diff --git a/assets/orca-docx/cover.jpg b/assets/orca-docx/cover.jpg deleted file mode 100644 index 5bf17d2..0000000 Binary files a/assets/orca-docx/cover.jpg and /dev/null differ diff --git a/assets/orca-godot/cover.jpg b/assets/orca-godot/cover.jpg deleted file mode 100644 index 16d3cfe..0000000 Binary files a/assets/orca-godot/cover.jpg and /dev/null differ diff --git a/assets/orca-latex/cover.jpg b/assets/orca-latex/cover.jpg deleted file mode 100644 index eebf1a8..0000000 Binary files a/assets/orca-latex/cover.jpg and /dev/null differ diff --git a/assets/orca-nix/cover.jpg b/assets/orca-nix/cover.jpg deleted file mode 100644 index 90d9ef5..0000000 Binary files a/assets/orca-nix/cover.jpg and /dev/null differ diff --git a/assets/orca-runner/cover.png b/assets/orca-runner/cover.png deleted file mode 100644 index d6dd0b6..0000000 Binary files a/assets/orca-runner/cover.png and /dev/null differ diff --git a/assets/orca-runner/orca-run-cover.png b/assets/orca-runner/orca-run-cover.png deleted file mode 100644 index b539c8a..0000000 Binary files a/assets/orca-runner/orca-run-cover.png and /dev/null differ diff --git a/orca-catalog.json b/orca-catalog.json index e0708f2..2090826 100644 --- a/orca-catalog.json +++ b/orca-catalog.json @@ -5,578 +5,143 @@ "owner": "stablyai", "plugins": [ { - "id": "stablyai.orca-midnight-theme", + "id": "lindoo.drawio", "source": { "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/midnight-theme" + "url": "https://github.com/lindoo67/orca-plugins.git", + "ref": "feat/drawio-plugin", + "path": "plugins/drawio" }, - "description": "A quiet dark theme tuned for long coding sessions.", + "description": "Offline draw.io diagram editing in Orca, with multi-page XML, theme support and document synchronization.", "categories": [ - "themes", - "official" + "diagrams", + "editors" ], "releases": [ { - "version": "2.1.1", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "03e4f745d2c68e81f341eb161b12f6fd4f7c7c7876f0106222f25a22c0a041e2", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Orca Midnight", - "contributes": [ - { - "kind": "themes", - "name": "Orca Midnight" - } - ], - "images": { - "cover": { - "path": "plugins/midnight-theme/images/cover.png", - "alt": "A crescent moon and stars over a deep blue-grey night sky, with the word Midnight and the theme palette", - "sha256": "8fec31d4f6f3a77a643f70391914e4d310add2571786b3110951c7d0efb3f671", - "width": 1600, - "height": 1000 - }, - "screenshots": [ - { - "path": "plugins/midnight-theme/images/editor.png", - "alt": "Orca Midnight on the editor and terminal", - "sha256": "52e5f60d2101d3ad627145d71796d6df9cba0927d147a72bff7ae6c81c7da229", - "width": 1600, - "height": 1000 - }, - { - "path": "plugins/midnight-theme/images/settings.png", - "alt": "Orca Midnight selected in Appearance settings", - "sha256": "91fea1694d407b6ccfc6473f68ccfb0a895b7be23cd663c9a2ba8d1d4d934aa7", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-nord-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/nord-theme" - }, - "description": "A cool, low-contrast application theme inspired by arctic colors.", - "categories": [ - "themes", - "official" - ], - "releases": [ - { - "version": "2.1.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "d5e5a4c8b780381a810c9d739bb65f452bd435ad542fbca0511979643b73b669", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Nord for Orca", - "contributes": [ - { - "kind": "themes", - "name": "Nord" - } - ], - "images": { - "cover": { - "path": "plugins/nord-theme/images/cover.png", - "alt": "The Nord theme on an editor with a file tree and a TypeScript file", - "sha256": "39d136fcc481191250faedf379f9d5081fee354dfd40525d90b0ff3695a6b774", - "width": 1600, - "height": 1000 - }, - "screenshots": [ - { - "path": "plugins/nord-theme/images/editor.png", - "alt": "Nord on the editor and terminal", - "sha256": "2daaec134aff9d8a30ca1e99664db3ebc61995438abceb9404b4fba79b529225", - "width": 1600, - "height": 1000 - }, - { - "path": "plugins/nord-theme/images/settings.png", - "alt": "Nord selected in Appearance settings", - "sha256": "314f09e5e0b69249efe8028c7186c00b4ee4d0ff52481fea18acfa722025ee63", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-oled-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/oled-theme" - }, - "description": "A true-black dark theme and terminal theme for OLED displays.", - "categories": [ - "themes", - "official" - ], - "releases": [ - { - "version": "1.1.1", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "0031f20cb30b60b2368ce605c7bfbba6911642f6b323aa395793a66de5a47e44", - "execution": "data", + "version": "0.1.2", + "commit": "b7e3621040eaf476f85ca841184d2dc30898180f", + "contentHash": "6078404266947e82618c51a4f8ca989fdc6ee21037e7949b48ff95a622d36609", + "execution": "sandboxed-ui", "minimumOrca": "1.4.245", - "name": "Orca OLED", + "name": "Draw.io", "contributes": [ { - "kind": "themes", - "name": "Orca OLED" + "kind": "customEditors", + "name": "Draw.io", + "detail": ".drawio, .drawio.xml" }, { - "kind": "terminalThemes", - "name": "Orca OLED" + "kind": "newFiles", + "name": "新建 Draw.io 图表", + "detail": ".drawio" } ], - "images": { - "cover": { - "path": "plugins/oled-theme/images/cover.png", - "alt": "The word OLED in large white letters on true black, mirrored below in a fading reflection", - "sha256": "3eeb8dc5080745ab62803232f77d0ee79fc6ac1fc2c1bf97466910b2872c425f", - "width": 1600, - "height": 1000 - }, - "screenshots": [ - { - "path": "plugins/oled-theme/images/workspace.png", - "alt": "Orca OLED on the editor, terminal and file tree, separated by thin dark grey lines", - "sha256": "e08f69ec7b91faed608669fc50cbf1ad0b95266e0a513ef8bf6a381176d44975", - "width": 1600, - "height": 1000 - }, - { - "path": "plugins/oled-theme/images/palette.png", - "alt": "The Orca OLED terminal colours on true black", - "sha256": "7674c8f717f4cfc5dcd369b3217b4d4d7a86927e97a5e8d835af2769619a0d26", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-minimal-icons", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/minimal-icons" - }, - "description": "A compact monochrome icon theme for common source files.", - "categories": [ - "icons", - "official" - ], - "releases": [ - { - "version": "2.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "7b128923d45b550ae7024594f2947ed09ea0710aa15b5b479ae3abc15cc9576a", - "execution": "data", - "minimumOrca": "1.4.245", - "types": [ - "icon-theme" + "fileTypes": [ + "drawio" ], - "name": "Orca Minimal Icons", - "contributes": [ - { - "kind": "iconThemes", - "name": "Minimal" - } + "editorFileTypes": [ + "drawio" ], - "license": "MIT", "images": { - "cover": { - "path": "plugins/minimal-icons/images/cover.png", - "alt": "The Minimal icons in the file explorer and the eight icons the theme provides", - "sha256": "60565d006e8dd868eae755fa131195ec62cab829135ad0d8c866b3ec61f1b311", - "width": 1600, - "height": 1000 + "icon": { + "path": "plugins/drawio/images/icon.png", + "alt": "Draw.io", + "sha256": "94a492ab617e6def75ff6805a3292a561933ce5bde5b9094634046b062ea9f9f", + "width": 256, + "height": 256 }, - "screenshots": [ - { - "path": "plugins/minimal-icons/images/explorer.png", - "alt": "Minimal icons in the explorer and editor tabs", - "sha256": "a485fd14f4e0950e90a5ac31faf9793442723553679fc7acccc78d78f66d2fcf", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-solarized-terminal", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/solarized-terminal" - }, - "description": "Solarized Dark terminal colors packaged for Orca.", - "categories": [ - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "2.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "8c3a7bc5ec4ba51b9c9a04685e6ddf1c0f922de59e334080dea1d20df415b31c", - "execution": "data", - "minimumOrca": "1.4.245", - "types": [ - "terminal-theme" - ], - "name": "Solarized Terminal", - "contributes": [ - { - "kind": "terminalThemes", - "name": "Solarized Dark" - } - ], - "license": "MIT", - "images": { "cover": { - "path": "plugins/solarized-terminal/images/cover.png", - "alt": "A terminal in Solarized Dark colours with git, ls and test output, and its 16-colour palette", - "sha256": "5b73a5d6ff662f69a3a05a042089e4bc0918dc535726cb2d43352c16099f42b7", + "path": "plugins/drawio/images/cover.webp", + "alt": "深蓝色背景中的橙色与青色流程图卡片,标题 Draw.io by LinDoo", + "sha256": "06f5cfeb0207be8868b7078195c5ae9a9dae6708b85ea55078522218cbd7a843", "width": 1600, "height": 1000 }, "screenshots": [ { - "path": "plugins/solarized-terminal/images/terminal.png", - "alt": "A Solarized Dark terminal beside the worktree list", - "sha256": "a7526bf00fb227d86e22a43508372a016375d1072203384c1d2a8d46cf6cdb96", + "path": "plugins/drawio/images/editing-light.png", + "alt": "浅色主题的 draw.io 编辑器,展示中文离线图表工作流和常用图形库", + "sha256": "581d3a3ecf4cb4ce59fe10caf61462fdb30de90565367cc20bda56eca1c5ba2e", "width": 1600, "height": 1000 }, { - "path": "plugins/solarized-terminal/images/palette.png", - "alt": "The 16 Solarized Dark terminal colours", - "sha256": "be7b3869c14370b25cc3d1d5dcfd4cfb188709eb5ab67ba516dbaf2928e58255", + "path": "plugins/drawio/images/editing-dark.png", + "alt": "深色主题的 draw.io 编辑器,展示相同的流程图和页面设置", + "sha256": "e818284b200dd33808e86d3b6be24ae8e4377c723e4f26d93d811c59625eae38", "width": 1600, "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-multipass-recipes", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/multipass-recipes" - }, - "description": "A reviewed starter lifecycle for disposable Multipass workspaces.", - "categories": [ - "vm-recipes", - "official" - ], - "releases": [ - { - "version": "2.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "82a7e8cc8d3a5e6b80bc919858b6165dfef582db2e39f644780e7e6c10cd0efb", - "execution": "declarative", - "minimumOrca": "1.4.245", - "types": [ - "instructions" - ], - "name": "Multipass VM Recipes", - "contributes": [ - { - "kind": "vmRecipes", - "name": "recipes/ubuntu-lts.json" - } - ], - "license": "MIT", - "images": { - "cover": { - "path": "plugins/multipass-recipes/images/cover.png", - "alt": "The Multipass Ubuntu LTS recipe with its create, suspend, resume and destroy commands", - "sha256": "9490fccc49dba758e9e0fc190922919601c67688da8265cf9f5384dce5680cd1", - "width": 1600, - "height": 1000 - }, - "screenshots": [ + }, { - "path": "plugins/multipass-recipes/images/session.png", - "alt": "A terminal on a Multipass machine created by the recipe", - "sha256": "055488d690f6626493a2adb9deef8a0a687671300f43d4be4ffdbdb7f10edacf", + "path": "plugins/drawio/images/editing-selection.png", + "alt": "选中流程图节点后的 draw.io 编辑器,右侧展示节点样式选项", + "sha256": "4fd771496f56b9101e29068493a1befde1418850f04dc2ecf446caf9b54ebb58", "width": 1600, "height": 1000 } ] } - } - ] - }, - { - "id": "stablyai.orca-excalidraw", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/excalidraw" - }, - "description": "Draw and edit .excalidraw diagrams right in Orca's editor.", - "categories": [ - "editors", - "official" - ], - "releases": [ + }, { - "version": "1.1.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "475b1a58fddf5ef99778d11cd6127c5a224367d944db9cd00be31c0187eb2d9f", + "version": "0.1.1", + "commit": "f2e1a56fa4af754dcf5662e662eb5b2f2978ba28", + "contentHash": "ad22b8d218eb5b24a27106ca8aa54683cf077dad3d427fc7fac55828b90d4614", "execution": "sandboxed-ui", "minimumOrca": "1.4.245", - "name": "Excalidraw", + "name": "Draw.io", "contributes": [ { "kind": "customEditors", - "name": "Excalidraw", - "detail": ".excalidraw, .excalidraw.json" + "name": "Draw.io", + "detail": ".drawio, .drawio.xml" }, { "kind": "newFiles", - "name": "New Excalidraw drawing", - "detail": ".excalidraw" + "name": "新建 Draw.io 图表", + "detail": ".drawio" } ], "fileTypes": [ - "excalidraw" + "drawio" ], "editorFileTypes": [ - "excalidraw" + "drawio" ], "images": { - "cover": { - "path": "plugins/excalidraw/images/cover.png", - "alt": "A hand-drawn architecture sketch of a web app, API gateway, services and database open in the Excalidraw editor", - "sha256": "85cc3391dbb7569b271d8367da9232b9806e0ea0bf183112e34fb304260f327d", - "width": 1600, - "height": 1000 + "icon": { + "path": "plugins/drawio/images/icon.png", + "alt": "Draw.io", + "sha256": "94a492ab617e6def75ff6805a3292a561933ce5bde5b9094634046b062ea9f9f", + "width": 256, + "height": 256 }, - "screenshots": [ - { - "path": "plugins/excalidraw/images/editing.png", - "alt": "A box in the sketch selected, with Excalidraw's stroke, fill and font options beside it", - "sha256": "cf14ff5105a08d396765816de52be2eba5a0076af20e72f667a29ffcc2521152", - "width": 1600, - "height": 1000 - }, - { - "path": "plugins/excalidraw/images/dark.png", - "alt": "The same sketch in Excalidraw's dark theme", - "sha256": "5db71c99c28336bf8b942de84a8327bf81d23b33d4eff7788c6efed0ebc463c9", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-spreadsheet", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/spreadsheet" - }, - "description": "View Excel and OpenDocument spreadsheets in Orca's editor: every sheet, formulas and formatted values, even for very large files.", - "categories": [ - "editors", - "official" - ], - "releases": [ - { - "version": "1.1.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "94a6a17137eb2587a3c40bdef62bdba9138aa9c87770b90a2c5aa47543587b30", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Spreadsheet Viewer", - "contributes": [ - { - "kind": "customEditors", - "name": "Spreadsheet", - "detail": ".xlsx, .xlsm, .xlsb, .xls, .ods" - } - ], - "fileTypes": [ - "xlsx", - "xlsm", - "xlsb", - "xls", - "ods" - ], - "editorFileTypes": [ - "xlsx", - "xlsm", - "xlsb", - "xls", - "ods" - ], - "images": { "cover": { - "path": "plugins/spreadsheet/images/cover.png", - "alt": "A quarterly summary workbook in Spreadsheet Viewer: formatted currency, percentages and dates, a SUM formula above the grid, and sheet tabs", - "sha256": "bd07b5e0fa7c6646461713ad6fbfacf8b5dcd168f8414aaeaeb23b59f41552e8", + "path": "plugins/drawio/images/cover.webp", + "alt": "深蓝色背景中的橙色与青色流程图卡片,标题 Draw.io by LinDoo", + "sha256": "06f5cfeb0207be8868b7078195c5ae9a9dae6708b85ea55078522218cbd7a843", "width": 1600, "height": 1000 }, "screenshots": [ { - "path": "plugins/spreadsheet/images/sheets.png", - "alt": "A 50,000-row data sheet with a block of cells selected and its count, sum and average in the status bar", - "sha256": "aaf8bc8a37bc461e9949bb2bd8429e62e882c3d1577981569323b75a05e1000d", + "path": "plugins/drawio/images/editing-light.png", + "alt": "浅色主题的 draw.io 编辑器,展示中文离线图表工作流和常用图形库", + "sha256": "581d3a3ecf4cb4ce59fe10caf61462fdb30de90565367cc20bda56eca1c5ba2e", "width": 1600, "height": 1000 }, { - "path": "plugins/spreadsheet/images/dark.png", - "alt": "The same summary workbook in Orca's dark theme, with merged title and notes cells and a #DIV/0! error in red", - "sha256": "f4040e07aa6a41d31b865fabb1fbae1d2623e9e8c9b1c6222f3a1018c76bc3b0", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-gleam", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/gleam" - }, - "description": "Syntax highlighting, comment toggling and bracket matching for Gleam files.", - "categories": [ - "syntax", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "af266ae7e1ba6c2ab1c027c2fd9476591ae79110da3e1a08519a7fd08afb5092", - "execution": "data", - "minimumOrca": "1.4.245", - "types": [ - "syntax" - ], - "name": "Gleam Language", - "contributes": [ - { - "kind": "syntaxes", - "name": "Gleam", - "detail": ".gleam" - } - ], - "fileTypes": [ - "gleam" - ], - "license": "MIT AND Apache-2.0", - "images": { - "cover": { - "path": "plugins/gleam/images/cover.png", - "alt": "A Gleam router module with highlighted keywords, types and strings next to the Gleam star", - "sha256": "5406f139714066f3161c60a0ae6d8beffb4bc8d9311d969b9f9cbd9ba21a0ba5", - "width": 1600, - "height": 1000 - }, - "screenshots": [ - { - "path": "plugins/gleam/images/editor.png", - "alt": "A highlighted Gleam module in the editor with gleam test output in the terminal below", - "sha256": "1c2f298f70e0b74886ee09f1a131ddc52fffc08799687d6d20ff1cb08ea4e3f6", + "path": "plugins/drawio/images/editing-dark.png", + "alt": "深色主题的 draw.io 编辑器,展示相同的流程图和页面设置", + "sha256": "e818284b200dd33808e86d3b6be24ae8e4377c723e4f26d93d811c59625eae38", "width": 1600, "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-prisma", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/prisma" - }, - "description": "Prisma-aware highlighting for .prisma schema files: block keywords, model names, scalar types, attributes and built-in functions.", - "categories": [ - "syntax", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "7f209ad7efdd4af6d454c0aa731572af6dbb3b06e86fa66a706b5c74c9ff34fc", - "execution": "data", - "minimumOrca": "1.4.245", - "types": [ - "syntax" - ], - "name": "Prisma Syntax", - "contributes": [ - { - "kind": "syntaxes", - "name": "Prisma", - "detail": ".prisma" - } - ], - "fileTypes": [ - "prisma" - ], - "license": "MIT", - "images": { - "cover": { - "path": "plugins/prisma/images/cover.png", - "alt": "A Prisma model and enum with highlighted keywords, scalar types, attributes and functions", - "sha256": "c0c29963ab192ce02809731affec4768cc641eef8d3b0ccf97aa3f86b0f63529", - "width": 1600, - "height": 1000 - }, - "screenshots": [ + }, { - "path": "plugins/prisma/images/editor.png", - "alt": "A Prisma schema with generator, datasource and model blocks highlighted in the editor", - "sha256": "eb88face5c23510871dc8861870bc628540978aaf3d83b0fcd88d39058e6b469", + "path": "plugins/drawio/images/editing-selection.png", + "alt": "选中流程图节点后的 draw.io 编辑器,右侧展示节点样式选项", + "sha256": "4fd771496f56b9101e29068493a1befde1418850f04dc2ecf446caf9b54ebb58", "width": 1600, "height": 1000 } @@ -584,639 +149,6 @@ } } ] - }, - { - "id": "stablyai.orca-dusk-ember", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/dusk-ember" - }, - "description": "A violet dark theme and a warm light theme, with matching terminal colors.", - "categories": [ - "themes", - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "1.1.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "685d75485ea3df4227dfea89b658c12be723792b298147da24981df8154c98ae", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Dusk & Ember Themes", - "contributes": [ - { - "kind": "themes", - "name": "Dusk" - }, - { - "kind": "themes", - "name": "Ember" - }, - { - "kind": "terminalThemes", - "name": "Dusk" - }, - { - "kind": "terminalThemes", - "name": "Ember" - } - ], - "images": { - "cover": { - "path": "plugins/dusk-ember/images/cover.png", - "alt": "The violet Dusk theme and the warm, light Ember theme side by side on a Gleam file", - "sha256": "b2614cedfec38ec336874f49756845ab4a3266feeb13c598d7dcd6903a556ca6", - "width": 1600, - "height": 1000 - }, - "screenshots": [ - { - "path": "plugins/dusk-ember/images/dusk.png", - "alt": "The Dusk theme on the editor and file tree, with the Dusk terminal colors below", - "sha256": "34988d2389baca80cfa77fd79f1df673315544a03e4d0d224107d60da679e0dc", - "width": 1600, - "height": 1000 - }, - { - "path": "plugins/dusk-ember/images/ember.png", - "alt": "The Ember theme on the same file, with the Ember terminal colors below", - "sha256": "de8c8a2a7f411ab3c8622632b1a491b4af5e4f252091b3597f7d2240b2814fa7", - "width": 1600, - "height": 1000 - } - ] - } - } - ] - }, - { - "id": "stablyai.orca-github-light-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/github-light-theme" - }, - "description": "A crisp white application theme inspired by GitHub's default light palette, with matching terminal colors.", - "categories": [ - "themes", - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "1.0.2", - "commit": "e78a6df982abdc6e6803878e16fb31ecc6dc58ac", - "contentHash": "47a866fc54e4d6dc330b25581bde5b96ed63e99da541beae747475ae1f8e7027", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "GitHub Light for Orca", - "contributes": [ - { - "kind": "themes", - "name": "GitHub Light" - }, - { - "kind": "terminalThemes", - "name": "GitHub Light" - } - ], - "images": { - "cover": { - "path": "plugins/github-light-theme/images/cover.png", - "alt": "GitHub Light theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches", - "sha256": "877ebfa585c421372b9663304690757fc8ca36d2a426d9894c4db5453dc5650b", - "width": 1600, - "height": 1000 - } - } - }, - { - "version": "1.0.1", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "d52486e0dae3ebcde3f4b7fb94c1349bef3f65f659e21c3cd4306d2b8b9d331e", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "GitHub Light for Orca", - "contributes": [ - { - "kind": "themes", - "name": "GitHub Light" - }, - { - "kind": "terminalThemes", - "name": "GitHub Light" - } - ], - "images": { - "cover": { - "path": "plugins/github-light-theme/images/cover.png", - "alt": "GitHub Light theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches", - "sha256": "877ebfa585c421372b9663304690757fc8ca36d2a426d9894c4db5453dc5650b", - "width": 1600, - "height": 1000 - } - } - } - ] - }, - { - "id": "stablyai.orca-solarized-light-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/solarized-light-theme" - }, - "description": "A warm cream application theme based on Ethan Schoonover's Solarized Light palette, with matching terminal colors.", - "categories": [ - "themes", - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "1.0.1", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "30d189e002e03236cd0da15406e79b8089a6084d2bddba9f0a486623392c857c", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Solarized Light for Orca", - "contributes": [ - { - "kind": "themes", - "name": "Solarized Light" - }, - { - "kind": "terminalThemes", - "name": "Solarized Light" - } - ], - "images": { - "cover": { - "path": "plugins/solarized-light-theme/images/cover.png", - "alt": "Solarized Light theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches", - "sha256": "9cfd4347e7308e917b36b757bd795b6f0f1b958961a37d29a43a612832578ba9", - "width": 1600, - "height": 1000 - } - } - } - ] - }, - { - "id": "stablyai.orca-dracula-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/dracula-theme" - }, - "description": "A dark application theme with Dracula\u2019s vivid pink, purple, and green palette, plus matching terminal colors.", - "categories": [ - "themes", - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "b48dc1c0f7104efbfe2ca31fb6d5f4f902245891bded7102e13828db1afd6390", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Dracula for Orca", - "contributes": [ - { - "kind": "themes", - "name": "Dracula" - }, - { - "kind": "terminalThemes", - "name": "Dracula" - } - ], - "images": { - "cover": { - "path": "plugins/dracula-theme/images/cover.png", - "alt": "Dracula theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches", - "sha256": "b8d9657683f7cb16f09c6a932d569f893e37659ee3ef7b707155e50044916706", - "width": 1600, - "height": 1000 - } - } - } - ] - }, - { - "id": "stablyai.orca-gruvbox-theme", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/gruvbox-theme" - }, - "description": "Retro warm dark and light application themes, with matching Gruvbox terminal colors.", - "categories": [ - "themes", - "terminal-themes", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "0975f18c47569fec59365e28263462387a79b077a073f86a21a960550edc9250", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Gruvbox for Orca", - "contributes": [ - { - "kind": "themes", - "name": "Gruvbox Dark" - }, - { - "kind": "themes", - "name": "Gruvbox Light" - }, - { - "kind": "terminalThemes", - "name": "Gruvbox Dark" - }, - { - "kind": "terminalThemes", - "name": "Gruvbox Light" - } - ], - "images": { - "cover": { - "path": "plugins/gruvbox-theme/images/cover.png", - "alt": "Gruvbox theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches", - "sha256": "2a9e6630b2382cafc2f0b3250897097371bce604043a53b6463097775bf22398", - "width": 1600, - "height": 1000 - } - } - } - ] - }, - { - "id": "stablyai.orca-nix", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/nix" - }, - "description": "Syntax highlighting and editor configuration for Nix files.", - "categories": [ - "languages", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "71c16d87911ab56636140f5dfff4434c7397a08dbf4e870ab572b3ae93e8fbc9", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Nix Syntax", - "contributes": [ - { - "kind": "syntaxes", - "name": "Nix", - "detail": ".nix" - } - ], - "fileTypes": [ - "nix" - ], - "images": { - "cover": { - "path": "assets/orca-nix/cover.jpg", - "alt": "Illustration of Nix configuration with syntax highlighting and a snowflake emblem", - "sha256": "21d13deaa12d594d70e9d2158a2105d593451d4a1716d7ad3a6f68fdfb95a78e", - "width": 1586, - "height": 992 - } - } - } - ] - }, - { - "id": "stablyai.orca-godot", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/godot" - }, - "description": "Syntax highlighting for GDScript, Godot resources and shaders.", - "categories": [ - "languages", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "b44792200f0b2c99a3b57be7cffd4e732f41d5ae16968840b9e3254b0d4e2705", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "Godot Syntax", - "contributes": [ - { - "kind": "syntaxes", - "name": "GDScript", - "detail": ".gd" - }, - { - "kind": "syntaxes", - "name": "Godot Resource", - "detail": ".tscn, .tres, .escn, .godot, .import, .remap, .gdextension" - }, - { - "kind": "syntaxes", - "name": "Godot Shader", - "detail": ".gdshader, .gdshaderinc" - } - ], - "fileTypes": [ - "gd", - "tscn", - "tres", - "escn", - "godot", - "import", - "remap", - "gdextension", - "gdshader", - "gdshaderinc" - ], - "images": { - "cover": { - "path": "assets/orca-godot/cover.jpg", - "alt": "Illustration of GDScript syntax highlighting and a blue robot emblem", - "sha256": "fb129868e1098a8a1f485705c40bea727eabe544ddbabff2b136b297f030beed", - "width": 1586, - "height": 992 - } - } - } - ] - }, - { - "id": "stablyai.orca-latex", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/latex" - }, - "description": "Syntax highlighting for LaTeX documents and packages.", - "categories": [ - "languages", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "07590d2c7bdc8c6c9299123106b9e0525656a411", - "contentHash": "864a1e097f5056ea75ff910a2e9d4887e103ab73ba6dfacd5fe17bb62013cae8", - "execution": "data", - "minimumOrca": "1.4.245", - "name": "LaTeX Syntax", - "contributes": [ - { - "kind": "syntaxes", - "name": "LaTeX", - "detail": ".tex, .ltx, .sty" - }, - { - "kind": "syntaxes", - "name": "TeX grammar dependency" - } - ], - "fileTypes": [ - "tex", - "ltx", - "sty" - ], - "images": { - "cover": { - "path": "assets/orca-latex/cover.jpg", - "alt": "Illustration of LaTeX syntax highlighting and a TeX emblem", - "sha256": "109d05e1d8c95db333b157b6f04d7f72854246cf2a2fcf48ff8b9bf179db6140", - "width": 1586, - "height": 992 - } - } - } - ] - }, - { - "id": "stablyai.orca-docx", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/docx" - }, - "description": "Preview Word (.docx) documents as read-only pages in Orca, with headers, footers, images and zoom controls.", - "categories": [ - "editors", - "official" - ], - "releases": [ - { - "version": "1.0.0", - "commit": "819a8c4070bb86370d616a7ca976015146820c24", - "contentHash": "36e8b84bc0c32754f40f98b9f1260f9a21cbab03f46db1a0da44818de94e2fb3", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Word Document Viewer", - "contributes": [ - { - "kind": "customEditors", - "name": "Word Preview", - "detail": ".docx" - } - ], - "fileTypes": [ - "docx" - ], - "editorFileTypes": [ - "docx" - ], - "images": { - "cover": { - "path": "assets/orca-docx/cover.jpg", - "alt": "Illustration of a document preview and blue document icon", - "sha256": "6c183bc8a56414e8bda11f9e3ea1393979165077776dfd3a279a00f80ffb50a1", - "width": 1586, - "height": 992 - } - } - } - ] - }, - { - "id": "stablyai.orca-runner", - "source": { - "kind": "git", - "url": "https://github.com/stablyai/orca-plugins.git", - "ref": "main", - "path": "plugins/orca-runner" - }, - "description": "An offline endless runner game in Orca's sidebar, starring a little black-and-white orca.", - "categories": [ - "games", - "official" - ], - "releases": [ - { - "version": "1.2.3", - "commit": "b9ab2b3916901be2fb1dcccb2392b2cdb231077d", - "contentHash": "965bb5692c7b7e5bd78124bcc13fa331f0af4d7df1b1c0536526e4285aa31318", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Run", - "contributes": [ - { - "kind": "panels", - "name": "Orca Run" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/orca-run-cover.png", - "alt": "Orca Run pixel art: a black-and-white orca leaps over an iceberg on an icy ocean, framed beneath the Orca Run title on a starry sky.", - "sha256": "4068b51ad31f96c5e0136d6926fd2ba60b93b81223663d707279b7514d3fac8c", - "width": 1600, - "height": 1000 - } - } - }, - { - "version": "1.2.2", - "commit": "d0a08a741a2a802d2f7502d64aa3957e4433562e", - "contentHash": "7794a88766d46dba0b27056fa9e90b59bb2c2b6a49a0c9e2443f1b867ca95ff9", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Run", - "contributes": [ - { - "kind": "panels", - "name": "Orca Run" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/orca-run-cover.png", - "alt": "Orca Run pixel art: a black-and-white orca leaps over an iceberg on an icy ocean, framed beneath the Orca Run title on a starry sky.", - "sha256": "4068b51ad31f96c5e0136d6926fd2ba60b93b81223663d707279b7514d3fac8c", - "width": 1600, - "height": 1000 - } - } - }, - { - "version": "1.2.1", - "commit": "f1aa4eb8a4cabeb3724ddd43fd31e00d1b68eb38", - "contentHash": "a1b7e6976d174ea8f4000b34ebbe2a565658dccff07791c5678017db0fc00613", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Run", - "contributes": [ - { - "kind": "panels", - "name": "Orca Run" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/orca-run-cover.png", - "alt": "Orca Run pixel art: a black-and-white orca leaps over an iceberg on an icy ocean, framed beneath the Orca Run title on a starry sky.", - "sha256": "4068b51ad31f96c5e0136d6926fd2ba60b93b81223663d707279b7514d3fac8c", - "width": 1600, - "height": 1000 - } - } - }, - { - "version": "1.2.0", - "commit": "1e66a15792014213e971ddfda64c4a34c02f7246", - "contentHash": "8b36fe3eb72eaea4b3817cbc7fe3514121d096077ceec7e647f3a8172a1106ae", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Run", - "contributes": [ - { - "kind": "panels", - "name": "Orca Run" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/orca-run-cover.png", - "alt": "Orca Run pixel art: a black-and-white orca leaps over an iceberg on an icy ocean, framed beneath the Orca Run title on a starry sky.", - "sha256": "4068b51ad31f96c5e0136d6926fd2ba60b93b81223663d707279b7514d3fac8c", - "width": 1600, - "height": 1000 - } - } - }, - { - "version": "1.1.0", - "commit": "1982c9937db84d3e5b6ebd89f87848887cf1288f", - "contentHash": "282db3c2adc92d3a481a27e5e13ce677666c2be60886088d66d6494ab68dfcd6", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Runner", - "contributes": [ - { - "kind": "panels", - "name": "Orca Runner" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/cover.png", - "alt": "Orca Runner pixel art gameplay with a black-and-white orca, snow-capped mountains, an ocean, and the press space to swim prompt.", - "sha256": "755f8980020b9c29d0495ff2c9c2fc2e90493864b0cb21c0684ebf6e2950424e", - "width": 800, - "height": 500 - } - } - }, - { - "version": "1.0.0", - "commit": "1b2df52ecaae0e216f701a94683a94d5084af193", - "contentHash": "08234b084cd0f1a02c01608b1e4488dd4daaa3f1ff584137f59878e3b6fbea06", - "execution": "sandboxed-ui", - "minimumOrca": "1.4.245", - "name": "Orca Runner", - "contributes": [ - { - "kind": "panels", - "name": "Orca Runner" - } - ], - "images": { - "cover": { - "path": "assets/orca-runner/cover.png", - "alt": "Orca Runner pixel art gameplay with a black-and-white orca, snow-capped mountains, an ocean, and the press space to swim prompt.", - "sha256": "755f8980020b9c29d0495ff2c9c2fc2e90493864b0cb21c0684ebf6e2950424e", - "width": 800, - "height": 500 - } - } - } - ] } ] } diff --git a/plugins/docx/LICENSE b/plugins/docx/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/docx/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/docx/README.md b/plugins/docx/README.md deleted file mode 100644 index a6991a6..0000000 --- a/plugins/docx/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Word Document Viewer - -Open `.docx` files as read-only pages in Orca's editor. The preview shows page layout, tables, -headers, footers, footnotes, images and embedded fonts. Select and copy text as usual. Zoom with -the footer controls or Ctrl+wheel / trackpad pinch, and use **Fit** to fit the page to the pane. -The controls follow Orca's light or dark theme; document pages keep their original colours. - -Orca supplies the document bytes through its custom-editor API for local, SSH and paired-host -files, and sends a new version when the file changes outside the editor. The viewer keeps the -current zoom and scroll position on reload. It never edits or writes back to the document. -Requires Orca 1.4.245 or later. - -Bookmark links scroll to their target in the document. Clicking an HTTP or HTTPS link selects its -address in a copy field below the pages. Orca's current plugin API does not offer opening URLs, -so copy the address to open it in a browser. Other link schemes are disabled. - -## Limits - -- `.docx` only; legacy `.doc`, password-encrypted documents and ZIP64 archives are unsupported. -- Files are limited to 50 MiB, 2,000 archive entries, 256 MiB of inflated content, and 32 MiB per - XML part. Actual inflated sizes are checked before parsing, including XML disguised as media. -- Complex Word layout may differ from Microsoft Word. Tracked changes, comments and embedded - HTML (`altChunk`) are not rendered. There is no editing, search or saved zoom between sessions. -- Documents cannot run macros or scripts, load network resources, or style Orca. Rendering runs - in Orca's sandboxed editor frame; document styles are isolated from the controls in a shadow root. - -## Credits and licence - -The archive guard, rendering options and default page layout are adapted from -[Kazuki Hanai's DOCX preview PR](https://github.com/stablyai/orca/pull/35061), addressing -[issue #35060](https://github.com/stablyai/orca/issues/35060). The original commit credits Kazuki -Hanai (`@kazuki-hanai`) and co-author Claude Opus 5.5. This plugin replaces the native viewer -integration with Orca's sandboxed custom-editor API. - -MIT. Bundled libraries include [docx-preview](https://github.com/VolodymyrBaydalka/docxjs) -(Apache-2.0), JSZip (MIT), fflate (MIT), and their dependencies; see -[THIRD_PARTY_NOTICES.txt](THIRD_PARTY_NOTICES.txt). Build instructions and tests are in -[build/README.md](build/README.md). diff --git a/plugins/docx/THIRD_PARTY_NOTICES.txt b/plugins/docx/THIRD_PARTY_NOTICES.txt deleted file mode 100644 index 3db8cd2..0000000 --- a/plugins/docx/THIRD_PARTY_NOTICES.txt +++ /dev/null @@ -1,991 +0,0 @@ -The archive inspection guard, rendering options, and default page layout are adapted from -stablyai/orca pull request #35061, "feat(editor): preview Word (.docx) documents": -https://github.com/stablyai/orca/pull/35061 -Commit: ba58f712a5ca51073df93397b7520f8c3fa12bca -Original author: Kazuki Hanai (@kazuki-hanai) -Original commit co-author: Claude Opus 5.5 -Linked issue: https://github.com/stablyai/orca/issues/35060 - -The implementation is adapted for Orca's sandboxed custom-editor API; it does not copy -Orca's native file-reading, IPC, host-frame navigation or React viewer integration. - -Upstream license: - -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Word Document Viewer's editor/index.html bundles the following software. - -docx-preview@0.4.1 (Apache-2.0) - - -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) 2016-2023 Volodymyr Baydalka - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -============================================================================== - -fflate@0.8.3 (MIT) -https://101arrowz.github.io/fflate - -MIT License - -Copyright (c) 2026 Arjun Barrett - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -============================================================================== - -immediate@3.0.6 (MIT) - - -Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, Domenic Denicola, Brian Cavalier - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -============================================================================== - -jszip@3.10.2 ((MIT OR GPL-3.0-or-later)) - - -JSZip is dual licensed. At your choice you may use it under the MIT license *or* the GPLv3 -license. - -The MIT License -=============== - -Copyright (c) 2009-2016 Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -GPL version 3 -============= - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - -============================================================================== - -lie@3.3.0 (MIT) - - -#Copyright (c) 2014-2018 Calvin Metcalf, Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.** - -============================================================================== - -pako@1.0.11 ((MIT AND Zlib)) -https://github.com/nodeca/pako - -(The MIT License) - -Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/plugins/docx/build/.gitignore b/plugins/docx/build/.gitignore deleted file mode 100644 index c2658d7..0000000 --- a/plugins/docx/build/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/plugins/docx/build/README.md b/plugins/docx/build/README.md deleted file mode 100644 index 6e80115..0000000 --- a/plugins/docx/build/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Building Word Document Viewer - -`../editor/index.html` is generated from the source here. Orca loads it in a sandboxed frame -with inline scripts/styles and data-URL images/fonts allowed; network, workers, and eval are -blocked. Everything is bundled into one file, with no runtime downloads. - -```sh -npm ci --ignore-scripts -npm run build -npm test -``` - -Browser tests use the Chromium headless shell expected by `playwright-core`; install it with -`npx playwright-core install chromium-headless-shell` if needed. The harness reproduces Orca's -opaque-origin `sandbox="allow-scripts"` frame, CSP, theme tokens, and document API. Tests cover -page rendering, header/footer/table content, zoom/fit, bookmarks, link isolation, external -rewrites, stale document versions, invalid files, encrypted/ZIP64 archives, size lies and bombs. - -The build is deterministic. It refuses eval, `new Function`, and unescaped closing script/style -tags. It generates third-party notices from bundled packages and compares their licence text -against reviewed copies in `licenses/` before succeeding. Only bundled-package licences are kept. - -## Dependencies and CSP - -`docx-preview` is pinned to 0.4.1; npm's lockfile pins JSZip and every transitive dependency. -`fflate` is pinned to 0.8.3 (the fixed version for GHSA-px8p-9vwx-vf98; the affected `unzipSync` -API is not used here). `npm audit` should remain clean after updates. - -JSZip's prebundled browser distribution contains a legacy `new Function` string-callback -fallback. The build uses JSZip's original entry instead, replacing only that scheduler with a -small `MessageChannel` function-only shim. A second shim declares Node streams unavailable, -since this viewer accepts only ArrayBuffers. No package files are patched. - -## Rendering boundary - -The renderer settings and archive inspector originate in -[stablyai/orca#35061](https://github.com/stablyai/orca/pull/35061) at -`ba58f712a5ca51073df93397b7520f8c3fa12bca`; see `UPSTREAM_NOTICE.txt` for authorship and the MIT -notice included in the generated notices. - -The plugin API already reads binary documents locally and remotely, so no native IPC, host -changes or broad capabilities are needed. The viewer only calls `orca.document.onDidChange`. -Orca handles saving and app shortcuts; the viewer sends no edits. - -Unlike the native PR, the sandbox cannot create workers or access a script-free nested frame -with `allow-same-origin`. The archive guard instead yields between bounded inflate chunks and -cancels superseded versions. Rendering keeps all document CSS in a shadow root. Only parsed -`@font-face` rules are promoted into a separate outer stylesheet because Chromium ignores font -faces defined inside shadow roots. Active elements and event handlers are removed, HTTP(S) -links become copyable addresses, and bookmark links are handled within the preview. The host -CSP remains the network and script-policy boundary. - -| File | Purpose | -| --- | --- | -| `src/editor.js`, `src/editor.css` | Frame API, reload/version state, scrolling, zoom, controls | -| `src/render-document.js` | Renderer options, document/style isolation, fonts and link sanitization | -| `src/archive-budget.js` | Entry/byte limits with actual bounded inflation before rendering | -| `src/document-message.js` | Versioned byte-document validation and the input size cap | -| `src/set-immediate.js`, `src/no-node-stream.js` | CSP-compatible browser shims for JSZip | -| `test/harness.mjs`, `test/fixture.mjs` | Orca-like sandbox and synthetic Word documents | diff --git a/plugins/docx/build/UPSTREAM_NOTICE.txt b/plugins/docx/build/UPSTREAM_NOTICE.txt deleted file mode 100644 index e61b6f2..0000000 --- a/plugins/docx/build/UPSTREAM_NOTICE.txt +++ /dev/null @@ -1,34 +0,0 @@ -The archive inspection guard, rendering options, and default page layout are adapted from -stablyai/orca pull request #35061, "feat(editor): preview Word (.docx) documents": -https://github.com/stablyai/orca/pull/35061 -Commit: ba58f712a5ca51073df93397b7520f8c3fa12bca -Original author: Kazuki Hanai (@kazuki-hanai) -Original commit co-author: Claude Opus 5.5 -Linked issue: https://github.com/stablyai/orca/issues/35060 - -The implementation is adapted for Orca's sandboxed custom-editor API; it does not copy -Orca's native file-reading, IPC, host-frame navigation or React viewer integration. - -Upstream license: - -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/docx/build/build.mjs b/plugins/docx/build/build.mjs deleted file mode 100644 index dd44b67..0000000 --- a/plugins/docx/build/build.mjs +++ /dev/null @@ -1,121 +0,0 @@ -// Builds ../editor/index.html: one self-contained file, because the editor frame's CSP allows only -// inline scripts and styles, with no network and no workers. Also writes ../THIRD_PARTY_NOTICES.txt -// from the packages that end up in the bundle. -// Usage: npm ci && node build.mjs -import { build, transform } from 'esbuild' -import { mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs' -import path from 'node:path' -import vm from 'node:vm' - -const HERE = import.meta.dirname -const PLUGIN = path.resolve(HERE, '..') -const OUT = path.join(PLUGIN, 'editor', 'index.html') -const NOTICES = path.join(PLUGIN, 'THIRD_PARTY_NOTICES.txt') - -const result = await build({ - entryPoints: [path.join(HERE, 'src', 'editor.js')], - bundle: true, - write: false, - format: 'iife', - platform: 'browser', - mainFields: ['module', 'main'], - target: 'chrome120', - minify: true, - legalComments: 'none', - metafile: true, - logLevel: 'warning', - absWorkingDir: HERE, - alias: { - setimmediate: path.join(HERE, 'src', 'set-immediate.js'), - stream: path.join(HERE, 'src', 'no-node-stream.js') - }, - // JSZip's browser field selects an already bundled file containing the legacy polyfill. - // Read its original entry so the CSP-compatible setImmediate alias above can take effect. - plugins: [{ - name: 'jszip-source', - setup(builder) { - builder.onResolve({ filter: /^jszip$/ }, () => ({ - path: path.join(HERE, 'node_modules', 'jszip', 'lib', 'index.js'), namespace: 'jszip-source' - })) - builder.onLoad({ filter: /.*/, namespace: 'jszip-source' }, ({ path: file }) => ({ - contents: readFileSync(file, 'utf8'), loader: 'js', resolveDir: path.dirname(file) - })) - } - }] -}) -const css = ( - await transform(readFileSync(path.join(HERE, 'src', 'editor.css'), 'utf8'), { loader: 'css', minify: true }) -).code.trim() - -// Why: `\s*(.+?)\s*\x3C!-- payload-end -->/);if(!t)throw new Error("INVALID");let r=(e.match(/\x3C!-- payload-version:(\d+) -->/)?.[1]||"1")!=="1";try{let n=dMe(t[1],r),i=JSON.parse(n);if(!("encoded"in i)){if("type"in i&&i.type===uh.excalidraw)return n;throw new Error("FAILED")}return fMe(i)}catch(n){throw console.error(n),new Error("FAILED")}}throw new Error("INVALID")},dne=(e,t)=>{let[r,n,i,a]=mi(e),o=Ql(r,i)+t*2,s=Ql(n,a)+t*2;return[r,n,o,s]},wRe=(e,t,r)=>{let[,,n,i]=dne(e,t).map(a=>Math.trunc(a*r));return[n,i]},PVt=class{constructor(e){this.scoreFunction=e,Oe(this,"content",[])}sinkDown(e){let t=this.content[e];for(;e>0;){let r=(e+1>>1)-1,n=this.content[r];if(this.scoreFunction(t)0&&(this.content[0]=t,this.bubbleUp(0)),e}remove(e){if(this.content.length===0)return;let t=this.content.indexOf(e),r=this.content.pop();t{let r=e.fixedSegments?e.fixedSegments.slice():null;if(r){let n=[];e.points.map(o=>ne(e.x+o[0],e.y+o[1])).forEach((o,s,l)=>{if(s<2)return n.push(o);let u=Q8(o,l[s-1]),d=Q8(l[s-1],l[s-2]);if(io(u,d)){let h=r?.findIndex(p=>p.index===s-1)??-1,f=r?.findIndex(p=>p.index===s)??-1;f!==-1&&(r[f].start=ne(l[s-2][0]-e.x,l[s-2][1]-e.y)),h!==-1&&r.splice(h,1),n.splice(-1,1),r.forEach(p=>{p.index>s-1&&(p.index-=1)})}return n.push(o)});let i=[];n.forEach((o,s,l)=>{if(s<3)return i.push(o);if(di(l[s-2],l[s-1])f.index===s-2)??-1,d=r?.findIndex(f=>f.index===s-1)??-1;d!==-1&&r.splice(d,1),u!==-1&&r.splice(u,1),i.splice(-2,2),r.forEach(f=>{f.index>s-2&&(f.index-=2)});let h=P1(o,l[s-1]);return i.push(ne(h?o[0]:l[s-2][0],h?l[s-2][1]:o[1]))}i.push(o)});let a=r.filter(o=>o.index!==1&&o.index!==i.length-1);return a.length===0?Cb(mne(gne(pne(e,fne(e,t,i.map(o=>ne(o[0]-e.x,o[1]-e.y)),e.startBinding&&uT(e.startBinding.elementId,t),e.endBinding&&uT(e.endBinding.elementId,t)))??[])),a,null,null):(en.DEV&&is(yne(i),"Invalid elbow points with fixed segments"),Cb(i,a,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},BVt=(e,t,r)=>{let n=t.map(S=>S.index),i=(e.fixedSegments?.map(S=>S.index)??[]).findIndex(S=>!n.includes(S));if(i===-1||!e.fixedSegments?.[i])return{points:e.points};let a=e.fixedSegments[i].index,o=e.fixedSegments[i-1],s=e.fixedSegments[i+1],l=e.x+(o?o.end[0]:0),u=e.y+(o?o.end[1]:0),d=o?null:e.startBinding,h=s?null:e.endBinding,{startHeading:f,endHeading:p,startGlobalPoint:m,endGlobalPoint:g,hoveredStartElement:y,hoveredEndElement:v,...b}=fne({x:l,y:u,startBinding:d,endBinding:h,startArrowhead:null,endArrowhead:null,points:e.points},r,[ne(0,0),ne(e.x+(s?.start[0]??e.points[e.points.length-1][0])-l,e.y+(s?.start[1]??e.points[e.points.length-1][1])-u)],d&&uT(d.elementId,r),h&&uT(h.elementId,r),{isDragging:!1}),{points:x}=Cb(mne(gne(pne(e,{startHeading:f,endHeading:p,startGlobalPoint:m,endGlobalPoint:g,hoveredStartElement:y,hoveredEndElement:v,...b})??[])),t,null,null),E=[];if(o)for(let S=0;S{E.push(ne(e.x+(o?o.end[0]:0)+S[0],e.y+(o?o.end[1]:0)+S[1]))}),s)for(let S=s.index;SS.index>a?{...S,index:S.index-w+(x.length-1)}:S),C=E.flatMap((S,R)=>{let U=E[R-1],L=E[R+1];if(U&&L){let I=Q8(S,U),A=Q8(L,S);if(io(I,A))return T.forEach(P=>{P.index>R&&(P.index-=1)}),[];if(io(I,CIe(A)))return T.forEach(P=>{P.index>R&&(P.index+=1)}),[S,S]}return[S]});return Cb(C,T,!1,!1)},FVt=(e,t,r,n,i,a)=>{let o=t.map((w,T)=>e.fixedSegments==null||e.fixedSegments[T]===void 0||e.fixedSegments[T].index!==w.index||(w.start[0]!==e.fixedSegments[T].start[0]&&w.end[0]!==e.fixedSegments[T].end[0])!=(w.start[1]!==e.fixedSegments[T].start[1]&&w.end[1]!==e.fixedSegments[T].end[1])?T:null).filter(w=>w!==null).shift();if(o==null)return{points:e.points};let s=e.fixedSegments?.findIndex(w=>w.index===1)??-1,l=e.fixedSegments?.findIndex(w=>w.index===e.points.length-1)??-1,u=di(t[o].start,t[o].end),d=u({...w,start:ne(e.x+w.start[0],e.y+w.start[1]),end:ne(e.x+w.end[0],e.y+w.end[1])})),f=e.points.map((w,T)=>ne(e.x+w[0],e.y+w[1])),p=h[o].index-1,m=h[o].index,g=h[o].start,y=h[o].end,v=f[p-1]&&!Mp(f[p],f[p-1])?P1(f[p-1],f[p]):void 0,b=f[m+1]&&!Mp(f[m],f[m+1])?P1(f[m+1],f[m]):void 0;if(v!==void 0){let w=v?1:0;f[p-1][w]=g[w]}if(f[p]=g,f[m]=y,b!==void 0){let w=b?1:0;f[m+1][w]=y[w]}let x=h.findIndex(w=>w.index===p);if(x!==-1){let w=P1(h[x].end,h[x].start)?1:0;h[x].start[w]=g[w],h[x].end=g}let E=h.findIndex(w=>w.index===m+1);if(E!==-1){let w=P1(h[E].end,h[E].start)?1:0;h[E].end[w]=y[w],h[E].start=y}if(s===-1&&p===0){let w=i?B1(r):P1(f[1],f[0]);f.unshift(ne(w?g[0]:e.x+e.points[0][0],w?e.y+e.points[0][1]:g[1])),i&&f.unshift(ne(e.x+e.points[0][0],e.y+e.points[0][1]));for(let T of h)T.index+=i?2:1}if(l===-1&&m===e.points.length-1){let w=B1(n);f.push(ne(w?y[0]:e.x+e.points[e.points.length-1][0],w?e.y+e.points[e.points.length-1][1]:y[1])),a&&f.push(ne(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return Cb(f,h.map(w=>({...w,start:ne(w.start[0]-e.x,w.start[1]-e.y),end:ne(w.end[0]-e.x,w.end[1]-e.y)})),!1,!1)},zVt=(e,t,r,n,i,a,o,s,l)=>{let u=e.startIsSpecial??null,d=e.endIsSpecial??null,h=t.map((y,v)=>v===0||v===t.length-1?ne(e.x+y[0],e.y+y[1]):ne(e.x+e.points[v][0],e.y+e.points[v][1])),f=r.map(y=>({...y,start:ne(e.x+(y.start[0]-t[0][0]),e.y+(y.start[1]-t[0][1])),end:ne(e.x+(y.end[0]-t[0][0]),e.y+(y.end[1]-t[0][1]))})),p=[],m=2+(u?1:0),g=2+(d?1:0);for(;p.length+m1&&(w.index+=1)}}else if(p.unshift(ne(x?a[0]:y[0],x?y[1]:a[1])),u){u=!1;for(let E of f)E.index>1&&(E.index-=1)}p.unshift(a)}{let y=h[h.length-(d?3:2)],v=h[h.length-(d?4:3)],b=B1(i),x=P1(v,y);if(l&&b===x){let E=b?io(i,ro):io(i,js);p.push(ne(x?o[0]+(E?Oi:-Oi):v[0],x?v[1]:o[1]+(E?Oi:-Oi))),p.push(ne(b?o[0]+(E?Oi:-Oi):o[0],b?o[1]:o[1]+(E?Oi:-Oi))),d||(d=!0)}else p.push(ne(x?o[0]:y[0],x?y[1]:o[1])),d&&(d=!1)}return p.push(o),Cb(p,f.map(({index:y})=>({index:y,start:p[y-1],end:p[y]})).map(y=>({...y,start:ne(y.start[0]-a[0],y.start[1]-a[1]),end:ne(y.end[0]-a[0],y.end[1]-a[1])})),u,d)},oa=1e6,iB=(e,t,r,n)=>{if(e.points.length<2)return{points:r.points??e.points};(e.x<-oa||e.x>oa||e.y<-oa||e.y>oa||e.x+(r?.points?.[r?.points?.length-1]?.[0]??0)<-oa||e.x+(r?.points?.[r?.points?.length-1]?.[0]??0)>oa||e.y+(r?.points?.[r?.points?.length-1]?.[1]??0)<-oa||e.y+(r?.points?.[r?.points?.length-1]?.[1]??0)>oa||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)<-oa||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)>oa||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)<-oa||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)>oa)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:r}),e.x=Nn(e.x,-oa,oa),e.y=Nn(e.y,-oa,oa),r.points&&(r.points=r.points.map(([v,b])=>ne(Nn(v,-oa,oa),Nn(b,-oa,oa)))),en.PROD||(is(!r.points||r.points.length>=2,"Updated point array length must match the arrow point length, contain exactly the new start and end points or not be specified at all (i.e. you can't add new points between start and end manually to elbow arrows)"),is(!e.fixedSegments||e.fixedSegments.map(v=>v.start[0]===v.end[0]||v.start[1]===v.end[1]).every(Boolean),"Fixed segments must be either horizontal or vertical"),is(!r.fixedSegments||r.fixedSegments.map(v=>v.start[0]===v.end[0]||v.start[1]===v.end[1]).every(Boolean),"Updates to fixed segments must be either horizontal or vertical"),is(e.points.slice(1).map((v,b)=>v[0]===e.points[b][0]||v[1]===e.points[b][1]),"Elbow arrow segments must be either horizontal or vertical"));let i=r.points?r.points&&r.points.length===2?e.points.map((v,b)=>b===0?r.points[0]:b===e.points.length-1?r.points[1]:v):r.points.slice():e.points.slice(),a=typeof r.startBinding<"u"?r.startBinding:e.startBinding,o=typeof r.endBinding<"u"?r.endBinding:e.endBinding,s=a&&uT(a.elementId,t),l=o&&uT(o.elementId,t);if(t.size===0&&yne(i)||s?.id!==a?.elementId||l?.id!==o?.elementId)return Cb(i.map(v=>ne(e.x+v[0],e.y+v[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:u,endHeading:d,startGlobalPoint:h,endGlobalPoint:f,hoveredStartElement:p,hoveredEndElement:m,...g}=fne({x:e.x,y:e.y,startBinding:a,endBinding:o,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,s,l,n),y=r.fixedSegments??e.fixedSegments??[];return!r.points&&!r.fixedSegments&&!r.startBinding&&!r.endBinding?OVt(e,t):r.startBinding===e.startBinding&&r.endBinding===e.endBinding&&(r.points??[]).every((v,b)=>Mp(v,e.points[b]??ne(1/0,1/0)))?{}:y.length===0?Cb(mne(gne(pne(e,{startHeading:u,endHeading:d,startGlobalPoint:h,endGlobalPoint:f,hoveredStartElement:p,hoveredEndElement:m,...g})??[])),y,null,null):(e.fixedSegments?.length??0)>y.length?BVt(e,y,t):r.points?r.points&&r.fixedSegments?r:zVt(e,i,y,u,d,h,f,p,m):FVt(e,y,u,d,p,m)},fne=(e,t,r,n,i,a)=>{let o=qP(r[0],wl(e.x,e.y)),s=qP(r[r.length-1],wl(e.x,e.y)),l=n,u=i;if(a?.isDragging){let C=Array.from(t.values());l=X7e(o,t,C,a?.zoom)||n,u=X7e(s,t,C,a?.zoom)||i}let d=Y7e({...e,elbowed:!0,points:r},"start",e.startBinding?.fixedPoint,o,n,l,a?.isDragging),h=Y7e({...e,elbowed:!0,points:r},"end",e.endBinding?.fixedPoint,s,i,u,a?.isDragging),f=j7e(d,h,t,l,o),p=j7e(h,d,t,u,s),m=[d[0]-2,d[1]-2,d[0]+2,d[1]+2],g=[h[0]-2,h[1]-2,h[0]+2,h[1]+2],y=l?Up(l,ub(f,e.startArrowhead?la*6:la*2,1)):m,v=u?Up(u,ub(p,e.endArrowhead?la*6:la*2,1)):g,b=sT(d,u?Up(u,ub(p,Oi,Oi)):g)||sT(h,l?Up(l,ub(f,Oi,Oi)):m),x=ERe(b?[m,g]:[y,v]),E=VVt(b?m:y,b?g:v,x,b?ub(f,!l&&!u?0:Oi,0):ub(f,!l&&!u?0:Oi-(e.startArrowhead?la*6:la*2),Oi),b?ub(p,!l&&!u?0:Oi,0):ub(p,!l&&!u?0:Oi-(e.endArrowhead?la*6:la*2),Oi),b,l&&Up(l),u&&Up(u)),w=q7e(E[0],f,d),T=q7e(E[1],p,h);return{dynamicAABBs:E,startDonglePosition:w,startGlobalPoint:d,startHeading:f,endDonglePosition:T,endGlobalPoint:h,endHeading:p,commonBounds:x,hoveredStartElement:l,hoveredEndElement:u,boundsOverlap:b,startElementBounds:y,endElementBounds:v}},pne=(e,t)=>{let{dynamicAABBs:r,startDonglePosition:n,startGlobalPoint:i,startHeading:a,endDonglePosition:o,endGlobalPoint:s,endHeading:l,commonBounds:u,hoveredEndElement:d}=t,h=HVt(r,n||i,a,o||s,l,u),f=n&&NP(n,h),p=o&&NP(o,h),m=NP(s,h);m&&d&&(m.closed=!0);let g=NP(i,h);g&&e.startBinding&&(g.closed=!0);let y=f&&p&&(sT(f.pos,r[1])||sT(p.pos,r[0])),v=GVt(f||g,p||m,h,a||ro,l||ro,y?[]:r);if(v){let b=v.map(x=>[x.pos[0],x.pos[1]]);return f&&b.unshift(i),p&&b.push(s),b}return null},ub=(e,t,r)=>{switch(e){case pu:return[t,r,r,r];case ro:return[r,t,r,r];case js:return[r,r,t,r]}return[r,r,r,t]},GVt=(e,t,r,n,i,a)=>{let o=Gee(e.pos,t.pos),s=new PVt(l=>l.f);for(s.push(e);s.size()>0;){let l=s.pop();if(!l||l.closed)continue;if(l===t)return WVt(e,l);l.closed=!0;let u=YVt(l.addr,r);for(let d=0;d<4;d++){let h=u[d];if(!h||h.closed)continue;let f=N1(h.pos,l.pos,.5);if(RPt(...a.map(x=>sT(f,x))))continue;let p=jVt(d),m=l.parent?e5(br(l.pos,l.parent.pos)):n,g=CIe(m);if(io(g,p)||$7e(e.addr,h.addr)&&io(p,n)||$7e(t.addr,h.addr)&&io(p,i))continue;let y=m!==p,v=l.g+Gee(h.pos,l.pos)+(y?Math.pow(o,3):0),b=h.visited;if(!b||v{let r=t,n=[];for(;r.parent;)n.unshift(r),r=r.parent;return n.unshift(e),n},Gee=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),VVt=(e,t,r,n,i,a,o,s)=>{let l=o??e,u=s??t,[d,h,f,p]=n??[0,0,0,0],[m,g,y,v]=i??[0,0,0,0],b=[e[0]>t[2]?e[1]>t[3]||e[3]t[0]?e[0]-p:r[0]-p,e[1]>t[3]?e[0]>t[2]||e[2]t[1]?e[1]-d:r[1]-d,e[2]t[3]||e[3]t[2]||e[2]e[2]?t[1]>e[3]||t[3]e[0]?t[0]-v:r[0]-v,t[1]>e[3]?t[0]>e[2]||t[2]e[1]?t[1]-m:r[1]-m,t[2]e[3]||t[3]e[2]||t[2]E[2]-E[0]+1e-11&&b[3]-b[1]+x[3]-x[1]>E[3]-E[1]+1e-11){let[w,T]=[(x[0]+x[2])/2,(x[1]+x[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let C=b[2]+(x[0]-b[2])/2,S=x[3]+(b[1]-x[3])/2;return Ys(wl(e[2]-w,e[1]-T),wl(e[0]-w,e[3]-T))>0?[[b[0],b[1],C,b[3]],[C,x[1],x[2],x[3]]]:[[b[0],S,b[2],b[3]],[x[0],x[1],x[2],S]]}else if(e[2]0?[[b[0],b[1],b[2],S],[x[0],S,x[2],x[3]]]:[[b[0],b[1],C,b[3]],[C,x[1],x[2],x[3]]]}else if(e[0]>t[2]&&e[3]0?[[C,b[1],b[2],b[3]],[x[0],x[1],C,x[3]]]:[[b[0],b[1],b[2],S],[x[0],S,x[2],x[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let C=x[2]+(b[0]-x[2])/2,S=x[3]+(b[1]-x[3])/2;return Ys(wl(e[0]-w,e[1]-T),wl(e[2]-w,e[3]-T))>0?[[C,b[1],b[2],b[3]],[x[0],x[1],C,x[3]]]:[[b[0],S,b[2],b[3]],[x[0],x[1],x[2],S]]}}return[b,x]},HVt=(e,t,r,n,i,a)=>{let o=new Set,s=new Set;r===fu||r===ro?s.add(t[1]):o.add(t[0]),i===fu||i===ro?s.add(n[1]):o.add(n[0]),e.forEach(d=>{o.add(d[0]),o.add(d[2]),s.add(d[1]),s.add(d[3])}),o.add(a[0]),o.add(a[2]),s.add(a[1]),s.add(a[3]);let l=Array.from(s).sort((d,h)=>d-h),u=Array.from(o).sort((d,h)=>d-h);return{row:l.length,col:u.length,data:l.flatMap((d,h)=>u.map((f,p)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[p,h],pos:[f,d]})))}},q7e=(e,t,r)=>{switch(t){case pu:return ne(r[0],e[1]);case ro:return ne(e[2],r[1]);case js:return ne(r[0],e[3])}return ne(e[0],r[1])},qVt=(e,t,r,n)=>{if(n===ro)switch(r){case ro:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case pu:return e.pos[1]>t.pos[1]&&e.pos[0]t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case js:return e.pos[1]t.pos[0]?1:3;case fu:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(n===pu)switch(r){case ro:return e.pos[1]>t.pos[1]&&e.pos[0]=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case js:return e.pos[0]===t.pos[0]?4:2;case fu:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(n===js)switch(r){case ro:return e.pos[1]t.pos[0]?1:3}return 0},YVt=([e,t],r)=>[W8([e,t-1],r),W8([e+1,t],r),W8([e,t+1],r),W8([e-1,t],r)],W8=([e,t],r)=>e<0||e>=r.col||t<0||t>=r.row?null:r.data[t*r.col+e]??null,NP=(e,t)=>{for(let r=0;r[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],uT=(e,t)=>{let r=t.get(e);return r&&yf(r)?r:null},Cb=(e,t,r,n)=>{let i=e[0][0],a=e[0][1],o=e.map(s=>qP(s,no(br(e[0]),-1)));return(i<-oa||i>oa||a<-oa||a>oa||i+o[o.length-1][0]<-oa||a+o[o.length-1][0]>oa||i+o[o.length-1][1]<-oa||a+o[o.length-1][1]>oa)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:a,points:o,...t5(o)}),o=o.map(([s,l])=>ne(Nn(s,-1e6,1e6),Nn(l,-1e6,1e6))),{points:o,x:Nn(i,-1e6,1e6),y:Nn(a,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...t5(o),startIsSpecial:r,endIsSpecial:n}},mne=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1]){if(n===0||n===e.length-1)return!0;let i=e[n+1],a=Math.abs(r[1]-i[1])e.length>=4?e.filter((t,r)=>{if(r===0||r===e.length-1)return!0;let n=e[r-1];return di(n,t)>hne}):e,jVt=e=>{switch(e){case 0:return pu;case 1:return ro;case 2:return js}return fu},Y7e=(e,t,r,n,i,a,o)=>{if(o){if(a){let s=lT(e,a,t);return qWt(a,s)}return n}if(i){let s=Zee(r||[0,0],i);return Math.abs(BO(i,s)-la)>.01?lT(e,i,t):s}return n},j7e=(e,t,r,n,i)=>GWt(e,t,n,n&&Up(n,Array(4).fill(BO(n,e))),r,i),X7e=(e,t,r,n)=>vf(hf(e),r,t,n,!0,!0),$7e=(e,t)=>e[0]===t[0]&&e[1]===t[1],yne=(e,t=hne)=>e.slice(1).map((r,n)=>Math.abs(r[0]-e[n][0])Object.keys(Fa).includes(e)?Fa[e]:G1,XE=(e,t)=>{if(!t)return null;let r=t.focus||0;return ar(e)?$P(t)?{...t,focus:r,fixedPoint:qO(t.fixedPoint??[0,0])}:null:{...t,focus:r}},db=(e,t)=>{let r={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||fh(),fillStyle:e.fillStyle||xo.fillStyle,strokeWidth:e.strokeWidth||xo.strokeWidth,strokeStyle:e.strokeStyle??xo.strokeStyle,roughness:e.roughness??xo.roughness,opacity:e.opacity==null?xo.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||xo.strokeColor,backgroundColor:e.backgroundColor||xo.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:h5(e.type)?as.LEGACY:as.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(n=>({type:"arrow",id:n})):e.boundElements??[],updated:e.updated??gT(),link:e.link?fd(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(r.customData="customData"in t?t.customData:e.customData),{...e,...r,...Ine(r),...t}},KVt=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,r=e.fontFamily;if("font"in e){let[d,h]=e.font.split(" ");t=parseFloat(d),r=$Vt(h)}let n=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?DPt(e):_b(e.fontFamily));return e=db(e,{fontSize:t,fontFamily:r,text:n,textAlign:e.textAlign||hT,verticalAlign:e.verticalAlign||iU,containerId:e.containerId??null,originalText:e.originalText||n,autoResize:e.autoResize??!0,lineHeight:i}),!n&&!e.isDeleted&&(e={...e,originalText:n,isDeleted:!0},e=OU(e)),e;case"freedraw":return db(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return db(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:a=null,endArrowhead:o=null}=e,s=e.x,l=e.y,u=!Array.isArray(e.points)||e.points.length<2?[ne(0,0),ne(e.width,e.height)]:e.points;return(u[0][0]!==0||u[0][1]!==0)&&({points:u,x:s,y:l}=rr.getNormalizedPoints(e)),db(e,{type:e.type==="draw"?"line":e.type,startBinding:XE(e,e.startBinding),endBinding:XE(e,e.endBinding),lastCommittedPoint:null,startArrowhead:a,endArrowhead:o,points:u,x:s,y:l,...t5(u)});case"arrow":{let{startArrowhead:d=null,endArrowhead:h="arrow"}=e,f=e.x,p=e.y,m=!Array.isArray(e.points)||e.points.length<2?[ne(0,0),ne(e.width,e.height)]:e.points;(m[0][0]!==0||m[0][1]!==0)&&({points:m,x:f,y:p}=rr.getNormalizedPoints(e));let g={type:e.type,startBinding:XE(e,e.startBinding),endBinding:XE(e,e.endBinding),lastCommittedPoint:null,startArrowhead:d,endArrowhead:h,points:m,x:f,y:p,elbowed:e.elbowed,...t5(m)};return ar(e)?db(e,{...g,elbowed:!0,startBinding:XE(e,e.startBinding),endBinding:XE(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):db(e,g)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return db(e,{});case"magicframe":case"frame":return db(e,{name:e.name??null})}return null},ZVt=(e,t)=>{if(e.boundElements){let r=e.boundElements.slice(),n=new Set;e.boundElements=r.reduce((i,a)=>{let o=t.get(a.id);if(o&&!n.has(a.id)){if(n.add(a.id),o.isDeleted)return i;i.push(a),er(o)&&!o.containerId&&(o.containerId=e.id)}return i},[])}},QVt=(e,t)=>{let r=e.containerId?t.get(e.containerId):null;if(!r){e.containerId=null;return}if(!e.isDeleted&&r.boundElements&&!r.boundElements.find(n=>n.id===e.id)){let n=(r.boundElements||(r.boundElements=[])).slice();n.push({type:"text",id:e.id}),r.boundElements=n}},JVt=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},aB=(e,t,r)=>{let n=new Set,i=t?Hr(t):null,a=Cm((e||[]).reduce((s,l)=>{if(l.type!=="selection"&&!w5(l)){let u=KVt(l);if(u){let d=i?.get(l.id);d&&d.version>u.version&&(u=OU(u,d.version)),n.has(u.id)&&(u={...u,id:fh()}),n.add(u.id),s.push(u)}}return s},[]));if(!r?.repairBindings)return a;let o=Hr(a);for(let s of a)s.frameId&&JVt(s,o),er(s)&&s.containerId?QVt(s,o):s.boundElements&&ZVt(s,o),r.refreshDimensions&&er(s)&&Object.assign(s,$re(s,$s(s,o),o)),dn(s)&&(s.startBinding&&(!o.has(s.startBinding.elementId)||!An(s))&&(s.startBinding=null),s.endBinding&&(!o.has(s.endBinding.elementId)||!An(s))&&(s.endBinding=null));return a.map(s=>{if(ar(s)&&s.startBinding==null&&s.endBinding==null&&!yne(s.points))return{...s,...iB(s,o,{points:[ne(0,0),s.points[s.points.length-1]]}),index:s.index};if(ar(s)&&s.startBinding&&s.endBinding&&s.startBinding.elementId===s.endBinding.elementId&&s.points.length>1&&s.points.some(([l,u])=>Math.abs(l)>1e6||Math.abs(u)>1e6)){console.error("Fixing self-bound elbow arrow",s.id);let l=o.get(s.startBinding.elementId);return l?{...s,x:l.x+l.width/2,y:l.y-5,width:l.width,height:l.height,points:[ne(0,0),ne(0,-10),ne(l.width/2+5,-10),ne(l.width/2+5,l.height/2+5)]}:(console.error("Bound element not found",s.startBinding.elementId),s)}return s})},eHt=(e,t,r)=>{let n=t[e];return n!==void 0?n:r[e]},K7e={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??eHt("defaultSidebarDockedPreference",e,t)]},TRe=(e,t)=>{e=e||{};let r=Fp(),n={};for(let i of Object.keys(K7e))if(i in e){let[a,o]=K7e[i](e,r);n[a]=o}for(let[i,a]of Object.entries(r)){let o=e[i],s=t?t[i]:void 0;n[i]=o!==void 0?o:s!==void 0?s:a}return{...n,cursorButton:t?.cursorButton||"up",penDetected:t?.penDetected??(e.penMode?e.penDetected??!1:!1),activeTool:{...Bo(r,n.activeTool.type&&XVt[n.activeTool.type]?n.activeTool:{type:"selection"}),lastActiveTool:null,locked:n.activeTool.locked??!1},zoom:{value:Tm(rT(e.zoom)?e.zoom:e.zoom?.value??r.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:bf.name}:n.openSidebar,gridSize:JWt(rT(e.gridSize)?e.gridSize:oU),gridStep:_re(rT(e.gridStep)?e.gridStep:U8e),editingFrame:null}},b5=(e,t,r,n)=>({elements:aB(e?.elements,r,n),appState:TRe(e?.appState,t||null),files:e?.files||{}}),Z7e=e=>{let t=aB(zi(e.elements),null);return t.length?{...e,elements:t}:null},oB=(e=[],t)=>{let r=[];for(let n of e)if(Array.isArray(n)){let i=Z7e({status:t,elements:n,id:fh(),created:Date.now()});i&&r.push(i)}else{let i=n,a=Z7e({...i,id:i.id||fh(),status:i.status||t,created:i.created||Date.now()});a&&r.push(a)}return r},Ip=32,sa=12,xb=256,kRe=50,Xw="NOT_SPREADSHEET",tU="VALID_SPREADSHEET",V8=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},Wee=(e,t)=>e.slice(1).every(r=>V8(r[t])!==null),Q7e=e=>{let t=e[0].length;if(t>2)return{type:Xw,reason:"More than 2 columns"};if(t===1){if(!Wee(e,0))return{type:Xw,reason:"Value is not numeric"};let l=V8(e[0][0])===null,u=(l?e.slice(1):e).map(d=>V8(d[0]));return u.length<2?{type:Xw,reason:"Less than two rows"}:{type:tU,spreadsheet:{title:l?e[0][0]:null,labels:null,values:u}}}let r=Wee(e,0),n=Wee(e,1);if(!r&&!n)return{type:Xw,reason:"Value is not numeric"};let[i,a]=n?[0,1]:[1,0],o=V8(e[0][a])===null,s=o?e.slice(1):e;return s.length<2?{type:Xw,reason:"Less than 2 rows"}:{type:tU,spreadsheet:{title:o?e[0][a]:null,labels:s.map(l=>l[i]),values:s.map(l=>V8(l[a]))}}},tHt=e=>{let t=[];for(let r=0;r{let t=e.trim().split(` -`).map(i=>i.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(` -`).map(i=>i.trim().split(","))),t.length===0)return{type:Xw,reason:"No values"};let r=t[0].length;if(!t.every(i=>i.length===r))return{type:Xw,reason:"All rows don't have same number of columns"};let n=Q7e(t);if(n.type!==tU){let i=Q7e(tHt(t));if(i.type===tU)return i}return n},nO=ePt(J_t),pf={fillStyle:"hachure",fontFamily:G1,fontSize:bm,opacity:100,roughness:1,strokeColor:In.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:hd.MIDDLE,locked:!1},CRe=e=>{let t=(Ip+sa)*e.values.length+sa,r=xb+sa*2;return{chartWidth:t,chartHeight:r}},nHt=(e,t,r,n,i)=>e.labels?.map((a,o)=>pd({groupIds:[n],backgroundColor:i,...pf,text:a.length>8?`${a.slice(0,5)}...`:a,x:t+o*(Ip+sa)+sa*2,y:r+sa/2,width:Ip,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))||[],iHt=(e,t,r,n,i)=>{let a=pd({groupIds:[n],backgroundColor:i,...pf,x:t-sa,y:r-sa,text:"0",textAlign:"right"}),o=pd({groupIds:[n],backgroundColor:i,...pf,x:t-sa,y:r-xb-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,o]},aHt=(e,t,r,n,i)=>{let{chartWidth:a,chartHeight:o}=CRe(e),s=bb({backgroundColor:i,groupIds:[n],...pf,type:"line",x:t,y:r,width:a,points:[ne(0,0),ne(a,0)]}),l=bb({backgroundColor:i,groupIds:[n],...pf,type:"line",x:t,y:r,height:o,points:[ne(0,0),ne(0,-o)]}),u=bb({backgroundColor:i,groupIds:[n],...pf,type:"line",x:t,y:r-xb-sa,strokeStyle:"dotted",width:a,opacity:kRe,points:[ne(0,0),ne(a,0)]});return[s,l,u]},SRe=(e,t,r,n,i,a)=>{let{chartWidth:o,chartHeight:s}=CRe(e),l=e.title?pd({backgroundColor:i,groupIds:[n],...pf,text:e.title,x:t+o/2,y:r-xb-sa*2-bm,roundness:null,textAlign:"center"}):null,u=a?Hp({backgroundColor:i,groupIds:[n],...pf,type:"rectangle",x:t,y:r-s,width:o,height:s,strokeColor:In.black,fillStyle:"solid",opacity:6}):null;return[...u?[u]:[],...l?[l]:[],...nHt(e,t,r,n,i),...iHt(e,t,r,n,i),...aHt(e,t,r,n,i)]},oHt=(e,t,r)=>{let n=Math.max(...e.values),i=fh(),a=nO[Math.floor(Math.random()*nO.length)];return[...e.values.map((o,s)=>{let l=o/n*xb;return Hp({backgroundColor:a,groupIds:[i],...pf,type:"rectangle",x:t+s*(Ip+sa)+sa,y:r-l-sa,width:Ip,height:l})}),...SRe(e,t,r,i,a,en.DEV)]},sHt=(e,t,r)=>{let n=Math.max(...e.values),i=fh(),a=nO[Math.floor(Math.random()*nO.length)],o=0,s=[];for(let g of e.values){let y=o*(Ip+sa),v=-(g/n)*xb;s.push([y,v]),o++}let l=Math.max(...s.map(g=>g[0])),u=Math.max(...s.map(g=>g[1])),d=Math.min(...s.map(g=>g[0])),h=Math.min(...s.map(g=>g[1])),f=bb({backgroundColor:a,groupIds:[i],...pf,type:"line",x:t+sa+Ip/2,y:r-sa,height:u-h,width:l-d,strokeWidth:2,points:s}),p=e.values.map((g,y)=>{let v=y*(Ip+sa)+sa/2,b=-(g/n)*xb+sa/2;return Hp({backgroundColor:a,groupIds:[i],...pf,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+v+Ip/2,y:r+b-sa*2,width:sa,height:sa})}),m=e.values.map((g,y)=>{let v=y*(Ip+sa)+sa/2,b=g/n*xb+sa/2+sa;return bb({backgroundColor:a,groupIds:[i],...pf,type:"line",x:t+v+Ip/2+sa/2,y:r-b,height:b,strokeStyle:"dotted",opacity:kRe,points:[ne(0,0),ne(0,b)]})});return[...SRe(e,t,r,i,a,en.DEV),f,...m,...p]},ARe=(e,t,r,n)=>e==="line"?sHt(t,r,n):oHt(t,r,n),AQr="clipboard"in navigator&&"readText"in navigator.clipboard,sB="clipboard"in navigator&&"writeText"in navigator.clipboard,lB="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,lHt=e=>!!([uh.excalidraw,uh.excalidrawClipboard,uh.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),URe=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[n,i]of Object.entries(e)){if(typeof i!="string"){t=t||[],t.push(i);continue}try{if(r.clipboardData?.setData(n,i),r.clipboardData?.getData(n)!==i)throw new Error(`Failed to set "${n}" as clipboardData item`)}catch(a){throw new Error(a.message)}}if(t){let n=-1;for(let i of t){n++;try{if(r.clipboardData?.items.add(i),r.clipboardData?.files[n]!==i)throw new Error(`Failed to set file "${i.name}" as clipboardData item`)}catch(a){throw new Error(a.message)}}}return r},cHt=({elements:e,files:t})=>{let r=Hr(e),n=new Set(e.filter(s=>qr(s))),i=!1,a=e.reduce((s,l)=>(mh(l)&&(i=!0,t&&t[l.fileId]&&(s[l.fileId]=t[l.fileId])),s),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let o={type:uh.excalidrawClipboard,elements:e.map(s=>{if(yu(s,r)&&!n.has(yu(s,r))){let l=Bb(s);return kt(l,{frameId:null}),l}return s}),files:t?a:void 0};return JSON.stringify(o)},IRe=async(e,t,r)=>{await RT(cHt({elements:e,files:t}),r)},uHt=e=>{let t=rHt(e);return t.type===tU?{spreadsheet:t.spreadsheet}:null};dHt=e=>{let t=e.clipboardData?.getData(Mr.html);if(!t)return null;try{let r=new DOMParser().parseFromString(t,Mr.html),n=RRe(r.body);if(n.length)return{type:"mixedContent",value:n}}catch(r){console.error(`error in parseHTMLFromPaste: ${r.message}`)}return null},MRe=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(r){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${r.message}). Failling back to navigator.clipboard.read()`);let n=await navigator.clipboard?.readText();if(n)return{[Mr.text]:n}}}catch(n){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${n.message}). Failling back to navigator.clipboard.read()`);else{if(n.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${n.message}`),e;throw n}}throw r}for(let r of t)for(let n of r.types)if(Ute(aPt,n))try{if(n===Mr.text||n===Mr.html)e[n]=await(await r.getType(n)).text();else if(eMe(n)){let i=await r.getType(n),a=H8(i,n,void 0);e[n]=a}else throw new p7e(`Unsupported clipboard type: ${n}`)}catch(i){console.warn(i instanceof p7e?i.message:`Cannot retrieve ${n} from clipboardItem: ${i.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},hHt=async(e,t=!1)=>{try{let r=!t&&e&&dHt(e);return r?r.value.every(n=>n.type==="text")?{type:"text",value:e.clipboardData?.getData(Mr.text)||r.value.map(n=>n.value).join(` -`).trim()}:r:{type:"text",value:(e.clipboardData?.getData(Mr.text)||"").trim()}}catch{return{type:"text",value:""}}},vne=async(e,t=!1)=>{let r=await hHt(e,t);if(r.type==="mixedContent")return{mixedContent:r.value};try{let n=!t&&uHt(r.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(r.value),i=n.type===uh.excalidrawClipboardWithAPI;if(lHt(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:r.value}},LRe=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[Mr.png]:e})])}catch(t){if(yT(e))await navigator.clipboard.write([new window.ClipboardItem({[Mr.png]:await e})]);else throw t}},RT=async(e,t)=>{if(sB)try{await navigator.clipboard.writeText(e||"");return}catch(r){console.error(r)}try{if(t){if(t.clipboardData?.setData(Mr.text,e||""),t.clipboardData?.getData(Mr.text)!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(r){console.error(r)}if(!fHt(e))throw new Error("Error copying to clipboard.")},fHt=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",r=document.createElement("textarea");r.style.border="0",r.style.padding="0",r.style.margin="0",r.style.position="absolute",r.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;r.style.top=`${n}px`,r.style.fontSize="12pt",r.setAttribute("readonly",""),r.value=e,document.body.appendChild(r);let i=!1;try{r.select(),r.setSelectionRange(0,r.value.length),i=document.execCommand("copy")}catch(a){console.error(a)}return r.remove(),i},cB=({elements:e,appState:t,files:r,maxWidthOrHeight:n,getDimensions:i,exportPadding:a,exportingFrame:o})=>{let{elements:s,appState:l}=b5({elements:e,appState:t},null,null),{exportBackground:u,viewBackgroundColor:d}=l;return une(s,{...l,offsetTop:0,offsetLeft:0,width:0,height:0},r||{},{exportBackground:u,exportPadding:a,viewBackgroundColor:d,exportingFrame:o},(h,f)=>{let p=document.createElement("canvas");if(n){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let g=Math.max(h,f),y=n{let{elements:l,appState:u}=b5({elements:e,appState:t},null,null),d={...u,exportPadding:n};return nB(l,d,r,{exportingFrame:a,renderEmbeddables:i,skipInliningFonts:o,reuseImages:s})},pHt=e=>e.type==="diamond"?[ne(e.width/2,0),ne(e.width,e.height/2),ne(e.width/2,e.height),ne(0,e.height/2)]:[ne(0,0),ne(0+e.width,0),ne(0+e.width,e.height),ne(0,e.height)],mHt=e=>dn(e)||gf(e)?e.points:pHt(e),J7e=e=>{let t=e.reduce((r,[n,i])=>(r.minY=Math.min(r.minY,i),r.minX=Math.min(r.minX,n),r.maxX=Math.max(r.maxX,n),r.maxY=Math.max(r.maxY,i),r),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},DRe=e=>{let t=mHt(e),{cx:r,cy:n}=J7e(t),i=ne(r,n),a=t.map(d=>ht(d,i,e.angle)),{minX:o,minY:s,maxX:l,maxY:u}=J7e(a);return[o+e.x,s+e.y,l+e.x,u+e.y]},rte=(e,t,r=!1)=>{let n=DRe(e),i=t[0]<=n[0]&&t[2]>=n[2]&&t[1]<=n[1]&&t[3]>=n[3];return r?i?!0:n[0]<=t[0]&&n[2]>=t[2]&&n[1]<=t[1]&&n[3]>=t[3]:i},NRe=(e,t)=>{let r=DRe(e);return(RP(r[0],Ic(t[0],t[2]))||RP(t[0],Ic(r[0],r[2])))&&(RP(r[1],Ic(t[1],t[3]))||RP(t[1],Ic(r[1],r[3])))},_Re=({elements:e,bounds:t,type:r,errorMargin:n=0})=>{Dte(t)&&(t=Dp(t,Hr(e)));let i=[t[0]-n,t[1]-n,t[2]+n,t[3]+n],a=new Set;for(let o of e)if(!a.has(o.id)&&(r==="overlap"?NRe(o,i):r==="inside"?rte(o,i):rte(o,i,!0))){if(a.add(o.id),o.boundElements)for(let s of o.boundElements)a.add(s.id);er(o)&&o.containerId&&a.add(o.containerId),An(o)&&(o.startBinding&&a.add(o.startBinding.elementId),o.endBinding&&a.add(o.endBinding?.elementId))}return e.filter(o=>a.has(o.id))};yHt=1e-6;xne=(e,t,r)=>{let n=Hr(e);for(let i of t)if(i.frameId){let a=r.get(i.id),o=r.get(i.frameId);if(a){let s=n.get(a);s&&kt(s,{frameId:o??i.frameId},!1)}}};PRe=(e,t,r)=>hB(mB(e,t,r,!1)).filter(n=>!qr(n)&&!n.frameId||n.frameId===t.id),Ene=(e,t,r)=>mB([t],e,r).some(n=>n.id===t.id),MT=(e,t,r)=>{let[n,i,a,o]=un(t,r),[s,l,u,d]=mi(e);return n<=s&&i<=l&&a>=u&&o>=d},F1=(e,t,r)=>MT([e],t,r)||wne(e,t,r)||Ene(e,t,r),Tne=(e,t,r)=>{let[n,i,a,o]=un(t,r);return Y8e(ne(n,i),ne(e.x,e.y),ne(a,o))},ORe=e=>{let t=new Map;for(let r of e){let n=qr(r)?r.id:r.frameId;n&&!t.has(n)&&t.set(n,Yp(e,n))}return t},Yp=(e,t)=>{let r=[];for(let n of e.values())n.frameId===t&&r.push(n);return r},uB=e=>e.filter(t=>qr(t)),dB=e=>{let t=Hr(uB(e));return e.filter(r=>t.has(r.id)||!r.frameId||!t.has(r.frameId))},NU=(e,t,r,n)=>{let i=Yp(e,t.id),a=new Set(i),o=new Set([...PRe(e,t,n),...i.filter(f=>Ene(f,t,n))]),s=i.filter(f=>!o.has(f)),l=new Set(Array.from(o).flatMap(f=>f.groupIds));for(let f of s)if(!wne(f,t,n))f.groupIds.length===0&&a.delete(f);else if(f.groupIds.length>0)for(let p of f.groupIds)l.add(p);for(let f of s)if(f.groupIds.length>0){let p=!0;for(let m of f.groupIds)l.has(m)&&(p=!1);p&&a.delete(f)}let u=Array.from(o).filter(f=>f.groupIds.length===0);for(let f of u)a.add(f);let d=Array.from(o).filter(f=>f.groupIds.length>0),h=Fre(d,r);for(let[f,p]of Object.entries(h))if(p){let m=ya(e,f);if(MT(m,t,n))for(let g of m)a.add(g)}return[...a].filter(f=>!(er(f)&&f.containerId))},BRe=(e,t,r)=>bHt(hB(e,PRe(e,t,r)),t,r),bHt=(e,t,r)=>{let n=[],i=new Map;for(let a of e){let o=!1;if(a.groupIds.length>0){if(a.groupIds.some(s=>i.get(s)))o=!0;else{let s=new Set(a.groupIds.flatMap(l=>ya(r,l)));o=!MT(Array.from(s),t,r)}a.groupIds.forEach(s=>{i.set(s,o)})}o||n.push(a)}return n},yu=(e,t)=>e.frameId&&t.get(e.frameId)||null,FRe=(e,t)=>{let r=new Set,n=Hr(e);e=hB(e);for(let o of e)qr(o)&&o.id!==t.id&&r.add(o.id);let i=new Set,a=[];for(let o of e)if(!(qr(o)||o.frameId&&r.has(o.frameId)))if(o.groupIds.length){let s=o.groupIds.at(-1);if(!i.has(s)){i.add(s);let l=ya(e,s);if(l.some(u=>F1(u,t,n)))for(let u of l)a.push(u)}}else F1(o,t,n)&&a.push(o);return a},LT=(e,t,r,n)=>{let i=Hr(e),a=new Map;for(let u of e.values())u.frameId===r.id&&a.set(u.id,!0);let o=new Set(t.map(u=>u.id)),s=[],l=new Set;for(let u of t)qr(u)&&u.id!==r.id&&l.add(u.id);for(let u of hB(e,t)){if(qr(u)||u.frameId&&l.has(u.frameId)||u.frameId&&n.selectedElementIds[u.id]&&n.selectedElementIds[u.frameId])continue;a.has(u.id)||s.push(u);let d=hn(u,i);d&&!o.has(d.id)&&!a.has(d.id)&&s.push(d)}for(let u of s)kt(u,{frameId:r.id},!1);return e},_U=(e,t)=>{let r=new Map,n=new Map;for(let i of e)if(i.frameId){r.set(i.id,i);let a=n.get(i.frameId)||[];a.push(i);let o=hn(i,t);o&&(r.set(o.id,o),a.push(o)),n.set(i.frameId,a)}for(let[,i]of r)kt(i,{frameId:null},!1)},kne=(e,t)=>{let r=Yp(e,t.id);return _U(r,Hr(e)),e},Cne=(e,t,r,n)=>LT(kne(e,r),t,r,n.state).slice(),x5=(e,t,r)=>{let n=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(n);if(t.editingGroupId)for(let s of n)s.groupIds.length===0?i.add(s):s.groupIds.flatMap(l=>ya(e,l)).forEach(l=>i.add(l));let a=new Set,o=Hr(e);return i.forEach(s=>{s.frameId&&!qr(s)&&!PU(s,o,t)&&a.add(s)}),a.size>0&&_U(a,o),e},hB=(e,t)=>{let r=new Set,n=t||e;for(let o of n.values()){let s=o.groupIds[o.groupIds.length-1];s&&r.add(s)}let i=new Set;for(let o of r)ya(e,o).some(s=>qr(s))&&i.add(o);let a=[];for(let o of n.values())i.has(o.groupIds[o.groupIds.length-1])||a.push(o);return a},nte=(e,t,r)=>{let n=er(e)&&$s(e,t)||e;return n.frameId&&r.selectedElementIds[n.id]&&r.selectedElementIds[n.frameId]?yu(n,t):r.selectedElementIds[n.id]&&r.selectedElementsAreBeingDragged?r.frameToHighlight:yu(n,t)},PU=(e,t,r,n)=>{let i=n?.targetFrame??nte(e,t,r);if(!i)return!1;let a=er(e)&&$s(e,t)||e,o=l=>{n?.checkedGroups&&a.groupIds.forEach(u=>{n.checkedGroups?.set(u,l)})};if(!r.selectedElementIds[a.id]||!r.selectedElementsAreBeingDragged||r.selectedElementIds[a.id]&&r.selectedElementIds[i.id])return!0;if(a.groupIds.length===0)return F1(a,i,t);for(let l of a.groupIds)if(n?.checkedGroups?.has(l))return n.checkedGroups.get(l);let s=new Set(a.groupIds.filter(l=>n?.checkedGroups?!n.checkedGroups.has(l):!0).flatMap(l=>ya(t,l)));if(r.editingGroupId&&r.selectedElementsAreBeingDragged){let l=new Set(Un(t,r));if(r.frameToHighlight!==null)return!0;l.forEach(u=>{s.delete(u)})}for(let l of s)if(qr(l))return o(!1),!1;for(let l of s)if(F1(l,i,t))return o(!0),!0;return!1},n8e=(e,t,r,n,i)=>{if(!r.frameRendering||!r.frameRendering.clip)return!1;let a=wne(e,t,n)||Ene(e,t,n);if(a){for(let o of e.groupIds)i?.set(o,!0);return!0}if(!a&&e.groupIds.length>0&&!MT([e],t,n)){let o=!1;if(r.selectedElementsAreBeingDragged)o=PU(e,n,r,{targetFrame:t,checkedGroups:i});else{o=e.frameId===t.id;for(let s of e.groupIds)i?.set(s,o)}for(let s of e.groupIds)i?.set(s,o);return o}return!1},Sne=e=>e.name===null?Mte(e)?"Frame":"AI Frame":e.name,fB=(e,t)=>_Re({elements:e,bounds:t,type:"overlap"}).filter(r=>!r.frameId||r.frameId===t.id),Ane=e=>{let t=Hr(e);return e.length>1&&e.some(r=>r.frameId&&t.has(r.frameId))},pB=e=>{let t=new Set;return e.forEach(r=>{qr(r)&&t.add(r.id)}),e.filter(r=>!(r.frameId&&t.has(r.frameId)))},mB=(e,t,r,n=!0)=>{let[i,a,o,s]=un(t,r),l=e.filter(u=>{let[d,h,f,p]=Dp(u,r),m=yu(u,r);if(m){let[g,y,v,b]=Dp(m,r);d=Math.max(g,d),h=Math.max(y,h),f=Math.min(v,f),p=Math.min(b,p)}return u.locked===!1&&u.type!=="selection"&&!ga(u)&&i<=d&&a<=h&&o>=f&&s>=p});return l=n?pB(l):l,l=l.filter(u=>{let d=yu(u,r);return d?F1(u,d,r):!0}),l},zRe=(e,t,r,n)=>{let i=new Set(t.map(a=>a.id));return e.filter(a=>{let o=BU(a,r.width,r.height,r,n);return!i.has(a.id)&&o})},ss=(function(){let e=null,t=null,r=null,n=(i,a)=>(r!=null&&i===e&&a.selectedElementIds===t||(r=i.some(o=>a.selectedElementIds[o.id]),e=i,t=a.selectedElementIds),r);return n.clearCache=()=>{e=null,t=null,r=null},n})(),GRe=(e,t,r)=>{let n=Array.from(new Set(Un(e,t).map(i=>r(i))));return n.length===1?n[0]:null},Un=(e,t,r)=>{let n=new Set,i=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){i.push(a),n.add(a.id);continue}if(r?.includeBoundTextElement&&ga(a)&&t.selectedElementIds[a?.containerId]){i.push(a),n.add(a.id);continue}}if(r?.includeElementsInFrames){let a=[];return i.forEach(o=>{qr(o)&&Yp(e,o.id).forEach(s=>!n.has(s.id)&&a.push(s)),a.push(o)}),a}return i},Une=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:Un(e,t,{includeBoundTextElement:!0}),fi=(e,t)=>El(t.selectedElementIds,e)?t.selectedElementIds:e,i8e=e=>{let t=new Map,r=[];for(let n of e)n.isDeleted||(r.push(n),t.set(n.id,n));return{elementsMap:t,elements:r}},xHt=(0,V8e.default)(e=>{(en.DEV||en.MODE===mu.TEST||window?.DEBUG_FRACTIONAL_INDICES)&&ZO(e,{shouldThrow:en.DEV||en.MODE===mu.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),wHt=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],r="";for(let n of t)r+=`${n}:${e[n]?"1":"0"}`;return r},a8e=e=>typeof e=="string",ite=class GP{constructor(){Oe(this,"callbacks",new Set),Oe(this,"nonDeletedElements",[]),Oe(this,"nonDeletedElementsMap",hh(new Map)),Oe(this,"elements",[]),Oe(this,"nonDeletedFramesLikes",[]),Oe(this,"frames",[]),Oe(this,"elementsMap",hh(new Map)),Oe(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),Oe(this,"sceneNonce"),Oe(this,"insertElement",t=>{let r=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,r)}),Oe(this,"insertElements",t=>{if(!t.length)return;let r=t[0]?.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,r)}),Oe(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),Oe(this,"getElementsFromId",t=>{let r=this.getNonDeletedElementsMap(),n=r.get(t);return n?[n]:ya(r,t)})}static mapElementToScene(t,r){a8e(t)?this.sceneMapById.set(t,r):(this.sceneMapByElement.set(t,r),this.sceneMapById.set(t.id,r))}static getScene(t){return a8e(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let r=wHt(t),n=t?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===n&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let a=this.selectedElementsCache.cache.get(r);if(a)return a}else t?.elements==null&&this.selectedElementsCache.cache.clear();let i=Un(n,{selectedElementIds:t.selectedElementIds},t);return t?.elements==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(r,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let r=this.getElement(t);return r&&xB(r)?r:null}mapElements(t){let r=!1,n=this.elements.map(i=>{let a=t(i);return a!==i&&(r=!0),a});return r&&this.replaceAllElements(n),r}replaceAllElements(t){let r=t instanceof Array?t:Array.from(t.values()),n=[];xHt(r),this.elements=Cm(r),this.elementsMap.clear(),this.elements.forEach(a=>{qr(a)&&n.push(a),this.elementsMap.set(a.id,a),GP.mapElementToScene(a,this)});let i=i8e(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=n,this.nonDeletedFramesLikes=i8e(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Vp();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),GP.sceneMapById.forEach((t,r)=>{t===this&&GP.sceneMapById.delete(r)}),this.callbacks.clear()}insertElementAtIndex(t,r){if(!Number.isFinite(r)||r<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let n=[...this.elements.slice(0,r),t,...this.elements.slice(r)];Op(n,Hr([t])),this.replaceAllElements(n)}insertElementsAtIndex(t,r){if(!t.length)return;if(!Number.isFinite(r)||r<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let n=[...this.elements.slice(0,r),...t,...this.elements.slice(r)];Op(n,Hr(t)),this.replaceAllElements(n)}getElementIndex(t){return this.elements.findIndex(r=>r.id===t)}};Oe(ite,"sceneMapByElement",new WeakMap),Oe(ite,"sceneMapById",new Map);EHt=ite,vm=EHt,kt=(e,t,r=!0,n)=>{let i=!1,{points:a,fixedSegments:o,fileId:s,startBinding:l,endBinding:u}=t;if(ar(e)&&(Object.keys(t).length===0||typeof a<"u"||typeof o<"u"||typeof l<"u"||typeof u<"u")){let d=hh(vm.getScene(e)?.getNonDeletedElementsMap()??new Map);t={...t,angle:0,...iB({...e,x:t.x||e.x,y:t.y||e.y},d,{fixedSegments:o,points:a,startBinding:l,endBinding:u},{isDragging:n?.isDragging})}}else typeof a<"u"&&(t={...t5(a),...t});for(let d in t){let h=t[d];if(typeof h<"u"){if(e[d]===h&&(typeof h!="object"||h===null||d==="groupIds"||d==="scale"))continue;if(d==="scale"){let f=e[d],p=h;if(f[0]===p[0]&&f[1]===p[1])continue}else if(d==="points"){let f=e[d],p=h;if(f.length===p.length){let m=!1,g=f.length;for(;--g;){let y=f[g],v=p[g];if(y[0]!==v[0]||y[1]!==v[1]){m=!0;break}}if(!m)continue}}e[d]=h,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof s<"u"||typeof a<"u")&&za.delete(e),e.version++,e.versionNonce=Vp(),e.updated=gT(),r&&vm.getScene(e)?.triggerUpdate()),e},Tn=(e,t,r=!1)=>{let n=!1;for(let i in t){let a=t[i];if(typeof a<"u"){if(e[i]===a&&(typeof a!="object"||a===null))continue;n=!0}}return!n&&!r?e:{...e,...t,updated:gT(),version:e.version+1,versionNonce:Vp()}},OU=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Vp(),e.updated=gT(),e),w5=e=>dn(e)||gf(e)?e.points.length<2:e.width===0&&e.height===0,BU=(e,t,r,n,i)=>{let[a,o,s,l]=Dp(e,i),u=ca({clientX:n.offsetLeft,clientY:n.offsetTop},n),d=ca({clientX:n.offsetLeft+t,clientY:n.offsetTop+r},n);return u.x<=s&&u.y<=l&&d.x>=a&&d.y>=o},FU=(e,t,r,n,i,a)=>{let[o,s,l,u]=mi(e,i),d=ca({clientX:n.offsetLeft+(a?.left||0),clientY:n.offsetTop+(a?.top||0)},n),h=ca({clientX:n.offsetLeft+t-(a?.right||0),clientY:n.offsetTop+r-(a?.bottom||0)},n);return o>=d.x&&s>=d.y&&l<=h.x&&u<=h.y},o8e=(e,t,r)=>{let n=Math.abs(t),i=Math.abs(r);if(e==="line"||e==="arrow"||e==="freedraw"){let a=Math.round(Math.atan(i/n)/wb)*wb;a===0?r=0:a===Math.PI/2?t=0:r=n*Math.tan(a)*Math.sign(r)||r}else e!=="selection"&&(r=n*Math.sign(r));return{width:t,height:r}},gB=(e,t,r,n)=>{let i=r-e,a=n-t,o=Math.round(Math.atan(a/i)/wb)*wb;if(o===0)a=0;else if(o===Math.PI/2)i=0;else{let s=Math.tan(o),l=-1,u=t-s*e,d=-1/s,h=-1,f=n-d*r,p=(l*f-h*u)/(s*h-d*l),m=(u*d-f*s)/(s*h-d*l);i=p-e,a=m-t}return{width:i,height:a}},Ine=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let r=Math.abs(e.width);t.width=r,t.x=e.x-r}if(e.height<0){let r=Math.abs(e.height);t.height=r,t.y=e.y-r}return t},s8e={mouse:8,pen:16,touch:28},THt=16,WRe={e:!0,s:!0,n:!0,w:!0},l8e={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Hee={e:!0,s:!0,n:!0,w:!0},D1=(e,t,r,n,i,a,o)=>{let[s,l]=ht(ne(e+r/2,t+n/2),ne(i,a),o);return[s-r/2,l-n/2,r,n]},Rne=e=>!(e.viewport.isMobile||e.isTouchScreen&&(tPt||hte)),DT=e=>Rne(e)?WRe:{},yB=([e,t,r,n,i,a],o,s,l,u={},d=4,h=Eb)=>{let f=s8e[l],p=f/s.value,m=f/s.value,g=f/s.value,y=f/s.value,v=r-e,b=n-t,x=d/s.value,E=(f-h*2)/(2*s.value),w={nw:u.nw?void 0:D1(e-x-g+E,t-x-y+E,p,m,i,a,o),ne:u.ne?void 0:D1(r+x-E,t-x-y+E,p,m,i,a,o),sw:u.sw?void 0:D1(e-x-g+E,n+x-E,p,m,i,a,o),se:u.se?void 0:D1(r+x-E,n+x-E,p,m,i,a,o),rotation:u.rotation?void 0:D1(e+v/2-p/2,t-x-y+E-THt/s.value,p,m,i,a,o)},T=5*s8e.mouse/s.value;return Math.abs(v)>T&&(u.n||(w.n=D1(e+v/2-p/2,t-x-y+E,p,m,i,a,o)),u.s||(w.s=D1(e+v/2-p/2,n+x-E,p,m,i,a,o))),Math.abs(b)>T&&(u.w||(w.w=D1(e-x-g+E,t+b/2-m/2,p,m,i,a,o)),u.e||(w.e=D1(r+x-E,t+b/2-m/2,p,m,i,a,o))),w},Mne=(e,t,r,n="mouse",i=WRe)=>{if(e.locked||ar(e))return{};if(e.type==="freedraw"||dn(e)){if(e.points.length===2){let[,o]=e.points;o[0]===0||o[1]===0?i=Hee:o[0]>0&&o[1]<0?i=l8e:o[0]>0&&o[1]>0?i=Hee:o[0]<0&&o[1]>0?i=l8e:o[0]<0&&o[1]<0&&(i=Hee)}}else qr(e)&&(i={...i,rotation:!0});let a=dn(e)?Eb+8:hi(e)?0:Eb;return yB(un(e,r,!0),e.angle,t,n,i,a,hi(e)?0:void 0)},Lne=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let r=e[0];return ar(r)?!1:dn(r)?r.points.length>2:!0},ate=(e,t,r)=>t>=e[0]&&t<=e[0]+e[2]&&r>=e[1]&&r<=e[1]+e[3],kHt=(e,t,r,n,i,a,o,s)=>{if(!r.selectedElementIds[e.id])return!1;let{rotation:l,...u}=Mne(e,a,t,o,DT(s));if(l&&ate(l,n,i))return"rotation";let d=Object.keys(u).filter(h=>{let f=u[h];return f?ate(f,n,i):!1});if(d.length>0)return d[0];if(Rne(s)){let[h,f,p,m,g,y]=un(e,t);if(!(dn(e)&&e.points.length<=2)){let v=hi(e)?0:WP/a.value,b=WP/a.value,x=VRe(ne(h-v,f-v),ne(p+v,m+v),ne(g,y),e.angle);for(let[E,w]of Object.entries(x))if(Zw(ne(n,i),w,b))return E}}return!1},Dne=(e,t,r,n,i,a,o,s)=>e.reduce((l,u)=>{if(l)return l;let d=kHt(u,o,t,r,n,i,a,s);return d?{element:u,transformHandleType:d}:null},null),Nne=([e,t,r,n],i,a,o,s,l)=>{let u=yB([e,t,r,n,(e+r)/2,(t+n)/2],0,o,s,DT(l)),d=Object.keys(u).find(h=>{let f=u[h];return f&&ate(f,i,a)});if(d)return d;if(Rne(l)){let h=(e+r)/2,f=(t+n)/2,p=WP/o.value,m=VRe(ne(e-p,t-p),ne(r+p,n+p),ne(h,f),0);for(let[g,y]of Object.entries(m))if(Zw(ne(i,a),y,p))return g}return!1},qee=["ns","nesw","ew","nwse"],CHt=(e,t)=>{let r=qee.indexOf(e);if(r>=0){let n=Math.round(t/(Math.PI/4));e=qee[(r+n)%qee.length]}return e},_ne=e=>{let{element:t,transformHandleType:r}=e,n=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(r){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":n?i="nesw":i="nwse";break;case"ne":case"sw":n?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=CHt(i,t.angle)),i?`${i}-resize`:""},VRe=([e,t],[r,n],i,a)=>{let o=ht(ne(e,t),i,a),s=ht(ne(r,t),i,a),l=ht(ne(e,n),i,a),u=ht(ne(r,n),i,a);return{n:[o,s],e:[s,u],s:[u,l],w:[l,o]}},HRe=(e,t,r,n,i,a,o,s,l,u,d,h)=>{if(r.length===1){let[f]=r;if(t==="rotation")ar(f)||(SHt(f,n,i,l,u,a),gu(f,n));else{if(er(f)&&t)return AHt(e,f,n,t,o,l,u),gu(f,n),!0;if(t){let p=r[0].id,m=n.get(p),g=e.get(p);if(m&&g){let{nextWidth:y,nextHeight:v}=MHt(m,g,n,e,t,l,u,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o});NT(y,v,m,g,n,e,t,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o})}}}return!0}else if(r.length>1){if(t==="rotation")return UHt(e,r,n,i,l,u,a,d,h),!0;if(t){let{nextWidth:f,nextHeight:p,flipByX:m,flipByY:g,originalBoundingBox:y}=LHt(r,e,n,t,l,u,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:o});return One(r,n,t,i,e,{shouldResizeFromCenter:o,shouldMaintainAspectRatio:s,flipByX:m,flipByY:g,nextWidth:f,nextHeight:p,originalBoundingBox:y}),!0}}return!1},SHt=(e,t,r,n,i,a)=>{let[o,s,l,u]=un(e,t),d=(o+l)/2,h=(s+u)/2,f;qr(e)?f=0:(f=5*Math.PI/2+Math.atan2(i-h,n-d),a&&(f=f+wb/2,f=f-f%wb),f=HP(f));let p=ym(e);if(kt(e,{angle:f}),p){let m=r.getElement(p);m&&!An(e)&&kt(m,{angle:f})}},vB=(e,t,r,n)=>dn(e)||gf(e)?{points:QP(0,t,QP(1,r,e.points,n),n)}:{},Pne=(e,t,r)=>{let n=e.width;if(ga(e)){let a=$s(e,t);a&&(n=_p(a,e))}let i=e.fontSize*(r/n);return i{let[s,l,u,d,h,f]=un(t,r),[p,m]=ht(ne(a,o),ne(h,f),-t.angle),g=0,y=0;n!=="e"&&n!=="w"&&(n.includes("e")&&(g=(p-s)/(u-s)),n.includes("w")&&(g=(u-p)/(u-s)),n.includes("n")&&(y=(d-m)/(d-l)),n.includes("s")&&(y=(m-l)/(d-l)));let v=Math.max(g,y);if(v>0){let b=t.width*v,x=t.height*v,E=Pne(t,r,b);if(E===null)return;let w=[s,l],T=[u,d],C=[h,f],S=ne(s,l);if(["n","w","nw"].includes(n)&&(S=ne(T[0]-Math.abs(b),T[1]-Math.abs(x))),n==="ne"){let D=[w[0],T[1]];S=ne(D[0],D[1]-Math.abs(x))}if(n==="sw"){let D=[T[0],w[1]];S=ne(D[0]-Math.abs(b),D[1])}["s","n"].includes(n)&&(S[0]=C[0]-b/2),["e","w"].includes(n)&&(S[1]=C[1]-x/2),i&&(S[0]=C[0]-Math.abs(b)/2,S[1]=C[1]-Math.abs(x)/2);let R=t.angle,U=ht(S,ne(h,f),R),L=ne(S[0]+Math.abs(b)/2,S[1]+Math.abs(x)/2),I=ht(L,ne(h,f),R);S=ht(U,I,-R);let[A,P]=S;kt(t,{fontSize:E.size,width:b,height:x,x:A,y:P})}if(n==="e"||n==="w"){let b=e.get(t.id),[x,E,w,T]=vb(b,b.width,b.height,!0),C=ne(x,E),S=ne(w,T),R=uU(C,S),U=ht(ne(a,o),R,-b.angle),[L,,I]=vb(t,t.width,t.height,!0),A=I-L,P=S[0]-C[0],D=gO(Bi({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),M=P/A;n.includes("e")&&(M=(U[0]-C[0])/A),n.includes("w")&&(M=(S[0]-U[0])/A);let O=t.width*M{let u=5*Math.PI/2+Math.atan2(a-l,i-s);o&&(u+=wb/2,u-=u%wb);for(let d of t)if(!qr(d)){let[h,f,p,m]=un(d,r),g=(h+p)/2,y=(f+m)/2,v=e.get(d.id)?.angle??d.angle,[b,x]=ht(ne(g,y),ne(s,l),u+v-d.angle);ar(d)?kt(d,{points:ZWt(d,r)}):kt(d,{x:d.x+(b-g),y:d.y+(x-y),angle:HP(u+v)},!1),gu(d,r,{simultaneouslyUpdated:t});let E=hn(d,r);E&&!An(d)&&kt(E,{x:E.x+(b-g),y:E.y+(x-y),angle:HP(u+v)},!1)}n.triggerUpdate()},qRe=(e,t,r,n,i)=>{let[a,o,s,l]=t.length===1?un(t[0],r):mi(t),u=(a+s)/2,d=(o+l)/2,h=t.length===1?t[0].angle:0;switch([n,i]=ht(ne(n,i),ne(u,d),-h),e){case"n":return ht(ne(n-(a+s)/2,i-o),ne(0,0),h);case"s":return ht(ne(n-(a+s)/2,i-l),ne(0,0),h);case"w":return ht(ne(n-a,i-(o+l)/2),ne(0,0),h);case"e":return ht(ne(n-s,i-(o+l)/2),ne(0,0),h);case"nw":return ht(ne(n-a,i-o),ne(0,0),h);case"ne":return ht(ne(n-s,i-o),ne(0,0),h);case"sw":return ht(ne(n-a,i-l),ne(0,0),h);case"se":return ht(ne(n-s,i-l),ne(0,0),h);default:return[0,0]}},YRe=(e,t)=>{let[,[r,n]]=t.points;return e==="nw"&&(r<0||n<0)||e==="ne"&&r>=0||e==="sw"&&r<=0||e==="se"&&(r>0||n>0)?"end":"origin"},IHt=(e,t,r)=>{if(r)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},RHt=(e,t,r,n,i,a,o,s,l)=>{let u=IHt(o,s,l),[d,h]=e;switch(u){case"top-left":return{x:d+(t-n)/2+(n-t)/2*Math.cos(a)+(r-i)/2*Math.sin(a),y:h+(r-i)/2+(n-t)/2*Math.sin(a)+(i-r)/2*Math.cos(a)};case"top-right":return{x:d+(t-n)/2*(Math.cos(a)+1)+(r-i)/2*Math.sin(a),y:h+(r-i)/2+(t-n)/2*Math.sin(a)+(i-r)/2*Math.cos(a)};case"bottom-left":return{x:d+(t-n)/2*(1-Math.cos(a))+(i-r)/2*Math.sin(a),y:h+(r-i)/2*(Math.cos(a)+1)+(n-t)/2*Math.sin(a)};case"bottom-right":return{x:d+(t-n)/2*(Math.cos(a)+1)+(i-r)/2*Math.sin(a),y:h+(r-i)/2*(Math.cos(a)+1)+(t-n)/2*Math.sin(a)};case"center":return{x:d-(n-t)/2,y:h-(i-r)/2};case"east-side":return{x:d+(t-n)/2*(Math.cos(a)+1),y:h+(t-n)/2*Math.sin(a)+(r-i)/2};case"west-side":return{x:d+(t-n)/2*(1-Math.cos(a)),y:h+(n-t)/2*Math.sin(a)+(r-i)/2};case"north-side":return{x:d+(t-n)/2+(r-i)/2*Math.sin(a),y:h+(i-r)/2*(Math.cos(a)-1)};case"south-side":return{x:d+(t-n)/2+(i-r)/2*Math.sin(a),y:h+(r-i)/2*(Math.cos(a)+1)}}},NT=(e,t,r,n,i,a,o,{shouldInformMutation:s=!0,shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:u=!1}={})=>{let d={},h=hn(r,i);if(h){let g=a.get(h.id);if(g&&(d={fontSize:g.fontSize}),l){let y={...r,width:e,height:t},v=Pne(h,i,_p(y,h));if(v===null)return;d={fontSize:v.size}}else{let y=Nte(Bi(h),h.lineHeight),v=Pte(h.fontSize,h.lineHeight);e=Math.max(e,y),t=Math.max(t,v)}}let f=vB(n,e,t,!0),p=ne(n.x,n.y);if(dn(n)){let[g,y]=Dp(n,a);p=ne(g,y)}let m=RHt(p,n.width,n.height,e,t,n.angle,o,l,u);if(dn(n)&&f.points){let g=n.x-p[0],y=n.y-p[1];m.x+=g,m.y+=y;let v=f.points[0][0],b=f.points[0][1];m.x+=v,m.y+=b,f.points=f.points.map(x=>ne(x[0]-v,x[1]-b))}if(e<0&&(m.x=m.x+e),t<0&&(m.y=m.y+t),"scale"in r&&"scale"in n&&kt(r,{scale:[(Math.sign(e)||n.scale[0])*n.scale[0],(Math.sign(t)||n.scale[1])*n.scale[1]]}),An(r)&&h&&l){let g=e/r.width*h.fontSize;if(g{let[u,d,h,f]=vb(t,t.width,t.height,!0),p=ne(u,d),m=ne(h,f),g=uU(p,m),y=ht(ne(a,o),g,-t.angle),[v,b,x,E]=vb(e,e.width,e.height,!0),w=x-v,T=E-b,C=m[0]-p[0],S=m[1]-p[1],R=C/w,U=S/T;i.includes("e")&&(R=(y[0]-p[0])/w),i.includes("s")&&(U=(y[1]-p[1])/T),i.includes("w")&&(R=(m[0]-y[0])/w),i.includes("n")&&(U=(m[1]-y[1])/T);let L=e.width*R,I=e.height*U;if(l&&(L=2*L-t.width,I=2*I-t.height),s){let A=Math.abs(L)/t.width,P=Math.abs(I)/t.height;if(i.length===1&&(I*=A,L*=P),i.length===2){let D=Math.max(A,P);L=t.width*D*Math.sign(L),I=t.height*D*Math.sign(I)}}return{nextWidth:L,nextHeight:I}},LHt=(e,t,r,n,i,a,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:s=!1}={})=>{let l=e.map(A=>t.get(A.id)),u=l.reduce((A,P)=>{if(!dn(P))return A;let D=ym(P);if(!D)return A;let M=t.get(D)??null;return ga(M)?[...A,{...M,...rr.getBoundTextElementPosition(P,M,r)}]:A},[]),d=xf(l.map(A=>A).concat(u)),{minX:h,minY:f,maxX:p,maxY:m,midX:g,midY:y}=d,v=p-h,b=m-f,x={ne:[h,m],se:[h,f],sw:[p,f],nw:[p,m],e:[h,f+b/2],w:[p,f+b/2],n:[h+v/2,m],s:[h+v/2,f]},[E,w]=s?[g,y]:x[n],T=s?2:1,C=Math.max(Math.abs(i-E)/v||0,Math.abs(a-w)/b||0)*T,S=n.includes("e")||n.includes("w")?Math.abs(i-E)*T:v,R=n.includes("n")||n.includes("s")?Math.abs(a-w)*T:b;o&&(S=v*C*Math.sign(i-E),R=b*C*Math.sign(a-w));let U={ne:[iw],se:[iE,aE,a>w],e:[iE,!1],n:[!1,a>w],s:[!1,aA);return{originalBoundingBox:d,nextWidth:S,nextHeight:R,flipByX:L,flipByY:I}},One=(e,t,r,n,i,{shouldMaintainAspectRatio:a=!1,shouldResizeFromCenter:o=!1,flipByX:s=!1,flipByY:l=!1,nextHeight:u,nextWidth:d,originalBoundingBox:h}={})=>{if(d===void 0&&u===void 0&&s===void 0&&l===void 0||u===0||d===0)return;i||(i=t);let f=e.reduce((T,C)=>{let S=i.get(C.id);return S&&T.push({orig:S,latest:C}),T},[]),p;if(h)p=h;else{let T=f.reduce((C,{orig:S})=>{if(!dn(S))return C;let R=ym(S);if(!R)return C;let U=i.get(R)??null;return ga(U)?[...C,{...U,...rr.getBoundTextElementPosition(S,U,t)}]:C},[]);p=xf(f.map(({orig:C})=>C).concat(T))}let{minX:m,minY:g,maxX:y,maxY:v,midX:b,midY:x}=p,E=y-m,w=v-g;if(d===void 0&&u===void 0&&(d=E,u=w),a&&(d===void 0?d=u*(E/w):u===void 0?u=d*(w/E):Math.abs(d/u-E/w)>.001&&(d=u*(E/w))),d&&u){let T=r.includes("e")||r.includes("w")?Math.abs(d)/E:1,C=r.includes("n")||r.includes("s")?Math.abs(u)/w:1,S;r.length===1?S=r.includes("e")||r.includes("w")?T:C:S=Math.max(Math.abs(d)/E||0,Math.abs(u)/w||0);let R={ne:[m,v],se:[m,g],sw:[y,g],nw:[y,v],e:[m,g+w/2],w:[y,g+w/2],n:[m+E/2,v],s:[m+E/2,g]},[U,L]=o?[b,x]:R[r],I=a||f.some(O=>O.latest.angle!==0||er(O.latest)||y5(O.latest));I&&(T=S,C=S);let[A,P]=[s?-1:1,l?-1:1],D=[];for(let{orig:O,latest:_}of f){if(er(O)&&ga(O))continue;let B=O.width*T,F=O.height*C,G=HP(O.angle*A*P),z=dn(O)||gf(O),V=O.x-U,$=O.y-L,Z=s&&!z?B:0,re=l&&!z?F:0,Q=U+A*(V*T+Z),ge=L+P*($*C+re),ie=vB(O,B*A,F*P,!1),pe={x:Q,y:ge,width:B,height:F,angle:G,...ie};if(ar(O)&&(O.startBinding&&(pe.startBinding={...O.startBinding,fixedPoint:[s?-O.startBinding.fixedPoint[0]+1:O.startBinding.fixedPoint[0],l?-O.startBinding.fixedPoint[1]+1:O.startBinding.fixedPoint[1]]}),O.endBinding&&(pe.endBinding={...O.endBinding,fixedPoint:[s?-O.endBinding.fixedPoint[0]+1:O.endBinding.fixedPoint[0],l?-O.endBinding.fixedPoint[1]+1:O.endBinding.fixedPoint[1]]}),O.fixedSegments&&ie.points&&(pe.fixedSegments=O.fixedSegments.map(fe=>({...fe,start:ie.points[fe.index-1],end:ie.points[fe.index]})))),hi(O)&&(pe.scale=[O.scale[0]*A,O.scale[1]*P]),er(O)){let fe=Pne(O,t,B);if(!fe)return;pe.fontSize=fe.size}let ue=i.get(ym(O)??"");if(ue)if(I){let fe=ue.fontSize*S;if(feO);for(let{element:O,update:{boundTextFontSize:_,...B}}of D){let{width:F,height:G,angle:z}=B;kt(O,B,!1,{isDragging:!0}),gu(O,t,{simultaneouslyUpdated:M,newSize:{width:F,height:G}});let V=hn(O,t);V&&_&&(kt(V,{fontSize:_,angle:dn(O)?void 0:z},!1),ST(O,t,r,!0))}n.triggerUpdate()}},jRe=(e,t,r,n,i,a)=>{if(t.length===1&&ar(t[0])&&(t[0].startBinding||t[0].endBinding))return;let o=t.filter(h=>{if(ar(h)&&h.startBinding&&h.endBinding){let f=t.find(m=>m.id===h.startBinding?.elementId),p=t.find(m=>m.id===h.endBinding?.elementId);return f&&p}return!0}),s=new Set(o),l=o.filter(h=>qr(h)).map(h=>h.id);if(l.length>0)for(let h of n.getNonDeletedElements())h.frameId!==null&&l.includes(h.frameId)&&s.add(h);let u=mi(Array.from(s).map(h=>e.originalElements.get(h.id)??h)),d=DHt(u,r,i,a);s.forEach(h=>{if(c8e(e,h,d),!An(h)){let f=hn(h,n.getNonDeletedElementsMap());f&&c8e(e,f,d),gu(h,n.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(s)})}})},DHt=(e,t,r,n)=>{let[i,a]=e,o=i+t.x+r.x,s=a+t.y+r.y;if(r.x===0||r.y===0){let[l,u]=os(i+t.x,a+t.y,n);r.x===0&&(o=l),r.y===0&&(s=u)}return{x:o-i,y:s-a}},c8e=(e,t,r)=>{let n=e.originalElements.get(t.id)??t,i=n.x+r.x,a=n.y+r.y;kt(t,{x:i,y:a})},XRe=(e,t,r)=>{let[n,i]=mi(e);return[t-n,r-i]},Bne=({newElement:e,elementType:t,originX:r,originY:n,x:i,y:a,width:o,height:s,shouldMaintainAspectRatio:l,shouldResizeFromCenter:u,zoom:d,widthAspectRatio:h=null,originOffset:f=null,informMutation:p=!0})=>{l&&e.type!=="selection"&&(h?s=o/h:(Math.abs(a-n)>Math.abs(i-r)?{width:o,height:s}=o8e(t,s,inPt/d&&(y={autoResize:!1}),g=n,u&&(m=r-o/2)}if(o!==0&&s!==0){let v=null;hi(e)&&(v={initialWidth:o,initialHeight:s}),kt(e,{x:m+(f?.x??0),y:g+(f?.y??0),width:o,height:s,...y,...v},p)}},bB=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||Un(t,e).length)),Fne=e=>{let t=5381;for(let r=0;r>>0},$Re=e=>{let t=5381;for(let r=0;r>>0},NHt=e=>e.filter(t=>!t.isDeleted&&!w5(t)),zi=e=>e.filter(t=>!t.isDeleted),xB=e=>!e.isDeleted,KRe=e=>zi(e).map(t=>mO(t.type)?{...t,lastCommittedPoint:null}:t),_Ht=e=>KRe(e),ZRe=e=>KRe(e),QRe=async e=>{let t;if(e.type===Mr.png)try{return await(await Promise.resolve().then(()=>(Aee(),See))).decodePngMetadata(e)}catch(r){throw r.message==="INVALID"?new gb("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new gb("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(r=>{let n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&r(n.result)}}),e.type===Mr.svg)try{return _Vt({svg:t})}catch(r){throw r.message==="INVALID"?new gb("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new gb("Error: cannot restore image")}return t},zne=e=>e&&e.name.match(/\.(json|excalidraw|png|svg)$/)?.[1]||null,JRe=e=>e==="png"||e==="svg",wB=e=>{let t=zne(e);return t==="png"||t==="svg"},eMe=e=>!!e&&Object.values(o5).includes(e),Fb=e=>{let{type:t}=e||{};return eMe(t)},Gne=async(e,t,r,n)=>{let i=await QRe(e),a;try{try{a=JSON.parse(i)}catch(o){throw Fb(e)?new gb("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):o}if(IVt(a))return{type:Mr.excalidraw,data:b5({elements:ZRe(a.elements||[]),appState:{theme:t?.theme,fileHandle:n||e.handle||null,...W8e(a.appState||{}),...t?TT(a.elements||[],t):{}},files:a.files},t,r,{repairBindings:!0,refreshDimensions:!1})};if(fRe(a))return{type:Mr.excalidrawlib,data:a};throw new Error("Error: invalid file")}catch(o){throw o instanceof gb?o:new Error("Error: invalid file")}},Wne=async(e,t,r,n)=>{let i=await Gne(e,t,r,n);if(i.type!==Mr.excalidraw)throw new Error("Error: invalid file");return i.data},Vne=(e,t="unpublished")=>{let r=JSON.parse(e);if(!fRe(r))throw new Error("Invalid library");let n=r.libraryItems||r.library;return oB(n,t)},tMe=async(e,t="unpublished")=>Vne(await QRe(e),t),_T=async e=>new Promise(async(t,r)=>{try{yT(e)&&(e=await e),e.toBlob(n=>{if(!n)return r(new nOt("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(n)})}catch(n){r(n)}}),rMe=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await $w(e));return UPt(new Uint8Array(t))}catch(t){return console.error(t),FE(40)}},Hne=async e=>new Promise((t,r)=>{let n=new FileReader;n.onload=()=>{let i=n.result;t(i)},n.onerror=i=>r(i),n.readAsDataURL(e)}),nMe=(e,t)=>`data:${t};base64,${uMe(iO(e),!0)}`,iMe=(e,t="")=>{let r=e.indexOf(","),n=atob(e.slice(r+1)),i=e.slice(0,r).split(":")[1].split(";")[0],a=new ArrayBuffer(n.length),o=new Uint8Array(a);for(let s=0;sdMe(e.slice(e.indexOf(",")+1)),EB=async(e,t)=>{if(e.type===Mr.svg)return e;let[r,n]=await Promise.all([Promise.resolve().then(()=>Ue(ZAe(),1)).then(a=>a.default),Promise.resolve().then(()=>(a7e(),i7e)).then(a=>a.default)]),i=n({pica:r({features:["js"]})});if(t.outputType){let{outputType:a}=t;i._create_blob=function(o){return this.pica.toBlob(o.out_canvas,a,.8).then(s=>(o.out_blob=s,o))}}if(!Fb(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},qne=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:Mr.svg}),oMe=async(e,t="")=>{let r;try{r=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!r.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let n=await r.blob();if(n.type&&Fb(n)){let i=t||n.name||"";return new File([n],i,{type:n.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},sMe=async e=>{let t=e.dataTransfer.files.item(0),r=await PHt(e);return{file:t?await TB(t):null,fileHandle:r}},PHt=async e=>{if(M1)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},u8e=e=>{let t=null,r=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,n={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return r===n.png?t=Mr.png:r.startsWith(n.jpg)?t=Mr.jpg:r.startsWith(n.gif)&&(t=Mr.gif),t},H8=(e,t,r)=>new File([e],r||"",{type:t}),TB=async e=>{if(e.type){if(Fb(e)){let t=await $w(e),r=u8e(t);r&&r!==e.type&&(e=H8(t,r,e.name))}}else if(e?.name?.endsWith(".excalidrawlib"))e=H8(await $w(e),Mr.excalidrawlib,e.name);else if(e?.name?.endsWith(".excalidraw"))e=H8(await $w(e),Mr.excalidraw,e.name);else{let t=await $w(e),r=u8e(t);r&&(e=H8(t,r,e.name))}return e},$w=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,r)=>{let n=new FileReader;n.onload=i=>{if(!i.target?.result)return r(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},n.readAsArrayBuffer(e)}),iO=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),r="";for(let n of t)r+=String.fromCharCode(n);return r},lMe=e=>{let t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let n=0,i=e.length;nnew TextDecoder("utf-8").decode(lMe(e)),uMe=(e,t=!1)=>t?window.btoa(e):window.btoa(iO(e)),dMe=(e,t=!1)=>t?window.atob(e):cMe(window.atob(e)),hMe=({text:e,compress:t})=>{let r;if(t!==!1)try{r=iO(gSe(e))}catch(n){console.error("encode: cannot deflate",n)}return{version:"1",encoding:"bstring",compressed:!!r,encoded:r||iO(e)}},fMe=e=>{let t;if(e.encoding==="bstring")t=e.compressed?e.encoded:cMe(e.encoded);else throw new Error(`decode: unknown encoding "${e.encoding}"`);return e.compressed?ySe(new Uint8Array(lMe(t)),{to:"string"}):t},Uee=async e=>{let t=(0,ote.default)(new Uint8Array(await $w(e))).find(r=>r.name==="tEXt");return t?ste.default.decode(t.data):null},XAe=async({blob:e,metadata:t})=>{let r=(0,ote.default)(new Uint8Array(await $w(e))),n=ste.default.encode(Mr.excalidraw,JSON.stringify(hMe({text:t,compress:!0})));return r.splice(-1,0,n),new Blob([(0,h8e.default)(r)],{type:Mr.png})},$Ae=async e=>{let t=await Uee(e);if(t?.keyword===Mr.excalidraw)try{let r=JSON.parse(t.text);if(!("encoded"in r)){if("type"in r&&r.type===uh.excalidraw)return t.text;throw new Error("FAILED")}return fMe(r)}catch(r){throw console.error(r),new Error("FAILED")}throw new Error("INVALID")}});var Yne,jne,Xne,$ne,Kne,Zne,Qne,Jne,eie,tie,rie,nie,iie,aie,oie,sie,lie,cie,uie,die,hie,fie,pie,mie,gie,yie,vie,bie,xie,wie,Eie,Tie,kie,Cie,Sie,zU,Aie=H(()=>{Yne={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library\u2026",libraries:"Browse libraries",loadingScene:"Loading scene\u2026",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},jne={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},Xne={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},$ne={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},Kne={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},Zne={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure? - -(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available. -Your changes will not be saved!`},Qne={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the Aggressively Block Fingerprinting setting enabled.",line2:"This could result in breaking the Text Elements in your drawings.",line3:"We strongly recommend disabling this setting. You can follow these steps on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an issue on our GitHub, or write us on Discord"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},Jne={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},eie={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},tie={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},rie={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing, -hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT, -hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s), -CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple), -or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},nie={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},iie={headingMain:"Encountered an error. Try .",clearCanvasMessage:"If reloading doesn't work, try .",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our . Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},aie={or:"Or"},oie={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},sie={title:"Error"},lie={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},cie={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},uie={title:"Clear canvas"},die={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the public library repository for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the guidelines before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the MIT License, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},hie={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status here"},fie={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},pie={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it. -Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},mie={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},gie={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},yie={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG -({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG -({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element, -or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},vie={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},bie={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},xie={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},wie={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will replace your existing content.

You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will replace your existing content.

You can back up your drawing first by using one of the options below."}}},Eie={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only Flowchart, Sequence, and Class Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},Tie={placeholder:"Quick search"},kie={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},Cie={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},Sie={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},zU={labels:Yne,elementLink:jne,library:Xne,search:$ne,buttons:Kne,alerts:Zne,errors:Qne,toolBar:Jne,element:eie,headings:tie,hints:rie,canvasError:nie,errorSplash:iie,shareDialog:aie,roomDialog:oie,errorDialog:sie,exportDialog:lie,helpDialog:cie,clearCanvasDialog:uie,publishDialog:die,publishSuccessDialog:hie,confirmDialog:fie,imageExportDialog:pie,encrypted:mie,stats:gie,toast:yie,colors:vie,welcomeScreen:bie,colorPicker:xie,overwriteConfirm:wie,mermaid:Eie,quickSearch:Tie,fontList:kie,userList:Cie,commandPalette:Sie}});var Uie,Iie,kB,Rie=H(()=>{Uie=100,Iie=36,kB={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:Uie,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:Iie,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100}});var $De=Bn((jDe,XDe)=>{(function(){var e=this,t={};typeof jDe<"u"?XDe.exports=t:e.fuzzy=t,t.simpleFilter=function(r,n){return n.filter(function(i){return t.test(r,i)})},t.test=function(r,n){return t.match(r,n)!==null},t.match=function(r,n,i){i=i||{};var a=0,o=[],s=n.length,l=0,u=0,d=i.pre||"",h=i.post||"",f=i.caseSensitive&&n||n.toLowerCase(),p;r=i.caseSensitive&&r||r.toLowerCase();for(var m=0;m{"use strict";var KT=dt();function _Yt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var PYt=typeof Object.is=="function"?Object.is:_Yt,OYt=KT.useState,BYt=KT.useEffect,FYt=KT.useLayoutEffect,zYt=KT.useDebugValue;function GYt(e,t){var r=t(),n=OYt({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return FYt(function(){i.value=r,i.getSnapshot=t,Sae(i)&&a({inst:i})},[e,r,t]),BYt(function(){return Sae(i)&&a({inst:i}),e(function(){Sae(i)&&a({inst:i})})},[e]),zYt(r),r}function Sae(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!PYt(e,r)}catch{return!0}}function WYt(e,t){return t()}var VYt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?WYt:GYt;JDe.useSyncExternalStore=KT.useSyncExternalStore!==void 0?KT.useSyncExternalStore:VYt});var rNe=Bn((ztn,tNe)=>{"use strict";tNe.exports=eNe()});var iNe=Bn(nNe=>{"use strict";var tF=dt(),HYt=rNe();function qYt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YYt=typeof Object.is=="function"?Object.is:qYt,jYt=HYt.useSyncExternalStore,XYt=tF.useRef,$Yt=tF.useEffect,KYt=tF.useMemo,ZYt=tF.useDebugValue;nNe.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=XYt(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=KYt(function(){function l(p){if(!u){if(u=!0,d=p,p=n(p),i!==void 0&&o.hasValue){var m=o.value;if(i(m,p))return h=m}return h=p}if(m=h,YYt(d,p))return m;var g=n(p);return i!==void 0&&i(m,g)?(d=p,m):(d=p,h=g)}var u=!1,d,h,f=r===void 0?null:r;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,r,n,i]);var s=jYt(e,a[0],a[1]);return $Yt(function(){o.hasValue=!0,o.value=s},[s]),ZYt(s),s}});var oNe=Bn((Wtn,aNe)=>{"use strict";aNe.exports=iNe()});var VNe=Bn((ann,WNe)=>{var Qjt="Expected a function",zNe=NaN,Jjt="[object Symbol]",eXt=/^\s+|\s+$/g,tXt=/^[-+]0x[0-9a-f]+$/i,rXt=/^0b[01]+$/i,nXt=/^0o[0-7]+$/i,iXt=parseInt,aXt=typeof global=="object"&&global&&global.Object===Object&&global,oXt=typeof self=="object"&&self&&self.Object===Object&&self,sXt=aXt||oXt||Function("return this")(),lXt=Object.prototype,cXt=lXt.toString,uXt=Math.max,dXt=Math.min,Hae=function(){return sXt.Date.now()};function hXt(e,t,r){var n,i,a,o,s,l,u=0,d=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(Qjt);t=GNe(t)||0,qae(r)&&(d=!!r.leading,h="maxWait"in r,a=h?uXt(GNe(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f);function p(T){var C=n,S=i;return n=i=void 0,u=T,o=e.apply(S,C),o}function m(T){return u=T,s=setTimeout(v,t),d?p(T):o}function g(T){var C=T-l,S=T-u,R=t-C;return h?dXt(R,a-S):R}function y(T){var C=T-l,S=T-u;return l===void 0||C>=t||C<0||h&&S>=a}function v(){var T=Hae();if(y(T))return b(T);s=setTimeout(v,g(T))}function b(T){return s=void 0,f&&n?p(T):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function E(){return s===void 0?o:b(Hae())}function w(){var T=Hae(),C=y(T);if(n=arguments,i=this,l=T,C){if(s===void 0)return m(l);if(h)return s=setTimeout(v,t),p(l)}return s===void 0&&(s=setTimeout(v,t)),o}return w.cancel=x,w.flush=E,w}function qae(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function fXt(e){return!!e&&typeof e=="object"}function pXt(e){return typeof e=="symbol"||fXt(e)&&cXt.call(e)==Jjt}function GNe(e){if(typeof e=="number")return e;if(pXt(e))return zNe;if(qae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=qae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(eXt,"");var r=rXt.test(e);return r||nXt.test(e)?iXt(e.slice(2),r?2:8):tXt.test(e)?zNe:+e}WNe.exports=hXt});var Yr={};gr(Yr,{default:()=>wXt});var wXt,jr=H(()=>{wXt={}});var jNe={};gr(jNe,{alerts:()=>Zne,buttons:()=>Kne,canvasError:()=>nie,clearCanvasDialog:()=>uie,colorPicker:()=>xie,colors:()=>vie,commandPalette:()=>Sie,confirmDialog:()=>fie,default:()=>zU,element:()=>eie,elementLink:()=>jne,encrypted:()=>mie,errorDialog:()=>sie,errorSplash:()=>iie,errors:()=>Qne,exportDialog:()=>lie,fontList:()=>kie,headings:()=>tie,helpDialog:()=>cie,hints:()=>rie,imageExportDialog:()=>pie,labels:()=>Yne,library:()=>Xne,mermaid:()=>Eie,overwriteConfirm:()=>wie,publishDialog:()=>die,publishSuccessDialog:()=>hie,quickSearch:()=>Tie,roomDialog:()=>oie,search:()=>$ne,shareDialog:()=>aie,stats:()=>gie,toast:()=>yie,toolBar:()=>Jne,userList:()=>Cie,welcomeScreen:()=>bie});var XNe=H(()=>{Aie();LE()});var $Ne={};gr($Ne,{default:()=>kB,en:()=>Uie,kaa:()=>Iie});var KNe=H(()=>{Rie();LE()});var ZNe,l9,D5=H(()=>{ZNe={rect:"rectangle",circle:"ellipse"},l9={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4}});var vd,_5=H(()=>{D5();vd=class{constructor({converter:t}){this.convert=(r,n)=>this.converter(r,{...n,fontSize:n.fontSize||20}),this.converter=t}}});var X1,Sl,si,c9=H(()=>{(function(e){e.ROUND="round",e.STADIUM="stadium",e.DOUBLECIRCLE="doublecircle",e.CIRCLE="circle",e.DIAMOND="diamond",e.CYLINDER="cylinder"})(X1||(X1={}));(function(e){e.COLOR="color"})(Sl||(Sl={}));(function(e){e.FILL="fill",e.STROKE="stroke",e.STROKE_WIDTH="stroke-width",e.STROKE_DASHARRAY="stroke-dasharray"})(si||(si={}))});var QNe=Bn(pF=>{"use strict";Object.defineProperty(pF,"__esModule",{value:!0});pF.removeMarkdown=void 0;var EXt=function(e,t){t===void 0&&(t={listUnicodeChar:""}),t=t||{},t.listUnicodeChar=t.hasOwnProperty("listUnicodeChar")?t.listUnicodeChar:!1,t.stripListLeaders=t.hasOwnProperty("stripListLeaders")?t.stripListLeaders:!0,t.gfm=t.hasOwnProperty("gfm")?t.gfm:!0,t.useImgAltText=t.hasOwnProperty("useImgAltText")?t.useImgAltText:!0,t.preserveLinks=t.hasOwnProperty("preserveLinks")?t.preserveLinks:!1;var r=e||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{t.stripListLeaders&&(t.listUnicodeChar?r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,t.listUnicodeChar+" $1"):r=r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),t.gfm&&(r=r.replace(/\n={2,}/g,` -`).replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),t.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,t.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,` - -`).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,` - -`)}catch(n){return console.error(n),e}return r};pF.removeMarkdown=EXt});var JNe,TXt,e_e,mF,kXt,P5,u9,Yae=H(()=>{c9();JNe=Ue(QNe(),1),TXt={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},e_e=e=>TXt[e],mF=e=>{let t=e.text;return e.labelType==="markdown"&&(t=(0,JNe.removeMarkdown)(e.text)),kXt(t)},kXt=e=>{let t=/\s?(fa|fab):[a-zA-Z0-9-]+/g;return e.replace(t,"")},P5=e=>{let t={};return Object.keys(e).forEach(r=>{switch(r){case si.FILL:{t.backgroundColor=e[r],t.fillStyle="solid";break}case si.STROKE:{t.strokeColor=e[r];break}case si.STROKE_WIDTH:{t.strokeWidth=Number(e[r]?.split("px")[0]);break}case si.STROKE_DASHARRAY:{t.strokeStyle="dashed";break}}}),t},u9=e=>{let t={};return Object.keys(e).forEach(r=>{r===Sl.COLOR&&(t.strokeColor=e[r])}),t}});var CXt,SXt,t_e,AXt,UXt,r_e,IXt,RXt,n_e,i_e=H(()=>{_5();Yae();c9();D5();CXt=(e,t)=>[e,t],SXt=32,t_e=.62,AXt=12,UXt=12,r_e=(e,t)=>Math.max(20,Math.ceil(e.length*t*t_e)),IXt=(e,t,r,n)=>{let i=n||20;if(e!==X1.CYLINDER||!t||t.includes(` -`))return i;let a=Math.max(20,r-AXt);return r_e(t,i)<=a?i:Math.max(UXt,Math.floor(a/(t.length*t_e)))},RXt=e=>{let t={};e.subGraphs.map(n=>{n.nodeIds.forEach(i=>{t[n.id]={id:n.id,parent:null,isLeaf:!1},t[i]={id:i,parent:n.id,isLeaf:e.vertices[i]!==void 0}})});let r={};return[...Object.keys(e.vertices),...e.subGraphs.map(n=>n.id)].forEach(n=>{if(!t[n])return;let i=t[n],a=[];for(i.isLeaf||a.push(`subgraph_group_${i.id}`);i.parent;)a.push(`subgraph_group_${i.parent}`),i=t[i.parent];r[n]=a}),{getGroupIds:n=>r[n]||[],getParentId:n=>t[n]?t[n].parent:null}},n_e=new vd({converter:(e,t)=>{let r=[],n=t.fontSize,{getGroupIds:i,getParentId:a}=RXt(e);return e.subGraphs.reverse().forEach(o=>{let s=i(o.id),l=mF(o),h=r_e(l,n||16)+SXt*2,f=Math.max(o.width,h),p=o.x-(f-o.width)/2,m=P5(o.containerStyle),g=u9(o.labelStyle),y={id:o.id,type:"rectangle",groupIds:s,x:p,y:o.y,width:f,height:o.height,label:{groupIds:s,text:l,fontSize:n,verticalAlign:"top",...g},...m};r.push(y)}),Object.values(e.vertices).forEach(o=>{if(!o)return;let s=i(o.id),l=mF(o),u=IXt(o.type,l,o.width,n),d=P5(o.containerStyle),h=u9(o.labelStyle),f={id:o.id,type:"rectangle",groupIds:s,x:o.x,y:o.y,width:o.width,height:o.height,strokeWidth:2,label:{groupIds:s,text:l,fontSize:u,...h},link:o.link||null,...d};switch(o.type){case X1.STADIUM:{f={...f,roundness:{type:3}};break}case X1.ROUND:{f={...f,roundness:{type:3}};break}case X1.DOUBLECIRCLE:{s.push(`doublecircle_${o.id}}`);let m={type:"ellipse",groupIds:s,x:o.x+5,y:o.y+5,width:o.width-10,height:o.height-10,strokeWidth:2,roundness:{type:3},label:{groupIds:s,text:l,fontSize:u,...h}};f={...f,groupIds:s,type:"ellipse"},r.push(m);break}case X1.CIRCLE:{f.type="ellipse";break}case X1.DIAMOND:{f.type="diamond";break}}r.push(f)}),e.edges.forEach(o=>{let s=[],l=a(o.start),u=a(o.end);l&&l===u&&(s=i(l));let{startX:d,startY:h,reflectionPoints:f}=o,p=f.map(x=>CXt(x.x-f[0].x,x.y-f[0].y)),m=e_e(o.type||"arrow_point"),g=r.find(x=>x.id===o.start),y=r.find(x=>x.id===o.end);if(!g||!y)return;let b={id:`${o.start}_${o.end}`,type:"arrow",groupIds:s,x:d,y:h,strokeWidth:o.stroke==="thick"?4:2,strokeStyle:o.stroke==="dotted"?"dashed":void 0,points:p,...o.text?{label:{text:mF(o),fontSize:n,groupIds:s}}:{},roundness:{type:2},...m,start:{id:g.id||""},end:{id:y.id||""}};r.push(b)}),{elements:r}}})});var Al,O5=H(()=>{Al=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"")});var a_e,o_e=H(()=>{_5();O5();a_e=new vd({converter:e=>{let t=Al(),{width:r,height:n}=e,i={type:"image",x:0,y:0,width:r,height:n,status:"saved",fileId:t};return{files:{[t]:{id:t,mimeType:e.mimeType,dataURL:e.dataURL}},elements:[i]}}})});var d9,jae,Mm,Lm,$1,nk,gF=H(()=>{d9=(e,t)=>[e,t],jae=e=>e.replace(/\\n/g,` -`),Mm=e=>{let t={type:"line",x:e.startX,y:e.startY,points:[d9(0,0),d9(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e.strokeStyle||"solid",strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},Lm=e=>{let t={type:"text",x:e.x,y:e.y,width:e.width,height:e.height,text:jae(e.text)||"",fontSize:e.fontSize,verticalAlign:"top",strokeColor:e.color};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},$1=e=>{let t={text:jae(e?.label?.text||""),fontSize:e?.label?.fontSize,textAlign:e.label?.textAlign,verticalAlign:e.label?.verticalAlign||"middle",strokeColor:e.label?.color||"#000",...e.groupId?{groupIds:[e.groupId]}:{}},r={};e.type==="rectangle"&&e.subtype==="activation"&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});let n={id:e.id,type:e.type,x:e.x,y:e.y,width:e.width,height:e.height,label:t,strokeStyle:e?.strokeStyle,strokeWidth:e?.strokeWidth,strokeColor:e?.strokeColor,backgroundColor:e?.bgColor,fillStyle:"solid",...r};return e.groupId&&Object.assign(n,{groupIds:[e.groupId]}),n},nk=e=>{let t={type:"arrow",x:e.startX,y:e.startY,points:e.points?.map(([r,n])=>d9(r,n))||[d9(0,0),d9(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e?.strokeStyle||"solid",endArrowhead:e?.endArrowhead||null,startArrowhead:e?.startArrowhead||null,label:{text:jae(e?.label?.text||""),fontSize:16,textAlign:e?.label?.textAlign,verticalAlign:e?.label?.verticalAlign},roundness:{type:2},start:e.start,end:e.end};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),t}});var yF,Xae,MXt,LXt,DXt,NXt,s_e,l_e,c_e=H(()=>{O5();_5();gF();yF=10,Xae=16,MXt=24,LXt=4,DXt=e=>{if(!e)return!0;let t=e.trim().toLowerCase();return t==="transparent"||t==="none"||t==="rgba(0,0,0,0)"||t==="rgba(0, 0, 0, 0)"},NXt=(e,t)=>Math.max(20,Math.round(e.length*t*.6)),s_e=(e,t,r=!0)=>{let n=e,i=n.groupIds??[];if(i.includes(t)||(n.groupIds=[...i,t]),!r||!n.label)return;let a=n.label.groupIds??[];a.includes(t)||(n.label.groupIds=[...a,t])},l_e=new vd({converter:e=>{let t=[],r=[];if(Object.values(e.nodes).forEach(n=>{!n||!n.length||n.forEach(i=>{let a;switch(i.type){case"line":a=Mm(i);break;case"rectangle":case"ellipse":a=$1(i);break;case"text":a=Lm(i);break;default:throw`unknown type ${i.type}`}i.type==="rectangle"&&i?.subtype==="activation"?r.push(a):t.push(a)})}),Object.values(e.lines).forEach(n=>{n&&t.push(Mm(n))}),Object.values(e.arrows).forEach(n=>{n&&(t.push(nk(n)),n.sequenceNumber&&t.push($1(n.sequenceNumber)))}),t.push(...r),e.loops){let{lines:n,texts:i,nodes:a}=e.loops;n.forEach(o=>{t.push(Mm(o))}),i.forEach(o=>{t.push(Lm(o))}),a.forEach(o=>{t.push($1(o))})}return e.groups&&e.groups.forEach(n=>{let{actorKeys:i,name:a}=n,o=1/0,s=1/0,l=0,u=0;if(!i.length)return;let d=t.filter(b=>{if(b.id){let x=b.id.indexOf("-"),E=b.id.substring(0,x);return i.includes(E)}return!1});if(!d.length||(d.forEach(b=>{b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||(o=Math.min(o,b.x),s=Math.min(s,b.y),l=Math.max(l,b.x+b.width),u=Math.max(u,b.y+b.height))}),!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(l)||!Number.isFinite(u)))return;let h=o-yF,f=s-yF,p=l-o+yF*2,m=u-s+yF*2,g=Al(),y=Al(),v=$1({type:"rectangle",x:h,y:f,width:p,height:m,bgColor:DXt(n.fill)?void 0:n.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:g,groupId:y});if(t.unshift(v),t.forEach(b=>{b.id!==g&&(b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||b.x>=o&&b.x+b.width<=l&&b.y>=s&&b.y+b.height<=u&&s_e(b,y))}),a){let b=Lm({type:"text",id:Al(),text:a,x:h+LXt,y:f-MXt,width:NXt(a,Xae),height:Xae+8,fontSize:Xae,color:"#1f1f1f",groupId:y});s_e(b,y,!1),t.push(b)}}),{elements:t}}})});var u_e,d_e=H(()=>{O5();gF();_5();u_e=new vd({converter:e=>{let t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(n=>{let i;switch(n.type){case"line":i=Mm(n);break;case"rectangle":case"ellipse":i=$1(n);break;case"text":i=Lm(n);break;default:throw`unknown type ${n.type}`}t.push(i)})}),Object.values(e.lines).forEach(r=>{r&&t.push(Mm(r))}),Object.values(e.arrows).forEach(r=>{if(!r)return;let n=nk(r);t.push(n)}),Object.values(e.text).forEach(r=>{let n=Lm(r);t.push(n)}),Object.values(e.namespaces).forEach(r=>{let n=Object.keys(r.classes),i=[...n],a=[...e.lines,...e.arrows,...e.text];n.forEach(s=>{let l=a.filter(u=>u.metadata&&u.metadata.classId===s).map(u=>u.id);l.length&&i.push(...l)});let o={type:"frame",id:Al(),name:r.id,children:i};t.push(o)}),{elements:t}}})});var h_e,f_e=H(()=>{gF();_5();h_e=new vd({converter:e=>{let t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(n=>{let i;switch(n.type){case"line":i=Mm(n);break;case"rectangle":case"ellipse":i=$1(n);break;case"text":i=Lm(n);break;default:throw`unknown type ${n.type}`}t.push(i)})}),e.lines.forEach(r=>{t.push(Mm(r))}),e.arrows.forEach(r=>{t.push(nk(r))}),e.text.forEach(r=>{t.push(Lm(r))}),{elements:t}}})});var vF,h9,p_e,_Xt,$ae,m_e,PXt,OXt,BXt,g_e,Kae,y_e,B5,FXt,ik,zXt,GXt,WXt,VXt,HXt,qXt,YXt,jXt,XXt,$Xt,v_e,b_e=H(()=>{_5();Yae();vF=(e,t)=>[e,t],h9=16,p_e=14,_Xt=1,$ae="#000000",m_e=5,PXt=m_e*2,OXt=m_e*2,BXt=1.25,g_e=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),Kae=e=>e.shape==="stateEnd"?[`state_end_group_${e.id}`]:void 0,y_e=e=>e.shape==="rectWithTitle"&&e.description.length?[e.text,...e.description].join(` -`):e.text,FXt=()=>{if(B5!==void 0)return B5;if(typeof document>"u")return B5=null,B5;try{B5=document.createElement("canvas").getContext("2d")}catch{B5=null}return B5},ik=(e,t)=>{let r=FXt();return r?(r.font=`${t}px Excalifont, sans-serif`,r.measureText(e).width):e.length*t*.6},zXt=(e,t,r)=>{if(ik(e,t)<=r)return[e];let n=[],i="";for(let a of e){let o=`${i}${a}`;if(i&&ik(o,t)>r){n.push(i),i=a;continue}i=o}return i&&n.push(i),n},GXt=(e,t,r)=>{if(!e.trim()||ik(e,t)<=r)return e;let n=e.split(/\s+/).filter(Boolean),i=[],a="";for(let o of n){let s=zXt(o,t,r);for(let[l,u]of s.entries()){let h=a?`${a}${a&&l===0?" ":""}${u}`:u;if(ik(h,t)<=r){a=h;continue}a&&i.push(a),a=u}s.length>1}return i.push(a),i.join(` -`)},WXt=(e,t,r)=>{let i=e.map(s=>GXt(s,t,r)).join(` -`).split(` -`),a=Math.max(...i.map(s=>ik(s,t))),o=i.length*t*BXt;return{width:a,height:o}},VXt=(e,t,r,n)=>{let i=e.split(` -`);for(let a=h9;a>=p_e;a-=_Xt){let{height:o}=WXt(i,a,t);if(o<=r)return a}return n},HXt=e=>{let t=y_e(e);if(!t||g_e.has(e.shape))return h9;let r=Math.max(1,e.width-PXt),n=Math.max(1,e.height-OXt),i=t.split(` -`);return i.length>1&&Math.max(...i.map(o=>ik(o,h9)))<=r?h9:VXt(t,r,n,i.length===1?h9:p_e)},qXt=e=>{if(g_e.has(e.shape))return;let t=y_e(e);if(t)return{text:t,fontSize:HXt(e),verticalAlign:e.shape==="rectWithTitle"||e.shape==="roundedWithTitle"?"top":"middle",...u9(e.labelStyle)}},YXt=e=>{let t=P5(e.containerStyle),r=qXt(e),n=e.shape==="choice"?"diamond":e.shape==="stateStart"||e.shape==="stateEnd"?"ellipse":"rectangle",i=e.shape==="rect"||e.shape==="rectWithTitle"||e.shape==="roundedWithTitle",a=e.shape==="stateStart"||e.shape==="fork"||e.shape==="join",o=t.backgroundColor||t.strokeColor||$ae,s=t.strokeColor||t.backgroundColor||$ae;return{id:e.id,type:n,...Kae(e)?{groupIds:Kae(e)}:{},x:e.x,y:e.y,width:e.width,height:e.height,...r?{label:r}:{},...t,...i?{roundness:{type:3}}:{},...a?{backgroundColor:o,strokeColor:s,fillStyle:"solid"}:{}}},jXt=e=>{if(!e.dividerLine)return null;let t=P5(e.containerStyle);return{id:`${e.id}__divider`,type:"line",x:e.dividerLine.startX,y:e.dividerLine.startY,width:e.dividerLine.endX-e.dividerLine.startX,height:e.dividerLine.endY-e.dividerLine.startY,points:[vF(0,0),vF(e.dividerLine.endX-e.dividerLine.startX,e.dividerLine.endY-e.dividerLine.startY)],strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1}},XXt=e=>{let t=P5(e.containerStyle),r=Math.max(2,Math.min(e.width,e.height)*.32),n=e.endInnerColor||t.strokeColor||t.backgroundColor||$ae;return{id:`${e.id}__inner`,type:"ellipse",groupIds:Kae(e),x:e.x+r,y:e.y+r,width:Math.max(1,e.width-r*2),height:Math.max(1,e.height-r*2),backgroundColor:n,strokeColor:n,fillStyle:"solid",strokeWidth:1}},$Xt=e=>{let t=e.reflectionPoints.map((r,n,i)=>{let a=i[0];return n===0?vF(0,0):vF(r.x-a.x,r.y-a.y)});return{id:e.id,type:"arrow",x:e.startX,y:e.startY,width:e.endX-e.startX,height:e.endY-e.startY,points:t,strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||2,strokeStyle:e.strokeStyle||"solid",endArrowhead:e.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:e.start},end:{id:e.end},...e.text?{label:{text:e.text,fontSize:16}}:{}}},v_e=new vd({converter:e=>{let t=[];return e.nodes.forEach(r=>{if(!r.isRenderable)return;let n=YXt(r);t.push(n);let i=jXt(r);i&&t.push(i),r.shape==="stateEnd"&&t.push(XXt(r))}),e.edges.forEach(r=>{t.push($Xt(r))}),{elements:t}}})});var Zs,r0,x_e,KXt,f9,p9,bF,xF,Kb=H(()=>{Zs=e=>{e=KXt(e);let t=e.replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=t,r.value},r0=e=>{let r=e.getAttribute("transform")?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/),n=0,i=0;return r&&(n=Number(r[1]),i=Number(r[2])),{transformX:n,transformY:i}},x_e=e=>{let t=e;return t=t.replace(/style.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/classDef.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/#\w+;/g,r=>{let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?`\uFB02\xB0\xB0${n}\xB6\xDF`:`\uFB02\xB0${n}\xB6\xDF`}),t},KXt=function(e){return e.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},f9=(e,t=.5)=>{let r=[];return e.forEach(n=>{let i=r[r.length-1];if(!i){r.push(n);return}Math.hypot(n[0]-i[0],n[1]-i[1])<=t||r.push(n)}),r},p9=e=>{let t=e.getAttribute("d");if(!t)return null;let r=Array.from(t.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),n=>Number(n[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},bF=e=>{let t=e.getAttribute("data-points");if(!t){let r=p9(e);return r?[{x:r.startX,y:r.startY},{x:r.endX,y:r.endY}]:[]}try{let r=atob(t),n=JSON.parse(r);return Array.isArray(n)?n.filter(i=>i&&typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)):[]}catch{return[]}},xF=(e,t={x:0,y:0},r="LM")=>{if(e.tagName.toLowerCase()!=="path")throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${e.tagName}`);let n=e.getAttribute("d");if(!n)throw new Error('Path element does not contain a "d" attribute');let i=n.split(new RegExp(`(?=[${r}])`)),a=i[0].substring(1).split(",").map(l=>parseFloat(l)),o=i[i.length-1].substring(1).split(",").map(l=>parseFloat(l)),s=i.map(l=>{let u=l[0],d=l.substring(1).split(",").map(h=>parseFloat(h));return u==="C"?{x:d[4],y:d[5],command:u}:{x:d[0],y:d[1],command:u}}).filter((l,u,d)=>{if(u===0||u===d.length-1)return!0;if(l.x===d[u-1].x&&l.y===d[u-1].y||u===d.length-2&&l.command==="C")return!1;if(u===d.length-2&&(d[u-1].x===l.x||d[u-1].y===l.y)){let h=d[d.length-1];return Math.hypot(h.x-l.x,h.y-l.y)>20}return l.x!==d[u-1].x||l.y!==d[u-1].y}).map(l=>({x:l.x+t.x,y:l.y+t.y}));return{startX:a[0]+t.x,startY:a[1]+t.y,endX:o[0]+t.x,endY:o[1]+t.y,reflectionPoints:s}}});var ZXt,w_e,E_e=H(()=>{i_e();o_e();c_e();d_e();f_e();b_e();Kb();ZXt=e=>({...e,elements:e.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;let r=t.points;if(r.length<2)return t;let n=f9(r);return n.length===r.length?t:{...t,points:n}})}),w_e=(e,t={})=>{let r=(()=>{switch(e.type){case"graphImage":return a_e.convert(e,t);case"flowchart":return n_e.convert(e,t);case"sequence":return l_e.convert(e,t);case"class":return u_e.convert(e,t);case"erd":return h_e.convert(e,t);case"state":return v_e.convert(e,t);default:throw new Error(`graphToExcalidraw: unknown graph type "${e.type}, only flowcharts are supported!"`)}})();return ZXt(r)}});var T_e,k,Zb,xr=H(()=>{T_e=Object.defineProperty,k=(e,t)=>T_e(e,"name",{value:t,configurable:!0}),Zb=(e,t)=>{for(var r in t)T_e(e,r,{get:t[r],enumerable:!0})}});var wF=Bn((Zae,Qae)=>{(function(e,t){typeof Zae=="object"&&typeof Qae<"u"?Qae.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Zae,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",a="minute",o="hour",s="day",l="week",u="month",d="quarter",h="year",f="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={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(I){var A=["th","st","nd","rd"],P=I%100;return"["+I+(A[(P-20)%10]||A[P]||A[0])+"]"}},v=function(I,A,P){var D=String(I);return!D||D.length>=A?I:""+Array(A+1-D.length).join(P)+I},b={s:v,z:function(I){var A=-I.utcOffset(),P=Math.abs(A),D=Math.floor(P/60),M=P%60;return(A<=0?"+":"-")+v(D,2,"0")+":"+v(M,2,"0")},m:function I(A,P){if(A.date()1)return I(_[0])}else{var B=A.name;E[B]=A,M=B}return!D&&M&&(x=M),M||!D&&x},S=function(I,A){if(T(I))return I.clone();var P=typeof A=="object"?A:{};return P.date=I,P.args=arguments,new U(P)},R=b;R.l=C,R.i=T,R.w=function(I,A){return S(I,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function I(P){this.$L=C(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[w]=!0}var A=I.prototype;return A.parse=function(P){this.$d=(function(D){var M=D.date,O=D.utc;if(M===null)return new Date(NaN);if(R.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var _=M.match(m);if(_){var B=_[2]-1||0,F=(_[7]||"0").substring(0,3);return O?new Date(Date.UTC(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,F)):new Date(_[1],B,_[3]||1,_[4]||0,_[5]||0,_[6]||0,F)}}return new Date(M)})(P),this.init()},A.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},A.$utils=function(){return R},A.isValid=function(){return this.$d.toString()!==p},A.isSame=function(P,D){var M=S(P);return this.startOf(D)<=M&&M<=this.endOf(D)},A.isAfter=function(P,D){return S(P){xr();k_e=Ue(wF(),1),K1={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ye={trace:k((...e)=>{},"trace"),debug:k((...e)=>{},"debug"),info:k((...e)=>{},"info"),warn:k((...e)=>{},"warn"),error:k((...e)=>{},"error"),fatal:k((...e)=>{},"fatal")},m9=k(function(e="fatal"){let t=K1.fatal;typeof e=="string"?e.toLowerCase()in K1&&(t=K1[e]):typeof e=="number"&&(t=e),ye.trace=()=>{},ye.debug=()=>{},ye.info=()=>{},ye.warn=()=>{},ye.error=()=>{},ye.fatal=()=>{},t<=K1.fatal&&(ye.fatal=console.error?console.error.bind(console,kf("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",kf("FATAL"))),t<=K1.error&&(ye.error=console.error?console.error.bind(console,kf("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",kf("ERROR"))),t<=K1.warn&&(ye.warn=console.warn?console.warn.bind(console,kf("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",kf("WARN"))),t<=K1.info&&(ye.info=console.info?console.info.bind(console,kf("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",kf("INFO"))),t<=K1.debug&&(ye.debug=console.debug?console.debug.bind(console,kf("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",kf("DEBUG"))),t<=K1.trace&&(ye.trace=console.debug?console.debug.bind(console,kf("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",kf("TRACE")))},"setLogLevel"),kf=k(e=>`%c${(0,k_e.default)().format("ss.SSS")} : ${e} : `,"format")});var EF,C_e,S_e=H(()=>{EF={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=>{let t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?e+(t-e)*6*r:r<.5?t:r<.6666666666666666?e+(t-e)*(.6666666666666666-r)*6:e),hsl2rgb:({h:e,s:t,l:r},n)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;let i=r<.5?r*(1+t):r+t-r*t,a=2*r-i;switch(n){case"r":return EF.hue2rgb(a,i,e+.3333333333333333)*255;case"g":return EF.hue2rgb(a,i,e)*255;case"b":return EF.hue2rgb(a,i,e-.3333333333333333)*255}},rgb2hsl:({r:e,g:t,b:r},n)=>{e/=255,t/=255,r/=255;let i=Math.max(e,t,r),a=Math.min(e,t,r),o=(i+a)/2;if(n==="l")return o*100;if(i===a)return 0;let s=i-a,l=o>.5?s/(2-i-a):s/(i+a);if(n==="s")return l*100;switch(i){case e:return((t-r)/s+(t{QXt={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},A_e=QXt});var JXt,I_e,R_e=H(()=>{JXt={dec2hex:e=>{let t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},I_e=JXt});var e$t,Or,Dm=H(()=>{S_e();U_e();R_e();e$t={channel:C_e,lang:A_e,unit:I_e},Or=e$t});var Z1,Qs,g9=H(()=>{Dm();Z1={};for(let e=0;e<=255;e++)Z1[e]=Or.unit.dec2hex(e);Qs={ALL:0,RGB:1,HSL:2}});var Jae,M_e,L_e=H(()=>{g9();Jae=class{constructor(){this.type=Qs.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Qs.ALL}is(t){return this.type===t}},M_e=Jae});var eoe,D_e,N_e=H(()=>{Dm();L_e();g9();eoe=class{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new M_e}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Qs.ALL,this}_ensureHSL(){let t=this.data,{h:r,s:n,l:i}=t;r===void 0&&(t.h=Or.channel.rgb2hsl(t,"h")),n===void 0&&(t.s=Or.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=Or.channel.rgb2hsl(t,"l"))}_ensureRGB(){let t=this.data,{r,g:n,b:i}=t;r===void 0&&(t.r=Or.channel.hsl2rgb(t,"r")),n===void 0&&(t.g=Or.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=Or.channel.hsl2rgb(t,"b"))}get r(){let t=this.data,r=t.r;return!this.type.is(Qs.HSL)&&r!==void 0?r:(this._ensureHSL(),Or.channel.hsl2rgb(t,"r"))}get g(){let t=this.data,r=t.g;return!this.type.is(Qs.HSL)&&r!==void 0?r:(this._ensureHSL(),Or.channel.hsl2rgb(t,"g"))}get b(){let t=this.data,r=t.b;return!this.type.is(Qs.HSL)&&r!==void 0?r:(this._ensureHSL(),Or.channel.hsl2rgb(t,"b"))}get h(){let t=this.data,r=t.h;return!this.type.is(Qs.RGB)&&r!==void 0?r:(this._ensureRGB(),Or.channel.rgb2hsl(t,"h"))}get s(){let t=this.data,r=t.s;return!this.type.is(Qs.RGB)&&r!==void 0?r:(this._ensureRGB(),Or.channel.rgb2hsl(t,"s"))}get l(){let t=this.data,r=t.l;return!this.type.is(Qs.RGB)&&r!==void 0?r:(this._ensureRGB(),Or.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Qs.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Qs.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Qs.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Qs.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Qs.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Qs.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},D_e=eoe});var t$t,Qb,y9=H(()=>{N_e();t$t=new D_e({r:0,g:0,b:0,a:0},"transparent"),Qb=t$t});var __e,F5,toe=H(()=>{y9();g9();__e={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;let t=e.match(__e.re);if(!t)return;let r=t[1],n=parseInt(r,16),i=r.length,a=i%4===0,o=i>4,s=o?1:17,l=o?8:4,u=a?0:-1,d=o?255:15;return Qb.set({r:(n>>l*(u+3)&d)*s,g:(n>>l*(u+2)&d)*s,b:(n>>l*(u+1)&d)*s,a:a?(n&d)*s/255:1},e)},stringify:e=>{let{r:t,g:r,b:n,a:i}=e;return i<1?`#${Z1[Math.round(t)]}${Z1[Math.round(r)]}${Z1[Math.round(n)]}${Z1[Math.round(i*255)]}`:`#${Z1[Math.round(t)]}${Z1[Math.round(r)]}${Z1[Math.round(n)]}`}},F5=__e});var TF,v9,P_e=H(()=>{Dm();y9();TF={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=>{let t=e.match(TF.hueRe);if(t){let[,r,n]=t;switch(n){case"grad":return Or.channel.clamp.h(parseFloat(r)*.9);case"rad":return Or.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Or.channel.clamp.h(parseFloat(r)*360)}}return Or.channel.clamp.h(parseFloat(e))},parse:e=>{let t=e.charCodeAt(0);if(t!==104&&t!==72)return;let r=e.match(TF.re);if(!r)return;let[,n,i,a,o,s]=r;return Qb.set({h:TF._hue2deg(n),s:Or.channel.clamp.s(parseFloat(i)),l:Or.channel.clamp.l(parseFloat(a)),a:o?Or.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{let{h:t,s:r,l:n,a:i}=e;return i<1?`hsla(${Or.lang.round(t)}, ${Or.lang.round(r)}%, ${Or.lang.round(n)}%, ${i})`:`hsl(${Or.lang.round(t)}, ${Or.lang.round(r)}%, ${Or.lang.round(n)}%)`}},v9=TF});var kF,roe,O_e=H(()=>{toe();kF={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();let t=kF.colors[e];if(t)return F5.parse(t)},stringify:e=>{let t=F5.stringify(e);for(let r in kF.colors)if(kF.colors[r]===t)return r}},roe=kF});var B_e,b9,F_e=H(()=>{Dm();y9();B_e={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=>{let t=e.charCodeAt(0);if(t!==114&&t!==82)return;let r=e.match(B_e.re);if(!r)return;let[,n,i,a,o,s,l,u,d]=r;return Qb.set({r:Or.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Or.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:Or.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:u?Or.channel.clamp.a(d?parseFloat(u)/100:parseFloat(u)):1},e)},stringify:e=>{let{r:t,g:r,b:n,a:i}=e;return i<1?`rgba(${Or.lang.round(t)}, ${Or.lang.round(r)}, ${Or.lang.round(n)}, ${Or.lang.round(i)})`:`rgb(${Or.lang.round(t)}, ${Or.lang.round(r)}, ${Or.lang.round(n)})`}},b9=B_e});var r$t,Js,Q1=H(()=>{toe();P_e();O_e();F_e();g9();r$t={format:{keyword:roe,hex:F5,rgb:b9,rgba:b9,hsl:v9,hsla:v9},parse:e=>{if(typeof e!="string")return e;let t=F5.parse(e)||b9.parse(e)||v9.parse(e)||roe.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Qs.HSL)||e.data.r===void 0?v9.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?b9.stringify(e):F5.stringify(e)},Js=r$t});var n$t,CF,noe=H(()=>{Dm();Q1();n$t=(e,t)=>{let r=Js.parse(e);for(let n in t)r[n]=Or.channel.clamp[n](t[n]);return Js.stringify(r)},CF=n$t});var i$t,ls,ioe=H(()=>{Dm();y9();Q1();noe();i$t=(e,t,r=0,n=1)=>{if(typeof e!="number")return CF(e,{a:t});let i=Qb.set({r:Or.channel.clamp.r(e),g:Or.channel.clamp.g(t),b:Or.channel.clamp.b(r),a:Or.channel.clamp.a(n)});return Js.stringify(i)},ls=i$t});var a$t,z5,z_e=H(()=>{Dm();Q1();a$t=(e,t)=>Or.lang.round(Js.parse(e)[t]),z5=a$t});var o$t,G_e,W_e=H(()=>{Dm();Q1();o$t=e=>{let{r:t,g:r,b:n}=Js.parse(e),i=.2126*Or.channel.toLinear(t)+.7152*Or.channel.toLinear(r)+.0722*Or.channel.toLinear(n);return Or.lang.round(i)},G_e=o$t});var s$t,V_e,H_e=H(()=>{W_e();s$t=e=>G_e(e)>=.5,V_e=s$t});var l$t,Gi,q_e=H(()=>{H_e();l$t=e=>!V_e(e),Gi=l$t});var c$t,ak,SF=H(()=>{Dm();Q1();c$t=(e,t,r)=>{let n=Js.parse(e),i=n[t],a=Or.channel.clamp[t](i+r);return i!==a&&(n[t]=a),Js.stringify(n)},ak=c$t});var u$t,st,Y_e=H(()=>{SF();u$t=(e,t)=>ak(e,"l",t),st=u$t});var d$t,lt,j_e=H(()=>{SF();d$t=(e,t)=>ak(e,"l",-t),lt=d$t});var h$t,AF,X_e=H(()=>{SF();h$t=(e,t)=>ak(e,"a",-t),AF=h$t});var f$t,be,$_e=H(()=>{Q1();noe();f$t=(e,t)=>{let r=Js.parse(e),n={};for(let i in t)t[i]&&(n[i]=r[i]+t[i]);return CF(e,n)},be=f$t});var p$t,K_e,Z_e=H(()=>{Q1();ioe();p$t=(e,t,r=50)=>{let{r:n,g:i,b:a,a:o}=Js.parse(e),{r:s,g:l,b:u,a:d}=Js.parse(t),h=r/100,f=h*2-1,p=o-d,g=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-g,v=n*g+s*y,b=i*g+l*y,x=a*g+u*y,E=o*h+d*(1-h);return ls(v,b,x,E)},K_e=p$t});var m$t,et,Q_e=H(()=>{Q1();Z_e();m$t=(e,t=100)=>{let r=Js.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,K_e(r,e,t)},et=m$t});var J_e=H(()=>{ioe();z_e();q_e();Y_e();j_e();X_e();$_e();Q_e()});var Ts=H(()=>{J_e()});function g$t(e,t){this.v=e,this.k=t}function ePe(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:G5;if(tPe&&tPe(e,null),!sk(t))return e;let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){let a=r(i);a!==i&&(E$t(t)||(t[n]=a),i=a)}e[i]=!0}return e}function I$t(e){for(let t=0;t0&&arguments[0]!==void 0?arguments[0]:Y$t(),t=Bt=>xPe(Bt);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==ks.document||!e.Element)return t.isSupported=!1,t;let r=e.document,n=r,i=n.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,h=s.prototype,f=Cf(h,"cloneNode"),p=Cf(h,"remove"),m=Cf(h,"removeAttributeNode"),g=Cf(h,"nextSibling"),y=Cf(h,"childNodes"),v=Cf(h,"parentNode"),b=Cf(h,"shadowRoot"),x=Cf(h,"attributes"),E=o&&o.prototype?Cf(o.prototype,"nodeType"):null,w=o&&o.prototype?Cf(o.prototype,"nodeName"):null,T=o&&o.prototype?Cf(o.prototype,"ownerDocument"):null,C=function(Pe){return E?E(Pe):Pe.nodeType},S=function(Pe){return w?w(Pe):Pe.nodeName},R=M$t(h,"namespaceURI"),U=function(Pe){return R?R(Pe):Pe.namespaceURI};if(typeof a=="function"){let Bt=r.createElement("template");Bt.content&&Bt.content.ownerDocument&&(r=Bt.content.ownerDocument)}let L,I="",A,P=!1,D=0,M=function(){if(D>0)throw ey('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},O=function(Pe){M(),D++;try{return L.createHTML(Pe)}finally{D--}},_=function(Pe){M(),D++;try{return L.createScriptURL(Pe)}finally{D--}},B=function(){return P||(A=j$t(d,i),P=!0),A},F=r,G=F.implementation,z=F.createNodeIterator,V=F.createDocumentFragment,$=F.getElementsByTagName,Z=n.importNode,re=pPe();t.isSupported=typeof mPe=="function"&&typeof v=="function"&&G&&G.createHTMLDocument!==void 0;let Q=_$t,ge=P$t,ie=O$t,pe=B$t,ue=F$t,fe=z$t,Me=G$t,Ce=V$t,Ye=dPe,Ze=null,Qe=gi({},[...sPe,...coe,...uoe,...doe,...lPe]),ve=null,Fe=gi({},[...cPe,...hoe,...uPe,...IF]),Le=Object.seal(ok(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}})),Be=null,ae=null,he=Object.seal(ok(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),de=!0,me=!0,ke=!1,le=!0,W=!1,X=!0,q=!1,j=!1,se=null,J=null,K=!1,ee=!1,Se=!1,Te=!1,Ae=!0,Ie=!1,Ge="user-content-",De=!0,He=!1,ze=null,Ke={},we=null,bt=gi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ve=null,vt=gi({},["audio","video","img","source","image","track"]),Pt=null,Xt=gi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),It="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml",Ee=Et,gt=!1,Ut=null,ct=gi({},[It,Ot,Et],loe),Ne=Ul(["mi","mo","mn","ms","mtext"]),at=gi({},Ne),ft=Ul(["annotation-xml"]),Ct=gi({},ft),Er=gi({},["title","style","font","a","script"]),Wt=null,Sr=["application/xhtml+xml","text/html"],on="text/html",ir=null,Jt=null,Ar=r.createElement("form"),ot=function(Pe){return Pe instanceof RegExp||Pe instanceof Function},wt=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Jt&&Jt===Pe)return;(!Pe||typeof Pe!="object")&&(Pe={}),Pe=bh(Pe),Wt=Sr.indexOf(Pe.PARSER_MEDIA_TYPE)===-1?on:Pe.PARSER_MEDIA_TYPE,ir=Wt==="application/xhtml+xml"?loe:G5,Ze=Jb(Pe,"ALLOWED_TAGS",Qe,{transform:ir}),ve=Jb(Pe,"ALLOWED_ATTR",Fe,{transform:ir}),Ut=Jb(Pe,"ALLOWED_NAMESPACES",ct,{transform:loe}),Pt=Jb(Pe,"ADD_URI_SAFE_ATTR",Xt,{transform:ir,base:Xt}),Ve=Jb(Pe,"ADD_DATA_URI_TAGS",vt,{transform:ir,base:vt}),we=Jb(Pe,"FORBID_CONTENTS",bt,{transform:ir}),Be=Jb(Pe,"FORBID_TAGS",bh({}),{transform:ir}),ae=Jb(Pe,"FORBID_ATTR",bh({}),{transform:ir}),Ke=bd(Pe,"USE_PROFILES")?Pe.USE_PROFILES&&typeof Pe.USE_PROFILES=="object"?bh(Pe.USE_PROFILES):Pe.USE_PROFILES:!1,de=Pe.ALLOW_ARIA_ATTR!==!1,me=Pe.ALLOW_DATA_ATTR!==!1,ke=Pe.ALLOW_UNKNOWN_PROTOCOLS||!1,le=Pe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=Pe.SAFE_FOR_TEMPLATES||!1,X=Pe.SAFE_FOR_XML!==!1,q=Pe.WHOLE_DOCUMENT||!1,ee=Pe.RETURN_DOM||!1,Se=Pe.RETURN_DOM_FRAGMENT||!1,Te=Pe.RETURN_TRUSTED_TYPE||!1,K=Pe.FORCE_BODY||!1,Ae=Pe.SANITIZE_DOM!==!1,Ie=Pe.SANITIZE_NAMED_PROPS||!1,De=Pe.KEEP_CONTENT!==!1,He=Pe.IN_PLACE||!1,Ye=L$t(Pe.ALLOWED_URI_REGEXP)?Pe.ALLOWED_URI_REGEXP:dPe,Ee=typeof Pe.NAMESPACE=="string"?Pe.NAMESPACE:Et,at=poe(Pe,"MATHML_TEXT_INTEGRATION_POINTS",()=>gi({},Ne)),Ct=poe(Pe,"HTML_INTEGRATION_POINTS",()=>gi({},ft));let tt=poe(Pe,"CUSTOM_ELEMENT_HANDLING",()=>ok(null));if(Le=ok(null),bd(tt,"tagNameCheck")&&ot(tt.tagNameCheck)&&(Le.tagNameCheck=tt.tagNameCheck),bd(tt,"attributeNameCheck")&&ot(tt.attributeNameCheck)&&(Le.attributeNameCheck=tt.attributeNameCheck),bd(tt,"allowCustomizedBuiltInElements")&&typeof tt.allowCustomizedBuiltInElements=="boolean"&&(Le.allowCustomizedBuiltInElements=tt.allowCustomizedBuiltInElements),tc(Le),W&&(me=!1),Se&&(ee=!0),Ke&&(Ze=gi({},lPe),ve=ok(null),Ke.html===!0&&(gi(Ze,sPe),gi(ve,cPe)),Ke.svg===!0&&(gi(Ze,coe),gi(ve,hoe),gi(ve,IF)),Ke.svgFilters===!0&&(gi(Ze,uoe),gi(ve,hoe),gi(ve,IF)),Ke.mathMl===!0&&(gi(Ze,doe),gi(ve,uPe),gi(ve,IF))),he.tagCheck=null,he.attributeCheck=null,bd(Pe,"ADD_TAGS")&&(typeof Pe.ADD_TAGS=="function"?he.tagCheck=Pe.ADD_TAGS:sk(Pe.ADD_TAGS)&&(Ze===Qe&&(Ze=bh(Ze)),gi(Ze,Pe.ADD_TAGS,ir))),bd(Pe,"ADD_ATTR")&&(typeof Pe.ADD_ATTR=="function"?he.attributeCheck=Pe.ADD_ATTR:sk(Pe.ADD_ATTR)&&(ve===Fe&&(ve=bh(ve)),gi(ve,Pe.ADD_ATTR,ir))),bd(Pe,"ADD_FORBID_CONTENTS")&&sk(Pe.ADD_FORBID_CONTENTS)&&(we===bt&&(we=bh(we)),gi(we,Pe.ADD_FORBID_CONTENTS,ir)),De&&(Ze["#text"]=!0),q&&gi(Ze,["html","head","body"]),Ze.table&&(gi(Ze,["tbody"]),delete Be.tbody),Pe.TRUSTED_TYPES_POLICY){if(typeof Pe.TRUSTED_TYPES_POLICY.createHTML!="function")throw ey('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Pe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ey('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let Rt=L;L=Pe.TRUSTED_TYPES_POLICY;try{I=O("")}catch(Mt){throw L=Rt,Mt}}else Pe.TRUSTED_TYPES_POLICY===null?(L=void 0,I=""):(L===void 0&&(L=B()),L&&typeof I=="string"&&(I=O("")));Ul&&Ul(Pe),Jt=Pe},zt=gi({},[...coe,...uoe,...D$t]),Pr=gi({},[...doe,...N$t]),Dr=function(Pe,tt,Rt){return tt.namespaceURI===Et?Pe==="svg":tt.namespaceURI===It?Pe==="svg"&&(Rt==="annotation-xml"||at[Rt]):!!zt[Pe]},Ln=function(Pe,tt,Rt){return tt.namespaceURI===Et?Pe==="math":tt.namespaceURI===Ot?Pe==="math"&&Ct[Rt]:!!Pr[Pe]},Si=function(Pe,tt,Rt){return tt.namespaceURI===Ot&&!Ct[Rt]||tt.namespaceURI===It&&!at[Rt]?!1:!Pr[Pe]&&(Er[Pe]||!zt[Pe])},wn=function(Pe){let tt=U(Pe),Rt=G5(S(Pe)),Mt=v(Pe),zr,En;return Mt&&C(Mt)===ks.element?(zr={namespaceURI:U(Mt)},En=G5(S(Mt))):(zr={namespaceURI:Ee},En="template"),Ut[tt]?tt===Ot?Dr(Rt,zr,En):tt===It?Ln(Rt,zr,En):tt===Et?Si(Rt,zr,En):!!(Wt==="application/xhtml+xml"&&Ut[tt]):!1},Vt=function(Pe){x9(t.removed,{element:Pe});try{v(Pe).removeChild(Pe)}catch{if(p(Pe),!v(Pe))throw ey("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},At=function(Pe,tt,Rt){try{m(Pe,tt)}catch{try{Pe.removeAttribute(Rt)}catch{}}},tr=function(Pe){_e(Pe);let tt=y(Pe);tt&&J1(k$t(tt),Mt=>{try{p(Mt)}catch{}});let Rt=C(Pe)===ks.element?x(Pe):null;if(Rt)for(let Mt=Rt.length-1;Mt>=0;--Mt){let zr=Rt[Mt],En=zr&&zr.name;typeof En=="string"&&At(Pe,zr,En)}},$t=function(Pe,tt,Rt){if(!Rt)try{Rt=tt.getAttributeNode(Pe)}catch{Rt=null}x9(t.removed,{attribute:Rt||null,from:tt});try{Rt?m(tt,Rt):tt.removeAttribute(Pe)}catch{try{tt.removeAttribute(Pe)}catch{}}if(Pe==="is")if(ee||Se)try{Vt(tt)}catch{}else try{tt.setAttribute(Pe,"")}catch{}},Dt=function(Pe){let tt=x(Pe);if(tt)for(let Rt=tt.length-1;Rt>=0;--Rt){let Mt=tt[Rt],zr=Mt&&Mt.name;typeof zr!="string"||ve[ir(zr)]||At(Pe,Mt,zr)}},kr=function(Pe,tt){let Rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Mt=[Pe];for(;Mt.length>0;){let zr=Mt.pop();if(tt(zr)===!1)continue;if(Rt&&C(zr)===ks.element){let $n=b(zr);Za($n)&&Mt.push($n)}let En=y(zr);if(En)for(let $n=En.length-1;$n>=0;--$n)Mt.push(En[$n])}},_e=function(Pe){kr(Pe,tt=>{C(tt)===ks.element&&Dt(tt)})},aa=function(Pe){let tt=[];return kr(Pe,Rt=>{tt.push(Rt)},!0),tt},We=function(Pe,tt){let Rt=ooe();J1(aa(Pe),Mt=>{C(Mt)===ks.element&&soe(Rt,Mt)}),J1(tt,Mt=>{C(Mt)===ks.element&&!w9(Rt,Mt)&&Dt(Mt)})},cn=function(Pe,tt){let Rt=!1;return J1(t.removed,Mt=>{Mt.element&&(Rt=Rt||Mt.element===Pe,_e(Mt.element))}),We(Pe,tt),Rt},Fs=8,hp=function(Pe,tt){let Rt=ze,Mt=null,zr=()=>(Mt||(Mt=ooe(),J1(tt,En=>{soe(Mt,En)})),Mt);for(let En=0;;En++){let $n=aa(Pe),Gs=[Pe],Q0=!1;if(J1($n,su=>{C(su)===ks.documentFragment?x9(Gs,su):!Q0&&!w9(Rt,su)&&(Q0=w9(zr(),su))}),!Q0)return;if(En>=Fs)throw ey("the tree kept changing during in-place sanitization; refusing to return it");J1(Gs,(su,ed)=>{Iv(su,ed>0,Pe,zr())})}},Iv=function(Pe,tt,Rt,Mt){let zr=f1(Pe),En;for(;En=zr.nextNode();)!w9(Mt,En)||w9(ze,En)||(tt&&zs(re.uponSanitizeShadowNode,En,null),th(En,Rt),fZ(En,Rt),Za(En.content)&&p7(En.content))},Rv=function(Pe){ze&&soe(ze,Pe)},bw=function(Pe,tt){return X?Pe==="patchsrc"?!0:Pe==="for"&&tt!=="label"&&tt!=="output":!1},go=function(Pe){X&&kr(Pe,tt=>{let Rt=C(tt);if(Rt===ks.processingInstruction||Rt===ks.comment&&ec(hPe,tt.data)){try{p(tt)}catch{}return!1}if(Rt===ks.element){let Mt=tt,zr=ir(S(tt));try{Mt.hasAttribute&&Mt.hasAttribute("patchsrc")&&Mt.removeAttribute("patchsrc"),Mt.hasAttribute&&Mt.hasAttribute("for")&&bw("for",zr)&&Mt.removeAttribute("for")}catch{}}return!0})},Jd=function(Pe){let tt=null,Rt=null;if(K)Pe=""+Pe;else{let En=nPe(Pe,/^[\r\n\t ]+/);Rt=En&&En[0]}Wt==="application/xhtml+xml"&&Ee===Et&&(Pe=''+Pe+"");let Mt=L?O(Pe):Pe;if(Ee===Et)try{tt=new u().parseFromString(Mt,Wt)}catch{}if(!tt||!tt.documentElement){tt=G.createDocument(Ee,"template",null);try{tt.documentElement.innerHTML=gt?I:Mt}catch{}}let zr=tt.body||tt.documentElement;return Pe&&Rt&&zr.insertBefore(r.createTextNode(Rt),zr.childNodes[0]||null),Ee===Et?$.call(tt,q?"html":"body")[0]:q?tt.documentElement:zr},f1=function(Pe){let tt=T?T(Pe):Pe.ownerDocument;return z.call(tt||Pe,Pe,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},eh=function(Pe){return Pe=E9(Pe,Q," "),Pe=E9(Pe,ge," "),Pe=E9(Pe,ie," "),Pe},Mv=function(Pe){var tt;yl(Pe);let Rt=(tt=Pe.querySelectorAll)===null||tt===void 0?void 0:tt.call(Pe,"template");Rt&&J1(Rt,Mt=>{Za(Mt.content)&&Mv(Mt.content)})},yl=function(Pe){Pe.normalize();let tt=T?T(Pe):Pe.ownerDocument,Rt=z.call(tt||Pe,Pe,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),Mt=Rt.nextNode();for(;Mt;)Mt.data=eh(Mt.data),Mt=Rt.nextNode()},p1=function(Pe){let tt=w?w(Pe):null;return typeof tt!="string"||ir(tt)!=="form"?!1:typeof Pe.nodeName!="string"||typeof Pe.textContent!="string"||typeof Pe.removeChild!="function"||Pe.attributes!==x(Pe)||typeof Pe.removeAttribute!="function"||typeof Pe.removeAttributeNode!="function"||typeof Pe.getAttributeNode!="function"||typeof Pe.setAttribute!="function"||typeof Pe.namespaceURI!="string"||typeof Pe.insertBefore!="function"||typeof Pe.hasChildNodes!="function"||Pe.nodeType!==E(Pe)||Pe.childNodes!==y(Pe)},Za=function(Pe){if(!E||typeof Pe!="object"||Pe===null)return!1;try{return E(Pe)===ks.documentFragment}catch{return!1}},m1=function(Pe){if(!E||typeof Pe!="object"||Pe===null)return!1;try{return typeof E(Pe)=="number"}catch{return!1}};function zs(Bt,Pe,tt){Bt.length!==0&&J1(Bt,Rt=>{Rt.call(t,Pe,tt,Jt)})}let Ju=function(Pe,tt){return!!(X&&Pe.hasChildNodes()&&!m1(Pe.firstElementChild)&&ec(foe,Pe.textContent)&&ec(foe,Pe.innerHTML)||X&&q$t[tt]&&C(Pe)===ks.element&&U(Pe)===Et&&(m1(Pe.firstElementChild)||typeof Pe.textContent=="string"&&ec(foe,Pe.textContent))||Pe.nodeType===ks.processingInstruction||X&&Pe.nodeType===ks.comment&&ec(hPe,Pe.data))},d7=function(Pe,tt){if(Pe instanceof RegExp)return ec(Pe,tt);if(Pe instanceof Function){for(var Rt=arguments.length,Mt=new Array(Rt>2?Rt-2:0),zr=2;zr=0;--$n){let Gs=Pe===Rt?f(zr[$n],!0):zr[$n];Mt.insertBefore(Gs,g(Pe))}}}return Vt(Pe),!0},g1=function(Pe,tt,Rt,Mt){return Pe.length===0?tt:tt===Rt||tt===Mt?bh(tt):tt},fp=function(Pe,tt){return Pe===tt||v(Pe)!==null?!1:(He&&_e(Pe),!0)},th=function(Pe,tt){if(Rv(Pe),zs(re.beforeSanitizeElements,Pe,null),fp(Pe,tt))return!0;if(p1(Pe))return Vt(Pe),!0;let Rt=ir(S(Pe));if(Ze=g1(re.uponSanitizeElement,Ze,Qe,se),zs(re.uponSanitizeElement,Pe,{tagName:Rt,allowedTags:Ze}),fp(Pe,tt))return!0;if(Ju(Pe,Rt))return Vt(Pe),!0;if(Be[Rt]||!(he.tagCheck instanceof Function&&he.tagCheck(Rt))&&!Ze[Rt]){let Mt=h7(Pe,Rt,tt);return Mt===!1&&(zs(re.afterSanitizeElements,Pe,null),fp(Pe,tt))?!0:Mt}if(C(Pe)===ks.element&&!wn(Pe)||(Rt==="noscript"||Rt==="noembed"||Rt==="noframes")&&ec(H$t,Pe.innerHTML))return Vt(Pe),!0;if(W&&Pe.nodeType===ks.text){let Mt=eh(Pe.textContent);Pe.textContent!==Mt&&(x9(t.removed,{element:Pe.cloneNode()}),Pe.textContent=Mt)}return zs(re.afterSanitizeElements,Pe,null),fp(Pe,tt)},f7=function(Pe,tt,Rt){if(ae[tt]||bw(tt,Pe)||Ae&&(tt==="id"||tt==="name")&&(Rt in r||Rt in Ar))return!1;let Mt=ve[tt]||he.attributeCheck instanceof Function&&he.attributeCheck(tt,Pe);return me&&ec(pe,tt)||de&&ec(ue,tt)?!0:Mt?Pt[tt]||ec(Ye,E9(Rt,Me,""))||(tt==="src"||tt==="xlink:href"||tt==="href")&&Pe!=="script"&&iPe(Rt,"data:")===0&&Ve[Pe]||ke&&!ec(fe,E9(Rt,Me,""))?!0:!Rt:eE(Pe)&&d7(Le.tagNameCheck,Pe)&&d7(Le.attributeNameCheck,tt,Pe)||tt==="is"&&Le.allowCustomizedBuiltInElements&&d7(Le.tagNameCheck,Rt)},J6=gi({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),eE=function(Pe){return!J6[G5(Pe)]&&ec(Ce,Pe)},ou=function(Pe,tt,Rt,Mt){if(L&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Rt)switch(d.getAttributeType(Pe,tt)){case"TrustedHTML":return O(Mt);case"TrustedScriptURL":return _(Mt)}return Mt},Y9t=function(Pe,tt,Rt,Mt){try{return Rt?Pe.setAttributeNS(Rt,tt,Mt):Pe.setAttribute(tt,Mt),p1(Pe)?(Vt(Pe),!1):!0}catch{return $t(tt,Pe),!1}},n6e=function(Pe,tt){return X&&ec(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,tt)?!0:G5(Pe)==="attributename"&&nPe(tt,"href")!==null},fZ=function(Pe,tt){if(zs(re.beforeSanitizeAttributes,Pe,null),fp(Pe,tt))return;let Rt=Pe.attributes;if(!Rt||p1(Pe))return;ve=g1(re.uponSanitizeAttribute,ve,Fe,J);let Mt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve,forceKeepAttr:void 0},zr=Rt.length,En=ir(Pe.nodeName);for(;zr--;){let $n=Rt[zr],Gs=$n.name,Q0=$n.namespaceURI,su=$n.value,ed=ir(Gs),tE=su,td=Gs==="value"?tE:S$t(tE),i6e=!1;if(Mt.attrName=ed,Mt.attrValue=td,Mt.keepAttr=!0,Mt.forceKeepAttr=void 0,zs(re.uponSanitizeAttribute,Pe,Mt),td=Mt.attrValue,Ie&&(ed==="id"||ed==="name")&&iPe(td,Ge)!==0&&($t(Gs,Pe,$n),td=Ge+td,i6e=!0),n6e(Gs,td)){$t(Gs,Pe,$n);continue}if(!Mt.forceKeepAttr){if(!Mt.keepAttr){$t(Gs,Pe,$n);continue}if(!le&&ec(fPe,td)){$t(Gs,Pe,$n);continue}if(W&&(td=eh(td)),!f7(En,ed,td)){$t(Gs,Pe,$n);continue}td=ou(En,ed,Q0,td),td!==tE&&Y9t(Pe,Gs,Q0,td)&&i6e&&rPe(t.removed)}}zs(re.afterSanitizeAttributes,Pe,null),fp(Pe,tt)},p7=function(Pe){let tt=null,Rt=f1(Pe);for(zs(re.beforeSanitizeShadowDOM,Pe,null);tt=Rt.nextNode();)if(zs(re.uponSanitizeShadowNode,tt,null),th(tt,Pe),fZ(tt,Pe),Za(tt.content)&&p7(tt.content),C(tt)===ks.element){let Mt=b(tt);Za(Mt)&&(pZ(Mt),p7(Mt))}W&&yl(Pe),zs(re.afterSanitizeShadowDOM,Pe,null)},pZ=function(Pe){let tt=[{node:Pe,shadow:null}];for(;tt.length>0;){let Rt=tt.pop();if(Rt.shadow){p7(Rt.shadow);continue}let Mt=Rt.node,zr=C(Mt)===ks.element,En=y(Mt);if(En)for(let $n=En.length-1;$n>=0;--$n)tt.push({node:En[$n],shadow:null});if(zr){let $n=w?w(Mt):null;if(typeof $n=="string"&&ir($n)==="template"){let Gs=Mt.content;Za(Gs)&&tt.push({node:Gs,shadow:null})}}if(zr){let $n=b(Mt);Za($n)&&tt.push({node:null,shadow:$n},{node:$n,shadow:null})}}};return t.sanitize=function(Bt){let Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=null,Rt=null,Mt=null,zr=null;if(gt=!Bt,gt&&(Bt="\x3C!-->"),typeof Bt!="string"&&!m1(Bt)&&(Bt=R$t(Bt),typeof Bt!="string"))throw ey("dirty is not a string, aborting");if(!t.isSupported)return Bt;j?(Ze=se,ve=J):wt(Pe),(re.uponSanitizeElement.length>0||re.uponSanitizeAttribute.length>0)&&(Ze=bh(Ze)),re.uponSanitizeAttribute.length>0&&(ve=bh(ve)),t.removed=[];let En=He&&typeof Bt!="string"&&m1(Bt),$n=[],Gs=ze;if(En){go(Bt);let ed=S(Bt);if(typeof ed=="string"){let tE=ir(ed);if(!Ze[tE]||Be[tE])throw tr(Bt),ey("root node is forbidden and cannot be sanitized in-place")}if(p1(Bt))throw tr(Bt),ey("root node is clobbered and cannot be sanitized in-place");$n=aa(Bt),ze=ooe()}else if(m1(Bt))tt=Jd("\x3C!---->"),Rt=tt.ownerDocument.importNode(Bt,!0),Rt.nodeType===ks.element&&Rt.nodeName==="BODY"||Rt.nodeName==="HTML"?tt=Rt:tt.appendChild(Rt),pZ(tt);else{if(!ee&&!W&&!q&&Bt.indexOf("<")===-1)return L&&Te?O(Bt):Bt;if(tt=Jd(Bt),!tt)return ee?null:Te?I:""}tt&&K&&Vt(tt.firstChild);let Q0=En?Bt:tt;try{En&&pZ(Bt);let ed=f1(Q0);for(;Mt=ed.nextNode();)th(Mt,Q0),fZ(Mt,Q0),Za(Mt.content)&&p7(Mt.content);En&&hp(Bt,$n)}catch(ed){throw En&&(tr(Bt),cn(Bt,$n)),ed}finally{ze=Gs}if(En){if(cn(Bt,$n))throw ey("a node selected for removal could not be safely returned; refusing to sanitize in place");return W&&Mv(Bt),Bt}if(ee){if(W&&Mv(tt),Se)for(zr=V.call(tt.ownerDocument);tt.firstChild;)zr.appendChild(tt.firstChild);else zr=tt;return(ve.shadowroot||ve.shadowrootmode)&&(zr=Z.call(n,zr,!0)),zr}let su=q?tt.outerHTML:tt.innerHTML;return q&&Ze["!doctype"]&&tt.ownerDocument&&tt.ownerDocument.doctype&&tt.ownerDocument.doctype.name&&ec(W$t,tt.ownerDocument.doctype.name)&&(su=" -`+su),W&&(su=eh(su)),L&&Te?O(su):su},t.setConfig=function(){let Bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wt(Bt),j=!0,se=Ze,J=ve},t.clearConfig=function(){Jt=null,j=!1,se=null,J=null,L=A,I=""},t.isValidAttribute=function(Bt,Pe,tt){Jt||wt({});let Rt=ir(Bt),Mt=ir(Pe);return typeof tt=="string"&&(n6e(Pe,tt)||!le&&ec(fPe,tt))?!1:f7(Rt,Mt,tt)},t.addHook=function(Bt,Pe){typeof Pe=="function"&&bd(re,Bt)&&x9(re[Bt],Pe)},t.removeHook=function(Bt,Pe){if(bd(re,Bt)){if(Pe!==void 0){let tt=T$t(re[Bt],Pe);return tt===-1?void 0:C$t(re[Bt],tt,1)[0]}return rPe(re[Bt])}},t.removeHooks=function(Bt){bd(re,Bt)&&(re[Bt]=[])},t.removeAllHooks=function(){re=pPe()},t}var mPe,tPe,E$t,gPe,yPe,Ul,tc,ok,vPe,moe,goe,J1,T$t,rPe,x9,k$t,C$t,sk,ooe,soe,w9,G5,loe,nPe,E9,iPe,S$t,A$t,U$t,aPe,oPe,bd,T9,ec,ey,sPe,coe,uoe,D$t,doe,N$t,lPe,cPe,hoe,uPe,IF,_$t,P$t,O$t,B$t,F$t,dPe,z$t,G$t,W$t,V$t,foe,hPe,H$t,fPe,ks,q$t,Y$t,j$t,pPe,Jb,poe,xd,lk=H(()=>{UF.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},UF.prototype.next=function(e){return this._invoke("next",e)},UF.prototype.throw=function(e){return this._invoke("throw",e)},UF.prototype.return=function(e){return this._invoke("return",e)};mPe=Object.entries,tPe=Object.setPrototypeOf,E$t=Object.isFrozen,gPe=Object.getPrototypeOf,yPe=Object.getOwnPropertyDescriptor,Ul=Object.freeze,tc=Object.seal,ok=Object.create,vPe=typeof Reflect<"u"&&Reflect,moe=vPe.apply,goe=vPe.construct;Ul||(Ul=function(t){return t});tc||(tc=function(t){return t});moe||(moe=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:oo(BigInt.prototype.toString),oPe=typeof Symbol>"u"?null:oo(Symbol.prototype.toString),bd=oo(Object.prototype.hasOwnProperty),T9=oo(Object.prototype.toString),ec=oo(RegExp.prototype.test),ey=bPe(TypeError);sPe=Ul(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),coe=Ul(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uoe=Ul(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),D$t=Ul(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),doe=Ul(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),N$t=Ul(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lPe=Ul(["#text"]),cPe=Ul(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),hoe=Ul(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),uPe=Ul(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),IF=Ul(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_$t=tc(/{{[\w\W]*|^[\w\W]*}}/g),P$t=tc(/<%[\w\W]*|^[\w\W]*%>/g),O$t=tc(/\${[\w\W]*/g),B$t=tc(/^data-[\-\w.\u00B7-\uFFFF]+$/),F$t=tc(/^aria-[\-\w]+$/),dPe=tc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z$t=tc(/^(?:\w+script|data):/i),G$t=tc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W$t=tc(/^html$/i),V$t=tc(/^[a-z][.\w]*(-[.\w]+)+$/i),foe=tc(/<[/\w!]/g),hPe=tc(/<[/\w]/g),H$t=tc(/<\/no(script|embed|frames)/i),fPe=tc(/\/>/i),ks={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},q$t=Ul(gi({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Y$t=function(){return typeof window>"u"?null:window},j$t=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));let a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},pPe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Jb=function(t,r,n,i){return bd(t,r)&&sk(t[r])?gi(i.base?bh(i.base):{},t[r],i.transform):n},poe=function(t,r,n){let i=bd(t,r)?t[r]:void 0;return i&&typeof i=="object"?bh(i):n()};xd=xPe()});var rBe={};gr(rBe,{ParseError:()=>Yt,SETTINGS_SCHEMA:()=>WF,__defineFunction:()=>hr,__defineMacro:()=>Re,__defineSymbol:()=>te,__domTree:()=>tBe,__parse:()=>ZOe,__renderToDomTree:()=>cz,__renderToHTMLTree:()=>JOe,__setFontMetrics:()=>sOe,default:()=>PZt,render:()=>dse,renderToString:()=>KOe,version:()=>eBe});function eKt(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function tKt(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return eKt(t)}function rKt(e,t,r,n){var i=r[t];e[t]=i!==void 0?n.processor?n.processor(i):i:tKt(n)}function cKt(e){for(var t=0;t=i[0]&&e<=i[1])return r.name}return null}function rOe(e){for(var t=0;t=GF[t]&&e<=GF[t+1])return!0;return!1}function xKt(e){return"toText"in e}function kKt(e){if(e instanceof Tu)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function CKt(e){if(e instanceof i2)return e;throw new Error("Expected span but got "+String(e)+".")}function sOe(e,t){Pm[e]=t}function Joe(e,t,r){if(!Pm[t])throw new Error("Font metrics not found for font: "+t+".");var n=e.charCodeAt(0),i=Pm[t][n];if(!i&&e[0]in EPe&&(n=EPe[e[0]].charCodeAt(0),i=Pm[t][n]),!i&&r==="text"&&rOe(n)&&(i=Pm[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function AKt(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!yoe[t]){var r=yoe[t]={cssEmPerMu:RF.quad[t]/18};for(var n in RF)RF.hasOwnProperty(n)&&(r[n]=RF[n][t])}return yoe[t]}function te(e,t,r,n,i,a){so[e][i]={font:t,group:r,replace:n},a&&n&&(so[e][n]=so[e][i])}function hr(e){for(var{type:t,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l0&&(a.push(PF(o,t)),o=[]),a.push(n[s]));o.length>0&&a.push(PF(o,t));var u;r?(u=PF(tl(r,t,!0),t),u.classes=["tag"],a.push(u)):i&&a.push(i);var d=Gt(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),u){var h=u.children[0];h.style.height=Zt(d.height+d.depth),d.depth&&(h.style.verticalAlign=Zt(-d.depth))}return d}function mOe(e){return new r2(e)}function xoe(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof zo&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var r=e.children[0];return r instanceof zo&&r.text===","}else return!1}function LPe(e,t,r,n,i){var a=Eh(e,r),o;a.length===1&&a[0]instanceof Ht&&WKt.has(a[0].type)?o=a[0]:o=new Ht("mrow",a);var s=new Ht("annotation",[new zo(t)]);s.setAttribute("encoding","application/x-tex");var l=new Ht("semantics",[o,s]),u=new Ht("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var d=i?"katex":"katex-mathml";return Gt([d],[u])}function JKt(e){return e in ZKt}function Wn(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 rz(e){var t=nz(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 nz(e){return e&&(e.type==="atom"||QKt.hasOwnProperty(e.type))?e:null}function xOe(e,t){var r=tl(e.body,t,!0);return Gt([e.mclass],r,t)}function wOe(e,t){var r,n=Eh(e.body,t);return e.mclass==="minner"?r=new Ht("mpadded",n):e.mclass==="mord"?e.isCharacterBox?(r=n[0],r.type="mi"):r=new Ht("mi",n):(e.isCharacterBox?(r=n[0],r.type="mo"):r=new Ht("mo",n),e.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):e.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):e.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}function nZt(e,t,r){var n=tZt[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},o=r.callFunction("\\Big",[a],[]),s=r.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,s]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function iZt(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 r=e.fetch().text;if(r==="&"||r==="\\\\")e.consume();else if(r==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Yt("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var h=0;h<2;h++){for(var f=!0,p=l+1;pAV=|." after @',o[l]);var m=nZt(u,d,e),g={type:"styling",body:[m],mode:"math",style:"display",resetFont:!0};n.push(g),s=_Pe()}a%2===0?n.push(s):n.shift(),n=[],i.push(n)}e.gullet.endGroup(),e.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}function BPe(e){return"isMiddle"in e}function az(e,t){var r=nz(e);if(r&&mZt.has(r.text))return r;throw r?new Yt("Invalid delimiter '"+r.text+"' after '"+t.funcName+"'",e):new Yt("Invalid delimiter type '"+e.type+"'",e)}function FPe(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}function Bm(e){for(var{type:t,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l1||!d)&&g.pop(),v.length{Yt=class e extends Error{constructor(t,r){var n="KaTeX parse error: "+t,i,a,o=r&&r.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=s.slice(i,a).replace(/[^]/g,"$&\u0332"),u;i>15?u="\u2026"+s.slice(i-15,i):u=s.slice(0,i);var d;a+15e.replace(X$t,"-$1").toLowerCase(),K$t={"&":"&",">":">","<":"<",'"':""","'":"'"},Z$t=/[&><"']/g,Oc=e=>String(e).replace(Z$t,t=>K$t[t]),zF=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?zF(e.body[0]):e:e.type==="font"?zF(e.body):e,Q$t=new Set(["mathord","textord","atom"]),iy=e=>Q$t.has(zF(e).type),J$t=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},WF={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};U9=class{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var r of Object.keys(WF)){var n=WF[r];n&&rKt(this,r,t,n)}}reportNonstrict(t,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(t,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Yt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+t+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+t+"]"))}}useStrictBehavior(t,r,n){var i=this.strict;if(typeof i=="function")try{i=i(t,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var r=J$t(t.url);if(r==null)return!1;t.protocol=r}var n=typeof this.trust=="function"?this.trust(t):this.trust;return!!n}},Nm=class{constructor(t,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=r,this.cramped=n}sup(){return _m[nKt[this.id]]}sub(){return _m[iKt[this.id]]}fracNum(){return _m[aKt[this.id]]}fracDen(){return _m[oKt[this.id]]}cramp(){return _m[sKt[this.id]]}text(){return _m[lKt[this.id]]}isTight(){return this.size>=2}},Zoe=0,VF=1,uk=2,ny=3,I9=4,Sf=5,dk=6,Eu=7,_m=[new Nm(Zoe,0,!1),new Nm(VF,0,!0),new Nm(uk,1,!1),new Nm(ny,1,!0),new Nm(I9,2,!1),new Nm(Sf,2,!0),new Nm(dk,3,!1),new Nm(Eu,3,!0)],nKt=[I9,Sf,I9,Sf,dk,Eu,dk,Eu],iKt=[Sf,Sf,Sf,Sf,Eu,Eu,Eu,Eu],aKt=[uk,ny,I9,Sf,dk,Eu,dk,Eu],oKt=[ny,ny,Sf,Sf,Eu,Eu,Eu,Eu],sKt=[VF,VF,ny,ny,Sf,Sf,Eu,Eu],lKt=[Zoe,VF,uk,ny,uk,ny,uk,ny],Rn={DISPLAY:_m[Zoe],TEXT:_m[uk],SCRIPT:_m[I9],SCRIPTSCRIPT:_m[dk]},Moe=[{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]]}];GF=[];Moe.forEach(e=>e.blocks.forEach(t=>GF.push(...t)));el=e=>e+" "+e,ck=80,uKt=function(t,r){return"M95,"+(622+t+r)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+t/2.075+" -"+t+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+t)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},dKt=function(t,r){return"M263,"+(601+t+r)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+t/2.084+" -"+t+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+t)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},hKt=function(t,r){return"M983 "+(10+t+r)+` -l`+t/3.13+" -"+t+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},fKt=function(t,r){return"M424,"+(2398+t+r)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+t)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+r+` -h400000v`+(40+t)+"h-400000z"},pKt=function(t,r){return"M473,"+(2713+t+r)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+t)+" "+r+"h400000v"+(40+t)+"H1017.7z"},mKt=function(t){var r=t/2;return"M400000 "+t+" H0 L"+r+" 0 l65 45 L145 "+(t-80)+" H400000z"},gKt=function(t,r,n){var i=n-54-r-t;return"M702 "+(t+r)+"H400000"+(40+t)+` -H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+t)+"H742z"},yKt=function(t,r,n){r=1e3*r;var i="";switch(t){case"sqrtMain":i=uKt(r,ck);break;case"sqrtSize1":i=dKt(r,ck);break;case"sqrtSize2":i=hKt(r,ck);break;case"sqrtSize3":i=fKt(r,ck);break;case"sqrtSize4":i=pKt(r,ck);break;case"sqrtTall":i=gKt(r,ck,n)}return i},vKt=function(t,r){switch(t){case"\u239C":return el("M291 0 H417 V"+r+" H291z");case"\u2223":return el("M145 0 H188 V"+r+" H145z");case"\u2225":return el("M145 0 H188 V"+r+" H145z")+el("M367 0 H410 V"+r+" H367z");case"\u239F":return el("M457 0 H583 V"+r+" H457z");case"\u23A2":return el("M319 0 H403 V"+r+" H319z");case"\u23A5":return el("M263 0 H347 V"+r+" H263z");case"\u23AA":return el("M384 0 H504 V"+r+" H384z");case"\u23D0":return el("M312 0 H355 V"+r+" H312z");case"\u2016":return el("M257 0 H300 V"+r+" H257z")+el("M478 0 H521 V"+r+" H478z");default:return""}},wPe={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:el("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:el("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:el("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:el("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:el("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:el("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:el("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:el("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},bKt=function(t,r){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z -M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z -M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z -M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};r2=class{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),r=0;r{if(xKt(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}},Loe={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},wKt={ex:!0,em:!0,mu:!0},nOe=function(t){return typeof t!="string"&&(t=t.unit),t in Loe||t in wKt||t==="ex"},Ao=function(t,r){var n;if(t.unit in Loe)n=Loe[t.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(t.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,t.unit==="ex")n=i.fontMetrics().xHeight;else if(t.unit==="em")n=i.fontMetrics().quad;else throw new Yt("Invalid unit: '"+t.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(t.number*n,r.maxSize)},Zt=function(t){return+t.toFixed(4)+"em"},n2=function(t){return t.filter(r=>r).join(" ")},Qoe=function(t){var r="";for(var n of Object.keys(t)){var i=t[n];i!==void 0&&(r+=$$t(n)+":"+i+";")}return r},iOe=function(t,r,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},aOe=function(t){var r=document.createElement(t);r.className=n2(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,oOe=function(t){var r="<"+t;this.classes.length&&(r+=' class="'+Oc(n2(this.classes))+'"');var n=Qoe(this.style);n&&(r+=' style="'+Oc(n)+'"');for(var i of Object.keys(this.attributes)){if(EKt.test(i))throw new Yt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Oc(this.attributes[i])+'"'}r+=">";for(var a=0;a",r},i2=class{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,iOe.call(this,t,n,i),this.children=r||[]}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return aOe.call(this,"span")}toMarkup(){return oOe.call(this,"span")}},hk=class{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,iOe.call(this,r,i),this.children=n||[],this.setAttribute("href",t)}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return aOe.call(this,"a")}toMarkup(){return oOe.call(this,"a")}},Doe=class{constructor(t,r,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=r,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t=''+Oc(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Zt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=n2(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(t),r):t}toMarkup(){var t=!1,r="0&&(n+="margin-right:"+Zt(this.italic)+";"),n+=Qoe(this.style),n&&(t=!0,r+=' style="'+Oc(n)+'"');var i=Oc(this.text);return t?(r+=">",r+=i,r+="",r):i}},n0=class{constructor(t,r){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=r||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},R9=class{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var t="e instanceof i2||e instanceof hk||e instanceof r2,Pm={"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]}},RF={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]},EPe={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};yoe={};so={math:{},text:{}};oe="math",Ft="text",xe="main",Xe="ams",lo="accent-token",yr="bin",ku="close",mk="inner",Zr="mathord",Ss="op-token",wh="open",L9="punct",$e="rel",ay="spacing",Je="textord";te(oe,xe,$e,"\u2261","\\equiv",!0);te(oe,xe,$e,"\u227A","\\prec",!0);te(oe,xe,$e,"\u227B","\\succ",!0);te(oe,xe,$e,"\u223C","\\sim",!0);te(oe,xe,$e,"\u22A5","\\perp");te(oe,xe,$e,"\u2AAF","\\preceq",!0);te(oe,xe,$e,"\u2AB0","\\succeq",!0);te(oe,xe,$e,"\u2243","\\simeq",!0);te(oe,xe,$e,"\u2223","\\mid",!0);te(oe,xe,$e,"\u226A","\\ll",!0);te(oe,xe,$e,"\u226B","\\gg",!0);te(oe,xe,$e,"\u224D","\\asymp",!0);te(oe,xe,$e,"\u2225","\\parallel");te(oe,xe,$e,"\u22C8","\\bowtie",!0);te(oe,xe,$e,"\u2323","\\smile",!0);te(oe,xe,$e,"\u2291","\\sqsubseteq",!0);te(oe,xe,$e,"\u2292","\\sqsupseteq",!0);te(oe,xe,$e,"\u2250","\\doteq",!0);te(oe,xe,$e,"\u2322","\\frown",!0);te(oe,xe,$e,"\u220B","\\ni",!0);te(oe,xe,$e,"\u221D","\\propto",!0);te(oe,xe,$e,"\u22A2","\\vdash",!0);te(oe,xe,$e,"\u22A3","\\dashv",!0);te(oe,xe,$e,"\u220B","\\owns");te(oe,xe,L9,".","\\ldotp");te(oe,xe,L9,"\u22C5","\\cdotp");te(oe,xe,L9,"\u22C5","\xB7");te(Ft,xe,Je,"\u22C5","\xB7");te(oe,xe,Je,"#","\\#");te(Ft,xe,Je,"#","\\#");te(oe,xe,Je,"&","\\&");te(Ft,xe,Je,"&","\\&");te(oe,xe,Je,"\u2135","\\aleph",!0);te(oe,xe,Je,"\u2200","\\forall",!0);te(oe,xe,Je,"\u210F","\\hbar",!0);te(oe,xe,Je,"\u2203","\\exists",!0);te(oe,xe,Je,"\u2207","\\nabla",!0);te(oe,xe,Je,"\u266D","\\flat",!0);te(oe,xe,Je,"\u2113","\\ell",!0);te(oe,xe,Je,"\u266E","\\natural",!0);te(oe,xe,Je,"\u2663","\\clubsuit",!0);te(oe,xe,Je,"\u2118","\\wp",!0);te(oe,xe,Je,"\u266F","\\sharp",!0);te(oe,xe,Je,"\u2662","\\diamondsuit",!0);te(oe,xe,Je,"\u211C","\\Re",!0);te(oe,xe,Je,"\u2661","\\heartsuit",!0);te(oe,xe,Je,"\u2111","\\Im",!0);te(oe,xe,Je,"\u2660","\\spadesuit",!0);te(oe,xe,Je,"\xA7","\\S",!0);te(Ft,xe,Je,"\xA7","\\S");te(oe,xe,Je,"\xB6","\\P",!0);te(Ft,xe,Je,"\xB6","\\P");te(oe,xe,Je,"\u2020","\\dag");te(Ft,xe,Je,"\u2020","\\dag");te(Ft,xe,Je,"\u2020","\\textdagger");te(oe,xe,Je,"\u2021","\\ddag");te(Ft,xe,Je,"\u2021","\\ddag");te(Ft,xe,Je,"\u2021","\\textdaggerdbl");te(oe,xe,ku,"\u23B1","\\rmoustache",!0);te(oe,xe,wh,"\u23B0","\\lmoustache",!0);te(oe,xe,ku,"\u27EF","\\rgroup",!0);te(oe,xe,wh,"\u27EE","\\lgroup",!0);te(oe,xe,yr,"\u2213","\\mp",!0);te(oe,xe,yr,"\u2296","\\ominus",!0);te(oe,xe,yr,"\u228E","\\uplus",!0);te(oe,xe,yr,"\u2293","\\sqcap",!0);te(oe,xe,yr,"\u2217","\\ast");te(oe,xe,yr,"\u2294","\\sqcup",!0);te(oe,xe,yr,"\u25EF","\\bigcirc",!0);te(oe,xe,yr,"\u2219","\\bullet",!0);te(oe,xe,yr,"\u2021","\\ddagger");te(oe,xe,yr,"\u2240","\\wr",!0);te(oe,xe,yr,"\u2A3F","\\amalg");te(oe,xe,yr,"&","\\And");te(oe,xe,$e,"\u27F5","\\longleftarrow",!0);te(oe,xe,$e,"\u21D0","\\Leftarrow",!0);te(oe,xe,$e,"\u27F8","\\Longleftarrow",!0);te(oe,xe,$e,"\u27F6","\\longrightarrow",!0);te(oe,xe,$e,"\u21D2","\\Rightarrow",!0);te(oe,xe,$e,"\u27F9","\\Longrightarrow",!0);te(oe,xe,$e,"\u2194","\\leftrightarrow",!0);te(oe,xe,$e,"\u27F7","\\longleftrightarrow",!0);te(oe,xe,$e,"\u21D4","\\Leftrightarrow",!0);te(oe,xe,$e,"\u27FA","\\Longleftrightarrow",!0);te(oe,xe,$e,"\u21A6","\\mapsto",!0);te(oe,xe,$e,"\u27FC","\\longmapsto",!0);te(oe,xe,$e,"\u2197","\\nearrow",!0);te(oe,xe,$e,"\u21A9","\\hookleftarrow",!0);te(oe,xe,$e,"\u21AA","\\hookrightarrow",!0);te(oe,xe,$e,"\u2198","\\searrow",!0);te(oe,xe,$e,"\u21BC","\\leftharpoonup",!0);te(oe,xe,$e,"\u21C0","\\rightharpoonup",!0);te(oe,xe,$e,"\u2199","\\swarrow",!0);te(oe,xe,$e,"\u21BD","\\leftharpoondown",!0);te(oe,xe,$e,"\u21C1","\\rightharpoondown",!0);te(oe,xe,$e,"\u2196","\\nwarrow",!0);te(oe,xe,$e,"\u21CC","\\rightleftharpoons",!0);te(oe,Xe,$e,"\u226E","\\nless",!0);te(oe,Xe,$e,"\uE010","\\@nleqslant");te(oe,Xe,$e,"\uE011","\\@nleqq");te(oe,Xe,$e,"\u2A87","\\lneq",!0);te(oe,Xe,$e,"\u2268","\\lneqq",!0);te(oe,Xe,$e,"\uE00C","\\@lvertneqq");te(oe,Xe,$e,"\u22E6","\\lnsim",!0);te(oe,Xe,$e,"\u2A89","\\lnapprox",!0);te(oe,Xe,$e,"\u2280","\\nprec",!0);te(oe,Xe,$e,"\u22E0","\\npreceq",!0);te(oe,Xe,$e,"\u22E8","\\precnsim",!0);te(oe,Xe,$e,"\u2AB9","\\precnapprox",!0);te(oe,Xe,$e,"\u2241","\\nsim",!0);te(oe,Xe,$e,"\uE006","\\@nshortmid");te(oe,Xe,$e,"\u2224","\\nmid",!0);te(oe,Xe,$e,"\u22AC","\\nvdash",!0);te(oe,Xe,$e,"\u22AD","\\nvDash",!0);te(oe,Xe,$e,"\u22EA","\\ntriangleleft");te(oe,Xe,$e,"\u22EC","\\ntrianglelefteq",!0);te(oe,Xe,$e,"\u228A","\\subsetneq",!0);te(oe,Xe,$e,"\uE01A","\\@varsubsetneq");te(oe,Xe,$e,"\u2ACB","\\subsetneqq",!0);te(oe,Xe,$e,"\uE017","\\@varsubsetneqq");te(oe,Xe,$e,"\u226F","\\ngtr",!0);te(oe,Xe,$e,"\uE00F","\\@ngeqslant");te(oe,Xe,$e,"\uE00E","\\@ngeqq");te(oe,Xe,$e,"\u2A88","\\gneq",!0);te(oe,Xe,$e,"\u2269","\\gneqq",!0);te(oe,Xe,$e,"\uE00D","\\@gvertneqq");te(oe,Xe,$e,"\u22E7","\\gnsim",!0);te(oe,Xe,$e,"\u2A8A","\\gnapprox",!0);te(oe,Xe,$e,"\u2281","\\nsucc",!0);te(oe,Xe,$e,"\u22E1","\\nsucceq",!0);te(oe,Xe,$e,"\u22E9","\\succnsim",!0);te(oe,Xe,$e,"\u2ABA","\\succnapprox",!0);te(oe,Xe,$e,"\u2246","\\ncong",!0);te(oe,Xe,$e,"\uE007","\\@nshortparallel");te(oe,Xe,$e,"\u2226","\\nparallel",!0);te(oe,Xe,$e,"\u22AF","\\nVDash",!0);te(oe,Xe,$e,"\u22EB","\\ntriangleright");te(oe,Xe,$e,"\u22ED","\\ntrianglerighteq",!0);te(oe,Xe,$e,"\uE018","\\@nsupseteqq");te(oe,Xe,$e,"\u228B","\\supsetneq",!0);te(oe,Xe,$e,"\uE01B","\\@varsupsetneq");te(oe,Xe,$e,"\u2ACC","\\supsetneqq",!0);te(oe,Xe,$e,"\uE019","\\@varsupsetneqq");te(oe,Xe,$e,"\u22AE","\\nVdash",!0);te(oe,Xe,$e,"\u2AB5","\\precneqq",!0);te(oe,Xe,$e,"\u2AB6","\\succneqq",!0);te(oe,Xe,$e,"\uE016","\\@nsubseteqq");te(oe,Xe,yr,"\u22B4","\\unlhd");te(oe,Xe,yr,"\u22B5","\\unrhd");te(oe,Xe,$e,"\u219A","\\nleftarrow",!0);te(oe,Xe,$e,"\u219B","\\nrightarrow",!0);te(oe,Xe,$e,"\u21CD","\\nLeftarrow",!0);te(oe,Xe,$e,"\u21CF","\\nRightarrow",!0);te(oe,Xe,$e,"\u21AE","\\nleftrightarrow",!0);te(oe,Xe,$e,"\u21CE","\\nLeftrightarrow",!0);te(oe,Xe,$e,"\u25B3","\\vartriangle");te(oe,Xe,Je,"\u210F","\\hslash");te(oe,Xe,Je,"\u25BD","\\triangledown");te(oe,Xe,Je,"\u25CA","\\lozenge");te(oe,Xe,Je,"\u24C8","\\circledS");te(oe,Xe,Je,"\xAE","\\circledR");te(Ft,Xe,Je,"\xAE","\\circledR");te(oe,Xe,Je,"\u2221","\\measuredangle",!0);te(oe,Xe,Je,"\u2204","\\nexists");te(oe,Xe,Je,"\u2127","\\mho");te(oe,Xe,Je,"\u2132","\\Finv",!0);te(oe,Xe,Je,"\u2141","\\Game",!0);te(oe,Xe,Je,"\u2035","\\backprime");te(oe,Xe,Je,"\u25B2","\\blacktriangle");te(oe,Xe,Je,"\u25BC","\\blacktriangledown");te(oe,Xe,Je,"\u25A0","\\blacksquare");te(oe,Xe,Je,"\u29EB","\\blacklozenge");te(oe,Xe,Je,"\u2605","\\bigstar");te(oe,Xe,Je,"\u2222","\\sphericalangle",!0);te(oe,Xe,Je,"\u2201","\\complement",!0);te(oe,Xe,Je,"\xF0","\\eth",!0);te(Ft,xe,Je,"\xF0","\xF0");te(oe,Xe,Je,"\u2571","\\diagup");te(oe,Xe,Je,"\u2572","\\diagdown");te(oe,Xe,Je,"\u25A1","\\square");te(oe,Xe,Je,"\u25A1","\\Box");te(oe,Xe,Je,"\u25CA","\\Diamond");te(oe,Xe,Je,"\xA5","\\yen",!0);te(Ft,Xe,Je,"\xA5","\\yen",!0);te(oe,Xe,Je,"\u2713","\\checkmark",!0);te(Ft,Xe,Je,"\u2713","\\checkmark");te(oe,Xe,Je,"\u2136","\\beth",!0);te(oe,Xe,Je,"\u2138","\\daleth",!0);te(oe,Xe,Je,"\u2137","\\gimel",!0);te(oe,Xe,Je,"\u03DD","\\digamma",!0);te(oe,Xe,Je,"\u03F0","\\varkappa");te(oe,Xe,wh,"\u250C","\\@ulcorner",!0);te(oe,Xe,ku,"\u2510","\\@urcorner",!0);te(oe,Xe,wh,"\u2514","\\@llcorner",!0);te(oe,Xe,ku,"\u2518","\\@lrcorner",!0);te(oe,Xe,$e,"\u2266","\\leqq",!0);te(oe,Xe,$e,"\u2A7D","\\leqslant",!0);te(oe,Xe,$e,"\u2A95","\\eqslantless",!0);te(oe,Xe,$e,"\u2272","\\lesssim",!0);te(oe,Xe,$e,"\u2A85","\\lessapprox",!0);te(oe,Xe,$e,"\u224A","\\approxeq",!0);te(oe,Xe,yr,"\u22D6","\\lessdot");te(oe,Xe,$e,"\u22D8","\\lll",!0);te(oe,Xe,$e,"\u2276","\\lessgtr",!0);te(oe,Xe,$e,"\u22DA","\\lesseqgtr",!0);te(oe,Xe,$e,"\u2A8B","\\lesseqqgtr",!0);te(oe,Xe,$e,"\u2251","\\doteqdot");te(oe,Xe,$e,"\u2253","\\risingdotseq",!0);te(oe,Xe,$e,"\u2252","\\fallingdotseq",!0);te(oe,Xe,$e,"\u223D","\\backsim",!0);te(oe,Xe,$e,"\u22CD","\\backsimeq",!0);te(oe,Xe,$e,"\u2AC5","\\subseteqq",!0);te(oe,Xe,$e,"\u22D0","\\Subset",!0);te(oe,Xe,$e,"\u228F","\\sqsubset",!0);te(oe,Xe,$e,"\u227C","\\preccurlyeq",!0);te(oe,Xe,$e,"\u22DE","\\curlyeqprec",!0);te(oe,Xe,$e,"\u227E","\\precsim",!0);te(oe,Xe,$e,"\u2AB7","\\precapprox",!0);te(oe,Xe,$e,"\u22B2","\\vartriangleleft");te(oe,Xe,$e,"\u22B4","\\trianglelefteq");te(oe,Xe,$e,"\u22A8","\\vDash",!0);te(oe,Xe,$e,"\u22AA","\\Vvdash",!0);te(oe,Xe,$e,"\u2323","\\smallsmile");te(oe,Xe,$e,"\u2322","\\smallfrown");te(oe,Xe,$e,"\u224F","\\bumpeq",!0);te(oe,Xe,$e,"\u224E","\\Bumpeq",!0);te(oe,Xe,$e,"\u2267","\\geqq",!0);te(oe,Xe,$e,"\u2A7E","\\geqslant",!0);te(oe,Xe,$e,"\u2A96","\\eqslantgtr",!0);te(oe,Xe,$e,"\u2273","\\gtrsim",!0);te(oe,Xe,$e,"\u2A86","\\gtrapprox",!0);te(oe,Xe,yr,"\u22D7","\\gtrdot");te(oe,Xe,$e,"\u22D9","\\ggg",!0);te(oe,Xe,$e,"\u2277","\\gtrless",!0);te(oe,Xe,$e,"\u22DB","\\gtreqless",!0);te(oe,Xe,$e,"\u2A8C","\\gtreqqless",!0);te(oe,Xe,$e,"\u2256","\\eqcirc",!0);te(oe,Xe,$e,"\u2257","\\circeq",!0);te(oe,Xe,$e,"\u225C","\\triangleq",!0);te(oe,Xe,$e,"\u223C","\\thicksim");te(oe,Xe,$e,"\u2248","\\thickapprox");te(oe,Xe,$e,"\u2AC6","\\supseteqq",!0);te(oe,Xe,$e,"\u22D1","\\Supset",!0);te(oe,Xe,$e,"\u2290","\\sqsupset",!0);te(oe,Xe,$e,"\u227D","\\succcurlyeq",!0);te(oe,Xe,$e,"\u22DF","\\curlyeqsucc",!0);te(oe,Xe,$e,"\u227F","\\succsim",!0);te(oe,Xe,$e,"\u2AB8","\\succapprox",!0);te(oe,Xe,$e,"\u22B3","\\vartriangleright");te(oe,Xe,$e,"\u22B5","\\trianglerighteq");te(oe,Xe,$e,"\u22A9","\\Vdash",!0);te(oe,Xe,$e,"\u2223","\\shortmid");te(oe,Xe,$e,"\u2225","\\shortparallel");te(oe,Xe,$e,"\u226C","\\between",!0);te(oe,Xe,$e,"\u22D4","\\pitchfork",!0);te(oe,Xe,$e,"\u221D","\\varpropto");te(oe,Xe,$e,"\u25C0","\\blacktriangleleft");te(oe,Xe,$e,"\u2234","\\therefore",!0);te(oe,Xe,$e,"\u220D","\\backepsilon");te(oe,Xe,$e,"\u25B6","\\blacktriangleright");te(oe,Xe,$e,"\u2235","\\because",!0);te(oe,Xe,$e,"\u22D8","\\llless");te(oe,Xe,$e,"\u22D9","\\gggtr");te(oe,Xe,yr,"\u22B2","\\lhd");te(oe,Xe,yr,"\u22B3","\\rhd");te(oe,Xe,$e,"\u2242","\\eqsim",!0);te(oe,xe,$e,"\u22C8","\\Join");te(oe,Xe,$e,"\u2251","\\Doteq",!0);te(oe,Xe,yr,"\u2214","\\dotplus",!0);te(oe,Xe,yr,"\u2216","\\smallsetminus");te(oe,Xe,yr,"\u22D2","\\Cap",!0);te(oe,Xe,yr,"\u22D3","\\Cup",!0);te(oe,Xe,yr,"\u2A5E","\\doublebarwedge",!0);te(oe,Xe,yr,"\u229F","\\boxminus",!0);te(oe,Xe,yr,"\u229E","\\boxplus",!0);te(oe,Xe,yr,"\u22C7","\\divideontimes",!0);te(oe,Xe,yr,"\u22C9","\\ltimes",!0);te(oe,Xe,yr,"\u22CA","\\rtimes",!0);te(oe,Xe,yr,"\u22CB","\\leftthreetimes",!0);te(oe,Xe,yr,"\u22CC","\\rightthreetimes",!0);te(oe,Xe,yr,"\u22CF","\\curlywedge",!0);te(oe,Xe,yr,"\u22CE","\\curlyvee",!0);te(oe,Xe,yr,"\u229D","\\circleddash",!0);te(oe,Xe,yr,"\u229B","\\circledast",!0);te(oe,Xe,yr,"\u22C5","\\centerdot");te(oe,Xe,yr,"\u22BA","\\intercal",!0);te(oe,Xe,yr,"\u22D2","\\doublecap");te(oe,Xe,yr,"\u22D3","\\doublecup");te(oe,Xe,yr,"\u22A0","\\boxtimes",!0);te(oe,Xe,$e,"\u21E2","\\dashrightarrow",!0);te(oe,Xe,$e,"\u21E0","\\dashleftarrow",!0);te(oe,Xe,$e,"\u21C7","\\leftleftarrows",!0);te(oe,Xe,$e,"\u21C6","\\leftrightarrows",!0);te(oe,Xe,$e,"\u21DA","\\Lleftarrow",!0);te(oe,Xe,$e,"\u219E","\\twoheadleftarrow",!0);te(oe,Xe,$e,"\u21A2","\\leftarrowtail",!0);te(oe,Xe,$e,"\u21AB","\\looparrowleft",!0);te(oe,Xe,$e,"\u21CB","\\leftrightharpoons",!0);te(oe,Xe,$e,"\u21B6","\\curvearrowleft",!0);te(oe,Xe,$e,"\u21BA","\\circlearrowleft",!0);te(oe,Xe,$e,"\u21B0","\\Lsh",!0);te(oe,Xe,$e,"\u21C8","\\upuparrows",!0);te(oe,Xe,$e,"\u21BF","\\upharpoonleft",!0);te(oe,Xe,$e,"\u21C3","\\downharpoonleft",!0);te(oe,xe,$e,"\u22B6","\\origof",!0);te(oe,xe,$e,"\u22B7","\\imageof",!0);te(oe,Xe,$e,"\u22B8","\\multimap",!0);te(oe,Xe,$e,"\u21AD","\\leftrightsquigarrow",!0);te(oe,Xe,$e,"\u21C9","\\rightrightarrows",!0);te(oe,Xe,$e,"\u21C4","\\rightleftarrows",!0);te(oe,Xe,$e,"\u21A0","\\twoheadrightarrow",!0);te(oe,Xe,$e,"\u21A3","\\rightarrowtail",!0);te(oe,Xe,$e,"\u21AC","\\looparrowright",!0);te(oe,Xe,$e,"\u21B7","\\curvearrowright",!0);te(oe,Xe,$e,"\u21BB","\\circlearrowright",!0);te(oe,Xe,$e,"\u21B1","\\Rsh",!0);te(oe,Xe,$e,"\u21CA","\\downdownarrows",!0);te(oe,Xe,$e,"\u21BE","\\upharpoonright",!0);te(oe,Xe,$e,"\u21C2","\\downharpoonright",!0);te(oe,Xe,$e,"\u21DD","\\rightsquigarrow",!0);te(oe,Xe,$e,"\u21DD","\\leadsto");te(oe,Xe,$e,"\u21DB","\\Rrightarrow",!0);te(oe,Xe,$e,"\u21BE","\\restriction");te(oe,xe,Je,"\u2018","`");te(oe,xe,Je,"$","\\$");te(Ft,xe,Je,"$","\\$");te(Ft,xe,Je,"$","\\textdollar");te(oe,xe,Je,"%","\\%");te(Ft,xe,Je,"%","\\%");te(oe,xe,Je,"_","\\_");te(Ft,xe,Je,"_","\\_");te(Ft,xe,Je,"_","\\textunderscore");te(oe,xe,Je,"\u2220","\\angle",!0);te(oe,xe,Je,"\u221E","\\infty",!0);te(oe,xe,Je,"\u2032","\\prime");te(oe,xe,Je,"\u25B3","\\triangle");te(oe,xe,Je,"\u0393","\\Gamma",!0);te(oe,xe,Je,"\u0394","\\Delta",!0);te(oe,xe,Je,"\u0398","\\Theta",!0);te(oe,xe,Je,"\u039B","\\Lambda",!0);te(oe,xe,Je,"\u039E","\\Xi",!0);te(oe,xe,Je,"\u03A0","\\Pi",!0);te(oe,xe,Je,"\u03A3","\\Sigma",!0);te(oe,xe,Je,"\u03A5","\\Upsilon",!0);te(oe,xe,Je,"\u03A6","\\Phi",!0);te(oe,xe,Je,"\u03A8","\\Psi",!0);te(oe,xe,Je,"\u03A9","\\Omega",!0);te(oe,xe,Je,"A","\u0391");te(oe,xe,Je,"B","\u0392");te(oe,xe,Je,"E","\u0395");te(oe,xe,Je,"Z","\u0396");te(oe,xe,Je,"H","\u0397");te(oe,xe,Je,"I","\u0399");te(oe,xe,Je,"K","\u039A");te(oe,xe,Je,"M","\u039C");te(oe,xe,Je,"N","\u039D");te(oe,xe,Je,"O","\u039F");te(oe,xe,Je,"P","\u03A1");te(oe,xe,Je,"T","\u03A4");te(oe,xe,Je,"X","\u03A7");te(oe,xe,Je,"\xAC","\\neg",!0);te(oe,xe,Je,"\xAC","\\lnot");te(oe,xe,Je,"\u22A4","\\top");te(oe,xe,Je,"\u22A5","\\bot");te(oe,xe,Je,"\u2205","\\emptyset");te(oe,Xe,Je,"\u2205","\\varnothing");te(oe,xe,Zr,"\u03B1","\\alpha",!0);te(oe,xe,Zr,"\u03B2","\\beta",!0);te(oe,xe,Zr,"\u03B3","\\gamma",!0);te(oe,xe,Zr,"\u03B4","\\delta",!0);te(oe,xe,Zr,"\u03F5","\\epsilon",!0);te(oe,xe,Zr,"\u03B6","\\zeta",!0);te(oe,xe,Zr,"\u03B7","\\eta",!0);te(oe,xe,Zr,"\u03B8","\\theta",!0);te(oe,xe,Zr,"\u03B9","\\iota",!0);te(oe,xe,Zr,"\u03BA","\\kappa",!0);te(oe,xe,Zr,"\u03BB","\\lambda",!0);te(oe,xe,Zr,"\u03BC","\\mu",!0);te(oe,xe,Zr,"\u03BD","\\nu",!0);te(oe,xe,Zr,"\u03BE","\\xi",!0);te(oe,xe,Zr,"\u03BF","\\omicron",!0);te(oe,xe,Zr,"\u03C0","\\pi",!0);te(oe,xe,Zr,"\u03C1","\\rho",!0);te(oe,xe,Zr,"\u03C3","\\sigma",!0);te(oe,xe,Zr,"\u03C4","\\tau",!0);te(oe,xe,Zr,"\u03C5","\\upsilon",!0);te(oe,xe,Zr,"\u03D5","\\phi",!0);te(oe,xe,Zr,"\u03C7","\\chi",!0);te(oe,xe,Zr,"\u03C8","\\psi",!0);te(oe,xe,Zr,"\u03C9","\\omega",!0);te(oe,xe,Zr,"\u03B5","\\varepsilon",!0);te(oe,xe,Zr,"\u03D1","\\vartheta",!0);te(oe,xe,Zr,"\u03D6","\\varpi",!0);te(oe,xe,Zr,"\u03F1","\\varrho",!0);te(oe,xe,Zr,"\u03C2","\\varsigma",!0);te(oe,xe,Zr,"\u03C6","\\varphi",!0);te(oe,xe,yr,"\u2217","*",!0);te(oe,xe,yr,"+","+");te(oe,xe,yr,"\u2212","-",!0);te(oe,xe,yr,"\u22C5","\\cdot",!0);te(oe,xe,yr,"\u2218","\\circ",!0);te(oe,xe,yr,"\xF7","\\div",!0);te(oe,xe,yr,"\xB1","\\pm",!0);te(oe,xe,yr,"\xD7","\\times",!0);te(oe,xe,yr,"\u2229","\\cap",!0);te(oe,xe,yr,"\u222A","\\cup",!0);te(oe,xe,yr,"\u2216","\\setminus",!0);te(oe,xe,yr,"\u2227","\\land");te(oe,xe,yr,"\u2228","\\lor");te(oe,xe,yr,"\u2227","\\wedge",!0);te(oe,xe,yr,"\u2228","\\vee",!0);te(oe,xe,Je,"\u221A","\\surd");te(oe,xe,wh,"\u27E8","\\langle",!0);te(oe,xe,wh,"\u2223","\\lvert");te(oe,xe,wh,"\u2225","\\lVert");te(oe,xe,ku,"?","?");te(oe,xe,ku,"!","!");te(oe,xe,ku,"\u27E9","\\rangle",!0);te(oe,xe,ku,"\u2223","\\rvert");te(oe,xe,ku,"\u2225","\\rVert");te(oe,xe,$e,"=","=");te(oe,xe,$e,":",":");te(oe,xe,$e,"\u2248","\\approx",!0);te(oe,xe,$e,"\u2245","\\cong",!0);te(oe,xe,$e,"\u2265","\\ge");te(oe,xe,$e,"\u2265","\\geq",!0);te(oe,xe,$e,"\u2190","\\gets");te(oe,xe,$e,">","\\gt",!0);te(oe,xe,$e,"\u2208","\\in",!0);te(oe,xe,$e,"\uE020","\\@not");te(oe,xe,$e,"\u2282","\\subset",!0);te(oe,xe,$e,"\u2283","\\supset",!0);te(oe,xe,$e,"\u2286","\\subseteq",!0);te(oe,xe,$e,"\u2287","\\supseteq",!0);te(oe,Xe,$e,"\u2288","\\nsubseteq",!0);te(oe,Xe,$e,"\u2289","\\nsupseteq",!0);te(oe,xe,$e,"\u22A8","\\models");te(oe,xe,$e,"\u2190","\\leftarrow",!0);te(oe,xe,$e,"\u2264","\\le");te(oe,xe,$e,"\u2264","\\leq",!0);te(oe,xe,$e,"<","\\lt",!0);te(oe,xe,$e,"\u2192","\\rightarrow",!0);te(oe,xe,$e,"\u2192","\\to");te(oe,Xe,$e,"\u2271","\\ngeq",!0);te(oe,Xe,$e,"\u2270","\\nleq",!0);te(oe,xe,ay,"\xA0","\\ ");te(oe,xe,ay,"\xA0","\\space");te(oe,xe,ay,"\xA0","\\nobreakspace");te(Ft,xe,ay,"\xA0","\\ ");te(Ft,xe,ay,"\xA0"," ");te(Ft,xe,ay,"\xA0","\\space");te(Ft,xe,ay,"\xA0","\\nobreakspace");te(oe,xe,ay,"","\\nobreak");te(oe,xe,ay,"","\\allowbreak");te(oe,xe,L9,",",",");te(oe,xe,L9,";",";");te(oe,Xe,yr,"\u22BC","\\barwedge",!0);te(oe,Xe,yr,"\u22BB","\\veebar",!0);te(oe,xe,yr,"\u2299","\\odot",!0);te(oe,xe,yr,"\u2295","\\oplus",!0);te(oe,xe,yr,"\u2297","\\otimes",!0);te(oe,xe,Je,"\u2202","\\partial",!0);te(oe,xe,yr,"\u2298","\\oslash",!0);te(oe,Xe,yr,"\u229A","\\circledcirc",!0);te(oe,Xe,yr,"\u22A1","\\boxdot",!0);te(oe,xe,yr,"\u25B3","\\bigtriangleup");te(oe,xe,yr,"\u25BD","\\bigtriangledown");te(oe,xe,yr,"\u2020","\\dagger");te(oe,xe,yr,"\u22C4","\\diamond");te(oe,xe,yr,"\u22C6","\\star");te(oe,xe,yr,"\u25C3","\\triangleleft");te(oe,xe,yr,"\u25B9","\\triangleright");te(oe,xe,wh,"{","\\{");te(Ft,xe,Je,"{","\\{");te(Ft,xe,Je,"{","\\textbraceleft");te(oe,xe,ku,"}","\\}");te(Ft,xe,Je,"}","\\}");te(Ft,xe,Je,"}","\\textbraceright");te(oe,xe,wh,"{","\\lbrace");te(oe,xe,ku,"}","\\rbrace");te(oe,xe,wh,"[","\\lbrack",!0);te(Ft,xe,Je,"[","\\lbrack",!0);te(oe,xe,ku,"]","\\rbrack",!0);te(Ft,xe,Je,"]","\\rbrack",!0);te(oe,xe,wh,"(","\\lparen",!0);te(oe,xe,ku,")","\\rparen",!0);te(Ft,xe,Je,"<","\\textless",!0);te(Ft,xe,Je,">","\\textgreater",!0);te(oe,xe,wh,"\u230A","\\lfloor",!0);te(oe,xe,ku,"\u230B","\\rfloor",!0);te(oe,xe,wh,"\u2308","\\lceil",!0);te(oe,xe,ku,"\u2309","\\rceil",!0);te(oe,xe,Je,"\\","\\backslash");te(oe,xe,Je,"\u2223","|");te(oe,xe,Je,"\u2223","\\vert");te(Ft,xe,Je,"|","\\textbar",!0);te(oe,xe,Je,"\u2225","\\|");te(oe,xe,Je,"\u2225","\\Vert");te(Ft,xe,Je,"\u2225","\\textbardbl");te(Ft,xe,Je,"~","\\textasciitilde");te(Ft,xe,Je,"\\","\\textbackslash");te(Ft,xe,Je,"^","\\textasciicircum");te(oe,xe,$e,"\u2191","\\uparrow",!0);te(oe,xe,$e,"\u21D1","\\Uparrow",!0);te(oe,xe,$e,"\u2193","\\downarrow",!0);te(oe,xe,$e,"\u21D3","\\Downarrow",!0);te(oe,xe,$e,"\u2195","\\updownarrow",!0);te(oe,xe,$e,"\u21D5","\\Updownarrow",!0);te(oe,xe,Ss,"\u2210","\\coprod");te(oe,xe,Ss,"\u22C1","\\bigvee");te(oe,xe,Ss,"\u22C0","\\bigwedge");te(oe,xe,Ss,"\u2A04","\\biguplus");te(oe,xe,Ss,"\u22C2","\\bigcap");te(oe,xe,Ss,"\u22C3","\\bigcup");te(oe,xe,Ss,"\u222B","\\int");te(oe,xe,Ss,"\u222B","\\intop");te(oe,xe,Ss,"\u222C","\\iint");te(oe,xe,Ss,"\u222D","\\iiint");te(oe,xe,Ss,"\u220F","\\prod");te(oe,xe,Ss,"\u2211","\\sum");te(oe,xe,Ss,"\u2A02","\\bigotimes");te(oe,xe,Ss,"\u2A01","\\bigoplus");te(oe,xe,Ss,"\u2A00","\\bigodot");te(oe,xe,Ss,"\u222E","\\oint");te(oe,xe,Ss,"\u222F","\\oiint");te(oe,xe,Ss,"\u2230","\\oiiint");te(oe,xe,Ss,"\u2A06","\\bigsqcup");te(oe,xe,Ss,"\u222B","\\smallint");te(Ft,xe,mk,"\u2026","\\textellipsis");te(oe,xe,mk,"\u2026","\\mathellipsis");te(Ft,xe,mk,"\u2026","\\ldots",!0);te(oe,xe,mk,"\u2026","\\ldots",!0);te(oe,xe,mk,"\u22EF","\\@cdots",!0);te(oe,xe,mk,"\u22F1","\\ddots",!0);te(oe,xe,Je,"\u22EE","\\varvdots");te(Ft,xe,Je,"\u22EE","\\varvdots");te(oe,xe,lo,"\u02CA","\\acute");te(oe,xe,lo,"\u02CB","\\grave");te(oe,xe,lo,"\xA8","\\ddot");te(oe,xe,lo,"~","\\tilde");te(oe,xe,lo,"\u02C9","\\bar");te(oe,xe,lo,"\u02D8","\\breve");te(oe,xe,lo,"\u02C7","\\check");te(oe,xe,lo,"^","\\hat");te(oe,xe,lo,"\u20D7","\\vec");te(oe,xe,lo,"\u02D9","\\dot");te(oe,xe,lo,"\u02DA","\\mathring");te(oe,xe,Zr,"\uE131","\\@imath");te(oe,xe,Zr,"\uE237","\\@jmath");te(oe,xe,Je,"\u0131","\u0131");te(oe,xe,Je,"\u0237","\u0237");te(Ft,xe,Je,"\u0131","\\i",!0);te(Ft,xe,Je,"\u0237","\\j",!0);te(Ft,xe,Je,"\xDF","\\ss",!0);te(Ft,xe,Je,"\xE6","\\ae",!0);te(Ft,xe,Je,"\u0153","\\oe",!0);te(Ft,xe,Je,"\xF8","\\o",!0);te(Ft,xe,Je,"\xC6","\\AE",!0);te(Ft,xe,Je,"\u0152","\\OE",!0);te(Ft,xe,Je,"\xD8","\\O",!0);te(Ft,xe,lo,"\u02CA","\\'");te(Ft,xe,lo,"\u02CB","\\`");te(Ft,xe,lo,"\u02C6","\\^");te(Ft,xe,lo,"\u02DC","\\~");te(Ft,xe,lo,"\u02C9","\\=");te(Ft,xe,lo,"\u02D8","\\u");te(Ft,xe,lo,"\u02D9","\\.");te(Ft,xe,lo,"\xB8","\\c");te(Ft,xe,lo,"\u02DA","\\r");te(Ft,xe,lo,"\u02C7","\\v");te(Ft,xe,lo,"\xA8",'\\"');te(Ft,xe,lo,"\u02DD","\\H");te(Ft,xe,lo,"\u25EF","\\textcircled");lOe={"--":!0,"---":!0,"``":!0,"''":!0};te(Ft,xe,Je,"\u2013","--",!0);te(Ft,xe,Je,"\u2013","\\textendash");te(Ft,xe,Je,"\u2014","---",!0);te(Ft,xe,Je,"\u2014","\\textemdash");te(Ft,xe,Je,"\u2018","`",!0);te(Ft,xe,Je,"\u2018","\\textquoteleft");te(Ft,xe,Je,"\u2019","'",!0);te(Ft,xe,Je,"\u2019","\\textquoteright");te(Ft,xe,Je,"\u201C","``",!0);te(Ft,xe,Je,"\u201C","\\textquotedblleft");te(Ft,xe,Je,"\u201D","''",!0);te(Ft,xe,Je,"\u201D","\\textquotedblright");te(oe,xe,Je,"\xB0","\\degree",!0);te(Ft,xe,Je,"\xB0","\\degree");te(Ft,xe,Je,"\xB0","\\textdegree",!0);te(oe,xe,Je,"\xA3","\\pounds");te(oe,xe,Je,"\xA3","\\mathsterling",!0);te(Ft,xe,Je,"\xA3","\\pounds");te(Ft,xe,Je,"\xA3","\\textsterling",!0);te(oe,Xe,Je,"\u2720","\\maltese");te(Ft,Xe,Je,"\u2720","\\maltese");TPe='0123456789/@."';for(MF=0;MF{var t=e.charCodeAt(0),r=e.charCodeAt(1),n=(t-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return MPe[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return IKt[a]}else{if(n===120485||n===120486)return MPe[0];if(120486{if(n2(e.classes)!==n2(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var r=e.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(e.style))if(e.style[n]!==t.style[n])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},cOe=e=>{for(var t=0;tr&&(r=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}t.height=r,t.depth=n,t.maxFontSize=i},Gt=function(t,r,n,i){var a=new i2(t,r,n,i);return tse(a),a},a2=(e,t,r,n)=>new i2(e,t,r,n),fk=function(t,r,n){var i=Gt([t],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Zt(i.height),i.maxFontSize=1,i},DKt=function(t,r,n,i){var a=new hk(t,r,n,i);return tse(a),a},oy=function(t){var r=new r2(t);return tse(r),r},pk=function(t,r){return t instanceof r2?Gt([],[t],r):t},NKt=function(t){if(t.positionType==="individualShift"){for(var r=t.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,o=1;o{var r=Gt(["mspace"],[],t),n=Ao(e,t);return r.style.marginRight=Zt(n),r},_F=(e,t,r)=>{var n,i;switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return t==="textbf"&&r==="textit"?i="BoldItalic":t==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},Foe={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"}},dOe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},hOe=function(t,r){var[n,i,a]=dOe[t],o=new Om(n),s=new n0([o],{width:Zt(i),height:Zt(a),style:"width:"+Zt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=a2(["overlay"],[s],r);return l.height=a,l.style.height=Zt(a),l.style.width=Zt(i),l},So={number:3,unit:"mu"},W5={number:4,unit:"mu"},ry={number:5,unit:"mu"},_Kt={mord:{mop:So,mbin:W5,mrel:ry,minner:So},mop:{mord:So,mop:So,mrel:ry,minner:So},mbin:{mord:W5,mop:W5,mopen:W5,minner:W5},mrel:{mord:ry,mop:ry,mopen:ry,minner:ry},mopen:{},mclose:{mop:So,mbin:W5,mrel:ry,minner:So},mpunct:{mord:So,mop:So,mrel:ry,mopen:So,mclose:So,mpunct:So,minner:So},minner:{mord:So,mop:So,mbin:W5,mrel:ry,mopen:So,mpunct:So,minner:So}},PKt={mord:{mop:So},mop:{mord:So,mop:So},mbin:{},mrel:{},mopen:{},mclose:{mop:So},mpunct:{},minner:{mop:So}},fOe={},qF={},YF={};jF=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Cs=function(t){return t.type==="ordgroup"?t.body:[t]},OKt=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),BKt=new Set(["rightmost","mrel","mclose","mpunct"]),FKt={display:Rn.DISPLAY,text:Rn.TEXT,script:Rn.SCRIPT,scriptscript:Rn.SCRIPTSCRIPT},zKt={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},tl=function(t,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],o=0;o{var y=g.classes[0],v=m.classes[0];y==="mbin"&&BKt.has(v)?g.classes[0]="mord":v==="mbin"&&OKt.has(y)&&(m.classes[0]="mord")},{node:h},f,p),zoe(a,(m,g)=>{var y,v,b=Woe(g),x=Woe(m),E=b&&x?m.hasClass("mtight")?(y=PKt[b])==null?void 0:y[x]:(v=_Kt[b])==null?void 0:v[x]:null;if(E)return uOe(E,u)},{node:h},f,p),a},zoe=function(t,r,n,i,a){i&&t.push(i);for(var o=0;of=>{t.splice(h+1,0,f),o++})(o)}i&&t.pop()},pOe=function(t){return t instanceof r2||t instanceof hk||t instanceof i2&&t.hasClass("enclosing")?t:null},Goe=function(t,r){var n=pOe(t);if(n){var i=n.children;if(i.length){if(r==="right")return Goe(i[i.length-1],"right");if(r==="left")return Goe(i[0],"left")}}return t},Woe=function(t,r){if(!t)return null;r&&(t=Goe(t,r));var n=t.classes[0];return zKt[n]||null},M9=function(t,r){var n=["nulldelimiter"].concat(t.baseSizingClasses());return Gt(r.concat(n))},Vi=function(t,r,n){if(!t)return Gt();if(qF[t.type]){var i=qF[t.type](t,r);if(n&&r.size!==n.size){i=Gt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Yt("Got group of unknown type: '"+t.type+"'")};Ht=class{constructor(t,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(t,r){this.attributes[t]=r}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);this.classes.length>0&&(t.className=n2(this.classes));for(var n=0;n0&&(t+=' class ="'+Oc(n2(this.classes))+'"'),t+=">";for(var n=0;n",t}toText(){return this.children.map(t=>t.toText()).join("")}},zo=class{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Oc(this.toText())}toText(){return this.text}},XF=class{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character="\u200A":t>=.1666&&t<=.1667?this.character="\u2009":t>=.2222&&t<=.2223?this.character="\u2005":t>=.2777&&t<=.2778?this.character="\u2005\u200A":t>=-.05556&&t<=-.05555?this.character="\u200A\u2063":t>=-.1667&&t<=-.1666?this.character="\u2009\u2063":t>=-.2223&&t<=-.2222?this.character="\u205F\u2063":t>=-.2778&&t<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Zt(this.width)),t}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}},GKt=new Set(["\\imath","\\jmath"]),WKt=new Set(["mrow","mtable"]),Af=function(t,r,n){return so[r][t]&&so[r][t].replace&&t.charCodeAt(0)!==55349&&!(lOe.hasOwnProperty(t)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(t=so[r][t].replace),new zo(t)},rse=function(t){return t.length===1?t[0]:new Ht("mrow",t)},VKt={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},nse=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var r=t.font;if(!r||r==="mathnormal")return null;var n=e.mode,i=VKt[r];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(GKt.has(a))return null;if(so[n][a]){var o=so[n][a].replace;o&&(a=o)}var s=Foe[r].fontName;return Joe(a,s,n)?Foe[r].variant:null};Eh=function(t,r,n){if(t.length===1){var i=va(t[0],r);return n&&i instanceof Ht&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,s=0;s=1&&(o.type==="mn"||xoe(o))){var u=l.children[0];u instanceof Ht&&u.type==="mn"&&(u.children=[...o.children,...u.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var d=o.children[0];if(d instanceof zo&&d.text==="\u0338"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof zo&&h.text.length>0&&(h.text=h.text.slice(0,1)+"\u0338"+h.text.slice(1),a.pop())}}}a.push(l),o=l}return a},o2=function(t,r,n){return rse(Eh(t,r,n))},va=function(t,r){if(!t)return new Ht("mrow");if(YF[t.type])return YF[t.type](t,r);throw new Yt("Got group of unknown type: '"+t.type+"'")};HKt=[[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]],DPe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],NPe=function(t,r){return r.size<2?t:HKt[t-1][r.size-1]},$F=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=DPe[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,t),new e(r)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:NPe(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:DPe[t-1]})}havingBaseStyle(t){t=t||this.style.text();var r=NPe(e.BASESIZE,t);return this.size===r&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:r})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==e.BASESIZE?["sizing","reset-size"+this.size,"size"+e.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=AKt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};$F.BASESIZE=6;gOe=function(t){return new $F({style:t.displayMode?Rn.DISPLAY:Rn.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},yOe=function(t,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),t=Gt(n,[t])}return t},qKt=function(t,r,n){var i=gOe(n),a;if(n.output==="mathml")return LPe(t,r,i,n.displayMode,!0);if(n.output==="html"){var o=Voe(t,i);a=Gt(["katex"],[o])}else{var s=LPe(t,r,i,n.displayMode,!1),l=Voe(t,i);a=Gt(["katex"],[s,l])}return yOe(a,n)},YKt=function(t,r,n){var i=gOe(n),a=Voe(t,i),o=Gt(["katex"],[a]);return yOe(o,n)},jKt={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",underbracket:"\u23B5",overbracket:"\u23B4",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},ez=function(t){var r=new Ht("mo",[new zo(jKt[t.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},XKt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},$Kt=new Set(["widehat","widecheck","widetilde","utilde"]),tz=function(t,r){function n(){var s=4e5,l=t.label.slice(1);if($Kt.has(l)&&"base"in t){var u=t.base.type==="ordgroup"?t.base.body.length:1,d,h,f;if(u>5)l==="widehat"||l==="widecheck"?(d=420,s=2364,f=.42,h=l+"4"):(d=312,s=2340,f=.34,h="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][p],d=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],h=l+p):(s=[0,600,1033,2339,2340][p],d=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],h="tilde"+p)}var m=new Om(h),g=new n0([m],{width:"100%",height:Zt(f),viewBox:"0 0 "+s+" "+d,preserveAspectRatio:"none"});return{span:a2([],[g],r),minWidth:0,height:f}}else{var y=[],v=XKt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[b,x,E]=v,w=E/1e3,T=b.length,C,S;if(T===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],S=[v[3]]}else if(T===2)C=["halfarrow-left","halfarrow-right"],S=["xMinYMin","xMaxYMin"];else if(T===3)C=["brace-left","brace-center","brace-right"],S=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+T+" children.");for(var R=0;R0&&(i.style.minWidth=Zt(a)),i},KKt=function(t,r,n,i,a){var o,s=t.height+t.depth+n+i;if(/fbox|color|angl/.test(r)){if(o=Gt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new R9({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new R9({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new n0(u,{width:"100%",height:Zt(s)});o=a2([],[d],a)}return o.height=s,o.style.height=Zt(s),o},ZKt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},QKt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};vOe=e=>{if(e instanceof Tu)return e;if(SKt(e)&&e.children.length===1)return vOe(e.children[0])},ise=(e,t)=>{var r,n,i;e&&e.type==="supsub"?(n=Wn(e.base,"accent"),r=n.base,e.base=r,i=CKt(Vi(e,t)),e.base=n):(n=Wn(e,"accent"),r=n.base);var a=Vi(r,t.havingCrampedStyle()),o=n.isShifty&&iy(r),s=0;if(o){var l,u;s=(l=(u=vOe(a))==null?void 0:u.skew)!=null?l:0}var d=n.label==="\\c",h=d?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),f;if(n.isStretchy)f=tz(n,t),f=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+Zt(2*s)+")",marginLeft:Zt(2*s)}:void 0}]});else{var p,m;n.label==="\\vec"?(p=hOe("vec",t),m=dOe.vec[1]):(p=JF({type:"textord",mode:n.mode,text:n.label},t,"textord"),p=kKt(p),p.italic=0,m=p.width,d&&(h+=p.depth)),f=Gt(["accent-body"],[p]);var g=n.label==="\\textcircled";g&&(f.classes.push("accent-full"),h=a.height);var y=s;g||(y-=m/2),f.style.left=Zt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:f}]})}var v=Gt(["mord","accent"],[f],t);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},bOe=(e,t)=>{var r=e.isStretchy?ez(e.label):new Ht("mo",[Af(e.label,e.mode)]),n=new Ht("mover",[va(e.base,t),r]);return n.setAttribute("accent","true"),n},eZt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));hr({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 r=jF(t[0]),n=!eZt.test(e.funcName),i=!n||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:ise,mathmlBuilder:bOe});hr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var r=t[0],n=e.parser.mode;return n==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:ise,mathmlBuilder:bOe});hr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(e,t)=>{var r=Vi(e.base,t),n=tz(e,t),i=e.label==="\\utilde"?.12:0,a=Wi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Gt(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var r=ez(e.label),n=new Ht("munder",[va(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});OF=e=>{var t=new Ht("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};hr({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,r){var{parser:n,funcName:i}=e;return{type:"xArrow",mode:n.mode,label:i,body:t[0],below:r[0]}},htmlBuilder(e,t){var r=t.style,n=t.havingStyle(r.sup()),i=pk(Vi(e.body,n,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;e.below&&(n=t.havingStyle(r.sub()),o=pk(Vi(e.below,n,t),t),o.classes.push(a+"-arrow-pad"));var s=tz(e,t),l=-t.fontMetrics().axisHeight+.5*s.height,u=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(u-=i.depth);var d;if(o){var h=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=Wi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:h}]})}else d=Wi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]});return Gt(["mrel","x-arrow"],[d],t)},mathmlBuilder(e,t){var r=ez(e.label);r.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(e.body){var i=OF(va(e.body,t));if(e.below){var a=OF(va(e.below,t));n=new Ht("munderover",[r,a,i])}else n=new Ht("mover",[r,i])}else if(e.below){var o=OF(va(e.below,t));n=new Ht("munder",[r,o])}else n=OF(),n=new Ht("mover",[r,n]);return n}});hr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Cs(i),isCharacterBox:iy(i)}},htmlBuilder:xOe,mathmlBuilder:wOe});iz=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};hr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:iz(t[0]),body:Cs(t[1]),isCharacterBox:iy(t[1])}}});hr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:r,funcName:n}=e,i=t[1],a=t[0],o;n!=="\\stackrel"?o=iz(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Cs(i)},l={type:"supsub",mode:a.mode,base:s,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:o,body:[l],isCharacterBox:iy(l)}},htmlBuilder:xOe,mathmlBuilder:wOe});hr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:iz(t[0]),body:Cs(t[0])}},htmlBuilder(e,t){var r=tl(e.body,t,!0),n=Gt([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){var r=Eh(e.body,t),n=new Ht("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});tZt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},_Pe=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),PPe=e=>e.type==="textord"&&e.text==="@",rZt=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;hr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){var r=t.havingStyle(t.style.sup()),n=pk(Vi(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=Zt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){var r=new Ht("mrow",[va(e.label,t)]);return r=new Ht("mpadded",[r]),r.setAttribute("width","0"),e.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ht("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});hr({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){var r=pk(Vi(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new Ht("mrow",[va(e.fragment,t)])}});hr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:r}=e,n=Wn(t[0],"ordgroup"),i=n.body,a="",o=0;o=1114111)throw new Yt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});EOe=(e,t)=>{var r=tl(e.body,t.withColor(e.color),!1);return oy(r)},TOe=(e,t)=>{var r=Eh(e.body,t.withColor(e.color)),n=new Ht("mstyle",r);return n.setAttribute("mathcolor",e.color),n};hr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:r}=e,n=Wn(t[0],"color-token").color,i=t[1];return{type:"color",mode:r.mode,color:n,body:Cs(i)}},htmlBuilder:EOe,mathmlBuilder:TOe});hr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:r,breakOnTokenText:n}=e,i=Wn(t[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:EOe,mathmlBuilder:TOe});hr({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){var{parser:n}=e,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Wn(i,"size").value}},htmlBuilder(e,t){var r=Gt(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=Zt(Ao(e.size,t)))),r},mathmlBuilder(e,t){var r=new Ht("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",Zt(Ao(e.size,t)))),r}});Hoe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},kOe=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Yt("Expected a control sequence",e);return t},aZt=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},COe=(e,t,r,n)=>{var i=e.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,i,n)};hr({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:r}=e;t.consumeSpaces();var n=t.fetch();if(Hoe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Hoe[n.text]),Wn(t.parseFunction(),"internal");throw new Yt("Invalid token after macro prefix",n)}});hr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=t.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Yt("Expected a control sequence",n);for(var a=0,o,s=[[]];t.gullet.future().text!=="{";)if(n=t.gullet.popToken(),n.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),s[a].push("{");break}if(n=t.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Yt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Yt('Argument number "'+n.text+'" out of order');a++,s.push([])}else{if(n.text==="EOF")throw new Yt("Expected a macro definition");s[a].push(n.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),(r==="\\edef"||r==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},r===Hoe[r]),{type:"internal",mode:t.mode}}});hr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=kOe(t.gullet.popToken());t.gullet.consumeSpaces();var i=aZt(t);return COe(t,n,i,r==="\\\\globallet"),{type:"internal",mode:t.mode}}});hr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,n=kOe(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return COe(t,n,a,r==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});S9=function(t,r,n){var i=so.math[t]&&so.math[t].replace,a=Joe(i||t,r,n);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+r+".");return a},ase=function(t,r,n,i){var a=n.havingBaseStyle(r),o=Gt(i.concat(a.sizingClasses(n)),[t],n),s=a.sizeMultiplier/n.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=a.sizeMultiplier,o},SOe=function(t,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Zt(a),t.height-=a,t.depth+=a},oZt=function(t,r,n,i,a,o){var s=wu(t,"Main-Regular",a,i),l=ase(s,r,i,o);return n&&SOe(l,i,r),l},sZt=function(t,r,n,i){return wu(t,"Size"+r+"-Regular",n,i)},AOe=function(t,r,n,i,a,o){var s=sZt(t,r,a,i),l=ase(Gt(["delimsizing","size"+r],[s],i),Rn.TEXT,i,o);return n&&SOe(l,i,Rn.TEXT),l},woe=function(t,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Gt(["delimsizinginner",i],[Gt([],[wu(t,r,n)])]);return{type:"elem",elem:a}},Eoe=function(t,r,n){var i=Pm["Size4-Regular"][t.charCodeAt(0)]?Pm["Size4-Regular"][t.charCodeAt(0)][4]:Pm["Size1-Regular"][t.charCodeAt(0)][4],a=new Om("inner",vKt(t,Math.round(1e3*r))),o=new n0([a],{width:Zt(i),height:Zt(r),style:"width:"+Zt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=a2([],[o],n);return s.height=r,s.style.height=Zt(r),s.style.width=Zt(i),{type:"elem",elem:s}},qoe=.008,BF={type:"kern",size:-1*qoe},lZt=new Set(["|","\\lvert","\\rvert","\\vert"]),cZt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),UOe=function(t,r,n,i,a,o){var s,l,u,d,h="",f=0;s=u=d=t,l=null;var p="Size1-Regular";t==="\\uparrow"?u=d="\u23D0":t==="\\Uparrow"?u=d="\u2016":t==="\\downarrow"?s=u="\u23D0":t==="\\Downarrow"?s=u="\u2016":t==="\\updownarrow"?(s="\\uparrow",u="\u23D0",d="\\downarrow"):t==="\\Updownarrow"?(s="\\Uparrow",u="\u2016",d="\\Downarrow"):lZt.has(t)?(u="\u2223",h="vert",f=333):cZt.has(t)?(u="\u2225",h="doublevert",f=556):t==="["||t==="\\lbrack"?(s="\u23A1",u="\u23A2",d="\u23A3",p="Size4-Regular",h="lbrack",f=667):t==="]"||t==="\\rbrack"?(s="\u23A4",u="\u23A5",d="\u23A6",p="Size4-Regular",h="rbrack",f=667):t==="\\lfloor"||t==="\u230A"?(u=s="\u23A2",d="\u23A3",p="Size4-Regular",h="lfloor",f=667):t==="\\lceil"||t==="\u2308"?(s="\u23A1",u=d="\u23A2",p="Size4-Regular",h="lceil",f=667):t==="\\rfloor"||t==="\u230B"?(u=s="\u23A5",d="\u23A6",p="Size4-Regular",h="rfloor",f=667):t==="\\rceil"||t==="\u2309"?(s="\u23A4",u=d="\u23A5",p="Size4-Regular",h="rceil",f=667):t==="("||t==="\\lparen"?(s="\u239B",u="\u239C",d="\u239D",p="Size4-Regular",h="lparen",f=875):t===")"||t==="\\rparen"?(s="\u239E",u="\u239F",d="\u23A0",p="Size4-Regular",h="rparen",f=875):t==="\\{"||t==="\\lbrace"?(s="\u23A7",l="\u23A8",d="\u23A9",u="\u23AA",p="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(s="\u23AB",l="\u23AC",d="\u23AD",u="\u23AA",p="Size4-Regular"):t==="\\lgroup"||t==="\u27EE"?(s="\u23A7",d="\u23A9",u="\u23AA",p="Size4-Regular"):t==="\\rgroup"||t==="\u27EF"?(s="\u23AB",d="\u23AD",u="\u23AA",p="Size4-Regular"):t==="\\lmoustache"||t==="\u23B0"?(s="\u23A7",d="\u23AD",u="\u23AA",p="Size4-Regular"):(t==="\\rmoustache"||t==="\u23B1")&&(s="\u23AB",d="\u23A9",u="\u23AA",p="Size4-Regular");var m=S9(s,p,a),g=m.height+m.depth,y=S9(u,p,a),v=y.height+y.depth,b=S9(d,p,a),x=b.height+b.depth,E=0,w=1;if(l!==null){var T=S9(l,p,a);E=T.height+T.depth,w=2}var C=g+x+E,S=Math.max(0,Math.ceil((r-C)/(w*v))),R=C+S*w*v,U=i.fontMetrics().axisHeight;n&&(U*=i.sizeMultiplier);var L=R/2-U,I=[];if(h.length>0){var A=R-g-x,P=Math.round(R*1e3),D=bKt(h,Math.round(A*1e3)),M=new Om(h,D),O=Zt(f/1e3),_=Zt(P/1e3),B=new n0([M],{width:O,height:_,viewBox:"0 0 "+f+" "+P}),F=a2([],[B],i);F.height=P/1e3,F.style.width=O,F.style.height=_,I.push({type:"elem",elem:F})}else{if(I.push(woe(d,p,a)),I.push(BF),l===null){var G=R-g-x+2*qoe;I.push(Eoe(u,G,i))}else{var z=(R-g-x-E)/2+2*qoe;I.push(Eoe(u,z,i)),I.push(BF),I.push(woe(l,p,a)),I.push(BF),I.push(Eoe(u,z,i))}I.push(BF),I.push(woe(s,p,a))}var V=i.havingBaseStyle(Rn.TEXT),$=Wi({positionType:"bottom",positionData:L,children:I});return ase(Gt(["delimsizing","mult"],[$],V),Rn.TEXT,i,o)},Toe=80,koe=.08,Coe=function(t,r,n,i,a){var o=yKt(t,i,n),s=new Om(t,o),l=new n0([s],{width:"400em",height:Zt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return a2(["hide-tail"],[l],a)},uZt=function(t,r){var n=r.havingBaseSizing(),i=DOe("\\surd",t*n.sizeMultiplier,LOe,n),a=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,l,u,d,h;return i.type==="small"?(d=1e3+1e3*o+Toe,t<1?a=1:t<1.4&&(a=.7),l=(1+o+koe)/a,u=(1+o)/a,s=Coe("sqrtMain",l,d,o,r),s.style.minWidth="0.853em",h=.833/a):i.type==="large"?(d=(1e3+Toe)*A9[i.size],u=(A9[i.size]+o)/a,l=(A9[i.size]+o+koe)/a,s=Coe("sqrtSize"+i.size,l,d,o,r),s.style.minWidth="1.02em",h=1/a):(l=t+o+koe,u=t+o,d=Math.floor(1e3*t+o)+Toe,s=Coe("sqrtTall",l,d,o,r),s.style.minWidth="0.742em",h=1.056),s.height=u,s.style.height=Zt(l),{span:s,advanceWidth:h,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*a}},IOe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"]),dZt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"]),ROe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),A9=[0,1.2,1.8,2.4,3],MOe=function(t,r,n,i,a){if(t==="<"||t==="\\lt"||t==="\u27E8"?t="\\langle":(t===">"||t==="\\gt"||t==="\u27E9")&&(t="\\rangle"),IOe.has(t)||ROe.has(t))return AOe(t,r,!1,n,i,a);if(dZt.has(t))return UOe(t,A9[r],!1,n,i,a);throw new Yt("Illegal delimiter: '"+t+"'")},hZt=[{type:"small",style:Rn.SCRIPTSCRIPT},{type:"small",style:Rn.SCRIPT},{type:"small",style:Rn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],fZt=[{type:"small",style:Rn.SCRIPTSCRIPT},{type:"small",style:Rn.SCRIPT},{type:"small",style:Rn.TEXT},{type:"stack"}],LOe=[{type:"small",style:Rn.SCRIPTSCRIPT},{type:"small",style:Rn.SCRIPT},{type:"small",style:Rn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],pZt=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var r=t.type;throw new Error("Add support for delim type '"+r+"' here.")},DOe=function(t,r,n,i){for(var a=Math.min(2,3-i.style.size),o=a;or)return s}return n[n.length-1]},Yoe=function(t,r,n,i,a,o){t==="<"||t==="\\lt"||t==="\u27E8"?t="\\langle":(t===">"||t==="\\gt"||t==="\u27E9")&&(t="\\rangle");var s;ROe.has(t)?s=hZt:IOe.has(t)?s=LOe:s=fZt;var l=DOe(t,r,s,i);return l.type==="small"?oZt(t,l.style,n,i,a,o):l.type==="large"?AOe(t,l.size,n,i,a,o):UOe(t,r,n,i,a,o)},Soe=function(t,r,n,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,d=Math.max(r-s,n+s),h=Math.max(d/500*l,2*d-u);return Yoe(t,h,!0,i,a,o)},OPe={"\\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}},mZt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);hr({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 r=az(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:OPe[e.funcName].size,mclass:OPe[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>e.delim==="."?Gt([e.mclass]):MOe(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Af(e.delim,e.mode));var r=new Ht("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Zt(A9[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});hr({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=e.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Yt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:az(t[0],e).text,color:r}}});hr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=az(t[0],e),n=e.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Wn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{FPe(e);for(var r=tl(e.body,t,!0,["mopen","mclose"]),n=0,i=0,a=!1,o=0;o{FPe(e);var r=Eh(e.body,t);if(e.left!=="."){var n=new Ht("mo",[Af(e.left,e.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(e.right!=="."){var i=new Ht("mo",[Af(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),r.push(i)}return rse(r)}});hr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=az(t[0],e);if(!e.parser.leftrightDepth)throw new Yt("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{var r;return e.delim==="."?r=M9(t,[]):(r=MOe(e.delim,1,t,e.mode,[]),r.isMiddle={delim:e.delim,options:t}),r},mathmlBuilder:(e,t)=>{var r=e.delim==="\\vert"||e.delim==="|"?Af("|","text"):Af(e.delim,e.mode),n=new Ht("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});oz=(e,t)=>{var r=pk(Vi(e.body,t),t),n=e.label.slice(1),i=t.sizeMultiplier,a,o,s=iy(e.body);if(n==="sout")a=Gt(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(n==="phase"){var l=Ao({number:.6,unit:"pt"},t),u=Ao({number:.35,unit:"ex"},t),d=t.havingBaseSizing();i=i/d.sizeMultiplier;var h=r.height+r.depth+l+u;r.style.paddingLeft=Zt(h/2+l);var f=Math.floor(1e3*h*i),p=mKt(f),m=new n0([new Om("phase",p)],{width:"400em",height:Zt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=a2(["hide-tail"],[m],t),a.style.height=Zt(h),o=r.depth+l+u}else{/cancel/.test(n)?s||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var g,y,v=0;/box/.test(n)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=g):n==="angl"?(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*v,y=Math.max(0,.25-r.depth)):(g=s?.2:0,y=g),a=KKt(r,n,g,y,t),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Zt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Zt(v),a.style.borderRightWidth=Zt(v)),o=r.depth+y,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var b;if(e.backgroundColor)b=Wi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Wi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!s?Gt(["mord","cancel-lap"],[b],t):Gt(["mord"],[b],t)},sz=(e,t)=>{var r,n=new Ht(e.label.includes("colorbox")?"mpadded":"menclose",[va(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+Zt(i)+" solid "+e.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};hr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,r){var{parser:n,funcName:i}=e,a=Wn(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:oz,mathmlBuilder:sz});hr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,r){var{parser:n,funcName:i}=e,a=Wn(t[0],"color-token").color,o=Wn(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:oz,mathmlBuilder:sz});hr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}});hr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:oz,mathmlBuilder:sz});hr({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:oz,mathmlBuilder:sz});hr({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});NOe={};_Oe={};wd=class e{constructor(t,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=r,this.end=n}static range(t,r){return r?!t||!t.loc||!r.loc||t.loc.lexer!==r.loc.lexer?null:new e(t.loc.lexer,t.loc.start,r.loc.end):t&&t.loc}},xh=class e{constructor(t,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=r}range(t,r){return new e(r,wd.range(this,t))}};lz=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Yt("{"+e.envName+"} can be used only in display mode.")},gZt=new Set(["gather","gather*"]);Fm=function(t,r){var n,i,a=t.body.length,o=t.hLinesBeforeRow,s=0,l=new Array(a),u=[],d=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),h=1/r.fontMetrics().ptPerEm,f=5*h;if(t.colSeparationType&&t.colSeparationType==="small"){var p=r.havingStyle(Rn.SCRIPT).sizeMultiplier;f=.2778*(p/r.sizeMultiplier)}var m=t.colSeparationType==="CD"?Ao({number:3,unit:"ex"},r):12*h,g=3*h,y=t.arraystretch*m,v=.7*y,b=.3*y,x=0;function E(W){for(var X=0;X0&&(x+=.25),u.push({pos:x,isDashed:W[X]})}for(E(o[0]),n=0;n0&&(L+=b,CW))for(n=0;n=s)){var ie=void 0;if(i>0||t.hskipBeforeAndAfter){var pe,ue;ie=(pe=(ue=V)==null?void 0:ue.pregap)!=null?pe:f,ie!==0&&(D=Gt(["arraycolsep"],[]),D.style.width=Zt(ie),P.push(D))}var fe=[];for(n=0;n0){for(var Be=fk("hline",r,d),ae=fk("hdashline",r,d),he=[{type:"elem",elem:Le,shift:0}];u.length>0;){var de=u.pop(),me=de.pos-I;de.isDashed?he.push({type:"elem",elem:ae,shift:me}):he.push({type:"elem",elem:Be,shift:me})}Le=Wi({positionType:"individualShift",children:he})}if(O.length===0)return Gt(["mord"],[Le],r);var ke=Wi({positionType:"individualShift",children:O}),le=Gt(["tag"],[ke],r);return oy([Le,le])},yZt={c:"center ",l:"left ",r:"right "},zm=function(t,r){for(var n=[],i=new Ht("mtd",[],["mtr-glue"]),a=new Ht("mtd",[],["mml-eqn-num"]),o=0;o0){var m=t.cols,g="",y=!1,v=0,b=m.length;m[0].type==="separator"&&(f+="top ",v=1),m[m.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var x=v;x0?"left ":"",f+=R[R.length-1].length>0?"right ":"";for(var U=1;U0&&p&&(y=1),n[m]={type:"align",align:g,pregap:y,postgap:0}}return o.colSeparationType=p?"align":"alignat",o};Bm({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var r=nz(t[0]),n=r?[t[0]]:Wn(t[0],"ordgroup").body,i=n.map(function(o){var s=rz(o),l=s.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Yt("Unknown column alignment: "+l,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return s2(e.parser,a,sse(e.envName))},htmlBuilder:Fm,mathmlBuilder:zm});Bm({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("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Yt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=s2(e.parser,n,sse(e.envName)),o=Math.max(0,...a.body.map(s=>s.length));return a.cols=new Array(o).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},r=s2(e.parser,t,"script");return r.colSeparationType="small",r},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var r=nz(t[0]),n=r?[t[0]]:Wn(t[0],"ordgroup").body,i=n.map(function(s){var l=rz(s),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Yt("Unknown column alignment: "+u,s)});if(i.length>1)throw new Yt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=s2(e.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Yt("{subarray} can contain only one column");return o},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=s2(e.parser,t,sse(e.envName));return{type:"leftright",mode:e.mode,body:[r],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:POe,htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){gZt.has(e.envName)&&lz(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ose(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return s2(e.parser,t,"display")},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:POe,htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){lz(e);var t={autoTag:ose(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return s2(e.parser,t,"display")},htmlBuilder:Fm,mathmlBuilder:zm});Bm({type:"array",names:["CD"],props:{numArgs:0},handler(e){return lz(e),iZt(e.parser)},htmlBuilder:Fm,mathmlBuilder:zm});Re("\\nonumber","\\gdef\\@eqnsw{0}");Re("\\notag","\\nonumber");hr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Yt(e.funcName+" valid only within array environment")}});GPe=NOe;hr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:r,funcName:n}=e,i=t[0];if(i.type!=="ordgroup")throw new Yt("Invalid environment name",i);for(var a="",o=0;o{var r=e.font,n=t.withFont(r);return Vi(e.body,n)},BOe=(e,t)=>{var r=e.font,n=t.withFont(r);return va(e.body,n)},WPe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};hr({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:r,funcName:n}=e,i=jF(t[0]),a=n;return a in WPe&&(a=WPe[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:OOe,mathmlBuilder:BOe});hr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"mclass",mode:r.mode,mclass:iz(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:iy(n)}}});hr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n,breakOnTokenText:i}=e,{mode:a}=r,o=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:OOe,mathmlBuilder:BOe});vZt=(e,t)=>{var r=t.style,n=r.fracNum(),i=r.fracDen(),a;a=t.havingStyle(n);var o=Vi(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?m=3*f:m=7*f,g=t.fontMetrics().denom1):(h>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),g=t.fontMetrics().denom2);var y;if(d){var b=t.fontMetrics().axisHeight;p-o.depth-(b+.5*h){var r=new Ht("mfrac",[va(e.numer,t),va(e.denom,t)]);if(!e.hasBarLine)r.setAttribute("linethickness","0px");else if(e.barSize){var n=Ao(e.barSize,t);r.setAttribute("linethickness",Zt(n))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Ht("mo",[new zo(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),e.rightDelim!=null){var o=new Ht("mo",[new zo(e.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return rse(i)}return r},FOe=(e,t)=>{if(!t)return e;var r={type:"styling",mode:e.mode,style:t,body:[e]};return r};hr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0],a=t[1],o,s=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",d=null;return u||n.startsWith("\\d")?d="display":n.startsWith("\\t")&&(d="text"),FOe({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:vZt,mathmlBuilder:bZt});hr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:r,token:n}=e,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:n}}});VPe=["display","text","script","scriptscript"],HPe=function(t){var r=null;return t.length>0&&(r=t,r=r==="."?null:r),r};hr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:r}=e,n=t[4],i=t[5],a=jF(t[0]),o=a.type==="atom"&&a.family==="open"?HPe(a.text):null,s=jF(t[1]),l=s.type==="atom"&&s.family==="close"?HPe(s.text):null,u=Wn(t[2],"size"),d,h=null;u.isBlank?d=!0:(h=u.value,d=h.number>0);var f=null,p=t[3];if(p.type==="ordgroup"){if(p.body.length>0){var m=Wn(p.body[0],"textord");f=VPe[Number(m.text)]}}else p=Wn(p,"textord"),f=VPe[Number(p.text)];return FOe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:d,barSize:h,leftDelim:o,rightDelim:l},f)}});hr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:r,funcName:n,token:i}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Wn(t[0],"size").value,token:i}}});hr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0],a=Wn(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=t[2],s=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});zOe=(e,t)=>{var r=t.style,n,i;e.type==="supsub"?(n=e.sup?Vi(e.sup,t.havingStyle(r.sup()),t):Vi(e.sub,t.havingStyle(r.sub()),t),i=Wn(e.base,"horizBrace")):i=Wn(e,"horizBrace");var a=Vi(i.base,t.havingBaseStyle(Rn.DISPLAY)),o=tz(i,t),s;if(i.isOver?s=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):s=Wi({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Gt(["minner",i.isOver?"mover":"munder"],[s],t);i.isOver?s=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=Wi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Gt(["minner",i.isOver?"mover":"munder"],[s],t)},xZt=(e,t)=>{var r=ez(e.label);return new Ht(e.isOver?"mover":"munder",[va(e.base,t),r])};hr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:t[0]}},htmlBuilder:zOe,mathmlBuilder:xZt});hr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[1],i=Wn(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Cs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var r=tl(e.body,t,!1);return DKt(e.href,[],r,t)},mathmlBuilder:(e,t)=>{var r=o2(e.body,t);return r instanceof Ht||(r=new Ht("mrow",[r])),r.setAttribute("href",e.href),r}});hr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=Wn(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=e,a=Wn(t[0],"raw").string,o=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(n){case"\\htmlClass":l.class=a,s={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,s={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,s={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),d=0;d{var r=tl(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));var i=Gt(n,r,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>o2(e.body,t)});hr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:Cs(t[0]),mathml:Cs(t[1])}},htmlBuilder:(e,t)=>{var r=tl(e.html,t,!1);return oy(r)},mathmlBuilder:(e,t)=>o2(e.mathml,t)});Aoe=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!r)throw new Yt("Invalid size: '"+t+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!nOe(n))throw new Yt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};hr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{var{parser:n}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(r[0])for(var l=Wn(r[0],"raw").string,u=l.split(","),d=0;d{var r=Ao(e.height,t),n=0;e.totalheight.number>0&&(n=Ao(e.totalheight,t)-r);var i=0;e.width.number>0&&(i=Ao(e.width,t));var a={height:Zt(r+n)};i>0&&(a.width=Zt(i)),n>0&&(a.verticalAlign=Zt(-n));var o=new Doe(e.src,e.alt,a);return o.height=r,o.depth=n,o},mathmlBuilder:(e,t)=>{var r=new Ht("mglyph",[]);r.setAttribute("alt",e.alt);var n=Ao(e.height,t),i=0;if(e.totalheight.number>0&&(i=Ao(e.totalheight,t)-n,r.setAttribute("valign",Zt(-i))),r.setAttribute("height",Zt(n+i)),e.width.number>0){var a=Ao(e.width,t);r.setAttribute("width",Zt(a))}return r.setAttribute("src",e.src),r}});hr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:n}=e,i=Wn(t[0],"size");if(r.settings.strict){var a=n[1]==="m",o=i.value.unit==="mu";a?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(e,t){return uOe(e.dimension,t)},mathmlBuilder(e,t){var r=Ao(e.dimension,t);return new XF(r)}});hr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(e,t)=>{var r;e.alignment==="clap"?(r=Gt([],[Vi(e.body,t)]),r=Gt(["inner"],[r],t)):r=Gt(["inner"],[Vi(e.body,t)]);var n=Gt(["fix"],[]),i=Gt([e.alignment],[r,n],t),a=Gt(["strut"]);return a.style.height=Zt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Zt(-i.depth)),i.children.unshift(a),i=Gt(["thinbox"],[i],t),Gt(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var r=new Ht("mpadded",[va(e.body,t)]);if(e.alignment!=="rlap"){var n=e.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});hr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:r,parser:n}=e,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",o=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:o}}});hr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Yt("Mismatched "+e.funcName)}});qPe=(e,t)=>{switch(t.style.size){case Rn.DISPLAY.size:return e.display;case Rn.TEXT.size:return e.text;case Rn.SCRIPT.size:return e.script;case Rn.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};hr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:Cs(t[0]),text:Cs(t[1]),script:Cs(t[2]),scriptscript:Cs(t[3])}},htmlBuilder:(e,t)=>{var r=qPe(e,t),n=tl(r,t,!1);return oy(n)},mathmlBuilder:(e,t)=>{var r=qPe(e,t);return o2(r,t)}});GOe=(e,t,r,n,i,a,o)=>{e=Gt([],[e]);var s=r&&iy(r),l,u;if(t){var d=Vi(t,n.havingStyle(i.sup()),n);u={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-d.depth)}}if(r){var h=Vi(r,n.havingStyle(i.sub()),n);l={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o;f=Wi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Zt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Zt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var m=e.height-o;f=Wi({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Zt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var g=e.depth+o;f=Wi({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Zt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return e;var y=[f];if(l&&a!==0&&!s){var v=Gt(["mspace"],[],n);v.style.marginRight=Zt(a),y.unshift(v)}return Gt(["mop","op-limits"],y,n)},WOe=new Set(["\\smallint"]),gk=(e,t)=>{var r,n,i=!1,a;e.type==="supsub"?(r=e.sup,n=e.sub,a=Wn(e.base,"op"),i=!0):a=Wn(e,"op");var o=t.style,s=!1;o.size===Rn.DISPLAY.size&&a.symbol&&!WOe.has(a.name)&&(s=!0);var l,u;if(a.symbol){var d=s?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=wu(a.name,d,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),u=l.italic,h.length>0){var f=hOe(h+"Size"+(s?"2":"1"),t);l=Wi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=tl(a.body,t,!0);p.length===1&&p[0]instanceof Tu?(l=p[0],l.classes[0]="mop"):l=Gt(["mop"],p,t)}else{for(var m=[],g=1;g{var r;if(e.symbol)r=new Ht("mo",[Af(e.name,e.mode)]),WOe.has(e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new Ht("mo",Eh(e.body,t));else{r=new Ht("mi",[new zo(e.name.slice(1))]);var n=new Ht("mo",[Af("\u2061","text")]);e.parentIsSupSub?r=new Ht("mrow",[r,n]):r=mOe([r,n])}return r},wZt={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};hr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=n;return i.length===1&&(i=wZt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:gk,mathmlBuilder:D9});hr({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Cs(n)}},htmlBuilder:gk,mathmlBuilder:D9});EZt={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};hr({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:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gk,mathmlBuilder:D9});hr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gk,mathmlBuilder:D9});hr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:r}=e,n=r;return n.length===1&&(n=EZt[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:gk,mathmlBuilder:D9});VOe=(e,t)=>{var r,n,i=!1,a;e.type==="supsub"?(r=e.sup,n=e.sub,a=Wn(e.base,"operatorname"),i=!0):a=Wn(e,"operatorname");var o;if(a.body.length>0){for(var s=a.body.map(h=>{var f="text"in h?h.text:void 0;return typeof f=="string"?{type:"textord",mode:h.mode,text:f}:h}),l=tl(s,t.withFont("mathrm"),!0),u=0;u{for(var r=Eh(e.body,t.withFont("mathrm")),n=!0,i=0;id.toText()).join("");r=[new zo(s)]}var l=new Ht("mi",r);l.setAttribute("mathvariant","normal");var u=new Ht("mo",[Af("\u2061","text")]);return e.parentIsSupSub?new Ht("mrow",[l,u]):mOe([l,u])};hr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"operatorname",mode:r.mode,body:Cs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:VOe,mathmlBuilder:TZt});Re("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");H5({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?oy(tl(e.body,t,!1)):Gt(["mord"],tl(e.body,t,!0),t)},mathmlBuilder(e,t){return o2(e.body,t,!0)}});hr({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:r}=e,n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){var r=Vi(e.body,t.havingCrampedStyle()),n=fk("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Gt(["mord","overline"],[a],t)},mathmlBuilder(e,t){var r=new Ht("mo",[new zo("\u203E")]);r.setAttribute("stretchy","true");var n=new Ht("mover",[va(e.body,t),r]);return n.setAttribute("accent","true"),n}});hr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"phantom",mode:r.mode,body:Cs(n)}},htmlBuilder:(e,t)=>{var r=tl(e.body,t.withPhantom(),!1);return oy(r)},mathmlBuilder:(e,t)=>{var r=Eh(e.body,t);return new Ht("mphantom",r)}});Re("\\hphantom","\\smash{\\phantom{#1}}");hr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{var r=Gt(["inner"],[Vi(e.body,t.withPhantom())]),n=Gt(["fix"],[]);return Gt(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{var r=Eh(Cs(e.body),t),n=new Ht("mphantom",r),i=new Ht("mpadded",[n]);return i.setAttribute("width","0px"),i}});hr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e,n=Wn(t[0],"size").value,i=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(e,t){var r=Vi(e.body,t),n=Ao(e.dy,t);return Wi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){var r=new Ht("mpadded",[va(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}});hr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});hr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,r){var{parser:n}=e,i=r[0],a=Wn(t[0],"size"),o=Wn(t[1],"size");return{type:"rule",mode:n.mode,shift:i&&Wn(i,"size").value,width:a.value,height:o.value}},htmlBuilder(e,t){var r=Gt(["mord","rule"],[],t),n=Ao(e.width,t),i=Ao(e.height,t),a=e.shift?Ao(e.shift,t):0;return r.style.borderRightWidth=Zt(n),r.style.borderTopWidth=Zt(i),r.style.bottom=Zt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*t.sizeMultiplier,r},mathmlBuilder(e,t){var r=Ao(e.width,t),n=Ao(e.height,t),i=e.shift?Ao(e.shift,t):0,a=t.color&&t.getColor()||"black",o=new Ht("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",Zt(r)),o.setAttribute("height",Zt(n));var s=new Ht("mpadded",[o]);return i>=0?s.setAttribute("height",Zt(i)):(s.setAttribute("height",Zt(i)),s.setAttribute("depth",Zt(-i))),s.setAttribute("voffset",Zt(i)),s}});YPe=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],kZt=(e,t)=>{var r=t.havingSize(e.size);return HOe(e.body,r,t)};hr({type:"sizing",names:YPe,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:r,funcName:n,parser:i}=e,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:YPe.indexOf(n)+1,body:a}},htmlBuilder:kZt,mathmlBuilder:(e,t)=>{var r=t.havingSize(e.size),n=Eh(e.body,r),i=new Ht("mstyle",n);return i.setAttribute("mathsize",Zt(r.sizeMultiplier)),i}});hr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{var{parser:n}=e,i=!1,a=!1,o=r[0]&&Wn(r[0],"ordgroup");if(o)for(var s,l=0;l{var r=Gt([],[Vi(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0),e.smashDepth&&(r.depth=0),e.smashHeight&&e.smashDepth)return Gt(["mord","smash"],[r],t);if(r.children)for(var n=0;n{var r=new Ht("mpadded",[va(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}});hr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:n}=e,i=r[0],a=t[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(e,t){var r=Vi(e.body,t.havingCrampedStyle());r.height===0&&(r.height=t.fontMetrics().xHeight),r=pk(r,t);var n=t.fontMetrics(),i=n.defaultRuleThickness,a=i;t.style.idr.height+r.depth+o&&(o=(o+h-r.height-r.depth)/2);var f=l.height-r.height-o-u;r.style.paddingLeft=Zt(d);var p=Wi({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var m=t.havingStyle(Rn.SCRIPTSCRIPT),g=Vi(e.index,m,t),y=.6*(p.height-p.depth),v=Wi({positionType:"shift",positionData:-y,children:[{type:"elem",elem:g}]}),b=Gt(["root"],[v]);return Gt(["mord","sqrt"],[b,p],t)}else return Gt(["mord","sqrt"],[p],t)},mathmlBuilder(e,t){var{body:r,index:n}=e;return n?new Ht("mroot",[va(r,t),va(n,t)]):new Ht("msqrt",[va(r,t)])}});joe={display:Rn.DISPLAY,text:Rn.TEXT,script:Rn.SCRIPT,scriptscript:Rn.SCRIPTSCRIPT};hr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:r,funcName:n,parser:i}=e,a=i.parseExpression(!0,r),o=n.slice(1,n.length-5);if(!CZt(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var r=joe[e.style],n=t.havingStyle(r);return e.resetFont&&(n=n.withFont("")),HOe(e.body,n,t)},mathmlBuilder(e,t){var r=joe[e.style],n=t.havingStyle(r);e.resetFont&&(n=n.withFont(""));var i=Eh(e.body,n),a=new Ht("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[e.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});SZt=function(t,r){var n=t.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Rn.DISPLAY.size||n.alwaysHandleSupSub);return i?gk:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Rn.DISPLAY.size||n.limits);return a?VOe:null}else{if(n.type==="accent")return iy(n.base)?ise:null;if(n.type==="horizBrace"){var o=!t.sub;return o===n.isOver?zOe:null}else return null}else return null};H5({type:"supsub",htmlBuilder(e,t){var r=SZt(e,t);if(r)return r(e,t);var{base:n,sup:i,sub:a}=e,o=Vi(n,t),s,l,u=t.fontMetrics(),d=0,h=0,f=n&&iy(n);if(i){var p=t.havingStyle(t.style.sup());s=Vi(i,p,t),f||(d=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());l=Vi(a,m,t),f||(h=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var g;t.style===Rn.DISPLAY?g=u.sup1:t.style.cramped?g=u.sup3:g=u.sup2;var y=t.sizeMultiplier,v=Zt(.5/u.ptPerEm/y),b=null;if(l){var x=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(o instanceof Tu||x){var E;b=Zt(-((E=o.italic)!=null?E:0))}}var w;if(s&&l){d=Math.max(d,g,s.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var T=u.defaultRuleThickness,C=4*T;if(d-s.depth-(l.height-h)0&&(d+=S,h-=S)}var R=[{type:"elem",elem:l,shift:h,marginRight:v,marginLeft:b},{type:"elem",elem:s,shift:-d,marginRight:v}];w=Wi({positionType:"individualShift",children:R})}else if(l){h=Math.max(h,u.sub1,l.height-.8*u.xHeight);var U=[{type:"elem",elem:l,marginLeft:b,marginRight:v}];w=Wi({positionType:"shift",positionData:h,children:U})}else if(s)d=Math.max(d,g,s.depth+.25*u.xHeight),w=Wi({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=Woe(o,"right")||"mord";return Gt([L],[o,Gt(["msupsub"],[w])],t)},mathmlBuilder(e,t){var r=!1,n,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(r=!0,n=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[va(e.base,t)];e.sub&&a.push(va(e.sub,t)),e.sup&&a.push(va(e.sup,t));var o;if(r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Rn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Rn.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Rn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Rn.DISPLAY)?o="munder":o="msub"}else{var s=e.base;s&&s.type==="op"&&s.limits&&(t.style===Rn.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===Rn.DISPLAY)?o="mover":o="msup"}return new Ht(o,a)}});H5({type:"atom",htmlBuilder(e,t){return ese(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var r=new Ht("mo",[Af(e.text,e.mode)]);if(e.family==="bin"){var n=nse(e,t);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else e.family==="punct"?r.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&r.setAttribute("stretchy","false");return r}});qOe={mi:"italic",mn:"normal",mtext:"normal"};H5({type:"mathord",htmlBuilder(e,t){return JF(e,t,"mathord")},mathmlBuilder(e,t){var r=new Ht("mi",[Af(e.text,e.mode,t)]),n=nse(e,t)||"italic";return n!==qOe[r.type]&&r.setAttribute("mathvariant",n),r}});H5({type:"textord",htmlBuilder(e,t){return JF(e,t,"textord")},mathmlBuilder(e,t){var r=Af(e.text,e.mode,t),n=nse(e,t)||"normal",i;return e.mode==="text"?i=new Ht("mtext",[r]):/[0-9]/.test(e.text)?i=new Ht("mn",[r]):e.text==="\\prime"?i=new Ht("mo",[r]):i=new Ht("mi",[r]),n!==qOe[i.type]&&i.setAttribute("mathvariant",n),i}});Uoe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ioe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};H5({type:"spacing",htmlBuilder(e,t){if(Ioe.hasOwnProperty(e.text)){var r=Ioe[e.text].className||"";if(e.mode==="text"){var n=JF(e,t,"textord");return n.classes.push(r),n}else return Gt(["mspace",r],[ese(e.text,e.mode,t)],t)}else{if(Uoe.hasOwnProperty(e.text))return Gt(["mspace",Uoe[e.text]],[],t);throw new Yt('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var r;if(Ioe.hasOwnProperty(e.text))r=new Ht("mtext",[new zo("\xA0")]);else{if(Uoe.hasOwnProperty(e.text))return new Ht("mspace");throw new Yt('Unknown type of space "'+e.text+'"')}return r}});jPe=()=>{var e=new Ht("mtd",[]);return e.setAttribute("width","50%"),e};H5({type:"tag",mathmlBuilder(e,t){var r=new Ht("mtable",[new Ht("mtr",[jPe(),new Ht("mtd",[o2(e.body,t)]),jPe(),new Ht("mtd",[o2(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});XPe={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$Pe={"\\textbf":"textbf","\\textmd":"textmd"},AZt={"\\textit":"textit","\\textup":"textup"},KPe=(e,t)=>{var r=e.font;if(r){if(XPe[r])return t.withTextFontFamily(XPe[r]);if($Pe[r])return t.withTextFontWeight($Pe[r]);if(r==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(AZt[r])};hr({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:r,funcName:n}=e,i=t[0];return{type:"text",mode:r.mode,body:Cs(i),font:n}},htmlBuilder(e,t){var r=KPe(e,t),n=tl(e.body,r,!0);return Gt(["mord","text"],n,r)},mathmlBuilder(e,t){var r=KPe(e,t);return o2(e.body,r)}});hr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=Vi(e.body,t),n=fk("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=Wi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Gt(["mord","underline"],[a],t)},mathmlBuilder(e,t){var r=new Ht("mo",[new zo("\u203E")]);r.setAttribute("stretchy","true");var n=new Ht("munder",[va(e.body,t),r]);return n.setAttribute("accentunder","true"),n}});hr({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=Vi(e.body,t),n=t.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Wi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){var r=new Ht("mpadded",[va(e.body,t)],["vcenter"]);return new Ht("mrow",[r])}});hr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new Yt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var r=ZPe(e),n=[],i=t.havingStyle(t.style.text()),a=0;ae.body.replace(/ /g,e.star?"\u2423":"\xA0"),t2=fOe,YOe=`[ \r - ]`,UZt="\\\\[a-zA-Z@]+",IZt="\\\\[^\uD800-\uDFFF]",RZt="("+UZt+")"+YOe+"*",MZt=`\\\\( -|[ \r ]+ -?)[ \r ]*`,Xoe="[\u0300-\u036F]",LZt=new RegExp(Xoe+"+$"),DZt="("+YOe+"+)|"+(MZt+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Xoe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Xoe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+RZt)+("|"+IZt+")"),KF=class{constructor(t,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=r,this.tokenRegex=new RegExp(DZt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){var t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new xh("EOF",new wd(this,r,r));var n=this.tokenRegex.exec(t);if(n===null||n.index!==r)throw new Yt("Unexpected character: '"+t[r]+"'",new xh(t[r],new wd(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new xh(i,new wd(this,r,this.tokenRegex.lastIndex))}},$oe=class{constructor(t,r){t===void 0&&(t={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Yt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var r in t)t.hasOwnProperty(r)&&(t[r]==null?delete this.current[r]:this.current[r]=t[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}r==null?delete this.current[t]:this.current[t]=r}},NZt=_Oe;Re("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});Re("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});Re("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});Re("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});Re("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return t[0].length===1&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});Re("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Re("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});QPe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Re("\\char",function(e){var t=e.popToken(),r,n=0;if(t.text==="'")r=8,t=e.popToken();else if(t.text==='"')r=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")n=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Yt("\\char` missing argument");n=t.text.charCodeAt(0)}else r=10;if(r){if(n=QPe[t.text],n==null||n>=r)throw new Yt("Invalid base-"+r+" digit "+t.text);for(var i;(i=QPe[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1)throw new Yt("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new Yt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!r)throw new Yt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Yt("Invalid number of arguments: "+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&n||e.macros.set(a,{tokens:i,numArgs:s}),""};Re("\\newcommand",e=>lse(e,!1,!0,!1));Re("\\renewcommand",e=>lse(e,!0,!1,!1));Re("\\providecommand",e=>lse(e,!0,!0,!0));Re("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(r=>r.text).join("")),""});Re("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(r=>r.text).join("")),""});Re("\\show",e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),t2[r],so.math[r],so.text[r]),""});Re("\\bgroup","{");Re("\\egroup","}");Re("~","\\nobreakspace");Re("\\lq","`");Re("\\rq","'");Re("\\aa","\\r a");Re("\\AA","\\r A");Re("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");Re("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Re("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");Re("\u212C","\\mathscr{B}");Re("\u2130","\\mathscr{E}");Re("\u2131","\\mathscr{F}");Re("\u210B","\\mathscr{H}");Re("\u2110","\\mathscr{I}");Re("\u2112","\\mathscr{L}");Re("\u2133","\\mathscr{M}");Re("\u211B","\\mathscr{R}");Re("\u212D","\\mathfrak{C}");Re("\u210C","\\mathfrak{H}");Re("\u2128","\\mathfrak{Z}");Re("\\Bbbk","\\Bbb{k}");Re("\\llap","\\mathllap{\\textrm{#1}}");Re("\\rlap","\\mathrlap{\\textrm{#1}}");Re("\\clap","\\mathclap{\\textrm{#1}}");Re("\\mathstrut","\\vphantom{(}");Re("\\underbar","\\underline{\\text{#1}}");Re("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Re("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");Re("\\ne","\\neq");Re("\u2260","\\neq");Re("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");Re("\u2209","\\notin");Re("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");Re("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");Re("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");Re("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");Re("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");Re("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");Re("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");Re("\u27C2","\\perp");Re("\u203C","\\mathclose{!\\mkern-0.8mu!}");Re("\u220C","\\notni");Re("\u231C","\\ulcorner");Re("\u231D","\\urcorner");Re("\u231E","\\llcorner");Re("\u231F","\\lrcorner");Re("\xA9","\\copyright");Re("\xAE","\\textregistered");Re("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Re("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Re("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Re("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Re("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Re("\u22EE","\\vdots");Re("\\varGamma","\\mathit{\\Gamma}");Re("\\varDelta","\\mathit{\\Delta}");Re("\\varTheta","\\mathit{\\Theta}");Re("\\varLambda","\\mathit{\\Lambda}");Re("\\varXi","\\mathit{\\Xi}");Re("\\varPi","\\mathit{\\Pi}");Re("\\varSigma","\\mathit{\\Sigma}");Re("\\varUpsilon","\\mathit{\\Upsilon}");Re("\\varPhi","\\mathit{\\Phi}");Re("\\varPsi","\\mathit{\\Psi}");Re("\\varOmega","\\mathit{\\Omega}");Re("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Re("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Re("\\boxed","\\fbox{$\\displaystyle{#1}$}");Re("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Re("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Re("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Re("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Re("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");JPe={",":"\\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"},_Zt=new Set(["bin","rel"]);Re("\\dots",function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in JPe?t=JPe[r]:(r.slice(0,4)==="\\not"||r in so.math&&_Zt.has(so.math[r].group))&&(t="\\dotsb"),t});cse={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Re("\\dotso",function(e){var t=e.future().text;return t in cse?"\\ldots\\,":"\\ldots"});Re("\\dotsc",function(e){var t=e.future().text;return t in cse&&t!==","?"\\ldots\\,":"\\ldots"});Re("\\cdots",function(e){var t=e.future().text;return t in cse?"\\@cdots\\,":"\\@cdots"});Re("\\dotsb","\\cdots");Re("\\dotsm","\\cdots");Re("\\dotsi","\\!\\cdots");Re("\\dotsx","\\ldots\\,");Re("\\DOTSI","\\relax");Re("\\DOTSB","\\relax");Re("\\DOTSX","\\relax");Re("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Re("\\,","\\tmspace+{3mu}{.1667em}");Re("\\thinspace","\\,");Re("\\>","\\mskip{4mu}");Re("\\:","\\tmspace+{4mu}{.2222em}");Re("\\medspace","\\:");Re("\\;","\\tmspace+{5mu}{.2777em}");Re("\\thickspace","\\;");Re("\\!","\\tmspace-{3mu}{.1667em}");Re("\\negthinspace","\\!");Re("\\negmedspace","\\tmspace-{4mu}{.2222em}");Re("\\negthickspace","\\tmspace-{5mu}{.277em}");Re("\\enspace","\\kern.5em ");Re("\\enskip","\\hskip.5em\\relax");Re("\\quad","\\hskip1em\\relax");Re("\\qquad","\\hskip2em\\relax");Re("\\tag","\\@ifstar\\tag@literal\\tag@paren");Re("\\tag@paren","\\tag@literal{({#1})}");Re("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Yt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Re("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Re("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Re("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Re("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Re("\\newline","\\\\\\relax");Re("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");jOe=Zt(Pm["Main-Regular"][84][1]-.7*Pm["Main-Regular"][65][1]);Re("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+jOe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Re("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+jOe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Re("\\hspace","\\@ifstar\\@hspacer\\@hspace");Re("\\@hspace","\\hskip #1\\relax");Re("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Re("\\ordinarycolon",":");Re("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Re("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Re("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Re("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Re("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Re("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Re("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Re("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Re("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Re("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Re("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Re("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Re("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Re("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Re("\u2237","\\dblcolon");Re("\u2239","\\eqcolon");Re("\u2254","\\coloneqq");Re("\u2255","\\eqqcolon");Re("\u2A74","\\Coloneqq");Re("\\ratio","\\vcentcolon");Re("\\coloncolon","\\dblcolon");Re("\\colonequals","\\coloneqq");Re("\\coloncolonequals","\\Coloneqq");Re("\\equalscolon","\\eqqcolon");Re("\\equalscoloncolon","\\Eqqcolon");Re("\\colonminus","\\coloneq");Re("\\coloncolonminus","\\Coloneq");Re("\\minuscolon","\\eqcolon");Re("\\minuscoloncolon","\\Eqcolon");Re("\\coloncolonapprox","\\Colonapprox");Re("\\coloncolonsim","\\Colonsim");Re("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Re("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Re("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Re("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Re("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");Re("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Re("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Re("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Re("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Re("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Re("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Re("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Re("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Re("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");Re("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");Re("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");Re("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");Re("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");Re("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");Re("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");Re("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");Re("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");Re("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");Re("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");Re("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");Re("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");Re("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");Re("\\imath","\\html@mathml{\\@imath}{\u0131}");Re("\\jmath","\\html@mathml{\\@jmath}{\u0237}");Re("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");Re("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");Re("\u27E6","\\llbracket");Re("\u27E7","\\rrbracket");Re("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");Re("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");Re("\u2983","\\lBrace");Re("\u2984","\\rBrace");Re("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");Re("\u29B5","\\minuso");Re("\\darr","\\downarrow");Re("\\dArr","\\Downarrow");Re("\\Darr","\\Downarrow");Re("\\lang","\\langle");Re("\\rang","\\rangle");Re("\\uarr","\\uparrow");Re("\\uArr","\\Uparrow");Re("\\Uarr","\\Uparrow");Re("\\N","\\mathbb{N}");Re("\\R","\\mathbb{R}");Re("\\Z","\\mathbb{Z}");Re("\\alef","\\aleph");Re("\\alefsym","\\aleph");Re("\\Alpha","\\mathrm{A}");Re("\\Beta","\\mathrm{B}");Re("\\bull","\\bullet");Re("\\Chi","\\mathrm{X}");Re("\\clubs","\\clubsuit");Re("\\cnums","\\mathbb{C}");Re("\\Complex","\\mathbb{C}");Re("\\Dagger","\\ddagger");Re("\\diamonds","\\diamondsuit");Re("\\empty","\\emptyset");Re("\\Epsilon","\\mathrm{E}");Re("\\Eta","\\mathrm{H}");Re("\\exist","\\exists");Re("\\harr","\\leftrightarrow");Re("\\hArr","\\Leftrightarrow");Re("\\Harr","\\Leftrightarrow");Re("\\hearts","\\heartsuit");Re("\\image","\\Im");Re("\\infin","\\infty");Re("\\Iota","\\mathrm{I}");Re("\\isin","\\in");Re("\\Kappa","\\mathrm{K}");Re("\\larr","\\leftarrow");Re("\\lArr","\\Leftarrow");Re("\\Larr","\\Leftarrow");Re("\\lrarr","\\leftrightarrow");Re("\\lrArr","\\Leftrightarrow");Re("\\Lrarr","\\Leftrightarrow");Re("\\Mu","\\mathrm{M}");Re("\\natnums","\\mathbb{N}");Re("\\Nu","\\mathrm{N}");Re("\\Omicron","\\mathrm{O}");Re("\\plusmn","\\pm");Re("\\rarr","\\rightarrow");Re("\\rArr","\\Rightarrow");Re("\\Rarr","\\Rightarrow");Re("\\real","\\Re");Re("\\reals","\\mathbb{R}");Re("\\Reals","\\mathbb{R}");Re("\\Rho","\\mathrm{P}");Re("\\sdot","\\cdot");Re("\\sect","\\S");Re("\\spades","\\spadesuit");Re("\\sub","\\subset");Re("\\sube","\\subseteq");Re("\\supe","\\supseteq");Re("\\Tau","\\mathrm{T}");Re("\\thetasym","\\vartheta");Re("\\weierp","\\wp");Re("\\Zeta","\\mathrm{Z}");Re("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Re("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Re("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Re("\\bra","\\mathinner{\\langle{#1}|}");Re("\\ket","\\mathinner{|{#1}\\rangle}");Re("\\braket","\\mathinner{\\langle{#1}\\rangle}");Re("\\Bra","\\left\\langle#1\\right|");Re("\\Ket","\\left|#1\\right\\rangle");XOe=e=>t=>{var r=t.consumeArg().tokens,n=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=h=>f=>{e&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",s));var p=h;if(!h&&i.length){var m=f.future();m.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var u=t.consumeArg().tokens,d=t.expandTokens([...a,...u,...r]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Re("\\bra@ket",XOe(!1));Re("\\bra@set",XOe(!0));Re("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Re("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Re("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Re("\\angln","{\\angl n}");Re("\\blue","\\textcolor{##6495ed}{#1}");Re("\\orange","\\textcolor{##ffa500}{#1}");Re("\\pink","\\textcolor{##ff00af}{#1}");Re("\\red","\\textcolor{##df0030}{#1}");Re("\\green","\\textcolor{##28ae7b}{#1}");Re("\\gray","\\textcolor{gray}{#1}");Re("\\purple","\\textcolor{##9d38bd}{#1}");Re("\\blueA","\\textcolor{##ccfaff}{#1}");Re("\\blueB","\\textcolor{##80f6ff}{#1}");Re("\\blueC","\\textcolor{##63d9ea}{#1}");Re("\\blueD","\\textcolor{##11accd}{#1}");Re("\\blueE","\\textcolor{##0c7f99}{#1}");Re("\\tealA","\\textcolor{##94fff5}{#1}");Re("\\tealB","\\textcolor{##26edd5}{#1}");Re("\\tealC","\\textcolor{##01d1c1}{#1}");Re("\\tealD","\\textcolor{##01a995}{#1}");Re("\\tealE","\\textcolor{##208170}{#1}");Re("\\greenA","\\textcolor{##b6ffb0}{#1}");Re("\\greenB","\\textcolor{##8af281}{#1}");Re("\\greenC","\\textcolor{##74cf70}{#1}");Re("\\greenD","\\textcolor{##1fab54}{#1}");Re("\\greenE","\\textcolor{##0d923f}{#1}");Re("\\goldA","\\textcolor{##ffd0a9}{#1}");Re("\\goldB","\\textcolor{##ffbb71}{#1}");Re("\\goldC","\\textcolor{##ff9c39}{#1}");Re("\\goldD","\\textcolor{##e07d10}{#1}");Re("\\goldE","\\textcolor{##a75a05}{#1}");Re("\\redA","\\textcolor{##fca9a9}{#1}");Re("\\redB","\\textcolor{##ff8482}{#1}");Re("\\redC","\\textcolor{##f9685d}{#1}");Re("\\redD","\\textcolor{##e84d39}{#1}");Re("\\redE","\\textcolor{##bc2612}{#1}");Re("\\maroonA","\\textcolor{##ffbde0}{#1}");Re("\\maroonB","\\textcolor{##ff92c6}{#1}");Re("\\maroonC","\\textcolor{##ed5fa6}{#1}");Re("\\maroonD","\\textcolor{##ca337c}{#1}");Re("\\maroonE","\\textcolor{##9e034e}{#1}");Re("\\purpleA","\\textcolor{##ddd7ff}{#1}");Re("\\purpleB","\\textcolor{##c6b9fc}{#1}");Re("\\purpleC","\\textcolor{##aa87ff}{#1}");Re("\\purpleD","\\textcolor{##7854ab}{#1}");Re("\\purpleE","\\textcolor{##543b78}{#1}");Re("\\mintA","\\textcolor{##f5f9e8}{#1}");Re("\\mintB","\\textcolor{##edf2df}{#1}");Re("\\mintC","\\textcolor{##e0e5cc}{#1}");Re("\\grayA","\\textcolor{##f6f7f7}{#1}");Re("\\grayB","\\textcolor{##f0f1f2}{#1}");Re("\\grayC","\\textcolor{##e3e5e6}{#1}");Re("\\grayD","\\textcolor{##d6d8da}{#1}");Re("\\grayE","\\textcolor{##babec2}{#1}");Re("\\grayF","\\textcolor{##888d93}{#1}");Re("\\grayG","\\textcolor{##626569}{#1}");Re("\\grayH","\\textcolor{##3b3e40}{#1}");Re("\\grayI","\\textcolor{##21242c}{#1}");Re("\\kaBlue","\\textcolor{##314453}{#1}");Re("\\kaGreen","\\textcolor{##71B307}{#1}");$Oe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Koe=class{constructor(t,r,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=r,this.expansionCount=0,this.feed(t),this.macros=new $oe(NZt,r.macros),this.mode=n,this.stack=[]}feed(t){this.lexer=new KF(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var r,n,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new xh("EOF",n.loc)),this.pushTokens(i),new xh("",wd.range(r,n))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var r=[],n=t&&t.length>0;n||this.consumeSpaces();var i=this.future(),a,o=0,s=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Yt("Extra }",a)}else if(a.text==="EOF")throw new Yt("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",a);if(t&&n)if((o===0||o===1&&t[s]==="{")&&a.text===t[s]){if(++s,s===t.length){r.splice(-s,s);break}}else s=0}while(o!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(t,r){if(r){if(r.length!==t+1)throw new Yt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Yt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||t&&i.unexpandable){if(t&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Yt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new Yt("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+l.text-1]);else throw new Yt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new xh(t)]):void 0}expandTokens(t){var r=[],n=this.stack.length;for(this.pushTokens(t);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(t){var r=this.expandMacro(t);return r&&r.map(n=>n.text).join("")}_getExpansion(t){var r=this.macros.get(t);if(r==null)return r;if(t.length===1){var n=this.lexer.catcodes[t];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var s=new KF(i,this.settings),l=[],u=s.lex();u.text!=="EOF";)l.push(u),u=s.lex();l.reverse();var d={tokens:l,numArgs:a};return d}return i}isDefined(t){return this.macros.has(t)||t2.hasOwnProperty(t)||so.math.hasOwnProperty(t)||so.text.hasOwnProperty(t)||$Oe.hasOwnProperty(t)}isExpandable(t){var r=this.macros.get(t);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:t2.hasOwnProperty(t)&&!t2[t].primitive}},eOe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FF=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),Roe={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},tOe={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},ZF=class e{constructor(t,r){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 Koe(t,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(t,r){if(r===void 0&&(r=!0),this.fetch().text!==t)throw new Yt("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var r=this.nextToken;this.consume(),this.gullet.pushToken(new xh("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(t,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||r&&i.text===r||t&&t2[i.text]&&t2[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(t){for(var r=-1,n,i=0;i=128)this.settings.strict&&(rOe(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:wd.range(t),text:r};else return null;if(this.consume(),a)for(var d=0;d{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),xd.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}function gz(e){return[...e.cssRules].map(t=>t.cssText).join(` -`)}var hse,co,Wm,Vm,fn,OZt,BZt,FZt,zZt,GZt,Bc,WZt,VZt,HZt,qZt,YZt,jZt,XZt,$Zt,KZt,ZZt,QZt,JZt,eQt,tQt,rQt,nQt,Gm,rc,lBe,cBe,iQt,Xr,aQt,oQt,_9,pse,Y5,Th,Ed,hz,q5,N9,P9,uBe,dBe,hBe,mse,gse,Kt,fBe,pBe,O9,sQt,iBe,mBe,lQt,pz,As,yse,yk,cQt,vse,l2,B9,mz,gBe,yBe,j5,uQt,dQt,bBe,aBe,rn,hQt,fQt,pQt,mQt,xBe,F9,gQt,yQt,Hm,fse,vQt,bQt,oBe,uz,uo,vk,xQt,bk,Lt,wQt,EQt,zn,qm,dz,TQt,kQt,wBe,yz,bse,xse,wse,Ese,$r,sn,pn,mn,gn,Sn,yn,sBe,CQt,je,z9,vz,bz,G9,SQt,fz,W9,xz,AQt,Wr=H(()=>{Gr();xr();Ts();Ts();Ts();Ts();Ts();Ts();Ts();Ts();Ts();Ts();Ts();Ts();lk();hse=k((e,t,{depth:r=2}={})=>{let n={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(i=>hse(e,i,n)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(i=>{e.includes(i)||e.push(i)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){let i=e;Object.entries(t).forEach(([a,o])=>{if(typeof o=="object"){if(o===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(o)?[]:{}),typeof i[a]=="object"&&(i[a]=hse(i[a],o,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(e,a)?i[a]=o:Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),co=hse,Wm="#ffffff",Vm="#f2f2f2",fn=k((e,t)=>t?be(e,{s:-40,l:10}):be(e,{s:-40,l:-10}),"mkBorder"),OZt=class{static{k(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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?lt(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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(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.vertLineColor=this.vertLineColor||"navy",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.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||lt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||lt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(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||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},BZt=k(e=>{let t=new OZt;return t.calculate(e),t},"getThemeVariables"),FZt=class{static{k(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=ls(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.radius=5,this.strokeWidth=1,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.clusterBkg="#302F3D",this.sectionBkgColor=lt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=lt(this.sectionBkgColor,10),this.taskBorderColor=ls(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=ls(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.vertLineColor="#00BFFF",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||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||lt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=st(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=st(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.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=st(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=et(this.doneTaskBkgColor),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=be(this.primaryColor,{h:64}),this.fillType3=be(this.secondaryColor,{h:64}),this.fillType4=be(this.primaryColor,{h:-64}),this.fillType5=be(this.secondaryColor,{h:-64}),this.fillType6=be(this.primaryColor,{h:128}),this.fillType7=be(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||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},zZt=k(e=>{let t=new FZt;return t.calculate(e),t},"getThemeVariables"),GZt=class{static{k(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=be(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=fn(this.primaryColor,this.darkMode),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.radius=5,this.strokeWidth=1,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.clusterBkg="#FBFBFF",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.vertLineColor="calculated",this.sectionBkgColor=ls(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.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",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.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",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||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||lt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||lt(this.tertiaryColor,40);for(let e=0;e{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}let t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Bc=k(e=>{let t=new GZt;return t.calculate(e),t},"getThemeVariables"),WZt=class{static{k(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=st("#cde498",10),this.primaryBorderColor=fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.primaryColor),this.lineColor=et(this.background),this.textColor=et(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,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.vertLineColor="#00BFFF",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.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=lt(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.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||lt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||lt(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},VZt=k(e=>{let t=new WZt;return t.calculate(e),t},"getThemeVariables"),HZt=class{static{k(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.lineColor=et(this.background),this.textColor=et(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.radius=5,this.strokeWidth=1,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.vertLineColor="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.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,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[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},qZt=k(e=>{let t=new HZt;return t.calculate(e),t},"getThemeVariables"),YZt=class{static{k(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=fn(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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?lt(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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e="#ECECFE",t="#E9E9F1",r=be(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||be(e,{h:30}),this.cScale4=this.cScale4||be(e,{h:60}),this.cScale5=this.cScale5||be(e,{h:90}),this.cScale6=this.cScale6||be(e,{h:120}),this.cScale7=this.cScale7||be(e,{h:150}),this.cScale8=this.cScale8||be(e,{h:210,l:150}),this.cScale9=this.cScale9||be(e,{h:270}),this.cScale10=this.cScale10||be(e,{h:300}),this.cScale11=this.cScale11||be(e,{h:330}),this.darkMode)for(let i=0;i{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},jZt=k(e=>{let t=new YZt;return t.calculate(e),t},"getThemeVariables"),XZt=class{static{k(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=ls(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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.border1,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?lt(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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},$Zt=k(e=>{let t=new XZt;return t.calculate(e),t},"getThemeVariables"),KZt=class{static{k(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=fn("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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?lt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e="#ECECFE",t="#E9E9F1",r=be(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",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;for(let i=0;i{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},ZZt=k(e=>{let t=new KZt;return t.calculate(e),t},"getThemeVariables"),QZt=class{static{k(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=ls(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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.border1,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?lt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||st(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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",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||be(this.primaryColor,{h:30}),this.cScale4=this.cScale4||be(this.primaryColor,{h:60}),this.cScale5=this.cScale5||be(this.primaryColor,{h:90}),this.cScale6=this.cScale6||be(this.primaryColor,{h:120}),this.cScale7=this.cScale7||be(this.primaryColor,{h:150}),this.cScale8=this.cScale8||be(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||be(this.primaryColor,{h:270}),this.cScale10=this.cScale10||be(this.primaryColor,{h:300}),this.cScale11=this.cScale11||be(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},JZt=k(e=>{let t=new QZt;return t.calculate(e),t},"getThemeVariables"),eQt=class{static{k(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=fn(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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?lt(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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e="#ECECFE",t="#E9E9F1",r=be(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||st(e,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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let i=0;i{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},tQt=k(e=>{let t=new eQt;return t.calculate(e),t},"getThemeVariables"),rQt=class{static{k(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=be(this.primaryColor,{h:-160}),this.primaryBorderColor=et(this.background),this.secondaryBorderColor=fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=fn(this.tertiaryColor,this.darkMode),this.primaryTextColor=et(this.primaryColor),this.secondaryTextColor=et(this.secondaryColor),this.tertiaryTextColor=et(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(et("#323D47"),10),this.border1="#ccc",this.border2=ls(255,255,255,.25),this.arrowheadColor=et(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||be(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||be(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||fn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||fn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||fn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||fn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||et(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||et(this.tertiaryColor),this.lineColor=this.lineColor||et(this.background),this.arrowheadColor=this.arrowheadColor||et(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.border1,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?lt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",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||lt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||et(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",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||st(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.vertLineColor=this.vertLineColor||this.primaryBorderColor,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.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,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||"#f0f0f0",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||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},nQt=k(e=>{let t=new rQt;return t.calculate(e),t},"getThemeVariables"),Gm={base:{getThemeVariables:BZt},dark:{getThemeVariables:zZt},default:{getThemeVariables:Bc},forest:{getThemeVariables:VZt},neutral:{getThemeVariables:qZt},neo:{getThemeVariables:jZt},"neo-dark":{getThemeVariables:$Zt},redux:{getThemeVariables:ZZt},"redux-dark":{getThemeVariables:JZt},"redux-color":{getThemeVariables:tQt},"redux-dark-color":{getThemeVariables:nQt}},rc={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},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,maxLabelWidth:360,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"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},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,donutHole:0,legendPosition:"right",highlightSlice:""},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,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,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,labelRotation:0},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,labelRotation:0},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,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},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:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},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},lBe={...rc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:Gm.default.getThemeVariables(),sequence:{...rc.sequence,messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:k(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:k(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...rc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...rc.c4,useWidth:void 0,personFont:k(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...rc.flowchart,inheritDir:!1},external_personFont:k(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:k(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:k(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:k(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:k(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:k(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:k(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:k(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:k(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:k(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:k(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:k(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:k(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:k(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:k(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:k(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:k(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:k(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:k(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:k(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:k(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...rc.pie,useWidth:984},xyChart:{...rc.xyChart,useWidth:void 0},requirement:{...rc.requirement,useWidth:void 0},packet:{...rc.packet},eventmodeling:{...rc.eventmodeling},treeView:{...rc.treeView,useWidth:void 0},radar:{...rc.radar},railroad:{...rc.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...rc.ishikawa},sankey:{...rc.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...rc.venn},cynefin:{...rc.cynefin}},cBe=k((e,t="")=>Object.keys(e).reduce((r,n)=>Array.isArray(e[n])?r:typeof e[n]=="object"&&e[n]!==null?[...r,t+n,...cBe(e[n],"")]:[...r,t+n],[]),"keyify"),iQt=new Set(cBe(lBe,"")),Xr=lBe,aQt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},oQt=k((e,t)=>{for(let r of Object.keys(e)){let n=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!t.test(n))&&(ye.debug("sanitize deleting dictionary entry:",r,n),delete e[r])}},"sanitizeDictionaryConfig"),_9=k(e=>{if(ye.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>_9(t));return}for(let t of Object.keys(e)){if(ye.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!iQt.has(t)||e[t]==null){ye.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){let n=aQt[t];n?oQt(e[t],n):(ye.debug("sanitizing object",t),_9(e[t]));continue}let r=["themeCSS","fontFamily","altFontFamily"];for(let n of r)t.includes(n)&&(ye.debug("sanitizing css option",t),e[t]=pse(e[t]))}if(e.themeVariables)for(let t of Object.keys(e.themeVariables)){let r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}ye.debug("After sanitization",e)}},"sanitizeDirective"),pse=k(e=>{let t=0,r=0;for(let n of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ed=co({},Y5),q5=[],N9=co({},Y5),P9=k((e,t)=>{let r=co({},e),n={};for(let i of t)fBe(i),n=co(n,i);if(r=co(r,n),n.theme&&n.theme in Gm){let i=co({},hz),a=co(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Gm&&(r.themeVariables=Gm[r.theme].getThemeVariables(a))}return N9=r,lQt(N9),N9},"updateCurrentConfig"),uBe=k(e=>(Ed=co({},Y5),Ed=co(Ed,e),e.theme&&Gm[e.theme]&&(Ed.themeVariables=Gm[e.theme].getThemeVariables(e.themeVariables)),P9(Ed,q5),Ed),"setSiteConfig"),dBe=k(e=>{hz=co({},e)},"saveConfigFromInitialize"),hBe=k(e=>(Ed=co(Ed,e),P9(Ed,q5),Ed),"updateSiteConfig"),mse=k(()=>co({},Ed),"getSiteConfig"),gse=k(e=>(P9(N9,[e]),Kt()),"setConfig"),Kt=k(()=>co({},N9),"getConfig"),fBe=k(e=>{e&&(["secure",...Ed.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(ye.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=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&fBe(e[t])}))},"sanitize"),pBe=k(e=>{_9(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),q5.push(e),P9(Ed,q5)},"addDirective"),O9=k((e=Ed)=>{q5=[],P9(e,q5)},"reset"),sQt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},iBe={},mBe=k(e=>{iBe[e]||(ye.warn(sQt[e]),iBe[e]=!0)},"issueWarning"),lQt=k(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&mBe("LAZY_LOAD_DEPRECATED")},"checkConfig"),pz=k(()=>{let e={};hz&&(e=co(e,hz));for(let t of q5)e=co(e,t);return e},"getUserDefinedConfig"),As=k(e=>(e.flowchart?.htmlLabels!=null&&mBe("FLOWCHART_HTML_LABELS_DEPRECATED"),Th(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),yse=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,yk=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,cQt=/\s*%%.*\n/gm,vse=class extends Error{static{k(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},l2={},B9=k(function(e,t){e=e.replace(yse,"").replace(yk,"").replace(cQt,` -`);for(let[r,{detector:n}]of Object.entries(l2))if(n(e,t))return r;throw new vse(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),mz=k((...e)=>{for(let{id:t,detector:r,loader:n}of e)gBe(t,r,n)},"registerLazyLoadedDiagrams"),gBe=k((e,t,r)=>{l2[e]&&ye.warn(`Detector with key ${e} already exists. Overwriting.`),l2[e]={detector:t,loader:r},ye.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),yBe=k(e=>l2[e].loader,"getDiagramLoader"),j5=//gi,uQt=k(e=>e?xBe(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),dQt=(()=>{let e=!1;return()=>{e||(vBe(),e=!0)}})();k(vBe,"setupDompurifyHooks");bBe=k(e=>(dQt(),xd.sanitize(e)),"removeScript"),aBe=k((e,t)=>{if(As(t)){let r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=bBe(e):r!=="loose"&&(e=xBe(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=mQt(e))}return e},"sanitizeMore"),rn=k((e,t)=>e&&(t.dompurifyConfig?e=xd.sanitize(aBe(e,t),t.dompurifyConfig).toString():e=xd.sanitize(aBe(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),hQt=k((e,t)=>typeof e=="string"?rn(e,t):e.flat().map(r=>rn(r,t)),"sanitizeTextOrArray"),fQt=k(e=>j5.test(e),"hasBreaks"),pQt=k(e=>e.split(j5),"splitBreaks"),mQt=k(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),xBe=k(e=>e.replace(j5,"#br#"),"breakToPlaceholder"),F9=k(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),gQt=k(function(...e){let t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),yQt=k(function(...e){let t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Hm=k(function(e){let t=e.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,e.split(t).length-1),"countOccurrence"),vQt=k((e,t)=>{let r=fse(e,"~"),n=fse(t,"~");return r===1&&n===1},"shouldCombineSets"),bQt=k(e=>{let t=fse(e,"~"),r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);let n=[...e],i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),oBe=k(()=>window.MathMLElement!==void 0,"isMathMLSupported"),uz=/\$\$(.*?)\$\$/g,uo=k(e=>(e.match(uz)?.length??0)>0,"hasKatex"),vk=k(async(e,t)=>{let r=document.createElement("div");r.innerHTML=await bk(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);let i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),xQt=k(async(e,t)=>{if(!uo(e))return e;if(!(oBe()||t.legacyMathML||t.forceLegacyMathML))return e.replace(uz,"MathML is unsupported in this environment.");{let{default:r}=await Promise.resolve().then(()=>(nBe(),rBe)),n=t.forceLegacyMathML||!oBe()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(j5).map(i=>uo(i)?`
${i}
`:`
${i}
`).join("").replace(uz,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}return e.replace(uz,"Katex is not supported in @mermaid-js/tiny. Please use the full mermaid library.")},"renderKatexUnsanitized"),bk=k(async(e,t)=>rn(await xQt(e,t),t),"renderKatexSanitized"),Lt={getRows:uQt,sanitizeText:rn,sanitizeTextOrArray:hQt,hasBreaks:fQt,splitBreaks:pQt,lineBreakRegex:j5,removeScript:bBe,getUrl:F9,evaluate:Th,getMax:gQt,getMin:yQt},wQt=k(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),EQt=k(function(e,t,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${t}px;`)):(n.set("height",e),n.set("width",t)),n},"calculateSvgSizeAttrs"),zn=k(function(e,t,r,n){let i=EQt(t,r,n);wQt(e,i)},"configureSvgSize"),qm=k(function(e,t,r,n){let i=t.node().getBBox(),a=i.width,o=i.height;ye.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;ye.info(`Graph bounds: ${s}x${l}`,e),s=a+r*2,l=o+r*2,ye.info(`Calculated bounds: ${s}x${l}`),zn(t,l,s,n);let u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;t.attr("viewBox",u)},"setupGraphViewbox"),dz={};k(gz,"cssStyleSheetToString");TQt=k((e,t,r,n)=>{let i="";return e in dz&&dz[e]?i=dz[e]({...r,svgId:n}):ye.warn(`No theme found for ${e}`),`& { - font-family: ${r.fontFamily}; - font-size: ${r.fontSize}; - fill: ${r.textColor} - } - @keyframes edge-animation-frame { - from { - stroke-dashoffset: 0; - } - } - @keyframes dash { - to { - stroke-dashoffset: 0; - } - } - & .edge-animation-slow { - stroke-dasharray: 9,5 !important; - stroke-dashoffset: 900; - animation: dash 50s linear infinite; - stroke-linecap: round; - } - & .edge-animation-fast { - stroke-dasharray: 9,5 !important; - stroke-dashoffset: 900; - animation: dash 20s linear infinite; - stroke-linecap: round; - } - /* Classes common for multiple diagrams */ - - & .error-icon { - fill: ${r.errorBkgColor}; - } - & .error-text { - fill: ${r.errorTextColor}; - stroke: ${r.errorTextColor}; - } - - & .edge-thickness-normal { - stroke-width: ${r.strokeWidth??1}px; - } - & .edge-thickness-thick { - stroke-width: 3.5px - } - & .edge-pattern-solid { - stroke-dasharray: 0; - } - & .edge-thickness-invisible { - stroke-width: 0; - fill: none; - } - & .edge-pattern-dashed{ - stroke-dasharray: 3; - } - .edge-pattern-dotted { - stroke-dasharray: 2; - } - - & .marker { - fill: ${r.lineColor}; - stroke: ${r.lineColor}; - } - & .marker.cross { - stroke: ${r.lineColor}; - } - - & svg { - font-family: ${r.fontFamily}; - font-size: ${r.fontSize}; - } - & p { - margin: 0 - } - - ${i} - .node .neo-node { - stroke: ${r.nodeBorder}; - } - - [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { - stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; - filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; - } - [data-look="neo"].swimlane.cluster rect { - filter: none; - } - - - [data-look="neo"].node path { - stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; - stroke-width: ${r.strokeWidth??1}px; - } - - [data-look="neo"].node .outer-path { - filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; - } - - [data-look="neo"].node .neo-line path { - stroke: ${r.nodeBorder}; - filter: none; - } - - [data-look="neo"].node circle{ - stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; - filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; - } - - [data-look="neo"].node circle .state-start{ - fill: #000000; - } - - [data-look="neo"].icon-shape .icon { - fill: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; - filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; - } - - [data-look="neo"].icon-shape .icon-neo path { - stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder}; - filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"}; - } - - ${t} -`},"getStyles"),kQt=k((e,t)=>{t!==void 0&&(dz[e]=t)},"addStylesForDiagram"),wBe=TQt,yz={};Zb(yz,{clear:()=>$r,getAccDescription:()=>gn,getAccTitle:()=>pn,getDiagramTitle:()=>yn,setAccDescription:()=>mn,setAccTitle:()=>sn,setDiagramTitle:()=>Sn});bse="",xse="",wse="",Ese=k(e=>rn(e,Kt()),"sanitizeText"),$r=k(()=>{bse="",wse="",xse=""},"clear"),sn=k(e=>{bse=Ese(e).replace(/^\s+/g,"")},"setAccTitle"),pn=k(()=>bse,"getAccTitle"),mn=k(e=>{wse=Ese(e).replace(/\n\s+/g,` -`)},"setAccDescription"),gn=k(()=>wse,"getAccDescription"),Sn=k(e=>{xse=Ese(e)},"setDiagramTitle"),yn=k(()=>xse,"getDiagramTitle"),sBe=ye,CQt=m9,je=Kt,z9=gse,vz=Y5,bz=k(e=>rn(e,je()),"sanitizeText"),G9=qm,SQt=k(()=>yz,"getCommonDb"),fz={},W9=k((e,t,r)=>{fz[e]&&sBe.warn(`Diagram with id ${e} already registered. Overwriting.`),fz[e]=t,r&&gBe(e,r),kQt(e,t.styles),t.injectUtils?.(sBe,CQt,je,bz,G9,SQt(),()=>{})},"registerDiagram"),xz=k(e=>{if(e in fz)return fz[e];throw new AQt(e)},"getDiagram"),AQt=class extends Error{static{k(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});function X5(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var Tse=H(()=>{});function kse(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var EBe=H(()=>{});function $5(e){let t,r,n;e.length!==2?(t=X5,r=(s,l)=>X5(e(s),l),n=(s,l)=>e(s)-l):(t=e===X5||e===kse?e:UQt,r=e,n=e);function i(s,l,u=0,d=s.length){if(u>>1;r(s[h],l)<0?u=h+1:d=h}while(u>>1;r(s[h],l)<=0?u=h+1:d=h}while(uu&&n(s[h-1],l)>-n(s[h],l)?h-1:h}return{left:i,center:o,right:a}}function UQt(){return 0}var Cse=H(()=>{Tse();EBe()});function Sse(e){return e===null?NaN:+e}var TBe=H(()=>{});var kBe,CBe,IQt,RQt,Ase,SBe=H(()=>{Tse();Cse();TBe();kBe=$5(X5),CBe=kBe.right,IQt=kBe.left,RQt=$5(Sse).center,Ase=CBe});function ABe({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function MQt({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function LQt({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function DQt(e){return e!==null&&typeof e=="object"?e.valueOf():e}var xk,UBe=H(()=>{xk=class extends Map{constructor(t,r=DQt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(ABe(this,t))}has(t){return super.has(ABe(this,t))}set(t,r){return super.set(MQt(this,t),r)}delete(t){return super.delete(LQt(this,t))}}});function wz(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=NQt?10:a>=_Qt?5:a>=PQt?2:1,s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];let n=t=i))return[];let s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u{NQt=Math.sqrt(50),_Qt=Math.sqrt(10),PQt=Math.sqrt(2)});function Tz(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var RBe=H(()=>{});function kz(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var MBe=H(()=>{});function Cz(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n{});var c2=H(()=>{SBe();Cse();RBe();MBe();LBe();IBe();UBe()});function DBe(e){return e}var NBe=H(()=>{});function OQt(e){return"translate("+e+",0)"}function BQt(e){return"translate(0,"+e+")"}function FQt(e){return t=>+e(t)}function zQt(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function GQt(){return!this.__axis}function PBe(e,t){var r=[],n=null,i=null,a=6,o=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===Az||e===Sz?-1:1,d=e===Sz||e===Use?"x":"y",h=e===Az||e===Ise?OQt:BQt;function f(p){var m=n??(t.ticks?t.ticks.apply(t,r):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,r):DBe),y=Math.max(a,0)+s,v=t.range(),b=+v[0]+l,x=+v[v.length-1]+l,E=(t.bandwidth?zQt:FQt)(t.copy(),l),w=p.selection?p.selection():p,T=w.selectAll(".domain").data([null]),C=w.selectAll(".tick").data(m,t).order(),S=C.exit(),R=C.enter().append("g").attr("class","tick"),U=C.select("line"),L=C.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(R),U=U.merge(R.append("line").attr("stroke","currentColor").attr(d+"2",u*a)),L=L.merge(R.append("text").attr("fill","currentColor").attr(d,u*y).attr("dy",e===Az?"0em":e===Ise?"0.71em":"0.32em")),p!==w&&(T=T.transition(p),C=C.transition(p),U=U.transition(p),L=L.transition(p),S=S.transition(p).attr("opacity",_Be).attr("transform",function(I){return isFinite(I=E(I))?h(I+l):this.getAttribute("transform")}),R.attr("opacity",_Be).attr("transform",function(I){var A=this.parentNode.__axis;return h((A&&isFinite(A=A(I))?A:E(I))+l)})),S.remove(),T.attr("d",e===Sz||e===Use?o?"M"+u*o+","+b+"H"+l+"V"+x+"H"+u*o:"M"+l+","+b+"V"+x:o?"M"+b+","+u*o+"V"+l+"H"+x+"V"+u*o:"M"+b+","+l+"H"+x),C.attr("opacity",1).attr("transform",function(I){return h(E(I)+l)}),U.attr(d+"2",u*a),L.attr(d,u*y).text(g),w.filter(GQt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Use?"start":e===Sz?"end":"middle"),w.each(function(){this.__axis=E})}return f.scale=function(p){return arguments.length?(t=p,f):t},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=o=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(o=+p,f):o},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Rse(e){return PBe(Az,e)}function Mse(e){return PBe(Ise,e)}var Az,Use,Ise,Sz,_Be,OBe=H(()=>{NBe();Az=1,Use=2,Ise=3,Sz=4,_Be=1e-6});var BBe=H(()=>{OBe()});function zBe(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function HQt(e,t){for(var r=0,n=e.length,i;r{WQt={value:()=>{}};Uz.prototype=zBe.prototype={constructor:Uz,on:function(e,t){var r=this._,n=VQt(e+"",r),i,a=-1,o=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n{GBe()});var Iz,Nse,_se=H(()=>{Iz="http://www.w3.org/1999/xhtml",Nse={svg:"http://www.w3.org/2000/svg",xhtml:Iz,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function sy(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Nse.hasOwnProperty(t)?{space:Nse[t],local:e}:e}var Rz=H(()=>{_se()});function qQt(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Iz&&t.documentElement.namespaceURI===Iz?t.createElement(e):t.createElementNS(r,e)}}function YQt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Mz(e){var t=sy(e);return(t.local?YQt:qQt)(t)}var Pse=H(()=>{Rz();_se()});function jQt(){}function K5(e){return e==null?jQt:function(){return this.querySelector(e)}}var Lz=H(()=>{});function WBe(e){typeof e!="function"&&(e=K5(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{i0();Lz()});function Ose(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var HBe=H(()=>{});function XQt(){return[]}function H9(e){return e==null?XQt:function(){return this.querySelectorAll(e)}}var Bse=H(()=>{});function $Qt(e){return function(){return Ose(e.apply(this,arguments))}}function qBe(e){typeof e=="function"?e=$Qt(e):e=H9(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a{i0();HBe();Bse()});function q9(e){return function(){return this.matches(e)}}function Dz(e){return function(t){return t.matches(e)}}var Y9=H(()=>{});function ZQt(e){return function(){return KQt.call(this.children,e)}}function QQt(){return this.firstElementChild}function jBe(e){return this.select(e==null?QQt:ZQt(typeof e=="function"?e:Dz(e)))}var KQt,XBe=H(()=>{Y9();KQt=Array.prototype.find});function eJt(){return Array.from(this.children)}function tJt(e){return function(){return JQt.call(this.children,e)}}function $Be(e){return this.selectAll(e==null?eJt:tJt(typeof e=="function"?e:Dz(e)))}var JQt,KBe=H(()=>{Y9();JQt=Array.prototype.filter});function ZBe(e){typeof e!="function"&&(e=q9(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{i0();Y9()});function Nz(e){return new Array(e.length)}var Fse=H(()=>{});function JBe(){return new Go(this._enter||this._groups.map(Nz),this._parents)}function j9(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var zse=H(()=>{Fse();i0();j9.prototype={constructor:j9,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function eFe(e){return function(){return e}}var tFe=H(()=>{});function rJt(e,t,r,n,i,a){for(var o=0,s,l=t.length,u=a.length;o=x&&(x=b+1);!(w=y[x])&&++x{i0();zse();tFe()});function iFe(){return new Go(this._exit||this._groups.map(Nz),this._parents)}var aFe=H(()=>{Fse();i0()});function oFe(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var sFe=H(()=>{});function lFe(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,o=Math.min(i,a),s=new Array(i),l=0;l{i0()});function uFe(){for(var e=this._groups,t=-1,r=e.length;++t=0;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}var dFe=H(()=>{});function hFe(e){e||(e=oJt);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;at?1:e>=t?0:NaN}var fFe=H(()=>{i0()});function pFe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var mFe=H(()=>{});function gFe(){return Array.from(this)}var yFe=H(()=>{});function vFe(){for(var e=this._groups,t=0,r=e.length;t{});function xFe(){let e=0;for(let t of this)++e;return e}var wFe=H(()=>{});function EFe(){return!this.node()}var TFe=H(()=>{});function kFe(e){for(var t=this._groups,r=0,n=t.length;r{});function sJt(e){return function(){this.removeAttribute(e)}}function lJt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cJt(e,t){return function(){this.setAttribute(e,t)}}function uJt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dJt(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function hJt(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function SFe(e,t){var r=sy(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?lJt:sJt:typeof t=="function"?r.local?hJt:dJt:r.local?uJt:cJt)(r,t))}var AFe=H(()=>{Rz()});function _z(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var Gse=H(()=>{});function fJt(e){return function(){this.style.removeProperty(e)}}function pJt(e,t,r){return function(){this.style.setProperty(e,t,r)}}function mJt(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function UFe(e,t,r){return arguments.length>1?this.each((t==null?fJt:typeof t=="function"?mJt:pJt)(e,t,r??"")):u2(this.node(),e)}function u2(e,t){return e.style.getPropertyValue(t)||_z(e).getComputedStyle(e,null).getPropertyValue(t)}var Wse=H(()=>{Gse()});function gJt(e){return function(){delete this[e]}}function yJt(e,t){return function(){this[e]=t}}function vJt(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function IFe(e,t){return arguments.length>1?this.each((t==null?gJt:typeof t=="function"?vJt:yJt)(e,t)):this.node()[e]}var RFe=H(()=>{});function MFe(e){return e.trim().split(/^|\s+/)}function Vse(e){return e.classList||new LFe(e)}function LFe(e){this._node=e,this._names=MFe(e.getAttribute("class")||"")}function DFe(e,t){for(var r=Vse(e),n=-1,i=t.length;++n{LFe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function EJt(){this.textContent=""}function TJt(e){return function(){this.textContent=e}}function kJt(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OFe(e){return arguments.length?this.each(e==null?EJt:(typeof e=="function"?kJt:TJt)(e)):this.node().textContent}var BFe=H(()=>{});function CJt(){this.innerHTML=""}function SJt(e){return function(){this.innerHTML=e}}function AJt(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FFe(e){return arguments.length?this.each(e==null?CJt:(typeof e=="function"?AJt:SJt)(e)):this.node().innerHTML}var zFe=H(()=>{});function UJt(){this.nextSibling&&this.parentNode.appendChild(this)}function GFe(){return this.each(UJt)}var WFe=H(()=>{});function IJt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function VFe(){return this.each(IJt)}var HFe=H(()=>{});function qFe(e){var t=typeof e=="function"?e:Mz(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var YFe=H(()=>{Pse()});function RJt(){return null}function jFe(e,t){var r=typeof e=="function"?e:Mz(e),n=t==null?RJt:typeof t=="function"?t:K5(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var XFe=H(()=>{Pse();Lz()});function MJt(){var e=this.parentNode;e&&e.removeChild(this)}function $Fe(){return this.each(MJt)}var KFe=H(()=>{});function LJt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DJt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZFe(e){return this.select(e?DJt:LJt)}var QFe=H(()=>{});function JFe(e){return arguments.length?this.property("__data__",e):this.node().__data__}var eze=H(()=>{});function NJt(e){return function(t){e.call(this,t,this.__data__)}}function _Jt(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function PJt(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r{});function nze(e,t,r){var n=_z(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function BJt(e,t){return function(){return nze(this,e,t)}}function FJt(e,t){return function(){return nze(this,e,t.apply(this,arguments))}}function ize(e,t){return this.each((typeof t=="function"?FJt:BJt)(e,t))}var aze=H(()=>{Gse()});function*oze(){for(var e=this._groups,t=0,r=e.length;t{});function Go(e,t){this._groups=e,this._parents=t}function lze(){return new Go([[document.documentElement]],Hse)}function zJt(){return this}var Hse,ly,i0=H(()=>{VBe();YBe();XBe();KBe();QBe();nFe();zse();aFe();sFe();cFe();dFe();fFe();mFe();yFe();bFe();wFe();TFe();CFe();AFe();Wse();RFe();PFe();BFe();zFe();WFe();HFe();YFe();XFe();KFe();QFe();eze();rze();aze();sze();Hse=[null];Go.prototype=lze.prototype={constructor:Go,select:WBe,selectAll:qBe,selectChild:jBe,selectChildren:$Be,filter:ZBe,data:rFe,enter:JBe,exit:iFe,join:oFe,merge:lFe,selection:zJt,order:uFe,sort:hFe,call:pFe,nodes:gFe,node:vFe,size:xFe,empty:EFe,each:kFe,attr:SFe,style:UFe,property:IFe,classed:_Fe,text:OFe,html:FFe,raise:GFe,lower:VFe,append:qFe,insert:jFe,remove:$Fe,clone:ZFe,datum:JFe,on:tze,dispatch:ize,[Symbol.iterator]:oze};ly=lze});function xt(e){return typeof e=="string"?new Go([[document.querySelector(e)]],[document.documentElement]):new Go([[e]],Hse)}var cze=H(()=>{i0()});var a0=H(()=>{Y9();Rz();cze();i0();Lz();Bse();Wse()});var uze=H(()=>{});function Z5(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ek(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var qse=H(()=>{});function d2(){}function hze(){return this.rgb().formatHex()}function XJt(){return this.rgb().formatHex8()}function $Jt(){return bze(this).formatHsl()}function fze(){return this.rgb().formatRgb()}function s0(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=GJt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?pze(t):r===3?new nc(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Pz(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Pz(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=WJt.exec(e))?new nc(t[1],t[2],t[3],1):(t=VJt.exec(e))?new nc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HJt.exec(e))?Pz(t[1],t[2],t[3],t[4]):(t=qJt.exec(e))?Pz(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=YJt.exec(e))?yze(t[1],t[2]/100,t[3]/100,1):(t=jJt.exec(e))?yze(t[1],t[2]/100,t[3]/100,t[4]):dze.hasOwnProperty(e)?pze(dze[e]):e==="transparent"?new nc(NaN,NaN,NaN,0):null}function pze(e){return new nc(e>>16&255,e>>8&255,e&255,1)}function Pz(e,t,r,n){return n<=0&&(e=t=r=NaN),new nc(e,t,r,n)}function jse(e){return e instanceof d2||(e=s0(e)),e?(e=e.rgb(),new nc(e.r,e.g,e.b,e.opacity)):new nc}function kk(e,t,r,n){return arguments.length===1?jse(e):new nc(e,t,r,n??1)}function nc(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function mze(){return`#${Q5(this.r)}${Q5(this.g)}${Q5(this.b)}`}function KJt(){return`#${Q5(this.r)}${Q5(this.g)}${Q5(this.b)}${Q5((isNaN(this.opacity)?1:this.opacity)*255)}`}function gze(){let e=Fz(this.opacity);return`${e===1?"rgb(":"rgba("}${J5(this.r)}, ${J5(this.g)}, ${J5(this.b)}${e===1?")":`, ${e})`}`}function Fz(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function J5(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Q5(e){return e=J5(e),(e<16?"0":"")+e.toString(16)}function yze(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new o0(e,t,r,n)}function bze(e){if(e instanceof o0)return new o0(e.h,e.s,e.l,e.opacity);if(e instanceof d2||(e=s0(e)),!e)return new o0;if(e instanceof o0)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new o0(o,s,l,e.opacity)}function xze(e,t,r,n){return arguments.length===1?bze(e):new o0(e,t,r,n??1)}function o0(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function vze(e){return e=(e||0)%360,e<0?e+360:e}function Oz(e){return Math.max(0,Math.min(1,e||0))}function Yse(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var X9,Bz,Tk,$9,Ym,GJt,WJt,VJt,HJt,qJt,YJt,jJt,dze,Xse=H(()=>{qse();X9=.7,Bz=1/X9,Tk="\\s*([+-]?\\d+)\\s*",$9="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GJt=/^#([0-9a-f]{3,8})$/,WJt=new RegExp(`^rgb\\(${Tk},${Tk},${Tk}\\)$`),VJt=new RegExp(`^rgb\\(${Ym},${Ym},${Ym}\\)$`),HJt=new RegExp(`^rgba\\(${Tk},${Tk},${Tk},${$9}\\)$`),qJt=new RegExp(`^rgba\\(${Ym},${Ym},${Ym},${$9}\\)$`),YJt=new RegExp(`^hsl\\(${$9},${Ym},${Ym}\\)$`),jJt=new RegExp(`^hsla\\(${$9},${Ym},${Ym},${$9}\\)$`),dze={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Z5(d2,s0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hze,formatHex:hze,formatHex8:XJt,formatHsl:$Jt,formatRgb:fze,toString:fze});Z5(nc,kk,Ek(d2,{brighter(e){return e=e==null?Bz:Math.pow(Bz,e),new nc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?X9:Math.pow(X9,e),new nc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nc(J5(this.r),J5(this.g),J5(this.b),Fz(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:mze,formatHex:mze,formatHex8:KJt,formatRgb:gze,toString:gze}));Z5(o0,xze,Ek(d2,{brighter(e){return e=e==null?Bz:Math.pow(Bz,e),new o0(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?X9:Math.pow(X9,e),new o0(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new nc(Yse(e>=240?e-240:e+120,i,n),Yse(e,i,n),Yse(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new o0(vze(this.h),Oz(this.s),Oz(this.l),Fz(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(){let e=Fz(this.opacity);return`${e===1?"hsl(":"hsla("}${vze(this.h)}, ${Oz(this.s)*100}%, ${Oz(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var wze,Eze,Tze=H(()=>{wze=Math.PI/180,Eze=180/Math.PI});function Ize(e){if(e instanceof jm)return new jm(e.l,e.a,e.b,e.opacity);if(e instanceof cy)return Rze(e);e instanceof nc||(e=jse(e));var t=Qse(e.r),r=Qse(e.g),n=Qse(e.b),i=$se((.2225045*t+.7168786*r+.0606169*n)/Cze),a,o;return t===r&&r===n?a=o=i:(a=$se((.4360747*t+.3850649*r+.1430804*n)/kze),o=$se((.0139322*t+.0971045*r+.7141733*n)/Sze)),new jm(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Jse(e,t,r,n){return arguments.length===1?Ize(e):new jm(e,t,r,n??1)}function jm(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function $se(e){return e>ZJt?Math.pow(e,1/3):e/Uze+Aze}function Kse(e){return e>Ck?e*e*e:Uze*(e-Aze)}function Zse(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Qse(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function QJt(e){if(e instanceof cy)return new cy(e.h,e.c,e.l,e.opacity);if(e instanceof jm||(e=Ize(e)),e.a===0&&e.b===0)return new cy(NaN,0{qse();Xse();Tze();zz=18,kze=.96422,Cze=1,Sze=.82521,Aze=4/29,Ck=6/29,Uze=3*Ck*Ck,ZJt=Ck*Ck*Ck;Z5(jm,Jse,Ek(d2,{brighter(e){return new jm(this.l+zz*(e??1),this.a,this.b,this.opacity)},darker(e){return new jm(this.l-zz*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=kze*Kse(t),e=Cze*Kse(e),r=Sze*Kse(r),new nc(Zse(3.1338561*t-1.6168667*e-.4906146*r),Zse(-.9787684*t+1.9161415*e+.033454*r),Zse(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Z5(cy,K9,Ek(d2,{brighter(e){return new cy(this.h,this.c,this.l+zz*(e??1),this.opacity)},darker(e){return new cy(this.h,this.c,this.l-zz*(e??1),this.opacity)},rgb(){return Rze(this).rgb()}}))});var Sk=H(()=>{Xse();Mze()});function ele(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function Lze(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n{});function Dze(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return ele((r-n/t)*t,i,a,o,s)}}var Nze=H(()=>{tle()});var Ak,rle=H(()=>{Ak=e=>()=>e});function _ze(e,t){return function(r){return e+r*t}}function JJt(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Pze(e,t){var r=t-e;return r?_ze(e,r>180||r<-180?r-360*Math.round(r/360):r):Ak(isNaN(e)?t:e)}function Oze(e){return(e=+e)==1?uy:function(t,r){return r-t?JJt(t,r,e):Ak(isNaN(t)?r:t)}}function uy(e,t){var r=t-e;return r?_ze(e,r):Ak(isNaN(e)?t:e)}var nle=H(()=>{rle()});function Bze(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),a=new Array(r),o,s;for(o=0;o{Sk();tle();Nze();nle();e4=(function e(t){var r=Oze(t);function n(i,a){var o=r((i=kk(i)).r,(a=kk(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=uy(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=s(d),i.b=l(d),i.opacity=u(d),i+""}}return n.gamma=e,n})(1);eer=Bze(Lze),ter=Bze(Dze)});function Fze(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i{});function Wze(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o{Gz()});function Hze(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var qze=H(()=>{});function ic(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Z9=H(()=>{});function Yze(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=t4(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var jze=H(()=>{Gz()});function rer(e){return function(){return e}}function ner(e){return function(t){return e(t)+""}}function Q9(e,t){var r=ole.lastIndex=ale.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(e=e+"",t=t+"";(n=ole.exec(e))&&(i=ale.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:ic(n,i)})),r=ale.lastIndex;return r{Z9();ole=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ale=new RegExp(ole.source,"g")});function t4(e,t){var r=typeof t,n;return t==null||r==="boolean"?Ak(t):(r==="number"?ic:r==="string"?(n=s0(t))?(t=n,e4):Q9:t instanceof s0?e4:t instanceof Date?Hze:zze(t)?Fze:Array.isArray(t)?Wze:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Yze:ic)(e,t)}var Gz=H(()=>{Sk();ile();Vze();qze();Z9();jze();sle();rle();Gze()});function lle(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var Xze=H(()=>{});function cle(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n{$ze=180/Math.PI,Wz={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function Zze(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wz:cle(t.a,t.b,t.c,t.d,t.e,t.f)}function Qze(e){return e==null?Wz:(Vz||(Vz=document.createElementNS("http://www.w3.org/2000/svg","g")),Vz.setAttribute("transform",e),(e=Vz.transform.baseVal.consolidate())?(e=e.matrix,cle(e.a,e.b,e.c,e.d,e.e,e.f)):Wz)}var Vz,Jze=H(()=>{Kze()});function eGe(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,d,h,f,p,m){if(u!==h||d!==f){var g=p.push("translate(",null,t,null,r);m.push({i:g-4,x:ic(u,h)},{i:g-2,x:ic(d,f)})}else(h||f)&&p.push("translate("+h+t+f+r)}function o(u,d,h,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,n)-2,x:ic(u,d)})):d&&h.push(i(h)+"rotate("+d+n)}function s(u,d,h,f){u!==d?f.push({i:h.push(i(h)+"skewX(",null,n)-2,x:ic(u,d)}):d&&h.push(i(h)+"skewX("+d+n)}function l(u,d,h,f,p,m){if(u!==h||d!==f){var g=p.push(i(p)+"scale(",null,",",null,")");m.push({i:g-4,x:ic(u,h)},{i:g-2,x:ic(d,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,d){var h=[],f=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,h,f),o(u.rotate,d.rotate,h,f),s(u.skewX,d.skewX,h,f),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,h,f),u=d=null,function(p){for(var m=-1,g=f.length,y;++m{Z9();Jze();ule=eGe(Zze,"px, ","px)","deg)"),dle=eGe(Qze,", ",")",")")});function rGe(e){return function(t,r){var n=e((t=K9(t)).h,(r=K9(r)).h),i=uy(t.c,r.c),a=uy(t.l,r.l),o=uy(t.opacity,r.opacity);return function(s){return t.h=n(s),t.c=i(s),t.l=a(s),t.opacity=o(s),t+""}}}var hle,ier,nGe=H(()=>{Sk();nle();hle=rGe(Pze),ier=rGe(uy)});var Uk=H(()=>{Gz();Z9();Xze();sle();tGe();ile();nGe()});function iI(){return r4||(oGe(aer),r4=rI.now()+Yz)}function aer(){r4=0}function nI(){this._call=this._time=this._next=null}function jz(e,t,r){var n=new nI;return n.restart(e,t,r),n}function sGe(){iI(),++Ik;for(var e=Hz,t;e;)(t=r4-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ik}function iGe(){r4=(qz=rI.now())+Yz,Ik=eI=0;try{sGe()}finally{Ik=0,ser(),r4=0}}function oer(){var e=rI.now(),t=e-qz;t>aGe&&(Yz-=t,qz=e)}function ser(){for(var e,t=Hz,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Hz=r);tI=e,fle(n)}function fle(e){if(!Ik){eI&&(eI=clearTimeout(eI));var t=e-r4;t>24?(e<1/0&&(eI=setTimeout(iGe,e-rI.now()-Yz)),J9&&(J9=clearInterval(J9))):(J9||(qz=rI.now(),J9=setInterval(oer,aGe)),Ik=1,oGe(iGe))}}var Ik,eI,J9,aGe,Hz,tI,qz,r4,Yz,rI,oGe,ple=H(()=>{Ik=0,eI=0,J9=0,aGe=1e3,qz=0,r4=0,Yz=0,rI=typeof performance=="object"&&performance.now?performance:Date,oGe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};nI.prototype=jz.prototype={constructor:nI,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?iI():+r)+(t==null?0:+t),!this._next&&tI!==this&&(tI?tI._next=this:Hz=this,tI=this),this._call=e,this._time=r,fle()},stop:function(){this._call&&(this._call=null,this._time=1/0,fle())}}});function Xz(e,t,r){var n=new nI;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var lGe=H(()=>{ple()});var $z=H(()=>{ple();lGe()});function h2(e,t,r,n,i,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;uer(e,r,{name:t,index:n,group:i,on:ler,tween:cer,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:dGe})}function oI(e,t){var r=rl(e,t);if(r.state>dGe)throw new Error("too late; already scheduled");return r}function ac(e,t){var r=rl(e,t);if(r.state>Kz)throw new Error("too late; already running");return r}function rl(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function uer(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=jz(a,0,r.time);function a(u){r.state=cGe,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var d,h,f,p;if(r.state!==cGe)return l();for(d in n)if(p=n[d],p.name===r.name){if(p.state===Kz)return Xz(o);p.state===uGe?(p.state=aI,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[d]):+d{Dse();$z();ler=Lse("start","end","cancel","interrupt"),cer=[],dGe=0,cGe=1,Zz=2,Kz=3,uGe=4,Qz=5,aI=6});function Jz(e,t){var r=e.__transition,n,i,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((n=r[o]).name!==t){a=!1;continue}i=n.state>Zz&&n.state{Td()});function fGe(e){return this.each(function(){Jz(this,e)})}var pGe=H(()=>{hGe()});function der(e,t){var r,n;return function(){var i=ac(this,e),a=i.tween;if(a!==r){n=r=a;for(var o=0,s=n.length;o{Td()});function eG(e,t){var r;return(typeof t=="number"?ic:t instanceof s0?e4:(r=s0(t))?(t=r,e4):Q9)(e,t)}var mle=H(()=>{Sk();Uk()});function fer(e){return function(){this.removeAttribute(e)}}function per(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mer(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===n?a:a=t(n=o,r)}}function ger(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===n?a:a=t(n=o,r)}}function yer(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function ver(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function gGe(e,t){var r=sy(e),n=r==="transform"?dle:eG;return this.attrTween(e,typeof t=="function"?(r.local?ver:yer)(r,n,Rk(this,"attr."+e,t)):t==null?(r.local?per:fer)(r):(r.local?ger:mer)(r,n,t))}var yGe=H(()=>{Uk();a0();sI();mle()});function ber(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function xer(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function wer(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&xer(e,a)),r}return i._value=t,i}function Eer(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&ber(e,a)),r}return i._value=t,i}function vGe(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=sy(e);return this.tween(r,(n.local?wer:Eer)(n,t))}var bGe=H(()=>{a0()});function Ter(e,t){return function(){oI(this,e).delay=+t.apply(this,arguments)}}function ker(e,t){return t=+t,function(){oI(this,e).delay=t}}function xGe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ter:ker)(t,e)):rl(this.node(),t).delay}var wGe=H(()=>{Td()});function Cer(e,t){return function(){ac(this,e).duration=+t.apply(this,arguments)}}function Ser(e,t){return t=+t,function(){ac(this,e).duration=t}}function EGe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cer:Ser)(t,e)):rl(this.node(),t).duration}var TGe=H(()=>{Td()});function Aer(e,t){if(typeof t!="function")throw new Error;return function(){ac(this,e).ease=t}}function kGe(e){var t=this._id;return arguments.length?this.each(Aer(t,e)):rl(this.node(),t).ease}var CGe=H(()=>{Td()});function Uer(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;ac(this,e).ease=r}}function SGe(e){if(typeof e!="function")throw new Error;return this.each(Uer(this._id,e))}var AGe=H(()=>{Td()});function UGe(e){typeof e!="function"&&(e=q9(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{a0();n4()});function RGe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s{n4()});function Ier(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Rer(e,t,r){var n,i,a=Ier(t)?oI:ac;return function(){var o=a(this,e),s=o.on;s!==n&&(i=(n=s).copy()).on(t,r),o.on=i}}function LGe(e,t){var r=this._id;return arguments.length<2?rl(this.node(),r).on.on(e):this.each(Rer(r,e,t))}var DGe=H(()=>{Td()});function Mer(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function NGe(){return this.on("end.remove",Mer(this._id))}var _Ge=H(()=>{});function PGe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=K5(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o{a0();n4();Td()});function BGe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=H9(e));for(var n=this._groups,i=n.length,a=[],o=[],s=0;s{a0();n4();Td()});function zGe(){return new Ler(this._groups,this._parents)}var Ler,GGe=H(()=>{a0();Ler=ly.prototype.constructor});function Der(e,t){var r,n,i;return function(){var a=u2(this,e),o=(this.style.removeProperty(e),u2(this,e));return a===o?null:a===r&&o===n?i:i=t(r=a,n=o)}}function WGe(e){return function(){this.style.removeProperty(e)}}function Ner(e,t,r){var n,i=r+"",a;return function(){var o=u2(this,e);return o===i?null:o===n?a:a=t(n=o,r)}}function _er(e,t,r){var n,i,a;return function(){var o=u2(this,e),s=r(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),u2(this,e))),o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s))}}function Per(e,t){var r,n,i,a="style."+t,o="end."+a,s;return function(){var l=ac(this,e),u=l.on,d=l.value[a]==null?s||(s=WGe(t)):void 0;(u!==r||i!==d)&&(n=(r=u).copy()).on(o,i=d),l.on=n}}function VGe(e,t,r){var n=(e+="")=="transform"?ule:eG;return t==null?this.styleTween(e,Der(e,n)).on("end.style."+e,WGe(e)):typeof t=="function"?this.styleTween(e,_er(e,n,Rk(this,"style."+e,t))).each(Per(this._id,e)):this.styleTween(e,Ner(e,n,t),r).on("end.style."+e,null)}var HGe=H(()=>{Uk();a0();Td();sI();mle()});function Oer(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Ber(e,t,r){var n,i;function a(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&Oer(e,o,r)),n}return a._value=t,a}function qGe(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Ber(e,t,r??""))}var YGe=H(()=>{});function Fer(e){return function(){this.textContent=e}}function zer(e){return function(){var t=e(this);this.textContent=t??""}}function jGe(e){return this.tween("text",typeof e=="function"?zer(Rk(this,"text",e)):Fer(e==null?"":e+""))}var XGe=H(()=>{sI()});function Ger(e){return function(t){this.textContent=e.call(this,t)}}function Wer(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Ger(i)),t}return n._value=e,n}function $Ge(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Wer(e))}var KGe=H(()=>{});function ZGe(){for(var e=this._name,t=this._id,r=tG(),n=this._groups,i=n.length,a=0;a{n4();Td()});function JGe(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};r.each(function(){var u=ac(this,n),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&a()})}var eWe=H(()=>{Td()});function Cu(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function tWe(e){return ly().transition(e)}function tG(){return++Ver}var Ver,dy,n4=H(()=>{a0();yGe();bGe();wGe();TGe();CGe();AGe();IGe();MGe();DGe();_Ge();OGe();FGe();GGe();HGe();YGe();XGe();KGe();QGe();sI();eWe();Ver=0;dy=ly.prototype;Cu.prototype=tWe.prototype={constructor:Cu,select:PGe,selectAll:BGe,selectChild:dy.selectChild,selectChildren:dy.selectChildren,filter:UGe,merge:RGe,selection:zGe,transition:ZGe,call:dy.call,nodes:dy.nodes,node:dy.node,size:dy.size,empty:dy.empty,each:dy.each,on:LGe,attr:gGe,attrTween:vGe,style:VGe,styleTween:qGe,text:jGe,textTween:$Ge,remove:NGe,tween:mGe,delay:xGe,duration:EGe,ease:kGe,easeVarying:SGe,end:JGe,[Symbol.iterator]:dy[Symbol.iterator]}});function rG(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rWe=H(()=>{});var gle=H(()=>{rWe()});function qer(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function nWe(e){var t,r;e instanceof Cu?(t=e._id,e=e._name):(t=tG(),(r=Her).time=iI(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a{n4();Td();gle();$z();Her={time:null,delay:0,duration:250,ease:rG}});var aWe=H(()=>{a0();pGe();iWe();ly.prototype.interrupt=fGe;ly.prototype.transition=nWe});var nG=H(()=>{aWe()});var oWe=H(()=>{});var sWe=H(()=>{});var lWe=H(()=>{});function cWe(e){return[+e[0],+e[1]]}function Yer(e){return[cWe(e[0]),cWe(e[1])]}function yle(e){return{type:e}}var ihn,ahn,ohn,shn,lhn,chn,uWe=H(()=>{nG();oWe();sWe();lWe();({abs:ihn,max:ahn,min:ohn}=Math);shn={name:"x",handles:["w","e"].map(yle),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},lhn={name:"y",handles:["n","s"].map(yle),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},chn={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(yle),input:function(e){return e==null?null:Yer(e)},output:function(e){return e}}});var dWe=H(()=>{uWe()});function hWe(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hWe;let r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i{vle=Math.PI,ble=2*vle,i4=1e-6,jer=ble-i4;a4=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hWe:Xer(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,l=n-t,u=i-r,d=o-t,h=s-r,f=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>i4)if(!(Math.abs(h*l-u*d)>i4)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,m=i-s,g=l*l+u*u,y=p*p+m*m,v=Math.sqrt(g),b=Math.sqrt(f),x=a*Math.tan((vle-Math.acos((g+f-y)/(2*v*b)))/2),E=x/b,w=x/v;Math.abs(E-1)>i4&&this._append`L${t+E*d},${r+E*h}`,this._append`A${a},${a},0,0,${+(h*p>d*m)},${this._x1=t+w*l},${this._y1=r+w*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,d=r+l,h=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>i4||Math.abs(this._y1-d)>i4)&&this._append`L${u},${d}`,n&&(f<0&&(f=f%ble+ble),f>jer?this._append`A${n},${n},0,1,${h},${t-s},${r-l}A${n},${n},0,1,${h},${this._x1=u},${this._y1=d}`:f>i4&&this._append`A${n},${n},0,${+(f>=vle)},${h},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};fWe.prototype=a4.prototype});var xle=H(()=>{pWe()});var mWe=H(()=>{});var gWe=H(()=>{});var yWe=H(()=>{});var vWe=H(()=>{});var bWe=H(()=>{});var xWe=H(()=>{});var wWe=H(()=>{});function EWe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function o4(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}var lI=H(()=>{});function Xm(e){return e=o4(Math.abs(e)),e?e[1]:NaN}var cI=H(()=>{lI()});function TWe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}var kWe=H(()=>{});function CWe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var SWe=H(()=>{});function f2(e){if(!(t=$er.exec(e)))throw new Error("invalid format: "+e);var t;return new iG({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 iG(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}var $er,wle=H(()=>{$er=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;f2.prototype=iG.prototype;iG.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function AWe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var UWe=H(()=>{});function IWe(e,t){var r=o4(e,t);if(!r)return uI=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(uI=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+o4(e,Math.max(0,t+a-1))[0]}var uI,Ele=H(()=>{lI()});function Tle(e,t){var r=o4(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var RWe=H(()=>{lI()});var kle,MWe=H(()=>{lI();Ele();RWe();kle={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:EWe,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)=>Tle(e*100,t),r:Tle,s:IWe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function Cle(e){return e}var LWe=H(()=>{});function _We(e){var t=e.grouping===void 0||e.thousands===void 0?Cle:TWe(DWe.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Cle:CWe(DWe.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h,f){h=f2(h);var p=h.fill,m=h.align,g=h.sign,y=h.symbol,v=h.zero,b=h.width,x=h.comma,E=h.precision,w=h.trim,T=h.type;T==="n"?(x=!0,T="g"):kle[T]||(E===void 0&&(E=12),w=!0,T="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),S=(y==="$"?n:/[%p]/.test(T)?o:"")+(f&&f.suffix!==void 0?f.suffix:""),R=kle[T],U=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function L(I){var A=C,P=S,D,M,O;if(T==="c")P=R(I)+P,I="";else{I=+I;var _=I<0||1/I<0;if(I=isNaN(I)?l:R(Math.abs(I),E),w&&(I=AWe(I)),_&&+I==0&&g!=="+"&&(_=!1),A=(_?g==="("?g:s:g==="-"||g==="("?"":g)+A,P=(T==="s"&&!isNaN(I)&&uI!==void 0?NWe[8+uI/3]:"")+P+(_&&g==="("?")":""),U){for(D=-1,M=I.length;++DO||O>57){P=(O===46?i+I.slice(D+1):I.slice(D))+P,I=I.slice(0,D);break}}}x&&!v&&(I=t(I,1/0));var B=A.length+I.length+P.length,F=B>1)+A+I+P+F.slice(B);break;default:I=F+A+I+P;break}return a(I)}return L.toString=function(){return h+""},L}function d(h,f){var p=Math.max(-8,Math.min(8,Math.floor(Xm(f)/3)))*3,m=Math.pow(10,-p),g=u((h=f2(h),h.type="f",h),{suffix:NWe[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var DWe,NWe,PWe=H(()=>{cI();kWe();SWe();wle();UWe();MWe();Ele();LWe();DWe=Array.prototype.map,NWe=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function Sle(e){return aG=_We(e),$m=aG.format,oG=aG.formatPrefix,aG}var aG,$m,oG,OWe=H(()=>{PWe();Sle({thousands:",",grouping:[3],currency:["$",""]})});function Ale(e){return Math.max(0,-Xm(Math.abs(e)))}var BWe=H(()=>{cI()});function Ule(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xm(t)/3)))*3-Xm(Math.abs(e)))}var FWe=H(()=>{cI()});function Ile(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xm(t)-Xm(e))+1}var zWe=H(()=>{cI()});var Rle=H(()=>{OWe();wle();BWe();FWe();zWe()});var GWe=H(()=>{});function Ker(e){var t=0,r=e.children,n=r&&r.length;if(!n)t=1;else for(;--n>=0;)t+=r[n].value;e.value=t}function WWe(){return this.eachAfter(Ker)}var VWe=H(()=>{});function HWe(e,t){let r=-1;for(let n of this)e.call(t,n,++r,this);return this}var qWe=H(()=>{});function YWe(e,t){for(var r=this,n=[r],i,a,o=-1;r=n.pop();)if(e.call(t,r,++o,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}var jWe=H(()=>{});function XWe(e,t){for(var r=this,n=[r],i=[],a,o,s,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(o=0,s=a.length;o{});function KWe(e,t){let r=-1;for(let n of this)if(e.call(t,n,++r,this))return n}var ZWe=H(()=>{});function QWe(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r})}var JWe=H(()=>{});function eVe(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}var tVe=H(()=>{});function rVe(e){for(var t=this,r=Zer(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n}function Zer(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}var nVe=H(()=>{});function iVe(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}var aVe=H(()=>{});function oVe(){return Array.from(this)}var sVe=H(()=>{});function lVe(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}var cVe=H(()=>{});function uVe(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}var dVe=H(()=>{});function*hVe(){var e=this,t,r=[e],n,i,a;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,n=e.children)for(i=0,a=n.length;i{});function Mk(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=etr)):t===void 0&&(t=Jer);for(var r=new dI(e),n,i=[r],a,o,s,l;n=i.pop();)if((o=t(n.data))&&(l=(o=Array.from(o)).length))for(n.children=o,s=l-1;s>=0;--s)i.push(a=o[s]=new dI(o[s])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(rtr)}function Qer(){return Mk(this).eachBefore(ttr)}function Jer(e){return e.children}function etr(e){return Array.isArray(e)?e[1]:null}function ttr(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function rtr(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function dI(e){this.data=e,this.depth=this.height=0,this.parent=null}var pVe=H(()=>{VWe();qWe();jWe();$We();ZWe();JWe();tVe();nVe();aVe();sVe();cVe();dVe();fVe();dI.prototype=Mk.prototype={constructor:dI,count:WWe,each:HWe,eachAfter:XWe,eachBefore:YWe,find:KWe,sum:QWe,sort:eVe,path:rVe,ancestors:iVe,descendants:oVe,leaves:lVe,links:uVe,copy:Qer,[Symbol.iterator]:hVe}});function mVe(e){if(typeof e!="function")throw new Error;return e}var gVe=H(()=>{});function Lk(){return 0}function Dk(e){return function(){return e}}var yVe=H(()=>{});function vVe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}var bVe=H(()=>{});function xVe(e,t,r,n,i){for(var a=e.children,o,s=-1,l=a.length,u=e.value&&(n-t)/e.value;++s{});function EVe(e,t,r,n,i){for(var a=e.children,o,s=-1,l=a.length,u=e.value&&(i-r)/e.value;++s{});function itr(e,t,r,n,i,a){for(var o=[],s=t.children,l,u,d=0,h=0,f=s.length,p,m,g=t.value,y,v,b,x,E,w,T;db&&(b=u),T=y*y*w,x=Math.max(b/T,T/v),x>E){y-=u;break}E=x}o.push(l={value:y,dice:p{wVe();TVe();ntr=(1+Math.sqrt(5))/2;kVe=(function e(t){function r(n,i,a,o,s){itr(t,n,i,a,o,s)}return r.ratio=function(n){return e((n=+n)>1?n:1)},r})(ntr)});function Mle(){var e=kVe,t=!1,r=1,n=1,i=[0],a=Lk,o=Lk,s=Lk,l=Lk,u=Lk;function d(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(h),i=[0],t&&f.eachBefore(vVe),f}function h(f){var p=i[f.depth],m=f.x0+p,g=f.y0+p,y=f.x1-p,v=f.y1-p;y{bVe();CVe();gVe();yVe()});var AVe=H(()=>{pVe();SVe()});var UVe=H(()=>{});var IVe=H(()=>{});function p2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var hI=H(()=>{});function kh(){var e=new xk,t=[],r=[],n=Lle;function i(a){let o=e.get(a);if(o===void 0){if(n!==Lle)return n;e.set(a,o=t.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new xk;for(let o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return kh(t,r).unknown(n)},p2.apply(i,arguments),i}var Lle,Dle=H(()=>{c2();hI();Lle=Symbol("implicit")});function Nk(){var e=kh().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,o,s=!1,l=0,u=0,d=.5;delete e.unknown;function h(){var f=t().length,p=i{c2();hI();Dle()});function Nle(e){return function(){return e}}var MVe=H(()=>{});function _le(e){return+e}var LVe=H(()=>{});function _k(e){return e}function Ple(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Nle(isNaN(t)?NaN:.5)}function atr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function otr(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?str:otr,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(l||(l=s(e.map(n),t,r)))(n(o(f)))}return h.invert=function(f){return o(i((u||(u=s(t,e.map(n),ic)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,_le),d()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),r=lle,d()},h.clamp=function(f){return arguments.length?(o=f?!0:_k,d()):o!==_k},h.interpolate=function(f){return arguments.length?(r=f,d()):r},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,p){return n=f,i=p,d()}}function fI(){return ltr()(_k,_k)}var DVe,Ole=H(()=>{c2();Uk();MVe();LVe();DVe=[0,1]});function Ble(e,t,r,n){var i=wk(e,t,r),a;switch(n=f2(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Ule(i,o))&&(n.precision=a),oG(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Ile(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Ale(i))&&(n.precision=a-(n.type==="%")*2);break}}return $m(n)}var NVe=H(()=>{c2();Rle()});function ctr(e){var t=e.domain;return e.ticks=function(r){var n=t();return Ez(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ble(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,d=10;for(s0;){if(u=V9(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function l0(){var e=fI();return e.copy=function(){return sG(e,l0())},p2.apply(e,arguments),ctr(e)}var _Ve=H(()=>{c2();Ole();hI();NVe()});function Fle(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return a{});function ba(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{let o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{let l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uba(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(zle.setTime(+a),Gle.setTime(+o),e(zle),e(Gle),Math.floor(r(zle,Gle))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}var zle,Gle,hy=H(()=>{zle=new Date,Gle=new Date});var Km,OVe,Wle=H(()=>{hy();Km=ba(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Km.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ba(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Km);OVe=Km.range});var Ch,BVe,Vle=H(()=>{hy();Ch=ba(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),BVe=Ch.range});var fy,utr,lG,dtr,Hle=H(()=>{hy();fy=ba(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),utr=fy.range,lG=ba(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),dtr=lG.range});var py,htr,cG,ftr,qle=H(()=>{hy();py=ba(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),htr=py.range,cG=ba(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),ftr=cG.range});var Uf,ptr,mI,mtr,uG,gtr,Yle=H(()=>{hy();Uf=ba(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),ptr=Uf.range,mI=ba(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),mtr=mI.range,uG=ba(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),gtr=uG.range});function c4(e){return ba(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}function u4(e){return ba(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var c0,m2,dG,hG,Qm,fG,pG,zVe,ytr,vtr,btr,xtr,wtr,Etr,d4,Pk,GVe,WVe,g2,VVe,HVe,qVe,Ttr,ktr,Ctr,Str,Atr,Utr,jle=H(()=>{hy();c0=c4(0),m2=c4(1),dG=c4(2),hG=c4(3),Qm=c4(4),fG=c4(5),pG=c4(6),zVe=c0.range,ytr=m2.range,vtr=dG.range,btr=hG.range,xtr=Qm.range,wtr=fG.range,Etr=pG.range;d4=u4(0),Pk=u4(1),GVe=u4(2),WVe=u4(3),g2=u4(4),VVe=u4(5),HVe=u4(6),qVe=d4.range,Ttr=Pk.range,ktr=GVe.range,Ctr=WVe.range,Str=g2.range,Atr=VVe.range,Utr=HVe.range});var my,Itr,mG,Rtr,Xle=H(()=>{hy();my=ba(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),Itr=my.range,mG=ba(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),Rtr=mG.range});var Sh,Mtr,u0,Ltr,$le=H(()=>{hy();Sh=ba(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());Sh.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ba(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Mtr=Sh.range,u0=ba(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());u0.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ba(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ltr=u0.range});function jVe(e,t,r,n,i,a){let o=[[Ch,1,1e3],[Ch,5,5*1e3],[Ch,15,15*1e3],[Ch,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function s(u,d,h){let f=dy).right(o,f);if(p===o.length)return e.every(wk(u/31536e6,d/31536e6,h));if(p===0)return Km.every(Math.max(wk(u,d,h),1));let[m,g]=o[f/o[p-1][2]{c2();Wle();Vle();Hle();qle();Yle();jle();Xle();$le();[Ntr,_tr]=jVe(u0,mG,d4,uG,cG,lG),[Kle,Zle]=jVe(Sh,my,c0,Uf,py,fy)});var gG=H(()=>{Wle();Vle();Hle();qle();Yle();jle();Xle();$le();XVe()});function Qle(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Jle(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gI(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function ece(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,l=e.shortMonths,u=yI(i),d=vI(i),h=yI(a),f=vI(a),p=yI(o),m=vI(o),g=yI(s),y=vI(s),v=yI(l),b=vI(l),x={a:O,A:_,b:B,B:F,c:null,d:eHe,e:eHe,f:irr,g:prr,G:grr,H:trr,I:rrr,j:nrr,L:aHe,m:arr,M:orr,p:G,q:z,Q:nHe,s:iHe,S:srr,u:lrr,U:crr,V:urr,w:drr,W:hrr,x:null,X:null,y:frr,Y:mrr,Z:yrr,"%":rHe},E={a:V,A:$,b:Z,B:re,c:null,d:tHe,e:tHe,f:wrr,g:Mrr,G:Drr,H:vrr,I:brr,j:xrr,L:sHe,m:Err,M:Trr,p:Q,q:ge,Q:nHe,s:iHe,S:krr,u:Crr,U:Srr,V:Arr,w:Urr,W:Irr,x:null,X:null,y:Rrr,Y:Lrr,Z:Nrr,"%":rHe},w={a:U,A:L,b:I,B:A,c:P,d:QVe,e:QVe,f:Ztr,g:ZVe,G:KVe,H:JVe,I:JVe,j:jtr,L:Ktr,m:Ytr,M:Xtr,p:R,q:qtr,Q:Jtr,s:err,S:$tr,u:ztr,U:Gtr,V:Wtr,w:Ftr,W:Vtr,x:D,X:M,y:ZVe,Y:KVe,Z:Htr,"%":Qtr};x.x=T(r,x),x.X=T(n,x),x.c=T(t,x),E.x=T(r,E),E.X=T(n,E),E.c=T(t,E);function T(ie,pe){return function(ue){var fe=[],Me=-1,Ce=0,Ye=ie.length,Ze,Qe,ve;for(ue instanceof Date||(ue=new Date(+ue));++Me53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Ce=Jle(gI(fe.y,0,1)),Ye=Ce.getUTCDay(),Ce=Ye>4||Ye===0?Pk.ceil(Ce):Pk(Ce),Ce=mI.offset(Ce,(fe.V-1)*7),fe.y=Ce.getUTCFullYear(),fe.m=Ce.getUTCMonth(),fe.d=Ce.getUTCDate()+(fe.w+6)%7):(Ce=Qle(gI(fe.y,0,1)),Ye=Ce.getDay(),Ce=Ye>4||Ye===0?m2.ceil(Ce):m2(Ce),Ce=Uf.offset(Ce,(fe.V-1)*7),fe.y=Ce.getFullYear(),fe.m=Ce.getMonth(),fe.d=Ce.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),Ye="Z"in fe?Jle(gI(fe.y,0,1)).getUTCDay():Qle(gI(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(Ye+5)%7:fe.w+fe.U*7-(Ye+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,Jle(fe)):Qle(fe)}}function S(ie,pe,ue,fe){for(var Me=0,Ce=pe.length,Ye=ue.length,Ze,Qe;Me=Ye)return-1;if(Ze=pe.charCodeAt(Me++),Ze===37){if(Ze=pe.charAt(Me++),Qe=w[Ze in $Ve?pe.charAt(Me++):Ze],!Qe||(fe=Qe(ie,ue,fe))<0)return-1}else if(Ze!=ue.charCodeAt(fe++))return-1}return fe}function R(ie,pe,ue){var fe=u.exec(pe.slice(ue));return fe?(ie.p=d.get(fe[0].toLowerCase()),ue+fe[0].length):-1}function U(ie,pe,ue){var fe=p.exec(pe.slice(ue));return fe?(ie.w=m.get(fe[0].toLowerCase()),ue+fe[0].length):-1}function L(ie,pe,ue){var fe=h.exec(pe.slice(ue));return fe?(ie.w=f.get(fe[0].toLowerCase()),ue+fe[0].length):-1}function I(ie,pe,ue){var fe=v.exec(pe.slice(ue));return fe?(ie.m=b.get(fe[0].toLowerCase()),ue+fe[0].length):-1}function A(ie,pe,ue){var fe=g.exec(pe.slice(ue));return fe?(ie.m=y.get(fe[0].toLowerCase()),ue+fe[0].length):-1}function P(ie,pe,ue){return S(ie,t,pe,ue)}function D(ie,pe,ue){return S(ie,r,pe,ue)}function M(ie,pe,ue){return S(ie,n,pe,ue)}function O(ie){return o[ie.getDay()]}function _(ie){return a[ie.getDay()]}function B(ie){return l[ie.getMonth()]}function F(ie){return s[ie.getMonth()]}function G(ie){return i[+(ie.getHours()>=12)]}function z(ie){return 1+~~(ie.getMonth()/3)}function V(ie){return o[ie.getUTCDay()]}function $(ie){return a[ie.getUTCDay()]}function Z(ie){return l[ie.getUTCMonth()]}function re(ie){return s[ie.getUTCMonth()]}function Q(ie){return i[+(ie.getUTCHours()>=12)]}function ge(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var pe=T(ie+="",x);return pe.toString=function(){return ie},pe},parse:function(ie){var pe=C(ie+="",!1);return pe.toString=function(){return ie},pe},utcFormat:function(ie){var pe=T(ie+="",E);return pe.toString=function(){return ie},pe},utcParse:function(ie){var pe=C(ie+="",!0);return pe.toString=function(){return ie},pe}}}function Ri(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function Ftr(e,t,r){var n=Il.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function ztr(e,t,r){var n=Il.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Gtr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Wtr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Vtr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function KVe(e,t,r){var n=Il.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function ZVe(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Htr(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function qtr(e,t,r){var n=Il.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Ytr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function QVe(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function jtr(e,t,r){var n=Il.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function JVe(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Xtr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function $tr(e,t,r){var n=Il.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Ktr(e,t,r){var n=Il.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Ztr(e,t,r){var n=Il.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Qtr(e,t,r){var n=Ptr.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Jtr(e,t,r){var n=Il.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function err(e,t,r){var n=Il.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function eHe(e,t){return Ri(e.getDate(),t,2)}function trr(e,t){return Ri(e.getHours(),t,2)}function rrr(e,t){return Ri(e.getHours()%12||12,t,2)}function nrr(e,t){return Ri(1+Uf.count(Sh(e),e),t,3)}function aHe(e,t){return Ri(e.getMilliseconds(),t,3)}function irr(e,t){return aHe(e,t)+"000"}function arr(e,t){return Ri(e.getMonth()+1,t,2)}function orr(e,t){return Ri(e.getMinutes(),t,2)}function srr(e,t){return Ri(e.getSeconds(),t,2)}function lrr(e){var t=e.getDay();return t===0?7:t}function crr(e,t){return Ri(c0.count(Sh(e)-1,e),t,2)}function oHe(e){var t=e.getDay();return t>=4||t===0?Qm(e):Qm.ceil(e)}function urr(e,t){return e=oHe(e),Ri(Qm.count(Sh(e),e)+(Sh(e).getDay()===4),t,2)}function drr(e){return e.getDay()}function hrr(e,t){return Ri(m2.count(Sh(e)-1,e),t,2)}function frr(e,t){return Ri(e.getFullYear()%100,t,2)}function prr(e,t){return e=oHe(e),Ri(e.getFullYear()%100,t,2)}function mrr(e,t){return Ri(e.getFullYear()%1e4,t,4)}function grr(e,t){var r=e.getDay();return e=r>=4||r===0?Qm(e):Qm.ceil(e),Ri(e.getFullYear()%1e4,t,4)}function yrr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ri(t/60|0,"0",2)+Ri(t%60,"0",2)}function tHe(e,t){return Ri(e.getUTCDate(),t,2)}function vrr(e,t){return Ri(e.getUTCHours(),t,2)}function brr(e,t){return Ri(e.getUTCHours()%12||12,t,2)}function xrr(e,t){return Ri(1+mI.count(u0(e),e),t,3)}function sHe(e,t){return Ri(e.getUTCMilliseconds(),t,3)}function wrr(e,t){return sHe(e,t)+"000"}function Err(e,t){return Ri(e.getUTCMonth()+1,t,2)}function Trr(e,t){return Ri(e.getUTCMinutes(),t,2)}function krr(e,t){return Ri(e.getUTCSeconds(),t,2)}function Crr(e){var t=e.getUTCDay();return t===0?7:t}function Srr(e,t){return Ri(d4.count(u0(e)-1,e),t,2)}function lHe(e){var t=e.getUTCDay();return t>=4||t===0?g2(e):g2.ceil(e)}function Arr(e,t){return e=lHe(e),Ri(g2.count(u0(e),e)+(u0(e).getUTCDay()===4),t,2)}function Urr(e){return e.getUTCDay()}function Irr(e,t){return Ri(Pk.count(u0(e)-1,e),t,2)}function Rrr(e,t){return Ri(e.getUTCFullYear()%100,t,2)}function Mrr(e,t){return e=lHe(e),Ri(e.getUTCFullYear()%100,t,2)}function Lrr(e,t){return Ri(e.getUTCFullYear()%1e4,t,4)}function Drr(e,t){var r=e.getUTCDay();return e=r>=4||r===0?g2(e):g2.ceil(e),Ri(e.getUTCFullYear()%1e4,t,4)}function Nrr(){return"+0000"}function rHe(){return"%"}function nHe(e){return+e}function iHe(e){return Math.floor(+e/1e3)}var $Ve,Il,Ptr,Otr,cHe=H(()=>{gG();$Ve={"-":"",_:" ",0:"0"},Il=/^\s*\d+/,Ptr=/^%/,Otr=/[\\^$*+?|[\]().{}]/g});function tce(e){return Ok=ece(e),h4=Ok.format,uHe=Ok.parse,dHe=Ok.utcFormat,hHe=Ok.utcParse,Ok}var Ok,h4,uHe,dHe,hHe,fHe=H(()=>{cHe();tce({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 rce=H(()=>{fHe()});function _rr(e){return new Date(e)}function Prr(e){return e instanceof Date?+e:+new Date(+e)}function pHe(e,t,r,n,i,a,o,s,l,u){var d=fI(),h=d.invert,f=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),b=u("%b %d"),x=u("%B"),E=u("%Y");function w(T){return(l(T){gG();rce();Ole();hI();PVe()});var gHe=H(()=>{RVe();_Ve();Dle();mHe()});function yHe(e){for(var t=e.length/6|0,r=new Array(t),n=0;n{});var nce,bHe=H(()=>{vHe();nce=yHe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")});var xHe=H(()=>{bHe()});function ho(e){return function(){return e}}var vG=H(()=>{});function EHe(e){return e>1?0:e<-1?Bk:Math.acos(e)}function ace(e){return e>=1?bI:e<=-1?-bI:Math.asin(e)}var ice,oc,y2,wHe,bG,d0,f4,Rl,Bk,bI,Fk,xG=H(()=>{ice=Math.abs,oc=Math.atan2,y2=Math.cos,wHe=Math.max,bG=Math.min,d0=Math.sin,f4=Math.sqrt,Rl=1e-12,Bk=Math.PI,bI=Bk/2,Fk=2*Bk});function wG(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new a4(t)}var oce=H(()=>{xle()});function Orr(e){return e.innerRadius}function Brr(e){return e.outerRadius}function Frr(e){return e.startAngle}function zrr(e){return e.endAngle}function Grr(e){return e&&e.padAngle}function Wrr(e,t,r,n,i,a,o,s){var l=r-e,u=n-t,d=o-i,h=s-a,f=h*l-d*u;if(!(f*fP*P+D*D&&(S=U,R=L),{cx:S,cy:R,x01:-d,y01:-h,x11:S*(i/w-1),y11:R*(i/w-1)}}function Jm(){var e=Orr,t=Brr,r=ho(0),n=null,i=Frr,a=zrr,o=Grr,s=null,l=wG(u);function u(){var d,h,f=+e.apply(this,arguments),p=+t.apply(this,arguments),m=i.apply(this,arguments)-bI,g=a.apply(this,arguments)-bI,y=ice(g-m),v=g>m;if(s||(s=d=l()),pRl))s.moveTo(0,0);else if(y>Fk-Rl)s.moveTo(p*y2(m),p*d0(m)),s.arc(0,0,p,m,g,!v),f>Rl&&(s.moveTo(f*y2(g),f*d0(g)),s.arc(0,0,f,g,m,v));else{var b=m,x=g,E=m,w=g,T=y,C=y,S=o.apply(this,arguments)/2,R=S>Rl&&(n?+n.apply(this,arguments):f4(f*f+p*p)),U=bG(ice(p-f)/2,+r.apply(this,arguments)),L=U,I=U,A,P;if(R>Rl){var D=ace(R/f*d0(S)),M=ace(R/p*d0(S));(T-=D*2)>Rl?(D*=v?1:-1,E+=D,w-=D):(T=0,E=w=(m+g)/2),(C-=M*2)>Rl?(M*=v?1:-1,b+=M,x-=M):(C=0,b=x=(m+g)/2)}var O=p*y2(b),_=p*d0(b),B=f*y2(w),F=f*d0(w);if(U>Rl){var G=p*y2(x),z=p*d0(x),V=f*y2(E),$=f*d0(E),Z;if(yRl?I>Rl?(A=EG(V,$,O,_,p,I,v),P=EG(G,z,B,F,p,I,v),s.moveTo(A.cx+A.x01,A.cy+A.y01),IRl)||!(T>Rl)?s.lineTo(B,F):L>Rl?(A=EG(B,F,G,z,f,-L,v),P=EG(O,_,V,$,f,-L,v),s.lineTo(A.cx+A.x01,A.cy+A.y01),L{vG();xG();oce()});function TG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var V0n,sce=H(()=>{V0n=Array.prototype.slice});function kHe(e){this._context=e}function gy(e){return new kHe(e)}var lce=H(()=>{kHe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&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);break}}}});function CHe(e){return e[0]}function SHe(e){return e[1]}var AHe=H(()=>{});function v2(e,t){var r=ho(!0),n=null,i=gy,a=null,o=wG(s);e=typeof e=="function"?e:e===void 0?CHe:ho(e),t=typeof t=="function"?t:t===void 0?SHe:ho(t);function s(l){var u,d=(l=TG(l)).length,h,f=!1,p;for(n==null&&(a=i(p=o())),u=0;u<=d;++u)!(u{sce();vG();lce();oce();AHe()});function IHe(e,t){return te?1:t>=e?0:NaN}var RHe=H(()=>{});function MHe(e){return e}var LHe=H(()=>{});function cce(){var e=MHe,t=IHe,r=null,n=ho(0),i=ho(Fk),a=ho(0);function o(s){var l,u=(s=TG(s)).length,d,h,f=0,p=new Array(u),m=new Array(u),g=+n.apply(this,arguments),y=Math.min(Fk,Math.max(-Fk,i.apply(this,arguments)-g)),v,b=Math.min(Math.abs(y)/u,a.apply(this,arguments)),x=b*(y<0?-1:1),E;for(l=0;l0&&(f+=E);for(t!=null?p.sort(function(w,T){return t(m[w],m[T])}):r!=null&&p.sort(function(w,T){return r(s[w],s[T])}),l=0,h=f?(y-u*x)/f:0;l0?E*h:0)+x,m[d]={data:s[d],index:l,value:E,startAngle:g,endAngle:v,padAngle:b};return m}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:ho(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,r=null,o):t},o.sort=function(s){return arguments.length?(r=s,t=null,o):r},o.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:ho(+s),o):n},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ho(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:ho(+s),o):a},o}var DHe=H(()=>{sce();vG();RHe();LHe();xG()});function xI(e){return new kG(e,!0)}function wI(e){return new kG(e,!1)}var kG,NHe=H(()=>{kG=class{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}});function If(){}var EI=H(()=>{});function zk(e,t,r){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+r)/6)}function TI(e){this._context=e}function b2(e){return new TI(e)}var kI=H(()=>{TI.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:zk(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:zk(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function _He(e){this._context=e}function uce(e){return new _He(e)}var PHe=H(()=>{EI();kI();_He.prototype={areaStart:If,areaEnd:If,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);break}}},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:zk(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function OHe(e){this._context=e}function dce(e){return new OHe(e)}var BHe=H(()=>{kI();OHe.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||this._line!==0&&this._point===3)&&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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:zk(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function FHe(e,t){this._basis=new TI(e),this._beta=t}var hce,zHe=H(()=>{kI();FHe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,s=-1,l;++s<=r;)l=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(n+l*a),this._beta*t[s]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};hce=(function e(t){function r(n){return t===1?new TI(n):new FHe(n,t)}return r.beta=function(n){return e(+n)},r})(.85)});function Gk(e,t,r){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-r),e._x2,e._y2)}function CG(e,t){this._context=e,this._k=(1-t)/6}var CI,SI=H(()=>{CG.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:Gk(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:Gk(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};CI=(function e(t){function r(n){return new CG(n,t)}return r.tension=function(n){return e(+n)},r})(0)});function SG(e,t){this._context=e,this._k=(1-t)/6}var fce,pce=H(()=>{EI();SI();SG.prototype={areaStart:If,areaEnd:If,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);break}}},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:Gk(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};fce=(function e(t){function r(n){return new SG(n,t)}return r.tension=function(n){return e(+n)},r})(0)});function AG(e,t){this._context=e,this._k=(1-t)/6}var mce,gce=H(()=>{SI();AG.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||this._line!==0&&this._point===3)&&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:Gk(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};mce=(function e(t){function r(n){return new AG(n,t)}return r.tension=function(n){return e(+n)},r})(0)});function AI(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>Rl){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);n=(n*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>Rl){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*u+e._x1*e._l23_2a-t*e._l12_2a)/d,o=(o*u+e._y1*e._l23_2a-r*e._l12_2a)/d}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function GHe(e,t){this._context=e,this._alpha=t}var UI,UG=H(()=>{xG();SI();GHe.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:AI(this,e,t);break}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}};UI=(function e(t){function r(n){return t?new GHe(n,t):new CG(n,0)}return r.alpha=function(n){return e(+n)},r})(.5)});function WHe(e,t){this._context=e,this._alpha=t}var yce,VHe=H(()=>{pce();EI();UG();WHe.prototype={areaStart:If,areaEnd:If,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);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:AI(this,e,t);break}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}};yce=(function e(t){function r(n){return t?new WHe(n,t):new SG(n,0)}return r.alpha=function(n){return e(+n)},r})(.5)});function HHe(e,t){this._context=e,this._alpha=t}var vce,qHe=H(()=>{gce();UG();HHe.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:AI(this,e,t);break}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}};vce=(function e(t){function r(n){return t?new HHe(n,t):new AG(n,0)}return r.alpha=function(n){return e(+n)},r})(.5)});function YHe(e){this._context=e}function bce(e){return new YHe(e)}var jHe=H(()=>{EI();YHe.prototype={areaStart:If,areaEnd:If,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}});function XHe(e){return e<0?-1:1}function $He(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(XHe(a)+XHe(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function KHe(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function xce(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function IG(e){this._context=e}function ZHe(e){this._context=new QHe(e)}function QHe(e){this._context=e}function II(e){return new IG(e)}function RI(e){return new ZHe(e)}var JHe=H(()=>{IG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xce(this,this._t0,KHe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){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,xce(this,KHe(this,r=$He(this,e,t)),r);break;default:xce(this,this._t0,r=$He(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(ZHe.prototype=Object.create(IG.prototype)).point=function(e,t){IG.prototype.point.call(this,t,e)};QHe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}}});function tqe(e){this._context=e}function eqe(e){var t,r=e.length-1,n,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{tqe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=eqe(e),i=eqe(t),a=0,o=1;o{RG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}}});var iqe=H(()=>{THe();UHe();DHe();PHe();BHe();kI();NHe();zHe();pce();gce();SI();VHe();qHe();UG();jHe();lce();JHe();rqe();nqe()});var aqe=H(()=>{});var oqe=H(()=>{});function x2(e,t,r){this.k=e,this.x=t,this.y=r}function Ece(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wce;return e.__zoom}var wce,Tce=H(()=>{x2.prototype={constructor:x2,scale:function(e){return e===1?this:new x2(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new x2(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+")"}};wce=new x2(1,0,0);Ece.prototype=x2.prototype});var sqe=H(()=>{});var lqe=H(()=>{nG();aqe();oqe();Tce();sqe()});var cqe=H(()=>{lqe();Tce()});var _n=H(()=>{c2();BBe();dWe();mWe();Sk();gWe();yWe();Dse();uze();vWe();gle();bWe();wWe();Rle();GWe();AVe();Uk();xle();UVe();xWe();IVe();gHe();xHe();a0();iqe();gG();rce();$z();nG();cqe()});var Mi,cs=H(()=>{Wr();xr();_n();Mi=k(e=>{let{securityLevel:t}=je(),r=xt("body");if(t==="sandbox"){let a=xt(`#i${e}`).node()?.contentDocument??document;r=xt(a.body)}return r.select(`#${e}`)},"selectSvgElement")});var uqe,Vrr,p4,Hrr,_I,or,ur,qrr,Us=H(()=>{Wr();xr();uqe=k(e=>{let{handDrawnSeed:t}=je();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Vrr=k(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),p4=k(e=>{let t=Hrr([...e.cssCompiledStyles||[],...e.cssStyles||[],...Vrr(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Hrr=k(e=>{let t=new Map;return e.forEach(r=>{let[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),_I=k(e=>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","isLabelStyle"),or=k(e=>{let{stylesArray:t}=p4(e),r=[],n=[],i=[],a=[];return t.forEach(o=>{let s=o[0];_I(s)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),s.includes("stroke")&&i.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),ur=k((e,t)=>{let{themeVariables:r,handDrawnSeed:n}=je(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=p4(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:qrr(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),qrr=k(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let i=isNaN(t[0])?0:t[0];return[i,i]}let r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray")});var Yrr,Wk,kce,dqe,MG=H(()=>{Yrr=Object.freeze({left:0,top:0,width:16,height:16}),Wk=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),kce=Object.freeze({...Yrr,...Wk}),dqe=Object.freeze({...kce,body:"",hidden:!1})});var jrr,hqe,fqe=H(()=>{MG();jrr=Object.freeze({width:null,height:null}),hqe=Object.freeze({...jrr,...Wk})});var Cce,LG,pqe=H(()=>{Cce=(e,t,r,n="")=>{let i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let s=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:s};return t&&!LG(u)?null:u}let a=i[0],o=a.split("-");if(o.length>1){let s={provider:n,prefix:o.shift(),name:o.join("-")};return t&&!LG(s)?null:s}if(r&&n===""){let s={provider:n,prefix:"",name:a};return t&&!LG(s,r)?null:s}return null},LG=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1});function mqe(e,t){let r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);let n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}var gqe=H(()=>{});function Sce(e,t){let r=mqe(e,t);for(let n in dqe)n in Wk?n in e&&!(n in r)&&(r[n]=Wk[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}var yqe=H(()=>{MG();gqe()});function vqe(e,t){let r=e.icons,n=e.aliases||Object.create(null),i=Object.create(null);function a(o){if(r[o])return i[o]=[];if(!(o in i)){i[o]=null;let s=n[o]&&n[o].parent,l=s&&a(s);l&&(i[o]=[s].concat(l))}return i[o]}return(t||Object.keys(r).concat(Object.keys(n))).forEach(a),i}var bqe=H(()=>{});function xqe(e,t,r){let n=e.icons,i=e.aliases||Object.create(null),a={};function o(s){a=Sce(n[s]||i[s],a)}return o(t),r.forEach(o),Sce(e,a)}function Ace(e,t){if(e.icons[t])return xqe(e,t,[]);let r=vqe(e,[t])[t];return r?xqe(e,t,r):null}var wqe=H(()=>{yqe();bqe()});function Uce(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;let n=e.split(Xrr);if(n===null||!n.length)return e;let i=[],a=n.shift(),o=$rr.test(a);for(;;){if(o){let s=parseFloat(a);isNaN(s)?i.push(a):i.push(Math.ceil(s*t*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");o=!o}}var Xrr,$rr,Eqe=H(()=>{Xrr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,$rr=/^-?[0-9.]*[0-9]+[0-9.]*$/g});function Krr(e,t="defs"){let r="",n=e.indexOf("<"+t);for(;n>=0;){let i=e.indexOf(">",n),a=e.indexOf("",a);if(o===-1)break;r+=e.slice(i+1,a).trim(),e=e.slice(0,n).trim()+e.slice(o+1)}return{defs:r,content:e}}function Zrr(e,t){return e?""+e+""+t:t}function Tqe(e,t,r){let n=Krr(e);return Zrr(n.defs,t+n.content+r)}var kqe=H(()=>{});function Ice(e,t){let r={...kce,...e},n={...hqe,...t},i={left:r.left,top:r.top,width:r.width,height:r.height},a=r.body;[r,n].forEach(g=>{let y=[],v=g.hFlip,b=g.vFlip,x=g.rotate;v?b?x+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):b&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let E;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:E=i.height/2+i.top,y.unshift("rotate(90 "+E.toString()+" "+E.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:E=i.width/2+i.left,y.unshift("rotate(-90 "+E.toString()+" "+E.toString()+")")}x%2===1&&(i.left!==i.top&&(E=i.left,i.left=i.top,i.top=E),i.width!==i.height&&(E=i.width,i.width=i.height,i.height=E)),y.length&&(a=Tqe(a,'',""))});let o=n.width,s=n.height,l=i.width,u=i.height,d,h;o===null?(h=s===null?"1em":s==="auto"?u:s,d=Uce(h,l/u)):(d=o==="auto"?l:o,h=s===null?Uce(d,u/l):s==="auto"?u:s);let f={},p=(g,y)=>{Qrr(y)||(f[g]=y.toString())};p("width",d),p("height",h);let m=[i.left,i.top,l,u];return f.viewBox=m.join(" "),{attributes:f,viewBox:m,body:a}}var Qrr,Cqe=H(()=>{MG();fqe();Eqe();kqe();Qrr=e=>e==="unset"||e==="undefined"||e==="none"});function enr(e){e=e.replace(/[0-9]+$/,"")||"a";let t=Sqe.get(e)||0;return Sqe.set(e,t+1),t?`${e}${t}`:e}function Rce(e){let t=[],r;for(;r=Jrr.exec(e);)t.push(r[1]);if(!t.length)return e;let n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(i=>{let a=enr(i),o=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}var Jrr,Sqe,Aqe=H(()=>{Jrr=/\sid="(\S+)"/g,Sqe=new Map});function Mce(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let n in t)r+=" "+n+'="'+t[n]+'"';return'"+e+""}var Uqe=H(()=>{});var Iqe=H(()=>{pqe();wqe();Cqe();Aqe();Uqe()});var Dce,Lce,Rqe,Vk,Mqe,Lqe,Ah,us=H(()=>{Wr();Gr();xr();Iqe();Dce={body:'?',height:80,width:80},Lce=new Map,Rqe=new Map,Vk=k(e=>{for(let t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ye.debug("Registering icon pack:",t.name),"loader"in t)Rqe.set(t.name,t.loader);else if("icons"in t)Lce.set(t.name,t.icons);else throw ye.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Mqe=k(async(e,t)=>{let r=Cce(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);let n=r.prefix||t;if(!n)throw new Error(`Icon name must contain a prefix: ${e}`);let i=Lce.get(n);if(!i){let o=Rqe.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},Lce.set(n,i)}catch(s){throw ye.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}let a=Ace(i,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),Lqe=k(async e=>{try{return await Mqe(e),!0}catch{return!1}},"isIconAvailable"),Ah=k(async(e,t,r)=>{let n;try{n=await Mqe(e,t?.fallbackPrefix)}catch(o){ye.error(o),n=Dce}let i=Ice(n,t),a=Mce(Rce(i.body),{...i.attributes,...r});return rn(a,Kt())},"getIconSVG")});var Dqe=Bn(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.BLANK_URL=Ml.relativeFirstCharacters=Ml.whitespaceEscapeCharsRegex=Ml.urlSchemeRegex=Ml.ctrlCharactersRegex=Ml.htmlCtrlEntityRegex=Ml.htmlEntitiesRegex=Ml.invalidProtocolRegex=void 0;Ml.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;Ml.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;Ml.htmlCtrlEntityRegex=/&(newline|tab);/gi;Ml.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;Ml.urlSchemeRegex=/^.+(:|:)/gim;Ml.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;Ml.relativeFirstCharacters=[".","/"];Ml.BLANK_URL="about:blank"});var PI=Bn(Nce=>{"use strict";Object.defineProperty(Nce,"__esModule",{value:!0});Nce.sanitizeUrl=inr;var Fc=Dqe();function tnr(e){return Fc.relativeFirstCharacters.indexOf(e[0])>-1}function rnr(e){var t=e.replace(Fc.ctrlCharactersRegex,"");return t.replace(Fc.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function nnr(e){return URL.canParse(e)}function Nqe(e){try{return decodeURIComponent(e)}catch{return e}}function inr(e){if(!e)return Fc.BLANK_URL;var t,r=Nqe(e.trim());do r=rnr(r).replace(Fc.htmlCtrlEntityRegex,"").replace(Fc.ctrlCharactersRegex,"").replace(Fc.whitespaceEscapeCharsRegex,"").trim(),r=Nqe(r),t=r.match(Fc.ctrlCharactersRegex)||r.match(Fc.htmlEntitiesRegex)||r.match(Fc.htmlCtrlEntityRegex)||r.match(Fc.whitespaceEscapeCharsRegex);while(t&&t.length>0);var n=r;if(!n)return Fc.BLANK_URL;if(tnr(n))return n;var i=n.trimStart(),a=i.match(Fc.urlSchemeRegex);if(!a)return n;var o=a[0].toLowerCase().trim();if(Fc.invalidProtocolRegex.test(o))return Fc.BLANK_URL;var s=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){if(!nnr(s))return Fc.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}});function _qe(e){return Array.isArray(e)}var Pqe=H(()=>{});function DG(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){var t;let n=e[Symbol.toStringTag];return n==null||!(!((t=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))===null||t===void 0)&&t.writable)?!1:e.toString()===`[object ${n}]`}let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var Oqe=H(()=>{});function Bqe(e){return Number.isSafeInteger(e)&&e>=0}var Fqe=H(()=>{});function NG(e){return e!=null&&typeof e!="function"&&Bqe(e.length)}var _ce=H(()=>{Fqe()});function zqe(e){return e==="__proto__"}var Gqe=H(()=>{});function m4(e,t){return anr.call(e,t)}var anr,Pce=H(()=>{anr=Object.prototype.hasOwnProperty});function w2(e){return e==null||typeof e!="object"&&typeof e!="function"}var OI=H(()=>{});function g4(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var _G=H(()=>{});var PG,BI,FI,zI,GI,OG,BG,FG,zG,GG,WG,VG,HG,qG,YG,jG,XG,$G,KG,ZG,QG,JG,Oce=H(()=>{PG="[object RegExp]",BI="[object String]",FI="[object Number]",zI="[object Boolean]",GI="[object Arguments]",OG="[object Symbol]",BG="[object Date]",FG="[object Map]",zG="[object Set]",GG="[object Array]",WG="[object ArrayBuffer]",VG="[object Object]",HG="[object DataView]",qG="[object Uint8Array]",YG="[object Uint8ClampedArray]",jG="[object Uint16Array]",XG="[object Uint32Array]",$G="[object Int8Array]",KG="[object Int16Array]",ZG="[object Int32Array]",QG="[object Float32Array]",JG="[object Float64Array]"});var Bce,Wqe=H(()=>{Bce=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()});function Hk(e){return typeof Bce.Buffer<"u"&&Bce.Buffer.isBuffer(e)}var eW=H(()=>{Wqe()});function Vqe(e){return Hk(e)}var Hqe=H(()=>{eW()});function tW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Fce=H(()=>{});function eg(e){return tW(e)}var WI=H(()=>{Fce()});function rW(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var zce=H(()=>{});function qqe(e,t){return Yk(e,void 0,e,new Map,t)}function Yk(e,t,r,n,i){if(i!=null){let o=i(e,t,r,n);if(o!==void 0)return o}if(w2(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let o=new Array(e.length);n.set(e,o);for(let s=0;s{o.set(l,Yk(s,l,r,n,i))}),o}if(e instanceof Set){let o=new Set;return n.set(e,o),e.forEach(s=>{o.add(Yk(s,void 0,r,n,i))}),o}if(Vqe(e))return e.subarray();if(eg(e)){let o=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,o);for(let s=0;s{OI();zce();_G();Oce();Pce();Hqe();WI()});function Gce(e){return qqe(e)}var jqe=H(()=>{Yqe()});function VI(e){return e!==null&&typeof e=="object"&&g4(e)==="[object Arguments]"}var Wce=H(()=>{_G()});function HI(e){return typeof e=="object"&&e!==null}var Vce=H(()=>{});function Xqe(e){return HI(e)&&NG(e)}var $qe=H(()=>{_ce();Vce()});function Kqe(e){let t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}var Zqe=H(()=>{});function y4(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");let r=function(...n){let i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);let o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(y4.Cache||Map),r}var Qqe=H(()=>{y4.Cache=Map});function qce(e){if(w2(e))return e;let t=g4(e);if(!snr(e))return{};if(_qe(e)){let n=Array.from(e);return e.length>0&&typeof e[0]=="string"&&m4(e,"index")&&(n.index=e.index,n.input=e.input),n}if(eg(e)){let n=e,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){let n=e,i=n.buffer,a=n.byteOffset,o=n.byteLength,s=new ArrayBuffer(o),l=new Uint8Array(i,a,o);return new Uint8Array(s).set(l),new DataView(s)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let n=e.constructor,i=new n(e.valueOf());return t==="[object String]"?cnr(i,e):Hce(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){let n=e,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){let n=e,i=new Map;return n.forEach((a,o)=>{i.set(o,a)}),i}if(t==="[object Set]"){let n=e,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(t==="[object Arguments]"){let n=e,i={};return Hce(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}let r={};return unr(r,e),Hce(r,e),lnr(r,e),r}function snr(e){switch(g4(e)){case GI:case GG:case WG:case HG:case zI:case BG:case QG:case JG:case $G:case KG:case ZG:case FG:case FI:case VG:case PG:case zG:case BI:case OG:case qG:case YG:case jG:case XG:return!0;default:return!1}}function Hce(e,t){for(let r in t)m4(t,r)&&(e[r]=t[r])}function lnr(e,t){let r=Object.getOwnPropertySymbols(t);for(let n=0;n=r)&&(e[n]=t[n])}function unr(e,t){let r=Object.getPrototypeOf(t);r!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,r)}var Jqe=H(()=>{OI();_G();Oce();Pqe();Pce();WI()});function eYe(e){if(w2(e))return e;if(Array.isArray(e)||tW(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){let n=new r(e);return n.lastIndex=e.lastIndex,n}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let n;return typeof AggregateError<"u"&&e instanceof AggregateError?n=new r(e.errors,e.message,{cause:e.cause}):n=new r(e.message,{cause:e.cause}),n.stack=e.stack,Object.assign(n,e),n}if(typeof File<"u"&&e instanceof File)return new r([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e=="object"){let n=Object.create(t);return Object.assign(n,e)}return e}var tYe=H(()=>{OI();Fce()});function rYe(e,...t){let r=t.slice(0,-1),n=t[t.length-1],i=e;for(let a=0;a{OI();zce();eW();Gqe();Oqe();WI();jqe();Wce();Vce();$qe();tYe()});function iYe(){}var aYe=H(()=>{});function Yce(e,...t){return rYe(e,...t,iYe)}var oYe=H(()=>{aYe();nYe()});function iW(e){if(e==null)return!0;if(NG(e))return typeof e.splice!="function"&&typeof e!="string"&&!Hk(e)&&!eg(e)&&!VI(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Kqe(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var sYe=H(()=>{eW();_ce();WI();Wce();Zqe()});var aW=H(()=>{Qqe();Jqe();oYe();sYe()});function sW(e,t){if(!e)return t;let r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return dnr[r]??t}function fYe(e,t){let r=e.trim();if(r)return t.securityLevel!=="loose"?(0,uYe.sanitizeUrl)(r):r}function Xce(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pYe(e){let t,r=0;e.forEach(i=>{r+=Xce(i,t),t=i});let n=r/2;return $ce(e,n)}function mYe(e){return e.length===1?e[0]:pYe(e)}function gYe(e,t,r){let n=structuredClone(r);ye.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();let i=25+e,a=$ce(n,i),o=10+e*.5,s=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(s+Math.PI)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s+Math.PI)*o+(n[0].y+a.y)/2):t==="end_right"?(l.x=Math.sin(s-Math.PI)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s-Math.PI)*o+(n[0].y+a.y)/2-5):t==="end_left"?(l.x=Math.sin(s)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2-5):(l.x=Math.sin(s)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2),l}function lW(e){let t="",r="";for(let n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}function yYe(e){let t="",r="0123456789abcdef",n=r.length;for(let i=0;iMath.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}var uYe,jce,dnr,hnr,fnr,dYe,hYe,pnr,mnr,lYe,$ce,gnr,cYe,Kce,Zce,ynr,vnr,v4,bnr,YI,xnr,oW,wnr,Enr,kd,Nr,vYe,h0,tg,Vn=H(()=>{Wr();Gr();xr();uYe=Ue(PI(),1);_n();aW();jce="\u200B",dnr={curveBasis:b2,curveBasisClosed:uce,curveBasisOpen:dce,curveBumpX:xI,curveBumpY:wI,curveBundle:hce,curveCardinalClosed:fce,curveCardinalOpen:mce,curveCardinal:CI,curveCatmullRomClosed:yce,curveCatmullRomOpen:vce,curveCatmullRom:UI,curveLinear:gy,curveLinearClosed:bce,curveMonotoneX:II,curveMonotoneY:RI,curveNatural:MI,curveStep:LI,curveStepAfter:NI,curveStepBefore:DI},hnr=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,fnr=k(function(e,t){let r=dYe(e,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(r)){let o=r.map(s=>s.args);_9(o),n=co(n,[...o])}else n=r.args;if(!n)return;let i=B9(e,t),a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),dYe=k(function(e,t=null){try{let r=new RegExp(`[%]{2}(?![{]${hnr.source})(?=[}][%]{2}).* -`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),ye.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let n,i=[];for(;(n=yk.exec(e))!==null;)if(n.index===yk.lastIndex&&yk.lastIndex++,n&&!t||t&&n[1]?.match(t)||t&&n[2]?.match(t)){let a=n[1]?n[1]:n[2],o=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:a,args:o})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(r){return ye.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),hYe=k(function(e){return e.replace(yk,"")},"removeDirectives"),pnr=k(function(e,t){for(let[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");k(sW,"interpolateToCurve");k(fYe,"formatUrl");mnr=k((e,...t)=>{let r=e.split("."),n=r.length-1,i=r[n],a=window;for(let o=0;o{let r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),$ce=k((e,t)=>{let r,n=t;for(let i of e){if(r){let a=Xce(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:lYe((1-o)*r.x+o*i.x,5),y:lYe((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),gnr=k((e,t,r)=>{ye.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());let i=$ce(t,25),a=e?10:5,o=Math.atan2(t[0].y-i.y,t[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(t[0].x+i.x)/2,s.y=-Math.cos(o)*a+(t[0].y+i.y)/2,s},"calcCardinalityPosition");k(gYe,"calcTerminalLabelPosition");k(lW,"getStylesFromArray");cYe=0,Kce=k(()=>(cYe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+cYe),"generateId");k(yYe,"makeRandomHex");Zce=k(e=>yYe(e.length),"random"),ynr=k(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"),vnr=k(function(e,t){let r=t.text.replace(Lt.lineBreakRegex," "),[,n]=kd(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",n),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);let a=i.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),i},"drawSimpleText"),v4=y4((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Lt.lineBreakRegex.test(e)))return e;let n=e.split(" ").filter(Boolean),i=[],a="";return n.forEach((o,s)=>{let l=zc(`${o} `,r),u=zc(a,r);if(l>t){let{hyphenatedStrings:f,remainingWord:p}=bnr(o,t,"-",r);i.push(a,...f),a=p}else u+l>=t?(i.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===n.length&&i.push(a)}),i.filter(o=>o!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),bnr=y4((e,t,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...e],a=[],o="";return i.forEach((s,l)=>{let u=`${o}${s}`;if(zc(u,n)>=t){let h=l+1,f=i.length===h,p=`${u}${r}`;a.push(f?u:p),o=""}else o=u}),{hyphenatedStrings:a,remainingWord:o}},(e,t,r="-",n)=>`${e}${t}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);k(qI,"calculateTextHeight");k(zc,"calculateTextWidth");YI=y4((e,t)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};let[,a]=kd(r),o=["sans-serif",n],s=e.split(Lt.lineBreakRegex),l=[],u=xt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};let d=u.append("svg");for(let f of o){let p=0,m={width:0,height:0,lineHeight:0};for(let g of s){let y=ynr();y.text=g||jce;let v=vnr(d,y).style("font-size",a).style("font-weight",i).style("font-family",f),b=(v._groups||v)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");m.width=Math.round(Math.max(m.width,b.width)),p=Math.round(b.height),m.height+=p,m.lineHeight=Math.round(Math.max(m.lineHeight,p))}l.push(m)}d.remove();let h=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;return l[h]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),xnr=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{k(this,"InitIDGenerator")}},wnr=k(function(e){return oW=oW||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),oW.innerHTML=e,unescape(oW.textContent)},"entityDecode");k(cW,"isDetailedError");Enr=k((e,t,r,n)=>{if(!n)return;let i=e.node()?.getBBox();i&&e.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",t)},"insertTitle"),kd=k(e=>{if(typeof e=="number")return[e,e+"px"];let t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");k(Kn,"cleanAndMerge");Nr={assignWithDepth:co,wrapLabel:v4,calculateTextHeight:qI,calculateTextWidth:zc,calculateTextDimensions:YI,cleanAndMerge:Kn,detectInit:fnr,detectDirective:dYe,isSubstringInArray:pnr,interpolateToCurve:sW,calcLabelPosition:mYe,calcCardinalityPosition:gnr,calcTerminalLabelPosition:gYe,formatUrl:fYe,getStylesFromArray:lW,generateId:Kce,random:Zce,runFunc:mnr,entityDecode:wnr,insertTitle:Enr,isLabelCoordinateInPath:bYe,parseFontSize:kd,InitIDGenerator:xnr},vYe=k(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),t},"encodeEntities"),h0=k(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),tg=k((e,t,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${e}_${t}_${r}${i?`_${i}`:""}`,"getEdgeId");k(Uo,"handleUndefinedAttr");k(bYe,"isLabelCoordinateInPath")});var xYe=Bn((Qce,Jce)=>{(function(e){"use strict";var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(u){return setTimeout(u,16)};function n(){var u=this;u.reads=[],u.writes=[],u.raf=r.bind(e),t("initialized",u)}n.prototype={constructor:n,runTasks:function(u){t("run tasks");for(var d;d=u.shift();)d()},measure:function(u,d){t("measure");var h=d?u.bind(d):u;return this.reads.push(h),i(this),h},mutate:function(u,d){t("mutate");var h=d?u.bind(d):u;return this.writes.push(h),i(this),h},clear:function(u){return t("clear",u),o(this.reads,u)||o(this.writes,u)},extend:function(u){if(t("extend",u),typeof u!="object")throw new Error("expected object");var d=Object.create(this);return s(d,u),d.fastdom=this,d.initialize&&d.initialize(),d},catch:null};function i(u){u.scheduled||(u.scheduled=!0,u.raf(a.bind(null,u)),t("flush scheduled"))}function a(u){t("flush");var d=u.writes,h=u.reads,f;try{t("flushing reads",h.length),u.runTasks(h),t("flushing writes",d.length),u.runTasks(d)}catch(p){f=p}if(u.scheduled=!1,(h.length||d.length)&&i(u),f)if(t("task errored",f.message),u.catch)u.catch(f);else throw f}function o(u,d){var h=u.indexOf(d);return!!~h&&!!u.splice(h,1)}function s(u,d){for(var h in d)d.hasOwnProperty(h)&&(u[h]=d[h])}var l=e.fastdom=e.fastdom||new n;typeof define=="function"?define(function(){return l}):typeof Jce=="object"&&(Jce.exports=l)})(typeof window<"u"?window:typeof Qce<"u"?Qce:globalThis)});var wYe=Bn((mvn,eue)=>{(function(){var e={initialize:function(){this._tasks=new Map},mutate:function(r,n){return t(this,"mutate",r,n)},measure:function(r,n){return t(this,"measure",r,n)},clear:function(r){var n=this._tasks,i=n.get(r);this.fastdom.clear(i),n.delete(r)}};function t(r,n,i,a){var o=r._tasks,s=r.fastdom,l,u=new Promise(function(d,h){l=s[n](function(){o.delete(u);try{d(a?i.call(a):i())}catch(f){h(f)}},a)});return o.set(u,l),u}(typeof define)[0]=="f"?define(function(){return e}):(typeof eue)[0]=="o"?eue.exports=e:window.fastdomPromised=e})()});function iue(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function UYe(e){x4=e}function Li(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Su.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,t)};return n}function rg(e,t){if(t){if(Su.escapeTest.test(e))return e.replace(Su.escapeReplace,kYe)}else if(Su.escapeTestNoEncode.test(e))return e.replace(Su.escapeReplaceNoEncode,kYe);return e}function CYe(e){try{e=encodeURI(e).replace(Su.percentDecode,"%")}catch{return null}return e}function SYe(e,t){let r=e.replace(Su.findPipe,(a,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Su.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function AYe(e,t,r,n,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function iir(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let i=n[1];return t.split(` -`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=i.length?a.slice(i.length):a}).join(` -`)}function Hi(e,t){return b4.parse(e,t)}var x4,KI,Tnr,Su,knr,Cnr,Snr,ZI,Anr,aue,IYe,RYe,Unr,oue,Inr,sue,Rnr,Mnr,pW,lue,Lnr,MYe,Dnr,cue,EYe,Nnr,_nr,Pnr,Onr,LYe,Bnr,mW,uue,DYe,Fnr,NYe,znr,Gnr,Wnr,_Ye,Vnr,Hnr,PYe,qnr,Ynr,jnr,Xnr,$nr,Knr,Znr,dW,Qnr,OYe,BYe,Jnr,TYe,due,eir,tue,tir,uW,jI,rir,kYe,hW,f0,fW,hue,p0,$I,air,b4,gvn,yvn,vvn,bvn,xvn,wvn,Evn,FYe=H(()=>{x4=iue();KI={exec:()=>null};Tnr=(()=>{try{return!!new RegExp("(?<=1)(?/,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+));?/ig,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})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\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")},knr=/^(?:[ \t]*(?:\n|$))+/,Cnr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Snr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ZI=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Anr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,aue=/(?:[*+-]|\d{1,9}[.)])/,IYe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,RYe=Li(IYe).replace(/bull/g,aue).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(),Unr=Li(IYe).replace(/bull/g,aue).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(),oue=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Inr=/^[^\n]+/,sue=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rnr=Li(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sue).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mnr=Li(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,aue).getRegex(),pW="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",lue=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,Lnr=Li("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",lue).replace("tag",pW).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),MYe=Li(oue).replace("hr",ZI).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",pW).getRegex(),Dnr=Li(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",MYe).getRegex(),cue={blockquote:Dnr,code:Cnr,def:Rnr,fences:Snr,heading:Anr,hr:ZI,html:Lnr,lheading:RYe,list:Mnr,newline:knr,paragraph:MYe,table:KI,text:Inr},EYe=Li("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ZI).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pW).getRegex(),Nnr={...cue,lheading:Unr,table:EYe,paragraph:Li(oue).replace("hr",ZI).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EYe).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",pW).getRegex()},_nr={...cue,html:Li(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lue).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:KI,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Li(oue).replace("hr",ZI).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",RYe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pnr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Onr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,LYe=/^( {2,}|\\)\n(?!\s*$)/,Bnr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Tnr?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_Ye=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Vnr=Li(_Ye,"u").replace(/punct/g,mW).getRegex(),Hnr=Li(_Ye,"u").replace(/punct/g,NYe).getRegex(),PYe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qnr=Li(PYe,"gu").replace(/notPunctSpace/g,DYe).replace(/punctSpace/g,uue).replace(/punct/g,mW).getRegex(),Ynr=Li(PYe,"gu").replace(/notPunctSpace/g,Gnr).replace(/punctSpace/g,znr).replace(/punct/g,NYe).getRegex(),jnr=Li("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,DYe).replace(/punctSpace/g,uue).replace(/punct/g,mW).getRegex(),Xnr=Li(/\\(punct)/,"gu").replace(/punct/g,mW).getRegex(),$nr=Li(/^<(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(),Knr=Li(lue).replace("(?:-->|$)","-->").getRegex(),Znr=Li("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Knr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dW=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Qnr=Li(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",dW).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),OYe=Li(/^!?\[(label)\]\[(ref)\]/).replace("label",dW).replace("ref",sue).getRegex(),BYe=Li(/^!?\[(ref)\](?:\[\])?/).replace("ref",sue).getRegex(),Jnr=Li("reflink|nolink(?!\\()","g").replace("reflink",OYe).replace("nolink",BYe).getRegex(),TYe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,due={_backpedal:KI,anyPunctuation:Xnr,autolink:$nr,blockSkip:Wnr,br:LYe,code:Onr,del:KI,emStrongLDelim:Vnr,emStrongRDelimAst:qnr,emStrongRDelimUnd:jnr,escape:Pnr,link:Qnr,nolink:BYe,punctuation:Fnr,reflink:OYe,reflinkSearch:Jnr,tag:Znr,text:Bnr,url:KI},eir={...due,link:Li(/^!?\[(label)\]\((.*?)\)/).replace("label",dW).getRegex(),reflink:Li(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dW).getRegex()},tue={...due,emStrongRDelimAst:Ynr,emStrongLDelim:Hnr,url:Li(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",TYe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Li(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},kYe=e=>rir[e];hW=class{options;rules;lexer;constructor(e){this.options=e||x4}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:XI(r,` -`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=iir(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=XI(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:XI(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=XI(t[0],` -`).split(` -`),n="",i="",a=[];for(;r.length>0;){let o=!1,s=[],l;for(l=0;l1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;e;){let l=!1,u="",d="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let h=t[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),f=e.split(` -`,1)[0],p=!h.trim(),m=0;if(this.options.pedantic?(m=2,d=h.trimStart()):p?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=h.slice(m),m+=t[1].length),p&&this.rules.other.blankLine.test(f)&&(u+=f+` -`,e=e.substring(f.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),x=this.rules.other.fencesBeginRegex(m),E=this.rules.other.headingBeginRegex(m),w=this.rules.other.htmlBeginRegex(m);for(;e;){let T=e.split(` -`,1)[0],C;if(f=T,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),C=f):C=f.replace(this.rules.other.tabCharGlobal," "),x.test(f)||E.test(f)||w.test(f)||v.test(f)||b.test(f))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!f.trim())d+=` -`+C.slice(m);else{if(p||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(h)||E.test(h)||b.test(h))break;d+=` -`+f}!p&&!f.trim()&&(p=!0),u+=T+` -`,e=e.substring(T.length+1),h=C.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0));let g=null,y;this.options.gfm&&(g=this.rules.other.listIsTask.exec(d),g&&(y=g[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!g,checked:y,loose:!1,text:d,tokens:[]}),i.raw+=u}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;lh.type==="space"),d=u.length>0&&u.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=d}if(i.loose)for(let l=0;l({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[l]})));return a}}lheading(e){let 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){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=XI(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=nir(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),AYe(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[n.toLowerCase()];if(!i){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return AYe(r,i,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,s=i,l=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(n=u.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(o=[...a].length,n[3]||n[4]){s+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){l+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+l);let d=[...n[0]][0].length,h=e.slice(0,i+n.index+d+o);if(Math.min(i,o)%2){let p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}let f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},f0=class rue{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||x4,this.options.tokenizer=this.options.tokenizer||new hW,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Su,block:uW.normal,inline:jI.normal};this.options.pedantic?(r.block=uW.pedantic,r.inline=jI.pedantic):this.options.gfm&&(r.block=uW.gfm,this.options.breaks?r.inline=jI.breaks:r.inline=jI.gfm),this.tokenizer.rules=r}static get rules(){return{block:uW,inline:jI}}static lex(t,r){return new rue(r).lex(t)}static lexInline(t,r){return new rue(r).inlineTokens(t)}lex(t){t=t.replace(Su.carriageReturn,` -`),this.blockTokens(t,this.tokens);for(let r=0;r(i=o.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let o=r.at(-1);i.raw.length===1&&o!==void 0?o.raw+=` -`:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(` -`)?"":` -`)+i.raw,o.text+=` -`+i.text,this.inlineQueue.at(-1).src=o.text):r.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(` -`)?"":` -`)+i.raw,o.text+=` -`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),r.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,s=t.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},s),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let o=r.at(-1);n&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(` -`)?"":` -`)+i.raw,o.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(i),n=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let o=r.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(` -`)?"":` -`)+i.raw,o.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(i);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let o=!1,s="";for(;t;){o||(s=""),o=!1;let l;if(this.options.extensions?.inline?.some(d=>(l=d.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let d=r.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,n,s)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let u=t;if(this.options.extensions?.startInline){let d=1/0,h=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},h),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(u=t.substring(0,d+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),o=!0;let d=r.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):r.push(l);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return r}},fW=class{options;parser;constructor(e){this.options=e||x4}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(Su.notSpaceStart)?.[0],i=e.replace(Su.endingNewline,"")+` -`;return n?'
'+(r?i:rg(i,!0))+`
-`:"
"+(r?i:rg(i,!0))+`
-`}blockquote({tokens:e}){return`
-${this.parser.parse(e)}
-`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} -`}hr(e){return`
-`}list(e){let t=e.ordered,r=e.start,n="";for(let o=0;o -`+n+" -`}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+rg(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • -`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    -`}table(e){let t="",r="";for(let i=0;i${n}`),` - -`+t+` -`+n+`
    -`}tablerow({text:e}){return` -${e} -`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${rg(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),i=CYe(e);if(i===null)return n;e=i;let a='
    ",a}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=CYe(e);if(i===null)return rg(r);e=i;let a=`${r}{let o=i[a].flat(1/0);r=r.concat(this.walkTokens(o,t))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...o){let s=i.renderer.apply(this,o);return s===!1&&(s=a.apply(this,o)),s}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),n.extensions=t),r.renderer){let i=this.defaults.renderer||new fW(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,s=r.renderer[o],l=i[o];i[o]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=l.apply(i,u)),d||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new hW(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,s=r.tokenizer[o],l=i[o];i[o]=(...u)=>{let d=s.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new $I;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,s=r.hooks[o],l=i[o];$I.passThroughHooks.has(a)?i[o]=u=>{if(this.defaults.async&&$I.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await s.call(i,u);return l.call(i,h)})();let d=s.call(i,u);return l.call(i,d)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let h=await s.apply(i,u);return h===!1&&(h=await l.apply(i,u)),h})();let d=s.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(o){let s=[];return s.push(a.call(this,o)),i&&(s=s.concat(i.call(this,o))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return f0.lex(e,t??this.defaults)}parser(e,t){return p0.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)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(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,s=await(i.hooks?await i.hooks.provideLexer():e?f0.lex:f0.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(s):s;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():e?p0.parse:p0.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer():e?f0.lex:f0.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let s=(i.hooks?i.hooks.provideParser():e?p0.parse:p0.parseInline)(o,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(o){return a(o)}}}onError(e,t){return r=>{if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let n="

    An error occurred:

    "+rg(r.message+"",!0)+"
    ";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},b4=new air;Hi.options=Hi.setOptions=function(e){return b4.setOptions(e),Hi.defaults=b4.defaults,UYe(Hi.defaults),Hi};Hi.getDefaults=iue;Hi.defaults=x4;Hi.use=function(...e){return b4.use(...e),Hi.defaults=b4.defaults,UYe(Hi.defaults),Hi};Hi.walkTokens=function(e,t){return b4.walkTokens(e,t)};Hi.parseInline=b4.parseInline;Hi.Parser=p0;Hi.parser=p0.parse;Hi.Renderer=fW;Hi.TextRenderer=hue;Hi.Lexer=f0;Hi.lexer=f0.lex;Hi.Tokenizer=hW;Hi.Hooks=$I;Hi.parse=Hi;gvn=Hi.options,yvn=Hi.setOptions,vvn=Hi.use,bvn=Hi.walkTokens,xvn=Hi.parseInline,wvn=p0.parse,Evn=f0.lex});function gW(e){for(var t=[],r=1;r{});function VYe(e,{markdownAutoWrap:t}){let n=e.replace(//g,` -`).replace(/\n{2,}/g,` -`);return gW(n)}function HYe(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function qYe(e,t={}){let r=VYe(e,t),n=Hi.lexer(r),i=[[]],a=0;function o(s,l="normal"){s.type==="text"?s.text.split(` -`).forEach((d,h)=>{h!==0&&(a++,i.push([])),d.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(u=>{o(u,s.type)}):s.type==="html"&&i[a].push({content:s.text,type:"normal"})}return k(o,"processNode"),n.forEach(s=>{s.type==="paragraph"?s.tokens?.forEach(l=>{o(l)}):s.type==="html"?i[a].push({content:s.text,type:"normal"}):i[a].push({content:s.raw,type:"normal"})}),i}function YYe(e){return e?`

    ${e.replace(/\\n|\n/g,"
    ")}

    `:""}function jYe(e,{markdownAutoWrap:t}={}){let r=Hi.lexer(e);function n(i){return i.type==="text"?t===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${i.tokens?.map(n).join("")}`:i.type==="em"?`${i.tokens?.map(n).join("")}`:i.type==="paragraph"?`

    ${i.tokens?.map(n).join("")}

    `:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ye.warn(`Unsupported markdown: ${i.type}`),i.raw)}return k(n,"output"),r.map(n).join("")}function XYe(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}function $Ye(e,t){let r=XYe(t.content);return vue(e,[],r,t.type)}function vue(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];let[i,...a]=r,o=[...t,i];return e([{content:o.join(""),type:n}])?vue(e,o,a,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}function KYe(e,t){if(e.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return yW(e,t)}function yW(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";e[0].content===" "&&(i=" ",e.shift());let a=e.shift()??{content:" ",type:"normal"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(a),t(o))return yW(e,t,r,o);if(n.length>0)r.push(n),e.unshift(a);else if(a.content){let[s,l]=$Ye(t,a);r.push([s]),l.content&&e.unshift(l)}return yW(e,t,r)}function gue(e,t){t&&e.attr("style",t)}async function ZYe(e,t,r,n,i=!1,a=Kt()){let o=e.append("foreignObject");o.attr("width",`${Math.min(10*r,zYe)}px`),o.attr("height",`${Math.min(10*r,zYe)}px`);let s=o.append("xhtml:div"),l=uo(t.label)?await bk(t.label.replace(Lt.lineBreakRegex,` -`),a):rn(t.label,a),u=t.isNode?"nodeLabel":"edgeLabel",d=s.append("span");return d.html(l),gue(d,t.labelStyle),d.attr("class",`${u} ${n}`),gue(s,t.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(s.style("max-width",r+"px"),s.style("text-align","center")),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg"),(await yy.measure(()=>s.node().getBoundingClientRect())).width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px")),o.node()}function vW(e,t,r,n=!1){let i=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}function QYe(e,t,r){let n=e.append("text"),i=vW(n,1,t);bW(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function bue(e,t,r){let n=e.append("text"),i=vW(n,1,t);bW(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function JYe(e,t,r,n=!1,i=!1){let o=t.append("g"),s=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(let d of r){let h=k(p=>QYe(o,1.1,p)<=e,"checkWidth"),f=h(d)?[d]:KYe(d,h);for(let p of f){let m=vW(l,u,1.1,i);bW(m,p),u++}}if(n){let d=l.node().getBBox(),h=2;return s.attr("x",d.x-h).attr("y",d.y-h).attr("width",d.width+2*h).attr("height",d.height+2*h),o.node()}else return l.node()}function yue(e){let t=/&(amp|lt|gt);/g;return e.replace(t,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function bW(e,t){e.text(""),t.forEach((r,n)=>{let i=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(yue(r.content)):i.text(" "+yue(r.content))})}async function eje(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{let s=`${a}:${o}`;return await Lqe(s)?await Ah(s,void 0,{class:"label-icon"}):``})()),i));let n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var GYe,WYe,mue,jk,pue,oir,sir,lir,_vn,cir,yy,zYe,Ll,ds=H(()=>{us();Vn();Wr();Gr();xr();GYe=Ue(xYe(),1),WYe=Ue(wYe(),1);_n();FYe();fue();mue=typeof performance<"u"&&typeof performance.now=="function",jk=k(()=>mue?performance.now():0,"now"),pue="\u{1F9DC} ",oir="Mermaid render",sir="Mermaid",lir={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},_vn=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{k(this,"Profiler")}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(e){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(e))}tickSync(e,t){if(!this.enabled)return t();let r=jk();try{return t()}finally{this.buckets[e]=(this.buckets[e]??0)+(jk()-r)}}async tick(e,t){if(!this.enabled)return t();let r=jk();try{return await t()}finally{this.buckets[e]=(this.buckets[e]??0)+(jk()-r)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();let e=this.roots.at(-1),t=this.runLabel??e?.name;return e&&(this.records.push({label:t??e.name,tree:e,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(e,t)),this.runLabel=void 0,e}begin(e){if(!this.enabled)return;let t={name:e,start:jk(),duration:-1,children:[]},r=this.stack.at(-1);if(r?r.children.push(t):this.roots.push(t),this.stack.push(t),mue&&typeof performance.mark=="function")try{performance.mark(`${pue}${e} \u25B6`)}catch{}}end(){if(!this.enabled)return;let e=this.stack.pop();if(!e)return;let t=jk();if(e.duration=t-e.start,mue&&typeof performance.measure=="function")try{performance.measure(`${pue}${e.name}`,{start:e.start,end:t,detail:{devtools:{dataType:"track-entry",track:oir,trackGroup:sir,color:lir[e.name]??"primary",tooltipText:`${e.name} \u2014 ${e.duration.toFixed(1)} ms`}}})}catch{}}async span(e,t){if(!this.enabled)return t();this.begin(e);try{return await t()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(e=this.report(),t){if(!e)return;let r=e.duration,n=t&&t!==e.name?`${e.name} [${t}]`:e.name,i=["ms % phase"],a=k((s,l)=>{let u=" ".repeat(l),d=s.duration.toFixed(1).padStart(8),h=r>0?`${(s.duration/r*100).toFixed(0).padStart(3)}%`:" -";i.push(`${d} ${h} ${u}${s.name}`);for(let f of s.children)a(f,l+1);if(s.children.length>0){let f=s.children.reduce((m,g)=>m+g.duration,0),p=s.duration-f;if(p>.5){let m=p.toFixed(1).padStart(8);i.push(`${m} ${u} (self)`)}}},"walk");a(e,0);let o=Object.keys(this.buckets);if(o.length>0){i.push("\u2014\u2014 buckets (summed) \u2014\u2014");for(let s of o)i.push(`${this.buckets[s].toFixed(1).padStart(8)} ${s}`)}console.log(`${pue}mermaid render profile \xB7 ${n} -${i.join(` -`)}`)}};globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};cir=GYe.default.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(WYe.default),yy=cir;k(VYe,"preprocessMarkdown");k(HYe,"nonMarkdownToLines");k(qYe,"markdownToLines");k(YYe,"nonMarkdownToHTML");k(jYe,"markdownToHTML");k(XYe,"splitTextToChars");k($Ye,"splitWordToFitWidth");k(vue,"splitWordToFitWidthRecursion");k(KYe,"splitLineToFitWidth");k(yW,"splitLineToFitWidthRecursion");k(gue,"applyStyle");zYe=16384;k(ZYe,"addHtmlSpan");k(vW,"createTspan");k(QYe,"computeWidthOfText");k(bue,"computeDimensionOfText");k(JYe,"createFormattedText");k(yue,"decodeHTMLEntities");k(bW,"updateTextContentAndStyles");k(eje,"replaceIconSubstring");Ll=k(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},d)=>{if(ye.debug("XYZ createText",t,r,n,i,a,s,"addSvgBackground: ",u),a){let h=o?jYe(t,d):YYe(t),f=await eje(h0(h),d),p=t.replace(/\\\\/g,"\\"),m={isNode:s,label:uo(t)?p:f,labelStyle:r.replace("fill:","color:")};return await ZYe(e,m,l,i,u,d)}else{let h=h0(t.replace(//g,"
    ")),f=o?qYe(h.replace("
    ","
    "),d):HYe(h),p=JYe(l,e,f,t?u:!1,!s);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");xt(p).attr("style",m)}else{let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");xt(p).select("rect").attr("style",m.replace(/background:/g,"fill:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");xt(p).select("text").attr("style",g)}return n?xt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):xt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText")});function xue(e,t,r){if(e&&e.length){let[n,i]=t,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(let l of e){let[u,d]=l;l[0]=(u-n)*o-(d-i)*s+n,l[1]=(u-n)*s+(d-i)*o+i}}}function uir(e,t){return e[0]===t[0]&&e[1]===t[1]}function dir(e,t,r,n=1){let i=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(i)for(let u of o)xue(u,s,i);let l=(function(u,d,h){let f=[];for(let b of u){let x=[...b];uir(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}let p=[];d=Math.max(d,.1);let m=[];for(let b of f)for(let x=0;xb.yminx.ymin?1:b.xx.x?1:b.ymax===x.ymax?0:(b.ymax-x.ymax)/Math.abs(b.ymax-x.ymax))),!m.length)return p;let g=[],y=m[0].ymin,v=0;for(;g.length||m.length;){if(m.length){let b=-1;for(let x=0;xy);x++)b=x;m.splice(0,b+1).forEach((x=>{g.push({s:y,edge:x})}))}if(g=g.filter((b=>!(b.edge.ymax<=y))),g.sort(((b,x)=>b.edge.x===x.edge.x?0:(b.edge.x-x.edge.x)/Math.abs(b.edge.x-x.edge.x))),(h!==1||v%d==0)&&g.length>1)for(let b=0;b=g.length)break;let E=g[b].edge,w=g[x].edge;p.push([[Math.round(E.x),y],[Math.round(w.x),y]])}y+=h,g.forEach((b=>{b.edge.x=b.edge.x+h*b.edge.islope})),v++}return p})(o,a,n);if(i){for(let u of o)xue(u,s,-i);(function(u,d,h){let f=[];u.forEach((p=>f.push(...p))),xue(f,d,h)})(l,s,-i)}return l}function tR(e,t){var r;let n=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),dir(e,i,n,a||1)}function UW(e){let t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}function Eue(e,t){return e.type===t}function Pue(e){let t=[],r=(function(o){let s=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))s[s.length]={type:hir,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];s[s.length]={type:wue,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return s[s.length]={type:tje,text:""},s})(e),n="BOD",i=0,a=r[i];for(;!Eue(a,tje);){let o=0,s=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return Pue("M0,0"+e);i++,o=xW[a.text],n=a.text}else Eue(a,wue)?o=xW[n]:(i++,o=xW[a.text],n=a.text);if(!(i+od%2?u+r:u+t));a.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...s]}),t=s[2],r=s[3];break;case"q":{let l=s.map(((u,d)=>d%2?u+r:u+t));a.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...s]}),t=s[5],r=s[6];break;case"a":t+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,r]});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]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),t=s[2],r=s[3];break;case"s":{let l=s.map(((u,d)=>d%2?u+r:u+t));a.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...s]}),t=s[0],r=s[1];break;case"t":t+=s[0],r+=s[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=n,r=i}return a}function uje(e){let t=[],r="",n=0,i=0,a=0,o=0,s=0,l=0;for(let{key:u,data:d}of e){switch(u){case"M":t.push({key:"M",data:[...d]}),[n,i]=d,[a,o]=d;break;case"C":t.push({key:"C",data:[...d]}),n=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],t.push({key:"L",data:[n,i]});break;case"V":i=d[0],t.push({key:"L",data:[n,i]});break;case"S":{let h=0,f=0;r==="C"||r==="S"?(h=n+(n-s),f=i+(i-l)):(h=n,f=i),t.push({key:"C",data:[h,f,...d]}),s=d[0],l=d[1],n=d[2],i=d[3];break}case"T":{let[h,f]=d,p=0,m=0;r==="Q"||r==="T"?(p=n+(n-s),m=i+(i-l)):(p=n,m=i);let g=n+2*(p-n)/3,y=i+2*(m-i)/3,v=h+2*(p-h)/3,b=f+2*(m-f)/3;t.push({key:"C",data:[g,y,v,b,h,f]}),s=p,l=m,n=h,i=f;break}case"Q":{let[h,f,p,m]=d,g=n+2*(h-n)/3,y=i+2*(f-i)/3,v=p+2*(h-p)/3,b=m+2*(f-m)/3;t.push({key:"C",data:[g,y,v,b,p,m]}),s=h,l=f,n=p,i=m;break}case"A":{let h=Math.abs(d[0]),f=Math.abs(d[1]),p=d[2],m=d[3],g=d[4],y=d[5],v=d[6];h===0||f===0?(t.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(dje(n,i,y,v,h,f,p,m,g).forEach((function(b){t.push({key:"C",data:b})})),n=y,i=v);break}case"Z":t.push({key:"Z",data:[]}),n=a,i=o}r=u}return t}function QI(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function dje(e,t,r,n,i,a,o,s,l,u){let d=(h=o,Math.PI*h/180);var h;let f=[],p=0,m=0,g=0,y=0;if(u)[p,m,g,y]=u;else{[e,t]=QI(e,t,-d),[r,n]=QI(r,n,-d);let A=(e-r)/2,P=(t-n)/2,D=A*A/(i*i)+P*P/(a*a);D>1&&(D=Math.sqrt(D),i*=D,a*=D);let M=i*i,O=a*a,_=M*O-M*P*P-O*A*A,B=M*P*P+O*A*A,F=(s===l?-1:1)*Math.sqrt(Math.abs(_/B));g=F*i*P/a+(e+r)/2,y=F*-a*A/i+(t+n)/2,p=Math.asin(parseFloat(((t-y)/a).toFixed(9))),m=Math.asin(parseFloat(((n-y)/a).toFixed(9))),em&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let v=m-p;if(Math.abs(v)>120*Math.PI/180){let A=m,P=r,D=n;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=dje(r=g+i*Math.cos(m),n=y+a*Math.sin(m),P,D,i,a,o,0,l,[m,A,g,y])}v=m-p;let b=Math.cos(p),x=Math.sin(p),E=Math.cos(m),w=Math.sin(m),T=Math.tan(v/4),C=4/3*i*T,S=4/3*a*T,R=[e,t],U=[e+C*x,t-S*b],L=[r+C*w,n-S*E],I=[r,n];if(U[0]=2*R[0]-U[0],U[1]=2*R[1]-U[1],u)return[U,L,I].concat(f);{f=[U,L,I].concat(f);let A=[];for(let P=0;P2){let i=[];for(let a=0;a2*Math.PI&&(p=0,m=2*Math.PI);let g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(m-p)/2),v=sje(y,u,d,h,f,p,m,1,l);if(!l.disableMultiStroke){let b=sje(y,u,d,h,f,p,m,1.5,l);v.push(...b)}return o&&(s?v.push(...E2(u,d,u+h*Math.cos(p),d+f*Math.sin(p),l),...E2(u,d,u+h*Math.cos(m),d+f*Math.sin(m),l)):v.push({op:"lineTo",data:[u,d]},{op:"lineTo",data:[u+h*Math.cos(p),d+f*Math.sin(p)]})),{type:"path",ops:v}}function ije(e,t){let r=uje(cje(Pue(e))),n=[],i=[0,0],a=[0,0];for(let{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...E2(a[0],a[1],s[0],s[1],t)),a=[s[0],s[1]];break;case"C":{let[l,u,d,h,f,p]=s;n.push(...mir(l,u,d,h,f,p,a,t)),a=[f,p];break}case"Z":n.push(...E2(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Tue(e,t){let r=[];for(let n of e)if(n.length){let i=t.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+nn(i,t),n[0][1]+nn(i,t)]});for(let o=1;o500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);let h=d/2,f=.2+.2*pje(i),p=i.bowing*i.maxRandomnessOffset*(n-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-r)/200;p=nn(p,i,u),m=nn(m,i,u);let g=[],y=()=>nn(h,i,u),v=()=>nn(d,i,u),b=i.preserveVertices;return a&&(o?g.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):g.push({op:"move",data:[e+(b?0:nn(d,i,u)),t+(b?0:nn(d,i,u))]})),o?g.push({op:"bcurveTo",data:[p+e+(r-e)*f+y(),m+t+(n-t)*f+y(),p+e+2*(r-e)*f+y(),m+t+2*(n-t)*f+y(),r+(b?0:y()),n+(b?0:y())]}):g.push({op:"bcurveTo",data:[p+e+(r-e)*f+v(),m+t+(n-t)*f+v(),p+e+2*(r-e)*f+v(),m+t+2*(n-t)*f+v(),r+(b?0:v()),n+(b?0:v())]}),g}function wW(e,t,r){if(!e.length)return[];let n=[];n.push([e[0][0]+nn(t,r),e[0][1]+nn(t,r)]),n.push([e[0][0]+nn(t,r),e[0][1]+nn(t,r)]);for(let i=1;i3){let a=[],o=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+21&&i.push(s)):i.push(s),i.push(e[t+3])}else{let l=e[t+0],u=e[t+1],d=e[t+2],h=e[t+3],f=w4(l,u,.5),p=w4(u,d,.5),m=w4(d,h,.5),g=w4(f,p,.5),y=w4(p,m,.5),v=w4(g,y,.5);Due([l,f,g,v],0,r,i),Due([v,y,m,h],0,r,i)}var a,o;return i}function yir(e,t){return AW(e,0,e.length,t)}function AW(e,t,r,n,i){let a=i||[],o=e[t],s=e[r-1],l=0,u=1;for(let d=t+1;dl&&(l=h,u=d)}return Math.sqrt(l)>n?(AW(e,t,u+1,n,a),AW(e,u,r,n,a)):(a.length||a.push(o),a.push(s)),a}function kue(e,t=.15,r){let n=[],i=(e.length-1)/3;for(let a=0;a0?AW(n,0,n.length,r):n}var eR,Cue,Sue,Aue,Uue,Iue,Cd,Rue,hir,wue,tje,xW,fir,Uh,$k,Nue,EW,_ue,yt,mr=H(()=>{eR=class{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let n=tR(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){let n=[];for(let i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};Cue=class extends eR{fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=tR(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(let[u,d]of i)UW([u,d])&&o.push([[u[0]-s,u[1]+l],[...d]],[[u[0]+s,u[1]-l],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}},Sue=class extends eR{fillPolygons(t,r){let n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,i);return n.ops=n.ops.concat(a.ops),n}},Aue=class{constructor(t){this.helper=t}fillPolygons(t,r){let n=tR(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,r){let n=[],i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let o=i/4;for(let s of t){let l=UW(s),u=l/i,d=Math.ceil(u)-1,h=l-d*i,f=(s[0][0]+s[1][0])/2-i/4,p=Math.min(s[0][1],s[1][1]);for(let m=0;m{let s=UW(o),l=Math.floor(s/(n+i)),u=(s+i-l*(n+i))/2,d=o[0],h=o[1];d[0]>h[0]&&(d=o[1],h=o[0]);let f=Math.atan((h[1]-d[1])/(h[0]-d[0]));for(let p=0;p{let o=UW(a),s=Math.round(o/(2*r)),l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);let d=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let h=0;h2*Math.PI&&(C=0,S=2*Math.PI);let R=(S-C)/b.curveStepCount,U=[];for(let L=C;L<=S;L+=R)U.push([x+w*Math.cos(L),E+T*Math.sin(L)]);return U.push([x+w*Math.cos(S),E+T*Math.sin(S)]),U.push([x,E]),Xk([U],b)})(t,r,n,i,a,o,u));return u.stroke!==Uh&&d.push(h),this._d("arc",d,u)}curve(t,r){let n=this._o(r),i=[],a=rje(t,n);if(n.fill&&n.fill!==Uh)if(n.fillStyle==="solid"){let o=rje(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{let o=[],s=t;if(s.length){let l=typeof s[0][0]=="number"?[s]:s;for(let u of l)u.length<3?o.push(...u):u.length===3?o.push(...kue(lje([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):o.push(...kue(lje(u),10,(1+n.roughness)/2))}o.length&&i.push(Xk([o],n))}return n.stroke!==Uh&&i.push(a),this._d("curve",i,n)}polygon(t,r){let n=this._o(r),i=[],a=TW(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Tue([t],n)):i.push(Xk([t],n))),n.stroke!==Uh&&i.push(a),this._d("polygon",i,n)}path(t,r){let n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==Uh,o=n.stroke!==Uh,s=!!(n.simplification&&n.simplification<1),l=(function(d,h,f){let p=uje(cje(Pue(d))),m=[],g=[],y=[0,0],v=[],b=()=>{v.length>=4&&g.push(...kue(v,h)),v=[]},x=()=>{b(),g.length&&(m.push(g),g=[])};for(let{key:w,data:T}of p)switch(w){case"M":x(),y=[T[0],T[1]],g.push(y);break;case"L":b(),g.push([T[0],T[1]]);break;case"C":if(!v.length){let C=g.length?g[g.length-1]:y;v.push([C[0],C[1]])}v.push([T[0],T[1]]),v.push([T[2],T[3]]),v.push([T[4],T[5]]);break;case"Z":b(),g.push([y[0],y[1]])}if(x(),!f)return m;let E=[];for(let w of m){let T=yir(w,f);T.length&&E.push(T)}return E})(t,1,s?4-4*(n.simplification||1):(1+n.roughness)/2),u=ije(t,n);if(a)if(n.fillStyle==="solid")if(l.length===1){let d=ije(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(Tue(l,n));else i.push(Xk(l,n));return o&&(s?l.forEach((d=>{i.push(TW(d,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(t,r){let n="";for(let i of t.ops){let a=typeof r=="number"&&r>=0?i.data.map((o=>+o.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(t){let r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(let a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Uh};break;case"fillPath":o={d:this.opsToPath(a),stroke:Uh,strokeWidth:0,fill:n.fill||Uh};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Uh,strokeWidth:n,fill:Uh}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}},Nue=class{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new $k(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let o of r)switch(o.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,o,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,a,s),i.restore();break}case"fillSketch":this.fillSketch(i,o,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(let a of r.ops){let o=typeof n=="number"&&n>=0?a.data.map((s=>+s.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o),o}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o),o}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o),o}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a),a}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,a,o,s=!1,l){let u=this.gen.arc(t,r,n,i,a,o,s,l);return this.draw(u),u}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){let n=this.gen.path(t,r);return this.draw(n),n}},EW="http://www.w3.org/2000/svg",_ue=class{constructor(t,r){this.svg=t,this.gen=new $k(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(EW,"g"),o=t.options.fixedDecimalPlaceDigits;for(let s of r){let l=null;switch(s.type){case"path":l=i.createElementNS(EW,"path"),l.setAttribute("d",this.opsToPath(s,o)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(EW,"path"),l.setAttribute("d",this.opsToPath(s,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,s,n)}l&&a.appendChild(l)}return a}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=t.createElementNS(EW,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o)}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o)}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o)}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a)}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,a,o,s=!1,l){let u=this.gen.arc(t,r,n,i,a,o,s,l);return this.draw(u)}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n)}path(t,r){let n=this.gen.path(t,r);return this.draw(n)}},yt={canvas:(e,t)=>new Nue(e,t),svg:(e,t)=>new _ue(e,t),generator:e=>new $k(e),newSeed:()=>$k.newSeed()}});async function que(e){let t=e.getElementsByTagName("img");if(!t||t.length===0)return;let r=!Yue(e);await Promise.all([...t].map(n=>new Promise(i=>{function a(){if(n.style.display="flex",n.style.flexDirection="column",r){let o=je().fontSize?je().fontSize:window.getComputedStyle(document.body).fontSize,s=5,[l=Xr.fontSize]=kd(o),u=l*s+"px";n.style.minWidth=u,n.style.maxWidth=u}else n.style.width="100%";i(n)}k(a,"setupImage"),setTimeout(()=>{n.complete&&a()}),n.addEventListener("error",a),n.addEventListener("load",a)})))}function Yue(e){return e.nodeType===bir?e.textContent?.trim()!=="":e.nodeType!==vir||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(Yue)}function li(e){let t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function T2(e,t,r,n,i,a){let o=[],l=r-e,u=n-t,d=l/a,h=2*Math.PI/d,f=t+u/2;for(let p=0;p<=50;p++){let m=p/50,g=e+m*l,y=f+i*Math.sin(h*(g-e));o.push({x:g,y})}return o}function ig(e,t,r,n,i,a){let o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);let i=t.find(l=>l.getAttribute("fill")!=="none"),a=t.find(l=>l.getAttribute("stroke")!=="none"),o=k((l,u)=>l?.getAttribute(u)??void 0,"getAttr");if(i){let l={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,d])=>{d&&r.setAttribute(u,d)})}if(a){let l={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,d])=>{d&&r.setAttribute(u,d)})}let s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}function Uje(e,t){return e.intersect(t)}function Ije(e,t,r,n){var i=e.x,a=e.y,o=i-n.x,s=a-n.y,l=Math.sqrt(t*t*s*s+r*r*o*o),u=Math.abs(t*r*o/l);n.x0}function Dje(e,t,r){let n=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){o=Math.min(o,d.x),s=Math.min(s,d.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let l=n-e.width/2-o,u=i-e.height/2-s;for(let d=0;d1&&a.sort(function(d,h){let f=d.x-r.x,p=d.y-r.y,m=Math.sqrt(f*f+p*p),g=h.x-r.x,y=h.y-r.y,v=Math.sqrt(g*g+y*y);return md,":first-child");return h.attr("class","anchor").attr("style",Uo(s)),pr(t,h),t.intersect=function(f){return ye.info("Circle intersect",t,o,f),sr.circle(t,o,f)},a}function Hue(e,t,r,n,i,a,o){let l=(e+r)/2,u=(t+n)/2,d=Math.atan2(n-t,r-e),h=(r-e)/2,f=(n-t)/2,p=h/i,m=f/a,g=Math.sqrt(p**2+m**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let y=Math.sqrt(1-g**2),v=l+y*a*Math.sin(d)*(o?-1:1),b=u-y*i*Math.cos(d)*(o?-1:1),x=Math.atan2((t-b)/a,(e-v)/i),w=Math.atan2((n-b)/a,(r-v)/i)-x;o&&w<0&&(w+=2*Math.PI),!o&&w>0&&(w-=2*Math.PI);let T=[];for(let C=0;C<20;C++){let S=C/19,R=x+S*w,U=v+i*Math.cos(R),L=b+a*Math.sin(R);T.push({x:U,y:L})}return T}function _je(e,t,r){let[n,i]=[t,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(e/n/2)**2))}async function Pje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,s=k(R=>R+o,"calcTotalHeight"),l=k(R=>{let U=R/2;return[U/(2.5+R/50),U]},"calcEllipseRadius"),{shapeSvg:u,bbox:d}=await Ur(e,t,Lr(t)),h=s(t?.height?t?.height:d.height),[f,p]=l(h),m=_je(h,f,p),y=(t?.width?t?.width:d.width)+a*2+m-m,v=h,{cssStyles:b}=t,x=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...Hue(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...Hue(y/2,v/2,y/2,-v/2,f,p,!0)],E=yt.svg(u),w=ur(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let T=li(x),C=E.path(T,w),S=u.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${f/2}, 0)`),pr(t,S),t.intersect=function(R){return sr.polygon(t,x,R)},u}async function Oje(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:s}=await Ur(e,t,Lr(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",u=t.padding??12,d=Math.max(o.width+u*2,t.width??0,80),h=Math.max(Math.min(d*.08,12),5),f=Math.max(o.height+u*2+h,t.height??0),p=-f/2+h,m=f/2,g=d*.72,y=[`M${-d/2},${p}`,`L${-g/2},${m}`,`A${g/2},${h} 0 0 0 ${g/2},${m}`,`L${d/2},${p}`,`A${d/2},${h} 0 0 0 ${-d/2},${p}`,"Z"].join(" "),{cssStyles:v}=t,b=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=yt.svg(a).path(y,ur(t,{}));b.node()?.appendChild(S),v&&b.attr("style",v)}else b.append("path").attr("d",y).attr("style",i);b.append("ellipse").attr("cx",0).attr("cy",p).attr("rx",d/2).attr("ry",h).attr("style",`fill:none;stroke:${l};stroke-width:1px`),pr(t,b);let x=p+(m-p)/2;s.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${x-o.height/2-(o.y-(o.top??0))})`);let E=12,w=k((C,S,R)=>Array.from({length:E+1},(U,L)=>{let I=Math.PI-L*Math.PI/E;return{x:C*Math.cos(I),y:S+R*h*Math.sin(I)}}),"arc"),T=[...w(d/2,p,-1),...w(g/2,m,1).reverse()];return t.intersect=function(C){return sr.polygon(t,T,C)},a}async function Bje(e,t){let{themeVariables:r}=je(),n=r.clusterBkg,i=r.clusterBorder,{nodeStyles:a}=or(t),{shapeSvg:o,bbox:s}=await Ur(e,t,Lr(t)),l=t.padding??8,u=s.height,d=Math.max(s.width+l*2,Uir,t?.width??0),h=Math.max(u+Fue+Bue+l*2,t?.height??0),f=-d/2,p=-h/2,m=-(Fue+Bue)/2,g=o.select(".label");g&&(t.useHtmlLabels??As(je())?g.attr("transform",`translate(${-s.width/2}, ${-s.height/2+m})`):g.attr("transform",`translate(0, ${-s.height/2+m})`));let y;if(t.look==="handDrawn"){let w=yt.svg(o),T=ur(t,{fill:n,stroke:i,fillStyle:"solid"}),C=w.path(Ih(f,p,d,h,zue),T);y=o.insert(()=>C,":first-child"),y.attr("class","basic label-container collapsed-group").attr("style",Uo(t.cssStyles))}else y=o.insert("rect",":first-child"),y.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",zue).attr("ry",zue).attr("x",f).attr("y",p).attr("width",d).attr("height",h).attr("fill",n).attr("stroke",i);let v=p+l+u+Fue;o.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",v).attr("x2",f+d-8).attr("y2",v).attr("stroke",i).attr("stroke-dasharray","3, 3");let b=v+Bue/2,x=2.5,E=10;for(let w=-1;w<=1;w++)o.append("circle").attr("class","collapsed-indicator").attr("cx",w*E).attr("cy",b).attr("r",x).attr("fill",i);return pr(t,y),t.calcIntersect=function(w,T){return sr.rect(w,T)},t.intersect=function(w){return sr.rect(t,w)},o}function og(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}async function Fje(e,t){let r=t,{shapeSvg:n,bbox:i}=await Ur(e,r,Lr(r)),a=r.padding??0,o=i.height+2*a,s=o/2,l=i.width+2*s+a,u=r.width??0,h=r.positioned&&(r.widthInColumns??1)>1&&u>l?u:l,f=Lir(r.directions??[],i,r,h),p=og(n,h,o,f);return p.attr("style",r.style??null),pr(r,p),r.intersect=function(m){return sr.polygon(r,f,m)},n}async function zje(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:s}=await Ur(e,t,Lr(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",u=t.padding??12,d=18,h=12,f=Math.max(o.width+u*2,t.width??0,90),p=Math.max(o.height+u*2+d,t.height??0),m=-p/2,{cssStyles:g}=t,y=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=yt.svg(a).path(Ih(-f/2,m,f,p,h),ur(t,{}));y.node()?.appendChild(x),g&&y.attr("style",g)}else y.append("rect").attr("x",-f/2).attr("y",m).attr("width",f).attr("height",p).attr("rx",h).attr("ry",h).attr("style",i);y.append("line").attr("x1",-f/2).attr("y1",m+d).attr("x2",f/2).attr("y2",m+d).attr("style",`stroke:${l};stroke-width:1px`);for(let b=0;b<3;b++)y.append("circle").attr("cx",-f/2+12+b*9).attr("cy",m+d/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);y.append("rect").attr("class","browser-address-bar").attr("x",-f/2+44).attr("y",m+4).attr("width",Math.max(f-56,10)).attr("height",d-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),pr(t,y);let v=m+d+(p-d)/2;return s.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${v-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(b){return sr.rect(t,b)},a}async function Gje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?28:i,o=t.look==="neo"?24:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=(t?.width??l.width)+(t.look==="neo"?a*2:a+IW),d=(t?.height??l.height)+(t.look==="neo"?o*2:o),h=0,f=u,p=-d,m=0,g=[{x:h+IW,y:p},{x:f,y:p},{x:f,y:m},{x:h,y:m},{x:h,y:p+IW},{x:h+IW,y:p}],y,{cssStyles:v}=t;if(t.look==="handDrawn"){let b=yt.svg(s),x=ur(t,{}),E=li(g),w=b.path(E,x);y=s.insert(()=>w,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`),v&&y.attr("style",v)}else y=og(s,u,d,g);return n&&y.attr("style",n),pr(t,y),t.intersect=function(b){return sr.polygon(t,g,b)},s}function Wje(e,t){let{nodeStyles:r}=or(t);t.label="";let n=e.insert("g").attr("class",Lr(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=yt.svg(n),l=ur(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");let u=li(o),d=s.path(u,l),h=n.insert(()=>d,":first-child");return i&&t.look!=="handDrawn"&&h.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&h.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return sr.polygon(t,o,f)},n}async function Xue(e,t,r){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,halfPadding:s}=await Ur(e,t,Lr(t)),l=16,u=r?.padding??s,d=t.look==="neo"?o.width/2+l*2:o.width/2+u,h,{cssStyles:f}=t;if(t.look==="handDrawn"){let p=yt.svg(a),m=ur(t,{}),g=p.circle(0,0,d*2,m);h=a.insert(()=>g,":first-child"),h.attr("class","basic label-container").attr("style",Uo(f))}else h=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return pr(t,h),t.calcIntersect=function(p,m){let g=p.width/2;return sr.circle(p,g,m)},t.intersect=function(p){return ye.info("Circle intersect",t,d,p),sr.circle(t,d,p)},a}async function Vje(e,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:a,halfPadding:o}=await Ur(e,r,n),s=i.insert("rect",":first-child"),l=r.padding??0,u=r.positioned?r.width??0:a.width+l,d=r.positioned?r.height??0:a.height+l,h=r.positioned?-u/2:-a.width/2-o,f=r.positioned?-d/2:-a.height/2-o;return s.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",h).attr("y",f).attr("width",u).attr("height",d),pr(r,s),r.intersect=function(p){return sr.rect(r,p)},i}async function Hje(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:s}=await Ur(e,t,Lr(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",u=t.padding??12,d=20,h=12,f=Math.max(o.width+u*2,t.width??0,90),p=Math.max(o.height+u*2+d,t.height??0),m=-p/2,{cssStyles:g}=t,y=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=yt.svg(a).path(Ih(-f/2,m,f,p,h),ur(t,{}));y.node()?.appendChild(x),g&&y.attr("style",g)}else y.append("rect").attr("x",-f/2).attr("y",m).attr("width",f).attr("height",p).attr("rx",h).attr("ry",h).attr("style",i);y.append("text").attr("x",-f/2+12).attr("y",m+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),pr(t,y);let v=m+d+(p-d)/2;return s.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${v-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(b){return sr.rect(t,b)},a}function qje(e){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},a={x:-(n/2)*t,y:n/2*r},o={x:-(n/2)*t,y:-(n/2)*r},s={x:n/2*t,y:-(n/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y} - M ${i.x},${i.y} L ${o.x},${o.y}`}function Yje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r,t.label="";let i=e.insert("g").attr("class",Lr(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=yt.svg(i),l=ur(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");let u=s.circle(0,0,a*2,l),d=qje(a),h=s.path(d,l),f=i.insert(()=>u,":first-child");return f.insert(()=>h),f.attr("class","outer-path"),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),pr(t,f),t.intersect=function(p){return ye.info("crossedCircle intersect",t,{radius:a,point:p}),sr.circle(t,a,p)},i}function vy(e,t,r,n=100,i=0,a=180){let o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hw,":first-child").attr("stroke-opacity",0),T.insert(()=>x,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${h}, 0)`),o.attr("transform",`translate(${-u/2+h-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pr(t,T),t.intersect=function(C){return sr.polygon(t,m,C)},i}function by(e,t,r,n=100,i=0,a=180){let o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hw,":first-child").attr("stroke-opacity",0),T.insert(()=>x,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${-h}, 0)`),o.attr("transform",`translate(${-u/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pr(t,T),t.intersect=function(C){return sr.polygon(t,m,C)},i}function sc(e,t,r,n=100,i=0,a=180){let o=[],s=i*Math.PI/180,d=(a*Math.PI/180-s)/(n-1);for(let h=0;hR,":first-child").attr("stroke-opacity",0),U.insert(()=>E,":first-child"),U.insert(()=>C,":first-child"),U.attr("class","text"),f&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",n),U.attr("transform",`translate(${h-h/4}, 0)`),o.attr("transform",`translate(${-u/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pr(t,U),t.intersect=function(L){return sr.polygon(t,g,L)},i}async function Kje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,s=20,l=5,{shapeSvg:u,bbox:d}=await Ur(e,t,Lr(t)),h=Math.max(s,(d.width+a*2)*1.25,t?.width??0),f=Math.max(l,d.height+o*2,t?.height??0),p=f/2,{cssStyles:m}=t,g=yt.svg(u),y=ur(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=h,b=f,x=v-p,E=b/4,w=[{x,y:0},{x:E,y:0},{x:0,y:b/2},{x:E,y:b},{x,y:b},...ig(-x,-b/2,p,50,270,90)],T=li(w),C=g.path(T,y),S=u.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(${-h/2}, ${-f/2})`),pr(t,S),t.intersect=function(R){return sr.polygon(t,w,R)},u}async function Zje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await Ur(e,t,Lr(t)),s=t.padding??20,l=Math.max(a.width+s*2,t.width??0,100),u=Math.min(Math.max(l*.23,16),56),d=u*.27,h=Math.max(a.height+s*2,t.height?t.height-(2*u-d):0),f=Math.min(l*.177,h*.45),p=h+2*u-d,m=-p/2,g=m+2*u-d,y=i.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:v}=t;if(t.look==="handDrawn"){let S=yt.svg(i),R=ur(t,{}),U=S.path(Ih(-l/2,g,l,h,f),R),L=S.circle(0,m+u,u*2,R);y.insert(()=>L,":first-child"),y.insert(()=>U,":first-child"),v&&y.attr("style",v)}else y.append("rect").attr("x",-l/2).attr("y",g).attr("width",l).attr("height",h).attr("rx",f).attr("ry",f).attr("style",n),y.append("circle").attr("cx",0).attr("cy",m+u).attr("r",u).attr("style",n);pr(t,y);let b=g+h/2;o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let x=m+u,E=Math.asin(Math.min(1,(g-x)/u))*180/Math.PI,C=[...ig(0,-x,u,24,180+E,-E),...ig(-(-l/2+f),-(g+f),f,12,90,0),...ig(-(-l/2+f),-(p/2-f),f,12,360,270),...ig(-(l/2-f),-(p/2-f),f,12,270,180),...ig(-(l/2-f),-(g+f),f,12,180,90)];return t.intersect=function(S){return sr.polygon(t,C,S)},i}async function Qje(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?24:i,o=t.look==="neo"?24:i,s=t.width??0;if(t.width&&(t.width=t.width-o,t.widthT,":first-child"),g=l.insert(()=>w,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{let v=Dir(0,0,h,m,f,p);g=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Uo(y)).attr("style",n)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-h/2}, ${-(m/2+p)})`),pr(t,g),d.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(t.padding??0)/1.5-(u.y-(u.top??0))})`),t.intersect=function(v){let b=sr.rect(t,v),x=b.x-(t.x??0);if(f!=0&&(Math.abs(x)<(t.width??0)/2||Math.abs(x)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-p)){let E=p*p*(1-x*x/(f*f));E>0&&(E=Math.sqrt(E)),E=p-E,v.y-(t.y??0)>0&&(E=-E),b.y+=E}return b},l}async function Jk(e,t,r){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{shapeSvg:a,bbox:o}=await Ur(e,t,Lr(t)),s=Math.max(o.width+r.labelPaddingX*2,t?.width||0),l=Math.max(o.height+r.labelPaddingY*2,t?.height||0),u=-s/2,d=-l/2,h,{rx:f,ry:p}=t,{cssStyles:m}=t;if(r?.rx&&r.ry&&(f=r.rx,p=r.ry),t.look==="handDrawn"){let g=yt.svg(a),y=ur(t,{}),v=f||p?g.path(Ih(u,d,s,l,f||0),y):g.rectangle(u,d,s,l,y);h=a.insert(()=>v,":first-child"),h.attr("class","basic label-container").attr("style",Uo(m))}else h=a.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",i).attr("rx",Uo(f)).attr("ry",Uo(p)).attr("x",u).attr("y",d).attr("width",s).attr("height",l);return pr(t,h,t.look==="handDrawn"?void 0:{width:s,height:l}),t.calcIntersect=function(g,y){return sr.rect(g,y)},t.intersect=function(g){return sr.rect(t,g)},a}async function Jje(e,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:o,height:s}=t,l={rx:0,ry:0,classes:r??"",labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await Jk(e,t,l);if(t.look==="handDrawn"){let p=yt.svg(u),m=ur(t,{}),g=u.select(".basic.label-container > path:nth-child(2)"),y=g.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,m),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,m),".basic.label-container g.label"),g.remove(),u}let d=u.select(".basic.label-container"),h=(Number(d.attr("width"))||o)??0,f=(Number(d.attr("height"))||s)??0;return h>0&&f>0&&d.attr("stroke-dasharray",`${h} ${f}`),u}async function eXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:o,bbox:s,label:l}=await Ur(e,t,Lr(t)),u=s.width+i,d=s.height+a,h=d*.2,f=-u/2,p=-d/2-h/2,{cssStyles:m}=t,g=yt.svg(o),y=ur(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:f,y:p+h},{x:-f,y:p+h},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+h}],b=g.polygon(v.map(E=>[E.x,E.y]),y),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+h+(t.padding??0)/2-(s.y-(s.top??0))})`),pr(t,x),t.intersect=function(E){return sr.rect(t,E)},o}async function tXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t),i=t.look==="neo"?12:5;t.labelStyle=r;let a=t.padding??0,o=t.look==="neo"?16:a,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=(t?.width?t?.width/2:l.width/2)+(o??0),d=u-i,h,{cssStyles:f}=t;if(t.look==="handDrawn"){let p=yt.svg(s),m=ur(t,{roughness:.2,strokeWidth:2.5}),g=ur(t,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,u*2,m),v=p.circle(0,0,d*2,g);h=s.insert("g",":first-child"),h.attr("class",Uo(t.cssClasses)).attr("style",Uo(f)),h.node()?.appendChild(y),h.node()?.appendChild(v)}else{h=s.insert("g",":first-child");let p=h.insert("circle",":first-child"),m=h.insert("circle");h.attr("class","basic label-container").attr("style",n),p.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0)}return pr(t,h),t.intersect=function(p){return ye.info("DoubleCircle intersect",t,u,p),sr.circle(t,u,p)},s}function rXe(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.label="",t.labelStyle=n;let a=e.insert("g").attr("class",Lr(t)).attr("id",t.domId??t.id),o=7,{cssStyles:s}=t,l=yt.svg(a),{nodeBorder:u}=r,d=ur(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);let h=l.circle(0,0,o*2,d),f=a.insert(()=>h,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),s&&s.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),pr(t,f),t.intersect=function(p){return ye.info("filledCircle intersect",t,{radius:o,point:p}),sr.circle(t,o,p)},a}async function nXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.heightv,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),t.width=u,t.height=d,pr(t,b),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(x){return ye.info("Triangle intersect",t,f,x),sr.polygon(t,f,x)},o}async function iXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await Ur(e,t,Lr(t)),s=t.padding??12,l=Math.max(a.width+s*2,t.width??0,90),u=a.height+s*2,d=Math.max(Math.min(u*.16,14),8),h=Math.max(u+d,t.height??0),f=h-d,p=Math.max(l*.38,28),m=-h/2,g=[{x:-l/2,y:m},{x:-l/2+p,y:m},{x:-l/2+p,y:m+d},{x:l/2,y:m+d},{x:l/2,y:h/2},{x:-l/2,y:h/2}],y=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(E=>`L${E.x},${E.y}`),"Z"].join(" "),{cssStyles:v}=t,b;if(t.look==="handDrawn"){let w=yt.svg(i).path(y,ur(t,{}));b=i.insert(()=>w,":first-child").attr("class","basic label-container"),v&&b.attr("style",v)}else b=i.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",n);t.look==="handDrawn"?pr(t,b):pr(t,b,{width:l,height:h});let x=m+d+f/2;return o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(E){return sr.polygon(t,g,E)},i}function aXe(e,t,{dir:r,config:{state:n,themeVariables:i}}){let{nodeStyles:a}=or(t);t.label="";let o=e.insert("g").attr("class",Lr(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,l=Math.max(70,t?.width??0),u=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),u=Math.max(70,t?.height??0));let d=-1*l/2,h=-1*u/2,f=yt.svg(o),p=ur(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=f.rectangle(d,h,l,u,p),g=o.insert(()=>m,":first-child");s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),pr(t,g);let y=n?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(v){return sr.rect(t,v)},o}async function oXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=15,a=10,o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-s*2,t.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),pr(t,x),t.intersect=function(E){return ye.info("Pill intersect",t,{radius:f,point:E}),sr.polygon(t,y,E)},l}async function sXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t),i=t.look==="neo"?3.5:4;t.labelStyle=r;let a=t.padding??0,o=70,s=32,l=t.look==="neo"?o:a,u=t.look==="neo"?s:a;if(t.width||t.height){let x=(t.height??0)/i;t.width=(t?.width??0)-2*x-u,t.height=(t.height??0)-l}let{shapeSvg:d,bbox:h}=await Ur(e,t,Lr(t)),f=(t?.height?t?.height:h.height)+l,p=f/i,m=(t?.width?t?.width:h.width)+2*p+u,g=[{x:p,y:0},{x:m-p,y:0},{x:m,y:-f/2},{x:m-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}],y,{cssStyles:v}=t;if(t.look==="handDrawn"){let b=yt.svg(d),x=ur(t,{}),E=Pir(0,0,m,f,p),w=b.path(E,x);y=d.insert(()=>w,":first-child").attr("transform",`translate(${-m/2}, ${f/2})`),v&&y.attr("style",v)}else y=og(d,m,f,g);return n&&y.attr("style",n),t.width=m,t.height=f,pr(t,y),t.intersect=function(b){return sr.polygon(t,g,b)},d}async function lXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.label="",t.labelStyle=r;let{shapeSvg:i}=await Ur(e,t,Lr(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,l=yt.svg(i),u=ur(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],h=li(d),f=l.path(h,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),s&&t.look!=="handDrawn"&&p.selectChildren("path").attr("style",s),n&&t.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-o/2})`),pr(t,p),t.intersect=function(m){return ye.info("Pill intersect",t,{points:d}),sr.polygon(t,d,m)},i}async function cXe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=or(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=n?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:h}=await Ur(e,t,"icon-shape default"),f=t.pos==="t",p=s,m=s,{nodeBorder:g}=r,{stylesMap:y}=p4(t),v=-m/2,b=-p/2,x=t.label?8:0,E=yt.svg(u),w=ur(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let T=E.rectangle(v,b,m,p,w),C=Math.max(m,d.width),S=p+d.height+x,R=E.rectangle(-C/2,-S/2,C,S,{...w,fill:"transparent",stroke:"none"}),U=u.insert(()=>T,":first-child"),L=u.insert(()=>R);if(t.icon){let I=u.append("g");I.html(`${await Ah(t.icon,{height:s,width:s,fallbackPrefix:""})}`);let A=I.node().getBBox(),P=A.width,D=A.height,M=A.x,O=A.y;I.attr("transform",`translate(${-P/2-M},${f?d.height/2+x/2-D/2-O:-d.height/2-x/2-D/2-O})`),I.attr("style",`color: ${y.get("stroke")??g};`)}return h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${f?-S/2:S/2-d.height})`),U.attr("transform",`translate(0,${f?d.height/2+x/2:-d.height/2-x/2})`),pr(t,L),t.intersect=function(I){if(ye.info("iconSquare intersect",t,I),!t.label)return sr.rect(t,I);let A=t.x??0,P=t.y??0,D=t.height??0,M=[];return f?M=[{x:A-d.width/2,y:P-D/2},{x:A+d.width/2,y:P-D/2},{x:A+d.width/2,y:P-D/2+d.height+x},{x:A+m/2,y:P-D/2+d.height+x},{x:A+m/2,y:P+D/2},{x:A-m/2,y:P+D/2},{x:A-m/2,y:P-D/2+d.height+x},{x:A-d.width/2,y:P-D/2+d.height+x}]:M=[{x:A-m/2,y:P-D/2},{x:A+m/2,y:P-D/2},{x:A+m/2,y:P-D/2+p},{x:A+d.width/2,y:P-D/2+p},{x:A+d.width/2/2,y:P+D/2},{x:A-d.width/2,y:P+D/2},{x:A-d.width/2,y:P-D/2+p},{x:A-m/2,y:P-D/2+p}],sr.polygon(t,M,I)},u}async function uXe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=or(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=n?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:h}=await Ur(e,t,"icon-shape default"),f=20,p=t.label?8:0,m=t.pos==="t",{nodeBorder:g,mainBkg:y}=r,{stylesMap:v}=p4(t),b=yt.svg(u),x=ur(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let E=v.get("fill");x.stroke=E??y;let w=u.append("g");t.icon&&w.html(`${await Ah(t.icon,{height:s,width:s,fallbackPrefix:""})}`);let T=w.node().getBBox(),C=T.width,S=T.height,R=T.x,U=T.y,L=Math.max(C,S)*Math.SQRT2+f*2,I=b.circle(0,0,L,x),A=Math.max(L,d.width),P=L+d.height+p,D=b.rectangle(-A/2,-P/2,A,P,{...x,fill:"transparent",stroke:"none"}),M=u.insert(()=>I,":first-child"),O=u.insert(()=>D);return w.attr("transform",`translate(${-C/2-R},${m?d.height/2+p/2-S/2-U:-d.height/2-p/2-S/2-U})`),w.attr("style",`color: ${v.get("stroke")??g};`),h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-P/2:P/2-d.height})`),M.attr("transform",`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),pr(t,O),t.intersect=function(_){return ye.info("iconSquare intersect",t,_),sr.rect(t,_)},u}async function dXe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=or(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=n?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:h,label:f}=await Ur(e,t,"icon-shape default"),p=t.pos==="t",m=s+h*2,g=s+h*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:b}=p4(t),x=-g/2,E=-m/2,w=t.label?8:0,T=yt.svg(u),C=ur(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let S=b.get("fill");C.stroke=S??v;let R=T.path(Ih(x,E,g,m,5),C),U=Math.max(g,d.width),L=m+d.height+w,I=T.rectangle(-U/2,-L/2,U,L,{...C,fill:"transparent",stroke:"none"}),A=u.insert(()=>R,":first-child").attr("class","icon-shape2"),P=u.insert(()=>I);if(t.icon){let D=u.append("g");D.html(`${await Ah(t.icon,{height:s,width:s,fallbackPrefix:""})}`);let M=D.node().getBBox(),O=M.width,_=M.height,B=M.x,F=M.y;D.attr("transform",`translate(${-O/2-B},${p?d.height/2+w/2-_/2-F:-d.height/2-w/2-_/2-F})`),D.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-L/2:L/2-d.height})`),A.attr("transform",`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),pr(t,P),t.intersect=function(D){if(ye.info("iconSquare intersect",t,D),!t.label)return sr.rect(t,D);let M=t.x??0,O=t.y??0,_=t.height??0,B=[];return p?B=[{x:M-d.width/2,y:O-_/2},{x:M+d.width/2,y:O-_/2},{x:M+d.width/2,y:O-_/2+d.height+w},{x:M+g/2,y:O-_/2+d.height+w},{x:M+g/2,y:O+_/2},{x:M-g/2,y:O+_/2},{x:M-g/2,y:O-_/2+d.height+w},{x:M-d.width/2,y:O-_/2+d.height+w}]:B=[{x:M-g/2,y:O-_/2},{x:M+g/2,y:O-_/2},{x:M+g/2,y:O-_/2+m},{x:M+d.width/2,y:O-_/2+m},{x:M+d.width/2/2,y:O+_/2},{x:M-d.width/2,y:O+_/2},{x:M-d.width/2,y:O-_/2+m},{x:M-g/2,y:O-_/2+m}],sr.polygon(t,B,D)},u}async function hXe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=or(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=n?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:h,label:f}=await Ur(e,t,"icon-shape default"),p=t.pos==="t",m=s+h*2,g=s+h*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:b}=p4(t),x=-g/2,E=-m/2,w=t.label?8:0,T=yt.svg(u),C=ur(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let S=b.get("fill");C.stroke=S??v;let R=T.path(Ih(x,E,g,m,.1),C),U=Math.max(g,d.width),L=m+d.height+w,I=T.rectangle(-U/2,-L/2,U,L,{...C,fill:"transparent",stroke:"none"}),A=u.insert(()=>R,":first-child"),P=u.insert(()=>I);if(t.icon){let D=u.append("g");D.html(`${await Ah(t.icon,{height:s,width:s,fallbackPrefix:""})}`);let M=D.node().getBBox(),O=M.width,_=M.height,B=M.x,F=M.y;D.attr("transform",`translate(${-O/2-B},${p?d.height/2+w/2-_/2-F:-d.height/2-w/2-_/2-F})`),D.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-L/2:L/2-d.height})`),A.attr("transform",`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),pr(t,P),t.intersect=function(D){if(ye.info("iconSquare intersect",t,D),!t.label)return sr.rect(t,D);let M=t.x??0,O=t.y??0,_=t.height??0,B=[];return p?B=[{x:M-d.width/2,y:O-_/2},{x:M+d.width/2,y:O-_/2},{x:M+d.width/2,y:O-_/2+d.height+w},{x:M+g/2,y:O-_/2+d.height+w},{x:M+g/2,y:O+_/2},{x:M-g/2,y:O+_/2},{x:M-g/2,y:O-_/2+d.height+w},{x:M-d.width/2,y:O-_/2+d.height+w}]:B=[{x:M-g/2,y:O-_/2},{x:M+g/2,y:O-_/2},{x:M+g/2,y:O-_/2+m},{x:M+d.width/2,y:O-_/2+m},{x:M+d.width/2/2,y:O+_/2},{x:M-d.width/2,y:O+_/2},{x:M-d.width/2,y:O-_/2+m},{x:M-g/2,y:O-_/2+m}],sr.polygon(t,B,D)},u}async function fXe(e,t,{config:{flowchart:r}}){let n=new Image;n.src=t?.img??"",await n.decode();let i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;let{labelStyles:o}=or(t);t.labelStyle=o;let s=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let l=Math.max(t.label?s??0:0,t?.assetWidth??i),u=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint==="on"?u/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(u,s??0);let{shapeSvg:h,bbox:f,label:p}=await Ur(e,t,"image-shape default"),m=t.pos==="t",g=-u/2,y=-d/2,v=t.label?8:0,b=yt.svg(h),x=ur(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let E=b.rectangle(g,y,u,d,x),w=Math.max(u,f.width),T=d+f.height+v,C=b.rectangle(-w/2,-T/2,w,T,{...x,fill:"none",stroke:"none"}),S=h.insert(()=>E,":first-child"),R=h.insert(()=>C);if(t.img){let U=h.append("image");U.attr("href",t.img),U.attr("width",u),U.attr("height",d),U.attr("preserveAspectRatio","none"),U.attr("transform",`translate(${-u/2},${m?T/2-d:-T/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-d/2-f.height/2-v/2:d/2-f.height/2+v/2})`),S.attr("transform",`translate(0,${m?f.height/2+v/2:-f.height/2-v/2})`),pr(t,R),t.intersect=function(U){if(ye.info("iconSquare intersect",t,U),!t.label)return sr.rect(t,U);let L=t.x??0,I=t.y??0,A=t.height??0,P=[];return m?P=[{x:L-f.width/2,y:I-A/2},{x:L+f.width/2,y:I-A/2},{x:L+f.width/2,y:I-A/2+f.height+v},{x:L+u/2,y:I-A/2+f.height+v},{x:L+u/2,y:I+A/2},{x:L-u/2,y:I+A/2},{x:L-u/2,y:I-A/2+f.height+v},{x:L-f.width/2,y:I-A/2+f.height+v}]:P=[{x:L-u/2,y:I-A/2},{x:L+u/2,y:I-A/2},{x:L+u/2,y:I-A/2+d},{x:L+f.width/2,y:I-A/2+d},{x:L+f.width/2/2,y:I+A/2},{x:L-f.width/2,y:I+A/2},{x:L-f.width/2,y:I-A/2+d},{x:L-u/2,y:I-A/2+d}],sr.polygon(t,P,U)},h}async function pXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=Math.max(l.height+a*2,t.height??0),d=Math.max(l.width+o*2,(t.width??0)-u),h=[{x:0,y:0},{x:d,y:0},{x:d+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=yt.svg(s),g=ur(t,{}),y=li(h),v=m.path(y,g);f=s.insert(()=>v,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=og(s,d,u,h);return n&&f.attr("style",n),t.width=d,t.height=u,pr(t,f),t.intersect=function(m){return sr.polygon(t,h,m)},s}async function mXe(e,t){let{shapeSvg:r,bbox:n,label:i}=await Ur(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),pr(t,a),t.intersect=function(l){return sr.rect(t,l)},r}async function gXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),h=[{x:0,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:-(3*u)/6,y:-u}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=yt.svg(s),g=ur(t,{}),y=li(h),v=m.path(y,g);f=s.insert(()=>v,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=og(s,d,u,h);return n&&f.attr("style",n),t.width=d,t.height=u,pr(t,f),t.intersect=function(m){return sr.polygon(t,h,m)},s}async function yXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),h=[{x:-3*u/6,y:0},{x:d,y:0},{x:d+3*u/6,y:-u},{x:0,y:-u}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=yt.svg(s),g=ur(t,{}),y=li(h),v=m.path(y,g);f=s.insert(()=>v,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=og(s,d,u,h);return n&&f.attr("style",n),t.width=d,t.height=u,pr(t,f),t.intersect=function(m){return sr.polygon(t,h,m)},s}function vXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.label="",t.labelStyle=r;let i=e.insert("g").attr("class",Lr(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=7,u=[{x:o,y:0},{x:0,y:s+l/2},{x:o-2*l,y:s+l/2},{x:0,y:2*s},{x:o,y:s-l/2},{x:2*l,y:s-l/2}],d=yt.svg(i),h=ur(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let f=li(u),p=d.path(f,h),m=i.insert(()=>p,":first-child");return m.attr("class","outer-path"),a&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(-${o/2},${-s})`),pr(t,m),t.intersect=function(g){return ye.info("lightningBolt intersect",t,g),sr.polygon(t,u,g)},i}async function bXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?24:i;if(t.width||t.height){let v=t.width??0;t.width=(t.width??0)-a,t.widthT,":first-child").attr("class","line"),g=s.insert(()=>w,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{let v=Oir(0,0,d,p,h,f,m);g=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Uo(y)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/2}, ${-(p/2+f)})`),pr(t,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(v){let b=sr.rect(t,v),x=b.x-(t.x??0);if(h!=0&&(Math.abs(x)<(t.width??0)/2||Math.abs(x)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let E=f*f*(1-x*x/(h*h));E>0&&(E=Math.sqrt(E)),E=f-E,v.y-(t.y??0)>0&&(E=-E),b.y+=E}return b},s}async function xXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;if(t.width||t.height){let E=t.width;t.width=(E??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10)}let{shapeSvg:s,bbox:l,label:u}=await Ur(e,t,Lr(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,h=(t?.height?t?.height:l.height)+(o??0)*2,f=t.look==="neo"?h/4:h/8,p=h+f,{cssStyles:m}=t,g=yt.svg(s),y=ur(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-d/2-d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:p/2},...T2(-d/2-d/2*.1,p/2,d/2+d/2*.1,p/2,f,.8),{x:d/2+d/2*.1,y:-p/2},{x:-d/2-d/2*.1,y:-p/2},{x:-d/2,y:-p/2},{x:-d/2,y:p/2*1.1},{x:-d/2,y:-p/2}],b=g.polygon(v.map(E=>[E.x,E.y]),y),x=s.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-d/2+(t.padding??0)+d/2*.1/2-(l.x-(l.left??0))},${-h/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),pr(t,x),t.intersect=function(E){return sr.polygon(t,v,E)},s}async function wXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,s=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:l,bbox:u,label:d}=await Ur(e,t,Lr(t)),h=(t?.width?t?.width:u.width)+a*2+2*s,f=(t?.height?t?.height:u.height)+o*2+2*s,p=h-2*s,m=f-2*s,g=-p/2,y=-m/2,{cssStyles:v}=t,b=yt.svg(l),x=ur(t,{}),E=[{x:g-s,y:y+s},{x:g-s,y:y+m+s},{x:g+p-s,y:y+m+s},{x:g+p-s,y:y+m},{x:g+p,y:y+m},{x:g+p,y:y+m-s},{x:g+p+s,y:y+m-s},{x:g+p+s,y:y-s},{x:g+s,y:y-s},{x:g+s,y},{x:g,y},{x:g,y:y+s}],w=[{x:g,y:y+s},{x:g+p-s,y:y+s},{x:g+p-s,y:y+m},{x:g+p,y:y+m},{x:g+p,y},{x:g,y}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let T=li(E),C=b.path(T,x),S=li(w),R=b.path(S,x);t.look!=="handDrawn"&&(C=Wue(C),R=Wue(R));let U=l.insert("g",":first-child");return U.insert(()=>C),U.insert(()=>R),U.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",v),n&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",n),d.attr("transform",`translate(${-(u.width/2)-s-(u.x-(u.left??0))}, ${-(u.height/2)+s-(u.y-(u.top??0))})`),pr(t,U),t.intersect=function(L){return sr.polygon(t,E,L)},l}async function EXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await Ur(e,t,Lr(t)),s=t.padding??0,l=t.look==="neo"?16:s,u=t.look==="neo"?12:s,d=!0;(t.width||t.height)&&(d=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-u*3);let h=Math.max(a.width,t?.width??0)+l*2,f=Math.max(a.height,t?.height??0)+u*3,p=t.look==="neo"?f/4:f/8,m=f+(d?p/2:-p/2),g=-h/2,y=-m/2,v=10,{cssStyles:b}=t,x=T2(g-v,y+m+v,g+h-v,y+m+v,p,.8),E=x?.[x.length-1],w=[{x:g-v,y:y+v},{x:g-v,y:y+m+v},...x,{x:g+h-v,y:E.y-v},{x:g+h,y:E.y-v},{x:g+h,y:E.y-2*v},{x:g+h+v,y:E.y-2*v},{x:g+h+v,y:y-v},{x:g+v,y:y-v},{x:g+v,y},{x:g,y},{x:g,y:y+v}],T=[{x:g,y:y+v},{x:g+h-v,y:y+v},{x:g+h-v,y:E.y-v},{x:g+h,y:E.y-v},{x:g+h,y},{x:g,y}],C=yt.svg(i),S=ur(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let R=li(w),U=C.path(R,S),L=li(T),I=C.path(L,S),A=i.insert(()=>U,":first-child");return A.insert(()=>I),A.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(0,${-p/2})`),o.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),pr(t,A),t.intersect=function(P){return sr.polygon(t,w,P)},i}async function TXe(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n,t.useHtmlLabels||As(Kt())||(t.centerLabel=!0);let{shapeSvg:o,bbox:s,label:l}=await Ur(e,t,Lr(t)),u=Math.max(s.width+(t.padding??0)*2,t?.width??0),d=Math.max(s.height+(t.padding??0)*2,t?.height??0),h=-u/2,f=-d/2,{cssStyles:p}=t,m=yt.svg(o),g=ur(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=m.rectangle(h,f,u,d,g),v=o.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),pr(t,v),t.intersect=function(b){return sr.rect(t,b)},o}async function kXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await Ur(e,t,Lr(t)),o=a.width+(t.padding??0),s=a.height+(t.padding??0),l=o+s,u=.5,d=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}],h,{cssStyles:f}=t;if(t.look==="handDrawn"){let p=yt.svg(i),m=ur(t,{}),g=zir(0,0,l),y=p.path(g,m);h=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&h.attr("style",f)}else h=og(i,l,l,d),h.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&h.attr("style",n),pr(t,h),t.calcIntersect=function(p,m){let g=p.width,y=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}],v=sr.polygon(p,y,m);return{x:v.x-.5,y:v.y-.5}},t.intersect=function(p){return this.calcIntersect(t,p)},i}async function CXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?21:i??0,o=t.look==="neo"?12:i??0,{shapeSvg:s,bbox:l,label:u}=await Ur(e,t,Lr(t)),d=l.width+(t.look==="neo"?a*2:a),h=Math.max(l.height+(t.look==="neo"?o*2:o),t.height??0),f=h/4,m=-Math.max(d,(t.width??0)-f)/2,g=-h/2,y=g/2,v=[{x:m+y,y:g},{x:m,y:0},{x:m+y,y:-g},{x:-m,y:-g},{x:-m,y:g}],{cssStyles:b}=t,x=yt.svg(s),E=ur(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let w=li(v),T=x.path(w,E),C=s.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-y/2},0)`),u.attr("transform",`translate(${-y/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),pr(t,C),t.intersect=function(S){return sr.polygon(t,v,S)},s}async function SXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i;t.cssClasses?i="node "+t.cssClasses:i="node default";let 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",n),l=t.description,u=t.label,d=await ag(s,u,t.labelStyle,!0,!0),h={width:0,height:0};if(As(je())){let S=d.children[0],R=xt(d);h=S.getBoundingClientRect(),R.attr("width",h.width),R.attr("height",h.height)}ye.info("Text 2",l);let f=l||[],p=d.getBBox(),m=await ag(s,Array.isArray(f)?f.join("
    "):f,t.labelStyle,!0,!0),g=m.children[0],y=xt(m);h=g.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height);let v=(t.padding||0)/2;xt(m).attr("transform","translate( "+(h.width>p.width?0:(p.width-h.width)/2)+", "+(p.height+v+5)+")"),xt(d).attr("transform","translate( "+(h.width(ye.debug("Rough node insert CXC",U),L),":first-child"),T=a.insert(()=>(ye.debug("Rough node insert CXC",U),U),":first-child")}else T=o.insert("rect",":first-child"),C=o.insert("line"),T.attr("class","outer title-state").attr("style",n).attr("x",-h.width/2-v).attr("y",-h.height/2-v).attr("width",h.width+(t.padding||0)).attr("height",h.height+(t.padding||0)),C.attr("class","divider").attr("x1",-h.width/2-v).attr("x2",h.width/2+v).attr("y1",-h.height/2-v+p.height+v).attr("y2",-h.height/2-v+p.height+v);return pr(t,T),t.intersect=function(S){return sr.rect(t,S)},a}async function AXe(e,t,{config:{themeVariables:r}}){let n=r?.radius??5,i={rx:n,ry:n,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Jk(e,t,i)}async function UXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:o,bbox:s,label:l}=await Ur(e,t,Lr(t)),u=(t?.width??s.width)+i*2+(t.look==="neo"?E4:E4*2),d=(t?.height??s.height)+a*2,h=u-E4,f=d,p=E4-u/2,m=-d/2,{cssStyles:g}=t,y=yt.svg(o),v=ur(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let b=[{x:p,y:m},{x:p+h,y:m},{x:p+h,y:m+f},{x:p-E4,y:m+f},{x:p-E4,y:m},{x:p,y:m},{x:p,y:m+f}],x=y.polygon(b.map(w=>[w.x,w.y]),v),E=o.insert(()=>x,":first-child");return E.attr("class","basic label-container outer-path").attr("style",Uo(g)),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),g&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),l.attr("transform",`translate(${E4/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),pr(t,E),t.intersect=function(w){return sr.rect(t,w)},o}async function IXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:l,label:u}=await Ur(e,t,Lr(t)),d=(t?.width?t?.width:l.width)+a*2,h=((t?.height?t?.height:l.height)+o*2)*1.5,f=d,p=h/1.5,m=-f/2,g=-p/2,{cssStyles:y}=t,v=yt.svg(s),b=ur(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let x=[{x:m,y:g},{x:m,y:g+p},{x:m+f,y:g+p},{x:m+f,y:g-p/2}],E=li(x),w=v.path(E,b),T=s.insert(()=>w,":first-child");return T.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",y),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),T.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-p/4+(t.padding??0)-(l.y-(l.top??0))})`),pr(t,T),t.intersect=function(C){return sr.polygon(t,x,C)},s}async function RXe(e,t){let r=t.padding??0,n=t.look==="neo"?16:r*2,i=t.look==="neo"?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??n,labelPaddingY:i};return Jk(e,t,a)}async function MXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?20:i,o=t.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=l.height+(t.look==="neo"?o*2:o),d=l.width+u/4+(t.look==="neo"?a*2:a),h=u/2,{cssStyles:f}=t,p=yt.svg(s),m=ur(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:-d/2+h,y:-u/2},{x:d/2-h,y:-u/2},...ig(-d/2+h,0,h,50,90,270),{x:d/2-h,y:u/2},...ig(d/2-h,0,h,50,270,450)],y=li(g),v=p.path(y,m),b=s.insert(()=>v,":first-child");return b.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),pr(t,b),t.intersect=function(x){return sr.polygon(t,g,x)},s}async function LXe(e,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return Jk(e,t,r)}function DXe(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:l,nodeShadow:u}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let d=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),h=yt.svg(d),f=ur(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=h.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??l,g=(t.width??0)*5/14,y=h.circle(0,0,g,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),v=d.insert(()=>p,":first-child");if(v.insert(()=>y),t.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),t.width<25&&u&&t.look!=="handDrawn"){let b=e.node()?.ownerSVGElement?.id??"",x=b?`${b}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${x})`)}return pr(t,v),t.intersect=function(b){return sr.circle(t,(t.width??0)/2,b)},d}function NXe(e,t,{config:{themeVariables:r}}){let{lineColor:n,nodeShadow:i}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),o;if(t.look==="handDrawn"){let l=yt.svg(a).circle(0,0,t.width,uqe(n));o=a.insert(()=>l),o.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else o=a.insert("circle",":first-child"),o.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&i&&t.look!=="handDrawn"){let s=e.node()?.ownerSVGElement?.id??"",l=s?`${s}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${l})`)}return pr(t,o),t.intersect=function(s){return sr.circle(t,(t.width??7)/2,s)},a}async function _Xe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t?.padding??8,a=t.look==="neo"?28:i,o=t.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=Math.max(l.width+2*Kk+a,t.width??0),d=Math.max(l.height+o,t.height??0),h=u-2*Kk,f=d,p=-u/2,m=-d/2,g=[{x:0,y:0},{x:h,y:0},{x:h,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:h+8,y:0},{x:h+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){let y=yt.svg(s),v=ur(t,{}),b=y.rectangle(p,m,h+16,f,v),x=y.line(p+Kk,m,p+Kk,m+f,v),E=y.line(p+Kk+h,m,p+Kk+h,m+f,v);s.insert(()=>x,":first-child"),s.insert(()=>E,":first-child");let w=s.insert(()=>b,":first-child"),{cssStyles:T}=t;w.attr("class","basic label-container").attr("style",Uo(T)),pr(t,w)}else{let y=og(s,h,f,g);n&&y.attr("style",n),pr(t,y)}return t.intersect=function(y){return sr.polygon(t,g,y)},s}async function PXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Gue*(t.height+o*2),10));let{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=(t?.height?t?.height:l.height)+o*2,d=Gue*u,h=Gue*u,p=(t?.width?t?.width:l.width)+a*2+d-d,m=u,g=-p/2,y=-m/2,{cssStyles:v}=t,b=yt.svg(s),x=ur(t,{}),E=[{x:g-d/2,y},{x:g+p+d/2,y},{x:g+p+d/2,y:y+m},{x:g-d/2,y:y+m}],w=[{x:g+p-d/2,y:y+m},{x:g+p+d/2,y:y+m},{x:g+p+d/2,y:y+m-h}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let T=li(E),C=b.path(T,x),S=li(w),R=b.path(S,{...x,fillStyle:"solid"}),U=s.insert(()=>R,":first-child");return U.insert(()=>C,":first-child"),U.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",v),n&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",n),pr(t,U),t.intersect=function(L){return sr.polygon(t,E,L)},s}async function OXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await Ur(e,t,Lr(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),u=l/8,d=.2*s,h=.2*l,f=l+u,{cssStyles:p}=t,m=yt.svg(i),g=ur(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-s/2-s/2*.1,y:f/2},...T2(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,u,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],v=-s/2+s/2*.1,b=-f/2-h*.4,x=[{x:v+s-d,y:(b+l)*1.3},{x:v+s,y:b+l-h},{x:v+s,y:(b+l)*.9},...T2(v+s,(b+l)*1.25,v+s-d,(b+l)*1.3,-l*.02,.5)],E=li(y),w=m.path(E,g),T=li(x),C=m.path(T,{...g,fillStyle:"solid"}),S=i.insert(()=>C,":first-child");return S.insert(()=>w,":first-child"),S.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-u/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-u/2-(a.y-(a.top??0))})`),pr(t,S),t.intersect=function(R){return sr.polygon(t,y,R)},i}async function BXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await Ur(e,t,Lr(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),l=-o/2,u=-s/2,d=i.insert("rect",":first-child");return d.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",o).attr("height",s),pr(t,d),t.intersect=function(h){return sr.rect(t,h)},i}async function FXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?12:i/2,o=t.height??0;if(t.height&&(t.height=t.height-a,t.heightE,":first-child"),g=s.insert(()=>x,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let y=Gir(0,0,p,d,f,h);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",Uo(m)).attr("style",n),g.attr("class","basic label-container outer-path"),m&&g.selectAll("path").attr("style",m),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",f),g.attr("transform",`translate(${-p/2}, ${d/2} )`),u.attr("transform",`translate(${-(l.width/2)-f-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),pr(t,g),t.intersect=function(y){let v=sr.rect(t,y),b=v.y-(t.y??0);if(h!=0&&(Math.abs(b)<(t.height??0)/2||Math.abs(b)==(t.height??0)/2&&Math.abs(v.x-(t.x??0))>(t.width??0)/2-f)){let x=f*f*(1-b*b/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=f-x,y.x-(t.x??0)>0&&(x=-x),v.x+=x}return v},s}async function zXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=(t.look==="neo",i),o=t.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),h=[{x:-3*u/6,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:0,y:-u}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=yt.svg(s),g=ur(t,{}),y=li(h),v=m.path(y,g);f=s.insert(()=>v,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`),p&&f.attr("style",p)}else f=og(s,d,u,h);return n&&f.attr("style",n),t.width=d,t.height=u,pr(t,f),t.intersect=function(m){return sr.polygon(t,h,m)},s}async function GXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,s=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),pr(t,x),t.intersect=function(E){return sr.polygon(t,y,E)},u}async function WXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?i*2:i;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.widthb,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),t.width=d,t.height=h,pr(t,x),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${h/2-(s.height+(t.padding??0)/(u?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(E){return ye.info("Triangle intersect",t,p,E),sr.polygon(t,p,E)},o}async function VXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:l,bbox:u,label:d}=await Ur(e,t,Lr(t)),h=(t?.width?t?.width:u.width)+(a??0)*2,f=(t?.height?t?.height:u.height)+(o??0)*2,p=t.look==="neo"?f/4:f/8,m=f+(s?p:-p),{cssStyles:g}=t,v=14-h,b=v>0?v/2:0,x=yt.svg(l),E=ur(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let w=[{x:-h/2-b,y:m/2},...T2(-h/2-b,m/2,h/2+b,m/2,p,.8),{x:h/2+b,y:-m/2},{x:-h/2-b,y:-m/2}],T=li(w),C=x.path(T,E),S=l.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-p/2})`),d.attr("transform",`translate(${-h/2+(t.padding??0)-(u.x-(u.left??0))},${-f/2+(t.padding??0)-p-(u.y-(u.top??0))})`),pr(t,S),t.intersect=function(R){return sr.polygon(t,w,R)},l}async function HXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let E=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-E*(20/9)),t.width=t.width-a*2}let{shapeSvg:s,bbox:l}=await Ur(e,t,Lr(t)),u=(t?.width?t?.width:l.width)+a*2,d=(t?.height?t?.height:l.height)+o,h=d/8,f=d+h*2,{cssStyles:p}=t,m=yt.svg(s),g=ur(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-u/2,y:f/2},...T2(-u/2,f/2,u/2,f/2,h,1),{x:u/2,y:-f/2},...T2(u/2,-f/2,-u/2,-f/2,h,-1)],v=li(y),b=m.path(v,g),x=s.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",n),pr(t,x),t.intersect=function(E){return sr.polygon(t,y,E)},s}async function qXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Wo,10),t.height=Math.max((t?.height??0)-a*2-Wo,10));let{shapeSvg:o,bbox:s,label:l}=await Ur(e,t,Lr(t)),u=(t?.width?t?.width:s.width)+i*2+Wo,d=(t?.height?t?.height:s.height)+a*2+Wo,h=u-Wo,f=d-Wo,p=-h/2,m=-f/2,{cssStyles:g}=t,y=yt.svg(o),v=ur(t,{}),b=[{x:p-Wo,y:m-Wo},{x:p-Wo,y:m+f},{x:p+h,y:m+f},{x:p+h,y:m-Wo}],x=`M${p-Wo},${m-Wo} L${p+h},${m-Wo} L${p+h},${m+f} L${p-Wo},${m+f} L${p-Wo},${m-Wo} - M${p-Wo},${m} L${p+h},${m} - M${p},${m-Wo} L${p},${m+f}`;t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let E=y.path(x,v),w=o.insert(()=>E,":first-child");return w.attr("transform",`translate(${Wo/2}, ${Wo/2})`),w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(s.width/2)+Wo/2-(s.x-(s.left??0))}, ${-(s.height/2)+Wo/2-(s.y-(s.top??0))})`),pr(t,w),t.intersect=function(T){return sr.polygon(t,b,T)},o}async function $ue(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:n,themeVariables:i}=Kt(),{rowEven:a,rowOdd:o,nodeBorder:s,borderColorArray:l}=i;if(t.look==="handDrawn"){let{themeVariables:re}=Kt(),{background:Q}=re,ge={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Q}`]};await $ue(e,ge)}let u=Kt();t.useHtmlLabels=u.htmlLabels;let d=u.er?.diagramPadding??10,h=u.er?.entityPadding??6,{cssStyles:f}=t,{labelStyles:p,nodeStyles:m}=or(t);if(r.attributes.length===0&&t.label){let re={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:""};zc(t.label,u)+re.labelPaddingX*20){let re=v.width+d*2-(w+T+C+S);w+=re/L,T+=re/L,C>0&&(C+=re/L),S>0&&(S+=re/L)}let A=w+T+C+S,P=yt.svg(y),D=ur(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let M=0;E.length>0&&(M=E.reduce((re,Q)=>re+(Q?.rowHeight??0),0));let O=Math.max(I.width+d*2,t?.width||0,A),_=Math.max((M??0)+v.height,t?.height||0),B=-O/2,F=-_/2;if(y.selectAll("g:not(:first-child)").each((re,Q,ge)=>{let ie=xt(ge[Q]),pe=ie.attr("transform"),ue=0,fe=0;if(pe){let Ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(pe);Ce&&(ue=parseFloat(Ce[1]),fe=parseFloat(Ce[2]),ie.attr("class").includes("attribute-name")?ue+=w:ie.attr("class").includes("attribute-keys")?ue+=w+T:ie.attr("class").includes("attribute-comment")&&(ue+=w+T+C))}ie.attr("transform",`translate(${B+d/2+ue}, ${fe+F+v.height+h/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(F+h/2)+")"),n!=null&&Aje.has(n)){let re=r.colorIndex??0;y.attr("data-color-id",`color-${re%l.length}`)}let G=P.rectangle(B,F,O,_,D),z=y.insert(()=>G,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(let[re,Q]of E.entries()){let ie=(re+1)%2===0&&Q.yOffset!==0,pe=P.rectangle(B,v.height+F+Q?.yOffset,O,Q?.rowHeight,{...D,fill:ie?a:o,stroke:s});y.insert(()=>pe,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ie?"even":"odd"}`)}let V=1e-4,$=Qk(B,v.height+F,O+B,v.height+F,V),Z=P.polygon($.map(re=>[re.x,re.y]),D);if(y.insert(()=>Z).attr("class","divider"),$=Qk(w+B,v.height+F,w+B,_+F,V),Z=P.polygon($.map(re=>[re.x,re.y]),D),y.insert(()=>Z).attr("class","divider"),R){let re=w+T+B;$=Qk(re,v.height+F,re,_+F,V),Z=P.polygon($.map(Q=>[Q.x,Q.y]),D),y.insert(()=>Z).attr("class","divider")}if(U){let re=w+T+C+B;$=Qk(re,v.height+F,re,_+F,V),Z=P.polygon($.map(Q=>[Q.x,Q.y]),D),y.insert(()=>Z).attr("class","divider")}for(let re of x){let Q=v.height+F+re;$=Qk(B,Q,O+B,Q,V),Z=P.polygon($.map(ge=>[ge.x,ge.y]),D),y.insert(()=>Z).attr("class","divider")}if(pr(t,z),m&&t.look!=="handDrawn")if(n!=null&&Hir.has(n))y.selectAll("path").attr("style",m);else{let Q=m.split(";")?.filter(ge=>ge.includes("stroke"))?.map(ge=>`${ge}`).join("; ");y.selectAll("path").attr("style",Q??""),y.selectAll(".row-rect-even path").attr("style",m)}return t.intersect=function(re){return sr.rect(t,re)},y}async function Zk(e,t,r,n=0,i=0,a=[],o=""){let s=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",o);t!==Hm(t)&&(t=Hm(t),t=t.replaceAll("<","<").replaceAll(">",">"));let l=s.node().appendChild(await Ll(s,t,{width:zc(t,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let d=l.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Th(r.htmlLabels)){let d=l.children[0];d.style.textAlign="start";let h=xt(l);u=d.getBoundingClientRect(),h.attr("width",u.width),h.attr("height",u.height)}return u}function Qk(e,t,r,n,i){return e===r?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}async function YXe(e,t,r,n,i=r.class.padding??12){let a=n?0:3,o=e.insert("g").attr("class",Lr(t)).attr("id",t.domId||t.id),s=null,l=null,u=null,d=null,h=0,f=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await rR(s,{text:`\xAB${b}\xBB`},0),h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await rR(l,t,0,["font-weight: bolder"]);let m=l.node().getBBox();f=m.height,u=o.insert("g").attr("class","members-group text");let g=0;for(let b of t.members){let x=await rR(u,b,g,[b.parseClassifier()]);g+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),d=o.insert("g").attr("class","methods-group text");let y=0;for(let b of t.methods){let x=await rR(d,b,y,[b.parseClassifier()]);y+=x+a}let v=o.node().getBBox();if(s!==null){let b=s.node().getBBox();s.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-m.width/2}, ${h})`),v=o.node().getBBox(),u.attr("transform",`translate(0, ${h+f+i*2})`),v=o.node().getBBox(),d.attr("transform",`translate(0, ${h+f+(p?p+i*4:i*2)})`),v=o.node().getBBox(),{shapeSvg:o,bbox:v}}async function rR(e,t,r,n=[]){let i=e.insert("g").attr("class","label").attr("style",n.join("; ")),a=Kt(),o="useHtmlLabels"in t?t.useHtmlLabels:Th(a.htmlLabels)??!0,s="";"text"in t?s=t.text:s=t.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),uo(s)&&(o=!0);let l=await Ll(i,bz(h0(s)),{width:zc(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a),u,d=1;if(o){let h=l.children[0],f=xt(l);d=h.innerHTML.split("
    ").length,h.innerHTML.includes("")&&(d+=h.innerHTML.split("").length-1),await que(h),u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&xt(l).selectAll("tspan").attr("font-weight",""),d=l.children.length;let h=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(h.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[1]===" "&&(h.textContent=h.textContent[0]+" "+h.textContent.substring(1))),h.textContent==="undefined"&&(h.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*d)+r)+")"),u.height}async function jXe(e,t){let r=je(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,s=t.useHtmlLabels??Th(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];let{shapeSvg:u,bbox:d}=await YXe(e,t,r,s,o),{labelStyles:h,nodeStyles:f}=or(t);t.labelStyle=h,t.cssStyles=l.styles||"";let p=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=p.replaceAll("!important","").split(";"));let m=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,g=yt.svg(u),y=ur(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=Math.max(t.width??0,d.width),b=Math.max(t.height??0,d.height),x=(t.height??0)>d.height;l.members.length===0&&l.methods.length===0?b+=o:l.members.length>0&&l.methods.length===0&&(b+=o*2);let E=-v/2,w=-b/2,T=m?a*2:l.members.length===0&&l.methods.length===0?-a:0;x&&(T=a*2);let C=g.rectangle(E-a,w-a-(m?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,b+2*a+T,y),S=u.insert(()=>C,":first-child");S.attr("class","basic label-container outer-path");let R=S.node().getBBox(),U=u.select(".annotation-group").node().getBBox().height-(m?a/2:0)||0,L=u.select(".label-group").node().getBBox().height-(m?a/2:0)||0,I=u.select(".members-group").node().getBBox().height-(m?a/2:0)||0,A=(U+L+w+a-(w-a-(m?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((P,D,M)=>{let O=xt(M[D]),_=O.attr("transform"),B=0;if(_){let V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(_);V&&(B=parseFloat(V[2]))}let F=B+w+a-(m?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(O.attr("class").includes("methods-group")){let z=Math.max(I,o/2);x?F=Math.max(A,U+L+z+w+o*2+a)+o*2:F=U+L+z+w+o*4+a}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?F=B-o:F=B),s||(F-=4);let G=E;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(G=-O.node()?.getBBox().width/2||0,u.selectAll("text").each(function(z,V,$){window.getComputedStyle($[V]).textAnchor==="middle"&&(G=0)})),O.attr("transform",`translate(${G}, ${F})`)}),l.members.length>0||l.methods.length>0||m){let P=U+L+w+a,D=g.line(R.x,P,R.x+R.width,P+.001,y);u.insert(()=>D).attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(m||l.members.length>0||l.methods.length>0){let P=U+L+I+w+o*2+a,D=g.line(R.x,x?Math.max(A,P):P,R.x+R.width,(x?Math.max(A,P):P)+.001,y);u.insert(()=>D).attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),S.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),t.labelStyle?u.selectAll("span").attr("style",t.labelStyle):u.selectAll("span").attr("style",p),!s){let P=RegExp(/color\s*:\s*([^;]*)/),D=P.exec(p);if(D){let M=D[0].replace("color","fill");u.selectAll("tspan").attr("style",M)}else if(h){let M=P.exec(h);if(M){let O=M[0].replace("color","fill");u.selectAll("tspan").attr("style",O)}}}return pr(t,S),t.intersect=function(P){return sr.rect(t,P)},u}async function XXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let i=t,a=t,o=20,s=20,l="verifyMethod"in t,u=Lr(t),d=je(),{themeVariables:h}=d,{borderColorArray:f,requirementEdgeLabelBackground:p}=h,m=d.layout==="elk"?"start":"center",g=e.insert("g").attr("class",u).attr("id",t.domId??t.id),y;l?y=await ng(g,`<<${i.type}>>`,0,t.labelStyle):y=await ng(g,"<<Element>>",0,t.labelStyle);let v=y,b=await ng(g,i.name,v,t.labelStyle+"; font-weight: bold;");if(v+=b+s,l){let L=await ng(g,`${i.requirementId?`ID: ${i.requirementId}`:""}`,v,t.labelStyle,m);v+=L;let I=await ng(g,`${i.text?`Text: ${i.text}`:""}`,v,t.labelStyle,m);v+=I;let A=await ng(g,`${i.risk?`Risk: ${i.risk}`:""}`,v,t.labelStyle,m);v+=A,await ng(g,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,v,t.labelStyle,m)}else{let L=await ng(g,`${a.type?`Type: ${a.type}`:""}`,v,t.labelStyle,m);v+=L,await ng(g,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,v,t.labelStyle,m)}let x=(g.node()?.getBBox().width??200)+o,E=(g.node()?.getBBox().height??200)+o,w=-x/2,T=-E/2,C=yt.svg(g),S=ur(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let R=C.rectangle(w,T,x,E,S),U=g.insert(()=>R,":first-child");if(U.attr("class","basic label-container outer-path").attr("style",n),f?.length){let L=t.colorIndex??0;g.attr("data-color-id",`color-${L%f.length}`)}if(g.selectAll(".label").each((L,I,A)=>{let P=xt(A[I]),D=P.attr("transform"),M=0,O=0;if(D){let G=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);G&&(M=parseFloat(G[1]),O=parseFloat(G[2]))}let _=O-E/2,B=w+o/2;(I===0||I===1)&&(B=M),P.attr("transform",`translate(${B}, ${_+o})`)}),v>y+b+s){let L=T+y+b+s,I;if(t.look==="neo"){let D=[[w,L],[w+x,L],[w+x,L+.001],[w,L+.001]];I=C.polygon(D,S)}else I=C.line(w,L,w+x,L,S);g.insert(()=>I).attr("class","divider")}return pr(t,U),t.intersect=function(L){return sr.rect(t,L)},n&&t.look!=="handDrawn"&&(p||f?.length)&&g.selectAll("path").attr("style",n),g}async function ng(e,t,r,n="",i="center"){if(t==="")return 0;let a=e.insert("g").attr("class","label").attr("style",n),o=je(),s=o.htmlLabels??!0,l=await Ll(a,bz(h0(t)),{width:zc(t,o)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},o),u;if(s){let d=l.children[0],h=xt(l);i==="start"&&xt(d).style("text-align","left"),u=d.getBoundingClientRect(),h.attr("width",u.width),h.attr("height",u.height)}else{let d=l.children[0];for(let h of d.children)n&&h.setAttribute("style",n);if(i==="start"){d.setAttribute("text-anchor","start");for(let h of d.children)h.setAttribute("text-anchor","start")}u=l.getBBox(),u.height+=6}return a.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}async function $Xe(e,t,{config:r}){let{labelStyles:n,nodeStyles:i}=or(t);t.labelStyle=n||"";let a=10,o=t.width;t.width=(t.width??200)-10;let{shapeSvg:s,bbox:l,label:u}=await Ur(e,t,Lr(t)),d=t.padding||10,h="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(h=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",h).attr("target","_blank"));let p={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},m,g;f?{label:m,bbox:g}=await Oue(f,"ticket"in t&&t.ticket||"",p):{label:m,bbox:g}=await Oue(s,"ticket"in t&&t.ticket||"",p);let{label:y,bbox:v}=await Oue(s,"assigned"in t&&t.assigned||"",p);t.width=o;let b=10,x=t?.width||0,E=Math.max(g.height,v.height)/2,w=Math.max(l.height+b*2,t?.height||0)+E,T=-x/2,C=-w/2;u.attr("transform","translate("+(d-x/2)+", "+(-E-l.height/2)+")"),m.attr("transform","translate("+(d-x/2)+", "+(-E+l.height/2)+")"),y.attr("transform","translate("+(d+x/2-v.width-2*a)+", "+(-E+l.height/2)+")");let S,{rx:R,ry:U}=t,{cssStyles:L}=t;if(t.look==="handDrawn"){let I=yt.svg(s),A=ur(t,{}),P=R||U?I.path(Ih(T,C,x,w,R||0),A):I.rectangle(T,C,x,w,A);S=s.insert(()=>P,":first-child"),S.attr("class","basic label-container").attr("style",L||null)}else{S=s.insert("rect",":first-child"),S.attr("class","basic label-container __APA__").attr("style",i).attr("rx",R??5).attr("ry",U??5).attr("x",T).attr("y",C).attr("width",x).attr("height",w);let I="priority"in t&&t.priority;if(I){let A=s.append("line"),P=T+2,D=C+Math.floor((R??0)/2),M=C+w-Math.floor((R??0)/2);A.attr("x1",P).attr("y1",D).attr("x2",P).attr("y2",M).attr("stroke-width","4").attr("stroke",qir(I))}}return pr(t,S),t.height=w,t.intersect=function(I){return sr.rect(t,I)},s}async function KXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await Ur(e,t,Lr(t)),l=a.width+10*o,u=a.height+8*o,d=.15*l,{cssStyles:h}=t,f=a.width+20,p=a.height+20,m=Math.max(l,f),g=Math.max(u,p);s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y,v=`M0 0 - a${d},${d} 1 0,0 ${m*.25},${-1*g*.1} - a${d},${d} 1 0,0 ${m*.25},0 - a${d},${d} 1 0,0 ${m*.25},0 - a${d},${d} 1 0,0 ${m*.25},${g*.1} - - a${d},${d} 1 0,0 ${m*.15},${g*.33} - a${d*.8},${d*.8} 1 0,0 0,${g*.34} - a${d},${d} 1 0,0 ${-1*m*.15},${g*.33} - - a${d},${d} 1 0,0 ${-1*m*.25},${g*.15} - a${d},${d} 1 0,0 ${-1*m*.25},0 - a${d},${d} 1 0,0 ${-1*m*.25},0 - a${d},${d} 1 0,0 ${-1*m*.25},${-1*g*.15} - - a${d},${d} 1 0,0 ${-1*m*.1},${-1*g*.33} - a${d*.8},${d*.8} 1 0,0 0,${-1*g*.34} - a${d},${d} 1 0,0 ${m*.1},${-1*g*.33} - H0 V0 Z`;if(t.look==="handDrawn"){let b=yt.svg(i),x=ur(t,{}),E=b.path(v,x);y=i.insert(()=>E,":first-child"),y.attr("class","basic label-container").attr("style",Uo(h))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-m/2}, ${-g/2})`),pr(t,y),t.calcIntersect=function(b,x){return sr.rect(b,x)},t.intersect=function(b){return ye.info("Bang intersect",t,b),sr.rect(t,b)},i}async function ZXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await Ur(e,t,Lr(t)),l=a.width+2*o,u=a.height+2*o,d=.15*l,h=.25*l,f=.35*l,p=.2*l,{cssStyles:m}=t,g,y=`M0 0 - a${d},${d} 0 0,1 ${l*.25},${-1*l*.1} - a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} - a${h},${h} 1 0,1 ${l*.35},${l*.2} - - a${d},${d} 1 0,1 ${l*.15},${u*.35} - a${p},${p} 1 0,1 ${-1*l*.15},${u*.65} - - a${h},${d} 1 0,1 ${-1*l*.25},${l*.15} - a${f},${f} 1 0,1 ${-1*l*.5},0 - a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15} - - a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35} - a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(t.look==="handDrawn"){let v=yt.svg(i),b=ur(t,{}),x=v.path(y,b);g=i.insert(()=>x,":first-child"),g.attr("class","basic label-container").attr("style",Uo(m))}else g=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),g.attr("transform",`translate(${-l/2}, ${-u/2})`),pr(t,g),t.calcIntersect=function(v,b){return sr.rect(v,b)},t.intersect=function(v){return ye.info("Cloud intersect",t,v),sr.rect(t,v)},i}async function QXe(e,t){let{labelStyles:r,nodeStyles:n}=or(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await Ur(e,t,Lr(t)),l=a.width+8*o,u=a.height+2*o,d=5,h=t.look==="neo"?` - M${-l/2} ${u/2-d} - v${-u+2*d} - q0,-${d} ${d},-${d} - h${l-2*d} - q${d},0 ${d},${d} - v${u-d} - H${-l/2} - Z - `:` - M${-l/2} ${u/2-d} - v${-u+2*d} - q0,-${d} ${d},-${d} - h${l-2*d} - q${d},0 ${d},${d} - v${u-2*d} - q0,${d} ${-d},${d} - h${-(l-2*d)} - q${-d},0 ${-d},${-d} - Z - `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let f=i.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",h);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),pr(t,f),t.calcIntersect=function(p,m){return sr.rect(p,m)},t.intersect=function(p){return sr.rect(t,p)},i}async function JXe(e,t){let r={padding:t.padding??0};return Xue(e,t,r)}function Kue(e){return e in nR}var vir,bir,mje,xir,wir,Ur,Oue,pr,Lr,Eir,k2,Ih,Tir,ag,kir,Rje,Cir,Sir,Air,sr,Bue,Fue,Uir,zue,Iir,jue,Rir,Mir,gje,Lir,IW,Dir,Nir,_ir,yje,vje,bje,xje,Pir,Oir,Bir,Fir,wje,Eje,zir,E4,Kk,Gue,Gir,Wir,Vir,Tje,kje,Cje,Sje,Wo,Aje,Hir,qir,Yir,jir,nR,Vo=H(()=>{Us();ds();us();Vn();Wr();Gr();xr();_n();_n();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();_n();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();mr();_n();_n();mr();_n();mr();_n();mr();mr();mr();vir=1,bir=3;k(que,"configureLabelImages");k(Yue,"hasTextBesidesImages");mje=3,xir=32,wir=k(async(e,t,r)=>{let n=je(),i=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=i.insert("g").attr("class","label").attr("style",Uo(t.labelStyle)),s=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(v=>({text:v,cssClass:"c4-descr"}))].filter(v=>v.text),l=t.width?Math.max(t.width-2*(t.padding??0),xir):je().flowchart?.wrappingWidth??200,d=n.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,h=await Promise.all(s.map(async v=>{let b=a.append("g").attr("class",v.cssClass),x=await Ll(b,rn(h0(v.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:d,style:t.labelStyle},n);return xt(x).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),xt(x).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),f=Math.max(...h.map(({box:v})=>v.width),0),p=0;for(let{el:v,box:b}of h)v.attr("transform",`translate(${f/2-b.x-b.width/2}, ${p-b.y})`),p+=b.height+mje;let m=h.length>0?p-mje:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-f/2}, ${-m/2})`);let g=a.node().getBBox(),y=(t.padding??0)/2;return{shapeSvg:i,bbox:g,halfPadding:y,label:a}},"c4LabelHelper"),Ur=k(async(e,t,r)=>{if(t.stereotype!==void 0)return wir(e,t,r);let n,i=t.useHtmlLabels||Th(je()?.htmlLabels);r?n=r:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",Uo(t.labelStyle)),s;t.label===void 0?s="":s=typeof t.label=="string"?t.label:t.label[0];let l=!!t.icon||!!t.img,u=t.labelType==="markdown",d=await Ll(o,rn(h0(s),je()),{useHtmlLabels:i,width:t.width||t.wrappingWidth||je().flowchart?.wrappingWidth,classes:u?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:u},je()),h=(t?.padding??0)/2,f;if(i){let p=d.children[0],m=xt(d);await que(p),f=await yy.measure(()=>p.getBoundingClientRect()),m.attr("width",f.width),m.attr("height",f.height)}else f=await yy.measure(()=>d.getBBox());return i?o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):o.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:f,halfPadding:h,label:o}},"labelHelper"),Oue=k(async(e,t,r)=>{let n=r.useHtmlLabels??As(je()),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Ll(i,rn(h0(t),je()),{useHtmlLabels:n,width:r.width||je()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),o=r.padding/2,s;if(As(je())){let l=a.children[0],u=xt(a);s=await yy.measure(()=>l.getBoundingClientRect()),u.attr("width",s.width),u.attr("height",s.height)}else s=await yy.measure(()=>a.getBBox());return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:o,label:i}},"insertLabel"),pr=k((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}let n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),Lr=k((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");k(li,"createPathFromPoints");k(T2,"generateFullSineWavePoints");k(ig,"generateCirclePoints");k(Wue,"mergePaths");Eir=k((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,s=e.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:r+l,y:n+u}},"intersectRect"),k2=Eir,Ih=k((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD"),Tir=k(async(e,t,r,n=!1,i=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let o=je(),s=As(o);return await Ll(e,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),ag=Tir;k(Uje,"intersectNode");kir=Uje;k(Ije,"intersectEllipse");Rje=Ije;k(Mje,"intersectCircle");Cir=Mje;k(Lje,"intersectLine");k(Vue,"sameSign");Sir=Lje;k(Dje,"intersectPolygon");Air=Dje,sr={node:kir,circle:Cir,ellipse:Rje,polygon:Air,rect:k2};k(Nje,"anchor");k(Hue,"generateArcPoints");k(_je,"calculateArcSagitta");k(Pje,"bowTieRect");k(Oje,"bucket");Bue=20,Fue=8,Uir=80,zue=8;k(Bje,"collapsedGroup");k(og,"insertPolygonShape");Iir=["right","left","up","down"],jue="point",Rir=k(e=>{let t=new Set;for(let r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),Mir=k(e=>Iir.filter(t=>e.has(t)).join("|")||jue,"getDirectionKey"),gje={"right|left|up|down":k(({height:e,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-e/3},{x:n+2*r,y:-e/2},{x:n,y:-2*e/3},{x:n,y:-e},{x:n-t,y:-e},{x:n/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":k(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":k(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":k(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":k(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":k(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":k(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":k(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":k(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":k(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":k(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:k(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:k(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:k(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r}],"up"),down:k(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[jue]:()=>[{x:0,y:0}]},Lir=k((e,t,r,n)=>{let i=Rir(e),a=(r.padding??0)/2,o=t.height+4*a,s=o/2,l=n??t.width+2*s+2*a,u=Mir(i);return(gje[u]??gje[jue])({height:o,midpoint:s,padding:a,width:l})},"getArrowPoints");k(Fje,"block_arrow");k(zje,"browser");IW=12;k(Gje,"card");k(Wje,"choice");k(Xue,"circle");k(Vje,"composite");k(Hje,"consoleWindow");k(qje,"createLine");k(Yje,"crossedCircle");k(vy,"generateCirclePoints");k(jje,"curlyBraceLeft");k(by,"generateCirclePoints");k(Xje,"curlyBraceRight");k(sc,"generateCirclePoints");k($je,"curlyBraces");k(Kje,"curvedTrapezoid");k(Zje,"person");Dir=k((e,t,r,n,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),Nir=k((e,t,r,n,i,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),_ir=k((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),yje=8,vje=8;k(Qje,"cylinder");k(Jk,"drawRect");k(Jje,"datastore");k(eXe,"dividedRectangle");k(tXe,"doublecircle");k(rXe,"filledCircle");bje=10,xje=10;k(nXe,"flippedTriangle");k(iXe,"folder");k(aXe,"forkJoin");k(oXe,"halfRoundedRectangle");Pir=k((e,t,r,n,i)=>[`M${e+i},${t}`,`L${e+r-i},${t}`,`L${e+r},${t-n/2}`,`L${e+r-i},${t-n}`,`L${e+i},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" "),"createHexagonPathD");k(sXe,"hexagon");k(lXe,"hourglass");k(cXe,"icon");k(uXe,"iconCircle");k(dXe,"iconRounded");k(hXe,"iconSquare");k(fXe,"imageSquare");k(pXe,"inv_trapezoid");k(mXe,"labelRect");k(gXe,"lean_left");k(yXe,"lean_right");k(vXe,"lightningBolt");Oir=k((e,t,r,n,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Bir=k((e,t,r,n,i,a,o)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Fir=k((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wje=10,Eje=10;k(bXe,"linedCylinder");k(xXe,"linedWaveEdgedRect");k(wXe,"multiRect");k(EXe,"multiWaveEdgedRectangle");k(TXe,"note");zir=k((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");k(kXe,"question");k(CXe,"rect_left_inv_arrow");k(SXe,"rectWithTitle");k(AXe,"roundedRect");E4=8;k(UXe,"shadedProcess");k(IXe,"slopedRect");k(RXe,"squareRect");k(MXe,"stadium");k(LXe,"state");k(DXe,"stateEnd");k(NXe,"stateStart");Kk=8;k(_Xe,"subroutine");Gue=.2;k(PXe,"taggedRect");k(OXe,"taggedWaveEdgedRectangle");k(BXe,"text");Gir=k((e,t,r,n,i,a)=>`M${e},${t} - a${i},${a} 0,0,1 0,${-n} - l${r},0 - a${i},${a} 0,0,1 0,${n} - M${r},${-n} - a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),Wir=k((e,t,r,n,i,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Vir=k((e,t,r,n,i,a)=>[`M${e+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Tje=5,kje=10;k(FXe,"tiltedCylinder");k(zXe,"trapezoid");k(GXe,"trapezoidalPentagon");Cje=10,Sje=10;k(WXe,"triangle");k(VXe,"waveEdgedRectangle");k(HXe,"waveRectangle");Wo=10;k(qXe,"windowPane");Aje=new Set(["redux-color","redux-dark-color"]),Hir=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);k($ue,"erBox");k(Zk,"addText");k(Qk,"lineToPolygon");k(YXe,"textHelper");k(rR,"addText");k(jXe,"classBox");k(XXe,"requirementBox");k(ng,"addText");qir=k(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");k($Xe,"kanbanItem");k(KXe,"bang");k(ZXe,"cloud");k(QXe,"defaultMindmapNode");k(JXe,"mindmapCircle");Yir=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:RXe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:AXe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:MXe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:_Xe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Qje},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Jje},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:iXe},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Oje},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Hje},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:zje},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Zje},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Xue},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:KXe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:ZXe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:kXe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:sXe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:yXe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:gXe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:zXe},{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:pXe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:tXe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:BXe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Gje},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:UXe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:NXe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:DXe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:aXe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:lXe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:jje},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Xje},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:$je},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:vXe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:VXe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:oXe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:FXe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:bXe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Kje},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:eXe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:WXe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:qXe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:rXe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:GXe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:nXe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:IXe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:EXe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:wXe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Pje},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Yje},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:OXe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:PXe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:HXe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:CXe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:xXe}],jir=k(()=>{let t=[...Object.entries({state:LXe,choice:Wje,note:TXe,composite:Vje,rectWithTitle:SXe,labelRect:mXe,block_arrow:Fje,collapsedGroup:Bje,iconSquare:hXe,iconCircle:uXe,icon:cXe,iconRounded:dXe,imageSquare:fXe,anchor:Nje,kanbanItem:$Xe,mindmapCircle:JXe,defaultMindmapNode:QXe,classBox:jXe,erBox:$ue,requirementBox:XXe}),...Yir.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),nR=jir();k(Kue,"isValidShape")});async function sg(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?nR[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",Uo(t.look)),t.tooltip&&i.attr("title",t.tooltip),RW.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var xy,RW,e$e,t$e,lg,nl=H(()=>{Vo();Vn();Gr();xr();xy=k(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),RW=new Map;k(sg,"insertNode");e$e=k((e,t)=>{RW.set(t.id,e)},"setNodeElem"),t$e=k(()=>{RW.clear()},"clear"),lg=k(e=>{let t=RW.get(e.id);ye.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var Xir,r$e,$ir,Kir,Zir,Qir,Jir,ear,n$e,C2,i$e,Gc=H(()=>{nl();Vo();Us();ds();Wr();Gr();xr();_n();mr();_n();mr();Xir=k(async(e,t)=>{let r=je(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,s=o,{labelStyles:l,nodeStyles:u,borderStyles:d,backgroundStyles:h}=or(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),p=Th(r.flowchart.htmlLabels),m=t.direction==="LR",g=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Ll(g,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),v=y.getBBox();if(p){let A=y.children[0],P=xt(y);v=A.getBoundingClientRect(),P.attr("width",v.width),P.attr("height",v.height)}let b=t.padding??0,x=t.width<=v.width+b?v.width+b:t.width;t.width<=v.width+b?t.diff=(x-t.width)/2-b:t.diff=-b;let E=t.height,w=t.y-E/2,T=t.y+E/2,C=t.x-x/2,S=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:w+E/3,R=m?4:0,U=v.height+2*R,L,I;if(m){let A=Math.max(U,v.height+2*R),P=C+A,D=Math.max(0,x-A);if(t.look==="handDrawn"){let _=yt.svg(f),B=ur(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),F=ur(t,{roughness:.7,fill:"none",stroke:s,seed:i}),G=_.rectangle(C,w,A,E,B);L=f.insert(()=>G,":first-child");let z=_.rectangle(P,w,D,E,F);I=f.insert(()=>z,":first-child"),L.select("path:nth-child(2)").attr("style",d.join(";")),L.select("path").attr("style",h.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",C).attr("y",w).attr("width",A).attr("height",E).attr("fill",a).attr("stroke",s),I.attr("class","swimlane-body").attr("style",u).attr("x",P).attr("y",w).attr("width",D).attr("height",E).attr("fill","none").attr("stroke",s);let M=C+A/2,O=t.y;g.attr("transform",`translate(${M}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{let A=Math.max(0,S-w),P=Math.min(U,A),D=w+P,M=Math.max(0,T-D),O=t.x-x/2;if(t.look==="handDrawn"){let F=yt.svg(f),G=ur(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),z=ur(t,{roughness:.7,fill:"none",stroke:s,seed:i}),V=F.rectangle(O,w,x,P,G);L=f.insert(()=>V,":first-child");let $=F.rectangle(O,D,x,M,z);I=f.insert(()=>$,":first-child"),L.select("path:nth-child(2)").attr("style",d.join(";")),L.select("path").attr("style",h.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",w).attr("width",x).attr("height",P).attr("fill",a).attr("stroke",s),I.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",D).attr("width",x).attr("height",M).attr("fill","none").attr("stroke",s);let _=t.x-v.width/2,B=w+(P-v.height)/2;g.attr("transform",`translate(${_}, ${B})`)}if(ye.trace("Swimlane data ",t,JSON.stringify(t)),l){let A=g.select("span");A&&A.attr("style",l)}return t.offsetX=0,t.width=x,t.height=E,t.offsetY=v.height-b/2,t.intersect=function(A){return k2(t,A)},{cluster:f,labelBBox:v}},"swimlane"),r$e=k(async(e,t)=>{ye.info("Creating subgraph rect for ",t.id,t);let r=je(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=or(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=As(r),p=h.insert("g").attr("class","cluster-label "),m;t.labelType==="markdown"?m=await Ll(p,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):m=await ag(p,t.label,t.labelStyle||"",!1,!0);let g=m.getBBox();if(As(r)){let C=m.children[0],S=xt(m);g=C.getBoundingClientRect(),S.attr("width",g.width),S.attr("height",g.height)}let y=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;let v=t.height,b=t.x-y/2,x=t.y-v/2;ye.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){let C=yt.svg(h),S=ur(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),R=C.path(Ih(b,x,y,v,0),S);E=h.insert(()=>(ye.debug("Rough node insert CXC",R),R),":first-child"),E.select("path:nth-child(2)").attr("style",u.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=h.insert("rect",":first-child"),E.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",x).attr("width",y).attr("height",v);let{subGraphTitleTopMargin:w}=xy(r);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){let C=p.select("span");C&&C.attr("style",s)}let T=E.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=g.height-t.padding/2,t.intersect=function(C){return k2(t,C)},{cluster:h,labelBBox:g}},"rect"),$ir=k((e,t)=>{let r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),n=r.insert("rect",":first-child"),i=0*t.padding,a=i/2;n.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");let o=n.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(s){return k2(t,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Kir=k(async(e,t)=>{let r=je(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:l}=n,u=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),d=u.insert("g",":first-child"),h=u.insert("g").attr("class","cluster-label"),f=u.append("rect"),p=await ag(h,t.label,t.labelStyle,void 0,!0),m=p.getBBox();if(As(r)){let R=p.children[0],U=xt(p);m=R.getBoundingClientRect(),U.attr("width",m.width),U.attr("height",m.height)}let g=0*t.padding,y=g/2,v=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+g;t.width<=m.width+t.padding?t.diff=(v-t.width)/2-t.padding:t.diff=-t.padding;let b=t.height+g,x=t.height+g-m.height-6,E=t.x-v/2,w=t.y-b/2;t.width=v;let T=t.y-t.height/2-y+m.height+2,C;if(t.look==="handDrawn"){let R=t.cssClasses.includes("statediagram-cluster-alt"),U=yt.svg(u),L=t.rx||t.ry?U.path(Ih(E,w,v,b,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):U.rectangle(E,w,v,b,{seed:i});C=u.insert(()=>L,":first-child");let I=U.rectangle(E,T,v,x,{fill:R?a:o,fillStyle:R?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>L,":first-child"),f=u.insert(()=>I)}else C=d.insert("rect",":first-child"),C.attr("class","outer").attr("x",E).attr("y",w).attr("width",v).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",E).attr("y",T).attr("width",v).attr("height",x);h.attr("transform",`translate(${t.x-m.width/2}, ${w+1-(As(r)?0:3)})`);let S=C.node().getBBox();return t.height=S.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(R){return k2(t,R)},{cluster:u,labelBBox:m}},"roundedWithTitle"),Zir=k(async(e,t)=>{ye.info("Creating subgraph rect for ",t.id,t);let r=je(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=or(t),h=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=As(r),p=h.insert("g").attr("class","cluster-label "),m=await Ll(p,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}),g=m.getBBox();if(As(r)){let C=m.children[0],S=xt(m);g=C.getBoundingClientRect(),S.attr("width",g.width),S.attr("height",g.height)}let y=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;let v=t.height,b=t.x-y/2,x=t.y-v/2;ye.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){let C=yt.svg(h),S=ur(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),R=C.path(Ih(b,x,y,v,t.rx),S);E=h.insert(()=>(ye.debug("Rough node insert CXC",R),R),":first-child"),E.select("path:nth-child(2)").attr("style",u.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=h.insert("rect",":first-child"),E.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",x).attr("width",y).attr("height",v);let{subGraphTitleTopMargin:w}=xy(r);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),s){let C=p.select("span");C&&C.attr("style",s)}let T=E.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=g.height-t.padding/2,t.intersect=function(C){return k2(t,C)},{cluster:h,labelBBox:g}},"kanbanSection"),Qir=k((e,t)=>{let r=je(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),s=o.insert("g",":first-child"),l=0*t.padding,u=t.width+l;t.diff=-t.padding;let d=t.height+l,h=t.x-u/2,f=t.y-d/2;t.width=u;let p;if(t.look==="handDrawn"){let y=yt.svg(o).rectangle(h,f,u,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=o.insert(()=>y,":first-child")}else{p=s.insert("rect",":first-child");let g="outer";t.look,g="divider",p.attr("class",g).attr("x",h).attr("y",f).attr("width",u).attr("height",d).attr("data-look",t.look)}let m=p.node().getBBox();return t.height=m.height,t.offsetX=0,t.offsetY=0,t.intersect=function(g){return k2(t,g)},{cluster:o,labelBBox:{}}},"divider"),Jir=r$e,ear={rect:r$e,squareRect:Jir,roundedWithTitle:Kir,noteGroup:$ir,divider:Qir,kanbanSection:Zir,swimlane:Xir},n$e=new Map,C2=k(async(e,t)=>{let r=t.shape||"rect",n=await ear[r](e,t);return n$e.set(t.id,n),n},"insertCluster"),i$e=k(()=>{n$e=new Map},"clear")});function oR(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=fo(e),t=fo(t);let[r,n]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-r,s=a-n;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}function sR(e,t){As(je())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}function u$e(e){let t=[],r=[];for(let n=1;n5&&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),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}function d$e(e,t){if(e.length<2)return"";let r="",n=e.length,i=1e-5;for(let a=0;a({...i}));if(e.length>=2&&il[t.arrowTypeStart]){let i=il[t.arrowTypeStart],a=e[0],o=e[1],{angle:s}=Zue(a,o),l=i*Math.cos(s),u=i*Math.sin(s);r[0].x=a.x+l,r[0].y=a.y+u}let n=e.length;if(n>=2&&il[t.arrowTypeEnd]){let i=il[t.arrowTypeEnd],a=e[n-1],o=e[n-2],{angle:s}=Zue(o,a),l=i*Math.cos(s),u=i*Math.sin(s);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}var iR,il,a$e,fo,tar,rar,nar,iar,o$e,aar,T4,Ho,c$e,Que,aR,cg,eC,oar,sar,lar,s$e,l$e,car,uar,S2,dar,har,far,par,mar,gar,yar,bar,xar,war,Ear,Tar,kar,Car,Sar,Aar,Uar,Iar,Rar,Mar,Lar,Dar,Nar,_ar,tC,Wc=H(()=>{nl();Vo();Us();ds();Vn();Wr();Gr();xr();_n();mr();iR=k((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";let r=e.x??0,n=e.y??0;return"translate("+-(r+e.width/2)+", "+-(n+e.height/2)+")"},"computeLabelTransform"),il={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},a$e={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};k(oR,"calculateDeltaAndAngle");fo=k(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),tar=k(e=>({x:k(function(t,r,n){let i=0,a=fo(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(il,e.arrowTypeEnd)){let{angle:p,deltaX:m}=oR(n[n.length-1],n[n.length-2]);i=il[e.arrowTypeEnd]*Math.cos(p)*(m>=0?1:-1)}let o=Math.abs(fo(t).x-fo(n[n.length-1]).x),s=Math.abs(fo(t).y-fo(n[n.length-1]).y),l=Math.abs(fo(t).x-fo(n[0]).x),u=Math.abs(fo(t).y-fo(n[0]).y),d=il[e.arrowTypeStart],h=il[e.arrowTypeEnd],f=1;if(o0&&s0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(il,e.arrowTypeEnd)){let{angle:p,deltaY:m}=oR(n[n.length-1],n[n.length-2]);i=il[e.arrowTypeEnd]*Math.abs(Math.sin(p))*(m>=0?1:-1)}let o=Math.abs(fo(t).y-fo(n[n.length-1]).y),s=Math.abs(fo(t).x-fo(n[n.length-1]).x),l=Math.abs(fo(t).y-fo(n[0]).y),u=Math.abs(fo(t).x-fo(n[0]).x),d=il[e.arrowTypeStart],h=il[e.arrowTypeEnd],f=1;if(o0&&s0&&u{t.arrowTypeStart&&o$e(e,"start",t.arrowTypeStart,r,n,i,a,o),t.arrowTypeEnd&&o$e(e,"end",t.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),nar={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{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}},iar=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],o$e=k((e,t,r,n,i,a,o=!1,s)=>{if(!r||r==="none")return;let l=nar[r],u=l&&iar.includes(l.type);if(!l){ye.warn(`Unknown arrow type: ${r}`);return}let d=l.type,p=`${i}_${a}-${d}${t==="start"?"Start":"End"}${o&&u?"-margin":""}`;if(s&&s.trim()!==""){let m=s.replace(/[^\dA-Za-z]/g,"_"),g=`${p}_${m}`;if(!document.getElementById(g)){let y=document.getElementById(p);if(y){let v=y.cloneNode(!0);v.id=g,v.querySelectorAll("path, circle, line").forEach(x=>{x.setAttribute("stroke",s),l.fill&&x.setAttribute("fill",s)}),y.parentNode?.appendChild(v)}}e.attr(`marker-${t}`,`url(${n}#${g})`)}else e.attr(`marker-${t}`,`url(${n}#${p})`)},"addEdgeMarker"),aar=k(e=>typeof e=="string"?e:je()?.flowchart?.curve,"resolveEdgeCurveType"),T4=new Map,Ho=new Map,c$e=k(()=>{T4.clear(),Ho.clear()},"clear"),Que=k(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),aR=k(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),cg=k(async(e,t)=>{let r=je(),n=As(r),{labelStyles:i}=or(t);t.labelStyle=i;let a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",t.id),s=t.labelType==="markdown",u=await Ll(e,t.label,{style:aR(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:s,width:s?void 0:void 0},r);o.node().appendChild(u),ye.info("abc82",t,t.labelType);let d,h;if(n){let p=u.children[0],m=xt(u);d=await yy.measure(()=>p.getBoundingClientRect()),h=d,m.attr("width",d.width),m.attr("height",d.height)}else{let p=xt(u).select("text").node();await yy.measure(()=>{d=u.getBBox(),p&&typeof p.getBBox=="function"?h=p.getBBox():h=d})}o.attr("transform",iR(h,n)),T4.set(t.id,a),t.width=d.width,t.height=d.height;let f;if(t.startLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),g=await ag(m,t.startLabelLeft,aR(t.labelStyle)||"",!1,!1);f=g;let y=g.getBBox();if(n){let v=g.children[0],b=xt(g);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}m.attr("transform",iR(y,n)),Ho.get(t.id)||Ho.set(t.id,{}),Ho.get(t.id).startLeft=p,sR(f,t.startLabelLeft)}if(t.startLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),g=await ag(m,t.startLabelRight,aR(t.labelStyle)||"",!1,!1);f=g;let y=g.getBBox();if(n){let v=g.children[0],b=xt(g);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}m.attr("transform",iR(y,n)),Ho.get(t.id)||Ho.set(t.id,{}),Ho.get(t.id).startRight=p,sR(f,t.startLabelRight)}if(t.endLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),g=await ag(p,t.endLabelLeft,aR(t.labelStyle)||"",!1,!1);f=g;let y=g.getBBox();if(n){let v=g.children[0],b=xt(g);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}m.attr("transform",iR(y,n)),Ho.get(t.id)||Ho.set(t.id,{}),Ho.get(t.id).endLeft=p,sR(f,t.endLabelLeft)}if(t.endLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),g=await ag(p,t.endLabelRight,aR(t.labelStyle)||"",!1,!1);f=g;let y=g.getBBox();if(n){let v=g.children[0],b=xt(g);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}m.attr("transform",iR(y,n)),Ho.get(t.id)||Ho.set(t.id,{}),Ho.get(t.id).endRight=p,sR(f,t.endLabelRight)}return u},"insertEdgeLabel");k(sR,"setTerminalWidth");eC=k((e,t)=>{ye.debug("Moving label abc88 ",e.id,e.label,T4.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,n=je(),{subGraphTitleTotalMargin:i}=xy(n);if(e.label){let a=T4.get(e.id),o=e.x,s=e.y;if(r){let l=Nr.calcLabelPosition(r);ye.debug("Moving label "+e.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(e.startLabelLeft){let a=Ho.get(e.id).startLeft,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.startLabelRight){let a=Ho.get(e.id).startRight,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelLeft){let a=Ho.get(e.id).endLeft,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelRight){let a=Ho.get(e.id).endRight,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),oar=k((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;let[r,n]=t,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?t:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),sar=k((e,t)=>{let r=e.x,n=e.y,i=Math.abs(t.x-r),a=Math.abs(t.y-n),o=e.width/2,s=e.height/2;return i>=o||a>=s},"outsideNode"),lar=k((e,t,r)=>{ye.debug(`intersection calc abc89: - outsidePoint: ${JSON.stringify(t)} - insidePoint : ${JSON.stringify(r)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let n=e.x,i=e.y,a=Math.abs(n-r.x),o=e.width/2,s=r.xMath.abs(n-t.x)*l){let h=r.y{ye.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(ye.info("abc88 checking point",a,t),!sar(t,a)&&!i){let o=lar(t,n,a);ye.debug("abc88 inside",a,n,o),ye.debug("abc88 intersection",o,t);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?ye.warn("abc88 no intersect",o,r):r.push(o),i=!0}else ye.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ye.debug("returning points",r),r},"cutPathAtIntersect");k(u$e,"extractCornerPoints");l$e=k(function(e,t,r){let n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:t.x-o*n,y:t.y-o*i}},"findAdjacentPoint"),car=k(function(e){let{cornerPointPositions:t}=u$e(e),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ye.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let p=5;o.x===s.x?f={x:u<0?s.x-p+h:s.x+p-h,y:d<0?s.y-h:s.y+h}:f={x:u<0?s.x-h:s.x+h,y:d<0?s.y-p+h:s.y+p-h}}else ye.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(e[n]);return r},"fixCorners"),uar=k((e,t,r)=>{let n=e-t-r,i=2,a=2,o=i+a,s=Math.floor(n/o),l=Number.isFinite(s)?Math.max(0,s):0,u=Array(l).fill(`${i} ${a}`).join(" ");return`0 ${t} ${u} ${r}`},"generateDashArray"),S2=k(function(e,t,r,n,i,a,o,s=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:l,layout:u}=je(),d=t.points,h=!1,f=i;var p=a;let m=[];for(let _ in t.cssCompiledStyles)_I(_)||m.push(t.cssCompiledStyles[_]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2)d=[f.intersect(d[0]),p.intersect(d[1])];else{let _=d.slice(1,-1),B=_[0],F=_[_.length-1],G=.5,z=Math.abs(d[d.length-1].x-F.x)!Number.isNaN(_.y)),v=aar(t.curve);v!=="rounded"&&(y=car(y));let b=gy;switch(v){case"linear":b=gy;break;case"basis":b=b2;break;case"cardinal":b=CI;break;case"bumpX":b=xI;break;case"bumpY":b=wI;break;case"catmullRom":b=UI;break;case"monotoneX":b=II;break;case"monotoneY":b=RI;break;case"natural":b=MI;break;case"step":b=LI;break;case"stepAfter":b=NI;break;case"stepBefore":b=DI;break;case"rounded":b=gy;break;default:b=b2}let{x,y:E}=tar(t),w=v2().x(x).y(E).curve(b),T;switch(t.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(t.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let C,S=v==="rounded"?d$e(h$e(y,t),5):w(y),R=Array.isArray(t.style)?t.style:[t.style],U=R.find(_=>_?.startsWith("stroke:")),L="";t.animate&&(L="edge-animation-fast"),t.animation&&(L="edge-animation-"+t.animation);let I=!1;if(t.look==="handDrawn"){let _=yt.svg(e);Object.assign([],y);let B=_.path(S,{roughness:.3,seed:l});T+=" transition",C=xt(B).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(L?" "+L:"")).attr("style",R?R.reduce((G,z)=>G+";"+z,""):"");let F=C.attr("d");C.attr("d",F),e.node().appendChild(C.node())}else{let _=m.join(";"),B=R?R.reduce((Z,re)=>Z+re+";",""):"",F=(_?_+";"+B+";":B)+";"+(R?R.reduce((Z,re)=>Z+";"+re,""):"");C=e.append("path").attr("d",S).attr("id",`${o}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(L?" "+L:"")).attr("style",F),U=F.match(/stroke:([^;]+)/)?.[1],I=t.animate===!0||!!t.animation||_.includes("animation");let G=C.node(),z=typeof G.getTotalLength=="function"?G.getTotalLength():0,V=a$e[t.arrowTypeStart]||0,$=a$e[t.arrowTypeEnd]||0;if(t.look==="neo"&&!I){let re=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?uar(z,V,$):`0 ${V} ${z-V-$} ${$}`}; stroke-dashoffset: 0;`;C.attr("style",re+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",t.id),C.attr("data-points",g),C.attr("data-look",Uo(t.look)),t.showPoints&&y.forEach(_=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",_.x).attr("cy",_.y)});let A="";(je().flowchart.arrowMarkerAbsolute||je().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ye.info("arrowTypeStart",t.arrowTypeStart),ye.info("arrowTypeEnd",t.arrowTypeEnd);let P=!I&&t?.look==="neo";rar(C,t,A,o,n,P,U);let D=Math.floor(d.length/2),M=d[D];Nr.isLabelCoordinateInPath(M,C.attr("d"))||(h=!0);let O={};return h&&(O.updatedPath=d),O.originalPath=t.points,O},"insertEdge");k(d$e,"generateRoundedPath");k(Zue,"calculateDeltaAndAngle");k(h$e,"applyMarkerOffsetsToPoints");dar=k((e,t,r,n)=>{t.forEach(i=>{_ar[i](e,r,n)})},"insertMarkers"),har=k((e,t,r)=>{ye.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),far=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),par=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),mar=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),gar=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),yar=k((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),bar=k((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),xar=k((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),war=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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"),Ear=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{transitionColor:a}=i;e.append("defs").append("marker").attr("id",r+"_"+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 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),Tar=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),kar=k((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");let i=e.append("defs").append("marker").attr("id",r+"_"+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"),Car=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Sar=k((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let i=e.append("defs").append("marker").attr("id",r+"_"+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"),Aar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),Uar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");s.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),s.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);let l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",o??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),Iar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),Rar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");s.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),s.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);let l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",o??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),Mar=k((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 - L20,10 - M20,10 - L0,20`)},"requirement_arrow"),Lar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 - L20,10 - M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),Dar=k((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Nar=k((e,t,r)=>{let n=Kt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),_ar={extension:har,composition:far,aggregation:par,dependency:mar,lollipop:gar,point:yar,circle:bar,cross:xar,barb:war,barbNeo:Ear,only_one:Tar,zero_or_one:kar,one_or_more:Car,zero_or_more:Sar,only_one_neo:Aar,zero_or_one_neo:Uar,one_or_more_neo:Iar,zero_or_more_neo:Rar,requirement_arrow:Mar,requirement_contains:Dar,requirement_arrow_neo:Lar,requirement_contains_neo:Nar},tC=dar});var Par,MW,Jue=H(()=>{Par=typeof global=="object"&&global&&global.Object===Object&&global,MW=Par});var Oar,Bar,qo,Rf=H(()=>{Jue();Oar=typeof self=="object"&&self&&self.Object===Object&&self,Bar=MW||Oar||Function("return this")(),qo=Bar});var Far,Dl,k4=H(()=>{Rf();Far=qo.Symbol,Dl=Far});function War(e){var t=zar.call(e,lR),r=e[lR];try{e[lR]=void 0;var n=!0}catch{}var i=Gar.call(e);return n&&(t?e[lR]=r:delete e[lR]),i}var f$e,zar,Gar,lR,p$e,m$e=H(()=>{k4();f$e=Object.prototype,zar=f$e.hasOwnProperty,Gar=f$e.toString,lR=Dl?Dl.toStringTag:void 0;p$e=War});function qar(e){return Har.call(e)}var Var,Har,g$e,y$e=H(()=>{Var=Object.prototype,Har=Var.toString;g$e=qar});function Xar(e){return e==null?e===void 0?jar:Yar:v$e&&v$e in Object(e)?p$e(e):g$e(e)}var Yar,jar,v$e,Au,A2=H(()=>{k4();m$e();y$e();Yar="[object Null]",jar="[object Undefined]",v$e=Dl?Dl.toStringTag:void 0;Au=Xar});function $ar(e){return e!=null&&typeof e=="object"}var hs,m0=H(()=>{hs=$ar});function Zar(e){return typeof e=="symbol"||hs(e)&&Au(e)==Kar}var Kar,Rh,C4=H(()=>{A2();m0();Kar="[object Symbol]";Rh=Zar});function Qar(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r{ug=Qar});var Jar,Hn,Is=H(()=>{Jar=Array.isArray,Hn=Jar});function w$e(e){if(typeof e=="string")return e;if(Hn(e))return ug(e,w$e)+"";if(Rh(e))return x$e?x$e.call(e):"";var t=e+"";return t=="0"&&1/e==-eor?"-0":t}var eor,b$e,x$e,E$e,T$e=H(()=>{k4();cR();Is();C4();eor=1/0,b$e=Dl?Dl.prototype:void 0,x$e=b$e?b$e.toString:void 0;E$e=w$e});function ror(e){for(var t=e.length;t--&&tor.test(e.charAt(t)););return t}var tor,k$e,C$e=H(()=>{tor=/\s/;k$e=ror});function ior(e){return e&&e.slice(0,k$e(e)+1).replace(nor,"")}var nor,S$e,A$e=H(()=>{C$e();nor=/^\s+/;S$e=ior});function aor(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var po,Mf=H(()=>{po=aor});function uor(e){if(typeof e=="number")return e;if(Rh(e))return U$e;if(po(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=po(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=S$e(e);var r=sor.test(e);return r||lor.test(e)?cor(e.slice(2),r?2:8):oor.test(e)?U$e:+e}var U$e,oor,sor,lor,cor,I$e,R$e=H(()=>{A$e();Mf();C4();U$e=NaN,oor=/^[-+]0x[0-9a-f]+$/i,sor=/^0b[01]+$/i,lor=/^0o[0-7]+$/i,cor=parseInt;I$e=uor});function hor(e){if(!e)return e===0?e:0;if(e=I$e(e),e===M$e||e===-M$e){var t=e<0?-1:1;return t*dor}return e===e?e:0}var M$e,dor,rC,ede=H(()=>{R$e();M$e=1/0,dor=17976931348623157e292;rC=hor});function por(e){var t=rC(e),r=t%1;return t===t?r?t-r:t:0}var L$e,D$e=H(()=>{ede();L$e=por});function mor(e){return e}var Sd,U2=H(()=>{Sd=mor});function xor(e){if(!po(e))return!1;var t=Au(e);return t==yor||t==vor||t==gor||t==bor}var gor,yor,vor,bor,dg,uR=H(()=>{A2();Mf();gor="[object AsyncFunction]",yor="[object Function]",vor="[object GeneratorFunction]",bor="[object Proxy]";dg=xor});var wor,LW,N$e=H(()=>{Rf();wor=qo["__core-js_shared__"],LW=wor});function Eor(e){return!!_$e&&_$e in e}var _$e,P$e,O$e=H(()=>{N$e();_$e=(function(){var e=/[^.]+$/.exec(LW&&LW.keys&&LW.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();P$e=Eor});function Cor(e){if(e!=null){try{return kor.call(e)}catch{}try{return e+""}catch{}}return""}var Tor,kor,wy,tde=H(()=>{Tor=Function.prototype,kor=Tor.toString;wy=Cor});function Dor(e){if(!po(e)||P$e(e))return!1;var t=dg(e)?Lor:Aor;return t.test(wy(e))}var Sor,Aor,Uor,Ior,Ror,Mor,Lor,B$e,F$e=H(()=>{uR();O$e();Mf();tde();Sor=/[\\^$.*+?()[\]{}|]/g,Aor=/^\[object .+?Constructor\]$/,Uor=Function.prototype,Ior=Object.prototype,Ror=Uor.toString,Mor=Ior.hasOwnProperty,Lor=RegExp("^"+Ror.call(Mor).replace(Sor,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");B$e=Dor});function Nor(e,t){return e?.[t]}var z$e,G$e=H(()=>{z$e=Nor});function _or(e,t){var r=z$e(e,t);return B$e(r)?r:void 0}var Ad,I2=H(()=>{F$e();G$e();Ad=_or});var Por,DW,W$e=H(()=>{I2();Rf();Por=Ad(qo,"WeakMap"),DW=Por});var V$e,Oor,H$e,q$e=H(()=>{Mf();V$e=Object.create,Oor=(function(){function e(){}return function(t){if(!po(t))return{};if(V$e)return V$e(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),H$e=Oor});function Bor(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Y$e,j$e=H(()=>{Y$e=Bor});function For(){}var X$e,$$e=H(()=>{X$e=For});function zor(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{NW=zor});function Hor(e){var t=0,r=0;return function(){var n=Vor(),i=Wor-(n-r);if(r=n,i>0){if(++t>=Gor)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Gor,Wor,Vor,K$e,Z$e=H(()=>{Gor=800,Wor=16,Vor=Date.now;K$e=Hor});function qor(e){return function(){return e}}var Ud,nde=H(()=>{Ud=qor});var Yor,nC,ide=H(()=>{I2();Yor=(function(){try{var e=Ad(Object,"defineProperty");return e({},"",{}),e}catch{}})(),nC=Yor});var jor,Q$e,J$e=H(()=>{nde();ide();U2();jor=nC?function(e,t){return nC(e,"toString",{configurable:!0,enumerable:!1,value:Ud(t),writable:!0})}:Sd,Q$e=jor});var Xor,_W,ade=H(()=>{J$e();Z$e();Xor=K$e(Q$e),_W=Xor});function $or(e,t){for(var r=-1,n=e==null?0:e.length;++r{PW=$or});function Kor(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a{OW=Kor});function Zor(e){return e!==e}var eKe,tKe=H(()=>{eKe=Zor});function Qor(e,t,r){for(var n=r-1,i=e.length;++n{rKe=Qor});function Jor(e,t,r){return t===t?rKe(e,t,r):OW(e,eKe,r)}var iKe,aKe=H(()=>{sde();tKe();nKe();iKe=Jor});function esr(e,t){var r=e==null?0:e.length;return!!r&&iKe(e,t,0)>-1}var oKe,sKe=H(()=>{aKe();oKe=esr});function nsr(e,t){var r=typeof e;return t=t??tsr,!!t&&(r=="number"||r!="symbol"&&rsr.test(e))&&e>-1&&e%1==0&&e{tsr=9007199254740991,rsr=/^(?:0|[1-9]\d*)$/;R2=nsr});function isr(e,t,r){t=="__proto__"&&nC?nC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var M2,hR=H(()=>{ide();M2=isr});function asr(e,t){return e===t||e!==e&&t!==t}var Lf,S4=H(()=>{Lf=asr});function lsr(e,t,r){var n=e[t];(!(ssr.call(e,t)&&Lf(n,r))||r===void 0&&!(t in e))&&M2(e,t,r)}var osr,ssr,L2,fR=H(()=>{hR();S4();osr=Object.prototype,ssr=osr.hasOwnProperty;L2=lsr});function csr(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a{fR();hR();hg=csr});function usr(e,t,r){return t=lKe(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=lKe(n.length-t,0),o=Array(a);++i{j$e();lKe=Math.max;BW=usr});function dsr(e,t){return _W(BW(e,t,Sd),e+"")}var D2,pR=H(()=>{U2();lde();ade();D2=dsr});function fsr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hsr}var hsr,aC,FW=H(()=>{hsr=9007199254740991;aC=fsr});function psr(e){return e!=null&&aC(e.length)&&!dg(e)}var Nl,fg=H(()=>{uR();FW();Nl=psr});function msr(e,t,r){if(!po(r))return!1;var n=typeof t;return(n=="number"?Nl(r)&&R2(t,r.length):n=="string"&&t in r)?Lf(r[t],e):!1}var Ey,mR=H(()=>{S4();fg();dR();Mf();Ey=msr});function gsr(e){return D2(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&Ey(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n{pR();mR();cKe=gsr});function vsr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ysr;return e===r}var ysr,N2,gR=H(()=>{ysr=Object.prototype;N2=vsr});function bsr(e,t){for(var r=-1,n=Array(e);++r{dKe=bsr});function wsr(e){return hs(e)&&Au(e)==xsr}var xsr,cde,fKe=H(()=>{A2();m0();xsr="[object Arguments]";cde=wsr});var pKe,Esr,Tsr,ksr,g0,oC=H(()=>{fKe();m0();pKe=Object.prototype,Esr=pKe.hasOwnProperty,Tsr=pKe.propertyIsEnumerable,ksr=cde((function(){return arguments})())?cde:function(e){return hs(e)&&Esr.call(e,"callee")&&!Tsr.call(e,"callee")},g0=ksr});function Csr(){return!1}var mKe,gKe=H(()=>{mKe=Csr});var bKe,yKe,Ssr,vKe,Asr,Usr,y0,sC=H(()=>{Rf();gKe();bKe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yKe=bKe&&typeof module=="object"&&module&&!module.nodeType&&module,Ssr=yKe&&yKe.exports===bKe,vKe=Ssr?qo.Buffer:void 0,Asr=vKe?vKe.isBuffer:void 0,Usr=Asr||mKe,y0=Usr});function Jsr(e){return hs(e)&&aC(e.length)&&!!Va[Au(e)]}var Isr,Rsr,Msr,Lsr,Dsr,Nsr,_sr,Psr,Osr,Bsr,Fsr,zsr,Gsr,Wsr,Vsr,Hsr,qsr,Ysr,jsr,Xsr,$sr,Ksr,Zsr,Qsr,Va,xKe,wKe=H(()=>{A2();FW();m0();Isr="[object Arguments]",Rsr="[object Array]",Msr="[object Boolean]",Lsr="[object Date]",Dsr="[object Error]",Nsr="[object Function]",_sr="[object Map]",Psr="[object Number]",Osr="[object Object]",Bsr="[object RegExp]",Fsr="[object Set]",zsr="[object String]",Gsr="[object WeakMap]",Wsr="[object ArrayBuffer]",Vsr="[object DataView]",Hsr="[object Float32Array]",qsr="[object Float64Array]",Ysr="[object Int8Array]",jsr="[object Int16Array]",Xsr="[object Int32Array]",$sr="[object Uint8Array]",Ksr="[object Uint8ClampedArray]",Zsr="[object Uint16Array]",Qsr="[object Uint32Array]",Va={};Va[Hsr]=Va[qsr]=Va[Ysr]=Va[jsr]=Va[Xsr]=Va[$sr]=Va[Ksr]=Va[Zsr]=Va[Qsr]=!0;Va[Isr]=Va[Rsr]=Va[Wsr]=Va[Msr]=Va[Vsr]=Va[Lsr]=Va[Dsr]=Va[Nsr]=Va[_sr]=Va[Psr]=Va[Osr]=Va[Bsr]=Va[Fsr]=Va[zsr]=Va[Gsr]=!1;xKe=Jsr});function elr(e){return function(t){return e(t)}}var _2,yR=H(()=>{_2=elr});var EKe,vR,tlr,ude,rlr,Ty,zW=H(()=>{Jue();EKe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vR=EKe&&typeof module=="object"&&module&&!module.nodeType&&module,tlr=vR&&vR.exports===EKe,ude=tlr&&MW.process,rlr=(function(){try{var e=vR&&vR.require&&vR.require("util").types;return e||ude&&ude.binding&&ude.binding("util")}catch{}})(),Ty=rlr});var TKe,nlr,P2,bR=H(()=>{wKe();yR();zW();TKe=Ty&&Ty.isTypedArray,nlr=TKe?_2(TKe):xKe,P2=nlr});function olr(e,t){var r=Hn(e),n=!r&&g0(e),i=!r&&!n&&y0(e),a=!r&&!n&&!i&&P2(e),o=r||n||i||a,s=o?dKe(e.length,String):[],l=s.length;for(var u in e)(t||alr.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||R2(u,l)))&&s.push(u);return s}var ilr,alr,GW,dde=H(()=>{hKe();oC();Is();sC();dR();bR();ilr=Object.prototype,alr=ilr.hasOwnProperty;GW=olr});function slr(e,t){return function(r){return e(t(r))}}var WW,hde=H(()=>{WW=slr});var llr,kKe,CKe=H(()=>{hde();llr=WW(Object.keys,Object),kKe=llr});function dlr(e){if(!N2(e))return kKe(e);var t=[];for(var r in Object(e))ulr.call(e,r)&&r!="constructor"&&t.push(r);return t}var clr,ulr,lC,VW=H(()=>{gR();CKe();clr=Object.prototype,ulr=clr.hasOwnProperty;lC=dlr});function hlr(e){return Nl(e)?GW(e):lC(e)}var Yo,ky=H(()=>{dde();VW();fg();Yo=hlr});function flr(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var SKe,AKe=H(()=>{SKe=flr});function glr(e){if(!po(e))return SKe(e);var t=N2(e),r=[];for(var n in e)n=="constructor"&&(t||!mlr.call(e,n))||r.push(n);return r}var plr,mlr,UKe,IKe=H(()=>{Mf();gR();AKe();plr=Object.prototype,mlr=plr.hasOwnProperty;UKe=glr});function ylr(e){return Nl(e)?GW(e,!0):UKe(e)}var Id,O2=H(()=>{dde();IKe();fg();Id=ylr});function xlr(e,t){if(Hn(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Rh(e)?!0:blr.test(e)||!vlr.test(e)||t!=null&&e in Object(t)}var vlr,blr,cC,HW=H(()=>{Is();C4();vlr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,blr=/^\w*$/;cC=xlr});var wlr,Cy,xR=H(()=>{I2();wlr=Ad(Object,"create"),Cy=wlr});function Elr(){this.__data__=Cy?Cy(null):{},this.size=0}var RKe,MKe=H(()=>{xR();RKe=Elr});function Tlr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var LKe,DKe=H(()=>{LKe=Tlr});function Alr(e){var t=this.__data__;if(Cy){var r=t[e];return r===klr?void 0:r}return Slr.call(t,e)?t[e]:void 0}var klr,Clr,Slr,NKe,_Ke=H(()=>{xR();klr="__lodash_hash_undefined__",Clr=Object.prototype,Slr=Clr.hasOwnProperty;NKe=Alr});function Rlr(e){var t=this.__data__;return Cy?t[e]!==void 0:Ilr.call(t,e)}var Ulr,Ilr,PKe,OKe=H(()=>{xR();Ulr=Object.prototype,Ilr=Ulr.hasOwnProperty;PKe=Rlr});function Llr(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cy&&t===void 0?Mlr:t,this}var Mlr,BKe,FKe=H(()=>{xR();Mlr="__lodash_hash_undefined__";BKe=Llr});function uC(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t{MKe();DKe();_Ke();OKe();FKe();uC.prototype.clear=RKe;uC.prototype.delete=LKe;uC.prototype.get=NKe;uC.prototype.has=PKe;uC.prototype.set=BKe;fde=uC});function Dlr(){this.__data__=[],this.size=0}var GKe,WKe=H(()=>{GKe=Dlr});function Nlr(e,t){for(var r=e.length;r--;)if(Lf(e[r][0],t))return r;return-1}var B2,wR=H(()=>{S4();B2=Nlr});function Olr(e){var t=this.__data__,r=B2(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Plr.call(t,r,1),--this.size,!0}var _lr,Plr,VKe,HKe=H(()=>{wR();_lr=Array.prototype,Plr=_lr.splice;VKe=Olr});function Blr(e){var t=this.__data__,r=B2(t,e);return r<0?void 0:t[r][1]}var qKe,YKe=H(()=>{wR();qKe=Blr});function Flr(e){return B2(this.__data__,e)>-1}var jKe,XKe=H(()=>{wR();jKe=Flr});function zlr(e,t){var r=this.__data__,n=B2(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var $Ke,KKe=H(()=>{wR();$Ke=zlr});function dC(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t{WKe();HKe();YKe();XKe();KKe();dC.prototype.clear=GKe;dC.prototype.delete=VKe;dC.prototype.get=qKe;dC.prototype.has=jKe;dC.prototype.set=$Ke;F2=dC});var Glr,z2,qW=H(()=>{I2();Rf();Glr=Ad(qo,"Map"),z2=Glr});function Wlr(){this.size=0,this.__data__={hash:new fde,map:new(z2||F2),string:new fde}}var ZKe,QKe=H(()=>{zKe();ER();qW();ZKe=Wlr});function Vlr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var JKe,eZe=H(()=>{JKe=Vlr});function Hlr(e,t){var r=e.__data__;return JKe(t)?r[typeof t=="string"?"string":"hash"]:r.map}var G2,TR=H(()=>{eZe();G2=Hlr});function qlr(e){var t=G2(this,e).delete(e);return this.size-=t?1:0,t}var tZe,rZe=H(()=>{TR();tZe=qlr});function Ylr(e){return G2(this,e).get(e)}var nZe,iZe=H(()=>{TR();nZe=Ylr});function jlr(e){return G2(this,e).has(e)}var aZe,oZe=H(()=>{TR();aZe=jlr});function Xlr(e,t){var r=G2(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var sZe,lZe=H(()=>{TR();sZe=Xlr});function hC(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t{QKe();rZe();iZe();oZe();lZe();hC.prototype.clear=ZKe;hC.prototype.delete=tZe;hC.prototype.get=nZe;hC.prototype.has=aZe;hC.prototype.set=sZe;A4=hC});function pde(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError($lr);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(pde.Cache||A4),r}var $lr,cZe,uZe=H(()=>{YW();$lr="Expected a function";pde.Cache=A4;cZe=pde});function Zlr(e){var t=cZe(e,function(n){return r.size===Klr&&r.clear(),n}),r=t.cache;return t}var Klr,dZe,hZe=H(()=>{uZe();Klr=500;dZe=Zlr});var Qlr,Jlr,ecr,fZe,pZe=H(()=>{hZe();Qlr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jlr=/\\(\\)?/g,ecr=dZe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Qlr,function(r,n,i,a){t.push(i?a.replace(Jlr,"$1"):n||r)}),t}),fZe=ecr});function tcr(e){return e==null?"":E$e(e)}var jW,mde=H(()=>{T$e();jW=tcr});function rcr(e,t){return Hn(e)?e:cC(e,t)?[e]:fZe(jW(e))}var W2,kR=H(()=>{Is();HW();pZe();mde();W2=rcr});function icr(e){if(typeof e=="string"||Rh(e))return e;var t=e+"";return t=="0"&&1/e==-ncr?"-0":t}var ncr,pg,fC=H(()=>{C4();ncr=1/0;pg=icr});function acr(e,t){t=W2(t,e);for(var r=0,n=t.length;e!=null&&r{kR();fC();V2=acr});function ocr(e,t,r){var n=e==null?void 0:V2(e,t);return n===void 0?r:n}var mZe,gZe=H(()=>{CR();mZe=ocr});function scr(e,t){for(var r=-1,n=t.length,i=e.length;++r{pC=scr});function lcr(e){return Hn(e)||g0(e)||!!(yZe&&e&&e[yZe])}var yZe,vZe,bZe=H(()=>{k4();oC();Is();yZe=Dl?Dl.isConcatSpreadable:void 0;vZe=lcr});function xZe(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=vZe),i||(i=[]);++a0&&r(s)?t>1?xZe(s,t-1,r,n,i):pC(i,s):n||(i[i.length]=s)}return i}var mC,$W=H(()=>{XW();bZe();mC=xZe});function ccr(e){var t=e==null?0:e.length;return t?mC(e,1):[]}var Df,gde=H(()=>{$W();Df=ccr});function ucr(e){return _W(BW(e,void 0,Df),e+"")}var wZe,EZe=H(()=>{gde();lde();ade();wZe=ucr});var dcr,gC,KW=H(()=>{hde();dcr=WW(Object.getPrototypeOf,Object),gC=dcr});function ycr(e){if(!hs(e)||Au(e)!=hcr)return!1;var t=gC(e);if(t===null)return!0;var r=mcr.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&TZe.call(r)==gcr}var hcr,fcr,pcr,TZe,mcr,gcr,kZe,CZe=H(()=>{A2();KW();m0();hcr="[object Object]",fcr=Function.prototype,pcr=Object.prototype,TZe=fcr.toString,mcr=pcr.hasOwnProperty,gcr=TZe.call(Object);kZe=ycr});function Scr(e){return Ccr.test(e)}var vcr,bcr,xcr,wcr,Ecr,Tcr,kcr,Ccr,SZe,AZe=H(()=>{vcr="\\ud800-\\udfff",bcr="\\u0300-\\u036f",xcr="\\ufe20-\\ufe2f",wcr="\\u20d0-\\u20ff",Ecr=bcr+xcr+wcr,Tcr="\\ufe0e\\ufe0f",kcr="\\u200d",Ccr=RegExp("["+kcr+vcr+Ecr+Tcr+"]");SZe=Scr});function Acr(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i{UZe=Acr});function Ucr(){this.__data__=new F2,this.size=0}var RZe,MZe=H(()=>{ER();RZe=Ucr});function Icr(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var LZe,DZe=H(()=>{LZe=Icr});function Rcr(e){return this.__data__.get(e)}var NZe,_Ze=H(()=>{NZe=Rcr});function Mcr(e){return this.__data__.has(e)}var PZe,OZe=H(()=>{PZe=Mcr});function Dcr(e,t){var r=this.__data__;if(r instanceof F2){var n=r.__data__;if(!z2||n.length{ER();qW();YW();Lcr=200;BZe=Dcr});function yC(e){var t=this.__data__=new F2(e);this.size=t.size}var mg,SR=H(()=>{ER();MZe();DZe();_Ze();OZe();FZe();yC.prototype.clear=RZe;yC.prototype.delete=LZe;yC.prototype.get=NZe;yC.prototype.has=PZe;yC.prototype.set=BZe;mg=yC});function Ncr(e,t){return e&&hg(t,Yo(t),e)}var zZe,GZe=H(()=>{iC();ky();zZe=Ncr});function _cr(e,t){return e&&hg(t,Id(t),e)}var WZe,VZe=H(()=>{iC();O2();WZe=_cr});function Ocr(e,t){if(t)return e.slice();var r=e.length,n=YZe?YZe(r):new e.constructor(r);return e.copy(n),n}var jZe,HZe,Pcr,qZe,YZe,ZW,yde=H(()=>{Rf();jZe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,HZe=jZe&&typeof module=="object"&&module&&!module.nodeType&&module,Pcr=HZe&&HZe.exports===jZe,qZe=Pcr?qo.Buffer:void 0,YZe=qZe?qZe.allocUnsafe:void 0;ZW=Ocr});function Bcr(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r{QW=Bcr});function Fcr(){return[]}var JW,bde=H(()=>{JW=Fcr});var zcr,Gcr,XZe,Wcr,vC,eV=H(()=>{vde();bde();zcr=Object.prototype,Gcr=zcr.propertyIsEnumerable,XZe=Object.getOwnPropertySymbols,Wcr=XZe?function(e){return e==null?[]:(e=Object(e),QW(XZe(e),function(t){return Gcr.call(e,t)}))}:JW,vC=Wcr});function Vcr(e,t){return hg(e,vC(e),t)}var $Ze,KZe=H(()=>{iC();eV();$Ze=Vcr});var Hcr,qcr,tV,xde=H(()=>{XW();KW();eV();bde();Hcr=Object.getOwnPropertySymbols,qcr=Hcr?function(e){for(var t=[];e;)pC(t,vC(e)),e=gC(e);return t}:JW,tV=qcr});function Ycr(e,t){return hg(e,tV(e),t)}var ZZe,QZe=H(()=>{iC();xde();ZZe=Ycr});function jcr(e,t,r){var n=t(e);return Hn(e)?n:pC(n,r(e))}var rV,wde=H(()=>{XW();Is();rV=jcr});function Xcr(e){return rV(e,Yo,vC)}var AR,Ede=H(()=>{wde();eV();ky();AR=Xcr});function $cr(e){return rV(e,Id,tV)}var JZe,eQe=H(()=>{wde();xde();O2();JZe=$cr});var Kcr,nV,tQe=H(()=>{I2();Rf();Kcr=Ad(qo,"DataView"),nV=Kcr});var Zcr,iV,rQe=H(()=>{I2();Rf();Zcr=Ad(qo,"Promise"),iV=Zcr});var Qcr,H2,Tde=H(()=>{I2();Rf();Qcr=Ad(qo,"Set"),H2=Qcr});var nQe,Jcr,iQe,aQe,oQe,sQe,eur,tur,rur,nur,iur,U4,Mh,I4=H(()=>{tQe();qW();rQe();Tde();W$e();A2();tde();nQe="[object Map]",Jcr="[object Object]",iQe="[object Promise]",aQe="[object Set]",oQe="[object WeakMap]",sQe="[object DataView]",eur=wy(nV),tur=wy(z2),rur=wy(iV),nur=wy(H2),iur=wy(DW),U4=Au;(nV&&U4(new nV(new ArrayBuffer(1)))!=sQe||z2&&U4(new z2)!=nQe||iV&&U4(iV.resolve())!=iQe||H2&&U4(new H2)!=aQe||DW&&U4(new DW)!=oQe)&&(U4=function(e){var t=Au(e),r=t==Jcr?e.constructor:void 0,n=r?wy(r):"";if(n)switch(n){case eur:return sQe;case tur:return nQe;case rur:return iQe;case nur:return aQe;case iur:return oQe}return t});Mh=U4});function sur(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&our.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var aur,our,lQe,cQe=H(()=>{aur=Object.prototype,our=aur.hasOwnProperty;lQe=sur});var lur,bC,kde=H(()=>{Rf();lur=qo.Uint8Array,bC=lur});function cur(e){var t=new e.constructor(e.byteLength);return new bC(t).set(new bC(e)),t}var xC,aV=H(()=>{kde();xC=cur});function uur(e,t){var r=t?xC(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var uQe,dQe=H(()=>{aV();uQe=uur});function hur(e){var t=new e.constructor(e.source,dur.exec(e));return t.lastIndex=e.lastIndex,t}var dur,hQe,fQe=H(()=>{dur=/\w*$/;hQe=hur});function fur(e){return mQe?Object(mQe.call(e)):{}}var pQe,mQe,gQe,yQe=H(()=>{k4();pQe=Dl?Dl.prototype:void 0,mQe=pQe?pQe.valueOf:void 0;gQe=fur});function pur(e,t){var r=t?xC(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var oV,Cde=H(()=>{aV();oV=pur});function Nur(e,t,r){var n=e.constructor;switch(t){case Tur:return xC(e);case mur:case gur:return new n(+e);case kur:return uQe(e,r);case Cur:case Sur:case Aur:case Uur:case Iur:case Rur:case Mur:case Lur:case Dur:return oV(e,r);case yur:return new n;case vur:case wur:return new n(e);case bur:return hQe(e);case xur:return new n;case Eur:return gQe(e)}}var mur,gur,yur,vur,bur,xur,wur,Eur,Tur,kur,Cur,Sur,Aur,Uur,Iur,Rur,Mur,Lur,Dur,vQe,bQe=H(()=>{aV();dQe();fQe();yQe();Cde();mur="[object Boolean]",gur="[object Date]",yur="[object Map]",vur="[object Number]",bur="[object RegExp]",xur="[object Set]",wur="[object String]",Eur="[object Symbol]",Tur="[object ArrayBuffer]",kur="[object DataView]",Cur="[object Float32Array]",Sur="[object Float64Array]",Aur="[object Int8Array]",Uur="[object Int16Array]",Iur="[object Int32Array]",Rur="[object Uint8Array]",Mur="[object Uint8ClampedArray]",Lur="[object Uint16Array]",Dur="[object Uint32Array]";vQe=Nur});function _ur(e){return typeof e.constructor=="function"&&!N2(e)?H$e(gC(e)):{}}var sV,Sde=H(()=>{q$e();KW();gR();sV=_ur});function Our(e){return hs(e)&&Mh(e)==Pur}var Pur,xQe,wQe=H(()=>{I4();m0();Pur="[object Map]";xQe=Our});var EQe,Bur,TQe,kQe=H(()=>{wQe();yR();zW();EQe=Ty&&Ty.isMap,Bur=EQe?_2(EQe):xQe,TQe=Bur});function zur(e){return hs(e)&&Mh(e)==Fur}var Fur,CQe,SQe=H(()=>{I4();m0();Fur="[object Set]";CQe=zur});var AQe,Gur,UQe,IQe=H(()=>{SQe();yR();zW();AQe=Ty&&Ty.isSet,Gur=AQe?_2(AQe):CQe,UQe=Gur});function lV(e,t,r,n,i,a){var o,s=t&Wur,l=t&Vur,u=t&Hur;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!po(e))return e;var d=Hn(e);if(d){if(o=lQe(e),!s)return NW(e,o)}else{var h=Mh(e),f=h==MQe||h==$ur;if(y0(e))return ZW(e,s);if(h==LQe||h==RQe||f&&!i){if(o=l||f?{}:sV(e),!s)return l?ZZe(e,WZe(o,e)):$Ze(e,zZe(o,e))}else{if(!Ua[h])return i?e:{};o=vQe(e,h,s)}}a||(a=new mg);var p=a.get(e);if(p)return p;a.set(e,o),UQe(e)?e.forEach(function(y){o.add(lV(y,t,r,y,e,a))}):TQe(e)&&e.forEach(function(y,v){o.set(v,lV(y,t,r,v,e,a))});var m=u?l?JZe:AR:l?Id:Yo,g=d?void 0:m(e);return PW(g||e,function(y,v){g&&(v=y,y=e[v]),L2(o,v,lV(y,t,r,v,e,a))}),o}var Wur,Vur,Hur,RQe,qur,Yur,jur,Xur,MQe,$ur,Kur,Zur,LQe,Qur,Jur,edr,tdr,rdr,ndr,idr,adr,odr,sdr,ldr,cdr,udr,ddr,hdr,fdr,Ua,DQe,NQe=H(()=>{SR();ode();fR();GZe();VZe();yde();rde();KZe();QZe();Ede();eQe();I4();cQe();bQe();Sde();Is();sC();kQe();Mf();IQe();ky();O2();Wur=1,Vur=2,Hur=4,RQe="[object Arguments]",qur="[object Array]",Yur="[object Boolean]",jur="[object Date]",Xur="[object Error]",MQe="[object Function]",$ur="[object GeneratorFunction]",Kur="[object Map]",Zur="[object Number]",LQe="[object Object]",Qur="[object RegExp]",Jur="[object Set]",edr="[object String]",tdr="[object Symbol]",rdr="[object WeakMap]",ndr="[object ArrayBuffer]",idr="[object DataView]",adr="[object Float32Array]",odr="[object Float64Array]",sdr="[object Int8Array]",ldr="[object Int16Array]",cdr="[object Int32Array]",udr="[object Uint8Array]",ddr="[object Uint8ClampedArray]",hdr="[object Uint16Array]",fdr="[object Uint32Array]",Ua={};Ua[RQe]=Ua[qur]=Ua[ndr]=Ua[idr]=Ua[Yur]=Ua[jur]=Ua[adr]=Ua[odr]=Ua[sdr]=Ua[ldr]=Ua[cdr]=Ua[Kur]=Ua[Zur]=Ua[LQe]=Ua[Qur]=Ua[Jur]=Ua[edr]=Ua[tdr]=Ua[udr]=Ua[ddr]=Ua[hdr]=Ua[fdr]=!0;Ua[Xur]=Ua[MQe]=Ua[rdr]=!1;DQe=lV});function gdr(e){return DQe(e,pdr|mdr)}var pdr,mdr,Ade,_Qe=H(()=>{NQe();pdr=1,mdr=4;Ade=gdr});function vdr(e){return this.__data__.set(e,ydr),this}var ydr,PQe,OQe=H(()=>{ydr="__lodash_hash_undefined__";PQe=vdr});function bdr(e){return this.__data__.has(e)}var BQe,FQe=H(()=>{BQe=bdr});function cV(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new A4;++t{YW();OQe();FQe();cV.prototype.add=cV.prototype.push=PQe;cV.prototype.has=BQe;uV=cV});function xdr(e,t){for(var r=-1,n=e==null?0:e.length;++r{zQe=xdr});function wdr(e,t){return e.has(t)}var dV,Ide=H(()=>{dV=wdr});function kdr(e,t,r,n,i,a){var o=r&Edr,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=r&Tdr?new uV:void 0;for(a.set(e,t),a.set(t,e);++h{Ude();GQe();Ide();Edr=1,Tdr=2;hV=kdr});function Cdr(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var WQe,VQe=H(()=>{WQe=Cdr});function Sdr(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var wC,fV=H(()=>{wC=Sdr});function zdr(e,t,r,n,i,a,o){switch(r){case Fdr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Bdr:return!(e.byteLength!=t.byteLength||!a(new bC(e),new bC(t)));case Idr:case Rdr:case Ddr:return Lf(+e,+t);case Mdr:return e.name==t.name&&e.message==t.message;case Ndr:case Pdr:return e==t+"";case Ldr:var s=WQe;case _dr:var l=n&Adr;if(s||(s=wC),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;n|=Udr,o.set(e,t);var d=hV(s(e),s(t),n,i,a,o);return o.delete(e),d;case Odr:if(Mde)return Mde.call(e)==Mde.call(t)}return!1}var Adr,Udr,Idr,Rdr,Mdr,Ldr,Ddr,Ndr,_dr,Pdr,Odr,Bdr,Fdr,HQe,Mde,qQe,YQe=H(()=>{k4();kde();S4();Rde();VQe();fV();Adr=1,Udr=2,Idr="[object Boolean]",Rdr="[object Date]",Mdr="[object Error]",Ldr="[object Map]",Ddr="[object Number]",Ndr="[object RegExp]",_dr="[object Set]",Pdr="[object String]",Odr="[object Symbol]",Bdr="[object ArrayBuffer]",Fdr="[object DataView]",HQe=Dl?Dl.prototype:void 0,Mde=HQe?HQe.valueOf:void 0;qQe=zdr});function Hdr(e,t,r,n,i,a){var o=r&Gdr,s=AR(e),l=s.length,u=AR(t),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var f=s[h];if(!(o?f in t:Vdr.call(t,f)))return!1}var p=a.get(e),m=a.get(t);if(p&&m)return p==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);for(var y=o;++h{Ede();Gdr=1,Wdr=Object.prototype,Vdr=Wdr.hasOwnProperty;jQe=Hdr});function jdr(e,t,r,n,i,a){var o=Hn(e),s=Hn(t),l=o?KQe:Mh(e),u=s?KQe:Mh(t);l=l==$Qe?pV:l,u=u==$Qe?pV:u;var d=l==pV,h=u==pV,f=l==u;if(f&&y0(e)){if(!y0(t))return!1;o=!0,d=!1}if(f&&!d)return a||(a=new mg),o||P2(e)?hV(e,t,r,n,i,a):qQe(e,t,l,r,n,i,a);if(!(r&qdr)){var p=d&&ZQe.call(e,"__wrapped__"),m=h&&ZQe.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,y=m?t.value():t;return a||(a=new mg),i(g,y,r,n,a)}}return f?(a||(a=new mg),jQe(e,t,r,n,i,a)):!1}var qdr,$Qe,KQe,pV,Ydr,ZQe,QQe,JQe=H(()=>{SR();Rde();YQe();XQe();I4();Is();sC();bR();qdr=1,$Qe="[object Arguments]",KQe="[object Array]",pV="[object Object]",Ydr=Object.prototype,ZQe=Ydr.hasOwnProperty;QQe=jdr});function eJe(e,t,r,n,i){return e===t?!0:e==null||t==null||!hs(e)&&!hs(t)?e!==e&&t!==t:QQe(e,t,r,n,eJe,i)}var mV,Lde=H(()=>{JQe();m0();mV=eJe});function Kdr(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var s=r[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i{SR();Lde();Xdr=1,$dr=2;tJe=Kdr});function Zdr(e){return e===e&&!po(e)}var gV,Dde=H(()=>{Mf();gV=Zdr});function Qdr(e){for(var t=Yo(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,gV(i)]}return t}var nJe,iJe=H(()=>{Dde();ky();nJe=Qdr});function Jdr(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var yV,Nde=H(()=>{yV=Jdr});function ehr(e){var t=nJe(e);return t.length==1&&t[0][2]?yV(t[0][0],t[0][1]):function(r){return r===e||tJe(r,e,t)}}var aJe,oJe=H(()=>{rJe();iJe();Nde();aJe=ehr});function thr(e,t){return e!=null&&t in Object(e)}var sJe,lJe=H(()=>{sJe=thr});function rhr(e,t,r){t=W2(t,e);for(var n=-1,i=t.length,a=!1;++n{kR();oC();Is();dR();FW();fC();vV=rhr});function nhr(e,t){return e!=null&&vV(e,t,sJe)}var bV,Pde=H(()=>{lJe();_de();bV=nhr});function ohr(e,t){return cC(e)&&gV(t)?yV(pg(e),t):function(r){var n=mZe(r,e);return n===void 0&&n===t?bV(r,e):mV(t,n,ihr|ahr)}}var ihr,ahr,cJe,uJe=H(()=>{Lde();gZe();Pde();HW();Dde();Nde();fC();ihr=1,ahr=2;cJe=ohr});function shr(e){return function(t){return t?.[e]}}var xV,Ode=H(()=>{xV=shr});function lhr(e){return function(t){return V2(t,e)}}var dJe,hJe=H(()=>{CR();dJe=lhr});function chr(e){return cC(e)?xV(pg(e)):dJe(e)}var fJe,pJe=H(()=>{Ode();hJe();HW();fC();fJe=chr});function uhr(e){return typeof e=="function"?e:e==null?Sd:typeof e=="object"?Hn(e)?cJe(e[0],e[1]):aJe(e):fJe(e)}var Vc,Sy=H(()=>{oJe();uJe();U2();Is();pJe();Vc=uhr});function dhr(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var mJe,gJe=H(()=>{mJe=dhr});var hhr,EC,wV=H(()=>{gJe();hhr=mJe(),EC=hhr});function fhr(e,t){return e&&EC(e,t,Yo)}var TC,EV=H(()=>{wV();ky();TC=fhr});function phr(e,t){return function(r,n){if(r==null)return r;if(!Nl(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a{fg();yJe=phr});var mhr,q2,UR=H(()=>{EV();vJe();mhr=yJe(TC),q2=mhr});var ghr,TV,bJe=H(()=>{Rf();ghr=function(){return qo.Date.now()},TV=ghr});var xJe,yhr,vhr,Bde,wJe=H(()=>{pR();S4();mR();O2();xJe=Object.prototype,yhr=xJe.hasOwnProperty,vhr=D2(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Ey(t[0],t[1],i)&&(n=1);++r{hR();S4();IR=bhr});function xhr(e){return hs(e)&&Nl(e)}var kV,zde=H(()=>{fg();m0();kV=xhr});function whr(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var RR,Gde=H(()=>{RR=whr});function Ehr(e){return hg(e,Id(e))}var EJe,TJe=H(()=>{iC();O2();EJe=Ehr});function Thr(e,t,r,n,i,a,o){var s=RR(e,r),l=RR(t,r),u=o.get(l);if(u){IR(e,r,u);return}var d=a?a(s,l,r+"",e,t,o):void 0,h=d===void 0;if(h){var f=Hn(l),p=!f&&y0(l),m=!f&&!p&&P2(l);d=l,f||p||m?Hn(s)?d=s:kV(s)?d=NW(s):p?(h=!1,d=ZW(l,!0)):m?(h=!1,d=oV(l,!0)):d=[]:kZe(l)||g0(l)?(d=s,g0(s)?d=EJe(s):(!po(s)||dg(s))&&(d=sV(l))):h=!1}h&&(o.set(l,d),i(d,l,n,a,o),o.delete(l)),IR(e,r,d)}var kJe,CJe=H(()=>{Fde();yde();Cde();rde();Sde();oC();Is();zde();sC();uR();Mf();CZe();bR();Gde();TJe();kJe=Thr});function SJe(e,t,r,n,i){e!==t&&EC(t,function(a,o){if(i||(i=new mg),po(a))kJe(e,t,o,r,SJe,n,i);else{var s=n?n(RR(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),IR(e,o,s)}},Id)}var AJe,UJe=H(()=>{SR();Fde();wV();CJe();Mf();O2();Gde();AJe=SJe});function khr(e,t,r){for(var n=-1,i=e==null?0:e.length;++n{IJe=khr});function Chr(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Y2,MJe=H(()=>{Y2=Chr});function Shr(e){return typeof e=="function"?e:Sd}var kC,CV=H(()=>{U2();kC=Shr});function Ahr(e,t){var r=Hn(e)?PW:q2;return r(e,kC(t))}var mt,Wde=H(()=>{ode();UR();CV();Is();mt=Ahr});var LJe=H(()=>{Wde()});function Uhr(e,t){var r=[];return q2(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}var DJe,NJe=H(()=>{UR();DJe=Uhr});function Ihr(e,t){var r=Hn(e)?QW:DJe;return r(e,Vc(t,3))}var Uu,_Je=H(()=>{vde();NJe();Sy();Is();Uu=Ihr});function Rhr(e){return function(t,r,n){var i=Object(t);if(!Nl(t)){var a=Vc(r,3);t=Yo(t),r=function(s){return a(i[s],s,i)}}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var PJe,OJe=H(()=>{Sy();fg();ky();PJe=Rhr});function Lhr(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:L$e(r);return i<0&&(i=Mhr(n+i,0)),OW(e,Vc(t,3),i)}var Mhr,BJe,FJe=H(()=>{sde();Sy();D$e();Mhr=Math.max;BJe=Lhr});var Dhr,CC,zJe=H(()=>{OJe();FJe();Dhr=PJe(BJe),CC=Dhr});function Nhr(e,t){var r=-1,n=Nl(e)?Array(e.length):[];return q2(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var SV,Vde=H(()=>{UR();fg();SV=Nhr});function _hr(e,t){var r=Hn(e)?ug:SV;return r(e,Vc(t,3))}var ea,GJe=H(()=>{cR();Sy();Vde();Is();ea=_hr});function Phr(e,t){return e==null?e:EC(e,kC(t),Id)}var Hde,WJe=H(()=>{wV();CV();O2();Hde=Phr});function Ohr(e,t){return e&&TC(e,kC(t))}var qde,VJe=H(()=>{EV();CV();qde=Ohr});function Bhr(e,t){return e>t}var HJe,qJe=H(()=>{HJe=Bhr});function Ghr(e,t){return e!=null&&zhr.call(e,t)}var Fhr,zhr,YJe,jJe=H(()=>{Fhr=Object.prototype,zhr=Fhr.hasOwnProperty;YJe=Ghr});function Whr(e,t){return e!=null&&vV(e,t,YJe)}var MR,XJe=H(()=>{jJe();_de();MR=Whr});function Hhr(e){return typeof e=="string"||!Hn(e)&&hs(e)&&Au(e)==Vhr}var Vhr,$Je,KJe=H(()=>{A2();Is();m0();Vhr="[object String]";$Je=Hhr});function qhr(e,t){return ug(t,function(r){return e[r]})}var ZJe,QJe=H(()=>{cR();ZJe=qhr});function Yhr(e){return e==null?[]:ZJe(e,Yo(e))}var Lh,JJe=H(()=>{QJe();ky();Lh=Yhr});function Zhr(e){if(e==null)return!0;if(Nl(e)&&(Hn(e)||typeof e=="string"||typeof e.splice=="function"||y0(e)||P2(e)||g0(e)))return!e.length;var t=Mh(e);if(t==jhr||t==Xhr)return!e.size;if(N2(e))return!lC(e).length;for(var r in e)if(Khr.call(e,r))return!1;return!0}var jhr,Xhr,$hr,Khr,AV,eet=H(()=>{VW();I4();oC();Is();fg();sC();gR();bR();jhr="[object Map]",Xhr="[object Set]",$hr=Object.prototype,Khr=$hr.hasOwnProperty;AV=Zhr});function Qhr(e){return e===void 0}var jo,tet=H(()=>{jo=Qhr});function Jhr(e,t){return e{UV=Jhr});function efr(e,t){var r={};return t=Vc(t,3),TC(e,function(n,i,a){M2(r,i,t(n,i,a))}),r}var R4,ret=H(()=>{hR();EV();Sy();R4=efr});function tfr(e,t,r){for(var n=-1,i=e.length;++n{C4();SC=tfr});function rfr(e){return e&&e.length?SC(e,Sd,HJe):void 0}var Rd,net=H(()=>{IV();qJe();U2();Rd=rfr});var nfr,AC,iet=H(()=>{UJe();uKe();nfr=cKe(function(e,t,r){AJe(e,t,r)}),AC=nfr});function ifr(e){return e&&e.length?SC(e,Sd,UV):void 0}var Ay,aet=H(()=>{IV();Yde();U2();Ay=ifr});function afr(e,t){return e&&e.length?SC(e,Vc(t,2),UV):void 0}var M4,oet=H(()=>{IV();Sy();Yde();M4=afr});function ofr(e,t,r,n){if(!po(e))return e;t=W2(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i{fR();kR();dR();Mf();fC();set=ofr});function sfr(e,t,r){for(var n=-1,i=t.length,a={};++n{CR();cet();kR();uet=sfr});function lfr(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var het,fet=H(()=>{het=lfr});function cfr(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=Rh(e),o=t!==void 0,s=t===null,l=t===t,u=Rh(t);if(!s&&!u&&!a&&e>t||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e{C4();pet=cfr});function ufr(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,s=r.length;++n=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var get,yet=H(()=>{met();get=ufr});function dfr(e,t,r){t.length?t=ug(t,function(a){return Hn(a)?function(o){return V2(o,a.length===1?a[0]:a)}:a}):t=[Sd];var n=-1;t=ug(t,_2(Vc));var i=SV(e,function(a,o,s){var l=ug(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return het(i,function(a,o){return get(a,o,r)})}var vet,bet=H(()=>{cR();CR();Sy();Vde();fet();yR();yet();U2();Is();vet=dfr});var hfr,xet,wet=H(()=>{Ode();hfr=xV("length"),xet=hfr});function kfr(e){for(var t=Eet.lastIndex=0;Eet.test(e);)++t;return t}var Tet,ffr,pfr,mfr,gfr,yfr,vfr,jde,Xde,bfr,ket,Cet,Aet,xfr,Uet,Iet,wfr,Efr,Tfr,Eet,Ret,Met=H(()=>{Tet="\\ud800-\\udfff",ffr="\\u0300-\\u036f",pfr="\\ufe20-\\ufe2f",mfr="\\u20d0-\\u20ff",gfr=ffr+pfr+mfr,yfr="\\ufe0e\\ufe0f",vfr="["+Tet+"]",jde="["+gfr+"]",Xde="\\ud83c[\\udffb-\\udfff]",bfr="(?:"+jde+"|"+Xde+")",ket="[^"+Tet+"]",Cet="(?:\\ud83c[\\udde6-\\uddff]){2}",Aet="[\\ud800-\\udbff][\\udc00-\\udfff]",xfr="\\u200d",Uet=bfr+"?",Iet="["+yfr+"]?",wfr="(?:"+xfr+"(?:"+[ket,Cet,Aet].join("|")+")"+Iet+Uet+")*",Efr=Iet+Uet+wfr,Tfr="(?:"+[ket+jde+"?",jde,Cet,Aet,vfr].join("|")+")",Eet=RegExp(Xde+"(?="+Xde+")|"+Tfr+Efr,"g");Ret=kfr});function Cfr(e){return SZe(e)?Ret(e):xet(e)}var Let,Det=H(()=>{wet();AZe();Met();Let=Cfr});function Sfr(e,t){return uet(e,t,function(r,n){return bV(e,n)})}var Net,_et=H(()=>{det();Pde();Net=Sfr});var Afr,L4,Pet=H(()=>{_et();EZe();Afr=wZe(function(e,t){return e==null?{}:Net(e,t)}),L4=Afr});function Rfr(e,t,r,n){for(var i=-1,a=Ifr(Ufr((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var Ufr,Ifr,Oet,Bet=H(()=>{Ufr=Math.ceil,Ifr=Math.max;Oet=Rfr});function Mfr(e){return function(t,r,n){return n&&typeof n!="number"&&Ey(t,r,n)&&(r=n=void 0),t=rC(t),r===void 0?(r=t,t=0):r=rC(r),n=n===void 0?t{Bet();mR();ede();Fet=Mfr});var Lfr,Nf,Get=H(()=>{zet();Lfr=Fet(),Nf=Lfr});function Dfr(e,t,r,n,i){return i(e,function(a,o,s){r=n?(n=!1,a):t(r,a,o,s)}),r}var Wet,Vet=H(()=>{Wet=Dfr});function Nfr(e,t,r){var n=Hn(e)?UZe:Wet,i=arguments.length<3;return n(e,Vc(t,4),r,i,q2)}var gg,Het=H(()=>{IZe();UR();Sy();Vet();Is();gg=Nfr});function Ofr(e){if(e==null)return 0;if(Nl(e))return $Je(e)?Let(e):e.length;var t=Mh(e);return t==_fr||t==Pfr?e.size:lC(e).length}var _fr,Pfr,$de,qet=H(()=>{VW();I4();fg();KJe();Det();_fr="[object Map]",Pfr="[object Set]";$de=Ofr});var Bfr,yg,Yet=H(()=>{$W();bet();pR();mR();Bfr=D2(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Ey(e,t[0],t[1])?t=[]:r>2&&Ey(t[0],t[1],t[2])&&(t=[t[0]]),vet(e,mC(t,1),[])}),yg=Bfr});var Ffr,zfr,jet,Xet=H(()=>{Tde();$$e();fV();Ffr=1/0,zfr=H2&&1/wC(new H2([,-0]))[1]==Ffr?function(e){return new H2(e)}:X$e,jet=zfr});function Wfr(e,t,r){var n=-1,i=oKe,a=e.length,o=!0,s=[],l=s;if(r)o=!1,i=IJe;else if(a>=Gfr){var u=t?null:jet(e);if(u)return wC(u);o=!1,i=dV,l=new uV}else l=t?[]:s;e:for(;++n{Ude();sKe();RJe();Ide();Xet();fV();Gfr=200;$et=Wfr});var Vfr,Kde,Zet=H(()=>{$W();pR();Ket();zde();Vfr=D2(function(e){return $et(mC(e,1,kV,!0))}),Kde=Vfr});function qfr(e){var t=++Hfr;return jW(e)+t}var Hfr,D4,Qet=H(()=>{mde();Hfr=0;D4=qfr});function Yfr(e,t,r){for(var n=-1,i=e.length,a=t.length,o={};++n{Jet=Yfr});function jfr(e,t){return Jet(e||[],t||[],L2)}var RV,ttt=H(()=>{fR();ett();RV=jfr});var ta=H(()=>{_Qe();nde();wJe();LJe();_Je();zJe();gde();Wde();WJe();VJe();XJe();Is();eet();uR();tet();ky();MJe();GJe();ret();net();iet();aet();oet();bJe();Pet();Get();Het();qet();Yet();Zet();Qet();JJe();ttt();});function ntt(e,t){e[t]?e[t]++:e[t]=1}function itt(e,t){--e[t]||delete e[t]}function LR(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+rtt+a+rtt+(jo(n)?Xfr:n)}function $fr(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function Zde(e,t){return LR(e,t.v,t.w,t.name)}var Xfr,N4,rtt,qi,Qde=H(()=>{ta();Xfr="\0",N4="\0",rtt="",qi=class{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Ud(void 0),this._defaultEdgeLabelFn=Ud(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[N4]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return dg(t)||(t=Ud(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Yo(this._nodes)}sources(){var t=this;return Uu(this.nodes(),function(r){return AV(t._in[r])})}sinks(){var t=this;return Uu(this.nodes(),function(r){return AV(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return mt(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=N4,this._children[t]={},this._children[N4][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],mt(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),mt(Yo(this._in[t]),r),delete this._in[t],delete this._preds[t],mt(Yo(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(jo(r))r=N4;else{r+="";for(var n=r;!jo(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==N4)return r}}children(t){if(jo(t)&&(t=N4),this._isCompound){var r=this._children[t];if(r)return Yo(r)}else{if(t===N4)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return Yo(r)}successors(t){var r=this._sucs[t];if(r)return Yo(r)}neighbors(t){var r=this.predecessors(t);if(r)return Kde(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;mt(this._nodes,function(o,s){t(s)&&r.setNode(s,o)}),mt(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&&mt(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return dg(t)||(t=Ud(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Lh(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return gg(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,jo(n)||(n=""+n);var s=LR(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!jo(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(t,r,n);var l=$fr(this._isDirected,t,r,n);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,ntt(this._preds[r],t),ntt(this._sucs[t],r),this._in[r][s]=l,this._out[t][s]=l,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?Zde(this._isDirected,arguments[0]):LR(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?Zde(this._isDirected,arguments[0]):LR(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?Zde(this._isDirected,arguments[0]):LR(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],itt(this._preds[r],t),itt(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=Lh(n);return r?Uu(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=Lh(n);return r?Uu(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}};qi.prototype._nodeCount=0;qi.prototype._edgeCount=0});var Dh=H(()=>{Qde()});var ctt={};gr(ctt,{captureNodeSizes:()=>ltt,shouldCaptureSizes:()=>att});function Jde(){if(!(typeof globalThis>"u"))return globalThis}function att(){return!!Jde()?.mermaidCaptureSizes}function ott(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}function stt(e,t){let r=Jde();if(!r)return;let n=t.node(),a=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}function ltt(e,t){let r=[];for(let n of t.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&stt({metadata:{captureVersion:Kfr,capturedAt:new Date().toISOString(),capturedFrom:ott()},nodes:r},e)}var Kfr,utt=H(()=>{xr();Kfr=1;k(Jde,"getCaptureGlobal");k(att,"shouldCaptureSizes");k(ott,"capturedFromLocation");k(stt,"emitCapturedSizes");k(ltt,"captureNodeSizes")});function MV(e,{edgePathsClass:t="edges edgePaths"}={}){let r=e.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",t),a=r.insert("g").attr("class","edgeLabels"),o=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:o,rootGroups:r}}async function htt(e,t){if(t.label){let{shapeSvg:r,bbox:n}=await Ur(e,t);t.labelBBox={width:n.width,height:n.height},r.remove()}else t.labelBBox={width:0,height:0}}async function LV(e,t,r){let n=await sg(e,t,r),i=n.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,n}async function ftt(e,t){let r=new qi({multigraph:!0,compound:!0}),n=[...t.edges],i=je(),a=MV(e),{edgeLabels:o,nodes:s}=a,l=new Map,u=e.node()!=null;await Promise.all(t.nodes.map(async d=>{if(d.isGroup)u&&await htt(s,d),r.setNode(d.id,{...d});else{if(u){let h=await LV(s,d,{config:i,dir:d.dir});l.set(d.id,h)}r.setNode(d.id,{...d})}}));for(let d of n)u&&Que(d)&&await cg(o,d),r.setEdge(d.start,d.end,{...d},d.id),t.edges.some(f=>f.id===d.id)||t.edges.push(d);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:d}=await Promise.resolve().then(()=>(utt(),ctt));d(e,t)}return{graph:r,groups:a,nodeElements:l}}function UC({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){let o=t??rhe;return k(async function(l,u,d,h){let f=u.select("g");(d?.insertMarkers??tC)(f,l.markers,l.type,l.diagramId),the();let p={element:f,helpers:d,options:h};p.preparedLayout=await e?.(l,p);let m=await o(l,p),g=await r(l,p),y={...p,measure:m};n?await n(l,y,g):await nhe(l,y,a),await i?.(l,y,g)},"render")}function the(){t$e(),c$e(),i$e(),Zfr()}async function rhe(e,{element:t}){return await ftt(t,e)}async function nhe(e,t,r={}){let{measure:n}=t,{groups:i}=n;for(let o of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(o,t)||await wtt(i,o,t,r);let a=Ttt(e.nodes);for(let o of e.edges)ktt(o,r)||await Ctt(i,o,a,e,r,t)}async function wtt(e,t,r,n){t.clusterNode?lg(t):Ett(t,r,n)?await C2(e.clusters,t):lg(t)}function Ett(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}function Ttt(e){let t=new Map;for(let r of e)r?.id&&t.set(r.id,r);return t}function ktt(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function Ctt(e,t,r,n,i,a){let o=S2(e.edgePaths,{...t},i.clusterDb??new Map,n.type,ehe(t.start,t,r,a,i),ehe(t.end,t,r,a,i),n.diagramId,Stt(t,i));Que(t)&&(T4.has(t.id)||await cg(e.edgeLabels,t),Att(t,o))}function ehe(e,t,r,n,i){return i.getEdgeNode?.(e,t,n)??(e?r.get(e)??{}:{})}function Stt(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}function Att(e,t){let r=t?.updatedPath??t?.originalPath,n=Kt(),{subGraphTitleTotalMargin:i}=xy({flowchart:n.flowchart??{}});if(e.label){let a=T4.get(e.id),o=e.x,s=e.y;if(r){let l=Nr.calcLabelPosition(r);ye.debug("Moving label "+e.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),t?.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(e?.startLabelLeft){let a=Ho.get(e.id).startLeft,o=e?.x,s=e?.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.startLabelRight){let a=Ho.get(e.id).startRight,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelLeft){let a=Ho.get(e.id).endLeft,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelRight){let a=Ho.get(e.id).endRight,o=e.x,s=e.y;if(r){let l=Nr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}}var Pn,_4,ptt,Zfr,NR,Qfr,mtt,gtt,Jfr,P4,dtt,ytt,vtt,btt,DV,xtt,epr,NV=H(()=>{Gc();Wc();nl();Vo();Vn();Wr();Gr();xr();Dh();Dh();k(MV,"createLayoutElementGroups");k(htt,"measureGroupLabel");k(LV,"insertMeasuredNode");k(ftt,"createGraphWithElements");Pn=new Map,_4=new Map,ptt=new Map,Zfr=k(()=>{_4.clear(),ptt.clear(),Pn.clear()},"clear"),NR=k((e,t)=>{let r=_4.get(t)||[];return ye.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),Qfr=k((e,t)=>{let r=_4.get(t)||[];return ye.info("Descendants of ",t," is ",r),ye.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||NR(e.v,t)||NR(e.w,t)||r.includes(e.w):(ye.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),mtt=k((e,t,r,n)=>{ye.debug("Copying children of ",e,"root",n,"data",t.node(e),n);let i=t.children(e)||[];e!==n&&i.push(e),ye.debug("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)mtt(a,t,r,n);else{let o=t.node(a);ye.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(ye.debug("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(ye.debug("Setting parent",a,e),r.setParent(a,e)):(ye.info("In copy ",e,"root",n,"data",t.node(e),n),ye.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));let s=t.edges(a);ye.debug("Copying Edges",s),s.forEach(l=>{ye.info("Edge",l);let u=t.edge(l.v,l.w,l.name);ye.info("Edge data",u,n);try{Qfr(l,n)?(ye.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ye.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):ye.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",e)}catch(d){ye.error(d)}})}ye.debug("Removing node",a),t.removeNode(a)})},"copy"),gtt=k((e,t)=>{let r=t.children(e),n=[...r];for(let i of r)ptt.set(i,e),n=[...n,...gtt(i,t)];return n},"extractDescendants"),Jfr=k((e,t,r)=>{let n=e.edges().filter(l=>l.v===t||l.w===t),i=e.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),P4=k((e,t,r)=>{let n=t.children(e);if(ye.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(let a of n){let o=P4(a,t,r),s=Jfr(t,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),dtt=k(e=>!Pn.has(e)||!Pn.get(e).externalConnections?e:Pn.has(e)?Pn.get(e).id:e,"getAnchorId"),ytt=k((e,t)=>{if(!e||t>10){ye.debug("Opting out, no graph ");return}else ye.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(ye.debug("Cluster identified",r," Replacement id in edges: ",P4(r,e,r)),_4.set(r,gtt(r,e)),Pn.set(r,{id:P4(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let n=e.children(r),i=e.edges();n.length>0?(ye.debug("Cluster identified",r,_4),i.forEach(a=>{let o=NR(a.v,r),s=NR(a.w,r);o^s&&(ye.debug("Edge: ",a," leaves cluster ",r),ye.debug("Descendants of XXX ",r,": ",_4.get(r)),Pn.get(r).externalConnections=!0)})):ye.debug("Not a cluster ",r,_4)});for(let r of Pn.keys()){let n=Pn.get(r).id,i=e.parent(n);i!==r&&Pn.has(i)&&!Pn.get(i).externalConnections&&(Pn.get(r).id=i);let a=e.edges().some(o=>o.v===r);if(n&&Pn.get(r)?.externalConnections&&a&&xtt(e,n,r)){let o=epr(e,r,e.parent(n));o&&(Pn.get(r).id=o)}}e.edges().forEach(function(r){let n=e.edge(r);ye.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),ye.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(ye.debug("Fix XXX",Pn,"ids:",r.v,r.w,"Translating: ",Pn.get(r.v)," --- ",Pn.get(r.w)),Pn.get(r.v)||Pn.get(r.w)){if(ye.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=dtt(r.v),a=dtt(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){let o=e.parent(i);Pn.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let o=e.parent(a);Pn.get(o).externalConnections=!0,n.toCluster=r.w}ye.debug("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),vtt(e,0),ye.trace(Pn)},"adjustClustersAndEdges"),vtt=k((e,t)=>{if(t>10){ye.error("Bailing out");return}let r=e.nodes(),n=!1;for(let i of r){let a=e.children(i);n=n||a.length>0}if(!n){ye.debug("Done, no node has children",e.nodes());return}ye.debug("Nodes = ",r,t);for(let i of r)if(ye.debug("Extracting node",i,Pn,Pn.has(i)&&!Pn.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!Pn.has(i))ye.debug("Not a cluster",i,t);else if(!Pn.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){ye.debug("Cluster without external connections, without a parent and with children",i,t);let o=e.graph().rankdir==="TB"?"LR":"TB";Pn.get(i)?.clusterData?.dir&&(o=Pn.get(i).clusterData.dir,ye.debug("Fixing dir",Pn.get(i).clusterData.dir,o));let s=new qi({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});mtt(i,e,s,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:Pn.get(i).clusterData,label:Pn.get(i).label,graph:s})}else ye.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!Pn.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),ye.debug(Pn);r=e.nodes(),ye.debug("New list of nodes",r);for(let i of r){let a=e.node(i);ye.debug(" Now next level",i,a),a?.clusterNode&&vtt(a.graph,t+1)}},"extractor"),btt=k((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{let i=e.children(n),a=btt(e,i);r=[...r,...a]}),r},"sorter"),DV=k(e=>btt(e,e.children()),"sortNodesByHierarchy"),xtt=k((e,t,r)=>{let n=e.parent(t);for(;n&&n!==r;){let i=Pn.get(n);if(i&&!i.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),epr=k((e,t,r)=>{let n=e.children(t)??[];for(let i of n){if(i===r||NR(i,r))continue;let a=P4(i,e,t);if(a&&!xtt(e,a,t))return a}return null},"findSafeAnchorNode");k(UC,"createCommonLayoutRenderer");k(the,"clearLayoutRenderState");k(rhe,"defaultMeasureLayout");k(nhe,"paintLayoutData");k(wtt,"paintLayoutNode");k(Ett,"shouldPaintAsCluster");k(Ttt,"buildNodeLookup");k(ktt,"shouldSkipPaintEdge");k(Ctt,"paintLayoutEdge");k(ehe,"getRenderedNode");k(Stt,"shouldSkipIntersect");k(Att,"positionRenderedEdgeLabel")});function Jtt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function IC(){if(Utt)return j2;Utt=1;function e(o){return typeof o>"u"||o===null}k(e,"isNothing");function t(o){return typeof o=="object"&&o!==null}k(t,"isObject");function r(o){return Array.isArray(o)?o:e(o)?[]:[o]}k(r,"toArray");function n(o,s){if(s){let l=Object.keys(s);for(let u=0,d=l.length;uh&&(u=" ... ",a=s-h+u.length),o-s>h&&(d=" ...",o=s+h-d.length),{str:u+i.slice(a,o).replace(/\t/g,"\u2192")+d,pos:s-a+u.length}}k(t,"getLine");function r(i,a){return e.repeat(" ",a-i.length)+i}k(r,"padStart");function n(i,a){if(a=Object.create(a||null),!i.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);let o=/\r?\n|\r|\0/g,s=[0],l=[],u,d=-1;for(;u=o.exec(i.buffer);)l.push(u.index),s.push(u.index+u[0].length),i.position<=u.index&&d<0&&(d=s.length-2);d<0&&(d=s.length-1);let h="",f=Math.min(i.line+a.linesAfter,l.length).toString().length,p=a.maxLength-(a.indent+f+3);for(let g=1;g<=a.linesBefore&&!(d-g<0);g++){let y=t(i.buffer,s[d-g],l[d-g],i.position-(s[d]-s[d-g]),p);h=e.repeat(" ",a.indent)+r((i.line-g+1).toString(),f)+" | "+y.str+` -`+h}let m=t(i.buffer,s[d],l[d],i.position,p);h+=e.repeat(" ",a.indent)+r((i.line+1).toString(),f)+" | "+m.str+` -`,h+=e.repeat("-",a.indent+f+3+m.pos)+`^ -`;for(let g=1;g<=a.linesAfter&&!(d+g>=l.length);g++){let y=t(i.buffer,s[d+g],l[d+g],i.position-(s[d]-s[d+g]),p);h+=e.repeat(" ",a.indent)+r((i.line+g+1).toString(),f)+" | "+y.str+` -`}return h.replace(/\n$/,"")}return k(n,"makeSnippet"),ahe=n,ahe}function qc(){if(Mtt)return ohe;Mtt=1;let e=RC(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(a){let o={};return a!==null&&Object.keys(a).forEach(function(s){a[s].forEach(function(l){o[String(l)]=s})}),o}k(n,"compileStyleAliases");function i(a,o){if(o=o||{},Object.keys(o).forEach(function(s){if(t.indexOf(s)===-1)throw new e('Unknown option "'+s+'" is met in definition of "'+a+'" YAML type.')}),this.options=o,this.tag=a,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(s){return s},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=n(o.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return k(i,"Type2"),ohe=i,ohe}function She(){if(Ltt)return she;Ltt=1;let e=RC(),t=qc();function r(a,o){let s=[];return a[o].forEach(function(l){let u=s.length;s.forEach(function(d,h){d.tag===l.tag&&d.kind===l.kind&&d.multi===l.multi&&(u=h)}),s[u]=l}),s}k(r,"compileList");function n(){let a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(s){s.multi?(a.multi[s.kind].push(s),a.multi.fallback.push(s)):a[s.kind][s.tag]=a.fallback[s.tag]=s}k(o,"collectType");for(let s=0,l=arguments.length;s=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}k(r,"isHexCode");function n(u){return u>=48&&u<=55}k(n,"isOctCode");function i(u){return u>=48&&u<=57}k(i,"isDecCode");function a(u){if(u===null)return!1;let d=u.length,h=0,f=!1;if(!d)return!1;let p=u[h];if((p==="-"||p==="+")&&(p=u[++h]),p==="0"){if(h+1===d)return!0;if(p=u[++h],p==="b"){for(h++;h=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},"binary"),octal:k(function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},"octal"),decimal:k(function(u){return u.toString(10)},"decimal"),hexadecimal:k(function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),phe}function Nhe(){if(ztt)return mhe;ztt=1;let e=IC(),t=qc(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(u){return u===null||!r.test(u)?!1:isFinite(parseFloat(u,10))?!0:n.test(u)}k(i,"resolveYamlFloat");function a(u){let d=u.toLowerCase(),h=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:h*parseFloat(d,10)}k(a,"constructYamlFloat");let o=/^[-+]?[0-9]+e/;function s(u,d){if(isNaN(u))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(u))return"-0.0";let h=u.toString(10);return o.test(h)?h.replace("e",".e"):h}k(s,"representYamlFloat");function l(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||e.isNegativeZero(u))}return k(l,"isFloat"),mhe=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:a,predicate:l,represent:s,defaultStyle:"lowercase"}),mhe}function _he(){return Gtt||(Gtt=1,ghe=Rhe().extend({implicit:[Mhe(),Lhe(),Dhe(),Nhe()]})),ghe}function Phe(){return Wtt||(Wtt=1,yhe=_he()),yhe}function Ohe(){if(Vtt)return vhe;Vtt=1;let e=qc(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=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 n(o){return o===null?!1:t.exec(o)!==null||r.exec(o)!==null}k(n,"resolveYamlTimestamp");function i(o){let s=0,l=null,u=t.exec(o);if(u===null&&(u=r.exec(o)),u===null)throw new Error("Date resolve error");let d=+u[1],h=+u[2]-1,f=+u[3];if(!u[4])return new Date(Date.UTC(d,h,f));let p=+u[4],m=+u[5],g=+u[6];if(u[7]){for(s=u[7].slice(0,3);s.length<3;)s+="0";s=+s}if(u[9]){let v=+u[10],b=+(u[11]||0);l=(v*60+b)*6e4,u[9]==="-"&&(l=-l)}let y=new Date(Date.UTC(d,h,f,p,m,g,s));return l&&y.setTime(y.getTime()-l),y}k(i,"constructYamlTimestamp");function a(o){return o.toISOString()}return k(a,"representYamlTimestamp"),vhe=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:a}),vhe}function Bhe(){if(Htt)return bhe;Htt=1;let e=qc();function t(r){return r==="<<"||r===null}return k(t,"resolveYamlMerge"),bhe=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),bhe}function Fhe(){if(qtt)return xhe;qtt=1;let e=qc(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function r(o){if(o===null)return!1;let s=0,l=o.length,u=t;for(let d=0;d64)){if(h<0)return!1;s+=6}}return s%8===0}k(r,"resolveYamlBinary");function n(o){let s=o.replace(/[\r\n=]/g,""),l=s.length,u=t,d=0,h=[];for(let p=0;p>16&255),h.push(d>>8&255),h.push(d&255)),d=d<<6|u.indexOf(s.charAt(p));let f=l%4*6;return f===0?(h.push(d>>16&255),h.push(d>>8&255),h.push(d&255)):f===18?(h.push(d>>10&255),h.push(d>>2&255)):f===12&&h.push(d>>4&255),new Uint8Array(h)}k(n,"constructYamlBinary");function i(o){let s="",l=0,u=o.length,d=t;for(let f=0;f>18&63],s+=d[l>>12&63],s+=d[l>>6&63],s+=d[l&63]),l=(l<<8)+o[f];let h=u%3;return h===0?(s+=d[l>>18&63],s+=d[l>>12&63],s+=d[l>>6&63],s+=d[l&63]):h===2?(s+=d[l>>10&63],s+=d[l>>4&63],s+=d[l<<2&63],s+=d[64]):h===1&&(s+=d[l>>2&63],s+=d[l<<4&63],s+=d[64],s+=d[64]),s}k(i,"representYamlBinary");function a(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return k(a,"isBinary"),xhe=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:a,represent:i}),xhe}function zhe(){if(Ytt)return whe;Ytt=1;let e=qc(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(a){if(a===null)return!0;let o=[],s=a;for(let l=0,u=s.length;l=48&&W<=57)return W-48;let X=W|32;return X>=97&&X<=102?X-97+10:-1}k(T,"fromHexCode");function C(W){return W===120?2:W===117?4:W===85?8:0}k(C,"escapedHexLen");function S(W){return W>=48&&W<=57?W-48:-1}k(S,"fromDecimalCode");function R(W){switch(W){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` -`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}k(R,"simpleEscapeSequence");function U(W){return W<=65535?String.fromCharCode(W):String.fromCharCode((W-65536>>10)+55296,(W-65536&1023)+56320)}k(U,"charFromCodepoint");function L(W,X,q){X==="__proto__"?Object.defineProperty(W,X,{configurable:!0,enumerable:!0,writable:!0,value:q}):W[X]=q}k(L,"setProperty");let I=new Array(256),A=new Array(256);for(let W=0;W<256;W++)I[W]=R(W)?1:0,A[W]=R(W);function P(W,X){this.input=W,this.filename=X.filename||null,this.schema=X.schema||n,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.maxDepth=typeof X.maxDepth=="number"?X.maxDepth:100,this.maxTotalMergeKeys=typeof X.maxTotalMergeKeys=="number"?X.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=W.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}k(P,"State");function D(W,X){let q={name:W.filename,buffer:W.input.slice(0,-1),position:W.position,line:W.line,column:W.position-W.lineStart};return q.snippet=r(q),new t(X,q)}k(D,"generateError");function M(W,X){throw D(W,X)}k(M,"throwError");function O(W,X){W.onWarning&&W.onWarning.call(null,D(W,X))}k(O,"throwWarning");function _(W,X,q){let j=W.anchorMapTransactions;if(j.length!==0){let se=j[j.length-1];i.call(se,X)||(se[X]={existed:i.call(W.anchorMap,X),value:W.anchorMap[X]})}W.anchorMap[X]=q}k(_,"storeAnchor");function B(W){W.anchorMapTransactions.push(Object.create(null))}k(B,"beginAnchorTransaction");function F(W){let X=W.anchorMapTransactions.pop(),q=W.anchorMapTransactions;if(q.length===0)return;let j=q[q.length-1],se=Object.keys(X);for(let J=0,K=se.length;J=0;j-=1){let se=X[q[j]];se.existed?W.anchorMap[q[j]]=se.value:delete W.anchorMap[q[j]]}}k(G,"rollbackAnchorTransaction");function z(W){return{position:W.position,line:W.line,lineStart:W.lineStart,lineIndent:W.lineIndent,firstTabInLine:W.firstTabInLine,tag:W.tag,anchor:W.anchor,kind:W.kind,result:W.result}}k(z,"snapshotState");function V(W,X){W.position=X.position,W.line=X.line,W.lineStart=X.lineStart,W.lineIndent=X.lineIndent,W.firstTabInLine=X.firstTabInLine,W.tag=X.tag,W.anchor=X.anchor,W.kind=X.kind,W.result=X.result}k(V,"restoreState");let $={YAML:k(function(X,q,j){X.version!==null&&M(X,"duplication of %YAML directive"),j.length!==1&&M(X,"YAML directive accepts exactly one argument");let se=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);se===null&&M(X,"ill-formed argument of the YAML directive");let J=parseInt(se[1],10),K=parseInt(se[2],10);J!==1&&M(X,"unacceptable YAML version of the document"),X.version=j[0],X.checkLineBreaks=K<2,K!==1&&K!==2&&O(X,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:k(function(X,q,j){let se;j.length!==2&&M(X,"TAG directive accepts exactly two arguments");let J=j[0];se=j[1],g.test(J)||M(X,"ill-formed tag handle (first argument) of the TAG directive"),i.call(X.tagMap,J)&&M(X,'there is a previously declared suffix for "'+J+'" tag handle'),y.test(se)||M(X,"ill-formed tag prefix (second argument) of the TAG directive");try{se=decodeURIComponent(se)}catch{M(X,"tag prefix is malformed: "+se)}X.tagMap[J]=se},"handleTagDirective")};function Z(W,X,q,j){if(X=32&&ee<=1114111||M(W,"expected valid JSON character")}else f.test(se)&&M(W,"the stream contains non-printable characters");W.result+=se}}k(Z,"captureSegment");function re(W,X,q,j){e.isObject(q)||M(W,"cannot merge mappings; the provided source object is unacceptable");let se=Object.keys(q);for(let J=0,K=se.length;JW.maxTotalMergeKeys&&M(W,"merge keys exceeded maxTotalMergeKeys ("+W.maxTotalMergeKeys+")"),i.call(X,ee)||(L(X,ee,q[ee]),j[ee]=!0)}}k(re,"mergeMappings");function Q(W,X,q,j,se,J,K,ee,Se){if(Array.isArray(se)){se=Array.prototype.slice.call(se);for(let Te=0,Ae=se.length;Te1&&(W.result+=e.repeat(` -`,X-1))}k(ue,"writeFoldedLines");function fe(W,X,q){let j,se,J,K,ee,Se,Te=W.kind,Ae=W.result,Ie=W.input.charCodeAt(W.position);if(E(Ie)||w(Ie)||Ie===35||Ie===38||Ie===42||Ie===33||Ie===124||Ie===62||Ie===39||Ie===34||Ie===37||Ie===64||Ie===96)return!1;if(Ie===63||Ie===45){let Ge=W.input.charCodeAt(W.position+1);if(E(Ge)||q&&w(Ge))return!1}for(W.kind="scalar",W.result="",j=se=W.position,J=!1;Ie!==0;){if(Ie===58){let Ge=W.input.charCodeAt(W.position+1);if(E(Ge)||q&&w(Ge))break}else if(Ie===35){let Ge=W.input.charCodeAt(W.position-1);if(E(Ge))break}else{if(W.position===W.lineStart&&pe(W)||q&&w(Ie))break;if(b(Ie))if(K=W.line,ee=W.lineStart,Se=W.lineIndent,ie(W,!1,-1),W.lineIndent>=X){J=!0,Ie=W.input.charCodeAt(W.position);continue}else{W.position=se,W.line=K,W.lineStart=ee,W.lineIndent=Se;break}}J&&(Z(W,j,se,!1),ue(W,W.line-K),j=se=W.position,J=!1),x(Ie)||(se=W.position+1),Ie=W.input.charCodeAt(++W.position)}return Z(W,j,se,!1),W.result?!0:(W.kind=Te,W.result=Ae,!1)}k(fe,"readPlainScalar");function Me(W,X){let q,j,se=W.input.charCodeAt(W.position);if(se!==39)return!1;for(W.kind="scalar",W.result="",W.position++,q=j=W.position;(se=W.input.charCodeAt(W.position))!==0;)if(se===39)if(Z(W,q,W.position,!0),se=W.input.charCodeAt(++W.position),se===39)q=W.position,W.position++,j=W.position;else return!0;else b(se)?(Z(W,q,j,!0),ue(W,ie(W,!1,X)),q=j=W.position):W.position===W.lineStart&&pe(W)?M(W,"unexpected end of the document within a single quoted scalar"):(W.position++,x(se)||(j=W.position));M(W,"unexpected end of the stream within a single quoted scalar")}k(Me,"readSingleQuotedScalar");function Ce(W,X){let q,j,se,J=W.input.charCodeAt(W.position);if(J!==34)return!1;for(W.kind="scalar",W.result="",W.position++,q=j=W.position;(J=W.input.charCodeAt(W.position))!==0;){if(J===34)return Z(W,q,W.position,!0),W.position++,!0;if(J===92){if(Z(W,q,W.position,!0),J=W.input.charCodeAt(++W.position),b(J))ie(W,!1,X);else if(J<256&&I[J])W.result+=A[J],W.position++;else if((se=C(J))>0){let K=se,ee=0;for(;K>0;K--)J=W.input.charCodeAt(++W.position),(se=T(J))>=0?ee=(ee<<4)+se:M(W,"expected hexadecimal character");W.result+=U(ee),W.position++}else M(W,"unknown escape sequence");q=j=W.position}else b(J)?(Z(W,q,j,!0),ue(W,ie(W,!1,X)),q=j=W.position):W.position===W.lineStart&&pe(W)?M(W,"unexpected end of the document within a double quoted scalar"):(W.position++,x(J)||(j=W.position))}M(W,"unexpected end of the stream within a double quoted scalar")}k(Ce,"readDoubleQuotedScalar");function Ye(W,X){let q=!0,j,se,J,K=W.tag,ee,Se=W.anchor,Te,Ae,Ie,Ge,De=Object.create(null),He,ze,Ke,we=W.input.charCodeAt(W.position);if(we===91)Te=93,Ge=!1,ee=[];else if(we===123)Te=125,Ge=!0,ee={};else return!1;for(W.anchor!==null&&_(W,W.anchor,ee),we=W.input.charCodeAt(++W.position);we!==0;){if(ie(W,!0,X),we=W.input.charCodeAt(W.position),we===Te)return W.position++,W.tag=K,W.anchor=Se,W.kind=Ge?"mapping":"sequence",W.result=ee,!0;if(q?we===44&&M(W,"expected the node content, but found ','"):M(W,"missed comma between flow collection entries"),ze=He=Ke=null,Ae=Ie=!1,we===63){let bt=W.input.charCodeAt(W.position+1);E(bt)&&(Ae=Ie=!0,W.position++,ie(W,!0,X))}j=W.line,se=W.lineStart,J=W.position,he(W,X,a,!1,!0),ze=W.tag,He=W.result,ie(W,!0,X),we=W.input.charCodeAt(W.position),(Ie||W.line===j)&&we===58&&(Ae=!0,we=W.input.charCodeAt(++W.position),ie(W,!0,X),he(W,X,a,!1,!0),Ke=W.result),Ge?Q(W,ee,De,ze,He,Ke,j,se,J):Ae?ee.push(Q(W,null,De,ze,He,Ke,j,se,J)):ee.push(He),ie(W,!0,X),we=W.input.charCodeAt(W.position),we===44?(q=!0,we=W.input.charCodeAt(++W.position)):q=!1}M(W,"unexpected end of the stream within a flow collection")}k(Ye,"readFlowCollection");function Ze(W,X){let q,j=u,se=!1,J=!1,K=X,ee=0,Se=!1,Te,Ae=W.input.charCodeAt(W.position);if(Ae===124)q=!1;else if(Ae===62)q=!0;else return!1;for(W.kind="scalar",W.result="";Ae!==0;)if(Ae=W.input.charCodeAt(++W.position),Ae===43||Ae===45)u===j?j=Ae===43?h:d:M(W,"repeat of a chomping mode identifier");else if((Te=S(Ae))>=0)Te===0?M(W,"bad explicit indentation width of a block scalar; it cannot be less than one"):J?M(W,"repeat of an indentation width identifier"):(K=X+Te-1,J=!0);else break;if(x(Ae)){do Ae=W.input.charCodeAt(++W.position);while(x(Ae));if(Ae===35)do Ae=W.input.charCodeAt(++W.position);while(!b(Ae)&&Ae!==0)}for(;Ae!==0;){for(ge(W),W.lineIndent=0,Ae=W.input.charCodeAt(W.position);(!J||W.lineIndentK&&(K=W.lineIndent),b(Ae)){ee++;continue}if(!J&&K===0&&M(W,"missing indentation for block scalar"),W.lineIndentX)&&K!==0)M(W,"bad indentation of a sequence entry");else if(W.lineIndentX)&&(He&&(se=W.line,J=W.lineStart,K=W.position),he(W,X,l,!0,j)&&(He?Ge=W.result:De=W.result),He||(Q(W,Te,Ae,Ie,Ge,De,se,J,K),Ie=Ge=De=null),ie(W,!0,-1),Ke=W.input.charCodeAt(W.position)),(W.line===bt||W.lineIndent>X)&&Ke!==0)M(W,"bad indentation of a mapping entry");else if(W.lineIndent=W.maxDepth&&M(W,"nesting exceeded maxDepth ("+W.maxDepth+")"),W.depth+=1,W.listener!==null&&W.listener("open",W),W.tag=null,W.anchor=null,W.kind=null,W.result=null;let He=J=K=l===q||s===q;if(j&&ie(W,!0,-1)&&(Se=!0,W.lineIndent>X?ee=1:W.lineIndent===X?ee=0:W.lineIndentX?ee=1:W.lineIndent===X?ee=0:W.lineIndent tag; it should be "scalar", not "'+W.kind+'"');for(let ze=0,Ke=W.implicitTypes.length;ze"),W.result!==null&&Ie.kind!==W.kind&&M(W,"unacceptable node kind for !<"+W.tag+'> tag; it should be "'+Ie.kind+'", not "'+W.kind+'"'),Ie.resolve(W.result,W.tag)?(W.result=Ie.construct(W.result,W.tag),W.anchor!==null&&_(W,W.anchor,W.result)):M(W,"cannot resolve a node with !<"+W.tag+"> explicit tag")}return W.listener!==null&&W.listener("close",W),W.depth-=1,W.tag!==null||W.anchor!==null||Te}k(he,"composeNode");function de(W){let X=W.position,q=!1,j;for(W.version=null,W.checkLineBreaks=W.legacy,W.tagMap=Object.create(null),W.anchorMap=Object.create(null);(j=W.input.charCodeAt(W.position))!==0&&(ie(W,!0,-1),j=W.input.charCodeAt(W.position),!(W.lineIndent>0||j!==37));){q=!0,j=W.input.charCodeAt(++W.position);let se=W.position;for(;j!==0&&!E(j);)j=W.input.charCodeAt(++W.position);let J=W.input.slice(se,W.position),K=[];for(J.length<1&&M(W,"directive name must not be less than one character in length");j!==0;){for(;x(j);)j=W.input.charCodeAt(++W.position);if(j===35){do j=W.input.charCodeAt(++W.position);while(j!==0&&!b(j));break}if(b(j))break;for(se=W.position;j!==0&&!E(j);)j=W.input.charCodeAt(++W.position);K.push(W.input.slice(se,W.position))}j!==0&&ge(W),i.call($,J)?$[J](W,J,K):O(W,'unknown document directive "'+J+'"')}if(ie(W,!0,-1),W.lineIndent===0&&W.input.charCodeAt(W.position)===45&&W.input.charCodeAt(W.position+1)===45&&W.input.charCodeAt(W.position+2)===45?(W.position+=3,ie(W,!0,-1)):q&&M(W,"directives end mark is expected"),he(W,W.lineIndent-1,l,!1,!0),ie(W,!0,-1),W.checkLineBreaks&&p.test(W.input.slice(X,W.position))&&O(W,"non-ASCII line breaks are interpreted as content"),W.documents.push(W.result),W.position===W.lineStart&&pe(W)){W.input.charCodeAt(W.position)===46&&(W.position+=3,ie(W,!0,-1));return}W.position"u"&&(q=X,X=null);let j=me(W,q);if(typeof X!="function")return j;for(let se=0,J=j.length;se=32&&K<=126||K>=161&&K<=55295&&K!==8232&&K!==8233||K>=57344&&K<=65533&&K!==a||K>=65536&&K<=1114111}k(re,"isPrintable");function Q(K){return re(K)&&K!==a&&K!==l&&K!==s}k(Q,"isNsCharOrWhitespace");function ge(K,ee,Se){let Te=Q(K),Ae=Te&&!Z(K);return(Se?Te:Te&&K!==v&&K!==S&&K!==R&&K!==L&&K!==A)&&K!==f&&!(ee===x&&!Ae)||Q(ee)&&!Z(ee)&&K===f||ee===x&&Ae}k(ge,"isPlainSafe");function ie(K){return re(K)&&K!==a&&!Z(K)&&K!==b&&K!==T&&K!==x&&K!==v&&K!==S&&K!==R&&K!==L&&K!==A&&K!==f&&K!==m&&K!==y&&K!==d&&K!==I&&K!==E&&K!==w&&K!==g&&K!==h&&K!==p&&K!==C&&K!==U}k(ie,"isPlainSafeFirst");function pe(K){return!Z(K)&&K!==x}k(pe,"isPlainSafeLast");function ue(K,ee){let Se=K.charCodeAt(ee),Te;return Se>=55296&&Se<=56319&&ee+1=56320&&Te<=57343)?(Se-55296)*1024+Te-56320+65536:Se}k(ue,"codePointAt");function fe(K){return/^\n* /.test(K)}k(fe,"needIndentIndicator");let Me=1,Ce=2,Ye=3,Ze=4,Qe=5;function ve(K,ee,Se,Te,Ae,Ie,Ge,De){let He,ze=0,Ke=null,we=!1,bt=!1,Ve=Te!==-1,vt=-1,Pt=ie(ue(K,0))&&pe(ue(K,K.length-1));if(ee||Ge)for(He=0;He=65536?He+=2:He++){if(ze=ue(K,He),!re(ze))return Qe;Pt=Pt&&ge(ze,Ke,De),Ke=ze}else{for(He=0;He=65536?He+=2:He++){if(ze=ue(K,He),ze===s)we=!0,Ve&&(bt=bt||He-vt-1>Te&&K[vt+1]!==" ",vt=He);else if(!re(ze))return Qe;Pt=Pt&&ge(ze,Ke,De),Ke=ze}bt=bt||Ve&&He-vt-1>Te&&K[vt+1]!==" "}return!we&&!bt?Pt&&!Ge&&!Ae(K)?Me:Ie===F?Qe:Ce:Se>9&&fe(K)?Qe:Ge?Ie===F?Qe:Ce:bt?Ze:Ye}k(ve,"chooseScalarStyle");function Fe(K,ee,Se,Te,Ae){K.dump=(function(){if(ee.length===0)return K.quotingType===F?'""':"''";if(!K.noCompatMode&&(D.indexOf(ee)!==-1||M.test(ee)))return K.quotingType===F?'"'+ee+'"':"'"+ee+"'";let Ie=K.indent*Math.max(1,Se),Ge=K.lineWidth===-1?-1:Math.max(Math.min(K.lineWidth,40),K.lineWidth-Ie),De=Te||K.flowLevel>-1&&Se>=K.flowLevel;function He(ze){return $(K,ze)}switch(k(He,"testAmbiguity"),ve(ee,De,K.indent,Ge,He,K.quotingType,K.forceQuotes&&!Te,Ae)){case Me:return ee;case Ce:return"'"+ee.replace(/'/g,"''")+"'";case Ye:return"|"+Le(ee,K.indent)+Be(z(ee,Ie));case Ze:return">"+Le(ee,K.indent)+Be(z(ae(ee,Ge),Ie));case Qe:return'"'+de(ee)+'"';default:throw new t("impossible error: invalid scalar style")}})()}k(Fe,"writeScalar");function Le(K,ee){let Se=fe(K)?String(ee):"",Te=K[K.length-1]===` -`,Ie=Te&&(K[K.length-2]===` -`||K===` -`)?"+":Te?"":"-";return Se+Ie+` -`}k(Le,"blockHeader");function Be(K){return K[K.length-1]===` -`?K.slice(0,-1):K}k(Be,"dropEndingNewline");function ae(K,ee){let Se=/(\n+)([^\n]*)/g,Te=(function(){let De=K.indexOf(` -`);return De=De!==-1?De:K.length,Se.lastIndex=De,he(K.slice(0,De),ee)})(),Ae=K[0]===` -`||K[0]===" ",Ie,Ge;for(;Ge=Se.exec(K);){let De=Ge[1],He=Ge[2];Ie=He[0]===" ",Te+=De+(!Ae&&!Ie&&He!==""?` -`:"")+he(He,ee),Ae=Ie}return Te}k(ae,"foldString");function he(K,ee){if(K===""||K[0]===" ")return K;let Se=/ [^ ]/g,Te,Ae=0,Ie,Ge=0,De=0,He="";for(;Te=Se.exec(K);)De=Te.index,De-Ae>ee&&(Ie=Ge>Ae?Ge:De,He+=` -`+K.slice(Ae,Ie),Ae=Ie+1),Ge=De;return He+=` -`,K.length-Ae>ee&&Ge>Ae?He+=K.slice(Ae,Ge)+` -`+K.slice(Ge+1):He+=K.slice(Ae),He.slice(1)}k(he,"foldLine");function de(K){let ee="",Se=0;for(let Te=0;Te=65536?Te+=2:Te++){Se=ue(K,Te);let Ae=P[Se];!Ae&&re(Se)?(ee+=K[Te],Se>=65536&&(ee+=K[Te+1])):ee+=Ae||_(Se)}return ee}k(de,"escapeString");function me(K,ee,Se){let Te="",Ae=K.tag;for(let Ie=0,Ge=Se.length;Ie"u"&&q(K,ee,null,!1,!1))&&(Te!==""&&(Te+=","+(K.condenseFlow?"":" ")),Te+=K.dump)}K.tag=Ae,K.dump="["+Te+"]"}k(me,"writeFlowSequence");function ke(K,ee,Se,Te){let Ae="",Ie=K.tag;for(let Ge=0,De=Se.length;Ge"u"&&q(K,ee+1,null,!0,!0,!1,!0))&&((!Te||Ae!=="")&&(Ae+=V(K,ee)),K.dump&&s===K.dump.charCodeAt(0)?Ae+="-":Ae+="- ",Ae+=K.dump)}K.tag=Ie,K.dump=Ae||"[]"}k(ke,"writeBlockSequence");function le(K,ee,Se){let Te="",Ae=K.tag,Ie=Object.keys(Se);for(let Ge=0,De=Ie.length;Ge1024&&(He+="? "),He+=K.dump+(K.condenseFlow?'"':"")+":"+(K.condenseFlow?"":" "),q(K,ee,Ke,!1,!1)&&(He+=K.dump,Te+=He))}K.tag=Ae,K.dump="{"+Te+"}"}k(le,"writeFlowMapping");function W(K,ee,Se,Te){let Ae="",Ie=K.tag,Ge=Object.keys(Se);if(K.sortKeys===!0)Ge.sort();else if(typeof K.sortKeys=="function")Ge.sort(K.sortKeys);else if(K.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let De=0,He=Ge.length;De1024;bt&&(K.dump&&s===K.dump.charCodeAt(0)?ze+="?":ze+="? "),ze+=K.dump,bt&&(ze+=V(K,ee)),q(K,ee+1,we,!0,bt)&&(K.dump&&s===K.dump.charCodeAt(0)?ze+=":":ze+=": ",ze+=K.dump,Ae+=ze)}K.tag=Ie,K.dump=Ae||"{}"}k(W,"writeBlockMapping");function X(K,ee,Se){let Te=Se?K.explicitTypes:K.implicitTypes;for(let Ae=0,Ie=Te.length;Ae tag resolver accepts not "'+De+'" style');K.dump=He}return!0}}return!1}k(X,"detectType");function q(K,ee,Se,Te,Ae,Ie,Ge){K.tag=null,K.dump=Se,X(K,Se,!1)||X(K,Se,!0);let De=n.call(K.dump),He=Te;Te&&(Te=K.flowLevel<0||K.flowLevel>ee);let ze=De==="[object Object]"||De==="[object Array]",Ke,we;if(ze&&(Ke=K.duplicates.indexOf(Se),we=Ke!==-1),(K.tag!==null&&K.tag!=="?"||we||K.indent!==2&&ee>0)&&(Ae=!1),we&&K.usedDuplicates[Ke])K.dump="*ref_"+Ke;else{if(ze&&we&&!K.usedDuplicates[Ke]&&(K.usedDuplicates[Ke]=!0),De==="[object Object]")Te&&Object.keys(K.dump).length!==0?(W(K,ee,K.dump,Ae),we&&(K.dump="&ref_"+Ke+K.dump)):(le(K,ee,K.dump),we&&(K.dump="&ref_"+Ke+" "+K.dump));else if(De==="[object Array]")Te&&K.dump.length!==0?(K.noArrayIndent&&!Ge&&ee>0?ke(K,ee-1,K.dump,Ae):ke(K,ee,K.dump,Ae),we&&(K.dump="&ref_"+Ke+K.dump)):(me(K,ee,K.dump),we&&(K.dump="&ref_"+Ke+" "+K.dump));else if(De==="[object String]")K.tag!=="?"&&Fe(K,K.dump,ee,Ie,He);else{if(De==="[object Undefined]")return!1;if(K.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+De)}if(K.tag!==null&&K.tag!=="?"){let bt=encodeURI(K.tag[0]==="!"?K.tag.slice(1):K.tag).replace(/!/g,"%21");K.tag[0]==="!"?bt="!"+bt:bt.slice(0,18)==="tag:yaml.org,2002:"?bt="!!"+bt.slice(18):bt="!<"+bt+">",K.dump=bt+" "+K.dump}}return!0}k(q,"writeNode");function j(K,ee){let Se=[],Te=[];se(K,Se,Te);let Ae=Te.length;for(let Ie=0;Ie{xr();k(Jtt,"getDefaultExportFromCjs");Hc={},_V={},j2={};k(IC,"requireCommon");k(RC,"requireException");k(ert,"requireSnippet");k(qc,"requireType");k(She,"requireSchema");k(Ahe,"requireStr");k(Uhe,"requireSeq");k(Ihe,"requireMap");k(Rhe,"requireFailsafe");k(Mhe,"require_null");k(Lhe,"requireBool");k(Dhe,"requireInt");k(Nhe,"requireFloat");k(_he,"requireJson");k(Phe,"requireCore");k(Ohe,"requireTimestamp");k(Bhe,"requireMerge");k(Fhe,"requireBinary");k(zhe,"requireOmap");k(Ghe,"requirePairs");k(Whe,"requireSet");k(PV,"require_default");k(trt,"requireLoader");Che={};k(rrt,"requireDumper");k(nrt,"requireJsYaml");tpr=nrt(),rpr=Jtt(tpr),{Type:M8n,Schema:L8n,FAILSAFE_SCHEMA:D8n,JSON_SCHEMA:X2,CORE_SCHEMA:N8n,DEFAULT_SCHEMA:_8n,load:$2,loadAll:P8n,dump:O8n,YAMLException:B8n,types:F8n,safeLoad:z8n,safeLoadAll:G8n,safeDump:W8n}=rpr});function irt(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function npr(e,t){if(e!=="_next"&&e!=="_prev")return t}var OV,art=H(()=>{OV=class{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return irt(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&irt(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,npr)),n=n._prev;return"["+t.join(", ")+"]"}}});function ort(e,t){if(e.nodeCount()<=1)return[];var r=opr(e,t||ipr),n=apr(r.graph,r.buckets,r.zeroIdx);return Df(ea(n,function(i){return e.outEdges(i.v,i.w)}))}function apr(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)Vhe(e,t,r,o);for(;o=i.dequeue();)Vhe(e,t,r,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){n=n.concat(Vhe(e,t,r,o,!0));break}}}return n}function Vhe(e,t,r,n,i){var a=i?[]:void 0;return mt(e.inEdges(n.v),function(o){var s=e.edge(o),l=e.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,Hhe(t,r,l)}),mt(e.outEdges(n.v),function(o){var s=e.edge(o),l=o.w,u=e.node(l);u.in-=s,Hhe(t,r,u)}),e.removeNode(n.v),a}function opr(e,t){var r=new qi,n=0,i=0;mt(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),mt(e.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=t(s),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=Nf(i+n+3).map(function(){return new OV}),o=n+1;return mt(r.nodes(),function(s){Hhe(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function Hhe(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var ipr,srt=H(()=>{ta();Dh();art();ipr=Ud(1)});function lrt(e){var t=e.graph().acyclicer==="greedy"?ort(e,r(e)):spr(e);mt(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,D4("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function spr(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,mt(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return mt(e.nodes(),i),t}function crt(e){mt(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var qhe=H(()=>{ta();srt()});function vg(e,t,r,n){var i;do i=D4(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function drt(e){var t=new qi().setGraph(e.graph());return mt(e.nodes(),function(r){t.setNode(r,e.node(r))}),mt(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function BV(e){var t=new qi({multigraph:e.isMultigraph()}).setGraph(e.graph());return mt(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),mt(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function Yhe(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,s=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function K2(e){var t=ea(Nf(Xhe(e)+1),function(){return[]});return mt(e.nodes(),function(r){var n=e.node(r),i=n.rank;jo(i)||(t[i][n.order]=r)}),t}function hrt(e){var t=Ay(ea(e.nodes(),function(r){return e.node(r).rank}));mt(e.nodes(),function(r){var n=e.node(r);MR(n,"rank")&&(n.rank-=t)})}function frt(e){var t=Ay(ea(e.nodes(),function(a){return e.node(a).rank})),r=[];mt(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;mt(r,function(a,o){jo(a)&&o%i!==0?--n:n&&mt(a,function(s){e.node(s).rank+=n})})}function jhe(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),vg(e,"border",i,t)}function Xhe(e){return Rd(ea(e.nodes(),function(t){var r=e.node(t).rank;if(!jo(r))return r}))}function prt(e,t){var r={lhs:[],rhs:[]};return mt(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function mrt(e,t){var r=TV();try{return t()}finally{console.log(e+" time: "+(TV()-r)+"ms")}}function grt(e,t){return t()}var bg=H(()=>{ta();Dh()});function vrt(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&mt(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a{ta();bg()});function wrt(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Trt(e)}function Ert(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&lpr(e),(t==="lr"||t==="rl")&&(cpr(e),Trt(e))}function Trt(e){mt(e.nodes(),function(t){xrt(e.node(t))}),mt(e.edges(),function(t){xrt(e.edge(t))})}function xrt(e){var t=e.width;e.width=e.height,e.height=t}function lpr(e){mt(e.nodes(),function(t){$he(e.node(t))}),mt(e.edges(),function(t){var r=e.edge(t);mt(r.points,$he),Object.prototype.hasOwnProperty.call(r,"y")&&$he(r)})}function $he(e){e.y=-e.y}function cpr(e){mt(e.nodes(),function(t){Khe(e.node(t))}),mt(e.edges(),function(t){var r=e.edge(t);mt(r.points,Khe),Object.prototype.hasOwnProperty.call(r,"x")&&Khe(r)})}function Khe(e){var t=e.x;e.x=e.y,e.y=t}var krt=H(()=>{ta()});function Crt(e){e.graph().dummyChains=[],mt(e.edges(),function(t){dpr(e,t)})}function dpr(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a!==n+1){e.removeEdge(t);var u=void 0,d,h;for(h=0,++n;n{ta();bg()});function _R(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=Ay(ea(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}mt(e.sources(),r)}function B4(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var FV=H(()=>{ta()});function zV(e){var t=new qi({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;hpr(t,e){ta();Dh();FV()});var Urt=H(()=>{});var Jhe=H(()=>{});var iUn,efe=H(()=>{ta();Jhe();iUn=Ud(1)});var Irt=H(()=>{efe()});var tfe=H(()=>{});var Rrt=H(()=>{tfe()});var dUn,Mrt=H(()=>{ta();dUn=Ud(1)});function rfe(e){var t={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new PR;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,mt(e.predecessors(a),i),delete r[a],n.push(a))}if(mt(e.sinks(),i),$de(t)!==e.nodeCount())throw new PR;return n}function PR(){}var nfe=H(()=>{ta();rfe.CycleException=PR;PR.prototype=new Error});var Lrt=H(()=>{nfe()});function GV(e,t,r){Hn(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return mt(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);Drt(e,o,r==="post",a,n,i)}),i}function Drt(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),mt(i(t),function(o){Drt(e,o,r,n,i,a)}),r&&a.push(t))}var ife=H(()=>{ta()});function afe(e,t){return GV(e,t,"post")}var Nrt=H(()=>{ife()});function ofe(e,t){return GV(e,t,"pre")}var _rt=H(()=>{ife()});var Prt=H(()=>{Jhe();Qde()});var Ort=H(()=>{Urt();efe();Irt();Rrt();Mrt();Lrt();Nrt();_rt();Prt();tfe();nfe()});function Q2(e){e=drt(e),_R(e);var t=zV(e);lfe(t),sfe(t,e);for(var r,n;r=Grt(t);)n=Wrt(t,e,r),Vrt(t,e,r,n)}function sfe(e,t){var r=afe(e,e.nodes());r=r.slice(0,r.length-1),mt(r,function(n){bpr(e,t,n)})}function bpr(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=Frt(e,t,r)}function Frt(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),s=0;return o||(a=!1,o=t.edge(i,r)),s=o.weight,mt(t.nodeEdges(r),function(l){var u=l.v===r,d=u?l.w:l.v;if(d!==i){var h=u===a,f=t.edge(l).weight;if(s+=h?f:-f,wpr(e,r,d)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function lfe(e,t){arguments.length<2&&(t=e.nodes()[0]),zrt(e,{},1,t)}function zrt(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,mt(e.neighbors(n),function(s){Object.prototype.hasOwnProperty.call(t,s)||(r=zrt(e,t,r,s,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function Grt(e){return CC(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Wrt(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=Uu(t.edges(),function(d){return l===Brt(e,e.node(d.v),s)&&l!==Brt(e,e.node(d.w),s)});return M4(u,function(d){return B4(t,d)})}function Vrt(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),lfe(e),sfe(e,t),xpr(e,t)}function xpr(e,t){var r=CC(e.nodes(),function(i){return!t.node(i).parent}),n=ofe(e,r);n=n.slice(1),mt(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),s=!1;o||(o=t.edge(a,i),s=!0),t.node(i).rank=t.node(a).rank+(s?o.minlen:-o.minlen)})}function wpr(e,t,r){return e.hasEdge(t,r)}function Brt(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Hrt=H(()=>{ta();Ort();bg();Qhe();FV();Q2.initLowLimValues=lfe;Q2.initCutValues=sfe;Q2.calcCutValue=Frt;Q2.leaveEdge=Grt;Q2.enterEdge=Wrt;Q2.exchangeEdges=Vrt});function cfe(e){switch(e.graph().ranker){case"network-simplex":qrt(e);break;case"tight-tree":Tpr(e);break;case"longest-path":Epr(e);break;default:qrt(e)}}function Tpr(e){_R(e),zV(e)}function qrt(e){Q2(e)}var Epr,ufe=H(()=>{Qhe();Hrt();FV();Epr=_R});function Yrt(e){var t=vg(e,"root",{},"_root"),r=kpr(e),n=Rd(Lh(r))-1,i=2*n+1;e.graph().nestingRoot=t,mt(e.edges(),function(o){e.edge(o).minlen*=i});var a=Cpr(e)+1;mt(e.children(),function(o){jrt(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function jrt(e,t,r,n,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var l=jhe(e,"_bt"),u=jhe(e,"_bb"),d=e.node(o);e.setParent(l,o),d.borderTop=l,e.setParent(u,o),d.borderBottom=u,mt(s,function(h){jrt(e,t,r,n,i,a,h);var f=e.node(h),p=f.borderTop?f.borderTop:h,m=f.borderBottom?f.borderBottom:h,g=f.borderTop?n:2*n,y=p!==m?1:i-a[o]+1;e.setEdge(l,p,{weight:g,minlen:y,nestingEdge:!0}),e.setEdge(m,u,{weight:g,minlen:y,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}function kpr(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&mt(a,function(o){r(o,i+1)}),t[n]=i}return mt(e.children(),function(n){r(n,1)}),t}function Cpr(e){return gg(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function Xrt(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,mt(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var $rt=H(()=>{ta();bg()});function Krt(e,t,r){var n={},i;mt(r,function(a){for(var o=e.parent(a),s,l;o;){if(s=e.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){t.setEdge(l,o);return}o=s}})}var Zrt=H(()=>{ta()});function Qrt(e,t,r){var n=Apr(e),i=new qi({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return mt(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||n),mt(e[r](a),function(l){var u=l.v===a?l.w:l.v,d=i.edge(u,a),h=jo(d)?0:d.weight;i.setEdge(u,a,{weight:e.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Apr(e){for(var t;e.hasNode(t=D4("_root")););return t}var Jrt=H(()=>{ta();Dh()});function ent(e,t){for(var r=0,n=1;n0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}var tnt=H(()=>{ta()});function rnt(e){var t={},r=Uu(e.nodes(),function(s){return!e.children(s).length}),n=Rd(ea(r,function(s){return e.node(s).rank})),i=ea(Nf(n+1),function(){return[]});function a(s){if(!MR(t,s)){t[s]=!0;var l=e.node(s);i[l.rank].push(s),mt(e.successors(s),a)}}var o=yg(r,function(s){return e.node(s).rank});return mt(o,a),i}var nnt=H(()=>{ta()});function int(e,t){return ea(t,function(r){var n=e.inEdges(r);if(n.length){var i=gg(n,function(a,o){var s=e.edge(o),l=e.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var ant=H(()=>{ta()});function ont(e,t){var r={};mt(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};jo(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),mt(t.edges(),function(i){var a=r[i.v],o=r[i.w];!jo(a)&&!jo(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=Uu(r,function(i){return!i.indegree});return Ipr(n)}function Ipr(e){var t=[];function r(a){return function(o){o.merged||(jo(o.barycenter)||jo(a.barycenter)||o.barycenter>=a.barycenter)&&Rpr(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(;e.length;){var i=e.pop();t.push(i),mt(i.in.reverse(),r(i)),mt(i.out,n(i))}return ea(Uu(t,function(a){return!a.merged}),function(a){return L4(a,["vs","i","barycenter","weight"])})}function Rpr(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var snt=H(()=>{ta()});function cnt(e,t){var r=prt(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=yg(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(Mpr(!!t)),l=lnt(a,i,l),mt(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=lnt(a,i,l)});var u={vs:Df(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function lnt(e,t,r){for(var n;t.length&&(n=Y2(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Mpr(e){return function(t,r){return t.barycenterr.barycenter?1:e?r.i-t.i:t.i-r.i}}var unt=H(()=>{ta();bg()});function dfe(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=Uu(i,function(m){return m!==o&&m!==s}));var u=int(e,i);mt(u,function(m){if(e.children(m.v).length){var g=dfe(e,m.v,r,n);l[m.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Dpr(m,g)}});var d=ont(u,r);Lpr(d,l);var h=cnt(d,n);if(o&&(h.vs=Df([o,h.vs,s]),e.predecessors(o).length)){var f=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+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function Lpr(e,t){mt(e,function(r){r.vs=Df(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function Dpr(e,t){jo(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)}var dnt=H(()=>{ta();ant();snt();unt()});function pnt(e){var t=Xhe(e),r=hnt(e,Nf(1,t+1),"inEdges"),n=hnt(e,Nf(t-1,-1,-1),"outEdges"),i=rnt(e);fnt(e,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){Npr(s%2?r:n,s%4>=2),i=K2(e);var u=ent(e,i);u{ta();Dh();bg();Zrt();Jrt();tnt();nnt();dnt()});function gnt(e){var t=Ppr(e);mt(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=_pr(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(u=o[l])!==s&&e.node(u).maxRanko||s>t[l].lim));for(u=l,l=n;(l=e.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function Ppr(e){var t={},r=0;function n(i){var a=r;mt(e.children(i),n),t[i]={low:a,lim:r++}}return mt(e.children(),n),t}var ynt=H(()=>{ta()});function Opr(e,t){var r={};function n(i,a){var o=0,s=0,l=i.length,u=Y2(a);return mt(a,function(d,h){var f=Fpr(e,d),p=f?e.node(f).order:l;(f||d===u)&&(mt(a.slice(s,h+1),function(m){mt(e.predecessors(m),function(g){var y=e.node(g),v=y.order;(vu)&&vnt(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return mt(o,function(d,h){if(e.node(d).dummy==="border"){var f=e.predecessors(d);f.length&&(l=e.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return gg(t,i),r}function Fpr(e,t){if(e.node(t).dummy)return CC(e.predecessors(t),function(r){return e.node(r).dummy})}function vnt(e,t,r){if(t>r){var n=t;t=r,r=n}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function zpr(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Gpr(e,t,r,n){var i={},a={},o={};return mt(t,function(s){mt(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),mt(t,function(s){var l=-1;mt(s,function(u){var d=n(u);if(d.length){d=yg(d,function(g){return o[g]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var m=d[f];a[u]===u&&l{ta();Dh();bg()});function wnt(e){e=BV(e),$pr(e),qde(bnt(e),function(t,r){e.node(r).x=t})}function $pr(e){var t=K2(e),r=e.graph().ranksep,n=0;mt(t,function(i){var a=Rd(ea(i,function(o){return e.node(o).height}));mt(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}var Ent=H(()=>{ta();bg();xnt()});function OR(e,t){var r=t&&t.debugTiming?mrt:grt;r("layout",()=>{var n=r(" buildLayoutGraph",()=>o0r(e));r(" runLayout",()=>Kpr(n,r)),r(" updateInputGraph",()=>Zpr(e,n))})}function Kpr(e,t){t(" makeSpaceForEdgeLabels",()=>s0r(e)),t(" removeSelfEdges",()=>g0r(e)),t(" acyclic",()=>lrt(e)),t(" nestingGraph.run",()=>Yrt(e)),t(" rank",()=>cfe(BV(e))),t(" injectEdgeLabelProxies",()=>l0r(e)),t(" removeEmptyRanks",()=>frt(e)),t(" nestingGraph.cleanup",()=>Xrt(e)),t(" normalizeRanks",()=>hrt(e)),t(" assignRankMinMax",()=>c0r(e)),t(" removeEdgeLabelProxies",()=>u0r(e)),t(" normalize.run",()=>Crt(e)),t(" parentDummyChains",()=>gnt(e)),t(" addBorderSegments",()=>vrt(e)),t(" order",()=>pnt(e)),t(" insertSelfEdges",()=>y0r(e)),t(" adjustCoordinateSystem",()=>wrt(e)),t(" position",()=>wnt(e)),t(" positionSelfEdges",()=>v0r(e)),t(" removeBorderNodes",()=>m0r(e)),t(" normalize.undo",()=>Srt(e)),t(" fixupEdgeLabelCoords",()=>f0r(e)),t(" undoCoordinateSystem",()=>Ert(e)),t(" translateGraph",()=>d0r(e)),t(" assignNodeIntersects",()=>h0r(e)),t(" reversePoints",()=>p0r(e)),t(" acyclic.undo",()=>crt(e))}function Zpr(e,t){mt(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),mt(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function o0r(e){var t=new qi({multigraph:!0,compound:!0}),r=ffe(e.graph());return t.setGraph(AC({},Jpr,hfe(r,Qpr),L4(r,e0r))),mt(e.nodes(),function(n){var i=ffe(e.node(n));t.setNode(n,Bde(hfe(i,t0r),r0r)),t.setParent(n,e.parent(n))}),mt(e.edges(),function(n){var i=ffe(e.edge(n));t.setEdge(n,AC({},i0r,hfe(i,n0r),L4(i,a0r)))}),t}function s0r(e){var t=e.graph();t.ranksep/=2,mt(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function l0r(e){mt(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};vg(e,"edge-proxy",a,"_ep")}})}function c0r(e){var t=0;mt(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Rd(t,n.maxRank))}),e.graph().maxRank=t}function u0r(e){mt(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function d0r(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(u){var d=u.x,h=u.y,f=u.width,p=u.height;t=Math.min(t,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}mt(e.nodes(),function(u){l(e.node(u))}),mt(e.edges(),function(u){var d=e.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),t-=o,n-=s,mt(e.nodes(),function(u){var d=e.node(u);d.x-=t,d.y-=n}),mt(e.edges(),function(u){var d=e.edge(u);mt(d.points,function(h){h.x-=t,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+s}function h0r(e){mt(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(Yhe(n,a)),r.points.push(Yhe(i,o))})}function f0r(e){mt(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function p0r(e){mt(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function m0r(e){mt(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(Y2(r.borderLeft)),o=e.node(Y2(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),mt(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function g0r(e){mt(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function y0r(e){var t=K2(e);mt(t,function(r){var n=0;mt(r,function(i,a){var o=e.node(i);o.order=a+n,mt(o.selfEdges,function(s){vg(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function v0r(e){mt(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.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}],r.label.x=r.x,r.label.y=r.y}})}function hfe(e,t){return R4(L4(e,t),Number)}function ffe(e){var t={};return mt(e,function(r,n){t[n.toLowerCase()]=r}),t}var Qpr,Jpr,e0r,t0r,r0r,n0r,i0r,a0r,Tnt=H(()=>{ta();Dh();brt();krt();qhe();Zhe();ufe();$rt();mnt();ynt();Ent();bg();Qpr=["nodesep","edgesep","ranksep","marginx","marginy"],Jpr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},e0r=["acyclicer","ranker","rankdir","align"],t0r=["width","height"],r0r={width:0,height:0},n0r=["minlen","weight","width","height","labeloffset"],i0r={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},a0r=["labelpos"]});var pfe=H(()=>{qhe();Tnt();Zhe();ufe()});var Lnt={};gr(Lnt,{applyDagreLayoutResult:()=>Int,getEdgesToRender:()=>mfe,measureDagreLayout:()=>Rnt,prepareLayoutForDagre:()=>gfe,render:()=>R0r,runDagreLayoutCore:()=>Mnt});var knt,Cnt,b0r,x0r,w0r,E0r,T0r,mfe,Ant,Unt,k0r,Snt,C0r,Int,S0r,A0r,gfe,Rnt,Mnt,U0r,I0r,R0r,Dnt=H(()=>{NV();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();pfe();Dh();knt=k((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),Cnt=k((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),b0r=k(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),x0r=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],w0r=k((e,t,r,n,i)=>{let a=[],o=new Set;if(r.forEach(({start:d,end:h})=>{d!==n&&o.add(d),h!==n&&o.add(h)}),o.forEach(d=>{let h=e.node(d);typeof h?.x=="number"&&typeof h?.y=="number"&&a.push(h)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(h=>{typeof h?.x=="number"&&typeof h?.y=="number"&&a.push(h)})}),a.length===0)return Cnt(i);let s=a.reduce((d,h)=>({x:d.x+h.x/a.length,y:d.y+h.y/a.length}),{x:0,y:0}),l=s.x-t.x,u=s.y-t.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":Cnt(i)},"getSelfLoopSide"),E0r=k((e,t="top",r=0,n=0)=>{let i=e.x,a=e.y-r,o=e.width/2,s=e.height/2,l=Math.max(36,Math.min(100,e.width*.8)),u=knt(Math.max(n,e.width*.35),36,l),d=knt(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{let h=a+s;return[{x:i-u/2,y:h},{x:i-u/2,y:h+d},{x:i+u/2,y:h+d},{x:i+u/2,y:h}]}case"right":{let h=i+o;return[{x:h,y:a-u/2},{x:h+d,y:a-u/2},{x:h+d,y:a+u/2},{x:h,y:a+u/2}]}case"left":{let h=i-o;return[{x:h,y:a-u/2},{x:h-d,y:a-u/2},{x:h-d,y:a+u/2},{x:h,y:a+u/2}]}default:{let h=a-s;return[{x:i-u/2,y:h},{x:i-u/2,y:h-d},{x:i+u/2,y:h-d},{x:i+u/2,y:h}]}}},"getSelfLoopPoints"),T0r=k((e,t,r="top",n=0,i={})=>{let o=e.x,s=e.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(d=>d.y))+u/2+4};case"right":return{x:Math.max(...t.map(d=>d.x))+l/2+4,y:s};case"left":return{x:Math.min(...t.map(d=>d.x))-l/2-4,y:s};default:return{x:o,y:Math.min(...t.map(d=>d.y))-u/2-4}}},"getSelfLoopLabelPosition"),mfe=k((e,t=0,{mergeSelfLoops:r=!0}={})=>{let n=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(o=>{let s=e.edge(o);if(r&&s.selfLoop){let l=s.selfLoop.id;n.has(l)||n.set(l,[]),n.get(l).push({edge:s,start:o.v,end:o.w})}else i.push({edge:s,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(v=>i.push(v));return}o.sort((v,b)=>v.edge.selfLoop.order-b.edge.selfLoop.order);let[s,l,u]=o,d=s.edge.originalEdge??l.edge.originalEdge??u.edge.originalEdge??l.edge,h=e.node(d.start);if(!h){o.forEach(v=>i.push(v));return}let f={width:l.edge.width,height:l.edge.height},p=w0r(e,h,o,d.start,a),m=E0r(h,p,t,f.width??0),g=T0r(h,m,p,t,f),y={...l.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:g.x,y:g.y,width:f.width,height:f.height,labelStyle:l.edge.labelStyle,fromCluster:s.edge.fromCluster??l.edge.fromCluster??u.edge.fromCluster,toCluster:s.edge.toCluster??l.edge.toCluster??u.edge.toCluster};delete y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),Ant=k(async({element:e,graph:t,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;ye.trace("Dir in recursive render - dir:",o);let{clusters:s,edgePaths:l,edgeLabels:u,nodes:d,rootGroups:h}=MV(e,{edgePathsClass:"edgePaths"});t.nodes()?ye.info("Recursive render XXX",t.nodes()):ye.info("No nodes found for",t),t.edges().length>0&&ye.info("Recursive edges",t.edge(t.edges()[0]));let f=b0r(r);await Promise.all(t.nodes().map(async function(g){let y=t.node(g);if(i!==void 0){let v=JSON.parse(JSON.stringify(i.clusterData));ye.trace(`Setting data for parent cluster XXX - Node.id = `,g,` - data=`,v.height,` -Parent cluster`,i.height),t.setNode(i.id,v),t.parent(g)||(ye.trace("Setting parent",g,i.id),t.setParent(g,i.id,v))}if(ye.info("(Insert) Node XXX"+g+": "+JSON.stringify(t.node(g))),y?.clusterNode){ye.info("Cluster identified XBX",g,y.width,t.node(g));let{ranksep:v,nodesep:b}=t.graph();y.graph.setGraph({...y.graph.graph(),ranksep:v+25,nodesep:b});let x=await A0r({element:d,graph:y.graph,diagramType:r,id:n,parentCluster:t.node(g),siteConfig:a}),E=x.elem;pr(y,E),y.diff=x.diff||0,ye.info("New compound node after recursive render XAX",g,"width",y.width,"height",y.height),e$e(E,y)}else t.children(g).length>0?(ye.trace("Cluster - the non recursive path XBX",g,y.id,y,y.width,"Graph:",t),ye.trace(P4(y.id,t)),Pn.set(y.id,{id:P4(y.id,t),node:y})):(ye.trace("Node - the non recursive path XAX",g,d,t.node(g),o),await LV(d,t.node(g),{config:a,dir:o}))})),await k(async()=>{let g=t.edges().map(async function(y){let v=t.edge(y.v,y.w,y.name);if(ye.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(y)),ye.info("Edge "+y.v+" -> "+y.w+": ",y," ",JSON.stringify(t.edge(y))),ye.info("Fix",Pn,"ids:",y.v,y.w,"Translating: ",Pn.get(y.v),Pn.get(y.w)),f&&v.selfLoop){if(v.selfLoop.order!==1)return;let b={...v.originalEdge,...v,id:v.selfLoop.id,startLabelLeft:v.originalEdge?.startLabelLeft??v.startLabelLeft,startLabelRight:v.originalEdge?.startLabelRight??v.startLabelRight,endLabelLeft:v.originalEdge?.endLabelLeft??v.endLabelLeft,endLabelRight:v.originalEdge?.endLabelRight??v.endLabelRight};await cg(u,b),v.width=b.width,v.height=b.height,v.labelStyle=b.labelStyle;return}await cg(u,v)});await Promise.all(g)},"processEdges")();let{subGraphTitleTotalMargin:m}=xy(a);return{elem:h,graph:t,groups:{clusters:s,edgePaths:l,edgeLabels:u,nodes:d,rootGroups:h},diagramType:r,id:n,mergeSelfLoops:f,subGraphTitleTotalMargin:m}},"measureDagreGraph"),Unt=k(e=>{ye.info("############################################# XXX"),ye.info("### Layout ### XXX"),ye.info("############################################# XXX"),OR(e)},"runDagreGraphLayout"),k0r=k((e,t,r)=>{let n=e.node(t);if(!n)return;let i={...n};return n?.clusterNode?i.y=(n.y??0)+r:e.children(t).length>0?i.height=(n.height??0)+r:i.y=(n.y??0)+r/2,i},"normalizeDagreNode"),Snt=k((e,t)=>{x0r.forEach(r=>{t[r]!==void 0&&(e[r]=t[r])})},"applyDagreNodeLayout"),C0r=k((e,t,r,n)=>({...e,start:e.start??t,end:e.end??r,points:(e.points??[]).map(i=>({...i,y:typeof i.y=="number"?i.y+n:i.y}))}),"normalizeDagreEdge"),Int=k((e,t)=>{let{graph:r,mergeSelfLoops:n,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(s=>[s.id,s]));DV(r).forEach(s=>{let l=k0r(r,s,i);if(!l)return;Snt(r.node(s),l);let u=a.get(s);u&&Snt(u,l)});let o=i/2;return e.edges=mfe(r,o,{mergeSelfLoops:n}).map(({edge:s,start:l,end:u})=>C0r(s,l,u,o)),e},"applyDagreLayoutResult"),S0r=k(async({elem:e,graph:t,groups:{clusters:r,edgePaths:n},diagramType:i,id:a,mergeSelfLoops:o,subGraphTitleTotalMargin:s})=>{let l=0;await Promise.all(DV(t).map(async function(h){let f=t.node(h);if(ye.info("Position XBX => "+h+": ("+f.x,","+f.y,") width: ",f.width," height: ",f.height),f?.clusterNode)f.y+=s,ye.info("A tainted cluster node XBX1",h,f.id,f.width,f.height,f.x,f.y,t.parent(h)),Pn.get(f.id).node=f,lg(f);else if(t.children(h).length>0){ye.info("A pure cluster node XBX1",h,f.id,f.x,f.y,f.width,f.height,t.parent(h)),f.height+=s,t.node(f.parentId);let p=f?.padding/2||0,m=f?.labelBBox?.height||0,g=m-p||0;ye.debug("OffsetY",g,"labelHeight",m,"halfPadding",p),await C2(r,f),Pn.get(f.id).node=f}else{let p=t.node(f.parentId);f.y+=s/2,ye.info("A regular node XBX1 - using the padding",f.id,"parent",f.parentId,f.width,f.height,f.x,f.y,"offsetY",f.offsetY,"parent",p,p?.offsetY,f),lg(f)}}));let u=s/2;return mfe(t,u,{mergeSelfLoops:o}).forEach(function({edge:h,start:f,end:p}){ye.info("Edge "+f+" -> "+p+": "+JSON.stringify(h),h),h.points.forEach(v=>v.y+=u);let m=t.node(f),g=t.node(p),y=S2(n,h,Pn,i,m,g,a);eC(h,y)}),t.nodes().forEach(function(h){let f=t.node(h);ye.info(h,f.type,f.diff),f.isGroup&&(l=f.diff)}),ye.warn("Returning from recursive render XAX",e,l),{elem:e,diff:l}},"paintDagreLayoutCore"),A0r=k(async e=>{let t=await Ant(e);return Unt(t.graph),await S0r(t)},"renderDagreSubgraph"),gfe=k(e=>{let t=new qi({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(r=>{t.setNode(r.id,{...r}),r.parentId&&t.setParent(r.id,r.parentId)}),ye.debug("Edges:",e.edges),e.edges.forEach(r=>{if(r.start===r.end){let n=r.start,i=n+"---"+n+"---1",a=n+"---"+n+"---2",o=t.node(n);t.setNode(i,{domId:i,id:i,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(i,o.parentId),t.setNode(a,{domId:a,id:a,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(a,o.parentId);let s=structuredClone(r),l=structuredClone(r),u=structuredClone(r),d=structuredClone(r);l.originalEdge=s,l.selfLoop={id:s.id,order:0},u.originalEdge=s,u.selfLoop={id:s.id,order:1},d.originalEdge=s,d.selfLoop={id:s.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=n+"-cyclic-special-1",u.startLabelRight="",u.startLabelLeft="",u.endLabelLeft="",u.endLabelRight="",u.arrowTypeStart="none",u.arrowTypeEnd="none",u.id=n+"-cyclic-special-mid",d.label="",d.startLabelRight="",d.startLabelLeft="",d.arrowTypeStart="none",o.isGroup&&(l.fromCluster=n,d.toCluster=n),d.id=n+"-cyclic-special-2",d.arrowTypeStart="none",t.setEdge(n,i,l,n+"-cyclic-special-0"),t.setEdge(i,a,u,n+"-cyclic-special-1"),t.setEdge(a,n,d,n+"-cyclic-special-2")}else t.setEdge(r.start,r.end,{...r},r.id)}),ytt(t),{graph:t}},"prepareLayoutForDagre"),Rnt=k(async(e,{element:t,preparedLayout:r})=>{let n=r??gfe(e),i=je(),a=await Ant({element:t,graph:n.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return n.measuredLayout=a,a},"measureDagreLayout"),Mnt=k((e,t)=>{let r=t.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Unt(r.graph),Int(e,r),r},"runDagreLayoutCore"),U0r=k((e,{measure:t})=>DV(t.graph).map(r=>t.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),I0r=k((e,t,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),R0r=UC({prepareLayout:gfe,measureLayout:Rnt,runLayoutCore:Mnt,paintOptions:{clusterDb:Pn,getNodes:U0r,getEdgeNode:I0r,skipNode:k((e,{measure:t})=>!t.graph.hasNode(e.id),"skipNode"),isCluster:k((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,"isCluster")}})});var bat={};gr(bat,{render:()=>W0r});function $V(e){let t=[];for(let r=0;r=1-VV||f<=VV||f>=1-VV?null:{point:{x:e.x+h*i,y:e.y+h*a},tA:h,tB:f}}function wfe(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function Gnt(e){let t=[];for(let r=0;r=Math.abs(r)?t>=0?1:0:r>=0?1:0}function Vnt(e,t){if(e.length<2)return e.map(a=>({...a}));let r=e.map(a=>({...a})),n=t.arrowTypeStart&&il[t.arrowTypeStart];if(n){let a=e[0],o=e[1],s=Math.atan2(o.y-a.y,o.x-a.x);r[0].x=a.x+n*Math.cos(s),r[0].y=a.y+n*Math.sin(s)}let i=t.arrowTypeEnd&&il[t.arrowTypeEnd];if(i){let a=e.length,o=e[a-2],s=e[a-1],l=Math.atan2(s.y-o.y,s.x-o.x);r[a-1].x=s.x-i*Math.cos(l),r[a-1].y=s.y-i*Math.sin(l)}return r}function Hnt(e,t,r,n,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-r*e.r},l={x:a+t*e.r,y:o+r*e.r},u=[`L${LC(s)}`];return i==="arc"?u.push(`A${b0(e.r)},${b0(e.r)} 0 0 ${n} ${LC(l)}`):u.push(`M${LC(l)}`),u}function Efe(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=r.x-t.x,s=r.y-t.y,l=Math.hypot(i,a),u=Math.hypot(o,s);if(l0){let x=Efe(i[u-1],i[u],i[u+1]??i[u],Nnt);x&&(g=x.cutLen)}let y=h,v=null;a&&ux.t-E.t);for(let x of b)x.r=Math.min(x.r,x.d-g,y-x.d);for(let x=0;xE){let w=E/2;b[x].r=Math.min(b[x].r,w),b[x+1].r=Math.min(b[x+1].r,w)}}for(let x of b)x.r=2?n:null}catch{return null}}function $nt(e,t,r){if(!r.enabled)return;let n=e.node();if(!n)return;let i=new Map;for(let u of t)i.set(u.id,u);let a=[],o=new Map;for(let u of t){let d=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,h=n.querySelector(`path[data-id="${d}"]`);if(!h)continue;o.set(u.id,h);let p=Xnt(h.getAttribute("data-points"))??u.points;a.push({...u,points:p})}let s=Gnt(a);if(s.length===0)return;let l=new Map;for(let u of s){let d=l.get(u.jumpEdgeId)??[];d.push(u),l.set(u.jumpEdgeId,d)}for(let u of a){let d=l.get(u.id);if(!d||d.length===0)continue;let f=i.get(u.id)?.curve;if(f!==void 0&&!jnt(f))continue;let p=o.get(u.id);if(!p)continue;if(f===void 0){let x=p.getAttribute("d")??"";if(!Ynt(x))continue}let m=p.getAttribute("style")??"",g=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(m),y=g?Number.parseFloat(g[1]):null,v=g?Number.parseFloat(g[2]):null,b=qnt(u,d,r);if(p.setAttribute("d",b),y!==null&&v!==null&&typeof p.getTotalLength=="function"){let x=p.getTotalLength(),E=Math.max(0,x-y-v),w=`0 ${y} ${E} ${v}`,T=m.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${w};`).replace(/;\s*;+/g,";");p.setAttribute("style",T)}}}function Knt(e,{measure:t}){let r=e.config?.swimlane?.lineHops;if(r===!1)return;let n=r==="gap"?"gap":"arc",i=e.edges.filter(a=>Array.isArray(a.points)&&a.points.length>=2).map(a=>({id:a.id,points:a.points,curve:a.curve,arrowTypeStart:a.arrowTypeStart,arrowTypeEnd:a.arrowTypeEnd}));$nt(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:n})}function Tfe(e){return Math.max(e.padding??_nt,_nt)}function Znt(e){let{x:t,y:r,width:n,height:i}=e,a=e.swimlaneContentTop;if(typeof t!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete e.groupTitleRect;return}let o=r-i/2,s=Math.min(a,r+i/2),l=Math.min(L0r,Math.max(0,s-o)),u=o+l;if(u<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-n/2,right:t+n/2,top:o,bottom:u}}function Qnt(e){let t=e.direction,r=e.nodes??=[];for(let a of e.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",t&&(a.direction=t));let n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===yfe);i?i.isGroup&&(i.shape="swimlane",t&&(i.direction=t)):(i={id:yfe,label:"",isGroup:!0,shape:"swimlane",padding:20,...t?{direction:t}:{}},r.push(i));for(let a of n)a.parentId=yfe}function Jnt(e){let t=new Map;for(let l of e.nodes??[])t.set(l.id,l);let r=[];for(let l of e.edges??[]){let u=typeof l.start=="string"?l.start:void 0,d=typeof l.end=="string"?l.end:void 0;!u||!d||l.labelNodeId||r.push({id:l.id,src:u,dst:d,ref:l})}let n=e.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:e,nodeById:t}}function eit(e,t,r,n){let{layout:i}=e,a=e.nodeById,o=n?.layerGap??100,s=n?.nodeGap??40,l=0;for(let f of t.layers){let p=0;for(let m of f){let g=a.get(m);if(!g){p++;continue}g.layer=l,g.order=p;let y=r.x[m]??p*s,v=r.y[m]??l*o;g.x=y,g.y=v,p++}l++}let u=i.nodes??[],d=new Map,h=[];for(let f of u){if(!f?.isGroup)continue;f.parentId||h.push(f);let p=u.filter(b=>b.parentId===f.id),m=1/0,g=-1/0,y=1/0,v=-1/0;for(let b of p){let x=b.x??r.x[b.id],E=b.y??r.y[b.id],w=b.width??0,T=b.height??0;x!=null&&E!=null&&(m=Math.min(m,x-w/2),g=Math.max(g,x+w/2),y=Math.min(y,E-T/2),v=Math.max(v,E+T/2))}if(m===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{let b=f.padding??20,x=f.parentId?b:2*Tfe(f),E=b,w=Math.max(0,g-m)+x,T=Math.max(0,v-y)+E,C=(m+g)/2,S=(y+v)/2;f.x=C,f.y=S,f.width=w,f.height=T,d.set(f.id,{minX:m,maxX:g,minY:y,maxY:v})}}if(h.length>0&&d.size>0){let f=1/0,p=-1/0,m=0;for(let g of h){let y=g.padding??20;y>m&&(m=y);let v=d.get(g.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){let g=Math.max(0,p-f),v=Math.max(m,36),b=g+2*v,x=(f+p)/2;for(let R of h)R.y=x,R.height=b,R.swimlaneContentTop=f;let E=[...h].sort((R,U)=>{let L=R.x??0,I=U.x??0;return L-I}),w=[],T=[],C=[];for(let R of E){let U=d.get(R.id);if(!U)continue;let L=Math.max(0,U.maxX-U.minX)+2*Tfe(R),I=(U.minX+U.maxX)/2;w.push(R.id),T.push(I),C.push(L)}let S=w.length;if(S>0){let R=new Map;if(S===1)R.set(w[0],C[0]);else{let U=[];for(let D=0;D0&&i>0?{cx:t,cy:r,rect:DC(t,r,n,i)}:void 0}function tpe(e){if(e.isGroup)return;let t=epe(e);return t?{id:String(e.id??""),cx:t.cx,cy:t.cy,rect:t.rect}:void 0}function Pf(e,t,r=Pl){return Math.abs(e.x-t.x)r}function $o(e,t,r=Pl){return ri(e,t,r)&&Math.abs(e.y-t.y)>r}function Iu(e,t,r,n){return Math.max(0,Math.min(Math.max(e,t),Math.max(r,n))-Math.max(Math.min(e,t),Math.min(r,n)))}function xg(e,t,r=Pl){return e.horizontal&&t.horizontal&&ci(e.a,t.a,r)?Iu(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&ri(e.a,t.a,r)?Iu(e.a.y,e.b.y,t.a.y,t.b.y):0}function NC(e,t=Pl){let r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Pf(i,n,t))&&r.push({x:n.x,y:n.y})}return r}function rpe(e,t=Pl){if(!e||e.length!==4)return;let[r,n,i,a]=e;return Xo(r,n,t)&&$o(n,i,t)&&Xo(i,a,t)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:$o(r,n,t)&&Xo(n,i,t)&&$o(i,a,t)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}function aH(e,t,r,n=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>r.left-n&&ir.top-n&&ot.left+r&&e.xt.top+r&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function KV(e,t){return e.leftt.left&&e.topt.top}function kfe(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function DC(e,t,r,n){return{left:e-r/2,right:e+r/2,top:t-n/2,bottom:t+n/2}}function Ld(e){return epe(e)?.rect}function G4(e,t){switch(t){case"top":return{x:e.cx,y:e.rect.top};case"bottom":return{x:e.cx,y:e.rect.bottom};case"left":return{x:e.rect.left,y:e.cy};case"right":return{x:e.rect.right,y:e.cy}}}function ipe(e,t,r,n,i,a=Pl){let o=t==="left"||t==="right",s=n==="left"||n==="right";if(o&&s){if(t==="right"&&n==="left"&&e.xr.x){if(ci(e,r,a))return[e,r];let h=(e.x+r.x)/2;return[e,{x:h,y:e.y},{x:h,y:r.y},r]}if(t===n){if(ci(e,r,a))return;let h=t==="left"?Math.min(e.x,r.x)-i:Math.max(e.x,r.x)+i;return[e,{x:h,y:e.y},{x:h,y:r.y},r]}return}if(!o&&!s){if(t===n){if(ri(e,r,a))return;let f=t==="top"?Math.min(e.y,r.y)-i:Math.max(e.y,r.y)+i;return[e,{x:e.x,y:f},{x:r.x,y:f},r]}if(!(t==="bottom"&&n==="top"&&e.yr.y))return;if(ri(e,r,a))return[e,r];let h=(e.y+r.y)/2;return[e,{x:e.x,y:h},{x:r.x,y:h},r]}if(o&&!s){let d=t==="right"&&r.x>e.x||t==="left"&&r.xr.y;return d&&h?[e,{x:r.x,y:e.y},r]:void 0}let l=t==="bottom"&&r.y>e.y||t==="top"&&r.yr.x;return l&&u?[e,{x:e.x,y:r.y},r]:void 0}function ape(e,t,r,n){return t==="left"||t==="right"?[e,{x:n,y:e.y},{x:n,y:r.y},r]:[e,{x:e.x,y:n},{x:r.x,y:n},r]}function oH(e){let t=new Map,r=[];for(let n of e){if(n.isEdgeLabel)continue;let i=tpe(n);i&&(t.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:t,realNodeRects:r}}function ex(e){let t=[],r=[];for(let n of e){let i=tpe(n);if(!i)continue;let a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):t.push(a)}return{realNodeRects:t,labelNodeRects:r}}function nit(e,{includeEdgeLabels:t=!0}={}){let r=[];for(let n of e){if(n.isGroup||!t&&n.isEdgeLabel)continue;let i=n.x??0,a=n.y??0,o=n.width??0,s=n.height??0;r.push({nodeId:n.id,...DC(i,a,o,s)})}return r}function ope(e,t,r=Pl){let n=e.start,i=e.end;if(!n||!i)return;let a=t.get(n),o=t.get(i);if(!(!a||!o))return{srcId:n,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)m||fv)return!1;let b=Math.abs(g-d.a.x)i:a&&s&&ci(e,r,i)?Iu(e.x,t.x,r.x,n.x)>i:!1}function ZV(e,t,r,n,{epsilon:i=Pl,skipDegenerateOther:a=!1}={}){for(let o of r){if(o===n||o.isLayoutOnly)continue;let s=o.points;if(!(!s||s.length<2))for(let l=0;lf+i&&mg+i&&hn+Pl&&e=2?t[t.length-2]:void 0,l=(o?ri(o,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};t.push(l)}t.push(a)}let r=[];for(let n of t){let i=r[r.length-1];(!i||!Pf(i,n))&&r.push(n)}return r}function wg(e){if(e.length<3)return e;let t=[...e];for(let r=0;r<32;r++){let n=oit(t);if(t=n.points,!n.changed)break}return t}function lpe(e,t,r){let n=e;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=e.length)return e;let a=i-n;if(a<0||a>=e.length)return e;let o=sit(e[i],e[a],t);return r?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}function lit(e,t){for(let r of e){let n=lpe(r,t,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=Sfe(i,n.srcRect,!0)),n.dstRect&&(i=Sfe(i,n.dstRect,!1)),i=wg(QV(i)),i=cpe(i,n.srcRect,n.dstRect),n.edge.points=wg(QV(i))}}function Afe(e,t,r,n=!1){if(ci(e,t,ln)){if(t.yr.bottom+ln)return t;if(n){if(e.xr.right+ln)return{x:r.right,y:e.y}}return{x:Math.abs(t.x-r.left)<=Math.abs(t.x-r.right)?r.left:r.right,y:e.y}}if(ri(e,t,ln)){if(t.xr.right+ln)return t;if(n){if(e.yr.bottom+ln)return{x:e.x,y:r.bottom}}let i=Math.abs(t.y-r.top)<=Math.abs(t.y-r.bottom);return{x:e.x,y:i?r.top:r.bottom}}return t}function JV(e,t,r){let n=e[t];for(let i=t+r;i>=0&&in.lo)),r=Math.min(...e.map(n=>n.hi));if(!(t>r))return{lo:t,hi:r}}function Ife(e,t){return t==="left"||t==="right"?eH(e.top,e.bottom):eH(e.left,e.right)}function tH(e,t,r){let n=e.y>=r.top-ln&&e.y<=r.bottom+ln,i=e.x>=r.left-ln&&e.x<=r.right+ln;if(ci(e,t,ln)&&n){if(Math.abs(e.x-r.left)0?cit(a):void 0}function Rfe(e,t,r,n,i){let a=uit(e,t,r,n,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...s}));for(let s=t;s>=0&&s=r.left-ln&&Math.max(e.x,t.x)<=r.right+ln,i=Math.min(e.y,t.y)>=r.top-ln&&Math.max(e.y,t.y)<=r.bottom+ln;if(Math.abs(e.y-r.top)n.bottom+ln;case"left":return ci(t,r,ln)&&r.xn.right+ln}}function Nfe(e,t,r){if(e.length<3)return e;if(r){let a=Lfe(e[0],e[1],t);return a&&Dfe(a,e[1],e[2],t)?e.slice(1):e}let n=e.length-1,i=Lfe(e[n-1],e[n],t);return i&&Dfe(i,e[n-1],e[n-2],t)?e.slice(0,n):e}function fit(e,t,r){let n=e;if(t){let a=JV(n,0,1);if(a){let o=Afe(a,n[0],t);o!==n[0]&&(n=[o,...n.slice(1)])}n=Nfe(n,t,!0)}if(r){let a=n.length-1,o=JV(n,a,-1);if(o){let s=Afe(o,n[a],r,!0);s!==n[a]&&(n=[...n.slice(0,a),s])}n=Nfe(n,r,!1)}let i=cpe(n,t,r);return i!==n||n.length===2?i:(t&&(n=Mfe(n,t,!0)),r&&(n=Mfe(n,r,!1)),n)}function _fe(e,t){for(let r of e){let n=lpe(r,t,2);if(!n)continue;let i=yi(n.points,ln),a=fit(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}let o=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=o}}function upe(e){return new Map(e.map(t=>[t.id,t]))}function pit(e,t){let r=e.parentId,n=null;for(;r;){let i=t.get(r);if(!i?.isGroup)break;n=i.id,r=i.parentId}return n}function Pfe(e,t){let r=0,n=e.parentId;for(;n;){let i=t.get(n);if(!i?.isGroup)break;r++,n=i.parentId}return r}function dpe(e){let t=1/0,r=-1/0,n=1/0,i=-1/0;for(let a of e){let o=a.x,s=a.y;if(typeof o!="number"||typeof s!="number")continue;let l=a.width??0,u=a.height??0;t=Math.min(t,o-l/2),r=Math.max(r,o+l/2),n=Math.min(n,s-u/2),i=Math.max(i,s+u/2)}return t===1/0||n===1/0?null:{minX:t,maxX:r,minY:n,maxY:i}}function mit(e,t){let r=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+r,e.height=Math.max(0,t.maxY-t.minY)+r}function git(e){let t=upe(e),r=e.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>Pfe(i,t)-Pfe(n,t));for(let n of r){let i=e.filter(o=>o.parentId===n.id),a=dpe(i);a&&mit(n,a)}}function rH(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(l=>!l.isGroup),a=1/0,o=-1/0;for(let l of i){let u=l[t];typeof u=="number"&&(a=Math.min(a,u),o=Math.max(o,u))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let s=k(l=>a+o-l,"mirror");for(let l of r){let u=l[t];typeof u=="number"&&(l[t]=s(u));let d=l.groupTitleRect;d&&(l.groupTitleRect=t==="x"?{...d,left:s(d.right),right:s(d.left)}:{...d,top:s(d.bottom),bottom:s(d.top)})}for(let l of n)for(let u of l.points??[])u[t]=s(u[t]);return!0}function yit(e){return(e.nodes??[]).some(r=>!r.isGroup)?rH(e,"y"):!0}function vit(e,t="LR"){let r=e.nodes??[],n=e.edges??[],i=r.filter(A=>!A.isGroup),a=1/0,o=1/0;for(let A of i){let P=A.x??0,D=A.y??0;P0?Math.max(1,d/h):1;for(let A of i){let P=A.x??0,M=((A.y??0)-o)*f+s,O=P-a;A.x=M,A.y=O}for(let A of n)if(A.points)for(let P of A.points){let D=P.x,O=(P.y-o)*f+s,_=D-a;P.x=O,P.y=_}git(r);let p=r.filter(A=>A.isGroup&&!A.parentId);if(p.length===0)return t==="RL"&&rH(e,"x"),!0;let m=upe(r),g=new Map;for(let A of r){if(A.isGroup)continue;let P=pit(A,m);if(!P)continue;let D=g.get(P)??[];D.push(A),g.set(P,D)}let y=0;for(let A of p){let P=A.padding??0;P>y&&(y=P)}let v=[],b=1/0,x=-1/0;for(let A of p){let P=g.get(A.id)??[],D=dpe(P);D&&(b=Math.min(b,D.minX),x=Math.max(x,D.maxX),v.push({lane:A,contentTop:D.minY,contentBottom:D.maxY,centerY:(D.minY+D.maxY)/2}))}if(b===1/0||x===-1/0)return!0;let E=Math.max(0,x-b),w=Math.max(y,10),T=E+2*w,C=s+T,U=(b+x)/2-T/2-s,L=U+C/2,I=Math.max(y,s);v.sort((A,P)=>A.centerY-P.centerY);for(let A=0;Af.cy?v.bottom:v.top,I=f.cx+b;if(I<=v.left+v0||I>=v.right-v0)continue;x={x:I,y:L},E={x:I,y:s.y},w={x:s.x,y:s.y}}else{let L=p.cx>f.cx?v.right:v.left,I=f.cy+b;if(I<=v.top+v0||I>=v.bottom-v0)continue;x={x:L,y:I},E={x:s.x,y:I},w={x:s.x,y:s.y}}let T=Pf(x,E,v0),C=Pf(E,w,v0);if(T&&C||!T&&fs(x,E,n,[d],1)||!C&&fs(E,w,n,[h],1))continue;let S=!T&&ZV(x,E,e,i,{epsilon:v0,skipDegenerateOther:!0}),R=!C&&ZV(E,w,e,i,{epsilon:v0,skipDegenerateOther:!0});if(!(S||R)){T?y=[E,w]:C?y=[x,E]:y=[x,E,w];break}}y&&(i.points=y)}}function xit(e,t){let{realNodeRects:a,labelNodeRects:o}=ex(t.values());for(let s of e){if(s.isLayoutOnly)continue;let l=s.points;if(!l||l.length<4)continue;let u=yi(l,.001);if(u.length<4)continue;let d=u.length-1,h=u[d],f=u[d-1],p=u[d-2],m=h.x-f.x,g=h.y-f.y,y=Math.hypot(m,g);if(y>=10||y<.001)continue;let v=f.x-p.x,b=f.y-p.y;if(Math.hypot(v,b)<.001)continue;let E=Xo(f,h,.001),w=$o(f,h,.001),T=Xo(p,f,.001),C=$o(p,f,.001);if(!(E&&C||w&&T))continue;let S=s.end,R=s.start,U=S?t.get(S):void 0;if(!U)continue;let L=U.x??0,I=U.y??0,A=Ld(U);if(!A)continue;let P,D;if(C){let z=b<0;P={x:L,y:p.y},D={x:L,y:z?A.bottom:A.top}}else{let z=v>0;P={x:p.x,y:I},D={x:z?A.right:A.left,y:I}}if(fs(P,D,a,S?[S]:[],-2)||fs(P,D,o,[],-2))continue;if(R){let z=t.get(R),V=z?Ld(z):void 0;if(V&&npe(P,V,2))continue}let M=k((z,V)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${V.x.toFixed(3)},${V.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let z=0;z{for(let $ of e){if($===s||$.isLayoutOnly)continue;let Z=$.points;if(!(!Z||Z.length<2))for(let re=0;re=0){let z=u[d-3],V=[R,S].filter($=>!!$);if(fs(z,P,a,V,-2)||_(z,P))continue}let F=[...u.slice(0,d-2),P,D];s.points=F;let G=s.labelNodeId;if(G){let z=t.get(G);if(z){let V=z.width??0,$=z.height??0;if(V>0&&$>0){let Z,re,Q=-1;for(let ge=0;ge=V+2||Me&&ue>=$+2)&&ue>Q&&(Q=ue,Z=(ie.x+pe.x)/2,re=(ie.y+pe.y)/2)}Z!==void 0&&re!==void 0&&(z.x=Z,z.y=re)}}}}}function wit(e,t){let i=k((p,m)=>{let g=p.x??0,y=p.y??0,v=m.x-g,b=m.y-y,x=(p.width??0)/2,E=(p.height??0)/2;return Math.abs(b)*x>Math.abs(v)*E?(b<0&&(E=-E),{x:g+(b===0?0:E*v/b),y:y+E}):(v<0&&(x=-x),{x:g+x,y:y+(v===0?0:x*b/v)})},"rectIntersect"),a=k((p,m)=>{let g=yi(p.points??[]);if(g.length<2)return;let y=m?p.start:p.end,v=y?t.get(y):void 0,b=v?Ld(v):void 0;if(!v||!y||!b)return;let x=m?g[0]:g[g.length-1],E=m?g[1]:g[g.length-2],w=i(v,x),T=x;if(vfe(E,w)&&(T=E),ri(w,T,Tr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:m,orientation:"V",coord:w.x,min:Math.min(w.y,T.y),max:Math.max(w.y,T.y),boundary:w,railEnd:T,rect:b};if(ci(w,T,Tr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:m,orientation:"H",coord:w.y,min:Math.min(w.x,T.x),max:Math.max(w.x,T.x),boundary:w,railEnd:T,rect:b}},"terminalLaneFor"),o=k((p,m)=>Math.max(0,Math.min(p.max,m.max)-Math.max(p.min,m.min)),"projectedOverlapLength"),s=k((p,m)=>p.nodeId!==m.nodeId||p.orientation!==m.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&ri(p.boundary,m.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&ci(p.boundary,m.boundary,1),"sameTerminalFace"),l=k((p,m)=>p.nodeId!==m.nodeId||p.orientation!==m.orientation?!1:o(p,m)>=_l&&Math.abs(p.coord-m.coord)<.5,"exactTerminalLaneConflict"),u=k((p,m)=>{if(p.nodeId!==m.nodeId||p.orientation!==m.orientation||p.orientation!=="H"||p.atStart===m.atStart)return!1;let g=o(p,m);if(g<_l)return!1;let y=p.rect.bottom-p.rect.top;return g2*y?!1:s(p,m)&&Math.abs(p.coord-m.coord)<16},"nearTerminalLaneConflict"),d=k((p,m)=>{let g=yi(p.edge.points??[]);if(g.length<2)return;let y=p.orientation==="V"?{x:p.boundary.x+m,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+m},v=p.orientation==="V"?{x:p.railEnd.x+m,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+m};if(!k(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?ci(y,p.boundary,Tr)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?ri(y,p.boundary,Tr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){let T=g.length>1&&Pf(g[1],p.railEnd,Tr),C=g.slice(T?2:1),S=C[0];return S&&!vfe(S,v)?void 0:[y,v,...C]}let x=g.length>1&&Pf(g[g.length-2],p.railEnd,Tr),E=g.slice(0,x?-2:-1),w=E[E.length-1];if(!(w&&!vfe(w,v)))return[...E,v,y]},"shiftedCandidate"),h=k(p=>{let m=p.edge,g=yi(m.points??[]);if(g.length!==2)return!1;let y=m.start,v=m.end,b=y?t.get(y):void 0,x=v?t.get(v):void 0;if(!b||!x)return!1;let E=b.x??0,w=b.y??0,T=x.x??0,C=x.y??0,[S,R]=g;return ci(S,R,Tr)&&Math.abs(w-C)<1&&Math.abs(E-T)>1||ri(S,R,Tr)&&Math.abs(E-T)<1&&Math.abs(w-C)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){let m=e.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y),g=!1;for(let y=0;y{let S=h(T),R=h(C);return S!==R?Number(S)-Number(R):+!C.atStart-+!T.atStart});for(let T of w){for(let C of f){let S=d(T,C);if(!S)continue;let R=a({...T.edge,points:S},T.atStart);if(!(!R||m.some(U=>U.edge!==T.edge&&(l(R,U)||E&&u(R,U))))){T.edge.points=S,g=!0;break}}if(g)break}}if(!g)return}}function Eit(e,t){let{realNodeRects:i,labelNodeRects:a}=ex(t.values()),o=k((l,u)=>{let d=l.start,h=l.end,f=qn(u);if(f.length!==u.length-1)return!1;let p=[d,h].filter(m=>!!m);for(let m of f)if(fs(m.a,m.b,i,p,-2)||fs(m.a,m.b,a,[],-2))return!1;for(let m of e){if(m===l||m.isLayoutOnly)continue;let g=m.points;if(!(!g||g.length<2)){for(let y of f)for(let v of qn(yi(g)))if(xg(y,v,.5)>=_l||Uy(y.a,y.b,v.a,v.b,Tr))return!1}}return!0},"candidateIsSafe"),s=k((l,u)=>{if(u+4>=l.length)return;let d=l[u],h=l[u+1],f=l[u+2],p=l[u+3],m=l[u+4],g=Xo(d,h)&&$o(h,f)&&Xo(f,p)&&$o(p,m)&&ri(d,p,Tr)&&ri(d,m,Tr)&&ri(h,f,Tr)&&(h.x-d.x)*(p.x-f.x)<0,y=$o(d,h)&&Xo(h,f)&&$o(f,p)&&Xo(p,m)&&ci(d,p,Tr)&&ci(d,m,Tr)&&ci(h,f,Tr)&&(h.y-d.y)*(p.y-f.y)<0;if(g||y)return yi([...l.slice(0,u+1),m,...l.slice(u+5)]);if(u+5>=l.length)return;let v=l[u+5],b=$o(d,h)&&Xo(h,f)&&$o(f,p)&&Xo(p,m)&&$o(m,v)&&ri(d,m,Tr)&&ri(d,v,Tr)&&ri(f,p,Tr)&&(f.x-h.x)*(m.x-p.x)<0,x=Xo(d,h)&&$o(h,f)&&Xo(f,p)&&$o(p,m)&&Xo(m,v)&&ci(d,m,Tr)&&ci(d,v,Tr)&&ci(f,p,Tr)&&(f.y-h.y)*(m.y-p.y)<0;if(!(!b&&!x))return yi([...l.slice(0,u+1),v,...l.slice(u+6)])},"withoutDogleg");for(let l=0;l<8;l++){let u=!1;for(let d of e){if(d.isLayoutOnly)continue;let h=yi(d.points??[]);for(let f=0;f<=h.length-5;f++){let p=s(h,f);if(!(!p||!o(d,p))){d.points=p,u=!0;break}}if(u)break}if(!u)return}}function Ofe(e,t){let{realNodeRects:a,labelNodeRects:o}=ex(t.values()),s=e.filter(m=>!m.isLayoutOnly),l=k((m,g,y)=>yi(m===g?y??[]:m.points??[]),"pointsFor"),u=k((m,g)=>{let y=0;for(let v=0;v{let g=qn(m);if(g.length!==3)return;let y=g[1];if(!(g[0].horizontal===y.horizontal||g[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),h=k((m,g)=>{let y=[m.start,m.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;let b=v.rect;return g.horizontal?Iu(g.a.x,g.b.x,b.left,b.right)>=_l&&g.a.y>=b.top-2&&g.a.y<=b.bottom+2:Iu(g.a.y,g.b.y,b.top,b.bottom)>=_l&&g.a.x>=b.left-2&&g.a.x<=b.right+2})},"blockingRectsFor"),f=k((m,g,y)=>{let v=m.map(x=>({...x}));if(g.horizontal)v[g.index].y=y,v[g.index+1].y=y;else if(g.vertical)v[g.index].x=y,v[g.index+1].x=y;else return;let b=wg(yi(v));return qn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=k((m,g,y)=>{let v=[m.start,m.end].filter(x=>!!x),b=qn(g);if(b.length!==g.length-1)return!1;for(let x of b)if(fs(x.a,x.b,a,v,-2)||fs(x.a,x.b,o,[],-2))return!1;for(let x of s)if(x!==m){for(let E of b)for(let w of qn(l(x)))if(xg(E,w,.5)>=_l)return!1}return u(m,g)<=y},"candidateIsSafe");for(let m=0;m<8;m++){let g=u(),y=!1;for(let v of s){let b=l(v),x=d(b);if(!x)continue;let E=h(v,x.segment);if(E.length===0)continue;let w=x.horizontal?[Math.min(...E.map(T=>T.rect.top))-20,Math.max(...E.map(T=>T.rect.bottom))+20]:[Math.min(...E.map(T=>T.rect.left))-20,Math.max(...E.map(T=>T.rect.right))+20];for(let T of w){let C=f(b,x.segment,T);if(!(!C||!p(v,C,g))){v.points=C,y=!0;break}}if(y)break}if(!y)return}}function Bfe(e,t){let n=k(l=>{let u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=k(l=>{if(!l.isGroup||l.parentId)return;let u=l.direction,d=typeof u=="string"?u.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT")return;let h=n(l),f=l.y,p=l.height;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;let m=h.right-h.left,g=h.bottom-h.top;if(!(g<=0||m{if(!l.horizontal)return!1;let d=l.a.y;return d<=u.top+Tr||d>=u.bottom-Tr?!1:Iu(l.a.x,l.b.x,u.left,u.right)>=_l},"horizontalSegmentIntersectsTitle"),o=[...t.values()].map(i).filter(l=>!!l);if(o.length===0)return;let s=0;for(let l of e){if(l.isLayoutOnly)continue;let u=yi(l.points??[]);for(let d of qn(u))for(let h of o)a(d,h.rect)&&(s=Math.max(s,h.rect.bottom-d.a.y+4))}if(!(s<=Tr))for(let l of o){let u=l.node.y,d=l.node.height;typeof u!="number"||typeof d!="number"||!Number.isFinite(u)||!Number.isFinite(d)||d<=0||(l.node.y=u-s/2,l.node.height=d+s,l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s})}}function Ffe(e,t){let n=k(u=>{let d=u.groupTitleRect;if(!(!d||typeof d.left!="number"||typeof d.right!="number"||typeof d.top!="number"||typeof d.bottom!="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top))return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect"),i=k(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;let h=n(u),f=u.x,p=u.width;if(!h||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;let m=h.right-h.left,g=h.bottom-h.top;if(!(m<=0||g{if(!u.vertical)return!1;let h=u.a.x;return h<=d.left+Tr||h>=d.right-Tr?!1:Iu(u.a.y,u.b.y,d.top,d.bottom)>=_l},"verticalSegmentIntersectsTitle"),o=k((u,d)=>{if(!u.horizontal)return!1;let h=u.a.y;return h<=d.top+Tr||h>=d.bottom-Tr?!1:Iu(u.a.x,u.b.x,d.left,d.right)>=_l},"horizontalSegmentIntersectsTitle"),s=[...t.values()].map(i).filter(u=>!!u);if(s.length===0)return;let l=0;for(let u of e){if(u.isLayoutOnly)continue;let d=yi(u.points??[]);for(let h of qn(d))for(let f of s)if(a(h,f.rect))l=Math.max(l,f.rect.right-h.a.x+4);else if(o(h,f.rect)){let p=Math.min(h.a.x,h.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Tr))for(let u of s){let d=u.node.x,h=u.node.width;typeof d!="number"||typeof h!="number"||!Number.isFinite(d)||!Number.isFinite(h)||h<=0||(u.node.x=d-l/2,u.node.width=h+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}function Tit(e,t){let{realNodeRects:i}=ex(t.values()),a=e.filter(g=>!g.isLayoutOnly),o=k((g,y=new Map)=>yi(y.get(g)??g.points??[]),"replacementPointsFor"),s=k((g=new Map)=>{let y=0;for(let v=0;va.reduce((y,v)=>y+Nh(o(v,g)),0),"totalBends"),u=k(g=>{let y=o(g);if(y.length<4)return;let v=y[y.length-2],b=y[y.length-1];if(!(!Xo(v,b,Tr)&&!$o(v,b,Tr)))return{tailStart:v,terminal:b}},"terminalTailFor"),d=k((g,y)=>{let v=o(g);if(v.length<3)return;let b=v[0],x=v[1],E;if(Xo(b,x,Tr))E={x:x.x,y:y.tailStart.y};else if($o(b,x,Tr))E={x:y.tailStart.x,y:x.y};else return;let w=wg(yi([b,x,E,y.tailStart,y.terminal]));return qn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=k((g,y)=>{let v=[g.start,g.end].filter(b=>!!b);for(let b of qn(y))if(fs(b.a,b.b,i,v,-2))return!0;return!1},"pathHasNodeHit"),f=k((g,y,v)=>{for(let b of a)if(b!==g){for(let x of qn(y))for(let E of qn(o(b,v)))if(xg(x,E,.5)>=_l)return!0}return!1},"pathHasSharedTrack"),p=k((g,y,v)=>!h(g,y)&&!f(g,y,v),"candidateIsSafe"),m=k(()=>{let g=new Map;for(let y of a){let v=y.end;if(!v||!t.has(v)||o(y).length<4)continue;let x=g.get(v)??[];x.push(y),g.set(v,x)}return g},"edgesByDestination");for(let g=0;g<4;g++){let y=s();if(y===0)return;let v=l(),b,x=y,E=v;for(let w of m().values())for(let T=0;T=y||D>x||D===x&&M>=E||(b=P,x=D,E=M)}if(!b)return;for(let[w,T]of b)w.points=T}}function kit(e,t){let{realNodeRects:o,labelNodeRects:s}=ex(t.values()),l=e.filter(w=>!w.isLayoutOnly),u=k((w,T=new Map)=>yi(T.get(w)??w.points??[]),"replacementPointsFor"),d=k((w=new Map)=>{let T=0;for(let C=0;Cl.reduce((T,C)=>T+Nh(u(C,w)),0),"totalBends"),f=k(w=>{let T=w.start,C=w.end,S=T?t.get(T):void 0,R=C?t.get(C):void 0,U=S?Ld(S):void 0,L=R?Ld(R):void 0;return U&&L?{src:U,dst:L}:void 0},"endpointRectsFor"),p=k((w,T,C)=>{if(C.index<=0||C.index+1>=T.length-1)return;let S=f(w);if(S){if(C.vertical){let R=C.a.x,U=Math.min(S.src.left,S.dst.left),L=Math.max(S.src.right,S.dst.right),I=RL+Tr?"right":void 0;return I?{edge:w,points:T,segmentIndex:C.index,axis:"vertical",side:I,coord:R,min:Math.min(C.a.y,C.b.y),max:Math.max(C.a.y,C.b.y)}:void 0}if(C.horizontal){let R=C.a.y,U=Math.min(S.src.top,S.dst.top),L=Math.max(S.src.bottom,S.dst.bottom),I=RL+Tr?"bottom":void 0;return I?{edge:w,points:T,segmentIndex:C.index,axis:"horizontal",side:I,coord:R,min:Math.min(C.a.x,C.b.x),max:Math.max(C.a.x,C.b.x)}:void 0}}},"externalRailForSegment"),m=k(()=>{let w=[];for(let T of l){let C=u(T);for(let S of qn(C)){let R=p(T,C,S);R&&w.push(R)}}return w},"collectExternalRails"),g=k((w,T)=>w.edge!==T.edge&&w.axis===T.axis&&w.side===T.side&&Iu(w.min,w.max,T.min,T.max)>=_l,"railsInteract"),y=k(w=>{let T=[],C=new Set;for(let S of w){if(C.has(S))continue;let R=[S],U=[];for(C.add(S);R.length>0;){let L=R.pop();U.push(L);for(let I of w)!C.has(I)&&g(L,I)&&(C.add(I),R.push(I))}U.length>1&&T.push(U)}return T},"connectedComponents"),v=k(w=>{let T=[];for(let C of w)T.some(S=>Math.abs(S-C.coord){let T=w.map(R=>R.coord),C=v(w),S=[];if(w.length<=6){let R=new Array(C.length).fill(!1),U=[],L=k(()=>{if(U.length===w.length){U.some((I,A)=>Math.abs(I-T[A])>=Tr)&&S.push([...U]);return}for(let[I,A]of C.entries())R[I]||(R[I]=!0,U.push(A),L(),U.pop(),R[I]=!1)},"visit");return L(),S}for(let R=0;R{let C=new Map;for(let[R,U]of w.entries()){let L=T[R],I=C.get(U.edge)??U.points.map(A=>({x:A.x,y:A.y}));U.axis==="vertical"?(I[U.segmentIndex].x=L,I[U.segmentIndex+1].x=L):(I[U.segmentIndex].y=L,I[U.segmentIndex+1].y=L),C.set(U.edge,I)}let S=new Map;for(let[R,U]of C){let L=wg(yi(U));if(qn(L).length!==L.length-1)return;S.set(R,L)}return S},"replacementsForAssignment"),E=k(w=>{for(let[T,C]of w){let S=[T.start,T.end].filter(R=>!!R);for(let R of qn(C))if(fs(R.a,R.b,o,S,-2)||fs(R.a,R.b,s,[],-2))return!1}for(let T=0;T=_l)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){let T=d();if(T===0)return;let C,S=T,R=h(),U=Number.POSITIVE_INFINITY;for(let L of y(m()))for(let I of b(L)){let A=x(L,I);if(!A||!E(A))continue;let P=d(A);if(P>=T)continue;let D=h(A),M=L.reduce((O,_,B)=>O+Math.abs(I[B]-_.coord),0);P>S||P===S&&(D>R||D===R&&M>=U)||(C=A,S=P,R=D,U=M)}if(!C)return;for(let[L,I]of C)L.points=I}}function Cit(e,t){let{realNodeRects:i,labelNodeRects:a}=ex(t.values()),o=e.filter(m=>!m.isLayoutOnly),s=k((m,g,y)=>yi(m===g?y??[]:m.points??[]),"pointsFor"),l=k(m=>qn(m).reduce((g,y)=>{let v=y.a.x-y.b.x,b=y.a.y-y.b.y;return g+Math.hypot(v,b)},0),"pathLength"),u=k((m,g)=>{let y=0;for(let v=0;v{if(m.horizontal){let y=m.a.y;return(Math.abs(y-g.top)<1||Math.abs(y-g.bottom)<1)&&Iu(m.a.x,m.b.x,g.left,g.right)>=_l}if(m.vertical){let y=m.a.x;return(Math.abs(y-g.left)<1||Math.abs(y-g.right)<1)&&Iu(m.a.y,m.b.y,g.top,g.bottom)>=_l}return!1},"segmentRunsAlongRectBorder"),h=k(m=>{let g=[m.start,m.end].filter(v=>!!v),y=[];for(let v of g){let b=t.get(v),x=b?Ld(b):void 0;x&&y.push(x)}return y},"endpointRectsFor"),f=k((m,g)=>{if(g+3>=m.length)return[];let y=m[g],v=m[g+1],b=m[g+2],x=m[g+3],E=Xo(y,v,Tr)&&$o(v,b,Tr)&&Xo(b,x,Tr),w=$o(y,v,Tr)&&Xo(v,b,Tr)&&$o(b,x,Tr);if(!E&&!w)return[];if(!(E?Math.sign(v.x-y.x)!==Math.sign(x.x-b.x):Math.sign(v.y-y.y)!==Math.sign(x.y-b.y)))return[];let C=ri(y,x,Tr)||ci(y,x,Tr)?[]:[{x:y.x,y:x.y},{x:x.x,y:y.y}],S=C.length===0?[[...m.slice(0,g+1),...m.slice(g+3)]]:C.map(U=>[...m.slice(0,g+1),U,...m.slice(g+3)]),R=new Set;return S.map(U=>wg(yi(U))).filter(U=>{if(qn(U).length!==U.length-1||!U.some(I=>Pf(I,x,Tr)))return!1;let L=U.map(I=>`${I.x.toFixed(3)},${I.y.toFixed(3)}`).join("|");return R.has(L)?!1:(R.add(L),!0)})},"shortcutCandidatesAt"),p=k((m,g,y)=>{let v=[m.start,m.end].filter(x=>!!x),b=h(m);for(let x of qn(g))if(fs(x.a,x.b,i,v,-2)||fs(x.a,x.b,a,[],-2)||b.some(E=>d(x,E)))return!1;for(let x of o)if(x!==m){for(let E of qn(g))for(let w of qn(s(x)))if(xg(E,w,.5)>=_l)return!1}return u(m,g)<=y},"candidateIsSafe");for(let m=0;m<8;m++){let g=u(),y,v,b=g,x=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(let w of o){let T=s(w),C=Nh(T,Tr),S=l(T);for(let R=0;R<=T.length-4;R++)for(let U of f(T,R)){let L=Nh(U,Tr),I=l(U);if(!(Lb||P===b&&(L>x||L===x&&I>=E)||(y=w,v=U,b=P,x=L,E=I)}}if(!y||!v)return;y.points=v}}function Sit(e,t){let o=[];for(let ve of t.values()){if(ve.isGroup||ve.isEdgeLabel)continue;let Fe=ve.x??0,Le=ve.y??0,Be=Ld(ve);Be&&o.push({id:String(ve.id??""),cx:Fe,cy:Le,rect:Be})}if(o.length===0)return;let s=new Map(o.map(ve=>[ve.id,ve])),l=o.map(ve=>({id:ve.id,rect:ve.rect})),u=["top","bottom","left","right"],d={top:Math.min(...o.map(ve=>ve.rect.top))-20,bottom:Math.max(...o.map(ve=>ve.rect.bottom))+20,left:Math.min(...o.map(ve=>ve.rect.left))-20,right:Math.max(...o.map(ve=>ve.rect.right))+20},h=e.filter(ve=>!ve.isLayoutOnly),f=new Map(h.map((ve,Fe)=>[ve,Fe])),p=k(ve=>{let Fe=ve==="left"||ve==="top"?-1:1,Le=[];for(let Be=0;Be<=2;Be++)Le.push(d[ve]+Fe*20*Be);return Le},"outwardTracksForSide"),m=k((ve,Fe=new Map)=>yi(Fe.get(ve)??ve.points??[]),"replacementPointsFor"),g=k((ve,Fe)=>{let Le=0;for(let Be of ve)for(let ae of Fe)Uy(Be.a,Be.b,ae.a,ae.b,Tr)&&Le++;return Le},"crossingCountBetweenSegments"),y=k((ve,Fe)=>g(qn(ve),qn(Fe)),"crossingCountBetweenPaths"),v=k((ve=new Map)=>{let Fe=0,Le=[],Be=new Set,ae=[],he=k(de=>{Be.has(de)||(Be.add(de),ae.push(de))},"addEdge");for(let de=0;de0&&(Fe+=X,Le.push({first:me,second:W,count:X}),he(me),he(W))}}return ae.sort((de,me)=>(f.get(de)??0)-(f.get(me)??0)),{count:Fe,pairs:Le,edgeSet:Be,edges:ae}},"crossingSnapshot"),b=k((ve,Fe)=>{let Le=new Set(Fe.keys());if(Le.size===0)return ve.count;let Be=0;for(let he of ve.pairs)(Le.has(he.first)||Le.has(he.second))&&(Be+=he.count);let ae=0;for(let he=0;he{let Fe=new Map;for(let ae of ve.pairs){let he=Fe.get(ae.first)??new Set;he.add(ae.second),Fe.set(ae.first,he);let de=Fe.get(ae.second)??new Set;de.add(ae.first),Fe.set(ae.second,de)}let Le=[],Be=new Set;for(let ae of ve.edges){if(Be.has(ae))continue;let he=[ae],de=[];for(Be.add(ae);he.length>0;){let me=he.pop();de.push(me);for(let ke of Fe.get(me)??[])Be.has(ke)||(Be.add(ke),he.push(ke))}de.sort((me,ke)=>(f.get(me)??0)-(f.get(ke)??0)),de.length>1&&Le.push(de)}return Le},"crossingComponents"),E=k(ve=>[ve.start,ve.end].filter(Fe=>!!Fe),"endpointIdsFor"),w=k(ve=>{let Fe=[];for(let Le of x(ve)){let Be=new Set(Le),ae=new Set(Le.flatMap(de=>E(de))),he=[...Le];for(let de of h)Be.has(de)||E(de).some(me=>ae.has(me))&&he.push(de);he.sort((de,me)=>(f.get(de)??0)-(f.get(me)??0)),Fe.push(he)}return Fe},"pairSearchGroups"),T=k((ve,Fe,Le)=>b(ve,new Map([[Fe,Le]])),"crossingCountWithSingleReplacement"),C=k(ve=>{let Fe=new Map;for(let Le of ve.pairs)Fe.set(Le.first,(Fe.get(Le.first)??0)+Le.count),Fe.set(Le.second,(Fe.get(Le.second)??0)+Le.count);return Fe},"currentCrossingsByEdge"),S=k(ve=>ve.slice(1).reduce((Fe,Le,Be)=>{let ae=ve[Be];return Fe+Math.abs(Le.x-ae.x)+Math.abs(Le.y-ae.y)},0),"pathLength"),R=k((ve=new Map)=>h.reduce((Fe,Le)=>Fe+Nh(m(Le,ve)),0),"totalBends"),U=k((ve=new Map)=>h.reduce((Fe,Le)=>Fe+S(m(Le,ve)),0),"totalLength"),L=k((ve,Fe,Le=new Map)=>{let Be=qn(Fe);for(let ae of h)if(ae!==ve){for(let he of Be)for(let de of qn(m(ae,Le)))if(xg(he,de,.5)>=_l)return!0}return!1},"pathHasSegmentConflict"),I=k((ve,Fe)=>{let Le=[ve.start,ve.end].filter(Be=>!!Be);for(let Be of qn(Fe))if(fs(Be.a,Be.b,l,Le,-2))return!0;return!1},"pathHitsNode"),A=k((ve,Fe)=>{let Le=wg(yi(Fe));qn(Le).length===Le.length-1&&ve.push(Le)},"pushOrthogonalCandidate"),P=k(ve=>ve==="left"||ve==="right","sideIsHorizontal"),D=k((ve,Fe,Le)=>{switch(Fe){case"left":return Math.min(ve.x,Le.x)-20;case"right":return Math.max(ve.x,Le.x)+20;case"top":return Math.min(ve.y,Le.y)-20;case"bottom":return Math.max(ve.y,Le.y)+20}},"localTrackForSameSide"),M=k((ve,Fe,Le,Be)=>{let ae=Le==="left"||Le==="top"?-1:1,he=[D(Fe,Le,Be),d[Le]];for(let de of he)for(let me=0;me<=2;me++)A(ve,ape(Fe,Le,Be,de+ae*20*me))},"addSameSideCandidates"),O=k((ve,Fe,Le,Be,ae)=>{for(let he of p(Le))for(let de of p(ae))A(ve,[Fe,{x:he,y:Fe.y},{x:he,y:de},{x:Be.x,y:de},Be])},"addHorizontalToVerticalCandidates"),_=k((ve,Fe,Le,Be,ae)=>{for(let he of p(Le))for(let de of p(ae))A(ve,[Fe,{x:Fe.x,y:he},{x:de,y:he},{x:de,y:Be.y},Be])},"addVerticalToHorizontalCandidates"),B=k((ve,Fe,Le,Be,ae)=>{let he=[...p("top"),...p("bottom")];for(let de of p(Le))for(let me of p(ae))for(let ke of he)A(ve,[Fe,{x:de,y:Fe.y},{x:de,y:ke},{x:me,y:ke},{x:me,y:Be.y},Be])},"addHorizontalPairCandidates"),F=k((ve,Fe,Le,Be,ae)=>{let he=[...p("left"),...p("right")];for(let de of p(Le))for(let me of p(ae))for(let ke of he)A(ve,[Fe,{x:Fe.x,y:de},{x:ke,y:de},{x:ke,y:me},{x:Be.x,y:me},Be])},"addVerticalPairCandidates"),G=k(ve=>{let Fe=new Set;return ve.map(Le=>yi(Le)).filter(Le=>{let Be=Le.map(ae=>`${ae.x.toFixed(3)},${ae.y.toFixed(3)}`).join("|");return Fe.has(Be)||Le.length<2?!1:(Fe.add(Be),!0)})},"dedupeCandidatePaths"),z=k((ve,Fe,Le,Be)=>{let ae=[],he=ipe(ve,Fe,Le,Be,20,Tr);he&&A(ae,he),Fe===Be&&M(ae,ve,Fe,Le);let de=P(Fe),me=P(Be);return de&&!me?O(ae,ve,Fe,Le,Be):!de&&me?_(ae,ve,Fe,Le,Be):de?B(ae,ve,Fe,Le,Be):F(ae,ve,Fe,Le,Be),G(ae)},"buildCandidatesForSides"),V=k((ve,Fe,Le,Be)=>{let ae=[...p("left"),...p("right")],he=[...p("top"),...p("bottom")];for(let de of u){let me=G4(Be,de),ke=de==="top"||de==="bottom"?p(de):he;for(let le of ae){A(ve,[Fe,Le,{x:le,y:Le.y},{x:le,y:me.y},me]);for(let W of ke)A(ve,[Fe,Le,{x:le,y:Le.y},{x:le,y:W},{x:me.x,y:W},me])}}},"addVerticalDepartureOuterTrackCandidates"),$=k((ve,Fe,Le,Be)=>{let ae=[...p("left"),...p("right")],he=[...p("top"),...p("bottom")];for(let de of u){let me=G4(Be,de),ke=de==="left"||de==="right"?p(de):ae;for(let le of he){A(ve,[Fe,Le,{x:Le.x,y:le},{x:me.x,y:le},me]);for(let W of ke)A(ve,[Fe,Le,{x:Le.x,y:le},{x:W,y:le},{x:W,y:me.y},me])}}},"addHorizontalDepartureOuterTrackCandidates"),Z=k(ve=>{let Fe=ve.start,Le=ve.end,Be=Le?s.get(Le):void 0;if(!Fe||!Be)return[];let ae=yi(ve.points??[]);if(ae.length<4)return[];let he=ae[0],de=ae[1],me=[];return $o(he,de,Tr)?V(me,he,de,Be):Xo(he,de,Tr)&&$(me,he,de,Be),me},"terminalPreservingOuterTrackCandidates"),re=k(ve=>{let Fe=ve.start,Le=ve.end,Be=Fe?s.get(Fe):void 0,ae=Le?s.get(Le):void 0;if(!Be||!ae)return[];let he=[];for(let de of u){let me=G4(Be,de);for(let ke of u)he.push(...z(me,de,G4(ae,ke),ke))}return he.push(...Z(ve)),he},"candidatePathsFor"),Q=k(()=>new Map(h.map(ve=>[ve,qn(m(ve))])),"currentSegmentsByEdge"),ge=k((ve,Fe,Le)=>{let Be=new Set;for(let ae of h){if(ae===ve)continue;let he=Le.get(ae)??qn(m(ae));Fe.some(de=>he.some(me=>xg(de,me,.5)>=_l))&&Be.add(ae)}return Be},"sharedTrackConflictsFor"),ie=k((ve,Fe,Le,Be)=>{let ae=new Set;return re(ve).map(de=>wg(yi(de))).filter(de=>{if(I(ve,de))return!1;let me=de.map(ke=>`${ke.x.toFixed(3)},${ke.y.toFixed(3)}`).join("|");return ae.has(me)||de.length<2?!1:(ae.add(me),!0)}).map(de=>{let me=qn(de),ke=0;for(let le of h)le!==ve&&(ke+=g(me,Le.get(le)??qn(m(le))));return{candidate:de,candidateSegments:me,crossings:Fe.count-(Be.get(ve)??0)+ke,bends:Nh(de,Tr),totalBends:Nh(de),length:S(de)}}).filter(({crossings:de})=>de<=Fe.count).sort((de,me)=>de.crossings-me.crossings||de.bends-me.bends||de.length-me.length).slice(0,48).map(de=>({path:de.candidate,segments:de.candidateSegments,sharedTrackConflicts:ge(ve,de.candidateSegments,Le),totalBends:de.totalBends,length:de.length}))},"pairCandidatesFor"),pe=k((ve,Fe,Le,Be,ae,he)=>{let de=0;for(let ke of ve.pairs)(ke.first===Fe||ke.second===Fe||ke.first===Be||ke.second===Be)&&(de+=ke.count);let me=g(Le.segments,ae.segments);for(let ke of h){if(ke===Fe||ke===Be)continue;let le=he.get(ke)??qn(m(ke));me+=g(Le.segments,le)+g(ae.segments,le)}return ve.count-de+me},"pairCrossingCount"),ue=k((ve,Fe)=>{for(let Le of ve.sharedTrackConflicts)if(Le!==Fe)return!1;return!0},"conflictsOnlyWith"),fe=k((ve,Fe)=>ve.segments.some(Le=>Fe.segments.some(Be=>xg(Le,Be,.5)>=_l)),"candidatesShareTrack"),Me=k((ve,Fe,Le,Be)=>ue(Fe,Le.edge)&&ue(Be,ve.edge)&&!fe(Fe,Be),"pairCandidatesAreCompatible"),Ce=k((ve,Fe,Le,Be,ae)=>{let he=pe(ve.current,Fe.edge,Le,Be.edge,ae,ve.baseSegments);if(!(he>=ve.current.count))return{replacements:new Map([[Fe.edge,Le.path],[Be.edge,ae.path]]),crossings:he,bends:ve.currentBends-(ve.baseBendsByEdge.get(Fe.edge)??0)-(ve.baseBendsByEdge.get(Be.edge)??0)+Le.totalBends+ae.totalBends,length:ve.currentLength-(ve.baseLengthByEdge.get(Fe.edge)??0)-(ve.baseLengthByEdge.get(Be.edge)??0)+Le.length+ae.length}},"scorePairReplacement"),Ye=k((ve,Fe)=>ve.crossings{let ae=Be;for(let he of Fe.candidates)for(let de of Le.candidates){if(!Me(Fe,he,Le,de))continue;let me=Ce(ve,Fe,he,Le,de);me&&Ye(me,ae)&&(ae=me)}return ae},"bestScoreForOptionPair"),Qe=k(ve=>{let Fe=R(),Le=U(),Be=Q(),ae=C(ve),he=new Map(h.map(X=>[X,Nh(m(X))])),de=new Map(h.map(X=>[X,S(m(X))])),me=new Map,ke=w(ve);for(let X of ke)for(let q of X){if(me.has(q))continue;let j=ie(q,ve,Be,ae);j.length>0&&me.set(q,{edge:q,candidates:j})}let le={replacements:new Map,crossings:ve.count,bends:Fe,length:Le},W={current:ve,currentBends:Fe,currentLength:Le,baseBendsByEdge:he,baseLengthByEdge:de,baseSegments:Be};for(let X of ke){let q=new Set(X.filter(se=>ve.edgeSet.has(se))),j=X.map(se=>me.get(se)).filter(se=>!!se);for(let se=0;se0?le.replacements:void 0},"bestPairedReplacement");for(let ve=0;ve<4;ve++){let Fe=v(),Le=Fe.count;if(Le===0)return;let Be,ae,he=Le,de=Number.POSITIVE_INFINITY;for(let ke of Fe.edges){let le=Nh(m(ke),Tr);for(let W of re(ke)){let X=I(ke,W),q=!X&&L(ke,W),j=T(Fe,ke,W),se=Nh(W,Tr);X||q||!(jhe||j===he&&se>=de||(Be=ke,ae=W,he=j,de=se)}}if(Be&&ae){Be.points=ae;continue}let me=Qe(Fe);if(!me)return;for(let[ke,le]of me)ke.points=le}}function Ait(e,t){let{nodeInfoById:r,realNodeRects:n}=oH(t),i=["top","bottom","left","right"],a=20,o={top:Math.min(...n.map(g=>g.rect.top))-a,bottom:Math.max(...n.map(g=>g.rect.bottom))+a,left:Math.min(...n.map(g=>g.rect.left))-a,right:Math.max(...n.map(g=>g.rect.right))+a},s=k((g,y,v,b)=>{let x=[],E=ipe(g,y,v,b,a,J2);return E&&x.push(E),y===b&&x.push(ape(g,y,v,o[y])),x},"buildOrthogonalPathCandidates"),l=k((g,y)=>{for(let v=0;v{let b=0,x=NC(g,J2),E=y.start,w=y.end;for(let T of e){if(T===y||T.isLayoutOnly)continue;let C=T.start,S=T.end;if(!v&&E&&w&&(C===E||C===w||S===E||S===w))continue;let R=T.points;if(!(!R||R.length<2))for(let U of x)for(let L of NC(R,J2)){if(spe(U.a,U.b,L.a,L.b,J2,J2)){b++;continue}xg(U,L,J2)>=O0r&&b++}}return b},"pathConflictCount"),d=4,h=k((g,y)=>{let v=Math.abs(g.y-y.rect.top),b=Math.abs(g.y-y.rect.bottom),x=Math.abs(g.x-y.rect.left),E=Math.abs(g.x-y.rect.right),w="top",T=v;return b{let b=f.get(g)??[];b.push({side:y,edgeId:v}),f.set(g,b)},"addFaceClaim");for(let g of e){if(g.isLayoutOnly)continue;let y=g.points??[];if(y.length<1)continue;let v=g.id??"",b=g.start,x=g.end;if(b){let E=r.get(b);E&&p(b,h(y[0],E),v)}if(x){let E=r.get(x);E&&p(x,h(y[y.length-1],E),v)}}let m=k((g,y,v)=>f.get(g)?.some(b=>b.edgeId!==v&&b.side===y)??!1,"faceIsClaimed");for(let g of e){if(g.isLayoutOnly)continue;let y=g.points;if(!y||y.length<2)continue;let v=Nh(y,J2);if(v0){let _=u(M,g,!0);if(_>U||_===U&&O>=L)continue;U=_,L=O,R=M;continue}u(M,g)>S||OP.edgeId!==T));let A=f.get(x);A&&f.set(x,A.filter(P=>P.edgeId!==T)),p(b,h(R[0],E),T),p(x,h(R[R.length-1],w),T)}}}function zfe(e,t){let r=t?0:e.length-1,n=t?1:-1,i=e[r],a=e[r+n];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)a&&KV(e,Uit(a)))}function jV(e,t){let r=[];for(let m of e){if(m.isLayoutOnly)continue;let g=m.points;if(!(!g||g.length<2))for(let y=0;y{let y=kfe(g,a);for(let{nodeId:v,rect:b}of n)if(v!==m&&KV(y,b))return!0;return!1},"labelOverlapsForeignNode"),u=k((m,g)=>{let y=kfe(g,a);for(let v of r)if(v.edgeId!==m&&aH(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),d=k((m,g,y)=>l(m,y)||u(g,y),"labelOverlapsAnything"),h=[],f=k(m=>{for(let{id:g,rect:y}of i)if(rit(y,m))return g},"findContainingLane"),p=k((m,g)=>h.some(y=>y.labelId!==m&&KV(g,y.rect)),"overlapsPlacedLabel");for(let m of e){if(m.isLayoutOnly)continue;let g=m.labelNodeId;if(!g)continue;let y=t.get(g);if(!y)continue;let v=m.points;if(!v||v.length<2)continue;let b=y.width??0,x=y.height??0;if(b<=0||x<=0)continue;let E=[];for(let G=0;G=Md&&Z>=Md||E.push({idx:G,length:$+Z,orientation:$>=Md?"horizontal":"vertical",midX:(z.x+V.x)/2,midY:(z.y+V.y)/2})}if(E.length===0)continue;let w=E.length>=3?E.filter(G=>G.idx>0&&G.idx0?w:E,C=b>=x?"horizontal":"vertical",S=k(G=>[...G].sort((z,V)=>{let $=z.orientation===C,Z=V.orientation===C;if($!==Z)return $?-1:1;let re=z.length>=(z.orientation==="horizontal"?b:x)+2,Q=V.length>=(V.orientation==="horizontal"?b:x)+2;return re!==Q?re?-1:1:V.length-z.length}),"rankSegments"),R=E[0],U=E[E.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],I=k((G,z)=>{let V=v[G.idx],$=v[G.idx+1];return{midX:V.x+($.x-V.x)*z,midY:V.y+($.y-V.y)*z}},"anchorAtT"),A=k((G,z,V)=>Math.min(V,Math.max(z,G)),"clamp"),P=k((G,z)=>G.midX>=z.left-Md&&G.midX<=z.right+Md&&G.midY>=z.top-Md&&G.midY<=z.bottom+Md,"pointInsideRectInclusive"),D=k(G=>{let z=DC(G.midX,G.midY,b,x),V=f(z);if(V)return{laneId:V,anchor:G,rect:z};let $=i.find(({rect:ue})=>P(G,ue));if(!$)return;let Z=$.rect.left+b/2+o,re=$.rect.right-b/2-o,Q=$.rect.top+x/2+o,ge=$.rect.bottom-x/2-o;if(Z>re||Q>ge)return;let ie={midX:A(G.midX,Z,re),midY:A(G.midY,Q,ge)},pe=DC(ie.midX,ie.midY,b,x);return P(G,pe)?{laneId:$.id,anchor:ie,rect:pe}:void 0},"placementForAnchor"),M=k((G,z,V)=>G.orientation==="horizontal"?Math.abs(z.midX-V.x):Math.abs(z.midY-V.y),"distanceAlongSegment"),O=k((G,z)=>{let $=(G.orientation==="horizontal"?b/2:x/2)+s;if(G===R){let Z=v[G.idx];if(M(G,z,Z)+Md<$)return!1}if(G===U){let Z=v[G.idx+1];if(M(G,z,Z)+Md<$)return!1}return!0},"labelClearsTerminalEndpoints"),_=k(G=>{let z=S(G);for(let V of z)for(let $ of L){let Z=I(V,$);if(!O(V,Z))continue;let re=D(Z);if(re&&!Gfe(re.rect,v)&&!p(g,re.rect)&&!d(g,m.id,re.rect))return{laneId:re.laneId,anchor:re.anchor}}},"tryPool"),B=k((G,z,V=!1)=>{let $=S(G);for(let Z of $){let re={midX:Z.midX,midY:Z.midY};if(z&&!O(Z,re))continue;let Q=D(re);if(Q&&!Gfe(Q.rect,v)&&!p(g,Q.rect)&&!l(g,Q.rect)&&(V||!u(m.id,Q.rect)))return{laneId:Q.laneId,anchor:Q.anchor}}},"findLaneContainingFallback"),F=_(T)??(T.lengthV.labelId===g);z>=0?h[z]={labelId:g,rect:G}:h.push({labelId:g,rect:G})}}}function Wfe(e,t){return e{let d=Wfe(s,l),h=0,f=k(p=>{if(!p)return;let m=i.get(p);if(!m)return;let g=u==="x"?m.w/2:m.h/2;g>h&&(h=g)},"consider");f(o.labelNodeId);for(let p of e){if(p===o||p.isLayoutOnly)continue;let m=p.start,g=p.end;!m||!g||Wfe(m,g)===d&&f(p.labelNodeId)}return h>0?h+F0r:0},"labelClearanceFor");for(let o of e){if(o.isLayoutOnly)continue;let s=o.points;if(!rpe(s,bfe))continue;let l=ope(o,r,bfe);if(!l)continue;let{srcId:u,dstId:d,srcInfo:h,dstInfo:f,collinearX:p,collinearY:m}=l;if(p===m)continue;let g,y;if(p){let w=f.cy>h.cy;g={x:h.cx,y:w?h.rect.bottom:h.rect.top},y={x:f.cx,y:w?f.rect.top:f.rect.bottom}}else{let w=f.cx>h.cx;g={x:w?h.rect.right:h.rect.left,y:h.cy},y={x:w?f.rect.left:f.rect.right,y:f.cy}}if(fs(g,y,n,[u,d],1))continue;let b=a(o,u,d,p?"x":"y"),x=b>Bnt?b:Bnt,E=[0,x,-x];for(let w of E){let T={...g},C={...y};if(p){if(T.x+=w,C.x+=w,T.x<=h.rect.left||T.x>=h.rect.right||C.x<=f.rect.left||C.x>=f.rect.right)continue}else if(T.y+=w,C.y+=w,T.y<=h.rect.top||T.y>=h.rect.bottom||C.y<=f.rect.top||C.y>=f.rect.bottom)continue;if(!fs(T,C,n,[u,d],1)&&!ZV(T,C,e,o,{epsilon:bfe})){o.points=[T,C];break}}}}function Vfe(e,t){let{realNodeRects:u,labelNodeRects:d}=ex(t.values()),h=k((T,C)=>NC(C,.001).map(S=>({...S,edge:T,interior:S.index>=1&&S.index<=C.length-3})),"segmentsFor"),f=k(()=>{let T=[];for(let C of e){if(C.isLayoutOnly)continue;let S=C.points;!S||S.length<2||T.push(...h(C,yi(S)))}return T},"allSegments"),p=k((T,C)=>T.horizontal&&C.horizontal?Iu(T.a.x,T.b.x,C.a.x,C.b.x)>=8&&Math.abs(T.a.y-C.a.y)<7:T.vertical&&C.vertical?Iu(T.a.y,T.b.y,C.a.y,C.b.y)>=8&&Math.abs(T.a.x-C.a.x)<7:!1,"hasCrowdedParallelTrack"),m=k((T,C)=>{let S=T.start,R=T.end,U=h(T,C);if(U.length!==C.length-1)return!1;let L=[S,R].filter(A=>!!A),I=T.labelNodeId?[T.labelNodeId]:[];for(let A of U)if(fs(A.a,A.b,u,L,-2)||fs(A.a,A.b,d,I,-2))return!1;for(let A of e){if(A===T||A.isLayoutOnly)continue;let P=A.points;if(!(!P||P.length<2)){for(let D of U)for(let M of h(A,yi(P)))if(p(D,M)||Uy(D.a,D.b,M.a,M.b,.001))return!1}}return!0},"candidateIsSafe"),g=k((T,C)=>{let S=yi(T.edge.points??[]);if(S.length<4||T.index>=S.length-1)return;let R=S.map(U=>({...U}));if(T.horizontal)R[T.index].y+=C,R[T.index+1].y+=C;else if(T.vertical)R[T.index].x+=C,R[T.index+1].x+=C;else return;return h(T.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),y=k((T,C)=>({x:T.x??(C.left+C.right)/2,y:T.y??(C.top+C.bottom)/2}),"nodeCenter"),v=k(T=>{let C=T.edge,S=yi(C.points??[]);if(S.length!==4||T.index!==1)return;let R=C.start?t.get(C.start):void 0,U=C.end?t.get(C.end):void 0,L=R?Ld(R):void 0,I=U?Ld(U):void 0,A=S.slice(T.index+2);if(!(!R||!U||!L||!I||A.length===0))return{sourceCenter:y(R,L),targetCenter:y(U,I),sourceRect:L,tail:A}},"sourceDetourContextFor"),b=k((T,C,S,R,U,L)=>{let I=R.y>=S.y,A=I?U.bottom:U.top,P=A+(I?20:-20);if(I&&T.b.y<=P+.001||!I&&T.b.y>=P-.001)return;let D=T.a.x+C;return yi([{x:S.x,y:A},{x:S.x,y:P},{x:D,y:P},{x:D,y:T.b.y},...L],.001)},"verticalSourceDetour"),x=k((T,C,S,R,U,L)=>{let I=R.x>=S.x,A=I?U.right:U.left,P=A+(I?20:-20);if(I&&T.b.x<=P+.001||!I&&T.b.x>=P-.001)return;let D=T.a.y+C;return yi([{x:A,y:S.y},{x:P,y:S.y},{x:P,y:D},{x:T.b.x,y:D},...L],.001)},"horizontalSourceDetour"),E=k((T,C)=>{let S=v(T);if(S){if(T.vertical)return b(T,C,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail);if(T.horizontal)return x(T,C,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let T=0;T<12;T++){let C=f(),S=!1;for(let R=0;RP.interior);for(let P of A){for(let D of w){let M=g(P,D);if(M&&m(P.edge,M)){P.edge.points=M,S=!0;break}let O=E(P,D);if(O&&m(P.edge,O)){P.edge.points=O,S=!0;break}}if(S)break}}if(!S)return}}function Rit(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=n.x-r.x,s=n.y-r.y,l=i*s-a*o;if(Math.abs(l)<1e-10)return!1;let u=r.x-e.x,d=r.y-e.y,h=(u*s-d*o)/l,f=(u*a-d*i)/l,p=.01;return h>p&&h<1-p&&f>p&&f<1-p}function Mit(e){let t=e.nodes??[],r=e.edges??[],n=[];if(!r.length||!t.length)return n;let i=nit(t),a=1,o=[];for(let l of r){if(l.isLayoutOnly)continue;let u=l.points;if(!u||u.length<2)continue;let d=l.start,h=l.end,f=l.labelNodeId,p=l.id??`${d}->${h}`;for(let m of i)if(!(m.nodeId===d||m.nodeId===h)&&!(f&&m.nodeId===f)){for(let g=0;g0){let l=n.filter(d=>d.type==="edge-node-overlap").length,u=n.filter(d=>d.type==="edge-edge-crossing").length;ye.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${l} edge-node overlap(s), ${u} edge crossing(s)`);for(let d of n)ye.warn(`[SWIMLANE_VALIDATE] ${d.type}: ${d.detail}`)}return n}function Lit(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(s=>!s.isGroup);if((t==="LR"||t==="RL")&&i.length>0&&!vit(e,t)||t==="BT"&&i.length>0&&!yit(e))return;for(let s of n){if(s.isLayoutOnly)continue;let l=s.points;!l||l.length<2||(s.points=wg(QV(l)))}Ait(n,r),Iit(n,r),bit(n,r);let a=new Map;for(let s of r)a.set(String(s.id),s);jV(n,a),lit(n,a),xit(n,a),Vfe(n,a),wit(n,a),Eit(n,a),Ofe(n,a),Tit(n,a);let o=k(()=>{Sit(n,a),kit(n,a),Cit(n,a),jV(n,a),_fe(n,a),Ofe(n,a),jV(n,a),_fe(n,a)},"finalizeRenderedEdges");o(),Vfe(n,a),o(),Bfe(n,a),Ffe(n,a),Bfe(n,a),Ffe(n,a)}function tx(e){let t=new Map(e.nodeById),r=new Set,n=[];for(let a of e.edges){if(!t.has(a.src)||!t.has(a.dst))continue;let o=`${a.id}:${a.src}->${a.dst}`;r.has(o)||(r.add(o),n.push(a))}return{nodes:[...t.keys()],edges:n,layout:e.layout,nodeById:t}}function hpe(e,t){return e.edges.filter(r=>r.dst===t)}function Dit(e){let t=new Map;for(let r of e.nodes)t.set(r,[]);for(let r of e.edges)t.get(r.src).push(r.dst);return t}function fpe(e){let t=Dit(e);for(let r of t.values())r.sort((n,i)=>n.localeCompare(i));return t}function ppe(e){let t=new Map;for(let r of e.nodes)t.set(r,0);for(let r of e.edges)t.set(r.dst,(t.get(r.dst)??0)+1);return t}function mpe(e){return[...e.entries()].filter(([,t])=>t===0).map(([t])=>t).sort((t,r)=>t.localeCompare(r))}function sH(e,t=()=>!0){let r=new Map,n=new Map;for(let i of e.nodes)r.set(i,[]),n.set(i,[]);for(let i of e.edges)t(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}function gpe(e,t,r,n){let i=0;for(let o of e.nodes)n?.skipGroups&&e.nodeById.get(o)?.isGroup||(i=Math.max(i,r[o]??0));let a=Array.from({length:i+1},()=>[]);for(let o of t)n?.skipGroups&&e.nodeById.get(o)?.isGroup||a[Math.max(0,r[o]??0)].push(o);return a}function FR(e){let t=ppe(e),r=mpe(t),n=[],i=fpe(e);for(;r.length;){let a=r.shift();n.push(a);for(let o of i.get(a)??[])if(t.set(o,(t.get(o)??0)-1),(t.get(o)??0)===0){let s=0;for(;s{if(i-n<=1)return 0;let a=n+i>>1,o=r(n,a)+r(a,i),s=n,l=a,u=n;for(;s=i||sh.dst===f.dst?h.id.localeCompare(f.id):h.dst.localeCompare(f.dst));let n=Object.create(null);for(let d of t.nodes)n[d]=0;let i=[],a=k(d=>{n[d]=1;for(let h of r.get(d)??[]){let f=h.dst;n[f]===0?a(f):n[f]===1&&i.push(h)}n[d]=2},"dfs"),o=[...t.nodes].sort((d,h)=>d.localeCompare(h));for(let d of o)n[d]===0&&a(d);let s=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`)),l=t.edges.map(d=>s.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);return{acyclic:{nodes:[...t.nodes],edges:l,layout:t.layout,nodeById:new Map(t.nodeById)},reversed:i}}function _it(e){let t=new Map,r=k(n=>{if(t.has(n))return t.get(n);let i=e.nodeById.get(n);if(!i)return t.set(n,null),null;let a=i.parentId;if(!a)return t.set(n,null),null;let s=r(a)??a;return t.set(n,s),s},"resolve");for(let n of e.nodes)r(n);return t}function Iy(e){let t=_it(e);return r=>t.get(r)??null}function lH(e){let t=[];for(let r of e.layout.nodes??[])r.isGroup&&!r.parentId&&t.push(r.id);return[...new Set(t)].reverse()}function vpe(e,t){let r=lH(e);if(!t||t.length===0)return r;let n=new Set(r),i=new Set,a=[];for(let o of t)!n.has(o)||i.has(o)||(i.add(o),a.push(o));for(let o of r)i.has(o)||a.push(o);return a}function Pit(e,t){let r=tx(e),n=t?.laneOf??(()=>null),i=t?.rankHint,{preds:a}=sH(r);for(let w of a.values())w.sort((T,C)=>T.localeCompare(C));let o=FR(r)??[...r.nodes].sort((w,T)=>w.localeCompare(T)),s=new Map;for(let[w,T]of o.entries())s.set(T,w);let l=new Map,u=new Map;for(let w of r.nodes)u.set(w,[]);for(let w of o){let T=(a.get(w)??[]).filter(C=>l.has(C));if(T.length>0){let C=Oit(w,T,{laneOf:n,rankHint:i,topoIndex:s});l.set(w,C),u.get(C).push(w)}else l.has(w)||l.set(w,null)}for(let w of r.nodes)l.has(w)||l.set(w,null);let d=new Set;for(let w of r.nodes)(l.get(w)??null)===null&&d.add(w);let h=[...d].sort((w,T)=>{let C=s.get(w)??0,S=s.get(T)??0;return C===S?w.localeCompare(T):C-S}),f=Bit(r),p=new Map;for(let[w,T]of f.entries())p.set(w,[...T].sort((C,S)=>C.localeCompare(S)));let m=Fit(p),g=zit(p),y=new Map;for(let w of r.nodes)y.set(w,[]);for(let w of g)for(let T of w.nodes){let C=y.get(T);C?C.push(w.id):y.set(T,[w.id])}let v=[],b=[],x=new Set,E=k(w=>{if(!x.has(w)){x.add(w),v.push(w);for(let T of u.get(w)??[])E(T);b.push(w)}},"walk");for(let w of h)E(w);for(let w of o)E(w);return{parent:l,children:u,roots:h,componentOf:m,blocks:g,nodeBlocks:y,adjacency:p,preorder:v,postorder:b,topologicalOrder:o}}function Oit(e,t,r){let n=r.laneOf(e);return[...t].sort((a,o)=>{let s=r.laneOf(a),l=r.laneOf(o),u=s!=null&&s===n,d=l!=null&&l===n;if(u!==d)return u?-1:1;let h=r.rankHint?.[a],f=r.rankHint?.[o];if(h!=null&&f!=null&&h!==f)return f-h;let p=r.topoIndex.get(a)??0,m=r.topoIndex.get(o)??0;return p!==m?p-m:a.localeCompare(o)})[0]}function Bit(e){let t=new Map;for(let r of e.nodes)t.set(r,new Set);for(let r of e.edges)t.get(r.src).add(r.dst),t.get(r.dst).add(r.src);return t}function Fit(e){let t=new Map,r=0;for(let n of e.keys()){if(t.has(n))continue;let i=[n];for(;i.length>0;){let a=i.pop();if(!t.has(a)){t.set(a,r);for(let o of e.get(a)??[])t.has(o)||i.push(o)}}r++}return t}function zit(e){let t=new Map,r=new Map,n=[],i=[],a=0,o=k((s,l)=>{t.set(s,++a),r.set(s,a);for(let u of e.get(s)??[])u!==l&&(t.has(u)?(t.get(u)??0)<(t.get(s)??0)&&(n.push([s,u]),r.set(s,Math.min(r.get(s)??a,t.get(u)??a))):(n.push([s,u]),o(u,s),r.set(s,Math.min(r.get(s)??a,r.get(u)??a)),(r.get(u)??0)>=(t.get(s)??0)&&i.push(Git(s,u,n,i.length))))},"visit");for(let s of e.keys())t.has(s)||o(s,null);return i}function Git(e,t,r,n){let i=[],a=new Set;for(;r.length>0;){let o=r.pop();if(i.push(o),a.add(o[0]),a.add(o[1]),o[0]===e&&o[1]===t||o[0]===t&&o[1]===e)break}return{id:n,edges:i,nodes:[...a]}}function Wit(e,t,r){let n=[...e.nodes],i=new Map;for(let[b,x]of n.entries())i.set(x,b);let a=n.length,o=new Array(a).fill(-1),s=new Array(a).fill(0),l=[],u=new Set;for(let b of n){let x=r.parent.get(b)??null,E=i.get(b);E!=null&&x==null&&(o[E]=-1,s[E]=0,u.has(b)||(u.add(b),l.push(b)))}for(;l.length>0;){let b=l.shift(),x=i.get(b);if(x==null)continue;let E=r.children.get(b)??[];for(let w of E){if(u.has(w))continue;let T=i.get(w);T!=null&&(o[T]=x,s[T]=s[x]+1,u.add(w),l.push(w))}}for(let b of n){if(u.has(b))continue;let x=i.get(b);x!=null&&(o[x]=-1,s[x]=0,u.add(b))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),h=Array.from({length:d},()=>new Array(a).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;s[b]>w&1&&(b=h[w][b],b===-1))return-1;if(b===x)return b;for(let w=d-1;w>=0;w--){let T=h[w][b],C=h[w][x];T===-1||C===-1||T!==C&&(b=T,x=C)}return h[0][b]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(let b of e.edges){let x=b.src,E=b.dst,w=t[x],T=t[E];if(w==null||T==null||(w>T&&([x,E]=[E,x],[w,T]=[T,w]),w==null||T==null||w===T))continue;let C=i.get(x),S=i.get(E);if(C==null||S==null)continue;let R=f(C,S);if(R===-1)continue;let U=p[R];for(let L=w;L{if(x.size!==0)for(let[E,w]of x)b.set(E,(b.get(E)??0)+w)},"mergeInto"),y=new Set,v=k(b=>{let x=i.get(b);y.add(b);let E=x==null?void 0:p[x],w=E?new Map(E):new Map,T=r.children.get(b)??[];for(let C of T){let S=v(C),R=t[b];if(R!=null){let U=m.get(b);U||(U=new Map,m.set(b,U));let L=S.get(R)??0,I=t[C];I!=null&&I>R&&(L+=1),U.set(C,L)}g(w,S)}return w},"dfs");for(let b of r.roots)y.has(b)||v(b);for(let b of n)y.has(b)||v(b);return m}function Vit(e,t,r){let n=new Map,i=k(a=>{let o=r[a]??0,s=[...t.get(a)??[]];s.sort(bpe(r));for(let l of s){i(l);let u=n.get(l);u!=null&&(o=Math.min(o,u))}n.set(a,o)},"annotate");for(let a of e)i(a);return n}function bpe(e){return(t,r)=>{let n=e[t]??0,i=e[r]??0;return n===i?t.localeCompare(r):n-i}}function Hit(e,t,r,n){let i=0;for(let l of t){let u=r[l]??0;u>i&&(i=u)}let a=Array.from({length:i+1},()=>[]),o=new Set,s=k(l=>{if(o.has(l))return;o.add(l);let u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(let d of n(l))s(d)},"emit");for(let l of e)s(l);for(let l of t)if(!o.has(l)){let u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),o.add(l)}return a}function qit(e){let t=[];for(let r of e){let n=new Set,i=[];for(let a of r)n.has(a)||(n.add(a),i.push(a));t.push(i)}return t}function Yit(e,t,r,n){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],l=[],u=r.get(i);for(let d of a){let h=n.get(d)??o;h>o?s.push({child:d,min:h}):l.push(d)}return s.sort((d,h)=>d.min===h.min?d.child.localeCompare(h.child):d.min-h.min),l.sort((d,h)=>{let f=u?.get(d)??0,p=u?.get(h)??0;if(f!==p)return f-p;let m=n.get(d)??o,g=n.get(h)??o;return m!==g?m-g:d.localeCompare(h)}),[...s.map(d=>d.child),...l]}}function iH(e,t,r){let n=Pit(e,{rankHint:t,laneOf:r}),{children:i,roots:a}=n;for(let h of e.nodes)i.has(h)||i.set(h,[]);let o=Wit(e,t,n),s=[...a].sort(bpe(t)),l=Vit(s,i,t),u=Yit(i,t,o,l),d=Hit(s,e.nodes,t,u);return d=qit(d),d}function jit(e,t,r){let n=new Set(e),i=new Set(t),a=_C(t),o=[];for(let s of r)n.has(s.src)&&i.has(s.dst)&&o.push(a.get(s.dst));return ype(o)}function Hfe(e,t,r){let n=[];for(let a of t){let o=r[a.src],s=r[a.dst];if(o==null||s==null||o===s)continue;let l=a.src,u=a.dst,d=o,h=s;o>s&&(l=a.dst,u=a.src,d=s,h=o);for(let f=d;f(r[f]??0)-(r[h]??0));for(let h of d){let f=r[h]??0;if(f===0)continue;let p=0;for(let v of n.get(h)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;let m=f;r[h]=p;let g=iH(e,r,i),y=Hfe(g,e.edges,r);y(t[i]??0)-(t[a]??0)||i.localeCompare(a));for(let i of n){let a=r(i);if(!a)continue;let o=e.edges.filter(g=>g.src===i);if(o.length===0)continue;let s=!1,l=0;for(let g of o){let y=r(g.dst);y==null||y===a?s=!0:l++}if(l===0||s)continue;let u=0,d=!1;for(let g of e.edges){if(g.dst!==i)continue;let y=r(g.src);y&&(y===a?d=!0:u++)}if(u>0||!d)continue;let h=t[i]??0,f=h+l,p=0;for(let g of e.edges)g.dst===i&&(p=Math.max(p,(t[g.src]??0)+1));let m=Math.max(h,p,f);m!==h&&(t[i]=m)}}function Kit(e,t){let r=tx(e),n=FR(r)??[...r.nodes].sort(),i=t?.compactSingleInput??!1,a=Iy(r),o=Object.create(null);for(let l of n){let u=hpe(r,l),d=t?.ignoreCrossLaneEdges?u.filter(h=>{let f=a(h.src),p=a(l);return!f||!p?!0:f===p}):u;if(d.length===0)o[l]=0;else if(i&&d.length===1){let h=d[0].src,f=a(h),p=a(l);f!==p?o[l]=o[h]??0:o[l]=(o[h]??0)+1}else{let h=-1/0;for(let f of d)h=Math.max(h,(o[f.src]??0)+1);o[l]=h===-1/0?0:h}}return(t?.optimizeRanksByCrossings??!1)&&(o=Xit(r,o)),t?.ignoreCrossLaneEdges&&$it(r,o),{layers:iH(r,o,a),rankOf:o,dummy:new Set}}function Zit(e,t){let r=tx(e),i={...Kit(r,{compactSingleInput:t?.compactSingleInput,ignoreCrossLaneEdges:t?.ignoreCrossLaneEdges,optimizeRanksByCrossings:t?.optimizeRanksByCrossings}).rankOf},a=Iy(r),{preds:o,succs:s}=sH(r,m=>{if(t?.ignoreCrossLaneEdges){let g=a(m.src),y=a(m.dst);if(g&&y&&g!==y)return!1}return!0}),l=FR(r)??[...r.nodes],u=[...l].reverse(),d=k((m,g)=>{let y=0;for(let x of o.get(m)??[])y=Math.max(y,(i[x]??0)+1);let v=Number.POSITIVE_INFINITY,b=s.get(m)??[];return b.length>0&&(v=Math.min(...b.map(x=>(i[x]??0)-1))),Number.isFinite(v)||(v=Math.max(y,g)),Math.min(Math.max(g,y),v)},"clampFeasible"),h=nH.GRAVITY_ITERATIONS,f=k(m=>{let g=!1;for(let y of m){let v=o.get(y)??[],b=s.get(y)??[];if(v.length===0&&b.length===0)continue;let x=v.length>0?v.reduce((C,S)=>C+(i[S]??0)+1,0)/v.length:i[y]??0,E=b.length>0?b.reduce((C,S)=>C+(i[S]??0)-1,0)/b.length:i[y]??0,w=Math.round((x+E)/2),T=d(y,w);T!==i[y]&&(i[y]=T,g=!0)}return g},"relaxOrder");for(let m=0;m0){let y=Math.min(...g.map(v=>(i[v]??0)-1));(i[m]??0)>y&&(i[m]=y)}}return{layers:gpe(r,l,i),rankOf:i,dummy:new Set}}function Qit(e){let t=ppe(e),r=fpe(e),n=mpe(t),i=[];for(;n.length>0;){let a=[];for(let o of n){i.push(o);for(let s of r.get(o)??[])t.set(s,(t.get(s)??0)-1),(t.get(s)??0)===0&&a.push(s)}n=a.sort((o,s)=>o.localeCompare(s))}return i.length===e.nodes.length?i:null}function Jit(e,t){let r=tx(e),n=t?.direction==="LR"?Qit(r)??[...r.nodes].sort():FR(r)??[...r.nodes].sort(),i=Iy(r),a=k(d=>i(d)??d,"laneOf"),o=Object.create(null),s=new Map,l=k((d,h)=>t?.ignoreCrossLaneEdges??!0?a(d)===a(h)?1:0:1,"edgeWeight");for(let d of n){if(r.nodeById.get(d)?.isGroup)continue;let f=hpe(r,d),p=0;if(f.length>0)for(let v of f){let b=v.src,x=o[b]??0;p=Math.max(p,x+l(b,d))}let m=a(d),g=s.get(m)??0,y=Math.max(p,g);o[d]=y,s.set(m,y+1)}return{layers:gpe(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}function eat(e,t){let r=tx(t),{rankOf:n}=e,i=e.layers.map(p=>[...p]),a=new Set(e.dummy?[...e.dummy]:[]),o=0,s=new Map(r.nodeById),l=k(p=>{let m=`placeholder-${o++}`,g={id:m,isGroup:!1,isDummy:!0,width:0,height:0};for(s.set(m,g),a.add(m);i.length<=p;)i.push([]);return i[p].push(m),n[m]=p,m},"addDummyAt"),u=[...r.edges].sort((p,m)=>p.id===m.id?p.src===m.src?p.dst.localeCompare(m.dst):p.src.localeCompare(m.src):p.id.localeCompare(m.id)),d=[];for(let p of u){let m=n[p.src]??0,g=n[p.dst]??0;if(g-m<=1){d.push(p);continue}let y=p.src;for(let b=m+1,x=0;b!r.nodes.includes(p))],edges:d,layout:r.layout,nodeById:s};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}function qfe(e){let t=e.length;if(t===0)return Number.POSITIVE_INFINITY;let r=[...e].sort((n,i)=>n-i);return t%2===1?r[(t-1)/2]:.5*(r[t/2-1]+r[t/2])}function Yfe(e){return e.length===0?Number.POSITIVE_INFINITY:e.reduce((r,n)=>r+n,0)/e.length}function tat(e,t,r,n){let i=new Map;for(let a of e)i.set(a,[]);for(let a of r)n==="down"?t.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(t.get(a.src)):t.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(t.get(a.dst));return i}function rat(e,t,r){let n=r.get(e)??0,i=r.get(t)??0;return n!==i?n-i:e.localeCompare(t)}function jfe(e,t,r){let n=new Set(e),i=new Set(t),a=_C(e),o=_C(t),s=[];for(let u of r)n.has(u.src)&&i.has(u.dst)&&s.push({u:a.get(u.src),v:o.get(u.dst)});s.sort((u,d)=>u.u===d.u?u.v-d.v:u.u-d.u);let l=s.map(u=>u.v);return ype(l)}function XV(e,t,r){return[...e].sort((n,i)=>{let a=qfe(t.get(n)??[]),o=qfe(t.get(i)??[]);return a===o?rat(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}function Xfe(e,t,r,n,i,a){let o=_C(e),s=_C(t),l=tat(t,o,r,n);if(!i||!a||a.length===0)return XV(t,l,s);let u=new Map;for(let f of t){let p=i(f),m=u.get(p)??[];m.push(f),u.set(p,m)}let d=[];for(let f of a){let p=u.get(f);if(!p||p.length===0)continue;let m=XV(p,l,s);d.push(...m)}let h=u.get(null);if(h&&h.length>0){let f=XV(h,l,s);for(let p of f){let m=Yfe(l.get(p)??[]),g=d.length;if(isFinite(m))for(let[y,v]of d.entries()){let b=Yfe(l.get(v)??[]);if(mo.has(g.src)&&s.has(g.dst)),d=l?r.filter(g=>s.has(g.src)&&l.has(g.dst)):void 0,h=k(g=>{let y=jfe(e,g,u);return d&&n&&(y+=jfe(g,n,d)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(let g of t)f.set(g,i(g));let p=!0,m=h(a);for(;p;){p=!1;for(let g=0;g+1[...s]),i=t.edges,a=Iy(t),o=vpe(t,r?.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--)n[l]=Xfe(n[l+1],n[l],i,"up",a,o),n[l]=$fe(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}function iat(e,t,r){let n=r?.layerGap??Fnt.DEFAULT_LAYER_GAP,i=r?.nodeGap??Fnt.DEFAULT_NODE_GAP,a=r?.laneGap??i*2,o=r?.direction??"TB",s=o==="LR"||o==="RL",l=e.layers,u=Object.create(null),d=Object.create(null),h=k(U=>t.nodeById.get(U),"getNode"),f=k(U=>h(U)?.width??0,"getWidth"),p=k(U=>h(U)?.height??0,"getHeight"),m=Iy(t),g=vpe(t,r?.laneOrder),y=l.map(U=>U.reduce((L,I)=>Math.max(L,p(I)),0)),v=[];if(s)for(let U=0;U+1Math.max(_,f(B)),0),I=l[U+1].reduce((_,B)=>Math.max(_,f(B)),0),A=y[U],P=y[U+1],D=A/2+P/2,M=(L+I)/2,O=Math.max(0,M-D-n);v.push(O)}let b=new Set;for(let U of l)for(let L of U)b.add(m(L));let x=b.has(null),E=g.filter(U=>b.has(U)),w=[...x?[null]:[],...E],T=Object.create(null);for(let U of E)T[U]=0;x&&(T.null=0);for(let U of l){let L=Object.create(null),I=[];for(let A of U){let P=m(A);P===null?I.push(A):(L[P]||=[]).push(A)}for(let[A,P]of Object.entries(L)){let D=P.reduce((M,O)=>M+f(O),0)+i*Math.max(0,P.length-1);T[A]=Math.max(T[A]??0,D)}if(x&&I.length){let A=I.reduce((P,D)=>P+f(D),0)+i*Math.max(0,I.length-1);T.null=Math.max(T.null??0,A)}}let C=new Map;{let U=w.map(A=>(A===null?T.null:T[A])??0),I=-(U.reduce((A,P)=>A+P,0)+a*Math.max(0,w.length-1))/2;for(let A=0;Af(G)),B=_.reduce((G,z)=>G+z,0)+i*(M.length-1),F=O-B/2;for(let[G,z]of M.entries()){let V=_[G];u[z]=F+V/2,d[z]=S+I/2,F+=V+i}}}let P=v[U]??0;S+=I+n+P}let R=new Map;for(let U of t.edges){let L=U.ref.id;R.has(L)||R.set(L,[]),R.get(L).push(U)}for(let[,U]of R){if(U.length===0)continue;let L=U[0].ref,I=L.start,A=L.end;if(I==null||A==null)continue;let P=Math.round(((u[I]??0)+(u[A]??0))/2),D=new Set;for(let M of U)D.add(M.src),D.add(M.dst);for(let M of D){if(M===I||M===A)continue;t.nodeById.get(M)?.isDummy&&(u[M]=P)}}return{x:u,y:d}}function oat(e){let t=2166136261;for(let r=0;r>>0}function sat(e){let t=e>>>0;return()=>{t+=1831565813;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function lat(e,t){let r=[...e],n=sat(t);for(let i=r.length-1;i>0;i--){let a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}function cat(e,t){let r=0;for(let[n,i]of e.entries())r+=Math.abs(n-(t.get(i)??n));return r}function Kfe(e,t){let r=new Map;for(let[i,a]of e.entries())r.set(a,i);let n=0;for(let{a:i,b:a,weight:o}of t){let s=r.get(i),l=r.get(a);s==null||l==null||(n+=o*Math.abs(s-l))}return n}function uat(e){let t=lH(e);if(t.length<2)return[];let r=new Map(t.map((a,o)=>[a,o])),n=Iy(e),i=new Map;for(let a of e.layout.edges??[]){if(a.isLayoutOnly)continue;let o=typeof a.start=="string"?a.start:void 0,s=typeof a.end=="string"?a.end:void 0;if(!o||!s||!e.nodeById.has(o)||!e.nodeById.has(s))continue;let l=n(o),u=n(s);if(!l||!u||l===u)continue;let d=r.get(l),h=r.get(u);if(d==null||h==null)continue;let[f,p]=d<=h?[l,u]:[u,l],m=`${f}\0${p}`,g=i.get(m);g?g.weight++:i.set(m,{a:f,b:p,weight:1})}return[...i.values()]}function Zfe(e,t,r){let n=[...e],i=Kfe(n,t),a=!0,o=0,s=Math.max(1,n.length);for(;a&&oi.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:o})=>`${i}:${a}:${o}`).join("|");return oat(`${e.join("|")}#${n}#${r}`)}function fat(e,t={}){let r=lH(e);if(r.length<2)return r;let n=uat(e);if(n.length===0)return r;let i=new Map(r.map((s,l)=>[s,l])),a=Zfe(r,n,i),o=Math.max(0,t.restarts??aat);for(let s=0;sYn&&l*3>=s?o>0?"bottom":"top":s>Yn?a>0?"right":"left":r}function Jfe(e,t){return Math.abs(e.to-t.from)ae.isGroup&&!ae.parentId);for(let ae of u){let he={id:ae.id},de=k(me=>{o.set(me.id,he),r.filter(ke=>ke.parentId===me.id).forEach(de)},"assignLane");de(ae)}let d=r.filter(ae=>!ae.isGroup&&!ae.isEdgeLabel).map(ae=>{let he=ae.width??10,de=ae.height??10,me=ae.x??0,ke=ae.y??0,le=G0r;return{nodeId:ae.id,minX:me-he/2-le,maxX:me+he/2+le,minY:ke-de/2-le,maxY:ke+de/2+le,visualXHalfExtent:l?de/2+le:he/2+le}}),h=k((ae,he,de,me)=>{let ke=s.find(le=>le.orientation===ae&&Math.abs(le.coord-he)<1);return ke||(ke={id:`pipe-${ae}-${he.toFixed(0)}`,orientation:ae,coord:he,spanMin:de,spanMax:me,tracks:[]},s.push(ke)),ke.spanMin=Math.min(ke.spanMin,de),ke.spanMax=Math.max(ke.spanMax,me),ke},"getOrAddPipe"),f=k((ae,he)=>{let de=ae.width??10,me=ae.height??10,ke=ae.x??0,le=ae.y??0;switch(he){case"top":return{x:ke,y:le-me/2};case"bottom":return{x:ke,y:le+me/2};case"left":return{x:ke-de/2,y:le};case"right":return{x:ke+de/2,y:le}}},"portForSide"),p=k((ae,he,de)=>f(ae,Qfe(ae,he,de?"bottom":"top")),"getOrthogonalPort"),m=[],g=[],y=new Set,v=1e3,b=k((ae,he,de)=>{if(m.length===0)return 0;let me=Math.abs(he.y-de.y)q||j.from-Yn<=W&&j.to+Yn>=W&&(le+=v)}else if(ke){let W=he.x,X=Math.min(he.y,de.y)-Yn,q=Math.max(he.y,de.y)+Yn;if(q<=X)return 0;for(let j of m)j.edgeIndex===ae||j.orientation!=="horizontal"||j.pipe.coordq||j.from-Yn<=W&&j.to+Yn>=W&&(le+=v)}return le},"crossingPenalty"),x=i.map((ae,he)=>{if(!ae.start||!ae.end)return{idx:he,crossLane:0,dx:0,dy:0};let de=a.get(ae.start),me=a.get(ae.end),ke=o.get(ae.start),le=o.get(ae.end),W=ke&&le&&ke.id!==le.id?1:0,X=de&&me?Math.abs((me.x??0)-(de.x??0)):0,q=de&&me?Math.abs((me.y??0)-(de.y??0)):0;return{idx:he,crossLane:W,dx:X,dy:q}}).sort((ae,he)=>{if(ae.crossLane!==he.crossLane)return he.crossLane-ae.crossLane;let de=ae.dx+ae.dy,me=he.dx+he.dy;return Math.abs(de-me)>1?de-me:ae.idx-he.idx}).map(ae=>ae.idx),E=k((ae,he,de,me)=>{let ke=Math.min(ae.x,he.x),le=Math.max(ae.x,he.x),W=Math.min(ae.y,he.y),X=Math.max(ae.y,he.y);return!!d.find(j=>de&&j.nodeId===de||me&&j.nodeId===me?!1:Math.abs(ae.x-he.x)>Yn?j.minYae.y&&j.maxX>ke&&j.minXae.x&&j.maxY>W&&j.minYQfe(ae,he,"bottom"),"determineSide"),S=new Map;for(let[ae,he]of i.entries()){if(!he.start||!he.end||he.start===he.end||he.points&&he.points.length>0)continue;let de=a.get(he.start),me=a.get(he.end);if(!de||!me)continue;let ke=(me.x??0)-(de.x??0),le=(me.y??0)-(de.y??0);S.set(ae,{edgeIdx:ae,srcId:he.start,dstId:he.end,srcSide:C(de,{x:me.x??0,y:me.y??0}),dstSide:C(me,{x:de.x??0,y:de.y??0}),absDx:Math.abs(ke),absDy:Math.abs(le),dxSign:Math.sign(ke),dySign:Math.sign(le)})}let R=k(ae=>ae.srcSide==="top"||ae.srcSide==="bottom"?ae.absDx===0?1/0:ae.absDy/ae.absDx:ae.absDy===0?1/0:ae.absDx/ae.absDy,"preferenceStrength"),U=k(ae=>ae.srcSide==="top"||ae.srcSide==="bottom"?ae.dxSign>=0?"right":"left":ae.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(let ae of S.values()){let he=`${ae.srcId}:${ae.srcSide}`;L.has(he)||L.set(he,[]),L.get(he).push(ae)}let I=new Map,A=k((ae,he)=>`${ae}:${he}`,"loadKey");for(let ae of S.values())I.set(A(ae.srcId,ae.srcSide),(I.get(A(ae.srcId,ae.srcSide))??0)+1),I.set(A(ae.dstId,ae.dstSide),(I.get(A(ae.dstId,ae.dstSide))??0)+1);for(let ae of L.values())if(!(ae.length<2)){ae.sort((he,de)=>{let me=R(he),ke=R(de);return Math.abs(me-ke)>1e-9?ke-me:he.edgeIdx-de.edgeIdx});for(let he=1;he=ke||(I.set(A(de.srcId,de.srcSide),ke-1),I.set(A(de.srcId,me),le+1),de.srcSide=me)}}let P=k(ae=>{let he=ae?.shape;return he==="question"||he==="diamond"},"isDiamondNode"),D=new Map;for(let ae of S.values())D.has(ae.dstId)||D.set(ae.dstId,new Set),D.get(ae.dstId).add(ae.dstSide);for(let ae of S.values()){if(!P(a.get(ae.srcId)))continue;let he=D.get(ae.srcId);if(!he?.has(ae.srcSide))continue;let de=U(ae);if(he.has(de)||(I.get(A(ae.srcId,de))??0)>0)continue;let me=I.get(A(ae.srcId,ae.srcSide))??0;I.set(A(ae.srcId,ae.srcSide),Math.max(0,me-1)),I.set(A(ae.srcId,de),1),ae.srcSide=de}for(let ae of S.values()){let{edgeIdx:he,srcId:de,dstId:me,srcSide:ke,dstSide:le}=ae,W=a.get(de),X=a.get(me),q=`${de}:${ke}:src`,j=ke==="top"||ke==="bottom"?X.x??0:X.y??0;w.has(q)||w.set(q,[]),w.get(q).push({edgeIdx:he,oppositeCoord:j});let se=`${me}:${le}:dst`,J=le==="top"||le==="bottom"?W.x??0:W.y??0;w.has(se)||w.set(se,[]),w.get(se).push({edgeIdx:he,oppositeCoord:J})}let M=new Map,O=8;for(let[ae,he]of w){if(he.length<2)continue;he.sort((Ae,Ie)=>Ae.oppositeCoord-Ie.oppositeCoord);let de=ae.split(":"),me=de.slice(0,-2).join(":"),ke=de[de.length-2],le=de[de.length-1],W=a.get(me);if(!W)continue;let q=ke==="left"||ke==="right"?W.height??10:W.width??10,j=W.shape,J=j==="question"||j==="diamond"?q*.3:q,ee=Math.min(20,Math.max(O,J/(he.length+1))),Te=-(ee*(he.length-1))/2;for(let[Ae,Ie]of he.entries()){let Ge=Te+Ae*ee,De=`${Ie.edgeIdx}:${le}`;M.set(De,Ge)}}let _=k(ae=>!!i[ae]?.labelNodeId,"edgeHasLabelNode"),B=k((ae,he)=>ae?(w.get(`${ae}:${he}:src`)??[]).some(({edgeIdx:de})=>_(de))||(w.get(`${ae}:${he}:dst`)??[]).some(({edgeIdx:de})=>_(de)):!1,"faceHasLabelNode"),F=k((ae,he,de)=>he==="top"||he==="bottom"?{x:ae.x+de,y:ae.y}:{x:ae.x,y:ae.y+de},"applyPortOffset"),G=k((ae,he,de)=>{let me=S.get(ae),ke={x:de.x??0,y:de.y??0},le={x:he.x??0,y:he.y??0},W=me?.srcSide??C(he,ke),X=me?.dstSide??C(de,le),q=me?f(he,me.srcSide):p(he,ke,!0),j=me?f(de,me.dstSide):p(de,le,!1),se=M.get(`${ae}:src`),J=M.get(`${ae}:dst`);return se!==void 0&&(q=F(q,W,se)),J!==void 0&&(j=F(j,X,J)),{pSrcPort:q,pDstPort:j,srcSide:W,dstSide:X}},"portsForEdge");for(let ae of x){let he=i[ae];if(g[ae]=[],!he.start||!he.end||he.points&&he.points.length>0||he.start===he.end)continue;let de=a.get(he.start),me=a.get(he.end);if(!de||!me)continue;let{pSrcPort:ke,pDstPort:le,srcSide:W,dstSide:X}=G(ae,de,me),q={...ke},j={...le},se=W==="top"||W==="bottom",J=X==="top"||X==="bottom";if(se){let ot=ke.y>(de.y??0);q.y=ot?ke.y+_f:ke.y-_f}else{let ot=ke.x>(de.x??0);q.x=ot?ke.x+_f:ke.x-_f}if(J){let ot=le.y>(me.y??0);j.y=ot?le.y+_f:le.y-_f}else{let ot=le.x>(me.x??0);j.x=ot?le.x+_f:le.x-_f}let K=k((ot,wt)=>{for(let zt of d)if(!wt.includes(zt.nodeId)&&ot.x>zt.minX&&ot.xzt.minY&&ot.y{if(Dr){let wn=ot.y>(wt.y??0);return{x:(zt.x??0)>=ot.x?Pr.maxX+F4:Pr.minX-F4,y:wn?Pr.maxY+MC:Pr.minY-MC,leavesPositiveSide:wn}}let Ln=ot.x>(wt.x??0),Si=(zt.y??0)>=ot.y;return{x:Ln?Pr.maxX+F4:Pr.minX-F4,y:Si?Pr.maxY+MC:Pr.minY-MC,leavesPositiveSide:Ln}},"obstacleDetour"),Se=[],Te=[he.start,he.end],Ae=K(q,Te);if(Ae.inside&&Ae.obstacle){let ot=Ae.obstacle;if(se){let wt=ee(ke,de,me,ot,!0);q.x=wt.x,q.y=wt.y;let zt=wt.leavesPositiveSide?Math.min(ot.minY-2,ke.y+_f):Math.max(ot.maxY+2,ke.y-_f);Se=[{x:ke.x,y:zt},{x:wt.x,y:zt},{x:wt.x,y:wt.y}]}else{let wt=ee(ke,de,me,ot,!1),zt=wt.leavesPositiveSide?Math.min(ot.minX-2,ke.x+_f):Math.max(ot.maxX+2,ke.x-_f);q.x=wt.x,q.y=wt.y,Se=[{x:zt,y:ke.y},{x:zt,y:wt.y},{x:wt.x,y:wt.y}]}}let Ie=[],Ge=K(j,Te);if(Ge.inside&&Ge.obstacle){let ot=Ge.obstacle;if(J){let wt=ee(le,me,de,ot,!0);j.x=wt.x,j.y=wt.y,Ie=[{x:wt.x,y:wt.y},{x:le.x,y:wt.y}]}else{let wt=ee(le,me,de,ot,!1);j.x=wt.x,j.y=wt.y,Ie=[{x:wt.x,y:wt.y},{x:wt.x,y:le.y}]}}if(Se.length===0&&Ie.length===0){let ot=F4,wt=Math.abs(q.x-j.x)1||Ln>1,wn=T.get(he.start??"")??0,Vt=T.get(he.end??"")??0,At=Dr>1&&B(he.start,W)||Ln>1&&B(he.end,X),tr=Dr<=1||wn<=2,$t=Ln<=1||Vt<=2;if((wt||zt)&&!Pr&&(!Si||Si&&!At&&tr&&$t)&&!E(ke,le,he.start,he.end)){he.points=[{...ke},{...q},{...j},{...le}],y.add(ae);let _e=zt?"horizontal":"vertical",aa=zt?ke.y:ke.x,We=zt?Math.min(ke.x,le.x):Math.min(ke.y,le.y),cn=zt?Math.max(ke.x,le.x):Math.max(ke.y,le.y),Fs={id:`fast-path-${_e}-${aa.toFixed(0)}-${ae}`,orientation:_e,coord:aa,spanMin:We,spanMax:cn,tracks:[]};m.push({edgeIndex:ae,segmentIndex:0,orientation:_e,pipe:Fs,trackIndex:0,from:We,to:cn});continue}}let De=h("vertical",q.x,q.y,q.y);q.x=De.coord;let He=h("vertical",j.x,j.y,j.y);j.x=He.coord;let ze=Math.min(q.x,j.x)-50,Ke=Math.max(q.x,j.x)+50,we=Math.min(q.y,j.y)-50,bt=Math.max(q.y,j.y)+50;for(let ot of d){let wt=Math.min(q.x,j.x),zt=Math.max(q.x,j.x),Pr=Math.min(q.y,j.y),Dr=Math.max(q.y,j.y);ot.minXwt&&ot.minYPr&&(ze=Math.min(ze,ot.minX-YV),Ke=Math.max(Ke,ot.maxX+YV),we=Math.min(we,ot.minY-YV),bt=Math.max(bt,ot.maxY+YV))}for(let ot of d){if(ot.maxXKe||ot.maxYbt)continue;let wt=F4;h("horizontal",ot.minY-wt,ze,Ke),h("horizontal",ot.maxY+wt,ze,Ke);let zt=MC;h("vertical",ot.minX-zt,we,bt),h("vertical",ot.maxX+zt,we,bt)}h("horizontal",q.y,ze,Ke),h("horizontal",j.y,ze,Ke);let Ve=s.filter(ot=>ot.orientation==="horizontal"&&ot.coord>=we&&ot.coord<=bt),vt=s.filter(ot=>ot.orientation==="vertical"&&ot.coord>=ze&&ot.coord<=Ke),Pt=k((ot,wt)=>`${ot.toFixed(1)},${wt.toFixed(1)}`,"getKey"),Xt=Pt(q.x,q.y),It=Pt(j.x,j.y),Ot=new Map,Et=new Map,Ee=new Map,gt=new Set,Ut=[];Ot.set(Xt,0),Ee.set(Xt,"n"),Ut.push({key:Xt,f:Math.hypot(j.x-q.x,j.y-q.y),pt:q}),gt.add(Xt);let ct=[],Ne=k((ot,wt)=>E(ot,wt,he.start,he.end),"checkSegmentBlocked"),at={x:j.x,y:q.y},ft=Ne(q,at),Ct=Ne(at,j),Er=ft||Ct,Wt={x:q.x,y:j.y},Sr=Ne(q,Wt),on=Ne(Wt,j);if(Er?Sr||on||(Math.abs(q.x-j.x)0;){Ut.sort((Vt,At)=>Vt.f-At.f);let ot=Ut.shift();if(gt.delete(ot.key),ot.key===It){let Vt=It,At=j;for(ct=[At];Et.has(Vt);){let tr=Et.get(Vt);ct.unshift(tr),At=tr,Vt=Pt(tr.x,tr.y)}break}let wt=ot.pt.x,zt=ot.pt.y,Pr=vt.sort((Vt,At)=>Vt.coord-At.coord),Dr=Pr.findIndex(Vt=>Math.abs(Vt.coord-wt)<1),Ln=Ve.sort((Vt,At)=>Vt.coord-At.coord),Si=Ln.findIndex(Vt=>Math.abs(Vt.coord-zt)<1),wn=[];Dr>0&&wn.push({x:Pr[Dr-1].coord,y:zt}),Dr>=0&&Dr0&&wn.push({x:wt,y:Ln[Si-1].coord}),Si>=0&&Siyl.nodeId===he.start||yl.nodeId===he.end?!1:At!==tr?yl.minYzt&&yl.maxX>At&&yl.minXwt&&yl.maxY>$t&&yl.minY10&&Rv<-5||hp<-10&&Rv>5)&&(cn=Math.abs(Rv)*100),(Fs>10&&Iv<-5||Fs<-10&&Iv>5)&&(cn+=Math.abs(Iv)*50);let bw=0,go=Ee.get(ot.key)??"n",Jd=Math.abs(Iv)>Yn?"h":"v";go!=="n"&&go!==Jd&&(bw=50);let f1=aa+We+cn+bw,eh=(Ot.get(ot.key)??1/0)+f1,Mv=Math.abs(j.x-Vt.x)+Math.abs(j.y-Vt.y);if(eh<(Ot.get(_e)??1/0))if(Et.set(_e,ot.pt),Ot.set(_e,eh),Ee.set(_e,Jd),!gt.has(_e))Ut.push({key:_e,f:eh+Mv,pt:Vt}),gt.add(_e);else{let yl=Ut.findIndex(p1=>p1.key===_e);yl!==-1&&(Ut[yl].f=eh+Mv)}}}if(ct.length===0&&(ct=[q,{x:q.x,y:j.y},j]),ct.length>4){let ot=ct[0],wt=ct[ct.length-1],zt=Math.min(ot.x,wt.x),Pr=Math.max(ot.x,wt.x),Dr=Math.min(ot.y,wt.y),Ln=Math.max(ot.y,wt.y);for(let $t of ct)zt=Math.min(zt,$t.x),Pr=Math.max(Pr,$t.x),Dr=Math.min(Dr,$t.y),Ln=Math.max(Ln,$t.y);let Si=Pr>Math.max(ot.x,wt.x),wn=ztWe.minXDt&&We.minY<_e&&We.maxY>kr);if(aa.length>0){let We=Math.max(ot.x,wt.x);for(let cn of aa){let Fs=(cn.minX+cn.maxX)/2;if(cn.visualXHalfExtent===void 0||isNaN(cn.visualXHalfExtent))continue;let hp=Fs+cn.visualXHalfExtent+$t;We=Math.max(We,hp)}isNaN(We)||(Pr=We)}}if(wn){let Dt=d.filter(kr=>kr.minXMath.min(ot.y,wt.y));if(Dt.length>0){let kr=Math.min(ot.x,wt.x);for(let _e of Dt){let We=(_e.minX+_e.maxX)/2-_e.visualXHalfExtent-$t;kr=Math.min(kr,We)}zt=kr}}}let Vt=k($t=>{let Dt=wt.y>ot.y,kr=d.filter(We=>{let cn=Math.min(ot.x,wt.x)We.minX,Fs=Math.min(ot.y,wt.y)We.minY;return cn&&Fs}),_e=kr;if(l&&kr.length>0){let We=kr.filter(cn=>cn.minX<$t&&cn.maxX>$t);We.length>0&&(_e=We)}if(_e.length===0)return wt.y;let aa=F4;if(Dt){let cn=Math.max(..._e.map(Fs=>Fs.maxY))+aa;if(cnFs.minY))-aa;if(cn>wt.y+Yn)return cn}return wt.y},"findBestReturnY"),At=k($t=>{let Dt=Vt($t),kr={x:$t,y:ot.y},_e={x:$t,y:Dt},aa={x:wt.x,y:Dt},We=Ne(ot,kr),cn=Ne(kr,_e),Fs=Ne(_e,aa),hp=Dt!==wt.y?Ne(aa,wt):!1;return!We&&!cn&&!Fs&&!hp?Math.abs(Dt-wt.y)=3){let ot=Jt[Jt.length-1],wt=Jt[Jt.length-2],zt=Jt[Jt.length-3],Pr=Math.abs(zt.y-wt.y)Math.abs(ot.x-zt.x)&&Jt.splice(-2,1)}else if(Dr){let Ln=Math.sign(wt.y-zt.y),Si=Math.sign(ot.y-zt.y);Ln!==0&&Ln===Si&&Math.abs(wt.y-zt.y)>Math.abs(ot.y-zt.y)&&Jt.splice(-2,1)}}let Ar=[Jt[0]];for(let ot=1;otwt.x,Ln=Pr.x>zt.x;if(Dr!==Ln){Ar.push(zt);continue}continue}if(Math.abs(wt.x-zt.x)wt.y,Ln=Pr.y>zt.y;if(Dr!==Ln){Ar.push(zt);continue}continue}Ar.push(zt)}Ar.push(Jt[Jt.length-1]);for(let ot=0;otae.from{let ke=!me.segments.some(W=>(W.edgeIndex!==he.edgeIndex||W.segmentIndex!==he.segmentIndex)&&z(W,ae)),le=!de.segments.some(W=>(W.edgeIndex!==ae.edgeIndex||W.segmentIndex!==ae.segmentIndex)&&z(W,he));return ke&&le?(ae.trackIndex=me.index,he.trackIndex=de.index,de.segments=[...de.segments.filter(W=>W.edgeIndex!==ae.edgeIndex||W.segmentIndex!==ae.segmentIndex),{edgeIndex:he.edgeIndex,segmentIndex:he.segmentIndex,from:he.from,to:he.to}],me.segments=[...me.segments.filter(W=>W.edgeIndex!==he.edgeIndex||W.segmentIndex!==he.segmentIndex),{edgeIndex:ae.edgeIndex,segmentIndex:ae.segmentIndex,from:ae.from,to:ae.to}],!0):!1},"trySwapSegmentsAcrossTracks"),$=k(ae=>{let he=ae.tracks.length;return ae.tracks[he]={index:he,coord:ae.coord,segments:[]},he},"createNewTrack"),Z=k((ae,he)=>{let de=ae.pipe.tracks[ae.trackIndex];de.segments=de.segments.filter(ke=>ke.edgeIndex!==ae.edgeIndex||ke.segmentIndex!==ae.segmentIndex),ae.trackIndex=he,ae.pipe.tracks[he].segments.push({edgeIndex:ae.edgeIndex,segmentIndex:ae.segmentIndex,from:ae.from,to:ae.to})},"moveSegmentToTrack"),re=k((ae,he)=>{let de=g[ae.edgeIndex];for(let me of de){let ke=m[me];ke.pipe===ae.pipe&&Z(ke,he)}},"moveSegmentChainToTrack"),Q=k(ae=>{let he=g[ae.edgeIndex],de=he.indexOf(m.indexOf(ae)),me=[];return de>0&&me.push(m[he[de-1]]),de{if(ae.orientation===he.orientation)return!1;let de=ae.orientation==="horizontal"?ae:he,me=ae.orientation==="horizontal"?he:ae;return me.pipe.coord>de.from&&me.pipe.coordme.from&&de.pipe.coord{for(let de of ae.tracks)if(!de.segments.some(ke=>(ke.edgeIndex!==he.edgeIndex||ke.segmentIndex!==he.segmentIndex)&&z(ke,he)))return de.index;return-1},"findAvailableTrack"),pe=k((ae,he)=>{if(ae.trackIndex===he.trackIndex)return z(ae,he);let de=Q(ae),me=Q(he);return de.some(ke=>me.some(le=>ge(ke,le)))},"segmentsConflict"),ue=k((ae,he,de)=>{if(V(ae,he,ae.pipe.tracks[ae.trackIndex],he.pipe.tracks[he.trackIndex]))return;let me=ie(ae.pipe,he);de(he,me!==-1?me:$(ae.pipe))},"resolveTrackConflict"),fe=k(ae=>{let he=0;for(let de=0;de{if(Me.has(ae))return Me.get(ae);let he=g[ae];if(he.length===0){let X={dest:0,deviation:0,base:0,delta:0};return Me.set(ae,X),X}let me=m[he[0]].pipe.coord,ke=me;for(let X=1;XMath.abs(se-me)?j:se;break}}let le=Math.abs(ke-me),W={dest:ke,deviation:le,base:me,delta:ke-me};return Me.set(ae,W),W},"getDestInfo"),Ye=k(()=>{let ae=0,he=new Map;for(let[me,ke]of i.entries())g[me].length!==0&&ke.start&&(he.has(ke.start)||he.set(ke.start,[]),he.get(ke.start).push(me));let de=k(me=>{let ke=i[me];if(!ke.start||!ke.end)return 0;let le=a.get(ke.start),W=a.get(ke.end);if(!le||!W)return 0;let X=(W.x??0)-(le.x??0),q=(W.y??0)-(le.y??0);return Math.abs(X)+Math.abs(q)},"getEdgeDistance");for(let me of he.values()){me.sort((le,W)=>{let X=Ce(le),q=Ce(W);if(Math.abs(X.deviation-q.deviation)>1)return X.deviation-q.deviation;if(Math.abs(X.dest-q.dest)>1)return X.dest-q.dest;let j=de(le),se=de(W);if(Math.abs(j-se)>1)return se-j;let J=g[le].length,K=g[W].length;if(J!==K)return J-K;if(J===1){let ee=g[le][0],Se=g[W][0];if(m[ee]&&m[Se]){let Te=m[ee],Ae=m[Se],Ie=Math.abs(Te.to-Te.from),Ge=Math.abs(Ae.to-Ae.from);if(Math.abs(Ie-Ge)>1)return Ie-Ge}}return 0});let ke=me.map(le=>m[g[le][0]]);ae+=fe(ke)}return ae},"fixSourceHandleCrossings"),Ze=k(()=>{let ae=0,he=new Map;for(let[de,me]of i.entries())g[de].length!==0&&me.end&&(he.has(me.end)||he.set(me.end,[]),he.get(me.end).push(de));for(let de of he.values()){de.sort((ke,le)=>{let W=k(j=>{let se=g[j];if(se.length<2)return 0;let J=m[se[se.length-2]];return Math.abs(J.to-J.from)},"getDist"),X=W(ke),q=W(le);return Math.abs(X-q)>.1?X-q:ke-le});let me=de.map(ke=>m[g[ke][g[ke].length-1]]);ae+=fe(me)}return ae},"fixTargetHandleCrossings"),Qe=k(()=>{let ae=0;for(let he of s){let de=[];for(let me of he.tracks)for(let ke of me.segments){let le=g[ke.edgeIndex].find(W=>m[W].segmentIndex===ke.segmentIndex);le!==void 0&&de.push(m[le])}de.sort((me,ke)=>me.edgeIndex-ke.edgeIndex||me.segmentIndex-ke.segmentIndex);for(let me=0;me{me.segments.forEach(ke=>{he.push({edgeIndex:ke.edgeIndex,segmentIndex:ke.segmentIndex,trackIndex:me.index,from:ke.from,to:ke.to})})}),he.sort((me,ke)=>me.from-ke.from);let de=[];if(he.length>0){let me=[he[0]],ke=he[0].to;for(let le=1;leke.add(ee.trackIndex));let le=new Map;me.forEach(ee=>{let Se=Ce(ee.edgeIndex);le.set(ee.trackIndex,(le.get(ee.trackIndex)??0)+Se.delta)});let W=[...ke].filter(ee=>(le.get(ee)??0)<-1),X=[...ke].filter(ee=>(le.get(ee)??0)>1),q=[...ke].filter(ee=>Math.abs(le.get(ee)??0)<=1);W.sort((ee,Se)=>(le.get(Se)??0)-(le.get(ee)??0)),X.sort((ee,Se)=>(le.get(ee)??0)-(le.get(Se)??0));let j=k((ee,Se)=>{me.filter(Te=>Te.trackIndex===ee).forEach(Te=>{let Ae=y.has(Te.edgeIndex)?ae.coord:Se;Le.set(`${Te.edgeIndex}-${Te.segmentIndex}`,Ae)})},"assignCoord"),se=0;for(let ee of W)se++,j(ee,ae.coord-se*xfe);if(q.length===0&&ke.size>0){let ee=[...ke].sort((Ae,Ie)=>Math.abs(le.get(Ae)??0)-Math.abs(le.get(Ie)??0))[0],Se=W.indexOf(ee);Se!==-1&&W.splice(Se,1);let Te=X.indexOf(ee);Te!==-1&&X.splice(Te,1),q.push(ee)}let J=0;for(let ee of q){if(J===0)j(ee,ae.coord);else{let Se=J%2===1?1:-1,Te=Math.ceil(J/2);j(ee,ae.coord+Se*Te*xfe*.5)}J++}let K=0;for(let ee of X)K++,j(ee,ae.coord+K*xfe)}}for(let[ae,he]of i.entries()){let de=g[ae]??[];if(de.length===0)continue;let me=[],ke=a.get(he.start),le=a.get(he.end),{pSrcPort:W,pDstPort:X}=G(ae,ke,le),q=de.map(J=>{let K=m[J],ee=Le.get(`${K.edgeIndex}-${K.segmentIndex}`)??K.pipe.coord;return{orient:K.orientation,coord:ee,from:K.from,to:K.to}});me.push(W);for(let J=0;JYn&&me.push(z4(K,Se)),Ie&&Ae.orient===K.orient)if(Math.abs(K.coord-Ae.coord)>Yn){let Ge=K.orient==="vertical"?(Se+Ae.from)/2:Jfe(K,Ae);me.push(z4(K,Ge),z4(Ae,Ge))}else(J===0||J===q.length-2)&&me.push(z4(K,Jfe(K,Ae)));else if(Ie)me.push(z4(K,Ae.coord));else{let Ge=Math.abs(K.from-Se)Yn||Math.abs(j.y-X.y)>Yn)&&me.push(X);let se=[];me.length>0&&se.push(me[0]);for(let J=1;JYn||Math.abs(K.y-ee.y)>Yn)&&se.push(K)}he.points=se}for(let ae of i){let he=ae.__originalEdge;he&&ae.points&&(he.points=ae.points)}e.edges=(e.edges??[]).filter(ae=>!ae.isLayoutOnly);let Be=k((ae,he)=>{let de=he.x??0,me=he.y??0,ke=he.width??0,le=he.height??0;if(ke<=0||le<=0)return ae;let W=de-ke/2,X=de+ke/2,q=me-le/2,j=me+le/2;if(ae.xX||ae.yj)return ae;let se=ae.x-W,J=X-ae.x,K=ae.y-q,ee=j-ae.y,Se=Math.min(se,J,K,ee);return Se===se?{x:W,y:ae.y}:Se===J?{x:X,y:ae.y}:Se===K?{x:ae.x,y:q}:{x:ae.x,y:j}},"nodeBoundaryClamp");for(let ae of e.edges){let he=ae.points;if(!he||he.length<2)continue;let de=ae.start,me=ae.end,ke=de?a.get(de):void 0,le=me?a.get(me):void 0;ke&&(he[0]=Be(he[0],ke)),le&&(he[he.length-1]=Be(he[he.length-1],le))}return e}function gat(e){return e.direction??"TB"}function yat(e){let t=Jnt(e),r=e.config.flowchart?.nodeSpacing??40,n=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=gat(e),{ordered:l,coordinates:u}=pat(t,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});eit(t,l,u,{nodeGap:r,layerGap:n});for(let d of e.edges??[])delete d.points;mat(e,s);for(let d of e.edges??[])(!d.curve||d.curve==="basis")&&(d.curve="rounded");return Lit(e,s),Mit(e),s}function vat(e){Qnt(e);let t=tit(e);e.nodes=t.nodes,e.edges=t.edges}var Nnt,WV,VV,M0r,yfe,L0r,_nt,D0r,Pl,ln,N0r,Pnt,v0,_0r,HV,P0r,Tr,_l,qn,vfe,J2,O0r,Md,Ont,qV,bfe,B0r,Bnt,F0r,z0r,nH,Fnt,aat,Yn,G0r,F4,MC,YV,_f,xfe,W0r,xat=H(()=>{NV();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();Nnt=5,WV=1e-5,VV=1e-6;k($V,"buildSegmentList");k(znt,"segmentIntersection");k(wfe,"isHorizontalSeg");k(Gnt,"findEdgeIntersections");k(b0,"fmt");k(LC,"pointToString");k(Wnt,"getArcSweepFlag");M0r=.001;k(Vnt,"applyMarkerOffsets");k(Hnt,"emitJump");k(Efe,"computeRoundedCorner");k(qnt,"rewriteEdgePath");k(Ynt,"isStraightPath");k(jnt,"curveSupportsLineHops");k(Xnt,"decodeDataPoints");k($nt,"applyLineJumpsToSvg");k(Knt,"applySwimlaneLineJumps");yfe="__swimlane_default__",L0r=21,_nt=20;k(Tfe,"topLaneHorizontalPadding");k(Znt,"assignTopLaneTitleRect");k(Qnt,"prepareLayoutForSwimlanes");k(Jnt,"toGraphView");k(eit,"writeBackToLayoutData");D0r="[EdgeLabelNodes]";k(tit,"createEdgeLabelNodes");Pl=.001;k(epe,"measuredNodeRect");k(tpe,"nodeBoundsInfoFor");k(Pf,"samePoint");k(ri,"sameX");k(ci,"sameY");k(Xo,"isHorizontalSegment");k($o,"isVerticalSegment");k(Iu,"overlapLength");k(xg,"sameAxisSegmentOverlapLength");k(NC,"orthogonalSegmentsForPoints");k(Nh,"countOrthogonalBends");k(yi,"dedupeConsecutivePoints");k(rpe,"classifyThreeSegmentRoute");k(aH,"segmentBoundsOverlapRect");k(npe,"pointInsideRect");k(rit,"rectContainsRect");k(KV,"rectsOverlap");k(kfe,"inflateRect");k(DC,"rectFromCenterSize");k(Ld,"rectOfNodeBounds");k(G4,"portForRectSide");k(ipe,"buildOrthogonalPortPath");k(ape,"buildSameSideTrackPath");k(oH,"collectRealNodeBounds");k(ex,"collectNodeRectEntries");k(nit,"collectLayoutNodeRects");k(ope,"getNodePairGeometry");k(fs,"segmentHitsAnyRect");k(spe,"orthogonalSegmentsCross");k(iit,"sameAxisSegmentsOverlap");k(ZV,"segmentConflictsWithAnyEdge");k(Uy,"orthogonalSegmentsStrictlyCross");k(Cfe,"strictlyBetween");k(ait,"isCollinearIntermediate");k(oit,"simplifyPolylineOnce");k(QV,"orthogonalizePolyline");k(wg,"simplifyPolyline");ln=.001,N0r=.5,Pnt=4;k(lpe,"endpointContextFor");k(sit,"segmentEnterPoint");k(Sfe,"clipEndpoint");k(lit,"clipEdgeEndpointsToNodeBoundaries");k(Afe,"snapEndpointToBoundary");k(JV,"firstDistinctAdjacent");k(eH,"cornerClearanceRange");k(Ufe,"clampToCornerClearance");k(cit,"intersectRanges");k(Ife,"clearanceRangeForSide");k(tH,"terminalSideForSegment");k(BR,"isHorizontalSide");k(uit,"straightClearanceRange");k(Rfe,"clearStraightEndpointCornerAxis");k(cpe,"clearStraightEndpointCornerConnections");k(dit,"cornerClearedEndpoint");k(hit,"moveCollinearEndpointRun");k(Mfe,"clearEndpointCornerConnection");k(Lfe,"borderSideForSegment");k(Dfe,"leavesOutward");k(Nfe,"collapseOwnBorderStub");k(fit,"snapAndCollapseEndpoints");k(_fe,"prepareEdgeEndpointsForRenderer");k(upe,"buildNodeMap");k(pit,"resolveTopLevelGroupId");k(Pfe,"groupDepth");k(dpe,"boundsForChildren");k(mit,"applyGroupBounds");k(git,"recomputeNestedGroupBounds");k(rH,"mirrorAxis");k(yit,"applyBtDirectionTransform");k(vit,"applyLrDirectionTransform");v0=1e-6,_0r=8,HV=_0r,P0r=[0,HV,-HV,2*HV,-2*HV];k(bit,"portSwapToLShape");k(xit,"collapseShortTerminalStub");Tr=.001,_l=8,qn=NC,vfe=k((e,t)=>ri(e,t,Tr)||ci(e,t,Tr),"orthogonallyAligned");k(wit,"separateSharedRenderedTerminalLanes");k(Eit,"collapseRedundantRectangularDoglegs");k(Ofe,"liftObstacleHuggingSameSideRails");k(Bfe,"liftTopLaneTitleBandsAboveRails");k(Ffe,"shiftLeftLaneTitleBandsLeftOfRails");k(Tit,"swapDestinationTerminalTailsToReduceCrossings");k(kit,"reassignCrossingExternalRailChannels");k(Cit,"shortcutRedundantOrthogonalJogs");k(Sit,"resolveRenderedOrthogonalCrossings");J2=.001,O0r=8;k(Ait,"simplifyDetouredEdges");Md=.001,Ont=10,qV=7;k(zfe,"markerClearanceRectFor");k(Uit,"normalizeRect");k(Gfe,"labelOverlapsOwnMarker");k(jV,"anchorLabelsToPolyline");bfe=1e-6,B0r=8,Bnt=B0r/2,F0r=3;k(Wfe,"pairKey");k(Iit,"straightenCollinearSiblingDetours");k(Vfe,"nudgeSharedInteriorSubpaths");k(Rit,"segmentsIntersect");k(Mit,"validateSwimlanesLayout");k(Lit,"postProcessSwimlaneLayout");k(tx,"normalizeGraph");k(hpe,"incoming");k(Dit,"buildSuccessorMap");k(fpe,"buildSortedSuccessorMap");k(ppe,"buildInDegreeMap");k(mpe,"sortedZeroInDegreeNodes");k(sH,"buildPredecessorSuccessorMaps");k(gpe,"buildLayersFromRanks");k(FR,"topoSortIfAcyclic");k(_C,"buildLayerIndex");k(ype,"countInversions");k(Nit,"removeCycles_DFS");k(_it,"buildTopLaneMap");k(Iy,"createTopLaneResolver");k(lH,"buildTopLaneOrder");k(vpe,"resolveTopLaneOrder");z0r={EPSILON:1e-6},nH={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Fnt={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};k(Pit,"buildDrivingTree");k(Oit,"chooseParent");k(Bit,"buildAdjacency");k(Fit,"assignComponents");k(zit,"computeBlocks");k(Git,"popBlock");k(Wit,"computeSubtreeCrossCounts");k(Vit,"annotateMinimumLayers");k(bpe,"compareByRankThenId");k(Hit,"emitNodesInTreeOrder");k(qit,"deduplicateLayers");k(Yit,"createChildOrderer");k(iH,"buildMultitreeLayerOrder");k(jit,"countCrossingsBetweenAdjacent");k(Hfe,"totalCrossings");k(Xit,"optimizeRanksByCrossings");k($it,"adjustCrossLaneSources");k(Kit,"assignLayers_LongestPath");k(Zit,"assignLayers_Gravity");k(Qit,"topoSortByGenerationIfAcyclic");k(Jit,"assignLayers_LaneAwareCompact");k(eat,"makeProperLayering");k(qfe,"median");k(Yfe,"barycenter");k(tat,"neighborPositionsFor");k(rat,"currentOrderTieBreak");k(jfe,"countCrossingsBetweenAdjacent");k(XV,"sortByHeuristic");k(Xfe,"reorderLayer");k($fe,"transposeImprove");k(nat,"orderLayers");k(iat,"assignCoordinates");aat=8;k(oat,"hashString");k(sat,"mulberry32");k(lat,"deterministicShuffle");k(cat,"sourceDistance");k(Kfe,"laneArrangementCost");k(uat,"buildWeightedLaneEdges");k(Zfe,"greedySwitch");k(dat,"isBetterCandidate");k(hat,"seedForRestart");k(fat,"optimizeTopLaneOrder");k(pat,"sugiyamaLayout");Yn=z0r.EPSILON,G0r=8,F4=15,MC=15,YV=25,_f=20,xfe=10;k(Qfe,"chooseOrthogonalSide");k(Jfe,"sharedLineEndpointCoord");k(z4,"pointOnLine");k(mat,"routeEdgesOrthogonal");k(gat,"getSwimlaneDirection");k(yat,"runSwimlaneLayoutCore");k(vat,"prepareSwimlaneLayout");W0r=UC({prepareLayout:vat,runLayoutCore:yat,afterPaint:Knt})});function K0e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw a}}}}function $st(e,t,r){return(t=Kst(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Y0r(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j0r(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function X0r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $0r(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ms(e,t){return V0r(e)||j0r(e,t)||gme(e,t)||X0r()}function DH(e){return H0r(e)||Y0r(e)||gme(e)||$0r()}function K0r(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Kst(e){var t=K0r(e,"string");return typeof t=="symbol"?t:t+""}function sl(e){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sl(e)}function gme(e,t){if(e){if(typeof e=="string")return K0e(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K0e(e,t):void 0}}function dM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hM(){if(Tat)return xpe;Tat=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return xpe=e,xpe}function vmr(){if(kat)return wpe;kat=1;var e=typeof cH=="object"&&cH&&cH.Object===Object&&cH;return wpe=e,wpe}function XH(){if(Cat)return Epe;Cat=1;var e=vmr(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Epe=r,Epe}function bmr(){if(Sat)return Tpe;Sat=1;var e=XH(),t=function(){return e.Date.now()};return Tpe=t,Tpe}function xmr(){if(Aat)return kpe;Aat=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return kpe=t,kpe}function wmr(){if(Uat)return Cpe;Uat=1;var e=xmr(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Cpe=r,Cpe}function bme(){if(Iat)return Spe;Iat=1;var e=XH(),t=e.Symbol;return Spe=t,Spe}function Emr(){if(Rat)return Ape;Rat=1;var e=bme(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),l=o[i];try{o[i]=void 0;var u=!0}catch{}var d=n.call(o);return u&&(s?o[i]=l:delete o[i]),d}return Ape=a,Ape}function Tmr(){if(Mat)return Upe;Mat=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Upe=r,Upe}function olt(){if(Lat)return Ipe;Lat=1;var e=bme(),t=Emr(),r=Tmr(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return Ipe=o,Ipe}function kmr(){if(Dat)return Rpe;Dat=1;function e(t){return t!=null&&typeof t=="object"}return Rpe=e,Rpe}function fM(){if(Nat)return Mpe;Nat=1;var e=olt(),t=kmr(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Mpe=n,Mpe}function Cmr(){if(_at)return Lpe;_at=1;var e=wmr(),t=hM(),r=fM(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var h=a.test(u);return h||o.test(u)?s(u.slice(2),h?2:8):i.test(u)?n:+u}return Lpe=l,Lpe}function Smr(){if(Pat)return Dpe;Pat=1;var e=hM(),t=bmr(),r=Cmr(),n="Expected a function",i=Math.max,a=Math.min;function o(s,l,u){var d,h,f,p,m,g,y=0,v=!1,b=!1,x=!0;if(typeof s!="function")throw new TypeError(n);l=r(l)||0,e(u)&&(v=!!u.leading,b="maxWait"in u,f=b?i(r(u.maxWait)||0,l):f,x="trailing"in u?!!u.trailing:x);function E(A){var P=d,D=h;return d=h=void 0,y=A,p=s.apply(D,P),p}function w(A){return y=A,m=setTimeout(S,l),v?E(A):p}function T(A){var P=A-g,D=A-y,M=l-P;return b?a(M,f-D):M}function C(A){var P=A-g,D=A-y;return g===void 0||P>=l||P<0||b&&D>=f}function S(){var A=t();if(C(A))return R(A);m=setTimeout(S,T(A))}function R(A){return m=void 0,x&&d?E(A):(d=h=void 0,p)}function U(){m!==void 0&&clearTimeout(m),y=0,d=g=h=m=void 0}function L(){return m===void 0?p:R(t())}function I(){var A=t(),P=C(A);if(d=arguments,h=this,g=A,P){if(m===void 0)return w(g);if(b)return clearTimeout(m),m=setTimeout(S,l),E(g)}return m===void 0&&(m=setTimeout(S,l)),p}return I.cancel=U,I.flush=L,I}return Dpe=o,Dpe}function Mmr(e,t,r,n,i){var a=i*Math.PI/180,o=Math.cos(a)*(e-r)-Math.sin(a)*(t-n)+r,s=Math.sin(a)*(e-r)+Math.cos(a)*(t-n)+n;return{x:o,y:s}}function Dmr(e,t,r){if(r===0)return e;var n=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=Mmr(e.x,e.y,n,i,r),l=Lmr(s.x,s.y,n,i,a,o);return{x:l.x,y:l.y}}function Hmr(){return Gat||(Gat=1,(function(e,t){(function(){var r,n,i,a,o,s,l,u,d,h,f,p,m,g,y;i=Math.floor,h=Math.min,n=function(v,b){return vb?1:0},d=function(v,b,x,E,w){var T;if(x==null&&(x=0),w==null&&(w=n),x<0)throw new Error("lo must be non-negative");for(E==null&&(E=v.length);xU;0<=U?R++:R--)S.push(R);return S}).apply(this).reverse(),C=[],E=0,w=T.length;EL;0<=L?++S:--S)I.push(o(v,x));return I},g=function(v,b,x,E){var w,T,C;for(E==null&&(E=n),w=v[x];x>b;){if(C=x-1>>1,T=v[C],E(w,T)<0){v[x]=T,x=C;continue}break}return v[x]=w},y=function(v,b,x){var E,w,T,C,S;for(x==null&&(x=n),w=v.length,S=b,T=v[b],E=2*b+1;E-1}return l0e=t,l0e}function B1r(){if(Uot)return c0e;Uot=1;var e=eq();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return c0e=t,c0e}function F1r(){if(Iot)return u0e;Iot=1;var e=N1r(),t=_1r(),r=P1r(),n=O1r(),i=B1r();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s-1&&n%1==0&&n0;){var d=i.shift();t(d),a.add(d.id()),s&&n(i,a,d)}return e}function Blt(e,t,r){if(r.isParent())for(var n=r._private.children,i=0;i0&&arguments[0]!==void 0?arguments[0]:Kyr,t=arguments.length>1?arguments[1]:void 0,r=0;r0?I=P:L=P;while(Math.abs(A)>o&&++D=a?b(U,D):M===0?D:E(U,L,L+u)}var T=!1;function C(){T=!0,(e!==t||r!==n)&&x()}var S=function(L){return T||C(),e===t&&r===n?L:L===0?0:L===1?1:y(w(L),t,n)};S.getControlPoints=function(){return[{x:e,y:t},{x:r,y:n}]};var R="generateBezier("+[e,t,r,n]+")";return S.toString=function(){return R},S}function vst(e,t,r,n,i){if(n===1||t===r)return r;var a=i(t,r,n);return e==null||((e.roundValue||e.color)&&(a=Math.round(a)),e.min!==void 0&&(a=Math.max(a,e.min)),e.max!==void 0&&(a=Math.min(a,e.max))),a}function bst(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function BC(e,t,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var o=bst(e,i),s=bst(t,i);if(nr(o)&&nr(s))return vst(a,o,s,r,n);if(xa(o)&&xa(s)){for(var l=[],u=0;u0?(p==="spring"&&m.push(o.duration),o.easingImpl=AH[p].apply(null,m)):o.easingImpl=AH[p]}var g=o.easingImpl,y;if(o.duration===0?y=1:y=(r-l)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var v=o.startPosition,b=o.position;if(b&&i&&!e.locked()){var x={};VR(v.x,b.x)&&(x.x=BC(v.x,b.x,y,g)),VR(v.y,b.y)&&(x.y=BC(v.y,b.y,y,g)),e.position(x)}var E=o.startPan,w=o.pan,T=a.pan,C=w!=null&&n;C&&(VR(E.x,w.x)&&(T.x=BC(E.x,w.x,y,g)),VR(E.y,w.y)&&(T.y=BC(E.y,w.y,y,g)),e.emit("pan"));var S=o.startZoom,R=o.zoom,U=R!=null&&n;U&&(VR(S,R)&&(a.zoom=rM(a.minZoom,BC(S,R,y,g),a.maxZoom)),e.emit("zoom")),(C||U)&&e.emit("viewport");var L=o.style;if(L&&L.length>0&&i){for(var I=0;I=0;C--){var S=T[C];S()}T.splice(0,T.length)},b=p.length-1;b>=0;b--){var x=p[b],E=x._private;if(E.stopped){p.splice(b,1),E.hooked=!1,E.playing=!1,E.started=!1,v(E.frames);continue}!E.playing&&!E.applying||(E.playing&&E.applying&&(E.applying=!1),E.started||uvr(d,x,e),cvr(d,x,e,h),E.applying&&(E.applying=!1),v(E.frames),E.step!=null&&E.step(e),x.completed()&&(p.splice(b,1),E.hooked=!1,E.playing=!1,E.started=!1,v(E.completes)),g=!0)}return!h&&p.length===0&&m.length===0&&n.push(d),g}for(var a=!1,o=0;o0?t.notify("draw",r):t.notify("draw")),r.unmerge(n),t.emit("step")}function rct(e){this.options=Qr({},vvr,bvr,e)}function nct(e){this.options=Qr({},xvr,e)}function ict(e){this.options=Qr({},wvr,e)}function lq(e){this.options=Qr({},Evr,e),this.options.layout=this;var t=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),o=i.target().data("id"),s=t.some(function(u){return u.data("id")===a}),l=t.some(function(u){return u.data("id")===o});return!s||!l});this.options.eles=this.options.eles.not(n)}function lct(e){this.options=Qr({},Ovr,e)}function _me(e){this.options=Qr({},Bvr,e)}function cct(e){this.options=Qr({},Fvr,e)}function uct(e){this.options=Qr({},zvr,e)}function dct(e){this.options=e,this.notifications=0}function pct(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Ome(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||t.radius===0?{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}:(Vvr(e,t,r,n,i),{cx:sme,cy:lme,radius:Y4,startX:hct,startY:fct,stopX:cme,stopY:ume,startAngle:kg.ang+Math.PI/2*X4,endAngle:Of.ang-Math.PI/2*X4,counterClockwise:RH})}function mct(e){var t=[];if(e!=null){for(var r=0;r5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(a,n/2,i/2);e.beginPath(),e.moveTo(t+o,r),e.lineTo(t+n-o,r),e.quadraticCurveTo(t+n,r,t+n,r+o),e.lineTo(t+n,r+i-o),e.quadraticCurveTo(t+n,r+i,t+n-o,r+i),e.lineTo(t+o,r+i),e.quadraticCurveTo(t,r+i,t,r+i-o),e.lineTo(t,r+o),e.quadraticCurveTo(t,r,t+o,r),e.closePath()}function zst(e,t,r){var n=e.createShader(t);if(e.shaderSource(n,r),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(n));return n}function Nbr(e,t,r){var n=zst(e,e.VERTEX_SHADER,t),i=zst(e,e.FRAGMENT_SHADER,r),a=e.createProgram();if(e.attachShader(a,n),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function _br(e,t,r){r===void 0&&(r=t);var n=e.makeOffscreenCanvas(t,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function zme(e){var t=e.pixelRatio,r=e.cy.zoom(),n=e.cy.pan();return{zoom:r*t,pan:{x:n.x*t,y:n.y*t}}}function Pbr(e){var t=e.pixelRatio,r=e.cy.zoom();return r*t}function Obr(e,t,r,n,i){var a=n*r+t.x,o=i*r+t.y;return o=Math.round(e.canvasHeight-o),[a,o]}function Bbr(e,t){return t.picking?!0:e.pstyle("background-fill").value!=="solid"||e.pstyle("background-image").strValue!=="none"?!1:e.pstyle("border-width").value===0||e.pstyle("border-opacity").value===0?!0:e.pstyle("border-style").value==="solid"}function Fbr(e,t){if(e.length!==t.length)return!1;for(var r=0;r>0&255)/255,r[1]=(e>>8&255)/255,r[2]=(e>>16&255)/255,r[3]=(e>>24&255)/255,r}function zbr(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function Gbr(e,t){var r=e.createTexture();return r.buffer=function(n){e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},r.deleteTexture=function(){e.deleteTexture(r)},r}function Ict(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 Rct(e,t,r){switch(t){case e.FLOAT:return new Float32Array(r);case e.INT:return new Int32Array(r)}}function Wbr(e,t,r,n,i,a){switch(t){case e.FLOAT:return new Float32Array(r.buffer,a*n,i);case e.INT:return new Int32Array(r.buffer,a*n,i)}}function Vbr(e,t,r,n){var i=Ict(e,t),a=Ms(i,2),o=a[0],s=a[1],l=Rct(e,s,n),u=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,l,e.STATIC_DRAW),s===e.FLOAT?e.vertexAttribPointer(r,o,s,!1,0,0):s===e.INT&&e.vertexAttribIPointer(r,o,s,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,null),u}function Tg(e,t,r,n){var i=Ict(e,r),a=Ms(i,3),o=a[0],s=a[1],l=a[2],u=Rct(e,s,t*o),d=o*l,h=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,h),e.bufferData(e.ARRAY_BUFFER,t*d,e.DYNAMIC_DRAW),e.enableVertexAttribArray(n),s===e.FLOAT?e.vertexAttribPointer(n,o,s,!1,d,0):s===e.INT&&e.vertexAttribIPointer(n,o,s,d,0),e.vertexAttribDivisor(n,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var f=new Array(t),p=0;pkct?(o2r(e),t.call(e,a)):(s2r(e),Nct(e,a,QR.SCREEN)))}}{var r=e.matchCanvasSize;e.matchCanvasSize=function(a){r.call(e,a),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0}}e.findNearestElements=function(a,o,s,l){return f2r(e,a,o)};{var n=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){n.call(e),e.pickingFrameBuffer.needsDraw=!0}}{var i=e.notify;e.notify=function(a,o){i.call(e,a,o),a==="viewport"||a==="bounds"?e.pickingFrameBuffer.needsDraw=!0:a==="background"&&e.drawing.invalidate(o,{type:"node-body"})}}}function o2r(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function s2r(e){var t=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,e.canvasWidth,e.canvasHeight),n.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function l2r(e){var t=e.canvasWidth,r=e.canvasHeight,n=zme(e),i=n.pan,a=n.zoom,o=H0e();LH(o,o,[i.x,i.y]),hme(o,o,[a,a]);var s=H0e();jbr(s,t,r);var l=H0e();return Ybr(l,s,o),l}function Dct(e,t){var r=e.canvasWidth,n=e.canvasHeight,i=zme(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,r,n),t.translate(a.x,a.y),t.scale(o,o)}function c2r(e,t){e.drawSelectionRectangle(t,function(r){return Dct(e,r)})}function u2r(e){var t=e.data.contexts[e.NODE];t.save(),Dct(e,t),t.strokeStyle="rgba(0, 0, 0, 0.3)",t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function d2r(e){var t=function(i,a,o){for(var s=i.atlasManager.getAtlasCollection(a),l=e.data.contexts[e.NODE],u=s.atlases,d=0;d=0&&E.add(C)}return E}function f2r(e,t,r){var n=h2r(e,t,r),i=e.getCachedZSortedEles(),a,o,s=Nd(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,d=i[u];if(!a&&d.isNode()&&(a=d),!o&&d.isEdge()&&(o=d),a&&o)break}}catch(h){s.e(h)}finally{s.f()}return[a,o].filter(Boolean)}function $0e(e,t,r){var n=e.drawing;t+=1,r.isNode()?(n.drawNode(r,t,"node-underlay"),n.drawNode(r,t,"node-body"),n.drawTexture(r,t,"label"),n.drawNode(r,t,"node-overlay")):(n.drawEdgeLine(r,t),n.drawEdgeArrow(r,t,"source"),n.drawEdgeArrow(r,t,"target"),n.drawTexture(r,t,"label"),n.drawTexture(r,t,"edge-source-label"),n.drawTexture(r,t,"edge-target-label"))}function Nct(e,t,r){var n;e.webglDebug&&(n=performance.now());var i=e.drawing,a=0;if(r.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&c2r(e,t),e.data.canvasNeedsRedraw[e.NODE]||r.picking){var o=e.data.contexts[e.WEBGL];r.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=l2r(e),l=e.getCachedZSortedEles();if(a=l.length,i.startFrame(s,r),r.screen){for(var u=0;u{al=typeof window>"u"?null:window,wat=al?al.navigator:null;al&&al.document;Z0r=sl(""),Zst=sl({}),Q0r=sl(function(){}),J0r=typeof HTMLElement>"u"?"undefined":sl(HTMLElement),cM=function(t){return t&&t.instanceString&&Io(t.instanceString)?t.instanceString():null},Vr=function(t){return t!=null&&sl(t)==Z0r},Io=function(t){return t!=null&&sl(t)===Q0r},xa=function(t){return!_h(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},xi=function(t){return t!=null&&sl(t)===Zst&&!xa(t)&&t.constructor===Object},emr=function(t){return t!=null&&sl(t)===Zst},nr=function(t){return t!=null&&sl(t)===sl(1)&&!isNaN(t)},Qst=function(t){return nr(t)&&Math.floor(t)===t},NH=function(t){if(J0r!=="undefined")return t!=null&&t instanceof HTMLElement},_h=function(t){return uM(t)||Jst(t)},uM=function(t){return cM(t)==="collection"&&t._private.single},Jst=function(t){return cM(t)==="collection"&&!t._private.single},yme=function(t){return cM(t)==="core"},elt=function(t){return cM(t)==="stylesheet"},tmr=function(t){return cM(t)==="event"},ux=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},rmr=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},nmr=function(t){return xi(t)&&nr(t.x1)&&nr(t.x2)&&nr(t.y1)&&nr(t.y2)},imr=function(t){return emr(t)&&Io(t.then)},amr=function(){return wat&&wat.userAgent.match(/msie|trident|edge/i)},ZC=function(t,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],o=0;or?1:0},hmr=function(t,r){return-1*rlt(t,r)},Qr=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,r=1;r1&&(y-=1),y<1/6?m+(g-m)*6*y:y<1/2?g:y<2/3?m+(g-m)*(2/3-y)*6:m}var h=new RegExp("^"+lmr+"$").exec(t);if(h){if(n=parseInt(h[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(h[2]),i<0||i>100||(i=i/100,a=parseFloat(h[3]),a<0||a>100)||(a=a/100,o=h[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(i===0)s=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;s=Math.round(255*d(p,f,n+1/3)),l=Math.round(255*d(p,f,n)),u=Math.round(255*d(p,f,n-1/3))}r=[s,l,u,o]}return r},mmr=function(t){var r,n=new RegExp("^"+omr+"$").exec(t);if(n){r=[];for(var i=[],a=1;a<=3;a++){var o=n[a];if(o[o.length-1]==="%"&&(i[a]=!0),o=parseFloat(o),i[a]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},gmr=function(t){return ymr[t.toLowerCase()]},nlt=function(t){return(xa(t)?t:null)||gmr(t)||fmr(t)||mmr(t)||pmr(t)},ymr={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]},ilt=function(t){for(var r=t.map,n=t.keys,i=n.length,a=0;a1&&arguments[1]!==void 0?arguments[1]:j4,n=r,i;i=t.next(),!i.done;)n=n*llt+i.value|0;return n},JR=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j4;return r*llt+t|0},eM=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:VC;return(r<<5)+r+t|0},Imr=function(t,r){return t*2097152+r},rx=function(t){return t[0]*2097152+t[1]},uH=function(t,r){return[JR(t[0],r[0]),eM(t[1],r[1])]},Oat=function(t,r){var n={value:0,done:!1},i=0,a=t.length,o={next:function(){return i=0;i--)t[i]===r&&t.splice(i,1)},Eme=function(t){t.splice(0,t.length)},Fmr=function(t,r){for(var n=0;n"u"?"undefined":sl(Set))!==Gmr?Set:Wmr,$H=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||r===void 0||!yme(t)){mo("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){mo("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:t,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new rS,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=t.pan(),l=t.zoom();a.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];xa(r.classes)?u=r.classes:Vr(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,h=u.length;d0;){var T=b.pop(),C=y(T),S=T.id();if(f[S]=C,C!==1/0)for(var R=T.neighborhood().intersect(m),U=0;U0)for(_.unshift(O);h[F];){var G=h[F];_.unshift(G.edge),_.unshift(G.node),B=G.node,F=B.id()}return s.spawn(_)}}}},$mr={kruskal:function(t){t=t||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,o=new Array(a),s=n,l=function(E){for(var w=0;w0;){if(w(),C++,E===d){for(var S=[],R=a,U=d,L=v[U];S.unshift(R),L!=null&&S.unshift(L),R=y[U],R!=null;)U=R.id(),L=v[U];return{found:!0,distance:h[E],path:this.spawn(S),steps:C}}p[E]=!0;for(var I=x._private.edges,A=0;AL&&(m[U]=L,b[U]=R,x[U]=w),!a){var I=R*d+S;!a&&m[I]>L&&(m[I]=L,b[I]=S,x[I]=w)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:o,Le=x(ve),Be=[],ae=Le;;){if(ae==null)return r.spawn();var he=b(ae),de=he.edge,me=he.pred;if(Be.unshift(ae[0]),ae.same(Fe)&&Be.length>0)break;de!=null&&Be.unshift(de),ae=me}return l.spawn(Be)},T=0;T=0;d--){var h=u[d],f=h[1],p=h[2];(r[f]===s&&r[p]===l||r[f]===l&&r[p]===s)&&u.splice(d,1)}for(var m=0;mi;){var a=Math.floor(Math.random()*r.length);r=ngr(a,t,r),n--}return r},igr={kargerStein:function(){var t=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(_){return _.isLoop()});var a=n.length,o=i.length,s=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/rgr);if(a<2){mo("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,i=0,a=0,o=r;o1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?t=t.slice(r,n):(n0&&t.splice(0,r));for(var s=0,l=t.length-1;l>=0;l--){var u=t[l];o?isFinite(u)||(t[l]=-1/0,s++):t.splice(l,1)}a&&t.sort(function(f,p){return f-p});var d=t.length,h=Math.floor(d/2);return d%2!==0?t[h+1+s]:(t[h-1+s]+t[h+s])/2},glt=function(t,r){return r===0?t:glt(r,t%r)},ugr=function(t){for(var r=t[0],n=0;n0&&(r=glt(r,t[n]));else return 0;return r},dgr=function(t){return Math.PI*t/180},dH=function(t,r){return Math.atan2(r,t)-Math.PI/2},Tme=Math.log2||function(e){return Math.log(e)/Math.log(2)},kme=function(t){return t>0?1:t<0?-1:0},Z4=function(t,r){return Math.sqrt(q4(t,r))},q4=function(t,r){var n=r.x-t.x,i=r.y-t.y;return n*n+i*i},hgr=function(t){for(var r=t.length,n=0,i=0;i=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},pgr=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},mgr=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},ggr=function(t,r){t.x1=Math.min(t.x1,r.x1),t.x2=Math.max(t.x2,r.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r.y1),t.y2=Math.max(t.y2,r.y2),t.h=t.y2-t.y1},ylt=function(t,r,n){t.x1=Math.min(t.x1,r),t.x2=Math.max(t.x2,r),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n),t.y2=Math.max(t.y2,n),t.h=t.y2-t.y1},TH=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=r,t.x2+=r,t.y1-=r,t.y2+=r,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},kH=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,o;if(r.length===1)n=i=a=o=r[0];else if(r.length===2)n=a=r[0],o=i=r[1];else if(r.length===4){var s=Ms(r,4);n=s[0],i=s[1],a=s[2],o=s[3]}return t.x1-=o,t.x2+=i,t.y1-=n,t.y2+=a,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},Vat=function(t,r){t.x1=r.x1,t.y1=r.y1,t.x2=r.x2,t.y2=r.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},Cme=function(t,r){return!(t.x1>r.x2||r.x1>t.x2||t.x2r.y2||r.y1>t.y2)},ox=function(t,r,n){return t.x1<=r&&r<=t.x2&&t.y1<=n&&n<=t.y2},Hat=function(t,r){return ox(t,r.x,r.y)},vlt=function(t,r){return ox(t,r.x1,r.y1)&&ox(t,r.x2,r.y2)},ygr=(Ope=Math.hypot)!==null&&Ope!==void 0?Ope:function(e,t){return Math.sqrt(e*e+t*t)};blt=function(t,r,n,i,a,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?hx(a,o):l,d=a/2,h=o/2;u=Math.min(u,d,h);var f=u!==d,p=u!==h,m;if(f){var g=n-d+u-s,y=i-h-s,v=n+d-u+s,b=y;if(m=sx(t,r,n,i,g,y,v,b,!1),m.length>0)return m}if(p){var x=n+d+s,E=i-h+u-s,w=x,T=i+h-u+s;if(m=sx(t,r,n,i,x,E,w,T,!1),m.length>0)return m}if(f){var C=n-d+u-s,S=i+h+s,R=n+d-u+s,U=S;if(m=sx(t,r,n,i,C,S,R,U,!1),m.length>0)return m}if(p){var L=n-d-s,I=i-h+u-s,A=L,P=i+h-u+s;if(m=sx(t,r,n,i,L,I,A,P,!1),m.length>0)return m}var D;{var M=n-d+u,O=i-h+u;if(D=jR(t,r,n,i,M,O,u+s),D.length>0&&D[0]<=M&&D[1]<=O)return[D[0],D[1]]}{var _=n+d-u,B=i-h+u;if(D=jR(t,r,n,i,_,B,u+s),D.length>0&&D[0]>=_&&D[1]<=B)return[D[0],D[1]]}{var F=n+d-u,G=i+h-u;if(D=jR(t,r,n,i,F,G,u+s),D.length>0&&D[0]>=F&&D[1]>=G)return[D[0],D[1]]}{var z=n-d+u,V=i+h-u;if(D=jR(t,r,n,i,z,V,u+s),D.length>0&&D[0]<=z&&D[1]>=V)return[D[0],D[1]]}return[]},xgr=function(t,r,n,i,a,o,s){var l=s,u=Math.min(n,a),d=Math.max(n,a),h=Math.min(i,o),f=Math.max(i,o);return u-l<=t&&t<=d+l&&h-l<=r&&r<=f+l},wgr=function(t,r,n,i,a,o,s,l,u){var d={x1:Math.min(n,s,a)-u,x2:Math.max(n,s,a)+u,y1:Math.min(i,l,o)-u,y2:Math.max(i,l,o)+u};return!(td.x2||rd.y2)},Egr=function(t,r,n,i){n-=i;var a=r*r-4*t*n;if(a<0)return[];var o=Math.sqrt(a),s=2*t,l=(-r+o)/s,u=(-r-o)/s;return[l,u]},Tgr=function(t,r,n,i,a){var o=1e-5;t===0&&(t=o),r/=t,n/=t,i/=t;var s,l,u,d,h,f,p,m;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,s=l*l*l+u*u,a[1]=0,p=r/3,s>0){h=u+Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),f=u-Math.sqrt(s),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+h+f,p+=(h+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+h)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,s===0){m=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*m,a[4]=a[2]=-(m+p);return}l=-l,d=l*l*l,d=Math.acos(u/Math.sqrt(d)),m=2*Math.sqrt(l),a[0]=-p+m*Math.cos(d/3),a[2]=-p+m*Math.cos((d+2*Math.PI)/3),a[4]=-p+m*Math.cos((d+4*Math.PI)/3)},kgr=function(t,r,n,i,a,o,s,l){var u=1*n*n-4*n*a+2*n*s+4*a*a-4*a*s+s*s+i*i-4*i*o+2*i*l+4*o*o-4*o*l+l*l,d=9*n*a-3*n*n-3*n*s-6*a*a+3*a*s+9*i*o-3*i*i-3*i*l-6*o*o+3*o*l,h=3*n*n-6*n*a+n*s-n*t+2*a*a+2*a*t-s*t+3*i*i-6*i*o+i*l-i*r+2*o*o+2*o*r-l*r,f=1*n*a-n*n+n*t-a*t+i*o-i*i+i*r-o*r,p=[];Tgr(u,d,h,f,p);for(var m=1e-7,g=[],y=0;y<6;y+=2)Math.abs(p[y+1])=0&&p[y]<=1&&g.push(p[y]);g.push(1),g.push(0);for(var v=-1,b,x,E,w=0;w=0?Eu?(t-a)*(t-a)+(r-o)*(r-o):d-f},Dd=function(t,r,n){for(var i,a,o,s,l,u=0,d=0;d=t&&t>=o||i<=t&&t<=o)l=(t-i)/(o-i)*(s-a)+a,l>r&&u++;else continue;return u%2!==0},Dy=function(t,r,n,i,a,o,s,l,u){var d=new Array(n.length),h;l[0]!=null?(h=Math.atan(l[1]/l[0]),l[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=l;for(var f=Math.cos(-h),p=Math.sin(-h),m=0;m0){var y=BH(d,-u);g=OH(y)}else g=d;return Dd(t,r,g)},Sgr=function(t,r,n,i,a,o,s,l){for(var u=new Array(n.length*2),d=0;d=0&&y<=1&&b.push(y),v>=0&&v<=1&&b.push(v),b.length===0)return[];var x=b[0]*l[0]+t,E=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[x,E];var w=b[1]*l[0]+t,T=b[1]*l[1]+r;return[x,E,w,T]}else return[x,E]},Bpe=function(t,r,n){return r<=t&&t<=n||n<=t&&t<=r?t:t<=r&&r<=n||n<=r&&r<=t?r:n},sx=function(t,r,n,i,a,o,s,l,u){var d=t-a,h=n-t,f=s-a,p=r-o,m=i-r,g=l-o,y=f*p-g*d,v=h*p-m*d,b=g*h-f*m;if(b!==0){var x=y/b,E=v/b,w=.001,T=0-w,C=1+w;return T<=x&&x<=C&&T<=E&&E<=C?[t+x*h,r+x*m]:u?[t+x*h,r+x*m]:[]}else return y===0||v===0?Bpe(t,n,s)===s?[s,l]:Bpe(t,n,a)===a?[a,o]:Bpe(a,s,n)===n?[n,i]:[]:[]},Ugr=function(t,r,n,i,a){var o=[],s=i/2,l=a/2,u=r,d=n;o.push({x:u+s*t[0],y:d+l*t[1]});for(var h=1;h0){var g=BH(h,-l);p=OH(g)}else p=h}else p=n;for(var y,v,b,x,E=0;E2){for(var m=[d[0],d[1]],g=Math.pow(m[0]-t,2)+Math.pow(m[1]-r,2),y=1;yd&&(d=E)},get:function(x){return u[x]}},f=0;f0?D=P.edgesTo(A)[0]:D=A.edgesTo(P)[0];var M=i(D);A=A.id(),C[A]>C[L]+M&&(C[A]=C[L]+M,S.nodes.indexOf(A)<0?S.push(A):S.updateItem(A),T[A]=0,w[A]=[]),C[A]==C[L]+M&&(T[A]=T[A]+T[L],w[A].push(L))}else for(var O=0;O0;){for(var G=E.pop(),z=0;z0&&s.push(n[l]);s.length!==0&&a.push(i.collection(s))}return a},Vgr=function(t,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:Ygr,s=i,l,u,d=0;d=2?zR(t,r,n,0,$at,jgr):zR(t,r,n,0,Xat)},squaredEuclidean:function(t,r,n){return zR(t,r,n,0,$at)},manhattan:function(t,r,n){return zR(t,r,n,0,Xat)},max:function(t,r,n){return zR(t,r,n,-1/0,Xgr)}};QC["squared-euclidean"]=QC.squaredEuclidean;QC.squaredeuclidean=QC.squaredEuclidean;$gr=uc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ame=function(t){return $gr(t)},FH=function(t,r,n,i,a){var o=a!=="kMedoids",s=o?function(h){return n[h]}:function(h){return i[h](n)},l=function(f){return i[f](r)},u=n,d=r;return ZH(t,i.length,s,l,u,d)},zpe=function(t,r,n){for(var i=n.length,a=new Array(i),o=new Array(i),s=new Array(r),l=null,u=0;un)return!1}return!0},Qgr=function(t,r,n){for(var i=0;is&&(s=r[u][d],l=d);a[l].push(t[u])}for(var h=0;h=a.threshold||a.mode==="dendrogram"&&t.length===1)return!1;var m=r[o],g=r[i[o]],y;a.mode==="dendrogram"?y={left:m,right:g,key:m.key}:y={value:m.value.concat(g.value),key:m.key},t[m.index]=y,t.splice(g.index,1),r[m.key]=y;for(var v=0;vn[g.key][b.key]&&(l=n[g.key][b.key])):a.linkage==="max"?(l=n[m.key][b.key],n[m.key][b.key]0&&i.push(a);return i},tot=function(t,r,n){for(var i=[],a=0;as&&(o=u,s=r[a*t+u])}o>0&&i.push(o)}for(var d=0;du&&(l=d,u=h)}n[a]=o[l]}return i=tot(t,r,n),i},rot=function(t){for(var r=this.cy(),n=this.nodes(),i=u1r(t),a={},o=0;o=L?(I=L,L=P,A=D):P>I&&(I=P);for(var M=0;M0?1:0;C[R%i.minIterations*s+z]=V,G+=V}if(G>0&&(R>=i.minIterations-1||R==i.maxIterations-1)){for(var $=0,Z=0;Z1||R>1)&&(s=!0),h[E]=[],T.forEach(function(L){return h[E].push(L.id())})}else f[E]=[void 0,x.target().id()]}):o.forEach(function(x){var E=x.id();if(x.isNode()){var w=x.connectedEdges().intersection(p),T=w.length+w.filter(function(C){return C.isLoop()}).length;T%2&&(l?u?s=!0:u=E:l=E),h[E]=[],w.forEach(function(C){return h[E].push(C.id())})}else f[E]=[x.source().id(),x.target().id()]});var m={found:!1,trail:void 0};if(s)return m;if(u&&l)if(a){if(d&&u!=d)return m;d=u}else{if(d&&u!=d&&l!=d)return m;d||(d=u)}else d||(d=o[0].id());var g=function(E){for(var w=E,T=[E],C,S,R;h[w].length;)C=h[w].shift(),S=f[C][0],R=f[C][1],w!=R?(h[R]=h[R].filter(function(U){return U!=C}),w=R):!a&&w!=S&&(h[S]=h[S].filter(function(U){return U!=C}),w=S),T.unshift(C),T.unshift(w);return T},y=[],v=[];for(v=g(d);v.length!=1;)h[v[0]].length==0?(y.unshift(o.getElementById(v.shift())),y.unshift(o.getElementById(v.shift()))):v=g(v.shift()).concat(v);y.unshift(o.getElementById(v.shift()));for(var b in h)if(h[b].length)return m;return m.found=!0,m.trail=this.spawn(y,!0),m}},fH=function(){var t=this,r={},n=0,i=0,a=[],o=[],s={},l=function(f,p){for(var m=o.length-1,g=[],y=t.spawn();o[m].x!=f||o[m].y!=p;)g.push(o.pop().edge),m--;g.push(o.pop().edge),g.forEach(function(v){var b=v.connectedNodes().intersection(t);y.merge(v),b.forEach(function(x){var E=x.id(),w=x.connectedEdges().intersection(t);y.merge(x),r[E].cutVertex?y.merge(w.filter(function(T){return T.isLoop()})):y.merge(w)})}),a.push(y)},u=function(f,p,m){f===m&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var g=t.getElementById(p).connectedEdges().intersection(t);if(g.size()===0)a.push(t.spawn(t.getElementById(p)));else{var y,v,b,x;g.forEach(function(E){y=E.source().id(),v=E.target().id(),b=y===p?v:y,b!==m&&(x=E.id(),s[x]||(s[x]=!0,o.push({x:p,y:b,edge:E})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};t.forEach(function(h){if(h.isNode()){var f=h.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var d=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return t.getElementById(h)});return{cut:t.spawn(d),components:a}},v1r={hopcroftTarjanBiconnected:fH,htbc:fH,htb:fH,hopcroftTarjanBiconnectedComponents:fH},pH=function(){var t=this,r={},n=0,i=[],a=[],o=t.spawn(t),s=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var d=t.getElementById(u).connectedEdges().intersection(t);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in r||s(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var h=t.spawn();;){var f=a.pop();if(h.merge(t.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=h.edgesWith(h),m=h.merge(p);i.push(m),o=o.difference(m)}};return t.forEach(function(l){if(l.isNode()){var u=l.id();u in r||s(u)}}),{cut:o,components:i}},b1r={tarjanStronglyConnected:pH,tsc:pH,tscc:pH,tarjanStronglyConnectedComponents:pH},Slt={};[tM,Xmr,$mr,Zmr,Jmr,tgr,igr,Lgr,XC,$C,J0e,qgr,i1r,l1r,m1r,y1r,v1r,b1r].forEach(function(e){Qr(Slt,e)});Alt=0,Ult=1,Ilt=2,E0=function(t){if(!(this instanceof E0))return new E0(t);this.id="Thenable/1.0.7",this.state=Alt,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};E0.prototype={fulfill:function(t){return not(this,Ult,"fulfillValue",t)},reject:function(t){return not(this,Ilt,"rejectReason",t)},then:function(t,r){var n=this,i=new E0;return n.onFulfilled.push(aot(t,i,"fulfill")),n.onRejected.push(aot(r,i,"reject")),Rlt(n),i.proxy}};not=function(t,r,n,i){return t.state===Alt&&(t.state=r,t[n]=i,Rlt(t)),t},Rlt=function(t){t.state===Ult?iot(t,"onFulfilled",t.fulfillValue):t.state===Ilt&&iot(t,"onRejected",t.rejectReason)},iot=function(t,r,n){if(t[r].length!==0){var i=t[r];t[r]=[];var a=function(){for(var s=0;s0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var o=0;o0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(t){return this.toggleClass(t,!0)},hasClass:function(t){var r=this[0];return r!=null&&r._private.classes.has(t)},toggleClass:function(t,r){xa(t)||(t=t.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],o=0,s=n.length;o0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(t){return this.toggleClass(t,!1)},flashClass:function(t,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(t),setTimeout(function(){n.removeClass(t)},r),n}};CH.className=CH.classNames=CH.classes;bi={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ol,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};bi.variable="(?:[\\w-.]|(?:\\\\"+bi.metaChar+"))+";bi.className="(?:[\\w-]|(?:\\\\"+bi.metaChar+"))+";bi.value=bi.string+"|"+bi.number;bi.id=bi.variable;(function(){var e,t,r;for(e=bi.comparatorOp.split("|"),r=0;r=0)&&t!=="="&&(bi.comparatorOp+="|\\!"+t)})();da=function(){return{checks:[]}},wr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},nme=[{selector:":selected",matches:function(t){return t.selected()}},{selector:":unselected",matches:function(t){return!t.selected()}},{selector:":selectable",matches:function(t){return t.selectable()}},{selector:":unselectable",matches:function(t){return!t.selectable()}},{selector:":locked",matches:function(t){return t.locked()}},{selector:":unlocked",matches:function(t){return!t.locked()}},{selector:":visible",matches:function(t){return t.visible()}},{selector:":hidden",matches:function(t){return!t.visible()}},{selector:":transparent",matches:function(t){return t.transparent()}},{selector:":grabbed",matches:function(t){return t.grabbed()}},{selector:":free",matches:function(t){return!t.grabbed()}},{selector:":removed",matches:function(t){return t.removed()}},{selector:":inside",matches:function(t){return!t.removed()}},{selector:":grabbable",matches:function(t){return t.grabbable()}},{selector:":ungrabbable",matches:function(t){return!t.grabbable()}},{selector:":animated",matches:function(t){return t.animated()}},{selector:":unanimated",matches:function(t){return!t.animated()}},{selector:":parent",matches:function(t){return t.isParent()}},{selector:":childless",matches:function(t){return t.isChildless()}},{selector:":child",matches:function(t){return t.isChild()}},{selector:":orphan",matches:function(t){return t.isOrphan()}},{selector:":nonorphan",matches:function(t){return t.isChild()}},{selector:":compound",matches:function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}},{selector:":loop",matches:function(t){return t.isLoop()}},{selector:":simple",matches:function(t){return t.isSimple()}},{selector:":active",matches:function(t){return t.active()}},{selector:":inactive",matches:function(t){return!t.active()}},{selector:":backgrounding",matches:function(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function(t){return!t.backgrounding()}}].sort(function(e,t){return hmr(e.selector,t.selector)}),gyr=(function(){for(var e={},t,r=0;r0&&d.edgeCount>0)return $i("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return $i("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&$i("The selector `"+t+"` 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},Eyr=function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=function(d){return d??""},r=function(d){return Vr(d)?'"'+d+'"':t(d)},n=function(d){return" "+d+" "},i=function(d,h){var f=d.type,p=d.value;switch(f){case wr.GROUP:{var m=t(p);return m.substring(0,m.length-1)}case wr.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(t(y))+r(p)+"]"}case wr.DATA_BOOL:{var v=d.operator,b=d.field;return"["+t(v)+b+"]"}case wr.DATA_EXIST:{var x=d.field;return"["+x+"]"}case wr.META_COMPARE:{var E=d.operator,w=d.field;return"[["+w+n(t(E))+r(p)+"]]"}case wr.STATE:return p;case wr.ID:return"#"+p;case wr.CLASS:return"."+p;case wr.PARENT:case wr.CHILD:return a(d.parent,h)+n(">")+a(d.child,h);case wr.ANCESTOR:case wr.DESCENDANT:return a(d.ancestor,h)+" "+a(d.descendant,h);case wr.COMPOUND_SPLIT:{var T=a(d.left,h),C=a(d.subject,h),S=a(d.right,h);return T+(T.length>0?" ":"")+C+S}case wr.TRUE:return""}},a=function(d,h){return d.checks.reduce(function(f,p,m){return f+(h===d&&m===0?"$":"")+i(p,h)},"")},o="",s=0;s1&&s=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(a||s||d)&&(l=!a&&!o?"":""+t,u=""+n),d&&(t=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=t===n;break;case">":f=!0,i=t>n;break;case">=":f=!0,i=t>=n;break;case"<":f=!0,i=t1&&arguments[1]!==void 0?arguments[1]:!0;return Mme(this,e,t,Blt)};JC.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Mme(this,e,t,Flt)};JC.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Mme(this,e,t,Ryr)};JC.ancestors=JC.parents;iM=zlt={data:Xi.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:Xi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Xi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Xi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Xi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var t=this[0];if(t)return t._private.data.id}};iM.attr=iM.data;iM.removeAttr=iM.removeData;Myr=zlt,rq={};Qr(rq,{degree:B0e(function(e,t){return t.source().same(t.target())?2:1}),indegree:B0e(function(e,t){return t.target().same(e)?1:0}),outdegree:B0e(function(e,t){return t.source().same(e)?1:0})});Qr(rq,{minDegree:OC("degree",function(e,t){return et}),minIndegree:OC("indegree",function(e,t){return et}),minOutdegree:OC("outdegree",function(e,t){return et})});Qr(rq,{totalDegree:function(t){for(var r=0,n=this.nodes(),i=0;i0,f=h;h&&(d=d[0]);var p=f?d.position():{x:0,y:0};r!==void 0?u.position(t,r+p[t]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var m=n.position(),g=s?n.parent():null,y=g&&g.length>0,v=y;y&&(g=g[0]);var b=v?g.position():{x:0,y:0};return a={x:m.x-b.x,y:m.y-b.y},t===void 0?a:a[t]}else if(!o)return;return this}};w0.modelPosition=w0.point=w0.position;w0.modelPositions=w0.points=w0.positions;w0.renderedPoint=w0.renderedPosition;w0.relativePoint=w0.relativePosition;Lyr=Glt,eS=function(t){switch(t){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},tS=function(t){switch(t){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},Dyr=function(t){switch(t){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}};KC=vx={};vx.renderedBoundingBox=function(e){var t=this.boundingBox(e),r=this.cy(),n=r.zoom(),i=r.pan(),a=t.x1*n+i.x,o=t.x2*n+i.x,s=t.y1*n+i.y,l=t.y2*n+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}};vx.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,e||r.emitAndNotify("bounds")}}),this)};vx.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},h=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=s.position;(h.w===0||h.h===0)&&(h={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},h.x1=f.x-h.w/2,h.x2=f.x+h.w/2,h.y1=f.y-h.h/2,h.y2=f.y+h.h/2);function p(R,U,L){var I=0,A=0,P=U+L;return R>0&&P>0&&(I=U/P*R,A=L/P*R),{biasDiff:I,biasComplementDiff:A}}function m(R,U,L,I){if(L.units==="%")switch(I){case"width":return R>0?L.pfValue*R:0;case"height":return U>0?L.pfValue*U:0;case"average":return R>0&&U>0?L.pfValue*(R+U)/2:0;case"min":return R>0&&U>0?R>U?L.pfValue*U:L.pfValue*R:0;case"max":return R>0&&U>0?R>U?L.pfValue*R:L.pfValue*U:0;default:return 0}else return L.units==="px"?L.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var v=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(v=v*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var x=p(d.width.val-h.w,g,y),E=x.biasDiff,w=x.biasComplementDiff,T=p(d.height.val-h.h,v,b),C=T.biasDiff,S=T.biasComplementDiff;s.autoPadding=m(h.w,h.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(h.w,d.width.val),f.x=(-E+h.x1+h.x2+w)/2,s.autoHeight=Math.max(h.h,d.height.val),f.y=(-C+h.y1+h.y2+S)/2}for(var n=0;nt.x2?i:t.x2,t.y1=nt.y2?a:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)},ix=function(t,r){return r==null?t:x0(t,r.x1,r.y1,r.x2,r.y2)},GR=function(t,r,n){return Mu(t,r,n)},mH=function(t,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,o=a.arrowWidth/2,s=r.pstyle(n+"-arrow-shape").value,l,u;if(s!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var d=i.arrowBounds=i.arrowBounds||{},h=d[n]=d[n]||{};h.x1=l-o,h.y1=u-o,h.x2=l+o,h.y2=u+o,h.w=h.x2-h.x1,h.h=h.y2-h.y1,TH(h,1),x0(t,h.x1,h.y1,h.x2,h.y2)}}},F0e=function(t,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,o=a.rstyle,s=r.pstyle(i+"label").strValue;if(s){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=GR(o,"labelWidth",n),h=GR(o,"labelHeight",n),f=GR(o,"labelX",n),p=GR(o,"labelY",n),m=r.pstyle(i+"text-margin-x").pfValue,g=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,x=r.pstyle("text-border-width").pfValue,E=x/2,w=r.pstyle("text-background-padding").pfValue,T=2,C=h,S=d,R=S/2,U=C/2,L,I,A,P;if(y)L=f-R,I=f+R,A=p-U,P=p+U;else{switch(eS(l.value)){case"left":L=f-S,I=f;break;case"center":L=f-R,I=f+R;break;case"right":L=f,I=f+S;break}switch(tS(u.value)){case"top":A=p-C,P=p;break;case"center":A=p-U,P=p+U;break;case"bottom":A=p,P=p+C;break}}var D=m-Math.max(b,E)-w-T,M=m+Math.max(b,E)+w+T,O=g-Math.max(b,E)-w-T,_=g+Math.max(b,E)+w+T;L+=D,I+=M,A+=O,P+=_;var B=n||"main",F=a.labelBounds,G=F[B]=F[B]||{};G.x1=L,G.y1=A,G.x2=I,G.y2=P,G.w=I-L,G.h=P-A,G.leftPad=D,G.rightPad=M,G.topPad=O,G.botPad=_;var z=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(z||V){var $=z?GR(a.rstyle,"labelAngle",n):v.pfValue,Z=Math.cos($),re=Math.sin($),Q=(L+I)/2,ge=(A+P)/2;if(!y){switch(eS(l.value)){case"left":Q=I;break;case"right":Q=L;break}switch(tS(u.value)){case"top":ge=P;break;case"bottom":ge=A;break}}var ie=function(Qe,ve){return Qe=Qe-Q,ve=ve-ge,{x:Qe*Z-ve*re+Q,y:Qe*re+ve*Z+ge}},pe=ie(L,A),ue=ie(L,P),fe=ie(I,A),Me=ie(I,P);L=Math.min(pe.x,ue.x,fe.x,Me.x),I=Math.max(pe.x,ue.x,fe.x,Me.x),A=Math.min(pe.y,ue.y,fe.y,Me.y),P=Math.max(pe.y,ue.y,fe.y,Me.y)}var Ce=B+"Rot",Ye=F[Ce]=F[Ce]||{};Ye.x1=L,Ye.y1=A,Ye.x2=I,Ye.y2=P,Ye.w=I-L,Ye.h=P-A,x0(t,L,A,I,P),x0(a.labelBounds.all,L,A,I,P)}return t}},ist=function(t,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,o=i+a;Vlt(t,r,n,o,"outside",o/2)}},Vlt=function(t,r,n,i,a,o){if(!(n===0||i<=0||a==="inside")){var s=r.cy(),l=s.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var d=r.position(),h=d.x,f=d.y,p=r.width(),m=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var g=u.miterBounds(h,f,p,m,i);ix(t,g)}else o!=null&&o>0&&kH(t,[o,o,o,o])}}},Nyr=function(t,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Vlt(t,r,n,i,a)}},_yr=function(t,r){var n=t._private.cy,i=n.styleEnabled(),a=n.headless(),o=Lu(),s=t._private,l=t.isNode(),u=t.isEdge(),d,h,f,p,m,g,y=s.rstyle,v=l&&i?t.pstyle("bounds-expansion").pfValue:[0],b=function(Ze){return Ze.pstyle("display").value!=="none"},x=!i||b(t)&&(!u||b(t.source())&&b(t.target()));if(x){var E=0,w=0;i&&r.includeOverlays&&(E=t.pstyle("overlay-opacity").value,E!==0&&(w=t.pstyle("overlay-padding").value));var T=0,C=0;i&&r.includeUnderlays&&(T=t.pstyle("underlay-opacity").value,T!==0&&(C=t.pstyle("underlay-padding").value));var S=Math.max(w,C),R=0,U=0;if(i&&(R=t.pstyle("width").pfValue,U=R/2),l&&r.includeNodes){var L=t.position();m=L.x,g=L.y;var I=t.outerWidth(),A=I/2,P=t.outerHeight(),D=P/2;d=m-A,h=m+A,f=g-D,p=g+D,x0(o,d,f,h,p),i&&ist(o,t),i&&r.includeOutlines&&!a&&ist(o,t),i&&Nyr(o,t)}else if(u&&r.includeEdges)if(i&&!a){var M=t.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),h=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),d-=U,h+=U,f-=U,p+=U,x0(o,d,f,h,p),M==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(d=O[0].x,f=O[0].y,h=O[1].x,p=O[1].y,d>h){var _=d;d=h,h=_}if(f>p){var B=f;f=p,p=B}x0(o,d-U,f-U,h+U,p+U)}}else if(M==="bezier"||M==="unbundled-bezier"||ax(M,"segments")||ax(M,"taxi")){var F;switch(M){case"bezier":case"unbundled-bezier":F=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=y.linePts;break}if(F!=null)for(var G=0;Gh){var Q=d;d=h,h=Q}if(f>p){var ge=f;f=p,p=ge}d-=U,h+=U,f-=U,p+=U,x0(o,d,f,h,p)}if(i&&r.includeEdges&&u&&(mH(o,t,"mid-source"),mH(o,t,"mid-target"),mH(o,t,"source"),mH(o,t,"target")),i){var ie=t.pstyle("ghost").value==="yes";if(ie){var pe=t.pstyle("ghost-offset-x").pfValue,ue=t.pstyle("ghost-offset-y").pfValue;x0(o,o.x1+pe,o.y1+ue,o.x2+pe,o.y2+ue)}}var fe=s.bodyBounds=s.bodyBounds||{};Vat(fe,o),kH(fe,v),TH(fe,1),i&&(d=o.x1,h=o.x2,f=o.y1,p=o.y2,x0(o,d-S,f-S,h+S,p+S));var Me=s.overlayBounds=s.overlayBounds||{};Vat(Me,o),kH(Me,v),TH(Me,1);var Ce=s.labelBounds=s.labelBounds||{};Ce.all!=null?mgr(Ce.all):Ce.all=Lu(),i&&r.includeLabels&&(r.includeMainLabels&&F0e(o,t,null),u&&(r.includeSourceLabels&&F0e(o,t,"source"),r.includeTargetLabels&&F0e(o,t,"target")))}return o.x1=Bf(o.x1),o.y1=Bf(o.y1),o.x2=Bf(o.x2),o.y2=Bf(o.y2),o.w=Bf(o.x2-o.x1),o.h=Bf(o.y2-o.y1),o.w>0&&o.h>0&&x&&(kH(o,v),TH(o,1)),o},Hlt=function(t){var r=0,n=function(o){return(o?1:0)<=0;s--)o(s);return this};mx.removeAllListeners=function(){return this.removeListener("*")};mx.emit=mx.trigger=function(e,t,r){var n=this.listeners,i=n.length;return this.emitting++,xa(t)||(t=[t]),Zyr(this,function(a,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],i=n.length);for(var s=function(){var d=n[l];if(d.type===o.type&&(!d.namespace||d.namespace===o.namespace||d.namespace===$yr)&&a.eventMatches(a.context,d,o)){var h=[o];t!=null&&Fmr(h,t),a.beforeEmit(a.context,d,o),d.conf&&d.conf.one&&(a.listeners=a.listeners.filter(function(m){return m!==d}));var f=a.callbackContext(a.context,d,o),p=d.callback.apply(f,h);a.afterEmit(a.context,d,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[t]=l,a.set(u,{ele:l,index:t})}return this.length--,this},unmergeOne:function(t){t=t[0];var r=this._private,n=t._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var o=a.index;return this.unmergeAt(o),this},unmerge:function(t){var r=this._private.cy;if(!t)return this;if(t&&Vr(t)){var n=t;t=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];t(n)&&this.unmergeAt(r)}return this},map:function(t,r){for(var n=[],i=this,a=0;an&&(n=l,i=s)}return{value:n,ele:i}},min:function(t,r){for(var n=1/0,i,a=this,o=0;o=0&&a"u"?"undefined":sl(Symbol))!=t&&sl(Symbol.iterator)!=t;r&&(zH[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,o=this.length;return $st({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[t];return a??(r?i.style().getDefaultProperty(t):null)}},numericStyle:function(t){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(t);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(t){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(t).units},renderedStyle:function(t){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,t)},style:function(t,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(xi(t)){var o=t;a.applyBypass(this,o,i),this.emitAndNotify("style")}else if(Vr(t))if(r===void 0){var s=this[0];return s?a.getStylePropertyValue(s,t):void 0}else a.applyBypass(this,t,r,i),this.emitAndNotify("style");else if(t===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(t){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(t===void 0)for(var o=0;o0&&t.push(d[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function(t){return this.neighborhood(t)}});Yc.neighbourhood=Yc.neighborhood;Yc.closedNeighbourhood=Yc.closedNeighborhood;Yc.openNeighbourhood=Yc.openNeighborhood;Qr(Yc,{source:Ff(function(t){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&t?n.filter(t):n},"source"),target:Ff(function(t){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&t?n.filter(t):n},"target"),sources:mst({attr:"source"}),targets:mst({attr:"target"})});Qr(Yc,{edgesWith:Ff(gst(),"edgesWith"),edgesTo:Ff(gst({thisIsSrc:!0}),"edgesTo")});Qr(Yc,{connectedEdges:Ff(function(e){for(var t=[],r=this,n=0;n0);return o},component:function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});Yc.componentsOf=Yc.components;cc=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t===void 0){mo("A collection must have a reference to the core");return}var a=new My,o=!1;if(!r)r=[];else if(r.length>0&&xi(r[0])&&!uM(r[0])){o=!0;for(var s=[],l=new rS,u=0,d=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],o=[],s,l=0,u=r.length;l0){for(var B=s.length===r.length?r:new cc(n,s),F=0;F0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function o(P){for(var D=P._private.edges,M=0;M0&&(e?L.emitAndNotify("remove"):t&&L.emit("remove"));for(var I=0;Id&&Math.abs(m.v)>d;);return f?function(g){return l[g*(l.length-1)|0]}:u}})(),Ia=function(t,r,n,i){var a=svr(t,r,n,i);return function(o,s,l){return o+(s-o)*a(l)}},AH={linear:function(t,r,n){return t+(r-t)*n},ease:Ia(.25,.1,.25,1),"ease-in":Ia(.42,0,1,1),"ease-out":Ia(0,0,.58,1),"ease-in-out":Ia(.42,0,.58,1),"ease-in-sine":Ia(.47,0,.745,.715),"ease-out-sine":Ia(.39,.575,.565,1),"ease-in-out-sine":Ia(.445,.05,.55,.95),"ease-in-quad":Ia(.55,.085,.68,.53),"ease-out-quad":Ia(.25,.46,.45,.94),"ease-in-out-quad":Ia(.455,.03,.515,.955),"ease-in-cubic":Ia(.55,.055,.675,.19),"ease-out-cubic":Ia(.215,.61,.355,1),"ease-in-out-cubic":Ia(.645,.045,.355,1),"ease-in-quart":Ia(.895,.03,.685,.22),"ease-out-quart":Ia(.165,.84,.44,1),"ease-in-out-quart":Ia(.77,0,.175,1),"ease-in-quint":Ia(.755,.05,.855,.06),"ease-out-quint":Ia(.23,1,.32,1),"ease-in-out-quint":Ia(.86,0,.07,1),"ease-in-expo":Ia(.95,.05,.795,.035),"ease-out-expo":Ia(.19,1,.22,1),"ease-in-out-expo":Ia(1,0,0,1),"ease-in-circ":Ia(.6,.04,.98,.335),"ease-out-circ":Ia(.075,.82,.165,1),"ease-in-out-circ":Ia(.785,.135,.15,.86),spring:function(t,r,n){if(n===0)return AH.linear;var i=lvr(t,r,n);return function(a,o,s){return a+(o-a)*i(s)}},"cubic-bezier":Ia};dvr={animate:Xi.animate(),animation:Xi.animation(),animated:Xi.animated(),clearQueue:Xi.clearQueue(),delay:Xi.delay(),delayAnimation:Xi.delayAnimation(),stop:Xi.stop(),addToAnimationPool:function(t){var r=this;r.styleEnabled()&&r._private.aniEles.merge(t)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var t=this;if(t._private.animationsRunning=!0,!t.styleEnabled())return;function r(){t._private.animationsRunning&&_H(function(a){xst(a,t),r()})}var n=t.renderer();n&&n.beforeRender?n.beforeRender(function(a,o){xst(o,t)},n.beforeRenderPriorities.animations):r()}},hvr={qualifierCompare:function(t,r){return t==null||r==null?t==null&&r==null:t.sameText(r)},eventMatches:function(t,r,n){var i=r.qualifier;return i!=null?t!==n.target&&uM(n.target)&&i.matches(n.target):!0},addEventFields:function(t,r){r.cy=t,r.target=t},callbackContext:function(t,r,n){return r.qualifier!=null?n.target:t}},vH=function(t){return Vr(t)?new fx(t):t},tct={createEmitter:function(){var t=this._private;return t.emitter||(t.emitter=new nq(hvr,this)),this},emitter:function(){return this._private.emitter},on:function(t,r,n){return this.emitter().on(t,vH(r),n),this},removeListener:function(t,r,n){return this.emitter().removeListener(t,vH(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(t,r,n){return this.emitter().one(t,vH(r),n),this},once:function(t,r,n){return this.emitter().one(t,vH(r),n),this},emit:function(t,r){return this.emitter().emit(t,r),this},emitAndNotify:function(t,r){return this.emit(t),this.notify(t,r),this}};Xi.eventAliasesOn(tct);ame={png:function(t){var r=this._private.renderer;return t=t||{},r.png(t)},jpg:function(t){var r=this._private.renderer;return t=t||{},t.bg=t.bg||"#fff",r.jpg(t)}};ame.jpeg=ame.jpg;UH={layout:function(t){var r=this;if(t==null){mo("Layout options must be specified to make a layout");return}if(t.name==null){mo("A `name` must be specified to make a layout");return}var n=t.name,i=r.extension("layout",n);if(i==null){mo("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Vr(t.eles)?a=r.$(t.eles):a=t.eles!=null?t.eles:r.$();var o=new i(Qr({},t,{cy:r,eles:a}));return o}};UH.createLayout=UH.makeLayout=UH.layout;fvr={notify:function(t,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[t]=n.batchNotifications[t]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(t,r)}},notifications:function(t){var r=this._private;return t===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!t,this)},noNotifications:function(t){this.notifications(!1),t(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var t=this._private;return t.batchCount==null&&(t.batchCount=0),t.batchCount===0&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this},endBatch:function(){var t=this._private;if(t.batchCount===0)return this;if(t.batchCount--,t.batchCount===0){t.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(t.batchNotifications).forEach(function(n){var i=t.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(t){return this.startBatch(),t(),this.endBatch(),this},batchData:function(t){var r=this;return this.batch(function(){for(var n=Object.keys(t),i=0;i0;)r.removeChild(r.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(t){return this.on("render",t)},offRender:function(t){return this.off("render",t)}};ome.invalidateDimensions=ome.resize;IH={collection:function(t,r){return Vr(t)?this.$(t):_h(t)?t.collection():xa(t)?(r||(r={}),new cc(this,t,r.unique,r.removed)):new cc(this)},nodes:function(t){var r=this.$(function(n){return n.isNode()});return t?r.filter(t):r},edges:function(t){var r=this.$(function(n){return n.isEdge()});return t?r.filter(t):r},$:function(t){var r=this._private.elements;return t?r.filter(t):r.spawnSelf()},mutableElements:function(){return this._private.elements}};IH.elements=IH.filter=IH.$;Fl={},KR="t",mvr="f";Fl.apply=function(e){for(var t=this,r=t._private,n=r.cy,i=n.collection(),a=0;a0;if(f||h&&p){var m=void 0;f&&p||f?m=u.properties:p&&(m=u.mappedProperties);for(var g=0;g1&&(E=1),s.color){var T=n.valueMin[0],C=n.valueMax[0],S=n.valueMin[1],R=n.valueMax[1],U=n.valueMin[2],L=n.valueMax[2],I=n.valueMin[3]==null?1:n.valueMin[3],A=n.valueMax[3]==null?1:n.valueMax[3],P=[Math.round(T+(C-T)*E),Math.round(S+(R-S)*E),Math.round(U+(L-U)*E),Math.round(I+(A-I)*E)];a={bypass:n.bypass,name:n.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else if(s.number){var D=n.valueMin+(n.valueMax-n.valueMin)*E;a=this.parse(n.name,D,n.bypass,f)}else return!1;if(!a)return g(),!1;a.mapping=n,n=a;break}case o.data:{for(var M=n.field.split("."),O=h.data,_=0;_0&&a>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(o).play().promise().then(x):x()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(e,i),e.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),n.transitioning=!1)};Fl.checkTrigger=function(e,t,r,n,i,a){var o=this.properties[t],s=i(o);e.removed()||s!=null&&s(r,n,e)&&a(o)};Fl.checkZOrderTrigger=function(e,t,r,n){var i=this;this.checkTrigger(e,t,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",e)})};Fl.checkBoundsTrigger=function(e,t,r,n){this.checkTrigger(e,t,r,n,function(i){return i.triggersBounds},function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};Fl.checkConnectedEdgesBoundsTrigger=function(e,t,r,n){this.checkTrigger(e,t,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){e.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Fl.checkParallelEdgesBoundsTrigger=function(e,t,r,n){this.checkTrigger(e,t,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){e.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Fl.checkTriggers=function(e,t,r,n){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,r,n),this.checkBoundsTrigger(e,t,r,n),this.checkConnectedEdgesBoundsTrigger(e,t,r,n),this.checkParallelEdgesBoundsTrigger(e,t,r,n)};yM={};yM.applyBypass=function(e,t,r,n){var i=this,a=[],o=!0;if(t==="*"||t==="**"){if(r!==void 0)for(var s=0;si.length?n=n.substr(i.length):n=""}function l(){a.length>o.length?a=a.substr(o.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){$i("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=d[0];var h=d[1];if(h!=="core"){var f=new fx(h);if(f.invalid){$i("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}}var p=d[2],m=!1;a=p;for(var g=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){$i("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),m=!0;break}o=v[0];var b=v[1],x=v[2],E=t.properties[b];if(!E){$i("Skipping property: Invalid property name in: "+o),l();continue}var w=r.parse(b,x);if(!w){$i("Skipping property: Invalid property definition in: "+o),l();continue}g.push({name:b,val:x}),l()}if(m){s();break}r.selector(h);for(var T=0;T=7&&t[0]==="d"&&(d=new RegExp(s.data.regex).exec(t))){if(r)return!1;var f=s.data;return{name:e,value:d,strValue:""+t,mapped:f,field:d[1],bypass:r}}else if(t.length>=10&&t[0]==="m"&&(h=new RegExp(s.mapData.regex).exec(t))){if(r||u.multiple)return!1;var p=s.mapData;if(!(u.color||u.number))return!1;var m=this.parse(e,h[4]);if(!m||m.mapped)return!1;var g=this.parse(e,h[5]);if(!g||g.mapped)return!1;if(m.pfValue===g.pfValue||m.strValue===g.strValue)return $i("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+m.strValue+"`"),this.parse(e,m.strValue);if(u.color){var y=m.value,v=g.value,b=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(b)return!1}return{name:e,value:h,strValue:""+t,mapped:p,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:m.value,valueMax:g.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=t.split(/\s+/):xa(t)?x=t:x=[t],u.evenMultiple&&x.length%2!==0)return null;for(var E=[],w=[],T=[],C="",S=!1,R=0;R0?" ":"")+U.strValue}return u.validate&&!u.validate(E,w)?null:u.singleEnum&&S?E.length===1&&Vr(E[0])?{name:e,value:E[0],strValue:E[0],bypass:r}:null:{name:e,value:E,pfValue:T,strValue:C,bypass:r,units:w}}var L=function(){for(var ie=0;ieu.max||u.strictMax&&t===u.max))return null;var M={name:e,value:t,strValue:""+t+(I||""),units:I,bypass:r};return u.unitless||I!=="px"&&I!=="em"?M.pfValue=t:M.pfValue=I==="px"||!I?t:this.getEmSizeInPixels()*t,(I==="ms"||I==="s")&&(M.pfValue=I==="ms"?t:1e3*t),(I==="deg"||I==="rad")&&(M.pfValue=I==="rad"?t:dgr(t)),I==="%"&&(M.pfValue=t/100),M}else if(u.propList){var O=[],_=""+t;if(_!=="none"){for(var B=_.split(/\s*,\s*|\s+/),F=0;F0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*r)/n.w,(s-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(t){return t===void 0?this._private.minZoom:this.zoomRange({min:t})},maxZoom:function(t){return t===void 0?this._private.maxZoom:this.zoomRange({max:t})},getZoomedViewport:function(t){var r=this._private,n=r.pan,i=r.zoom,a,o,s=!1;if(r.zoomingEnabled||(s=!0),nr(t)?o=t:xi(t)&&(o=t.level,t.position!=null?a=KH(t.position,i,n):t.renderedPosition!=null&&(a=t.renderedPosition),a!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=or.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var u=t.pan;nr(u.x)&&(r.pan.x=u.x,s=!1),nr(u.y)&&(r.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(t){var r=this.getCenterPan(t);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(t,r){if(this._private.panningEnabled){if(Vr(t)){var n=t;t=this.mutableElements().filter(n)}else _h(t)||(t=this.mutableElements());if(t.length!==0){var i=t.boundingBox(),a=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(a-r*(i.x1+i.x2))/2,y:(o-r*(i.y1+i.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var t=this._private,r=t.container,n=this;return t.sizeCache=t.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(s){return parseFloat(i.getPropertyValue(s))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var t=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-t.x)/r,x2:(n.x2-t.x)/r,y1:(n.y1-t.y)/r,y2:(n.y2-t.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var t=this.width(),r=this.height();return{x1:0,y1:0,x2:t,y2:r,w:t,h:r}},multiClickDebounceTime:function(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};J4.centre=J4.center;J4.autolockNodes=J4.autolock;J4.autoungrabifyNodes=J4.autoungrabify;oM={data:Xi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Xi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Xi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};oM.attr=oM.data;oM.removeAttr=oM.removeData;sM=function(t){var r=this;t=Qr({},t);var n=t.container;n&&!NH(n)&&NH(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var o=al!==void 0&&n!==void 0&&!t.headless,s=t;s.layout=Qr({name:o?"grid":"null"},s.layout),s.renderer=Qr({name:o?"canvas":"null"},s.renderer);var l=function(m,g,y){return g!==void 0?g:y!==void 0?y:m},u=this._private={container:n,ready:!1,options:s,elements:new cc(this),listeners:[],aniEles:new cc(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:nr(s.zoom)?s.zoom:1,pan:{x:xi(s.pan)&&nr(s.pan.x)?s.pan.x:0,y:xi(s.pan)&&nr(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var d=function(m,g){var y=m.some(imr);if(y)return nS.all(m).then(g);g(m)};u.styleEnabled&&r.setStyle([]);var h=Qr({},s,s.renderer);r.initRenderer(h);var f=function(m,g,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),m!=null&&(xi(m)||xa(m))&&r.add(m),r.one("layoutready",function(x){r.notifications(!0),r.emit(x),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Qr({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([s.style,s.elements],function(p){var m=p[0],g=p[1];u.styleEnabled&&r.style().append(m),f(g,function(){r.startAnimationLoop(),u.ready=!0,Io(s.ready)&&r.on("ready",s.ready);for(var y=0;y0,s=!!e.boundingBox,l=Lu(s?e.boundingBox:structuredClone(t.extent())),u;if(_h(e.roots))u=e.roots;else if(xa(e.roots)){for(var d=[],h=0;h0;){var P=A(),D=R(P,L);if(D)P.outgoers().filter(function(Fe){return Fe.isNode()&&r.has(Fe)}).forEach(I);else if(D===null){$i("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(e.avoidOverlap)for(var O=0;O0&&v[0].length<=3?de/2:0),ke=2*Math.PI/v[ae].length*he;return ae===0&&v[0].length===1&&(me=1),{x:fe.x+me*Math.cos(ke),y:fe.y+me*Math.sin(ke)}}else{var le=v[ae].length,W=Math.max(le===1?0:s?(l.w-e.padding*2-Me.w)/((e.grid?Ye:le)-1):(l.w-e.padding*2-Me.w)/((e.grid?Ye:le)+1),M),X={x:fe.x+(he+1-(le+1)/2)*W,y:fe.y+(ae+1-(Z+1)/2)*Ce};return X}},Qe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Qe).indexOf(e.direction)===-1&&mo("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Qe).join(", ")));var ve=function(Le){return Dmr(Ze(Le),l,Qe[e.direction])};return r.nodes().layoutPositions(this,e,ve),this};xvr={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,r){return!0},ready:void 0,stop:void 0,transform:function(t,r){return r}};nct.prototype.run=function(){var e=this.options,t=e,r=e.cy,n=t.eles,i=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,a=n.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o=Lu(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=t.sweep===void 0?2*Math.PI-2*Math.PI/a.length:t.sweep,u=l/Math.max(1,a.length-1),d,h=0,f=0;f1&&t.avoidOverlap){h*=1.75;var v=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),x=Math.sqrt(h*h/(v*v+b*b));d=Math.max(x,d)}var E=function(T,C){var S=t.startAngle+C*u*(i?1:-1),R=d*Math.cos(S),U=d*Math.sin(S),L={x:s.x+R,y:s.y+U};return L};return n.nodes().layoutPositions(this,t,E),this};wvr={fit:!0,padding:30,startAngle:3/2*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(t){return t.degree()},levelWidth:function(t){return t.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,r){return!0},ready:void 0,stop:void 0,transform:function(t,r){return r}};ict.prototype.run=function(){for(var e=this.options,t=e,r=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,n=e.cy,i=t.eles,a=i.nodes().not(":parent"),o=Lu(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,d=0;d0){var w=Math.abs(b[0].value-E.value);w>=y&&(b=[],v.push(b))}b.push(E)}var T=u+t.minNodeSpacing;if(!t.avoidOverlap){var C=v.length>0&&v[0].length>1,S=Math.min(o.w,o.h)/2-T,R=S/(v.length+C?1:0);T=Math.min(T,R)}for(var U=0,L=0;L1&&t.avoidOverlap){var D=Math.cos(P)-Math.cos(0),M=Math.sin(P)-Math.sin(0),O=Math.sqrt(T*T/(D*D+M*M));U=Math.max(O,U)}I.r=U,U+=T}if(t.equidistant){for(var _=0,B=0,F=0;F=e.numIter||(Uvr(n,e),n.temperature=n.temperature*e.coolingFactor,n.temperature=e.animationThreshold&&a(),_H(d)}};d()}else{for(;u;)u=o(l),l++;Tst(n,e),s()}return this};lq.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};lq.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};Tvr=function(t,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),o=Lu(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},d=0;d0){s.graphSet.push(S);for(var d=0;di.count?0:i.graph},act=function(t,r,n,i){var a=i.graphSet[n];if(-10)var h=i.nodeOverlap*d,f=Math.sqrt(s*s+l*l),p=h*s/f,m=h*l/f;else var g=WH(t,s,l),y=WH(r,-1*s,-1*l),v=y.x-g.x,b=y.y-g.y,x=v*v+b*b,f=Math.sqrt(x),h=(t.nodeRepulsion+r.nodeRepulsion)/x,p=h*v/f,m=h*b/f;t.isLocked||(t.offsetX-=p,t.offsetY-=m),r.isLocked||(r.offsetX+=p,r.offsetY+=m)}},Mvr=function(t,r,n,i){if(n>0)var a=t.maxX-r.minX;else var a=r.maxX-t.minX;if(i>0)var o=t.maxY-r.minY;else var o=r.maxY-t.minY;return a>=0&&o>=0?Math.sqrt(a*a+o*o):0},WH=function(t,r,n){var i=t.positionX,a=t.positionY,o=t.height||1,s=t.width||1,l=n/r,u=o/s,d={};return r===0&&0n?(d.x=i,d.y=a+o/2,d):0r&&-1*u<=l&&l<=u?(d.x=i-s/2,d.y=a-s*n/2/r,d):0=u)?(d.x=i+o*r/2/n,d.y=a+o/2,d):(0>n&&(l<=-1*u||l>=u)&&(d.x=i-o*r/2/n,d.y=a-o/2),d)},Lvr=function(t,r){for(var n=0;nn){var y=r.gravity*p/g,v=r.gravity*m/g;f.offsetX+=y,f.offsetY+=v}}}}},Nvr=function(t,r){var n=[],i=0,a=-1;for(n.push.apply(n,t.graphSet[0]),a+=t.graphSet[0].length;i<=a;){var o=n[i++],s=t.idToIndex[o],l=t.layoutNodes[s],u=l.children;if(0n)var a={x:n*t/i,y:n*r/i};else var a={x:t,y:r};return a},sct=function(t,r){var n=t.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(i.minX==null||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(i.minY==null||t.minY-i.padTopv&&(m+=y+r.componentSpacing,p=0,g=0,y=0)}}},Ovr={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(t){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,r){return!0},ready:void 0,stop:void 0,transform:function(t,r){return r}};lct.prototype.run=function(){var e=this.options,t=e,r=e.cy,n=t.eles,i=n.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var a=Lu(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,t,function(V){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),d=function($){if($==null)return Math.min(l,u);var Z=Math.min(l,u);Z==l?l=$:u=$},h=function($){if($==null)return Math.max(l,u);var Z=Math.max(l,u);Z==l?l=$:u=$},f=t.rows,p=t.cols!=null?t.cols:t.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(o/l);else if(f==null&&p!=null)u=p,l=Math.ceil(o/u);else if(u*l>o){var m=d(),g=h();(m-1)*g>=o?d(m-1):(g-1)*m>=o&&h(g-1)}else for(;u*l=o?h(v+1):d(y+1)}var b=a.w/u,x=a.h/l;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var E=0;E=u&&(D=0,P++)},O={},_=0;_(D=Cgr(e,t,M[O],M[O+1],M[O+2],M[O+3])))return y(C,D),!0}else if(R.edgeType==="bezier"||R.edgeType==="multibezier"||R.edgeType==="self"||R.edgeType==="compound"){for(var M=R.allpts,O=0;O+5(D=kgr(e,t,M[O],M[O+1],M[O+2],M[O+3],M[O+4],M[O+5])))return y(C,D),!0}for(var _=_||S.source,B=B||S.target,F=i.getArrowWidth(U,L),G=[{name:"source",x:R.arrowStartX,y:R.arrowStartY,angle:R.srcArrowAngle},{name:"target",x:R.arrowEndX,y:R.arrowEndY,angle:R.tgtArrowAngle},{name:"mid-source",x:R.midX,y:R.midY,angle:R.midsrcArrowAngle},{name:"mid-target",x:R.midX,y:R.midY,angle:R.midtgtArrowAngle}],O=0;O0&&(v(_),v(B))}function x(C,S,R){return Mu(C,S,R)}function E(C,S){var R=C._private,U=f,L;S?L=S+"-":L="",C.boundingBox();var I=R.labelBounds[S||"main"],A=C.pstyle(L+"label").value,P=C.pstyle("text-events").strValue==="yes";if(!(!P||!A)){var D=x(R.rscratch,"labelX",S),M=x(R.rscratch,"labelY",S),O=x(R.rscratch,"labelAngle",S),_=C.pstyle(L+"text-margin-x").pfValue,B=C.pstyle(L+"text-margin-y").pfValue,F=I.x1-U-_,G=I.x2+U-_,z=I.y1-U-B,V=I.y2+U-B;if(O){var $=Math.cos(O),Z=Math.sin(O),re=function(Me,Ce){return Me=Me-D,Ce=Ce-M,{x:Me*$-Ce*Z+D,y:Me*Z+Ce*$+M}},Q=re(F,z),ge=re(F,V),ie=re(G,z),pe=re(G,V),ue=[Q.x+_,Q.y+B,ie.x+_,ie.y+B,pe.x+_,pe.y+B,ge.x+_,ge.y+B];if(Dd(e,t,ue))return y(C),!0}else if(ox(I,e,t))return y(C),!0}}for(var w=o.length-1;w>=0;w--){var T=o[w];T.isNode()?v(T)||E(T):b(T)||E(T)||E(T,"source")||E(T,"target")}return s};t3.getAllInBox=function(e,t,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),o=2/a,s=[],l=Math.min(e,r),u=Math.max(e,r),d=Math.min(t,n),h=Math.max(t,n);e=l,r=u,t=d,n=h;var f=Lu({x1:e,y1:t,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],m=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function g(Me,Ce,Ye){return Mu(Me,Ce,Ye)}function y(Me,Ce){var Ye=Me._private,Ze=o,Qe="";Me.boundingBox();var ve=Ye.labelBounds.main;if(!ve)return null;var Fe=g(Ye.rscratch,"labelX",Ce),Le=g(Ye.rscratch,"labelY",Ce),Be=g(Ye.rscratch,"labelAngle",Ce),ae=Me.pstyle(Qe+"text-margin-x").pfValue,he=Me.pstyle(Qe+"text-margin-y").pfValue,de=ve.x1-Ze-ae,me=ve.x2+Ze-ae,ke=ve.y1-Ze-he,le=ve.y2+Ze-he;if(Be){var W=Math.cos(Be),X=Math.sin(Be),q=function(se,J){return se=se-Fe,J=J-Le,{x:se*W-J*X+Fe,y:se*X+J*W+Le}};return[q(de,ke),q(me,ke),q(me,le),q(de,le)]}else return[{x:de,y:ke},{x:me,y:ke},{x:me,y:le},{x:de,y:le}]}function v(Me,Ce,Ye,Ze){function Qe(ve,Fe,Le){return(Le.y-ve.y)*(Fe.x-ve.x)>(Fe.y-ve.y)*(Le.x-ve.x)}return Qe(Me,Ye,Ze)!==Qe(Ce,Ye,Ze)&&Qe(Me,Ce,Ye)!==Qe(Me,Ce,Ze)}for(var b=0;b0?-(Math.PI-t.ang):Math.PI+t.ang},Vvr=function(t,r,n,i,a){if(t!==Ust?Ist(r,t,kg):Wvr(Of,kg),Ist(r,n,Of),Sst=kg.nx*Of.ny-kg.ny*Of.nx,Ast=kg.nx*Of.nx-kg.ny*-Of.ny,Ry=Math.asin(Math.max(-1,Math.min(1,Sst))),Math.abs(Ry)<1e-6){sme=r.x,lme=r.y,Y4=zC=0;return}X4=1,RH=!1,Ast<0?Ry<0?Ry=Math.PI+Ry:(Ry=Math.PI-Ry,X4=-1,RH=!0):Ry>0&&(X4=-1,RH=!0),r.radius!==void 0?zC=r.radius:zC=i,W4=Ry/2,bH=Math.min(kg.len/2,Of.len/2),a?(Eg=Math.abs(Math.cos(W4)*zC/Math.sin(W4)),Eg>bH?(Eg=bH,Y4=Math.abs(Eg*Math.sin(W4)/Math.cos(W4))):Y4=zC):(Eg=Math.min(bH,zC),Y4=Math.abs(Eg*Math.sin(W4)/Math.cos(W4))),cme=r.x+Of.nx*Eg,ume=r.y+Of.ny*Eg,sme=cme-Of.ny*Y4*X4,lme=ume+Of.nx*Y4*X4,hct=r.x+kg.nx*Eg,fct=r.y+kg.ny*Eg,Ust=r};lM=.01,Hvr=Math.sqrt(2*lM),Xc={};Xc.findMidptPtsEtc=function(e,t){var r=t.posPts,n=t.intersectionPts,i=t.vectorNormInverse,a,o=e.pstyle("source-endpoint"),s=e.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(w,T,C,S){var R=S-T,U=C-w,L=Math.sqrt(U*U+R*R);return{x:-R/L,y:U/L}},d=e.pstyle("edge-distances").value;switch(d){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var h=this.manualEndptToPx(e.source()[0],o),f=Ms(h,2),p=f[0],m=f[1],g=this.manualEndptToPx(e.target()[0],s),y=Ms(g,2),v=y[0],b=y[1],x={x1:p,y1:m,x2:v,y2:b};i=u(p,m,v,b),a=x}else $i("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};Xc.findHaystackPoints=function(e){for(var t=0;t0?Math.max(J-K,0):Math.min(J+K,0)},A=I(U,S),P=I(L,R),D=!1;b===u?v=Math.abs(A)>Math.abs(P)?i:n:b===l||b===s?(v=n,D=!0):(b===a||b===o)&&(v=i,D=!0);var M=v===n,O=M?P:A,_=M?L:U,B=kme(_),F=!1;!(D&&(E||T))&&(b===s&&_<0||b===l&&_>0||b===a&&_>0||b===o&&_<0)&&(B*=-1,O=B*Math.abs(O),F=!0);var G;if(E){var z=w<0?1+w:w;G=z*O}else{var V=w<0?O:0;G=V+w*B}var $=function(J){return Math.abs(J)=Math.abs(O)},Z=$(G),re=$(Math.abs(O)-Math.abs(G)),Q=Z||re;if(Q&&!F)if(M){var ge=Math.abs(_)<=f/2,ie=Math.abs(U)<=p/2;if(ge){var pe=(d.x1+d.x2)/2,ue=d.y1,fe=d.y2;r.segpts=[pe,ue,pe,fe]}else if(ie){var Me=(d.y1+d.y2)/2,Ce=d.x1,Ye=d.x2;r.segpts=[Ce,Me,Ye,Me]}else r.segpts=[d.x1,d.y2]}else{var Ze=Math.abs(_)<=h/2,Qe=Math.abs(L)<=m/2;if(Ze){var ve=(d.y1+d.y2)/2,Fe=d.x1,Le=d.x2;r.segpts=[Fe,ve,Le,ve]}else if(Qe){var Be=(d.x1+d.x2)/2,ae=d.y1,he=d.y2;r.segpts=[Be,ae,Be,he]}else r.segpts=[d.x2,d.y1]}else if(M){var de=d.y1+G+(y?f/2*B:0),me=d.x1,ke=d.x2;r.segpts=[me,de,ke,de]}else{var le=d.x1+G+(y?h/2*B:0),W=d.y1,X=d.y2;r.segpts=[le,W,le,X]}if(r.isRound){var q=e.pstyle("taxi-radius").value,j=e.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(q),r.isArcRadius=new Array(r.segpts.length/2).fill(j)}};Xc.tryToCorrectInvalidPoints=function(e,t){var r=e._private.rscratch;if(r.edgeType==="bezier"){var n=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,d=t.tgtShape,h=t.srcCornerRadius,f=t.tgtCornerRadius,p=t.srcRs,m=t.tgtRs,g=!nr(r.startX)||!nr(r.startY),y=!nr(r.arrowStartX)||!nr(r.arrowStartY),v=!nr(r.endX)||!nr(r.endY),b=!nr(r.arrowEndX)||!nr(r.arrowEndY),x=3,E=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,w=x*E,T=Z4({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=T_.poolIndex()){var B=O;O=_,_=B}var F=A.srcPos=O.position(),G=A.tgtPos=_.position(),z=A.srcW=O.outerWidth(),V=A.srcH=O.outerHeight(),$=A.tgtW=_.outerWidth(),Z=A.tgtH=_.outerHeight(),re=A.srcShape=r.nodeShapes[t.getNodeShape(O)],Q=A.tgtShape=r.nodeShapes[t.getNodeShape(_)],ge=A.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,ie=A.tgtCornerRadius=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,pe=A.tgtRs=_._private.rscratch,ue=A.srcRs=O._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var fe=0;fe=Hvr||(ke=Math.sqrt(Math.max(me*me,lM)+Math.max(de*de,lM)));var le=A.vector={x:me,y:de},W=A.vectorNorm={x:le.x/ke,y:le.y/ke},X={x:-W.y,y:W.x};A.nodesOverlap=!nr(ke)||Q.checkPoint(ve[0],ve[1],0,$,Z,G.x,G.y,ie,pe)||re.checkPoint(Le[0],Le[1],0,z,V,F.x,F.y,ge,ue),A.vectorNormInverse=X,P={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:G,srcRs:pe,tgtPos:F,tgtRs:ue,srcW:$,srcH:Z,tgtW:z,tgtH:V,srcIntn:Be,tgtIntn:Fe,srcShape:Q,tgtShape:re,posPts:{x1:he.x2,y1:he.y2,x2:he.x1,y2:he.y1},intersectionPts:{x1:ae.x2,y1:ae.y2,x2:ae.x1,y2:ae.y1},vector:{x:-le.x,y:-le.y},vectorNorm:{x:-W.x,y:-W.y},vectorNormInverse:{x:-X.x,y:-X.y}}}var q=Qe?P:A;Ce.nodesOverlap=q.nodesOverlap,Ce.srcIntn=q.srcIntn,Ce.tgtIntn=q.tgtIntn,Ce.isRound=Ye.startsWith("round"),i&&(O.isParent()||O.isChild()||_.isParent()||_.isChild())&&(O.parents().anySame(_)||_.parents().anySame(O)||O.same(_)&&O.isParent())?t.findCompoundLoopPoints(Me,q,fe,Ze):O===_?t.findLoopPoints(Me,q,fe,Ze):Ye.endsWith("segments")?t.findSegmentsPoints(Me,q):Ye.endsWith("taxi")?t.findTaxiPoints(Me,q):Ye==="straight"||!Ze&&A.eles.length%2===1&&fe===Math.floor(A.eles.length/2)?t.findStraightEdgePoints(Me):t.findBezierPoints(Me,q,fe,Ze,Qe),t.findEndpoints(Me),t.tryToCorrectInvalidPoints(Me,q),t.checkForInvalidEdgeWarning(Me),t.storeAllpts(Me),t.storeEdgeProjections(Me),t.calculateArrowAngles(Me),t.recalculateEdgeLabelProjections(Me),t.calculateLabelAngles(Me)}},C=0;C0){var ve=u,Fe=q4(ve,HC(o)),Le=q4(ve,HC(Qe)),Be=Fe;if(Le2){var ae=q4(ve,{x:Qe[2],y:Qe[3]});ae0){var ee=d,Se=q4(ee,HC(o)),Te=q4(ee,HC(K)),Ae=Se;if(Te2){var Ie=q4(ee,{x:K[2],y:K[3]});Ie=m||C){y={cp:E,segment:T};break}}if(y)break}var S=y.cp,R=y.segment,U=(m-v)/R.length,L=R.t1-R.t0,I=p?R.t0+L*U:R.t1-L*U;I=rM(0,I,1),t=jC(S.p0,S.p1,S.p2,I),f=Yvr(S.p0,S.p1,S.p2,I);break}case"straight":case"segments":case"haystack":{for(var A=0,P,D,M,O,_=n.allpts.length,B=0;B+3<_&&(p?(M={x:n.allpts[B],y:n.allpts[B+1]},O={x:n.allpts[B+2],y:n.allpts[B+3]}):(M={x:n.allpts[_-2-B],y:n.allpts[_-1-B]},O={x:n.allpts[_-4-B],y:n.allpts[_-3-B]}),P=Z4(M,O),D=A,A+=P,!(A>=m));B+=2);var F=m-D,G=F/P;G=rM(0,G,1),t=fgr(M,O,G),f=yct(M,O);break}}o("labelX",h,t.x),o("labelY",h,t.y),o("labelAutoAngle",h,f)}};u("source"),u("target"),this.applyLabelDimensions(e)}};Ug.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};Ug.applyPrefixedLabelDimensions=function(e,t){var r=e._private,n=this.getLabelText(e,t),i=K4(n,e._private.labelDimsKey);if(Mu(r.rscratch,"prefixedLabelDimsKey",t)!==i){Cg(r.rscratch,"prefixedLabelDimsKey",t,i);var a=this.calculateLabelDimensions(e,n),o=e.pstyle("line-height").pfValue,s=e.pstyle("font-size").pfValue,l=e.pstyle("text-wrap").strValue,u=Mu(r.rscratch,"labelWrapCachedLines",t)||[],d=l!=="wrap"?1:Math.max(u.length,1),h=s*o,f=a.width,p=a.height+(d-1)*(o-1)*s;Cg(r.rstyle,"labelWidth",t,f),Cg(r.rscratch,"labelWidth",t,f),Cg(r.rstyle,"labelHeight",t,p),Cg(r.rscratch,"labelHeight",t,p),Cg(r.rscratch,"labelLineHeight",t,h),Cg(r.rscratch,"labelActualDescent",t,a.labelActualDescent)}};Ug.getLabelText=function(e,t){var r=e._private,n=t?t+"-":"",i=e.pstyle(n+"label").strValue,a=e.pstyle("text-transform").value,o=function(V,$){return $?(Cg(r.rscratch,V,t,$),$):Mu(r.rscratch,V,t)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="\u200B",d=i.split(` -`),h=e.pstyle("text-max-width").pfValue,f=e.pstyle("text-overflow-wrap").value,p=f==="anywhere",m=[],g=/[\s\u200b]+|$/g,y=0;yh){var w=v.matchAll(g),T="",C=0,S=Nd(w),R;try{for(S.s();!(R=S.n()).done;){var U=R.value,L=U[0],I=v.substring(C,U.index);C=U.index+L.length;var A=T.length===0?I:T+I+L,P=this.calculateLabelDimensions(e,A),D=P.width;D<=h?T+=I+L:(T&&m.push(T),T=I+L)}}catch(z){S.e(z)}finally{S.f()}T.match(/^[\s\u200b]+$/)||m.push(T)}else m.push(v)}o("labelWrapCachedLines",m),i=o("labelWrapCachedText",m.join(` -`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var M=e.pstyle("text-max-width").pfValue,O="",_="\u2026",B=!1;if(this.calculateLabelDimensions(e,i).widthM)break;O+=i[F],F===i.length-1&&(B=!0)}return B||(O+=_),O}return i};Ug.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,r=e.pstyle("text-halign").strValue;return t==="auto"?e.isNode()?Dyr(r):"center":t};Ug.calculateLabelDimensions=function(e,t){var r=this,n=r.cy.window(),i=n.document,a=0,o=e.pstyle("font-style").strValue,s=e.pstyle("font-size").pfValue,l=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,d=e.pstyle("text-metrics").strValue||"font",h=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=h.getContext("2d");var p=h.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(o," ").concat(u," ").concat(s,"px ").concat(l);for(var m=0,g=0,y=t.split(` -`),v=y.length,b=0,x=0,E=0;E1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(o),s)for(var l=0;l=e.desktopTapThreshold2}var It=a(q);we&&(e.hoverData.tapholdCancelled=!0);var Ot=function(){var Wt=e.hoverData.dragDelta=e.hoverData.dragDelta||[];Wt.length===0?(Wt.push(ze[0]),Wt.push(ze[1])):(Wt[0]+=ze[0],Wt[1]+=ze[1])};se=!0,i(Ge,["mousemove","vmousemove","tapdrag"],q,{x:Se[0],y:Se[1]});var Et=function(Wt){return{originalEvent:q,type:Wt,position:{x:Se[0],y:Se[1]}}},Ee=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||J.emit(Et("boxstart")),Ie[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(we){var gt=Et("cxtdrag");He?He.emit(gt):J.emit(gt),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||Ge!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(Et("cxtdragout")),e.hoverData.cxtOver=Ge,Ge&&Ge.emit(Et("cxtdragover")))}}else if(e.hoverData.dragging){if(se=!0,J.panningEnabled()&&J.userPanningEnabled()){var Ut;if(e.hoverData.justStartedPan){var ct=e.hoverData.mdownPos;Ut={x:(Se[0]-ct[0])*K,y:(Se[1]-ct[1])*K},e.hoverData.justStartedPan=!1}else Ut={x:ze[0]*K,y:ze[1]*K};J.panBy(Ut),J.emit(Et("dragpan")),e.hoverData.dragged=!0}Se=e.projectIntoViewport(q.clientX,q.clientY)}else if(Ie[4]==1&&(He==null||He.pannable())){if(we){if(!e.hoverData.dragging&&J.boxSelectionEnabled()&&(It||!J.panningEnabled()||!J.userPanningEnabled()))Ee();else if(!e.hoverData.selecting&&J.panningEnabled()&&J.userPanningEnabled()){var Ne=o(He,e.hoverData.downs);Ne&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,Ie[4]=0,e.data.bgActivePosistion=HC(Te),e.redrawHint("select",!0),e.redraw())}He&&He.pannable()&&He.active()&&He.unactivate()}}else{if(He&&He.pannable()&&He.active()&&He.unactivate(),(!He||!He.grabbed())&&Ge!=De&&(De&&i(De,["mouseout","tapdragout"],q,{x:Se[0],y:Se[1]}),Ge&&i(Ge,["mouseover","tapdragover"],q,{x:Se[0],y:Se[1]}),e.hoverData.last=Ge),He)if(we){if(J.boxSelectionEnabled()&&It)He&&He.grabbed()&&(g(Ke),He.emit(Et("freeon")),Ke.emit(Et("free")),e.dragData.didDrag&&(He.emit(Et("dragfreeon")),Ke.emit(Et("dragfree")))),Ee();else if(He&&He.grabbed()&&e.nodeIsDraggable(He)){var at=!e.dragData.didDrag;at&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||p(Ke,{inDragLayer:!0});var ft={x:0,y:0};if(nr(ze[0])&&nr(ze[1])&&(ft.x+=ze[0],ft.y+=ze[1],at)){var Ct=e.hoverData.dragDelta;Ct&&nr(Ct[0])&&nr(Ct[1])&&(ft.x+=Ct[0],ft.y+=Ct[1])}e.hoverData.draggingEles=!0,Ke.silentShift(ft).emit(Et("position")).emit(Et("drag")),e.redrawHint("drag",!0),e.redraw()}}else Ot();se=!0}if(Ie[2]=Se[0],Ie[3]=Se[1],se)return q.stopPropagation&&q.stopPropagation(),q.preventDefault&&q.preventDefault(),!1}},!1);var U,L,I;e.registerBinding(t,"mouseup",function(q){if(!(e.hoverData.which===1&&q.which!==1&&e.hoverData.capture)){var j=e.hoverData.capture;if(j){e.hoverData.capture=!1;var se=e.cy,J=e.projectIntoViewport(q.clientX,q.clientY),K=e.selection,ee=e.findNearestElement(J[0],J[1],!0,!1),Se=e.dragData.possibleDragElements,Te=e.hoverData.down,Ae=a(q);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,Te&&Te.unactivate();var Ie=function(bt){return{originalEvent:q,type:bt,position:{x:J[0],y:J[1]}}};if(e.hoverData.which===3){var Ge=Ie("cxttapend");if(Te?Te.emit(Ge):se.emit(Ge),!e.hoverData.cxtDragged){var De=Ie("cxttap");Te?Te.emit(De):se.emit(De)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(i(ee,["mouseup","tapend","vmouseup"],q,{x:J[0],y:J[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(i(Te,["click","tap","vclick"],q,{x:J[0],y:J[1]}),L=!1,q.timeStamp-I<=se.multiClickDebounceTime()?(U&&clearTimeout(U),L=!0,I=null,i(Te,["dblclick","dbltap","vdblclick"],q,{x:J[0],y:J[1]})):(U=setTimeout(function(){L||i(Te,["oneclick","onetap","voneclick"],q,{x:J[0],y:J[1]})},se.multiClickDebounceTime()),I=q.timeStamp)),Te==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(q)&&(se.$(r).unselect(["tapunselect"]),Se.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=Se=se.collection()),ee==Te&&!e.dragData.didDrag&&!e.hoverData.selecting&&ee!=null&&ee._private.selectable&&(e.hoverData.dragging||(se.selectionType()==="additive"||Ae?ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]):Ae||(se.$(r).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var He=se.collection(e.getAllInBox(K[0],K[1],K[2],K[3]));e.redrawHint("select",!0),He.length>0&&e.redrawHint("eles",!0),se.emit(Ie("boxend"));var ze=function(bt){return bt.selectable()&&!bt.selected()};se.selectionType()==="additive"||Ae||se.$(r).unmerge(He).unselect(),He.emit(Ie("box")).stdFilter(ze).select().emit(Ie("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!K[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var Ke=Te&&Te.grabbed();g(Se),Ke&&(Te.emit(Ie("freeon")),Se.emit(Ie("free")),e.dragData.didDrag&&(Te.emit(Ie("dragfreeon")),Se.emit(Ie("dragfree"))))}}K[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 A=[],P=4,D,M=1e5,O=function(q){for(var j=Math.abs(q[0]),se=1;se=P){D=!1;var J=A;if(J[0]>=5){var K;O(J)?K=J[0]:K=ugr(J),K>1&&(D=!0,M=K)}}else A.push(Math.abs(se)),j=!0;else D&&(M=Math.min(Math.abs(se),M));if(!e.scrollingPage){var ee=e.cy,Se=ee.zoom(),Te=ee.pan(),Ae=e.projectIntoViewport(q.clientX,q.clientY),Ie=[Ae[0]*Se+Te.x,Ae[1]*Se+Te.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C()){q.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){q.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var Ge;j&&Math.abs(se)>5&&(se=kme(se)*5),Ge=se/-250,D&&(Ge/=M,Ge*=3),Ge=Ge*e.wheelSensitivity;var De=q.deltaMode===1;De&&(Ge*=33);var He=ee.zoom()*Math.pow(10,Ge);q.type==="gesturechange"&&(He=e.gestureStartZoom*q.scale),ee.zoom({level:He,renderedPosition:{x:Ie[0],y:Ie[1]}}),ee.emit({type:q.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:q,position:{x:Ae[0],y:Ae[1]}})}}}};e.registerBinding(e.container,"wheel",_,!0),e.registerBinding(t,"scroll",function(q){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(q){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||q.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(X){e.hasTouchStarted||_(X)},!0),e.registerBinding(e.container,"mouseout",function(q){var j=e.projectIntoViewport(q.clientX,q.clientY);e.cy.emit({originalEvent:q,type:"mouseout",position:{x:j[0],y:j[1]}})},!1),e.registerBinding(e.container,"mouseover",function(q){var j=e.projectIntoViewport(q.clientX,q.clientY);e.cy.emit({originalEvent:q,type:"mouseover",position:{x:j[0],y:j[1]}})},!1);var B,F,G,z,V,$,Z,re,Q,ge,ie,pe,ue,fe=function(q,j,se,J){return Math.sqrt((se-q)*(se-q)+(J-j)*(J-j))},Me=function(q,j,se,J){return(se-q)*(se-q)+(J-j)*(J-j)},Ce;e.registerBinding(e.container,"touchstart",Ce=function(q){if(e.hasTouchStarted=!0,!!S(q)){v(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var j=e.cy,se=e.touchData.now,J=e.touchData.earlier;if(q.touches[0]){var K=e.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);se[0]=K[0],se[1]=K[1]}if(q.touches[1]){var K=e.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);se[2]=K[0],se[3]=K[1]}if(q.touches[2]){var K=e.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);se[4]=K[0],se[5]=K[1]}var ee=function(It){return{originalEvent:q,type:It,position:{x:se[0],y:se[1]}}};if(q.touches[1]){e.touchData.singleTouchMoved=!0,g(e.dragData.touchDragEles);var Se=e.findContainerClientCoords();Q=Se[0],ge=Se[1],ie=Se[2],pe=Se[3],B=q.touches[0].clientX-Q,F=q.touches[0].clientY-ge,G=q.touches[1].clientX-Q,z=q.touches[1].clientY-ge,ue=0<=B&&B<=ie&&0<=G&&G<=ie&&0<=F&&F<=pe&&0<=z&&z<=pe;var Te=j.pan(),Ae=j.zoom();V=fe(B,F,G,z),$=Me(B,F,G,z),Z=[(B+G)/2,(F+z)/2],re=[(Z[0]-Te.x)/Ae,(Z[1]-Te.y)/Ae];var Ie=200,Ge=Ie*Ie;if($=1){for(var Ve=e.touchData.startPosition=[null,null,null,null,null,null],vt=0;vt=e.touchTapThreshold2}if(j&&e.touchData.cxt){q.preventDefault();var vt=q.touches[0].clientX-Q,Pt=q.touches[0].clientY-ge,Xt=q.touches[1].clientX-Q,It=q.touches[1].clientY-ge,Ot=Me(vt,Pt,Xt,It),Et=Ot/$,Ee=150,gt=Ee*Ee,Ut=1.5,ct=Ut*Ut;if(Et>=ct||Ot>=gt){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ne=Ae("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(Ne),e.touchData.start=null):J.emit(Ne)}}if(j&&e.touchData.cxt){var Ne=Ae("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(Ne):J.emit(Ne),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var at=e.findNearestElement(K[0],K[1],!0,!0);(!e.touchData.cxtOver||at!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(Ae("cxtdragout")),e.touchData.cxtOver=at,at&&at.emit(Ae("cxtdragover")))}else if(j&&q.touches[2]&&J.boxSelectionEnabled())q.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||J.emit(Ae("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,se[4]=1,!se||se.length===0||se[0]===void 0?(se[0]=(K[0]+K[2]+K[4])/3,se[1]=(K[1]+K[3]+K[5])/3,se[2]=(K[0]+K[2]+K[4])/3+1,se[3]=(K[1]+K[3]+K[5])/3+1):(se[2]=(K[0]+K[2]+K[4])/3,se[3]=(K[1]+K[3]+K[5])/3),e.redrawHint("select",!0),e.redraw();else if(j&&q.touches[1]&&!e.touchData.didSelect&&J.zoomingEnabled()&&J.panningEnabled()&&J.userZoomingEnabled()&&J.userPanningEnabled()){q.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var ft=e.dragData.touchDragEles;if(ft){e.redrawHint("drag",!0);for(var Ct=0;Ct0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Ze;e.registerBinding(t,"touchcancel",Ze=function(q){var j=e.touchData.start;e.touchData.capture=!1,j&&j.unactivate()});var Qe,ve,Fe,Le;if(e.registerBinding(t,"touchend",Qe=function(q){var j=e.touchData.start,se=e.touchData.capture;if(se)q.touches.length===0&&(e.touchData.capture=!1),q.preventDefault();else return;var J=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var K=e.cy,ee=K.zoom(),Se=e.touchData.now,Te=e.touchData.earlier;if(q.touches[0]){var Ae=e.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);Se[0]=Ae[0],Se[1]=Ae[1]}if(q.touches[1]){var Ae=e.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);Se[2]=Ae[0],Se[3]=Ae[1]}if(q.touches[2]){var Ae=e.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);Se[4]=Ae[0],Se[5]=Ae[1]}var Ie=function(gt){return{originalEvent:q,type:gt,position:{x:Se[0],y:Se[1]}}};j&&j.unactivate();var Ge;if(e.touchData.cxt){if(Ge=Ie("cxttapend"),j?j.emit(Ge):K.emit(Ge),!e.touchData.cxtDragged){var De=Ie("cxttap");j?j.emit(De):K.emit(De)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!q.touches[2]&&K.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var He=K.collection(e.getAllInBox(J[0],J[1],J[2],J[3]));J[0]=void 0,J[1]=void 0,J[2]=void 0,J[3]=void 0,J[4]=0,e.redrawHint("select",!0),K.emit(Ie("boxend"));var ze=function(gt){return gt.selectable()&&!gt.selected()};He.emit(Ie("box")).stdFilter(ze).select().emit(Ie("boxselect")),He.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(j?.unactivate(),q.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!q.touches[1]){if(!q.touches[0]){if(!q.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ke=e.dragData.touchDragEles;if(j!=null){var we=j._private.grabbed;g(Ke),e.redrawHint("drag",!0),e.redrawHint("eles",!0),we&&(j.emit(Ie("freeon")),Ke.emit(Ie("free")),e.dragData.didDrag&&(j.emit(Ie("dragfreeon")),Ke.emit(Ie("dragfree")))),i(j,["touchend","tapend","vmouseup","tapdragout"],q,{x:Se[0],y:Se[1]}),j.unactivate(),e.touchData.start=null}else{var bt=e.findNearestElement(Se[0],Se[1],!0,!0);i(bt,["touchend","tapend","vmouseup","tapdragout"],q,{x:Se[0],y:Se[1]})}var Ve=e.touchData.startPosition[0]-Se[0],vt=Ve*Ve,Pt=e.touchData.startPosition[1]-Se[1],Xt=Pt*Pt,It=vt+Xt,Ot=It*ee*ee;e.touchData.singleTouchMoved||(j||K.$(":selected").unselect(["tapunselect"]),i(j,["tap","vclick"],q,{x:Se[0],y:Se[1]}),ve=!1,q.timeStamp-Le<=K.multiClickDebounceTime()?(Fe&&clearTimeout(Fe),ve=!0,Le=null,i(j,["dbltap","vdblclick"],q,{x:Se[0],y:Se[1]})):(Fe=setTimeout(function(){ve||i(j,["onetap","voneclick"],q,{x:Se[0],y:Se[1]})},K.multiClickDebounceTime()),Le=q.timeStamp)),j!=null&&!e.dragData.didDrag&&j._private.selectable&&Ot"u"){var Be=[],ae=function(q){return{clientX:q.clientX,clientY:q.clientY,force:1,identifier:q.pointerId,pageX:q.pageX,pageY:q.pageY,radiusX:q.width/2,radiusY:q.height/2,screenX:q.screenX,screenY:q.screenY,target:q.target}},he=function(q){return{event:q,touch:ae(q)}},de=function(q){Be.push(he(q))},me=function(q){for(var j=0;j0)return z[0]}return null},m=Object.keys(f),g=0;g0?p:blt(a,o,t,r,n,i,s,l)},checkPoint:function(t,r,n,i,a,o,s,l){l=l==="auto"?hx(i,a):l;var u=2*l;if(Dy(t,r,this.points,o,s,i,a-u,[0,-1],n)||Dy(t,r,this.points,o,s,i-u,a,[0,-1],n))return!0;var d=i/2+2*n,h=a/2+2*n,f=[o-d,s-h,o-d,s,o+d,s,o+d,s-h];return!!(Dd(t,r,f)||$4(t,r,u,u,o+i/2-l,s+a/2-l,n)||$4(t,r,u,u,o-i/2+l,s+a/2-l,n))}}};Ny.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Ru(3,0)),this.generateRoundPolygon("round-triangle",Ru(3,0)),this.generatePolygon("rectangle",Ru(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Ru(5,0)),this.generateRoundPolygon("round-pentagon",Ru(5,0)),this.generatePolygon("hexagon",Ru(6,0)),this.generateRoundPolygon("round-hexagon",Ru(6,0)),this.generatePolygon("heptagon",Ru(7,0)),this.generateRoundPolygon("round-heptagon",Ru(7,0)),this.generatePolygon("octagon",Ru(8,0)),this.generateRoundPolygon("round-octagon",Ru(8,0));var n=new Array(20);{var i=Z0e(5,0),a=Z0e(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=t.deqFastCost*E)break}else if(u){if(b>=t.deqCost*p||b>=t.deqAvgCost*f)break}else if(x>=t.deqNoDrawCost*W0e)break;var w=t.deq(n,y,g);if(w.length>0)for(var T=0;T0&&(t.onDeqd(n,m),!u&&t.shouldRedraw(n,m,y,g)&&a())},s=t.priority||wme;i.beforeRender(o,s(n))}}}},Kvr=(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:PH;gx(this,e),this.idsByKey=new My,this.keyForId=new My,this.cachesByLvl=new My,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=r}return yx(e,[{key:"getIdsFor",value:function(r){r==null&&mo("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new rS,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new My,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),Dst=25,xH=50,MH=-4,dme=3,kct=7.99,Zvr=8,Qvr=1024,Jvr=1024,ebr=1024,tbr=.2,rbr=.8,nbr=10,ibr=.15,abr=.1,obr=.9,sbr=.9,lbr=100,cbr=1,YC={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ubr=uc({getKey:null,doesEleInvalidateKey:PH,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:dlt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),$R=function(t,r){var n=this;n.renderer=t,n.onDequeues=[];var i=ubr(r);Qr(n,i),n.lookup=new Kvr(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ll=$R.prototype;ll.reasons=YC;ll.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]};ll.getRetiredTextureQueue=function(e){var t=this,r=t.eleImgCaches.retired=t.eleImgCaches.retired||{},n=r[e]=r[e]||[];return n};ll.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new mM(function(r,n){return n.reqs-r.reqs});return t};ll.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};ll.getElement=function(e,t,r,n,i){var a=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(n==null&&(n=Math.ceil(Tme(s*r))),n=kct||n>dme)return null;var u=Math.pow(2,n),d=t.h*u,h=t.w*u,f=o.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,f))return null;var p=l.get(e,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var m;if(d<=Dst?m=Dst:d<=xH?m=xH:m=Math.ceil(d/xH)*xH,d>ebr||h>Jvr)return null;var g=a.getTextureQueue(m),y=g[g.length-2],v=function(){return a.recycleTexture(m,h)||a.addTexture(m,h)};y||(y=g[g.length-1]),y||(y=v()),y.width-y.usedWidthn;L--)R=a.getElement(e,t,r,L,YC.downscale);U()}else return a.queueElement(e,T.level-1),T;else{var I;if(!x&&!E&&!w)for(var A=n-1;A>=MH;A--){var P=l.get(e,A);if(P){I=P;break}}if(b(I))return a.queueElement(e,n),I;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,e,t,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:h,height:d,scaledLabelShown:f},y.usedWidth+=Math.ceil(h+Zvr),y.eleCaches.push(p),l.set(e,n,p),a.checkTextureFullness(y),p};ll.invalidateElements=function(e){for(var t=0;t=tbr*e.width&&this.retireTexture(e)};ll.checkTextureFullness=function(e){var t=this,r=t.getTextureQueue(e.height);e.usedWidth/e.width>rbr&&e.fullnessChecks>=nbr?dx(r,e):e.fullnessChecks++};ll.retireTexture=function(e){var t=this,r=e.height,n=t.getTextureQueue(r),i=this.lookup;dx(n,e),e.retired=!0;for(var a=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Eme(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),dx(i,o),n.push(o),o}};ll.queueElement=function(e,t){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(e),o=i[a];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:a};n.push(s),i[a]=s}};ll.dequeue=function(e){for(var t=this,r=t.getElementQueue(),n=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o0;o++){var s=r.pop(),l=s.key,u=s.eles[0],d=a.hasCache(u,s.level);if(n[l]=null,d)continue;i.push(s);var h=t.getBoundingBox(u);t.getElement(u,h,e,s.level,YC.dequeue)}return i};ll.removeFromQueue=function(e){var t=this,r=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(e),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=xme,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(e))};ll.onDequeue=function(e){this.onDequeues.push(e)};ll.offDequeue=function(e){dx(this.onDequeues,e)};ll.setupDequeueing=Tct.setupDequeueing({deqRedrawThreshold:lbr,deqCost:ibr,deqAvgCost:abr,deqNoDrawCost:obr,deqFastCost:sbr,deq:function(t,r,n){return t.dequeue(r,n)},onDeqd:function(t,r){for(var n=0;n=hbr||r>HH)return null}n.validateLayersElesOrdering(r,e);var l=n.layersByLevel,u=Math.pow(2,r),d=l[r]=l[r]||[],h,f=n.levelIsComplete(r,e),p,m=function(){var U=function(D){if(n.validateLayersElesOrdering(D,e),n.levelIsComplete(D,e))return p=l[D],!0},L=function(D){if(!p)for(var M=r+D;ZR<=M&&M<=HH&&!U(M);M+=D);};L(1),L(-1);for(var I=d.length-1;I>=0;I--){var A=d[I];A.invalid&&dx(d,A)}};if(!f)m();else return d;var g=function(){if(!h){h=Lu();for(var U=0;U_st||A>_st)return null;var P=I*A;if(P>xbr)return null;var D=n.makeLayer(h,r);if(L!=null){var M=d.indexOf(L)+1;d.splice(M,0,D)}else(U.insert===void 0||U.insert)&&d.unshift(D);return D};if(n.skipping&&!s)return null;for(var v=null,b=e.length/dbr,x=!s,E=0;E=b||!vlt(v.bb,w.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||x?n.queueLayer(v,w):n.drawEleInLayer(v,w,r,t),v.eles.push(w),C[r]=v}return p||(x?null:d)};dc.getEleLevelForLayerLevel=function(e,t){return e};dc.drawEleInLayer=function(e,t,r,n){var i=this,a=this.renderer,o=e.context,s=t.boundingBox();s.w===0||s.h===0||!t.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(o,!1),a.drawCachedElement(o,t,null,null,r,wbr),a.setImgSmoothing(o,!0))};dc.levelIsComplete=function(e,t){var r=this,n=r.layersByLevel[e];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||o.invalid)return!1;i+=o.eles.length}return i===t.length};dc.validateLayersElesOrdering=function(e,t){var r=this.layersByLevel[e];if(r)for(var n=0;n0){t=!0;break}}return t};dc.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Ly(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,i,a){t.invalidateLayer(n)}))};dc.invalidateLayer=function(e){if(this.lastInvalidationTime=Ly(),!e.invalid){var t=e.level,r=e.eles,n=this.layersByLevel[t];dx(n,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=t._private.rscratch;if(!(a&&!t.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;r&&(l=r,e.translate(-l.x1,-l.y1));var u=a?t.pstyle("opacity").value:1,d=a?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,f=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,m=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,y=t.pstyle("line-outline-color").value,v=u*d,b=u*d,x=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;h==="straight-triangle"?(o.eleStrokeStyle(e,t,D),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=m,o.eleStrokeStyle(e,t,D),o.drawEdgePath(t,e,s.allpts,f),e.lineCap="butt")},E=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(e.lineWidth=p+g,e.lineCap=m,g>0)o.colorStrokeStyle(e,y[0],y[1],y[2],D);else{e.lineCap="butt";return}h==="straight-triangle"?o.drawEdgeTrianglePath(t,e,s.allpts):(o.drawEdgePath(t,e,s.allpts,f),e.lineCap="butt")},w=function(){i&&o.drawEdgeOverlay(e,t)},T=function(){i&&o.drawEdgeUnderlay(e,t)},C=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(e,t,D)},S=function(){o.drawElementText(e,t,null,n)};e.lineJoin="round";var R=t.pstyle("ghost").value==="yes";if(R){var U=t.pstyle("ghost-offset-x").pfValue,L=t.pstyle("ghost-offset-y").pfValue,I=t.pstyle("ghost-opacity").value,A=v*I;e.translate(U,L),x(A),C(A),e.translate(-U,-L)}else E();T(),x(),C(),w(),S(),r&&e.translate(l.x1,l.y1)}};Act=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(t,"-opacity")).value;if(i!==0){var a=this,o=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(t,"-padding")).pfValue,u=2*l,d=n.pstyle("".concat(t,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,d[0],d[1],d[2],i),a.drawEdgePath(n,r,s.allpts,"solid")}}}};_y.drawEdgeOverlay=Act("overlay");_y.drawEdgeUnderlay=Act("underlay");_y.drawEdgePath=function(e,t,r,n){var i=e._private.rscratch,a=t,o,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(l){var h=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===h;f?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=h,i.pathCache=o)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=d;break;case"solid":a.setLineDash([]);break}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(a&&!o.eleTextBiggerThanMin(t))return}else if(n===!1)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(t),u=t.pstyle("text-metrics").strValue==="glyph";e.textAlign=l,e.textBaseline=u?"alphabetic":"bottom"}else{var d=t.element()._private.rscratch.badLine,h=t.pstyle("label"),f=t.pstyle("source-label"),p=t.pstyle("target-label");if(d||(!h||!h.value)&&(!f||!f.value)&&(!p||!p.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!r,g;r&&(g=r,e.translate(-g.x1,-g.y1)),i==null?(o.drawText(e,t,null,m,a),t.isEdge()&&(o.drawText(e,t,"source",m,a),o.drawText(e,t,"target",m,a))):o.drawText(e,t,i,m,a),r&&e.translate(g.x1,g.y1)};r3.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=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=r?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=n+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,d[0],d[1],d[2],l)};r3.getTextAngle=function(e,t){var r,n=e._private,i=n.rscratch,a=t?t+"-":"",o=e.pstyle(a+"text-rotation");if(o.strValue==="autorotate"){var s=Mu(i,"labelAngle",t);r=e.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};r3.drawText=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=t._private,o=a.rscratch,s=i?t.effectiveOpacity():1;if(!(i&&(s===0||t.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Mu(o,"labelX",r),u=Mu(o,"labelY",r),d,h,f=this.getLabelText(t,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(e,t,i);var p=r?r+"-":"",m=Mu(o,"labelWidth",r),g=Mu(o,"labelHeight",r),y=Mu(o,"labelActualDescent",r),v=t.pstyle(p+"text-margin-x").pfValue,b=t.pstyle(p+"text-margin-y").pfValue,x=t.isEdge(),E=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;x&&(E="center",w="center"),l+=v,u+=b;var T;n?T=this.getTextAngle(t,r):T=0,T!==0&&(d=l,h=u,e.translate(d,h),e.rotate(T),l=0,u=0);var C=eS(E),S=tS(w);switch(S){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var R=t.pstyle("text-background-opacity").value,U=t.pstyle("text-border-opacity").value,L=t.pstyle("text-border-width").pfValue,I=t.pstyle("text-background-padding").pfValue,A=t.pstyle("text-background-shape").strValue,P=A==="round-rectangle"||A==="roundrectangle",D=A==="circle",M=2;if(R>0||L>0&&U>0){var O=e.fillStyle,_=e.strokeStyle,B=e.lineWidth,F=t.pstyle("text-background-color").value,G=t.pstyle("text-border-color").value,z=t.pstyle("text-border-style").value,V=R>0,$=L>0&&U>0,Z=l-I;switch(C){case"left":Z-=m;break;case"center":Z-=m/2;break}var re=u-g-I,Q=m+2*I,ge=g+2*I;if(V&&(e.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(R*s,")")),$&&(e.strokeStyle="rgba(".concat(G[0],",").concat(G[1],",").concat(G[2],",").concat(U*s,")"),e.lineWidth=L,e.setLineDash))switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=L/4,e.setLineDash([]);break;default:e.setLineDash([]);break}if(P?(e.beginPath(),Fst(e,Z,re,Q,ge,M)):D?(e.beginPath(),Lbr(e,Z,re,Q,ge)):(e.beginPath(),e.rect(Z,re,Q,ge)),V&&e.fill(),$&&e.stroke(),$&&z==="double"){var ie=L/2;e.beginPath(),P?Fst(e,Z+ie,re+ie,Q-2*ie,ge-2*ie,M):e.rect(Z+ie,re+ie,Q-2*ie,ge-2*ie),e.stroke()}e.fillStyle=O,e.strokeStyle=_,e.lineWidth=B,e.setLineDash&&e.setLineDash([])}var pe=2*t.pstyle("text-outline-width").pfValue;if(pe>0&&(e.lineWidth=pe),u-=y,t.pstyle("text-wrap").value==="wrap"){var ue=Mu(o,"labelWrapCachedLines",r),fe=Mu(o,"labelLineHeight",r),Me=m/2,Ce=this.getLabelJustification(t);switch(Ce==="auto"||(C==="left"?Ce==="left"?l+=-m:Ce==="center"&&(l+=-Me):C==="center"?Ce==="left"?l+=-Me:Ce==="right"&&(l+=Me):C==="right"&&(Ce==="center"?l+=Me:Ce==="right"&&(l+=m))),S){case"top":u-=(ue.length-1)*fe;break;case"center":case"bottom":u-=(ue.length-1)*fe;break}for(var Ye=0;Ye0&&e.strokeText(ue[Ye],l,u),e.fillText(ue[Ye],l,u),u+=fe}else pe>0&&e.strokeText(f,l,u),e.fillText(f,l,u);T!==0&&(e.rotate(-T),e.translate(-d,-h))}}};bx={};bx.drawNode=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=t._private,d=u.rscratch,h=t.position();if(!(!nr(h.x)||!nr(h.y))&&!(a&&!t.visible())){var f=a?t.effectiveOpacity():1,p=o.usePaths(),m,g=!1,y=t.padding();s=t.width()+2*y,l=t.height()+2*y;var v;r&&(v=r,e.translate(-v.x1,-v.y1));for(var b=t.pstyle("background-image"),x=b.value,E=new Array(x.length),w=new Array(x.length),T=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:A;o.eleFillStyle(e,t,j)},ie=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(e,P[0],P[1],P[2],j)},pe=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z;o.colorStrokeStyle(e,V[0],V[1],V[2],j)},ue=function(j,se,J,K){var ee=o.nodePathCache=o.nodePathCache||[],Se=ult(J==="polygon"?J+","+K.join(","):J,""+se,""+j,""+Q),Te=ee[Se],Ae,Ie=!1;return Te!=null?(Ae=Te,Ie=!0,d.pathCache=Ae):(Ae=new Path2D,ee[Se]=d.pathCache=Ae),{path:Ae,cacheHit:Ie}},fe=t.pstyle("shape").strValue,Me=t.pstyle("shape-polygon-points").pfValue;if(p){e.translate(h.x,h.y);var Ce=ue(s,l,fe,Me);m=Ce.path,g=Ce.cacheHit}var Ye=function(){if(!g){var j=h;p&&(j={x:0,y:0}),o.nodeShapes[o.getNodeShape(t)].draw(m||e,j.x,j.y,s,l,Q,d)}p?e.fill(m):e.fill()},Ze=function(){for(var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,J=u.backgrounding,K=0,ee=0;ee0&&arguments[0]!==void 0?arguments[0]:!1,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasPie(t)&&(o.drawPie(e,t,se),j&&(p||o.nodeShapes[o.getNodeShape(t)].draw(e,h.x,h.y,s,l,Q,d)))},ve=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasStripe(t)&&(e.save(),p?e.clip(d.pathCache):(o.nodeShapes[o.getNodeShape(t)].draw(e,h.x,h.y,s,l,Q,d),e.clip()),o.drawStripe(e,t,se),e.restore(),j&&(p||o.nodeShapes[o.getNodeShape(t)].draw(e,h.x,h.y,s,l,Q,d)))},Fe=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=(L>0?L:-L)*j,J=L>0?0:255;L!==0&&(o.colorFillStyle(e,J,J,J,se),p?e.fill(m):e.fill())},Le=function(){if(I>0){if(e.lineWidth=I,e.lineCap=O,e.lineJoin=M,e.setLineDash)switch(D){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(B),e.lineDashOffset=F;break;case"solid":case"double":e.setLineDash([]);break}if(_!=="center"){if(e.save(),e.lineWidth*=2,_==="inside")p?e.clip(m):e.clip();else{var j=new Path2D;j.rect(-s/2-I,-l/2-I,s+2*I,l+2*I),j.addPath(m),e.clip(j,"evenodd")}p?e.stroke(m):e.stroke(),e.restore()}else p?e.stroke(m):e.stroke();if(D==="double"){e.lineWidth=I/3;var se=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",p?e.stroke(m):e.stroke(),e.globalCompositeOperation=se}e.setLineDash&&e.setLineDash([])}},Be=function(){if(z>0){if(e.lineWidth=z,e.lineCap="butt",e.setLineDash)switch($){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var j=h;p&&(j={x:0,y:0});var se=o.getNodeShape(t),J=I;_==="inside"&&(J=0),_==="outside"&&(J*=2);var K=(s+J+(z+re))/s,ee=(l+J+(z+re))/l,Se=s*K,Te=l*ee,Ae=o.nodeShapes[se].points,Ie;if(p){var Ge=ue(Se,Te,se,Ae);Ie=Ge.path}if(se==="ellipse")o.drawEllipsePath(Ie||e,j.x,j.y,Se,Te);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(se)){var De=0,He=0,ze=0;se==="round-diamond"?De=(J+re+z)*1.4:se==="round-heptagon"?(De=(J+re+z)*1.075,ze=-(J/2+re+z)/35):se==="round-hexagon"?De=(J+re+z)*1.12:se==="round-pentagon"?(De=(J+re+z)*1.13,ze=-(J/2+re+z)/15):se==="round-tag"?(De=(J+re+z)*1.12,He=(J/2+z+re)*.07):se==="round-triangle"&&(De=(J+re+z)*(Math.PI/2),ze=-(J+re/2+z)/Math.PI),De!==0&&(K=(s+De)/s,Se=s*K,["round-hexagon","round-tag"].includes(se)||(ee=(l+De)/l,Te=l*ee)),Q=Q==="auto"?wlt(Se,Te):Q;for(var Ke=Se/2,we=Te/2,bt=Q+(J+z+re)/2,Ve=new Array(Ae.length/2),vt=new Array(Ae.length/2),Pt=0;Pt0){if(i=i||n.position(),a==null||o==null){var p=n.padding();a=n.width()+2*p,o=n.height()+2*p}s.colorFillStyle(r,d[0],d[1],d[2],u),s.nodeShapes[h].draw(r,i.x,i.y,a+l*2,o+l*2,f),r.fill()}}}};bx.drawNodeOverlay=Uct("overlay");bx.drawNodeUnderlay=Uct("underlay");bx.hasPie=function(e){return e=e[0],e._private.hasPie};bx.hasStripe=function(e){return e=e[0],e._private.hasStripe};bx.drawPie=function(e,t,r,n){t=t[0],n=n||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=t.pstyle("pie-hole"),s=t.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,d=t.width(),h=t.height(),f=Math.min(d,h)/2,p,m=0,g=this.usePaths();if(g&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),o.units==="%"?p=f*o.pfValue:o.pfValue!==void 0&&(p=o.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=t.pstyle("pie-"+y+"-background-size").value,b=t.pstyle("pie-"+y+"-background-color").value,x=t.pstyle("pie-"+y+"-background-opacity").value*r,E=v/100;E+m>1&&(E=1-m);var w=1.5*Math.PI+2*Math.PI*m;w+=s;var T=2*Math.PI*E,C=w+T;v===0||m>=1||m+E>1||(p===0?(e.beginPath(),e.moveTo(l,u),e.arc(l,u,f,w,C),e.closePath()):(e.beginPath(),e.arc(l,u,f,w,C),e.arc(l,u,p,C,w,!0),e.closePath()),this.colorFillStyle(e,b[0],b[1],b[2],x),e.fill(),m+=E)}};bx.drawStripe=function(e,t,r,n){t=t[0],n=n||t.position();var i=t.cy().style(),a=n.x,o=n.y,s=t.width(),l=t.height(),u=0,d=this.usePaths();e.save();var h=t.pstyle("stripe-direction").value,f=t.pstyle("stripe-size");switch(h){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var p=s,m=l;f.units==="%"?(p=p*f.pfValue,m=m*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,m=f.pfValue),d&&(a=0,o=0),o-=p/2,a-=m/2;for(var g=1;g<=i.stripeBackgroundN;g++){var y=t.pstyle("stripe-"+g+"-background-size").value,v=t.pstyle("stripe-"+g+"-background-color").value,b=t.pstyle("stripe-"+g+"-background-opacity").value*r,x=y/100;x+u>1&&(x=1-u),!(y===0||u>=1||u+x>1)&&(e.beginPath(),e.rect(a,o+m*u,p,m*x),e.closePath(),this.colorFillStyle(e,v[0],v[1],v[2],b),e.fill(),u+=x)}e.restore()};Du={},Dbr=100;Du.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),r=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/r};Du.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;it.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!h&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var b=r.style(),x=r.zoom(),E=o!==void 0?o:x,w=r.pan(),T={x:w.x,y:w.y},C={zoom:x,pan:{x:w.x,y:w.y}},S=t.prevViewport,R=S===void 0||C.zoom!==S.zoom||C.pan.x!==S.pan.x||C.pan.y!==S.pan.y;!R&&!(g&&!m)&&(t.motionBlurPxRatio=1),s&&(T=s),E*=l,T.x*=l,T.y*=l;var U=t.getCachedZSortedEles();function L(ie,pe,ue,fe,Me){var Ce=ie.globalCompositeOperation;ie.globalCompositeOperation="destination-out",t.colorFillStyle(ie,255,255,255,t.motionBlurTransparency),ie.fillRect(pe,ue,fe,Me),ie.globalCompositeOperation=Ce}function I(ie,pe){var ue,fe,Me,Ce;!t.clearingMotionBlur&&(ie===u.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||ie===u.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(ue={x:w.x*p,y:w.y*p},fe=x*p,Me=t.canvasWidth*p,Ce=t.canvasHeight*p):(ue=T,fe=E,Me=t.canvasWidth,Ce=t.canvasHeight),ie.setTransform(1,0,0,1,0,0),pe==="motionBlur"?L(ie,0,0,Me,Ce):!n&&(pe===void 0||pe)&&ie.clearRect(0,0,Me,Ce),i||(ie.translate(ue.x,ue.y),ie.scale(fe,fe)),s&&ie.translate(s.x,s.y),o&&ie.scale(o,o)}if(h||(t.textureDrawLastFrame=!1),h){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=r.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});var C=t.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:t.canvasWidth,height:t.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}d[t.DRAG]=!1,d[t.NODE]=!1;var P=u.contexts[t.NODE],D=t.textureCache.texture,C=t.textureCache.viewport;P.setTransform(1,0,0,1,0,0),f?L(P,0,0,C.width,C.height):P.clearRect(0,0,C.width,C.height);var M=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;t.colorFillStyle(P,M[0],M[1],M[2],O),P.fillRect(0,0,C.width,C.height);var x=r.zoom();I(P,!1),P.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),P.drawImage(D,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else t.textureOnViewport&&!n&&(t.textureCache=null);var _=r.extent(),B=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),F=t.hideEdgesOnViewport&&B,G=[];if(G[t.NODE]=!d[t.NODE]&&f&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,G[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),G[t.DRAG]=!d[t.DRAG]&&f&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,G[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||i||a||G[t.NODE]){var z=f&&!G[t.NODE]&&p!==1,P=n||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:u.contexts[t.NODE]),V=f&&!z?"motionBlur":void 0;I(P,V),F?t.drawCachedNodes(P,U.nondrag,l,_):t.drawLayeredElements(P,U.nondrag,l,_),t.debug&&t.drawDebugPoints(P,U.nondrag),!i&&!f&&(d[t.NODE]=!1)}if(!a&&(d[t.DRAG]||i||G[t.DRAG])){var z=f&&!G[t.DRAG]&&p!==1,P=n||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:u.contexts[t.DRAG]);I(P,f&&!z?"motionBlur":void 0),F?t.drawCachedNodes(P,U.drag,l,_):t.drawCachedElements(P,U.drag,l,_),t.debug&&t.drawDebugPoints(P,U.drag),!i&&!f&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,I),f&&p!==1){var $=u.contexts[t.NODE],Z=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],re=u.contexts[t.DRAG],Q=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],ge=function(pe,ue,fe){pe.setTransform(1,0,0,1,0,0),fe||!v?pe.clearRect(0,0,t.canvasWidth,t.canvasHeight):L(pe,0,0,t.canvasWidth,t.canvasHeight);var Me=p;pe.drawImage(ue,0,0,t.canvasWidth*Me,t.canvasHeight*Me,0,0,t.canvasWidth,t.canvasHeight)};(d[t.NODE]||G[t.NODE])&&(ge($,Z,G[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||G[t.DRAG])&&(ge(re,Q,G[t.DRAG]),d[t.DRAG]=!1)}t.prevViewport=C,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),f&&(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,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},Dbr)),n||r.emit("render")};Du.drawSelectionRectangle=function(e,t){var r=this,n=r.cy,i=r.data,a=n.style(),o=e.drawOnlyNodeLayer,s=e.drawAllLayers,l=i.canvasNeedsRedraw,u=e.forcedContext;if(r.showFps||!o&&l[r.SELECT_BOX]&&!s){var d=u||i.contexts[r.SELECT_BOX];if(t(d),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var h=r.cy.zoom(),f=a.core("selection-box-border-width").value/h;d.lineWidth=f,d.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+")",d.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(d.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+")",d.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var h=r.cy.zoom(),p=i.bgActivePosistion;d.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+")",d.beginPath(),d.arc(p.x,p.y,a.core("active-bg-size").pfValue/h,0,2*Math.PI),d.fill()}var m=r.lastRedrawTime;if(r.showFps&&m){m=Math.round(m);var g=Math.round(1e3/m),y="1 frame = "+m+" ms = "+g+" fps";if(d.setTransform(1,0,0,1,0,0),d.fillStyle="rgba(255, 0, 0, 0.75)",d.strokeStyle="rgba(255, 0, 0, 0.75)",d.font="30px Arial",!HR){var v=d.measureText(y);HR=v.actualBoundingBoxAscent}d.fillText(y,0,HR);var b=60;d.strokeRect(0,HR+10,250,20),d.fillRect(0,HR+10,250*Math.min(g/b,1),20)}s||(l[r.SELECT_BOX]=!1)}};Gst=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});Xbr=(function(){function e(t,r,n,i){gx(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),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,r,r),this.scratch=i(t,r,this.texHeight,"scratch")}return yx(e,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,i=r.h,a=this.texHeight,o=this.texSize,s=a/i,l=n*s,u=i*s;return l>o&&(s=o/n,l=n*s,u=i*s),{scale:s,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,l=this.texHeight,u=this.getScale(n),d=u.scale,h=u.texW,f=u.texH,p=function(x,E){if(i&&E){var w=E.context,T=x.x,C=x.row,S=T,R=l*C;w.save(),w.translate(S,R),w.scale(d,d),i(w,n),w.restore()}},m=[null,null],g=function(){p(a.freePointer,a.canvas),m[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:h,h:f},m[1]={x:a.freePointer.x+h,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=h,a.freePointer.x==o&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var x=a.scratch,E=a.canvas;x.clear(),p({x:0,row:0},x);var w=o-a.freePointer.x,T=h-w,C=l;{var S=a.freePointer.x,R=a.freePointer.row*l,U=w;E.context.drawImage(x,0,0,U,C,S,R,U,C),m[0]={x:S,y:R,w:U,h:f}}{var L=w,I=(a.freePointer.row+1)*l,A=T;E&&E.context.drawImage(x,L,0,A,C,0,I,A,C),m[1]={x:0,y:I,w:A,h:f}}a.freePointer.x=T,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+h<=o)g();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(v(),g()):this.enableWrapping?y():(v(),g())}return this.keyToLocation.set(r,m),this.needsBuffer=!0,m}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),o=a.texW;return this.freePointer.x+o>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,o=a===void 0?!1:a,s=i.filterEle,l=s===void 0?function(){return!0}:s,u=i.filterType,d=u===void 0?function(){return!0}:u,h=!1,f=!1,p=Nd(r),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;if(l(g)){var y=Nd(this.renderTypes.values()),v;try{var b=function(){var E=v.value,w=E.type;if(d(w)){var T=n.collections.get(E.collection),C=E.getKey(g),S=Array.isArray(C)?C:[C];if(o)S.forEach(function(I){return T.markKeyForGC(I)}),f=!0;else{var R=E.getID?E.getID(g):g.id(),U=n._key(w,R),L=n.typeAndIdToKey.get(U);L!==void 0&&!Fbr(S,L)&&(h=!0,n.typeAndIdToKey.delete(U),L.forEach(function(I){return T.markKeyForGC(I)}))}}};for(y.s();!(v=y.n()).done;)b()}catch(x){y.e(x)}finally{y.f()}}}}catch(x){p.e(x)}finally{p.f()}return f&&(this.gc(),h=!1),h}},{key:"gc",value:function(){var r=Nd(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var o=this.renderTypes.get(n),s=this.collections.get(o.collection),l=!1,u=s.draw(a,i,function(f){o.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),o.drawElement(f,r,i,!0,!0),f.restore()):o.drawElement(f,r,i,!0,!0),l=!0});if(l){var d=o.getID?o.getID(r):r.id(),h=this._key(n,d);this.typeAndIdToKey.has(h)?this.typeAndIdToKey.get(h).push(a):this.typeAndIdToKey.set(h,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),o=a.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(l){var u=a.getBoundingBox(r,l),d=i.getOrCreateAtlas(r,n,u,l),h=d.getOffsets(l),f=Ms(h,2),p=f[0],m=f[1];return{atlas:d,tex:p,tex1:p,tex2:m,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Nd(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ms(i.value,2),o=a[0],s=a[1],l=s.getCounts(),u=l.keyCount,d=l.atlasCount;r.push({type:o,keyCount:u,atlasCount:d})}}catch(h){n.e(h)}finally{n.f()}return r}}])})(),Qbr=(function(){function e(t){gx(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return yx(e,[{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(r,n){return n})}},{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(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),Jbr=` - float circleSD(vec2 p, float r) { - return distance(vec2(0), p) - r; // signed distance - } -`,e2r=` - float rectangleSD(vec2 p, vec2 b) { - vec2 d = abs(p)-b; - return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); - } -`,t2r=` - float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { - cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; - cr.x = (p.y > 0.0) ? cr.x : cr.y; - vec2 q = abs(p) - b + cr.x; - return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; - } -`,r2r=` - float ellipseSD(vec2 p, vec2 ab) { - p = abs( p ); // symmetry - - // find root with Newton solver - vec2 q = ab*(p-ab); - float w = (q.x1.0) ? d : -d; - } -`,QR={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},qH={IGNORE:1,USE_BB:2},q0e=0,Hst=1,qst=2,Y0e=3,WC=4,wH=5,qR=6,YR=7,n2r=(function(){function e(t,r,n){gx(this,e),this.r=t,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=_br,this.atlasManager=new Zbr(t,n),this.batchManager=new Qbr(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(QR.SCREEN),this.pickingProgram=this._createShaderProgram(QR.PICKING),this.vao=this._createVAO()}return yx(e,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(s){return s===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es - precision highp float; - - uniform mat3 uPanZoomMatrix; - uniform int uAtlasSize; - - // instanced - in vec2 aPosition; // a vertex from the unit square - - in mat3 aTransform; // used to transform verticies, eg into a bounding box - in int aVertType; // the type of thing we are rendering - - // the z-index that is output when using picking mode - in vec4 aIndex; - - // For textures - in int aAtlasId; // which shader unit/atlas to use - in vec4 aTex; // x/y/w/h of texture in atlas - - // for edges - in vec4 aPointAPointB; - in vec4 aPointCPointD; - in vec2 aLineWidth; // also used for node border width - - // simple shapes - in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] - in vec4 aColor; // also used for edges - in vec4 aBorderColor; // aLineWidth is used for border width - - // output values passed to the fragment shader - out vec2 vTexCoord; - out vec4 vColor; - out vec2 vPosition; - // flat values are not interpolated - flat out int vAtlasId; - flat out int vVertType; - flat out vec2 vTopRight; - flat out vec2 vBotLeft; - flat out vec4 vCornerRadius; - flat out vec4 vBorderColor; - flat out vec2 vBorderWidth; - flat out vec4 vIndex; - - void main(void) { - int vid = gl_VertexID; - vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - - if(aVertType == `.concat(q0e,`) { - float texX = aTex.x; // texture coordinates - float texY = aTex.y; - float texW = aTex.z; - float texH = aTex.w; - - if(vid == 1 || vid == 2 || vid == 4) { - texX += texW; - } - if(vid == 2 || vid == 4 || vid == 5) { - texY += texH; - } - - float d = float(uAtlasSize); - vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - } - else if(aVertType == `).concat(WC," || aVertType == ").concat(YR,` - || aVertType == `).concat(wH," || aVertType == ").concat(qR,`) { // simple shapes - - // the bounding box is needed by the fragment shader - vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat - vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat - vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated - - // calculations are done in the fragment shader, just pass these along - vColor = aColor; - vCornerRadius = aCornerRadius; - vBorderColor = aBorderColor; - vBorderWidth = aLineWidth; - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - } - else if(aVertType == `).concat(Hst,`) { - vec2 source = aPointAPointB.xy; - vec2 target = aPointAPointB.zw; - - // adjust the geometry so that the line is centered on the edge - position.y = position.y - 0.5; - - // stretch the unit square into a long skinny rectangle - vec2 xBasis = target - source; - vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); - vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; - - gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); - vColor = aColor; - } - else if(aVertType == `).concat(qst,`) { - vec2 pointA = aPointAPointB.xy; - vec2 pointB = aPointAPointB.zw; - vec2 pointC = aPointCPointD.xy; - vec2 pointD = aPointCPointD.zw; - - // adjust the geometry so that the line is centered on the edge - position.y = position.y - 0.5; - - vec2 p0, p1, p2, pos; - if(position.x == 0.0) { // The left side of the unit square - p0 = pointA; - p1 = pointB; - p2 = pointC; - pos = position; - } else { // The right side of the unit square, use same approach but flip the geometry upside down - p0 = pointD; - p1 = pointC; - p2 = pointB; - pos = vec2(0.0, -position.y); - } - - vec2 p01 = p1 - p0; - vec2 p12 = p2 - p1; - vec2 p21 = p1 - p2; - - // Find the normal vector. - vec2 tangent = normalize(normalize(p12) + normalize(p01)); - vec2 normal = vec2(-tangent.y, tangent.x); - - // Find the vector perpendicular to p0 -> p1. - vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); - - // Determine the bend direction. - float sigma = sign(dot(p01 + p21, normal)); - float width = aLineWidth[0]; - - if(sign(pos.y) == -sigma) { - // This is an intersecting vertex. Adjust the position so that there's no overlap. - vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); - gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); - } else { - // This is a non-intersecting vertex. Treat it like a mitre join. - vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); - gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); - } - - vColor = aColor; - } - else if(aVertType == `).concat(Y0e,` && vid < 3) { - // massage the first triangle into an edge arrow - if(vid == 0) - position = vec2(-0.15, -0.3); - if(vid == 1) - position = vec2( 0.0, 0.0); - if(vid == 2) - position = vec2( 0.15, -0.3); - - gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); - vColor = aColor; - } - else { - gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space - } - - vAtlasId = aAtlasId; - vVertType = aVertType; - vIndex = aIndex; - } - `),a=this.batchManager.getIndexArray(),o=`#version 300 es - precision highp float; - - // declare texture unit for each texture atlas in the batch - `.concat(a.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(` - `),` - - uniform vec4 uBGColor; - uniform float uZoom; - - in vec2 vTexCoord; - in vec4 vColor; - in vec2 vPosition; // model coordinates - - flat in int vAtlasId; - flat in vec4 vIndex; - flat in int vVertType; - flat in vec2 vTopRight; - flat in vec2 vBotLeft; - flat in vec4 vCornerRadius; - flat in vec4 vBorderColor; - flat in vec2 vBorderWidth; - - out vec4 outColor; - - `).concat(Jbr,` - `).concat(e2r,` - `).concat(t2r,` - `).concat(r2r,` - - vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( - top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) - ); - } - - vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance - // scale to the zoom level so that borders don't look blurry when zoomed in - // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); - } - - void main(void) { - if(vVertType == `).concat(q0e,`) { - // look up the texel from the texture unit - `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` - else `),` - } - else if(vVertType == `).concat(Y0e,`) { - // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; - outColor = blend(vColor, uBGColor); - outColor.a = 1.0; // make opaque, masks out line under arrow - } - else if(vVertType == `).concat(WC,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border - outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done - } - else if(vVertType == `).concat(WC," || vVertType == ").concat(YR,` - || vVertType == `).concat(wH," || vVertType == ").concat(qR,`) { // use SDF - - float outerBorder = vBorderWidth[0]; - float innerBorder = vBorderWidth[1]; - float borderPadding = outerBorder * 2.0; - float w = vTopRight.x - vBotLeft.x - borderPadding; - float h = vTopRight.y - vBotLeft.y - borderPadding; - vec2 b = vec2(w/2.0, h/2.0); // half width, half height - vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center - - float d; // signed distance - if(vVertType == `).concat(WC,`) { - d = rectangleSD(p, b); - } else if(vVertType == `).concat(YR,` && w == h) { - d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(YR,`) { - d = ellipseSD(p, b); - } else { - d = roundRectangleSD(p, b, vCornerRadius.wzyx); - } - - // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling - // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box - if(d > 0.0) { - if(d > outerBorder) { - discard; - } else { - outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); - } - } else { - if(d > innerBorder) { - vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; - vec4 innerBorderColor = blend(vBorderColor, vColor); - outColor = distInterp(innerBorderColor, outerColor, d); - } - else { - vec4 outerColor; - if(innerBorder == 0.0 && outerBorder == 0.0) { - outerColor = vec4(0); - } else if(innerBorder == 0.0) { - outerColor = vBorderColor; - } else { - outerColor = blend(vBorderColor, vColor); - } - outColor = distInterp(vColor, outerColor, d - innerBorder); - } - } - } - else { - outColor = vColor; - } - - `).concat(r.picking?`if(outColor.a == 0.0) discard; - else outColor = vIndex;`:"",` - } - `),s=Nbr(n,i,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:QR.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,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(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,o=this.batchManager,s=a.getRenderTypeOpts(i);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(r);if(l===qH.IGNORE)return;if(l==qH.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),d=Nd(u),h;try{for(d.s();!(h=d.n()).done;){var f=h.value,p=f.atlas,m=f.tex1,g=f.tex2;o.canAddToCurrentBatch(p)||this.endBatch();for(var y=o.getAtlasIndexForBatch(p),v=0,b=[[m,!0],[g,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(L){d.e(L)}finally{d.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(i.shapeProps&&i.shapeProps.padding&&(s=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,d=a.tex2,h=u.w/(u.w+d.w);o||(h=1-h);var f=this._getAdjustedBB(l,s,o,h);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),m=this._getAdjustedBB(p,s,!0,1);this._applyTransformMatrix(n,m,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var o,s;Wst(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),d=u.x,h=u.y;LH(r,r,[d,h]),Vst(r,r,l);var f=i.getRotationOffset(a);o=f.x+(n.xOffset||0),s=f.y+(n.yOffset||0)}else o=n.x1,s=n.y1;LH(r,r,[o,s]),hme(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var o=r.x1,s=r.y1,l=r.w,u=r.h,d=r.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var h=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(h=l-f,o+=h,l=f),{x1:o,y1:s,w:l,h:u,xOffset:h,yOffset:d}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=WC;var s=this.indexBuffer.getView(o);GC(n,s);var l=this.colorBuffer.getView(o);V4([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var o=a.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,s===wH||s===qR){var u=a.getBoundingBox(r),d=this._getCornerRadius(r,o.radius,u),h=this.cornerRadiusBuffer.getView(l);h[0]=d,h[1]=d,h[2]=d,h[3]=d,s===qR&&(h[0]=0,h[2]=0)}var f=this.indexBuffer.getView(l);GC(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,m=this.renderTarget.picking?1:r.pstyle(o.opacity).value*p,g=r.pstyle(o.color).value,y=this.colorBuffer.getView(l);V4(g,m,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,o.border){var b=r.pstyle("border-width").value;if(b>0){var x=r.pstyle("border-color").value,E=p*r.pstyle("border-opacity").value,w=this.borderColorBuffer.getView(l);V4(x,E,w);var T=r.pstyle("border-position").value;if(T==="inside")v[0]=0,v[1]=-b;else if(T==="outside")v[0]=b,v[1]=0;else{var C=b/2;v[0]=C,v[1]=-C}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,S,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return WC;case"ellipse":return YR;case"roundrectangle":case"round-rectangle":return wH;case"bottom-round-rectangle":return qR;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,o=i.h;if(r.pstyle(n).value==="auto")return hx(a,o);var s=r.pstyle(n).pfValue,l=a/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,o,s,l;if(i==="source"?(o=a.arrowStartX,s=a.arrowStartY,l=a.srcArrowAngle):(o=a.arrowEndX,s=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var d=r.pstyle(i+"-arrow-color").value,h=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=h*f,m=r.pstyle("width").pfValue,g=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(m,g),v=this.instanceCount,b=this.transformBuffer.getMatrixView(v);Wst(b),LH(b,b,[o,s]),hme(b,b,[y,y]),Vst(b,b,l),this.vertTypeBuffer.getView(v)[0]=Y0e;var x=this.indexBuffer.getView(v);GC(n,x);var E=this.colorBuffer.getView(v);V4(d,p,E),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*o;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=Hst;var h=this.indexBuffer.getView(d);GC(n,h);var f=this.colorBuffer.getView(d);V4(l,u,f);var p=this.lineWidthBuffer.getView(d);p[0]=s;var m=this.pointAPointBBuffer.getView(d);m[0]=i[0],m[1]=i[1],m[2]=i[2],m[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var g=0;g=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var o=a/n;this._setCurvePoint(r,o,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var o=Array(r.length-2),s=0;s0}},s=function(h){var f=h.pstyle("text-events").strValue==="yes";return f?qH.USE_BB:qH.IGNORE},l=function(h){var f=h.position(),p=f.x,m=f.y,g=h.outerWidth(),y=h.outerHeight();return{w:g,h:y,x1:p-g/2,y1:m-y/2}};r.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Bbr,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.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"}}),r.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"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:j0e(t.getLabelKey,null),getBoundingBox:X0e(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:j0e(t.getSourceLabelKey,"source"),getBoundingBox:X0e(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:i("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:j0e(t.getTargetLabelKey,"target"),getBoundingBox:X0e(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:i("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=pM(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(d,h){var f=!1;h&&h.length>0&&(f|=r.drawing.invalidate(h)),f&&u()}),a2r(r)};j0e=function(t,r){return function(n){var i=t(n),a=Lct(n,r);return a.length>1?a.map(function(o,s){return"".concat(i,"_").concat(s)}):i}},X0e=function(t,r){return function(n,i){var a=t(n);if(typeof i=="string"){var o=i.indexOf("_");if(o>0){var s=Number(i.substring(o+1)),l=Lct(n,r),u=a.h/l.length,d=u*s,h=a.y1+d;return{x1:a.x1,w:a.w,y1:h,h:u,yOffset:d}}}return a}};xx={};xx.drawPolygonPath=function(e,t,r,n,i,a){var o=n/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],r+s*a[1]);for(var l=1;l0&&o>0){p.clearRect(0,0,a,o),p.globalCompositeOperation="source-over";var m=this.getCachedZSortedEles();if(e.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,m);else{var g=t.pan(),y={x:g.x*u,y:g.y*u};u*=t.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,m)}p.setTransform(1,0,0,1,0,0),e.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=e.bg,p.fillRect(0,0,a,o))}return f};xM.png=function(e){return Pct(e,this.bufferCanvasImage(e),"image/png")};xM.jpg=function(e){return Pct(e,this.bufferCanvasImage(e),"image/jpeg")};Oct={};Oct.nodeShapeImpl=function(e,t,r,n,i,a,o,s){switch(e){case"ellipse":return this.drawEllipsePath(t,r,n,i,a);case"polygon":return this.drawPolygonPath(t,r,n,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,r,n,i,a,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,r,n,i,a,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,r,n,i,a,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,r,n,i,a,s);case"barrel":return this.drawBarrelPath(t,r,n,i,a)}};m2r=Bct,jn=Bct.prototype;jn.CANVAS_LAYERS=3;jn.SELECT_BOX=0;jn.DRAG=1;jn.NODE=2;jn.WEBGL=3;jn.CANVAS_TYPES=["2d","2d","2d","webgl2"];jn.BUFFER_COUNT=3;jn.TEXTURE_BUFFER=0;jn.MOTIONBLUR_BUFFER_NODE=1;jn.MOTIONBLUR_BUFFER_DRAG=2;jn.redrawHint=function(e,t){var r=this;switch(e){case"eles":r.data.canvasNeedsRedraw[jn.NODE]=t;break;case"drag":r.data.canvasNeedsRedraw[jn.DRAG]=t;break;case"select":r.data.canvasNeedsRedraw[jn.SELECT_BOX]=t;break;case"gc":r.data.gc=!0;break}};g2r=typeof Path2D<"u";jn.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e};jn.usePaths=function(){return g2r&&this.pathsEnabled};jn.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)};jn.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled};jn.makeOffscreenCanvas=function(e,t){var r;if((typeof OffscreenCanvas>"u"?"undefined":sl(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(e,t);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=e,r.height=t}return r};[Sct,Ig,_y,Fme,r3,bx,Du,Mct,xx,xM,Oct].forEach(function(e){Qr(jn,e)});y2r=[{name:"null",impl:dct},{name:"base",impl:Ect},{name:"canvas",impl:m2r}],v2r=[{type:"layout",extensions:Gvr},{type:"renderer",extensions:y2r}],Fct={},zct={};mme=function(){if(arguments.length===2)return Wct.apply(null,arguments);if(arguments.length===3)return Gct.apply(null,arguments);if(arguments.length===4)return x2r.apply(null,arguments);if(arguments.length===5)return b2r.apply(null,arguments);mo("Invalid extension access syntax")};sM.prototype.extension=mme;v2r.forEach(function(e){e.extensions.forEach(function(t){Gct(e.type,t.name,t.impl)})});YH=function(){if(!(this instanceof YH))return new YH;this.length=0},e3=YH.prototype;e3.instanceString=function(){return"stylesheet"};e3.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this};e3.css=function(e,t){var r=this.length-1;if(Vr(e))this[r].properties.push({name:e,value:t});else if(xi(e))for(var n=e,i=Object.keys(n),a=0;a{(function(t,r){typeof wM=="object"&&typeof Wme=="object"?Wme.exports=r():typeof define=="function"&&define.amd?define([],r):typeof wM=="object"?wM.layoutBase=r():t.layoutBase=r()})(wM,function(){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.i=function(n){return n},r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=26)})([(function(e,t,r){"use strict";function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(8),a=r(9);function o(l,u,d){n.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=l,this.target=u}o.prototype=Object.create(n.prototype);for(var s in n)o[s]=n[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(l){if(this.source===l)return this.target;if(this.target===l)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(l,u){for(var d=this.getOtherEnd(l),h=u.getGraphManager().getRoot();;){if(d.getOwner()==u)return d;if(d.getOwner()==h)break;d=d.getOwner().getParent()}return null},o.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),l),this.isOverlapingSourceAndTarget||(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[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,r){"use strict";function n(i){this.vGraphObject=i}e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(10),a=r(13),o=r(0),s=r(16),l=r(4);function u(h,f,p,m){p==null&&m==null&&(m=f),n.call(this,m),h.graphManager!=null&&(h=h.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=m,this.edges=[],this.graphManager=h,p!=null&&f!=null?this.rect=new a(f.x,f.y,p.width,p.height):this.rect=new a}u.prototype=Object.create(n.prototype);for(var d in n)u[d]=n[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(h){this.rect.width=h},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(h){this.rect.height=h},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(h,f){this.rect.x=h.x,this.rect.y=h.y,this.rect.width=f.width,this.rect.height=f.height},u.prototype.setCenter=function(h,f){this.rect.x=h-this.rect.width/2,this.rect.y=f-this.rect.height/2},u.prototype.setLocation=function(h,f){this.rect.x=h,this.rect.y=f},u.prototype.moveBy=function(h,f){this.rect.x+=h,this.rect.y+=f},u.prototype.getEdgeListToNode=function(h){var f=[],p,m=this;return m.edges.forEach(function(g){if(g.target==h){if(g.source!=m)throw"Incorrect edge source!";f.push(g)}}),f},u.prototype.getEdgesBetween=function(h){var f=[],p,m=this;return m.edges.forEach(function(g){if(!(g.source==m||g.target==m))throw"Incorrect edge source and/or target";(g.target==h||g.source==h)&&f.push(g)}),f},u.prototype.getNeighborsList=function(){var h=new Set,f=this;return f.edges.forEach(function(p){if(p.source==f)h.add(p.target);else{if(p.target!=f)throw"Incorrect incidency!";h.add(p.source)}}),h},u.prototype.withChildren=function(){var h=new Set,f,p;if(h.add(this),this.child!=null)for(var m=this.child.getNodes(),g=0;gf&&(this.rect.x-=(this.labelWidth-f)/2,this.setWidth(this.labelWidth)),this.labelHeight>p&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-p)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-p),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(h){var f=this.rect.x;f>o.WORLD_BOUNDARY?f=o.WORLD_BOUNDARY:f<-o.WORLD_BOUNDARY&&(f=-o.WORLD_BOUNDARY);var p=this.rect.y;p>o.WORLD_BOUNDARY?p=o.WORLD_BOUNDARY:p<-o.WORLD_BOUNDARY&&(p=-o.WORLD_BOUNDARY);var m=new l(f,p),g=h.inverseTransformPoint(m);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,r){"use strict";function n(i,a){i==null&&a==null?(this.x=0,this.y=0):(this.x=i,this.y=a)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(i){this.x=i},n.prototype.setY=function(i){this.y=i},n.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(10),a=r(0),o=r(6),s=r(3),l=r(1),u=r(13),d=r(12),h=r(11);function f(m,g,y){n.call(this,y),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=m,g!=null&&g instanceof o?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}f.prototype=Object.create(n.prototype);for(var p in n)f[p]=n[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(m,g,y){if(g==null&&y==null){var v=m;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var b=m;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=y.owner?null:(b.source=g,b.target=y,b.isInterGraph=!1,this.getEdges().push(b),g.edges.push(b),y!=g&&y.edges.push(b),b)}},f.prototype.remove=function(m){var g=m;if(m instanceof s){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=g.edges.slice(),v,b=y.length,x=0;x-1&&T>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(w,1),v.target!=v.source&&v.target.edges.splice(T,1);var E=v.source.owner.getEdges().indexOf(v);if(E==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(E,1)}},f.prototype.updateLeftTop=function(){for(var m=i.MAX_VALUE,g=i.MAX_VALUE,y,v,b,x=this.getNodes(),E=x.length,w=0;wy&&(m=y),g>v&&(g=v)}return m==i.MAX_VALUE?null:(x[0].getParent().paddingLeft!=null?b=x[0].getParent().paddingLeft:b=this.margin,this.left=g-b,this.top=m-b,new d(this.left,this.top))},f.prototype.updateBounds=function(m){for(var g=i.MAX_VALUE,y=-i.MAX_VALUE,v=i.MAX_VALUE,b=-i.MAX_VALUE,x,E,w,T,C,S=this.nodes,R=S.length,U=0;Ux&&(g=x),yw&&(v=w),bx&&(g=x),yw&&(v=w),b=this.nodes.length){var R=0;y.forEach(function(U){U.owner==m&&R++}),R==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,r){"use strict";var n,i=r(1);function a(o){n=r(5),this.layout=o,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var o=this.layout.newGraph(),s=this.layout.newNode(null),l=this.add(o,s);return this.setRootGraph(l),this.rootGraph},a.prototype.add=function(o,s,l,u,d){if(l==null&&u==null&&d==null){if(o==null)throw"Graph is null!";if(s==null)throw"Parent node is null!";if(this.graphs.indexOf(o)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(o),o.parent!=null)throw"Already has a parent!";if(s.child!=null)throw"Already has a child!";return o.parent=s,s.child=o,o}else{d=l,u=s,l=o;var h=u.getOwner(),f=d.getOwner();if(!(h!=null&&h.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(f!=null&&f.getGraphManager()==this))throw"Target not in this graph mgr!";if(h==f)return l.isInterGraph=!1,h.add(l,u,d);if(l.isInterGraph=!0,l.source=u,l.target=d,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},a.prototype.remove=function(o){if(o instanceof n){var s=o;if(s.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(s==this.rootGraph||s.parent!=null&&s.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(s.getEdges());for(var u,d=l.length,h=0;h=o.getRight()?s[0]+=Math.min(o.getX()-a.getX(),a.getRight()-o.getRight()):o.getX()<=a.getX()&&o.getRight()>=a.getRight()&&(s[0]+=Math.min(a.getX()-o.getX(),o.getRight()-a.getRight())),a.getY()<=o.getY()&&a.getBottom()>=o.getBottom()?s[1]+=Math.min(o.getY()-a.getY(),a.getBottom()-o.getBottom()):o.getY()<=a.getY()&&o.getBottom()>=a.getBottom()&&(s[1]+=Math.min(a.getY()-o.getY(),o.getBottom()-a.getBottom()));var d=Math.abs((o.getCenterY()-a.getCenterY())/(o.getCenterX()-a.getCenterX()));o.getCenterY()===a.getCenterY()&&o.getCenterX()===a.getCenterX()&&(d=1);var h=d*s[0],f=s[1]/d;s[0]h)return s[0]=l,s[1]=p,s[2]=d,s[3]=S,!1;if(ud)return s[0]=f,s[1]=u,s[2]=T,s[3]=h,!1;if(ld?(s[0]=g,s[1]=y,I=!0):(s[0]=m,s[1]=p,I=!0):P===M&&(l>d?(s[0]=f,s[1]=p,I=!0):(s[0]=v,s[1]=y,I=!0)),-D===M?d>l?(s[2]=C,s[3]=S,A=!0):(s[2]=T,s[3]=w,A=!0):D===M&&(d>l?(s[2]=E,s[3]=w,A=!0):(s[2]=R,s[3]=S,A=!0)),I&&A)return!1;if(l>d?u>h?(O=this.getCardinalDirection(P,M,4),_=this.getCardinalDirection(D,M,2)):(O=this.getCardinalDirection(-P,M,3),_=this.getCardinalDirection(-D,M,1)):u>h?(O=this.getCardinalDirection(-P,M,1),_=this.getCardinalDirection(-D,M,3)):(O=this.getCardinalDirection(P,M,2),_=this.getCardinalDirection(D,M,4)),!I)switch(O){case 1:F=p,B=l+-x/M,s[0]=B,s[1]=F;break;case 2:B=v,F=u+b*M,s[0]=B,s[1]=F;break;case 3:F=y,B=l+x/M,s[0]=B,s[1]=F;break;case 4:B=g,F=u+-b*M,s[0]=B,s[1]=F;break}if(!A)switch(_){case 1:z=w,G=d+-L/M,s[2]=G,s[3]=z;break;case 2:G=R,z=h+U*M,s[2]=G,s[3]=z;break;case 3:z=S,G=d+L/M,s[2]=G,s[3]=z;break;case 4:G=C,z=h+-U*M,s[2]=G,s[3]=z;break}}return!1},i.getCardinalDirection=function(a,o,s){return a>o?s:1+s%4},i.getIntersection=function(a,o,s,l){if(l==null)return this.getIntersection2(a,o,s);var u=a.x,d=a.y,h=o.x,f=o.y,p=s.x,m=s.y,g=l.x,y=l.y,v=void 0,b=void 0,x=void 0,E=void 0,w=void 0,T=void 0,C=void 0,S=void 0,R=void 0;return x=f-d,w=u-h,C=h*d-u*f,E=y-m,T=p-g,S=g*m-p*y,R=x*T-E*w,R===0?null:(v=(w*S-T*C)/R,b=(E*C-x*S)/R,new n(v,b))},i.angleOfVector=function(a,o,s,l){var u=void 0;return a!==s?(u=Math.atan((l-o)/(s-a)),s0?1:i<0?-1:0},n.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},n.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},e.exports=n}),(function(e,t,r){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,e.exports=n}),(function(e,t,r){"use strict";var n=(function(){function u(d,h){for(var f=0;f"u"?"undefined":n(a);return a==null||o!="object"&&o!="function"},e.exports=i}),(function(e,t,r){"use strict";function n(p){if(Array.isArray(p)){for(var m=0,g=Array(p.length);m0&&m;){for(x.push(w[0]);x.length>0&&m;){var T=x[0];x.splice(0,1),b.add(T);for(var C=T.getEdges(),v=0;v-1&&w.splice(L,1)}b=new Set,E=new Map}}return p},f.prototype.createDummyNodesForBendpoints=function(p){for(var m=[],g=p.source,y=this.graphManager.calcLowestCommonAncestor(p.source,p.target),v=0;v0){for(var y=this.edgeToDummyNodes.get(g),v=0;v=0&&m.splice(S,1);var R=E.getNeighborsList();R.forEach(function(I){if(g.indexOf(I)<0){var A=y.get(I),P=A-1;P==1&&T.push(I),y.set(I,P)}})}g=g.concat(T),(m.length==1||m.length==2)&&(v=!0,b=m[0])}return b},f.prototype.setGraphManager=function(p){this.graphManager=p},e.exports=f}),(function(e,t,r){"use strict";function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},e.exports=n}),(function(e,t,r){"use strict";var n=r(4);function i(a,o){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(a){this.lworldOrgX=a},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(a){this.lworldExtX=a},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(a){this.lworldExtY=a},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},i.prototype.transformX=function(a){var o=0,s=this.lworldExtX;return s!=0&&(o=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/s),o},i.prototype.transformY=function(a){var o=0,s=this.lworldExtY;return s!=0&&(o=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/s),o},i.prototype.inverseTransformX=function(a){var o=0,s=this.ldeviceExtX;return s!=0&&(o=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/s),o},i.prototype.inverseTransformY=function(a){var o=0,s=this.ldeviceExtY;return s!=0&&(o=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/s),o},i.prototype.inverseTransformPoint=function(a){var o=new n(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return o},e.exports=i}),(function(e,t,r){"use strict";function n(h){if(Array.isArray(h)){for(var f=0,p=Array(h.length);fa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(h-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(h>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(h-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var h=this.getAllEdges(),f,p=0;p0&&arguments[0]!==void 0?arguments[0]:!0,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p,m,g,y,v=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&h&&this.updateGrid(),b=new Set,p=0;px||b>x)&&(h.gravitationForceX=-this.gravityConstant*g,h.gravitationForceY=-this.gravityConstant*y)):(x=f.getEstimatedSize()*this.compoundGravityRangeFactor,(v>x||b>x)&&(h.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,h.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},u.prototype.isConverged=function(){var h,f=!1;return this.totalIterations>this.maxIterations/3&&(f=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),h=this.totalDisplacement=v.length||x>=v[0].length)){for(var E=0;Eu}}]),s})();e.exports=o}),(function(e,t,r){"use strict";var n=(function(){function o(s,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,o),this.sequence1=s,this.sequence2=l,this.match_score=u,this.mismatch_penalty=d,this.gap_penalty=h,this.iMax=s.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var f=0;f=0;s--){var l=this.listeners[s];l.event===a&&l.callback===o&&this.listeners.splice(s,1)}},i.emit=function(a,o){for(var s=0;s{(function(t,r){typeof EM=="object"&&typeof Hme=="object"?Hme.exports=r(Vme()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof EM=="object"?EM.coseBase=r(Vme()):t.coseBase=r(t.layoutBase)})(EM,function(e){return(function(t){var r={};function n(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=r,n.i=function(i){return i},n.d=function(i,a,o){n.o(i,a)||Object.defineProperty(i,a,{configurable:!1,enumerable:!0,get:o})},n.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(a,"a",a),a},n.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},n.p="",n(n.s=7)})([(function(t,r){t.exports=e}),(function(t,r,n){"use strict";var i=n(0).FDLayoutConstants;function a(){}for(var o in i)a[o]=i[o];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=a}),(function(t,r,n){"use strict";var i=n(0).FDLayoutEdge;function a(s,l,u){i.call(this,s,l,u)}a.prototype=Object.create(i.prototype);for(var o in i)a[o]=i[o];t.exports=a}),(function(t,r,n){"use strict";var i=n(0).LGraph;function a(s,l,u){i.call(this,s,l,u)}a.prototype=Object.create(i.prototype);for(var o in i)a[o]=i[o];t.exports=a}),(function(t,r,n){"use strict";var i=n(0).LGraphManager;function a(s){i.call(this,s)}a.prototype=Object.create(i.prototype);for(var o in i)a[o]=i[o];t.exports=a}),(function(t,r,n){"use strict";var i=n(0).FDLayoutNode,a=n(0).IMath;function o(l,u,d,h){i.call(this,l,u,d,h)}o.prototype=Object.create(i.prototype);for(var s in i)o[s]=i[s];o.prototype.move=function(){var l=this.graphManager.getLayout();this.displacementX=l.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=l.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementX=l.coolingFactor*l.maxNodeDisplacement*a.sign(this.displacementX)),Math.abs(this.displacementY)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementY=l.coolingFactor*l.maxNodeDisplacement*a.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),l.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},o.prototype.propogateDisplacementToChildren=function(l,u){for(var d=this.getChild().getNodes(),h,f=0;f0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var T=new Set(this.getAllNodes()),C=this.nodesWithGravity.filter(function(S){return T.has(S)});this.graphManager.setAllNodesToApplyGravitation(C),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(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 w=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(R){return w.has(R)});this.graphManager.setAllNodesToApplyGravitation(T),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.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=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var C=!this.isTreeGrowing&&!this.isGrowthFinished,S=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(C,S),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var w=this.graphManager.getAllNodes(),T={},C=0;C1){var I;for(I=0;IS&&(S=Math.floor(L.y)),U=Math.floor(L.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(h.WORLD_CENTER_X-L.x/2,h.WORLD_CENTER_Y-L.y/2))},x.radialLayout=function(w,T,C){var S=Math.max(this.maxDiagonalInTree(w),u.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(T,null,0,359,0,S);var R=v.calculateBounds(w),U=new b;U.setDeviceOrgX(R.getMinX()),U.setDeviceOrgY(R.getMinY()),U.setWorldOrgX(C.x),U.setWorldOrgY(C.y);for(var L=0;L1;){var V=z[0];z.splice(0,1);var $=O.indexOf(V);$>=0&&O.splice($,1),F--,_--}T!=null?G=(O.indexOf(z[0])+1)%F:G=0;for(var Z=Math.abs(S-C)/_,re=G;B!=_;re=++re%F){var Q=O[re].getOtherEnd(w);if(Q!=T){var ge=(C+B*Z)%360,ie=(ge+Z)%360;x.branchRadialLayout(Q,w,ge,ie,R+U,U),B++}}},x.maxDiagonalInTree=function(w){for(var T=g.MIN_VALUE,C=0;CT&&(T=R)}return T},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var w=this,T={};this.memberGroups={},this.idToDummyNode={};for(var C=[],S=this.graphManager.getAllNodes(),R=0;R"u"&&(T[I]=[]),T[I]=T[I].concat(U)}Object.keys(T).forEach(function(A){if(T[A].length>1){var P="DummyCompound_"+A;w.memberGroups[P]=T[A];var D=T[A][0].getParent(),M=new s(w.graphManager);M.id=P,M.paddingLeft=D.paddingLeft||0,M.paddingRight=D.paddingRight||0,M.paddingBottom=D.paddingBottom||0,M.paddingTop=D.paddingTop||0,w.idToDummyNode[P]=M;var O=w.getGraphManager().add(w.newGraph(),M),_=D.getChild();_.add(M);for(var B=0;B=0;w--){var T=this.compoundOrder[w],C=T.id,S=T.paddingLeft,R=T.paddingTop;this.adjustLocations(this.tiledMemberPack[C],T.rect.x,T.rect.y,S,R)}},x.prototype.repopulateZeroDegreeMembers=function(){var w=this,T=this.tiledZeroDegreePack;Object.keys(T).forEach(function(C){var S=w.idToDummyNode[C],R=S.paddingLeft,U=S.paddingTop;w.adjustLocations(T[C],S.rect.x,S.rect.y,R,U)})},x.prototype.getToBeTiled=function(w){var T=w.id;if(this.toBeTiled[T]!=null)return this.toBeTiled[T];var C=w.getChild();if(C==null)return this.toBeTiled[T]=!1,!1;for(var S=C.getNodes(),R=0;R0)return this.toBeTiled[T]=!1,!1;if(U.getChild()==null){this.toBeTiled[U.id]=!1;continue}if(!this.getToBeTiled(U))return this.toBeTiled[T]=!1,!1}return this.toBeTiled[T]=!0,!0},x.prototype.getNodeDegree=function(w){for(var T=w.id,C=w.getEdges(),S=0,R=0;RA&&(A=D.rect.height)}C+=A+w.verticalPadding}},x.prototype.tileCompoundMembers=function(w,T){var C=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(S){var R=T[S];C.tiledMemberPack[S]=C.tileNodes(w[S],R.paddingLeft+R.paddingRight),R.rect.width=C.tiledMemberPack[S].width,R.rect.height=C.tiledMemberPack[S].height})},x.prototype.tileNodes=function(w,T){var C=u.TILING_PADDING_VERTICAL,S=u.TILING_PADDING_HORIZONTAL,R={rows:[],rowWidth:[],rowHeight:[],width:0,height:T,verticalPadding:C,horizontalPadding:S};w.sort(function(I,A){return I.rect.width*I.rect.height>A.rect.width*A.rect.height?-1:I.rect.width*I.rect.height0&&(L+=w.horizontalPadding),w.rowWidth[C]=L,w.width0&&(I+=w.verticalPadding);var A=0;I>w.rowHeight[C]&&(A=w.rowHeight[C],w.rowHeight[C]=I,A=w.rowHeight[C]-A),w.height+=A,w.rows[C].push(T)},x.prototype.getShortestRowIndex=function(w){for(var T=-1,C=Number.MAX_VALUE,S=0;SC&&(T=S,C=w.rowWidth[S]);return T},x.prototype.canAddHorizontal=function(w,T,C){var S=this.getShortestRowIndex(w);if(S<0)return!0;var R=w.rowWidth[S];if(R+w.horizontalPadding+T<=w.width)return!0;var U=0;w.rowHeight[S]0&&(U=C+w.verticalPadding-w.rowHeight[S]);var L;w.width-R>=T+w.horizontalPadding?L=(w.height+U)/(R+T+w.horizontalPadding):L=(w.height+U)/w.width,U=C+w.verticalPadding;var I;return w.widthU&&T!=C){S.splice(-1,1),w.rows[C].push(R),w.rowWidth[T]=w.rowWidth[T]-U,w.rowWidth[C]=w.rowWidth[C]+U,w.width=w.rowWidth[instance.getLongestRowIndex(w)];for(var L=Number.MIN_VALUE,I=0;IL&&(L=S[I].height);T>0&&(L+=w.verticalPadding);var A=w.rowHeight[T]+w.rowHeight[C];w.rowHeight[T]=L,w.rowHeight[C]0)for(var _=R;_<=U;_++)O[0]+=this.grid[_][L-1].length+this.grid[_][L].length-1;if(U0)for(var _=L;_<=I;_++)O[3]+=this.grid[R-1][_].length+this.grid[R][_].length-1;for(var B=g.MAX_VALUE,F,G,z=0;z{(function(t,r){typeof TM=="object"&&typeof Yme=="object"?Yme.exports=r(qme()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof TM=="object"?TM.cytoscapeCoseBilkent=r(qme()):t.cytoscapeCoseBilkent=r(t.coseBase)})(TM,function(e){return(function(t){var r={};function n(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=r,n.i=function(i){return i},n.d=function(i,a,o){n.o(i,a)||Object.defineProperty(i,a,{configurable:!1,enumerable:!0,get:o})},n.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(a,"a",a),a},n.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},n.p="",n(n.s=1)})([(function(t,r){t.exports=e}),(function(t,r,n){"use strict";var i=n(0).layoutBase.LayoutConstants,a=n(0).layoutBase.FDLayoutConstants,o=n(0).CoSEConstants,s=n(0).CoSELayout,l=n(0).CoSENode,u=n(0).layoutBase.PointD,d=n(0).layoutBase.DimensionD,h={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function f(y,v){var b={};for(var x in y)b[x]=y[x];for(var x in v)b[x]=v[x];return b}function p(y){this.options=f(h,y),m(this.options)}var m=function(v){v.nodeRepulsion!=null&&(o.DEFAULT_REPULSION_STRENGTH=a.DEFAULT_REPULSION_STRENGTH=v.nodeRepulsion),v.idealEdgeLength!=null&&(o.DEFAULT_EDGE_LENGTH=a.DEFAULT_EDGE_LENGTH=v.idealEdgeLength),v.edgeElasticity!=null&&(o.DEFAULT_SPRING_STRENGTH=a.DEFAULT_SPRING_STRENGTH=v.edgeElasticity),v.nestingFactor!=null&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(o.DEFAULT_GRAVITY_STRENGTH=a.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(o.MAX_ITERATIONS=a.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=a.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.quality=="draft"?i.QUALITY=0:v.quality=="proof"?i.QUALITY=2:i.QUALITY=1,o.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!v.randomize,o.ANIMATE=a.ANIMATE=i.ANIMATE=v.animate,o.TILE=v.tile,o.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal};p.prototype.run=function(){var y,v,b=this.options,x=this.idToLNode={},E=this.layout=new s,w=this;w.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var T=E.newGraphManager();this.gm=T;var C=this.options.eles.nodes(),S=this.options.eles.edges();this.root=T.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(C),E);for(var R=0;R0){var I;I=b.getGraphManager().add(b.newGraph(),C),this.processChildrenList(I,T,b)}}},p.prototype.stop=function(){return this.stopped=!0,this};var g=function(v){v("layout","cose-bilkent",p)};typeof cytoscape<"u"&&g(cytoscape),t.exports=g})])})});var Qct={};gr(Qct,{render:()=>T2r});function qct(e,t){e.forEach(r=>{let n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),t.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}function Yct(e,t){e.forEach(r=>{let n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),t.add({group:"edges",data:n})})}function jct(e){return new Promise(t=>{let r=xt("body").append("div").attr("id","cy").attr("style","display:none"),n=zf({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),qct(e.nodes,n),Yct(e.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{let o=a.data();return{w:o.width,h:o.height}}});let i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ye.info("Cytoscape ready",a),t(n)})})}function Xct(e){return e.nodes().map(t=>{let r=t.data(),n=t.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}function $ct(e){return e.edges().map(t=>{let r=t.data(),n=t._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}async function Kct(e,t){ye.debug("Starting cose-bilkent layout algorithm");try{Zct(e);let r=await jct(e),n=Xct(r),i=$ct(r);return ye.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ye.error("Error in cose-bilkent layout algorithm:",r),r}}function Zct(e){if(!e)throw new Error("Layout data is required");if(!e.config)throw new Error("Configuration is required in layout data");if(!e.rootNode)throw new Error("Root node is required");if(!e.nodes||!Array.isArray(e.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(e.edges))throw new Error("Edges array is required in layout data");return!0}var Hct,E2r,T2r,Jct=H(()=>{Gr();xr();Gme();Hct=Ue(Vct(),1);_n();zf.use(Hct.default);k(qct,"addNodes");k(Yct,"addEdges");k(jct,"createCytoscapeInstance");k(Xct,"extractPositionedNodes");k($ct,"extractPositionedEdges");k(Kct,"executeCoseBilkentLayout");k(Zct,"validateLayoutData");E2r=k(async(e,t,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:l},{algorithm:u})=>{let d={},h={},f=t.select("g");a(f,e.markers,e.type,e.diagramId);let p=f.insert("g").attr("class","subgraphs"),m=f.insert("g").attr("class","edgePaths"),g=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");s.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(e.nodes.map(async x=>{if(x.isGroup){let E={...x};h[x.id]=E,d[x.id]=E,await r(p,x)}else{let E={...x};d[x.id]=E;let w=await o(y,x,{config:e.config,dir:e.direction||"TB"}),T=w.node().getBBox();E.width=T.width,E.height=T.height,E.domId=w,s.debug(`Node ${x.id} dimensions: ${T.width}x${T.height}`)}})),s.debug("Running cose-bilkent layout algorithm");let v={...e,nodes:e.nodes.map(x=>{let E=d[x.id];return{...x,width:E.width,height:E.height}})},b=await Kct(v,e.config);s.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{let E=d[x.id];E?.domId&&(E.domId.attr("transform",`translate(${x.x}, ${x.y})`),E.x=x.x,E.y=x.y,s.debug(`Positioned node ${E.id} at center (${x.x}, ${x.y})`))}),b.edges.forEach(x=>{let E=e.edges.find(w=>w.id===x.id);E&&(E.points=[{x:x.startX,y:x.startY},{x:x.midX,y:x.midY},{x:x.endX,y:x.endY}])}),s.debug("Inserting and positioning edges"),await Promise.all(e.edges.map(async x=>{let E=await i(g,x),w=d[x.start??""],T=d[x.end??""];if(w&&T){let C=b.edges.find(S=>S.id===x.id);if(C){s.debug("APA01 positionedEdge",C);let S={...x},R=n(m,S,h,e.type,w,T,e.diagramId);l(S,R)}else{let S={...x,points:[{x:w.x||0,y:w.y||0},{x:T.x||0,y:T.y||0}]},R=n(m,S,h,e.type,w,T,e.diagramId);l(S,R)}}})),s.debug("Cose-bilkent rendering completed")},"render"),T2r=E2r});var k2r,kM,jme,C2r,Gf,Rg,_d=H(()=>{Gc();Wc();nl();Vo();Vn();Wr();Gr();xr();k2r={common:Lt,getConfig:Kt,insertCluster:C2,insertEdge:S2,insertEdgeLabel:cg,insertMarkers:tC,insertNode:sg,interpolateToCurve:sW,labelHelper:Ur,log:ye,positionEdgeLabel:eC},kM={},jme=k(e=>{for(let t of e)kM[t.name]=t},"registerLayoutLoaders"),C2r=k(()=>{jme([{name:"dagre",loader:k(async()=>await Promise.resolve().then(()=>(Dnt(),Lnt)),"loader")},{name:"swimlane",loader:k(async()=>await Promise.resolve().then(()=>(xat(),bat)),"loader")},{name:"cose-bilkent",loader:k(async()=>await Promise.resolve().then(()=>(Jct(),Qct)),"loader")}])},"registerDefaultLayoutLoaders");C2r();Gf=k(async(e,t)=>{if(!(e.layoutAlgorithm in kM))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let d of e.nodes){let h=d.domId||d.id;d.domId=`${e.diagramId}-${h}`}let r=kM[e.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:l}=a,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),o){let d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return n.render(e,t,k2r,{algorithm:r.algorithm})},"render"),Rg=k((e="",{fallback:t="dagre"}={})=>{if(e in kM)return e;if(t in kM)return ye.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")});var lS,dq,hq,eut,tut,rut,nut,CM,fq,iut,pq=H(()=>{lS="comm",dq="rule",hq="decl",eut="@media",tut="@import",rut="@supports",nut="@namespace",CM="@keyframes",fq="@layer",iut="@scope"});function mq(e){return e.trim()}function SM(e,t,r){return e.replace(t,r)}function Py(e,t){return e.charCodeAt(t)|0}function Oy(e,t,r){return e.slice(t,r)}function Pd(e){return e.length}function gq(e){return e.length}function cS(e,t){return t.push(e),e}var aut,n3,uS=H(()=>{aut=Math.abs,n3=String.fromCharCode});function vq(e,t,r,n,i,a,o,s){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:yq,column:dS,length:o,return:"",siblings:s}}function sut(){return Ls}function lut(){return Ls=Wf>0?Py(fS,--Wf):0,dS--,Ls===10&&(dS=1,yq--),Ls}function Vf(){return Ls=Wf2||hS(Ls)>3?"":" "}function hut(e,t){for(;--t&&Vf()&&!(Ls<48||Ls>102||Ls>57&&Ls<65||Ls>70&&Ls<97););return bq(e,AM()+(t<6&&By()==32&&Vf()==32))}function Xme(e){for(;Vf();)switch(Ls){case e:return Wf;case 34:case 39:e!==34&&e!==39&&Xme(Ls);break;case 40:e===41&&Xme(e);break;case 92:Vf();break}return Wf}function fut(e,t){for(;Vf()&&e+Ls!==57;)if(e+Ls===84&&By()===47)break;return"/*"+bq(t,Wf-1)+"*"+n3(e===47?e:Vf())}function put(e){for(;!hS(By());)Vf();return bq(e,Wf)}var yq,dS,out,Wf,Ls,fS,$me=H(()=>{uS();yq=1,dS=1,out=0,Wf=0,Ls=0,fS=""});function yut(e){return uut(wq("",null,null,null,[""],e=cut(e),0,[0],e))}function wq(e,t,r,n,i,a,o,s,l){for(var u=0,d=0,h=o,f=0,p=0,m=0,g=1,y=1,v=1,b=0,x=0,E="",w=i,T=a,C=n,S=E;y;)switch(m=x,x=Vf()){case 40:m!=108&&Py(S,h-1)==58?(b++,S+="("):S+=xq(x);break;case 41:b--,S+=")";break;case 34:case 39:case 91:S+=xq(x);break;case 9:case 10:case 13:case 32:if(b>0){S+=n3(x);break}S+=dut(m);break;case 92:S+=hut(AM()-1,7);continue;case 47:switch(By()){case 42:case 47:cS(A2r(fut(Vf(),AM()),t,r,l),l),(hS(m||1)==5||hS(By()||1)==5)&&Pd(S)&&Oy(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*g:s[u++]=Pd(S)*v;case 125*g:case 59:case 0:if(b>0&&x){S+=n3(x);break}switch(x){case 0:case 125:y=0;case 59+d:v==-1&&(S=SM(S,/\f/g,"")),p>0&&(Pd(S)-h||g===0)&&cS(p>32?gut(S+";",n,r,h-1,l):gut(SM(S," ","")+";",n,r,h-2,l),l);break;case 59:S+=";";default:if(cS(C=mut(S,t,r,u,d,i,s,E,w=[],T=[],h,a),a),x===123)if(d===0)wq(S,t,C,C,w,a,h,s,T);else{switch(f){case 99:if(Py(S,3)===110)break;case 108:if(Py(S,2)===97)break;default:d=0;case 100:case 109:case 115:}d?wq(e,C,C,n&&cS(mut(e,C,C,0,0,i,s,E,i,w=[],h,T),T),i,T,h,s,n?w:T):wq(S,C,C,C,[""],T,0,s,T)}}u=d=p=0,g=v=1,E=S="",h=o;break;case 58:h=1+Pd(S),p=m;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&lut()==125)continue}switch(S+=n3(x),x*g){case 38:v=d>0?1:(S+="\f",-1);break;case 44:if(b>0)break;s[u++]=(Pd(S)-1)*v,v=1;break;case 64:By()===45&&(S+=xq(Vf())),f=By(),d=h=Pd(E=S+=put(AM())),x++;break;case 45:m===45&&Pd(S)==2&&(g=0)}}return a}function mut(e,t,r,n,i,a,o,s,l,u,d,h){for(var f=i-1,p=i===0?a:[""],m=gq(p),g=0,y=0,v=0;g0?p[b]+" "+x:SM(x,/&\f/g,p[b])))&&(l[v++]=E);return vq(e,t,r,i===0?dq:s,l,u,d,h)}function A2r(e,t,r,n){return vq(e,t,r,lS,n3(sut()),Oy(e,2,-2),0,n)}function gut(e,t,r,n,i){return vq(e,t,r,hq,Oy(e,0,n),Oy(e,n+1,-1),n,i)}var vut=H(()=>{pq();uS();$me()});var but=H(()=>{});function Eq(e,t){for(var r="",n=0;n{pq();uS()});function Eut(e){var t=gq(e);return function(r,n,i,a){for(var o="",s=0;s{uS()});var kut=H(()=>{pq();uS();vut();but();$me();wut();Tut()});var Kme,i3,Tq,Cut,kq,Cq,Od,Sq,pS,Ph=H(()=>{Wr();xr();Kme=Ue(PI(),1);_n();i3=k((e,t)=>{let r=e.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name&&r.attr("name",t.name),t.rx&&r.attr("rx",t.rx),t.ry&&r.attr("ry",t.ry),t.attrs!==void 0)for(let n in t.attrs)r.attr(n,t.attrs[n]);return t.class&&r.attr("class",t.class),r},"drawRect"),Tq=k((e,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};i3(e,r).lower()},"drawBackgroundRect"),Cut=k((e,t)=>{let r=t.text.replace(j5," "),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.attr("class","legend"),n.style("text-anchor",t.anchor),t.class&&n.attr("class",t.class);let i=n.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),n},"drawText"),kq=k((e,t,r,n)=>{let i=e.append("image");i.attr("x",t),i.attr("y",r);let a=(0,Kme.sanitizeUrl)(n);i.attr("xlink:href",a)},"drawImage"),Cq=k((e,t,r,n)=>{let i=e.append("use");i.attr("x",t),i.attr("y",r);let a=(0,Kme.sanitizeUrl)(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Od=k(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Sq=k(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),pS=k(()=>{let e=xt(".mermaidTooltip");return e.empty()&&(e=xt("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),e},"createTooltip")});var Gut={};gr(Gut,{diagram:()=>Mxr});function Ex(e,t,r,n,i){let a=t[e];if(!a.width)if(r)a.text=v4(a.text,i,n),a.textLines=a.text.split(Lt.lineBreakRegex).length,a.width=i,a.height=qI(a.text,n);else{let o=a.text.split(Lt.lineBreakRegex);a.textLines=o.length;let s=0;a.height=0,a.width=0;for(let l of o)a.width=Math.max(zc(l,n),a.width),s=qI(l,n),a.height=a.height+s}return a}async function nge(e,t,r,n,i){let a=i.db,o=new But(i);o.data.widthLimit=r.data.widthLimit/Math.min(Jme,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let d=l.wrap&&Kr.wrap,h=Aq(Kr);h.fontSize=h.fontSize+2,h.fontWeight="bold";let f=Ex("label",l,d,h,o.data.widthLimit);if(f.Y=u+8,u=f.Y+f.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let y=Aq(Kr),v=Ex("type",l,d,y,o.data.widthLimit);v.Y=u+5,u=v.Y+v.height}if(l.descr&&l.descr.text!==""){let y=Aq(Kr);y.fontSize=y.fontSize-2;let v=Ex("descr",l,d,y,o.data.widthLimit);v.Y=u+20,u=v.Y+v.height}if(s==0||s%Jme===0){let y=r.data.startx+Kr.diagramMarginX,v=r.data.stopy+Kr.diagramMarginY+u;o.setData(y,y,v,v)}else{let y=o.data.stopx!==o.data.startx?o.data.stopx+Kr.diagramMarginX:o.data.startx,v=o.data.starty;o.setData(y,y,v,v)}o.name=l.alias;let p=a.getC4ShapeArray(l.alias),m=a.getC4ShapeKeys(l.alias);m.length>0&&await zut(o,e,p,m),t=l.alias;let g=a.getBoundaries(t);g.length>0&&await nge(e,t,o,g,i),l.alias!=="global"&&Fut(e,l,o),r.data.stopy=Math.max(o.data.stopy+Kr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(o.data.stopx+Kr.c4ShapeMargin,r.data.stopx),IM=Math.max(IM,r.data.stopx),RM=Math.max(RM,r.data.stopy)}}var Uq,U2r,Rut,a3,Mut,k0,wx,Nu,T0,Mg,MM,tge,rge,Iq,Rq,Lut,I2r,R2r,M2r,L2r,D2r,N2r,_2r,P2r,O2r,B2r,F2r,z2r,G2r,W2r,V2r,H2r,q2r,Dut,Y2r,j2r,Nut,X2r,$2r,K2r,Z2r,Tx,Q2r,J2r,exr,txr,rxr,Qme,_ut,nxr,ixr,axr,oxr,sxr,lxr,cxr,uxr,dxr,UM,Fy,hxr,fxr,pxr,mxr,Zme,gxr,yxr,vxr,bxr,xxr,Put,wxr,Sut,Exr,Aut,IM,RM,Out,Jme,Kr,But,ege,Aq,Txr,Fut,zut,kxr,Uut,Cxr,Sxr,Axr,Iut,Uxr,Ixr,Rxr,Mxr,Wut=H(()=>{Ph();Vo();Us();ds();us();Vn();Wr();Gr();xr();_n();Uq=(function(){var e=k(function(he,de,me,ke){for(me=me||{},ke=he.length;ke--;me[he[ke]]=de);return me},"o"),t=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],d=[1,67],h=[1,68],f=[1,69],p=[1,29],m=[1,30],g=[1,31],y=[1,32],v=[1,33],b=[1,34],x=[1,35],E=[1,36],w=[1,37],T=[1,38],C=[1,39],S=[1,40],R=[1,41],U=[1,42],L=[1,43],I=[1,44],A=[1,45],P=[1,46],D=[1,47],M=[1,48],O=[1,50],_=[1,51],B=[1,52],F=[1,53],G=[1,54],z=[1,55],V=[1,56],$=[1,57],Z=[1,58],re=[1,59],Q=[1,60],ge=[14,42],ie=[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],pe=[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],ue=[1,82],fe=[1,83],Me=[1,84],Ce=[1,85],Ye=[12,14,42],Ze=[12,14,33,42],Qe=[12,14,33,42,76,77,79,80],ve=[12,33],Fe=[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],Le={trace:k(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:k(function(de,me,ke,le,W,X,q){var j=X.length-1;switch(W){case 3:le.setDirection("TB");break;case 4:le.setDirection("BT");break;case 5:le.setDirection("RL");break;case 6:le.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:le.setC4Type(X[j-3]);break;case 19:le.setTitle(X[j].substring(6)),this.$=X[j].substring(6);break;case 20:le.setAccDescription(X[j].substring(15)),this.$=X[j].substring(15);break;case 21:this.$=X[j].trim(),le.setTitle(this.$);break;case 22:case 23:this.$=X[j].trim(),le.setAccDescription(this.$);break;case 28:X[j].splice(2,0,"ENTERPRISE"),le.addPersonOrSystemBoundary(...X[j]),this.$=X[j];break;case 29:X[j].splice(2,0,"SYSTEM"),le.addPersonOrSystemBoundary(...X[j]),this.$=X[j];break;case 30:le.addPersonOrSystemBoundary(...X[j]),this.$=X[j];break;case 31:X[j].splice(2,0,"CONTAINER"),le.addContainerBoundary(...X[j]),this.$=X[j];break;case 32:le.addDeploymentNode("node",...X[j]),this.$=X[j];break;case 33:le.addDeploymentNode("nodeL",...X[j]),this.$=X[j];break;case 34:le.addDeploymentNode("nodeR",...X[j]),this.$=X[j];break;case 35:le.popBoundaryParseStack();break;case 39:le.addPersonOrSystem("person",...X[j]),this.$=X[j];break;case 40:le.addPersonOrSystem("external_person",...X[j]),this.$=X[j];break;case 41:le.addPersonOrSystem("system",...X[j]),this.$=X[j];break;case 42:le.addPersonOrSystem("system_db",...X[j]),this.$=X[j];break;case 43:le.addPersonOrSystem("system_queue",...X[j]),this.$=X[j];break;case 44:le.addPersonOrSystem("external_system",...X[j]),this.$=X[j];break;case 45:le.addPersonOrSystem("external_system_db",...X[j]),this.$=X[j];break;case 46:le.addPersonOrSystem("external_system_queue",...X[j]),this.$=X[j];break;case 47:le.addContainer("container",...X[j]),this.$=X[j];break;case 48:le.addContainer("container_db",...X[j]),this.$=X[j];break;case 49:le.addContainer("container_queue",...X[j]),this.$=X[j];break;case 50:le.addContainer("external_container",...X[j]),this.$=X[j];break;case 51:le.addContainer("external_container_db",...X[j]),this.$=X[j];break;case 52:le.addContainer("external_container_queue",...X[j]),this.$=X[j];break;case 53:le.addComponent("component",...X[j]),this.$=X[j];break;case 54:le.addComponent("component_db",...X[j]),this.$=X[j];break;case 55:le.addComponent("component_queue",...X[j]),this.$=X[j];break;case 56:le.addComponent("external_component",...X[j]),this.$=X[j];break;case 57:le.addComponent("external_component_db",...X[j]),this.$=X[j];break;case 58:le.addComponent("external_component_queue",...X[j]),this.$=X[j];break;case 60:le.addRel("rel",...X[j]),this.$=X[j];break;case 61:le.addRel("birel",...X[j]),this.$=X[j];break;case 62:le.addRel("rel_u",...X[j]),this.$=X[j];break;case 63:le.addRel("rel_d",...X[j]),this.$=X[j];break;case 64:le.addRel("rel_l",...X[j]),this.$=X[j];break;case 65:le.addRel("rel_r",...X[j]),this.$=X[j];break;case 66:le.addRel("rel_b",...X[j]),this.$=X[j];break;case 67:X[j].splice(0,1),le.addRel("rel",...X[j]),this.$=X[j];break;case 68:le.updateElStyle("update_el_style",...X[j]),this.$=X[j];break;case 69:le.updateRelStyle("update_rel_style",...X[j]),this.$=X[j];break;case 70:le.updateLayoutConfig("update_layout_config",...X[j]),this.$=X[j];break;case 71:this.$=[X[j]];break;case 72:X[j].unshift(X[j-1]),this.$=X[j];break;case 73:case 75:this.$=X[j].trim();break;case 74:let se={};se[X[j-1].trim()]=X[j].trim(),this.$=se;break;case 76:this.$="";break}},"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:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{13:70,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{13:71,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{13:72,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{13:73,19:20,20:21,21:22,22:t,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{14:[1,74]},e(ge,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q}),e(ge,[2,14]),e(ie,[2,16],{12:[1,76]}),e(ge,[2,36],{12:[1,77]}),e(pe,[2,19]),e(pe,[2,20]),{25:[1,78]},{27:[1,79]},e(pe,[2,23]),{35:80,75:81,76:ue,77:fe,79:Me,80:Ce},{35:86,75:81,76:ue,77:fe,79:Me,80:Ce},{35:87,75:81,76:ue,77:fe,79:Me,80:Ce},{35:88,75:81,76:ue,77:fe,79:Me,80:Ce},{35:89,75:81,76:ue,77:fe,79:Me,80:Ce},{35:90,75:81,76:ue,77:fe,79:Me,80:Ce},{35:91,75:81,76:ue,77:fe,79:Me,80:Ce},{35:92,75:81,76:ue,77:fe,79:Me,80:Ce},{35:93,75:81,76:ue,77:fe,79:Me,80:Ce},{35:94,75:81,76:ue,77:fe,79:Me,80:Ce},{35:95,75:81,76:ue,77:fe,79:Me,80:Ce},{35:96,75:81,76:ue,77:fe,79:Me,80:Ce},{35:97,75:81,76:ue,77:fe,79:Me,80:Ce},{35:98,75:81,76:ue,77:fe,79:Me,80:Ce},{35:99,75:81,76:ue,77:fe,79:Me,80:Ce},{35:100,75:81,76:ue,77:fe,79:Me,80:Ce},{35:101,75:81,76:ue,77:fe,79:Me,80:Ce},{35:102,75:81,76:ue,77:fe,79:Me,80:Ce},{35:103,75:81,76:ue,77:fe,79:Me,80:Ce},{35:104,75:81,76:ue,77:fe,79:Me,80:Ce},e(Ye,[2,59]),{35:105,75:81,76:ue,77:fe,79:Me,80:Ce},{35:106,75:81,76:ue,77:fe,79:Me,80:Ce},{35:107,75:81,76:ue,77:fe,79:Me,80:Ce},{35:108,75:81,76:ue,77:fe,79:Me,80:Ce},{35:109,75:81,76:ue,77:fe,79:Me,80:Ce},{35:110,75:81,76:ue,77:fe,79:Me,80:Ce},{35:111,75:81,76:ue,77:fe,79:Me,80:Ce},{35:112,75:81,76:ue,77:fe,79:Me,80:Ce},{35:113,75:81,76:ue,77:fe,79:Me,80:Ce},{35:114,75:81,76:ue,77:fe,79:Me,80:Ce},{35:115,75:81,76:ue,77:fe,79:Me,80:Ce},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q},{12:[1,118],33:[1,117]},{35:119,75:81,76:ue,77:fe,79:Me,80:Ce},{35:120,75:81,76:ue,77:fe,79:Me,80:Ce},{35:121,75:81,76:ue,77:fe,79:Me,80:Ce},{35:122,75:81,76:ue,77:fe,79:Me,80:Ce},{35:123,75:81,76:ue,77:fe,79:Me,80:Ce},{35:124,75:81,76:ue,77:fe,79:Me,80:Ce},{35:125,75:81,76:ue,77:fe,79:Me,80:Ce},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(ge,[2,15]),e(ie,[2,17],{21:22,19:130,22:t,23:r,24:n,26:i,28:a}),e(ge,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:r,24:n,26:i,28:a,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:m,46:g,47:y,48:v,49:b,50:x,51:E,52:w,53:T,54:C,55:S,56:R,57:U,58:L,59:I,60:A,61:P,62:D,63:M,64:O,65:_,66:B,67:F,68:G,69:z,70:V,71:$,72:Z,73:re,74:Q}),e(pe,[2,21]),e(pe,[2,22]),e(Ye,[2,39]),e(Ze,[2,71],{75:81,35:132,76:ue,77:fe,79:Me,80:Ce}),e(Qe,[2,73]),{78:[1,133]},e(Qe,[2,75]),e(Qe,[2,76]),e(Ye,[2,40]),e(Ye,[2,41]),e(Ye,[2,42]),e(Ye,[2,43]),e(Ye,[2,44]),e(Ye,[2,45]),e(Ye,[2,46]),e(Ye,[2,47]),e(Ye,[2,48]),e(Ye,[2,49]),e(Ye,[2,50]),e(Ye,[2,51]),e(Ye,[2,52]),e(Ye,[2,53]),e(Ye,[2,54]),e(Ye,[2,55]),e(Ye,[2,56]),e(Ye,[2,57]),e(Ye,[2,58]),e(Ye,[2,60]),e(Ye,[2,61]),e(Ye,[2,62]),e(Ye,[2,63]),e(Ye,[2,64]),e(Ye,[2,65]),e(Ye,[2,66]),e(Ye,[2,67]),e(Ye,[2,68]),e(Ye,[2,69]),e(Ye,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(ve,[2,28]),e(ve,[2,29]),e(ve,[2,30]),e(ve,[2,31]),e(ve,[2,32]),e(ve,[2,33]),e(ve,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(ie,[2,18]),e(ge,[2,38]),e(Ze,[2,72]),e(Qe,[2,74]),e(Ye,[2,24]),e(Ye,[2,35]),e(Fe,[2,25]),e(Fe,[2,26],{12:[1,138]}),e(Fe,[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:k(function(de,me){if(me.recoverable)this.trace(de);else{var ke=new Error(de);throw ke.hash=me,ke}},"parseError"),parse:k(function(de){var me=this,ke=[0],le=[],W=[null],X=[],q=this.table,j="",se=0,J=0,K=0,ee=2,Se=1,Te=X.slice.call(arguments,1),Ae=Object.create(this.lexer),Ie={yy:{}};for(var Ge in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ge)&&(Ie.yy[Ge]=this.yy[Ge]);Ae.setInput(de,Ie.yy),Ie.yy.lexer=Ae,Ie.yy.parser=this,typeof Ae.yylloc>"u"&&(Ae.yylloc={});var De=Ae.yylloc;X.push(De);var He=Ae.options&&Ae.options.ranges;typeof Ie.yy.parseError=="function"?this.parseError=Ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ze(ct){ke.length=ke.length-2*ct,W.length=W.length-ct,X.length=X.length-ct}k(ze,"popStack");function Ke(){var ct;return ct=le.pop()||Ae.lex()||Se,typeof ct!="number"&&(ct instanceof Array&&(le=ct,ct=le.pop()),ct=me.symbols_[ct]||ct),ct}k(Ke,"lex");for(var we,bt,Ve,vt,Pt,Xt,It={},Ot,Et,Ee,gt;;){if(Ve=ke[ke.length-1],this.defaultActions[Ve]?vt=this.defaultActions[Ve]:((we===null||typeof we>"u")&&(we=Ke()),vt=q[Ve]&&q[Ve][we]),typeof vt>"u"||!vt.length||!vt[0]){var Ut="";gt=[];for(Ot in q[Ve])this.terminals_[Ot]&&Ot>ee&>.push("'"+this.terminals_[Ot]+"'");Ae.showPosition?Ut="Parse error on line "+(se+1)+`: -`+Ae.showPosition()+` -Expecting `+gt.join(", ")+", got '"+(this.terminals_[we]||we)+"'":Ut="Parse error on line "+(se+1)+": Unexpected "+(we==Se?"end of input":"'"+(this.terminals_[we]||we)+"'"),this.parseError(Ut,{text:Ae.match,token:this.terminals_[we]||we,line:Ae.yylineno,loc:De,expected:gt})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ve+", token: "+we);switch(vt[0]){case 1:ke.push(we),W.push(Ae.yytext),X.push(Ae.yylloc),ke.push(vt[1]),we=null,bt?(we=bt,bt=null):(J=Ae.yyleng,j=Ae.yytext,se=Ae.yylineno,De=Ae.yylloc,K>0&&K--);break;case 2:if(Et=this.productions_[vt[1]][1],It.$=W[W.length-Et],It._$={first_line:X[X.length-(Et||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(Et||1)].first_column,last_column:X[X.length-1].last_column},He&&(It._$.range=[X[X.length-(Et||1)].range[0],X[X.length-1].range[1]]),Xt=this.performAction.apply(It,[j,J,se,Ie.yy,vt[1],W,X].concat(Te)),typeof Xt<"u")return Xt;Et&&(ke=ke.slice(0,-1*Et*2),W=W.slice(0,-1*Et),X=X.slice(0,-1*Et)),ke.push(this.productions_[vt[1]][0]),W.push(It.$),X.push(It._$),Ee=q[ke[ke.length-2]][ke[ke.length-1]],ke.push(Ee);break;case 3:return!0}}return!0},"parse")},Be=(function(){var he={EOF:1,parseError:k(function(me,ke){if(this.yy.parser)this.yy.parser.parseError(me,ke);else throw new Error(me)},"parseError"),setInput:k(function(de,me){return this.yy=me||this.yy||{},this._input=de,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var de=this._input[0];this.yytext+=de,this.yyleng++,this.offset++,this.match+=de,this.matched+=de;var me=de.match(/(?:\r\n?|\n).*/g);return me?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),de},"input"),unput:k(function(de){var me=de.length,ke=de.split(/(?:\r\n?|\n)/g);this._input=de+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-me),this.offset-=me;var le=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),ke.length-1&&(this.yylineno-=ke.length-1);var W=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:ke?(ke.length===le.length?this.yylloc.first_column:0)+le[le.length-ke.length].length-ke[0].length:this.yylloc.first_column-me},this.options.ranges&&(this.yylloc.range=[W[0],W[0]+this.yyleng-me]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(de){this.unput(this.match.slice(de))},"less"),pastInput:k(function(){var de=this.matched.substr(0,this.matched.length-this.match.length);return(de.length>20?"...":"")+de.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var de=this.match;return de.length<20&&(de+=this._input.substr(0,20-de.length)),(de.substr(0,20)+(de.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var de=this.pastInput(),me=new Array(de.length+1).join("-");return de+this.upcomingInput()+` -`+me+"^"},"showPosition"),test_match:k(function(de,me){var ke,le,W;if(this.options.backtrack_lexer&&(W={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&&(W.yylloc.range=this.yylloc.range.slice(0))),le=de[0].match(/(?:\r\n?|\n).*/g),le&&(this.yylineno+=le.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:le?le[le.length-1].length-le[le.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+de[0].length},this.yytext+=de[0],this.match+=de[0],this.matches=de,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(de[0].length),this.matched+=de[0],ke=this.performAction.call(this,this.yy,this,me,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ke)return ke;if(this._backtrack){for(var X in W)this[X]=W[X];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var de,me,ke,le;this._more||(this.yytext="",this.match="");for(var W=this._currentRules(),X=0;Xme[0].length)){if(me=ke,le=X,this.options.backtrack_lexer){if(de=this.test_match(ke,W[X]),de!==!1)return de;if(this._backtrack){me=!1;continue}else return!1}else if(!this.options.flex)break}return me?(de=this.test_match(me,W[le]),de!==!1?de:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var me=this.next();return me||this.lex()},"lex"),begin:k(function(me){this.conditionStack.push(me)},"begin"),popState:k(function(){var me=this.conditionStack.length-1;return me>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(me){return me=this.conditionStack.length-1-Math.abs(me||0),me>=0?this.conditionStack[me]:"INITIAL"},"topState"),pushState:k(function(me){this.begin(me)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(me,ke,le,W){var X=W;switch(le){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;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),26;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;break;case 23:return this.begin("person"),44;break;case 24:return this.begin("system_ext_queue"),51;break;case 25:return this.begin("system_ext_db"),50;break;case 26:return this.begin("system_ext"),49;break;case 27:return this.begin("system_queue"),48;break;case 28:return this.begin("system_db"),47;break;case 29:return this.begin("system"),46;break;case 30:return this.begin("boundary"),37;break;case 31:return this.begin("enterprise_boundary"),34;break;case 32:return this.begin("system_boundary"),36;break;case 33:return this.begin("container_ext_queue"),57;break;case 34:return this.begin("container_ext_db"),56;break;case 35:return this.begin("container_ext"),55;break;case 36:return this.begin("container_queue"),54;break;case 37:return this.begin("container_db"),53;break;case 38:return this.begin("container"),52;break;case 39:return this.begin("container_boundary"),38;break;case 40:return this.begin("component_ext_queue"),63;break;case 41:return this.begin("component_ext_db"),62;break;case 42:return this.begin("component_ext"),61;break;case 43:return this.begin("component_queue"),60;break;case 44:return this.begin("component_db"),59;break;case 45:return this.begin("component"),58;break;case 46:return this.begin("node"),39;break;case 47:return this.begin("node"),39;break;case 48:return this.begin("node_l"),40;break;case 49:return this.begin("node_r"),41;break;case 50:return this.begin("rel"),64;break;case 51:return this.begin("birel"),65;break;case 52:return this.begin("rel_u"),66;break;case 53:return this.begin("rel_u"),66;break;case 54:return this.begin("rel_d"),67;break;case 55:return this.begin("rel_d"),67;break;case 56:return this.begin("rel_l"),68;break;case 57:return this.begin("rel_l"),68;break;case 58:return this.begin("rel_r"),69;break;case 59:return this.begin("rel_r"),69;break;case 60:return this.begin("rel_b"),70;break;case 61:return this.begin("rel_index"),71;break;case 62:return this.begin("update_el_style"),72;break;case 63:return this.begin("update_rel_style"),73;break;case 64:return this.begin("update_layout_config"),74;break;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";break;case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";break;case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\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:[65,66,67,68],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 he})();Le.lexer=Be;function ae(){this.yy={}}return k(ae,"Parser"),ae.prototype=Le,Le.Parser=ae,new ae})();Uq.parser=Uq;U2r=Uq,Rut=k(e=>je()[e],"getRequiredConfig"),a3=k((e,t)=>{for(let[r,n]of Object.entries(t))if(n!==void 0)if(typeof n=="object"){let[i,a]=Object.entries(n)[0];e[i]=a}else e[r]=n},"assignAttributes"),Mut=k(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),k0=[],wx=[""],Nu="global",T0="",Mg=[Mut()],MM=[],tge="",rge=!1,Iq=4,Rq=2,I2r=k(function(){return Lut},"getC4Type"),R2r=k(function(e){Lut=rn(e,je())},"setC4Type"),M2r=k(function(e,t,r,n,i,a,o,s,l){if(e==null||t===void 0||t===null||r===void 0||r===null||n===void 0||n===null)return;let u={},d=MM.find(h=>h.from===t&&h.to===r);if(d?u=d:MM.push(u),u.type=e,u.from=t,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[h,f]=Object.entries(i)[0];u[h]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[h,f]=Object.entries(a)[0];u[h]={text:f}}else u.descr={text:a};a3(u,{sprite:o,tags:s,link:l}),u.wrap=Tx()},"addRel"),L2r=k(function(e,t,r,n,i,a,o){if(t===null||r===null)return;let s={},l=k0.find(u=>u.alias===t);if(l&&t===l.alias?s=l:(s.alias=t,k0.push(s)),r==null?s.label={text:""}:s.label={text:r},n==null)s.descr={text:""};else if(typeof n=="object"){let[u,d]=Object.entries(n)[0];s[u]={text:d}}else s.descr={text:n};a3(s,{sprite:i,tags:a,link:o}),s.typeC4Shape={text:e},s.parentBoundary=Nu,s.wrap=Tx()},"addPersonOrSystem"),D2r=k(function(e,t,r,n,i,a,o,s){if(t===null||r===null)return;let l={},u=k0.find(d=>d.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,k0.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[d,h]=Object.entries(n)[0];l[d]={text:h}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[d,h]=Object.entries(i)[0];l[d]={text:h}}else l.descr={text:i};a3(l,{sprite:a,tags:o,link:s}),l.wrap=Tx(),l.typeC4Shape={text:e},l.parentBoundary=Nu},"addContainer"),N2r=k(function(e,t,r,n,i,a,o,s){if(t===null||r===null)return;let l={},u=k0.find(d=>d.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,k0.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[d,h]=Object.entries(n)[0];l[d]={text:h}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[d,h]=Object.entries(i)[0];l[d]={text:h}}else l.descr={text:i};a3(l,{sprite:a,tags:o,link:s}),l.wrap=Tx(),l.typeC4Shape={text:e},l.parentBoundary=Nu},"addComponent"),_2r=k(function(e,t,r,n,i){if(e===null||t===null)return;let a={},o=Mg.find(s=>s.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Mg.push(a)),t==null?a.label={text:""}:a.label={text:t},r==null)a.type={text:"system"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};a3(a,{tags:n,link:i}),a.parentBoundary=Nu,a.wrap=Tx(),T0=Nu,Nu=e,wx.push(T0)},"addPersonOrSystemBoundary"),P2r=k(function(e,t,r,n,i){if(e===null||t===null)return;let a={},o=Mg.find(s=>s.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,Mg.push(a)),t==null?a.label={text:""}:a.label={text:t},r==null)a.type={text:"container"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};a3(a,{tags:n,link:i}),a.parentBoundary=Nu,a.wrap=Tx(),T0=Nu,Nu=e,wx.push(T0)},"addContainerBoundary"),O2r=k(function(e,t,r,n,i,a,o,s){if(t===null||r===null)return;let l={},u=Mg.find(d=>d.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,Mg.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[d,h]=Object.entries(n)[0];l[d]={text:h}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[d,h]=Object.entries(i)[0];l[d]={text:h}}else l.descr={text:i};a3(l,{tags:o,link:s}),l.nodeType=e,l.parentBoundary=Nu,l.wrap=Tx(),T0=Nu,Nu=t,wx.push(T0)},"addDeploymentNode"),B2r=k(function(){Nu=T0,wx.pop(),T0=wx.pop(),wx.push(T0)},"popBoundaryParseStack"),F2r=k(function(e,t,r,n,i,a,o,s,l,u,d){let h=k0.find(f=>f.alias===t);if(!(h===void 0&&(h=Mg.find(f=>f.alias===t),h===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];h[f]=p}else h.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];h[f]=p}else h.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];h[f]=p}else h.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];h[f]=p}else h.shadowing=a;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];h[f]=p}else h.shape=o;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];h[f]=p}else h.sprite=s;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];h[f]=p}else h.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];h[f]=p}else h.legendText=u;if(d!=null)if(typeof d=="object"){let[f,p]=Object.entries(d)[0];h[f]=p}else h.legendSprite=d}},"updateElStyle"),z2r=k(function(e,t,r,n,i,a,o){let s=MM.find(l=>l.from===t&&l.to===r);if(s!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];s[l]=u}else s.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];s[l]=u}else s.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];s[l]=parseInt(u)}else s.offsetX=parseInt(a);if(o!=null)if(typeof o=="object"){let[l,u]=Object.entries(o)[0];s[l]=parseInt(u)}else s.offsetY=parseInt(o)}},"updateRelStyle"),G2r=k(function(e,t,r){let n=Iq,i=Rq;if(typeof t=="object"){let a=Object.values(t)[0];n=parseInt(a)}else n=parseInt(t);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(Iq=n),i>=1&&(Rq=i)},"updateLayoutConfig"),W2r=k(function(){return Iq},"getC4ShapeInRow"),V2r=k(function(){return Rq},"getC4BoundaryInRow"),H2r=k(function(){return Nu},"getCurrentBoundaryParse"),q2r=k(function(){return T0},"getParentBoundaryParse"),Dut=k(function(e){return e==null?k0:k0.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),Y2r=k(function(e){return k0.find(t=>t.alias===e)},"getC4Shape"),j2r=k(function(e){return Object.keys(Dut(e))},"getC4ShapeKeys"),Nut=k(function(e){return e==null?Mg:Mg.filter(t=>t.parentBoundary===e)},"getBoundaries"),X2r=Nut,$2r=k(function(){return MM},"getRels"),K2r=k(function(){return tge},"getTitle"),Z2r=k(function(e){rge=e},"setWrap"),Tx=k(function(){return rge},"autoWrap"),Q2r=k(function(){k0=[],Mg=[Mut()],T0="",Nu="global",wx=[""],MM=[],wx=[""],tge="",rge=!1,Iq=4,Rq=2},"clear"),J2r={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},exr={FILLED:0,OPEN:1},txr={LEFTOF:0,RIGHTOF:1,OVER:2},rxr=k(function(e){tge=rn(e,je())},"setTitle"),Qme={addPersonOrSystem:L2r,addPersonOrSystemBoundary:_2r,addContainer:D2r,addContainerBoundary:P2r,addComponent:N2r,addDeploymentNode:O2r,popBoundaryParseStack:B2r,addRel:M2r,updateElStyle:F2r,updateRelStyle:z2r,updateLayoutConfig:G2r,autoWrap:Tx,setWrap:Z2r,getC4ShapeArray:Dut,getC4Shape:Y2r,getC4ShapeKeys:j2r,getBoundaries:Nut,getBoundarys:X2r,getCurrentBoundaryParse:H2r,getParentBoundaryParse:q2r,getRels:$2r,getTitle:K2r,getC4Type:I2r,getC4ShapeInRow:W2r,getC4BoundaryInRow:V2r,setAccTitle:sn,getAccTitle:pn,getAccDescription:gn,setAccDescription:mn,getConfig:k(()=>Rut("c4"),"getConfig"),clear:Q2r,LINETYPE:J2r,ARROWTYPE:exr,PLACEMENT:txr,setTitle:rxr,setC4Type:R2r},_ut=k(function(e,t){return i3(e,t)},"drawRect"),nxr=k((e,t,r,n)=>{let i=e.append("g"),a=0;for(let o of t){let s=o.textColor?o.textColor:"#444444",l=o.lineColor?o.lineColor:"#444444",u=o.offsetX?parseInt(String(o.offsetX)):0,d=o.offsetY?parseInt(String(o.offsetY)):0,h="";if(a===0){let m=i.append("line");m.attr("x1",o.startPoint.x),m.attr("y1",o.startPoint.y),m.attr("x2",o.endPoint.x),m.attr("y2",o.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",l),m.style("fill","none"),o.type!=="rel_b"&&m.attr("marker-end","url("+h+"#"+n+"-arrowhead)"),(o.type==="birel"||o.type==="rel_b")&&m.attr("marker-start","url("+h+"#"+n+"-arrowend)"),a=-1}else{let m=i.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",o.startPoint.x).replaceAll("starty",o.startPoint.y).replaceAll("controlx",o.startPoint.x+(o.endPoint.x-o.startPoint.x)/2-(o.endPoint.x-o.startPoint.x)/4).replaceAll("controly",o.startPoint.y+(o.endPoint.y-o.startPoint.y)/2).replaceAll("stopx",o.endPoint.x).replaceAll("stopy",o.endPoint.y)),o.type!=="rel_b"&&m.attr("marker-end","url("+h+"#"+n+"-arrowhead)"),(o.type==="birel"||o.type==="rel_b")&&m.attr("marker-start","url("+h+"#"+n+"-arrowend)")}let f=o.label.width,p=r.messageFont();UM(r)(o.label.text,i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+d,f,o.label.height,{fill:s},p),o.techn&&o.techn.text!==""&&(p=r.messageFont(),UM(r)("["+o.techn.text+"]",i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+r.messageFontSize+5+d,Math.max(f,o.techn.width),o.techn.height,{fill:s,"font-style":"italic"},p))}},"drawRels"),ixr=k(function(e,t,r){let n=e.append("g"),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};_ut(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=o,UM(r)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=r.boundaryFont(),u.fontColor=o,UM(r)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=o,UM(r)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),axr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),oxr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),sxr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),lxr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),cxr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),uxr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),dxr=k(function(e,t){let n=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.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"),n.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"),UM=(function(){function e(i,a,o,s,l,u,d){let h=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("text-anchor","middle").text(i);n(h,d)}k(e,"byText");function t(i,a,o,s,l,u,d,h){let{fontSize:f,fontFamily:p,fontWeight:m}=h,g=i.split(Lt.lineBreakRegex);for(let y=0;y{if(t==="sandbox"){let n=xt("#i"+e).node()?.contentDocument;if(!n)throw new Error(`Sandbox iframe #i${e} is missing its content document`);return{root:xt(n.body),doc:n}}return{root:xt("body"),doc:document}},"getDiagramRoot"),fxr=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),pxr=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),mxr={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},Zme=k(e=>e?mxr[e.toLowerCase()]:void 0,"keywordShape"),gxr=k(e=>{let t=Zme(e.shape)??Zme(e.sprite);if(t)return t;if(e.tags)for(let n of e.tags.split(",")){let i=Zme(n.trim());if(i)return i}let r=e.typeC4Shape.text;return r==="person"||r==="external_person"?"person":pxr.has(r)?"cylinder":fxr.has(r)?"h-cyl":"rounded"},"resolveNodeShape"),yxr={person:"Person",system:"Software System",container:"Container",component:"Component"},vxr=k(e=>{let t=e.replace(/^external_/,"").replace(/_(db|queue)$/,"");return yxr[t]??t.replace(/_/g," ")},"stereotypeLabel"),bxr=k(e=>e.startsWith("external_"),"isExternal"),xxr=k(e=>{let t=vxr(e.typeC4Shape.text);return e.techn?.text?`[${t}: ${e.techn.text}]`:`[${t}]`},"stereotypeText"),Put=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(e=>[e,`external_${e}`]),wxr=new Set(Put),Sut=k(e=>wxr.has(e),"isC4ElementType"),Exr=k((e,t)=>{let r=e.typeC4Shape.text,n=e.bgColor??(Sut(r)&&t[`${r}_bg_color`]),i=e.borderColor??(Sut(r)&&t[`${r}_border_color`]),a=[];return n&&a.push(`fill:${n}`),i&&a.push(`stroke:${i}`),a.push(`color:${e.fontColor??"#FFFFFF"}`),a},"elementCssStyles"),Aut=k((e,t,r,n,i)=>{let a=e.typeC4Shape.text,o=["c4-shape",`c4-${a}`];bxr(a)&&o.push("c4-external");let s=gxr(e),l=Exr(e,t);return(s==="rounded"||s==="fr-rect")&&l.push("rx:12px","ry:12px"),{id:e.alias,label:e.label.text,stereotype:xxr(e),description:e.descr?.text?[e.descr.text]:void 0,labelType:"string",isGroup:!1,shape:s,cssClasses:o.join(" "),cssStyles:l,padding:r,look:n,useHtmlLabels:!1,width:i}},"buildC4Node"),IM=0,RM=0,Out=4,Jme=2;Uq.yy=Qme;Kr={},But=class{static{k(this,"Bounds")}constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,ege(e.db.getConfig())}setData(e,t,r,n){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=t,this.nextData.starty=this.data.starty=r,this.nextData.stopy=this.data.stopy=n}updateVal(e,t,r,n){e[t]===void 0?e[t]=r:e[t]=n(r,e[t])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let t=this.nextData.stopx,r=this.data.widthLimit,n=this.nextData.startx===this.nextData.stopx?t+e.margin:t+e.margin*2,i=n+e.width,a=this.nextData.starty+e.margin*2,o=a+e.height;(n>=r||i>=r||this.nextData.cnt>Out)&&(n=this.nextData.startx+e.margin+Kr.nextLinePaddingX,a=this.nextData.stopy+e.margin*2,this.nextData.stopx=i=n+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=o=a+e.height,this.nextData.cnt=1),e.x=n,e.y=a,this.updateVal(this.data,"startx",n,Math.min),this.updateVal(this.data,"starty",a,Math.min),this.updateVal(this.data,"stopx",i,Math.max),this.updateVal(this.data,"stopy",o,Math.max),this.updateVal(this.nextData,"startx",n,Math.min),this.updateVal(this.nextData,"starty",a,Math.min),this.updateVal(this.nextData,"stopx",i,Math.max),this.updateVal(this.nextData,"stopy",o,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},ege(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},ege=k(function(e){co(Kr,e),e?.fontFamily&&(Kr.personFontFamily=Kr.systemFontFamily=Kr.messageFontFamily=e.fontFamily),e?.fontSize&&(Kr.personFontSize=Kr.systemFontSize=Kr.messageFontSize=e.fontSize),e?.fontWeight&&(Kr.personFontWeight=Kr.systemFontWeight=Kr.messageFontWeight=e.fontWeight)},"setConf"),Aq=k(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),Txr=k(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");k(Ex,"calcC4ShapeTextWH");Fut=k(function(e,t,r){let n=r.data.startx,i=r.data.starty;t.x=n,t.y=i,t.width=r.data.stopx-n,t.height=r.data.stopy-i,t.label.y=Kr.c4ShapeMargin-35;let a=t.wrap&&Kr.wrap,o=Aq(Kr);o.fontSize=o.fontSize+2,o.fontWeight="bold";let s=zc(t.label.text,o);Ex("label",t,a,o,s),Fy.drawBoundary(e,t,Kr)},"drawBoundary"),zut=k(async function(e,t,r,n){let i=je(),a=i.look??"classic",o={config:i},s=t.attr("id")??"",l=n.map(d=>r[Number(d)]),u=k(d=>{let h=d.shape?nR[d.shape]:void 0;if(!h)throw new Error(`C4: no shape handler for "${d.shape}"`);return h},"shapeHandlerFor");await Promise.all(l.map(async d=>{let h=Aut(d,Kr,Kr.c4ShapePadding,a,Kr.width);h.domId=`${s}-${h.id}`;let f=await u(h)(t,h,o);d.width=h.width??Kr.width,d.height=h.height??Kr.height,d.margin=Kr.c4ShapeMargin,f.remove()}));for(let d of l)e.insert(d);await Promise.all(l.map(async d=>{let h=Aut(d,Kr,Kr.c4ShapePadding,a,Kr.width);h.domId=`${s}-${h.id}`,h.x=d.x+d.width/2,h.y=d.y+d.height/2;let f=t.append("g").attr("transform",`translate(${d.x+d.width/2}, ${d.y+d.height/2})`);await u(h)(f,h,o),d.intersect=h.intersect})),e.bumpLastMargin(Kr.c4ShapeMargin)},"drawC4ShapeArray"),kxr=class{static{k(this,"Point")}constructor(e,t){this.x=e,this.y=t}},Uut=k(function(e,t){if(!e.intersect)throw new Error(`C4 shape "${e.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);let{x:r,y:n}=e.intersect(t);return new kxr(r,n)},"getIntersectPoint"),Cxr=k(function(e,t){let r={x:0,y:0};r.x=t.x+t.width/2,r.y=t.y+t.height/2;let n=Uut(e,r);r.x=e.x+e.width/2,r.y=e.y+e.height/2;let i=Uut(t,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),Sxr=k(function(e,t,r,n,i){let a=n.db.getC4Type(),o=0;for(let s of t){o=o+1;let l=s.wrap&&Kr.wrap,u=Txr(Kr);a==="C4Dynamic"&&(s.label.text=o+": "+s.label.text);let d=zc(s.label.text,u);Ex("label",s,l,u,d),s.techn&&s.techn.text!==""&&(d=zc(s.techn.text,u),Ex("techn",s,l,u,d)),s.descr&&s.descr.text!==""&&(d=zc(s.descr.text,u),Ex("descr",s,l,u,d));let h=r(s.from),f=r(s.to);if(!h||!f)throw new Error(`C4 rel "${s.from}" -> "${s.to}" references an unknown shape`);let p=Cxr(h,f);if(!p.startPoint||!p.endPoint)throw new Error(`Could not calculate intersection points for rel "${s.from}" -> "${s.to}"`);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Fy.drawRels(e,t,Kr,i)},"drawRels");k(nge,"drawInsideBoundary");Axr=k(async function(e,t,r,n){Kr=Rut("c4");let i=je().securityLevel,{root:a}=hxr(t,i),o=n.db;o.setWrap(Kr.wrap),Out=o.getC4ShapeInRow(),Jme=o.getC4BoundaryInRow(),ye.debug(`C:${JSON.stringify(Kr,null,2)}`);let s=a.select(`[id="${t}"]`);Fy.insertComputerIcon(s,t),Fy.insertDatabaseIcon(s,t),Fy.insertClockIcon(s,t);let l=new But(n);l.setData(Kr.diagramMarginX,Kr.diagramMarginX,Kr.diagramMarginY,Kr.diagramMarginY),l.data.widthLimit=screen.availWidth,IM=Kr.diagramMarginX,RM=Kr.diagramMarginY;let u=o.getTitle(),d=o.getBoundaries("");await nge(s,"",l,d,n),Fy.insertArrowHead(s,t),Fy.insertArrowEnd(s,t),Fy.insertArrowCrossHead(s,t),Fy.insertArrowFilledHead(s,t),Sxr(s,o.getRels(),o.getC4Shape,n,t),l.data.stopx=IM,l.data.stopy=RM;let h=l.data,f=h.startx,p=h.starty,g=RM-p+2*Kr.diagramMarginY,y=IM-f,v=y+2*Kr.diagramMarginX;u&&s.append("text").text(u).attr("x",y/2-4*Kr.diagramMarginX).attr("y",p+Kr.diagramMarginY),zn(s,g,v,Kr.useMaxWidth);let b=u?60:0;s.attr("viewBox",f-Kr.diagramMarginX+" -"+(Kr.diagramMarginY+b)+" "+v+" "+(g+b)),ye.debug("models:",h)},"draw"),Iut={drawPersonOrSystemArray:zut,drawBoundary:Fut,setConf:ege,draw:Axr},Uxr=k(()=>{let e=je().c4??{},t=new CSSStyleSheet;for(let r of Put){let n=t.cssRules[t.insertRule(`.c4-shape.c4-${r} .label {}`,t.cssRules.length)],i=e[`${r}FontFamily`],a=e[`${r}FontSize`],o=e[`${r}FontWeight`];i&&n.style.setProperty("font-family",i),a&&n.style.setProperty("font-size",typeof a=="number"?`${a}px`:a),o&&n.style.setProperty("font-weight",String(o))}return[...t.cssRules].filter(r=>r.style.length>0).map(r=>` ${r.cssText}`).join(` -`)},"elementFontStyles"),Ixr=k(e=>`.person { - stroke: ${e.personBorder}; - fill: ${e.personBkg}; - } -${Uxr()} - - /* The element font colour is set inline per element (default white); the - label text takes it via currentColor. */ - .c4-shape .label, - .c4-shape .label text { - color: inherit; - fill: currentColor; - } - /* Structurizr typography: bold name, smaller stereotype/type and description lines. */ - .c4-shape .label .c4-name { - font-weight: bold; - } - .c4-shape .label .c4-type { - font-size: 0.75em; - } - .c4-shape .label .c4-descr { - font-size: 0.82em; - } - .c4-shape .basic, - .c4-shape rect, - .c4-shape path, - .c4-shape circle, - .c4-shape ellipse, - .c4-shape line { - stroke-width: 2px; - } -`,"getStyles"),Rxr=Ixr,Mxr={parser:U2r,db:Qme,renderer:Iut,styles:Rxr,init:k(({c4:e,wrap:t})=>{Iut.setConf(e),Qme.setWrap(t)},"init")}});var Lg,Dg=H(()=>{xr();Lg=k(()=>` - /* Font Awesome icon styling - consolidated */ - .label-icon { - display: inline-block; - height: 1em; - overflow: visible; - vertical-align: -0.125em; - } - - .node .label-icon path { - fill: currentColor; - stroke: revert; - stroke-width: revert; - } -`,"getIconStyles")});var Hf,Oh=H(()=>{xr();_n();Hf=k((e,t)=>{let r;return t==="sandbox"&&(r=xt("#i"+e)),(t==="sandbox"?xt(r.nodes()[0].contentDocument.body):xt("body")).select(`[id="${e}"]`)},"getDiagramElement")});var Bd,Lxr,Dxr,Fd=H(()=>{Wr();Gr();xr();Bd=k((e,t,r,n)=>{e.attr("class",r);let{width:i,height:a,x:o,y:s}=Lxr(e,t);zn(e,a,i,n);let l=Dxr(o,s,i,a,t);e.attr("viewBox",l),ye.debug(`viewBox configured: ${l} with padding: ${t}`)},"setupViewPortForSVG"),Lxr=k((e,t)=>{let r=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+t*2,height:r.height+t*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),Dxr=k((e,t,r,n,i)=>`${e-i} ${t-i} ${r} ${n}`,"createViewBox")});var Nxr,_xr,Pxr,Oxr,Bxr,ige,Vut,Hut,Fxr,zxr,Gxr,age,LM,qut,oge=H(()=>{Dg();Oh();Fd();O4();_d();Ph();Vo();Vn();Wr();Gr();xr();_n();lk();Ts();Nxr="flowchart-",_xr=class{constructor(){this.vertexCounter=0,this.config=je(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=sn,this.setAccDescription=mn,this.setDiagramTitle=Sn,this.getAccTitle=pn,this.getAccDescription=gn,this.getDiagramTitle=yn,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{k(this,"FlowDB")}sanitizeText(e){return Lt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,r,n,i,a,o={},s){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let p;s.includes(` -`)?p=s+` -`:p=`{ -`+s+` -}`,l=$2(p,{schema:X2})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(p=>p.id===e);if(d){let p=l;p?.animate!==void 0&&(d.animate=p.animate),p?.animation!==void 0&&(d.animation=p.animation),p?.curve!==void 0&&(d.interpolate=p.curve);return}let h,f=this.vertices.get(e);if(f===void 0&&(t===void 0&&r===void 0&&n!==void 0&&n!==null&&ye.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:Nxr+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,t!==void 0?(this.config=je(),h=this.sanitizeText(t.text.trim()),f.labelType=t.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),f.text=h):f.text===void 0&&(f.text=e),r!==void 0&&(f.type=r),n?.forEach(p=>{f.styles.push(p)}),i?.forEach(p=>{f.classes.push(p)}),a!==void 0&&(f.dir=a),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),l!==void 0){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(!Kue(l.shape))throw new Error(`No such shape: ${l.shape}.`);f.type=l?.shape}l?.label&&(f.text=l?.label,f.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(f.icon=l?.icon,!l.label?.trim()&&f.text===e&&(f.text="")),l?.form&&(f.form=l?.form),l?.pos&&(f.pos=l?.pos),l?.img&&(f.img=l?.img,!l.label?.trim()&&f.text===e&&(f.text="")),l?.constraint&&(f.constraint=l.constraint),l.w&&(f.assetWidth=Number(l.w)),l.h&&(f.assetHeight=Number(l.h))}}addSingleLink(e,t,r,n){let o={start:e,end:t,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ye.info("abc78 Got edge...",o);let s=r.text;if(s!==void 0&&(o.text=this.sanitizeText(s.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(s.type)),r!==void 0&&(o.type=r.type,o.stroke=r.stroke,o.length=r.length>10?10:r.length),n&&!this.edges.some(l=>l.id===n))o.id=n,o.isUserDefinedId=!0;else{let l=this.edges.filter(u=>u.start===o.start&&u.end===o.end);l.length===0?o.id=tg(o.start,o.end,{counter:0,prefix:"L"}):o.id=tg(o.start,o.end,{counter:l.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ye.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. - -Initialize mermaid with maxEdges set to a higher number to allow more edges. -You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,t,r){let n=this.isLinkData(r)?r.id.replace("@",""):void 0;ye.info("addLink",e,t,n);for(let i of e)for(let a of t){let o=i===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(i,a,r,n):this.addSingleLink(i,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=t:this.edges[r].interpolate=t})}updateLink(e,t){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} 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.)`);r==="default"?this.edges.defaultStyle=t:(this.edges[r].style=t,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,t){let r=t.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r?.forEach(a=>{if(/color/.exec(a)){let o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,t){for(let r of e.split(",")){let n=this.vertices.get(r);n&&n.classes.push(t);let i=this.edges.find(o=>o.id===r);i&&i.classes.push(t);let a=this.subGraphLookup.get(r);a&&a.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,t)}}setClickFun(e,t,r){if(je().securityLevel!=="loose"||t===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{let a=this.lookUpDomId(e),o=document.querySelector(`[id="${a}"]`);o!==null&&o.addEventListener("click",()=>{Nr.runFunc(t,...n)},!1)}))}setLink(e,t,r){e.split(",").forEach(n=>{let i=this.vertices.get(n);i!==void 0&&(i.link=Nr.formatUrl(t,this.config),i.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,r){e.split(",").forEach(n=>{this.setClickFun(n,t,r)}),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=pS();xt(e).select("svg").selectAll("g.node").on("mouseover",i=>{let a=xt(i.currentTarget),o=a.attr("title");if(o===null)return;let s=i.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.text(a.attr("title")).style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px"),t.html(xd.sanitize(o)),a.classed("hover",!0)}).on("mouseout",i=>{t.transition().duration(500).style("opacity",0),xt(i.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.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=je(),$r()}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,r){let n=e.text.trim(),i=r.text;e===r&&/\s/.exec(r.text)&&(n=void 0);let o=k(h=>{let f={boolean:{},number:{},string:{}},p=[],m;return{nodeList:h.filter(function(y){let v=typeof y;return y.stmt&&y.stmt==="dir"?(m=y.value,!1):y.trim()===""?!1:v in f?f[v].hasOwnProperty(y)?!1:f[v][y]=!0:p.includes(y)?!1:p.push(y)}),dir:m}},"uniq")(t.flat()),s=o.nodeList,l=o.dir,u=je().flowchart??{};if(l=l??(u.inheritDir?this.getDirection()??je().direction??void 0:void 0),this.version==="gen-1")for(let h=0;h2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let n=0,i=1;for(;n=0){let o=this.indexNodes2(e,a);if(o.result)return{result:!0,count:i+o.count};i=i+o.count}n=n+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):!1}destructStartLink(e){let t=e.trim(),r="arrow_open";switch(t[0]){case"<":r="arrow_point",t=t.slice(1);break;case"x":r="arrow_cross",t=t.slice(1);break;case"o":r="arrow_circle",t=t.slice(1);break}let n="normal";return t.includes("=")&&(n="thick"),t.includes(".")&&(n="dotted"),{type:r,stroke:n}}countChar(e,t){let r=t.length,n=0;for(let i=0;i":n="arrow_point",t.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",t.startsWith("o")&&(n="double_"+n,r=r.slice(1));break}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");let o=this.countChar(".",r);return o&&(i="dotted",a=o),{type:n,stroke:i,length:a}}destructLink(e,t){let r=this.destructEndLink(e),n;if(t){if(n=this.destructStartLink(t),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=r.length,n}return r}exists(e,t){for(let r of e)if(r.nodes.includes(t))return!0;return!1}makeUniq(e,t){let r=[];return e.nodes.forEach((n,i)=>{this.exists(t,n)||r.push(e.nodes[i])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"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(r=>r.id===t)}destructEdgeType(e){let t="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":t=e.replace("double_",""),r=t;break}return{arrowTypeStart:t,arrowTypeEnd:r}}addNodeFromVertex(e,t,r,n,i,a){let o=r.get(e.id),s=n.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{let u={id:e.id,label:e.text,labelType:e.labelType,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({...u,isGroup:!0,shape:"rect"}):t.push({...u,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let t=[];for(let r of e){let n=this.classes.get(r);n?.styles&&(t=[...t,...n.styles??[]].map(i=>i.trim())),n?.textStyles&&(t=[...t,...n.textStyles??[]].map(i=>i.trim()))}return t}getData(){let e=je(),t=[],r=[],n=this.getSubGraphs(),i=new Map,a=new Map,o=new Map;for(let p of n)for(let m of p.nodes)this.subGraphLookup.has(m)&&o.set(m,p.id);let s=k(p=>this.subGraphLookup.get(p)?.metadata?.view==="collapsed","isCollapsed"),l=k(p=>{let m,g=new Set,y=p;for(;y!==void 0&&!g.has(y);)g.add(y),s(y)&&(m=y),y=o.get(y);return m},"outermostCollapsed"),u=new Set,d=new Map;for(let p of n){let m=l(p.id);if(m!==void 0){p.id!==m&&(u.add(p.id),d.set(p.id,m));for(let g of p.nodes)g!==m&&(u.add(g),d.set(g,m))}}for(let p=n.length-1;p>=0;p--){let m=n[p];if(!u.has(m.id)){m.nodes.length>0&&a.set(m.id,!0);for(let g of m.nodes)i.set(g,m.id)}}for(let p=n.length-1;p>=0;p--){let m=n[p];u.has(m.id)||(m.metadata?.view==="collapsed"?t.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:i.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"collapsedGroup",dir:m.dir,isGroup:!1,look:e.look}):t.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:i.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"rect",dir:m.dir,isGroup:!0,look:e.look}))}this.getVertices().forEach(p=>{u.has(p.id)||this.addNodeFromVertex(p,t,i,a,e,e.look||"classic")});let f=this.getEdges();return f.forEach((p,m)=>{let{arrowTypeStart:g,arrowTypeEnd:y}=this.destructEdgeType(p.type),v=[...f.defaultStyle??[]],b=d.get(p.start)??p.start,x=d.get(p.end)??p.end;if(b===x&&(d.has(p.start)||d.has(p.end)))return;p.style&&v.push(...p.style);let E={id:tg(b,x,{counter:m,prefix:"L"},p.id),isUserDefinedId:p.isUserDefinedId,start:b,end:x,type:p.type??"normal",label:p.text,labelType:p.labelType,labelpos:"c",thickness:p.stroke,minlen:p.length,classes:p?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:p?.stroke==="invisible"||p?.type==="arrow_open"?"none":g,arrowTypeEnd:p?.stroke==="invisible"||p?.type==="arrow_open"?"none":y,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(p.classes),labelStyle:v,style:v,pattern:p.stroke,look:e.look,animate:p.animate,animation:p.animation,curve:p.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(E)}),{nodes:t,edges:r,other:{},config:e}}defaultConfig(){return vz.flowchart}},Pxr=k(function(e,t){return t.db.getClasses()},"getClasses"),Oxr=k(async function(e,t,r,n){ye.info("REF0:"),ye.info("Drawing state diagram (v2)",t);let{securityLevel:i,flowchart:a,layout:o}=je();n.db.setDiagramId(t),ye.debug("Before getData: ");let s=n.db.getData();ye.debug("Data: ",s);let l=Hf(t,i),u=n.db.getDirection();s.type=n.type,s.layoutAlgorithm=Rg(o),s.layoutAlgorithm==="dagre"&&o==="elk"&&ye.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."),s.direction=u,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["point","circle","cross"],s.diagramId=t,ye.debug("REF1:",s),await Gf(s,l);let d=s.config.flowchart?.diagramPadding??8;Nr.insertTitle(l,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),Bd(l,d,"flowchart",a?.useMaxWidth||!1)},"draw"),Bxr={getClasses:Pxr,draw:Oxr},ige=(function(){var e=k(function(Vt,At,tr,$t){for(tr=tr||{},$t=Vt.length;$t--;tr[Vt[$t]]=At);return tr},"o"),t=[1,4],r=[1,3],n=[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,125],a=[2,2],o=[1,13],s=[1,14],l=[1,15],u=[1,16],d=[1,23],h=[1,25],f=[1,26],p=[1,27],m=[1,50],g=[1,49],y=[1,29],v=[1,30],b=[1,31],x=[1,32],E=[1,33],w=[1,45],T=[1,47],C=[1,43],S=[1,48],R=[1,44],U=[1,51],L=[1,46],I=[1,52],A=[1,53],P=[1,34],D=[1,35],M=[1,36],O=[1,37],_=[1,38],B=[1,58],F=[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,125],G=[1,62],z=[1,61],V=[1,63],$=[8,9,11,75,77,78],Z=[1,79],re=[1,92],Q=[1,97],ge=[1,96],ie=[1,93],pe=[1,89],ue=[1,95],fe=[1,91],Me=[1,98],Ce=[1,94],Ye=[1,99],Ze=[1,90],Qe=[8,9,10,11,40,75,77,78],ve=[8,9,10,11,40,46,75,77,78],Fe=[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],Le=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Be=[44,60,89,102,105,106,109,111,114,115,116],ae=[1,122],he=[1,123],de=[1,125],me=[1,124],ke=[44,60,62,74,89,102,105,106,109,111,114,115,116],le=[1,134],W=[1,148],X=[1,149],q=[1,150],j=[1,151],se=[1,136],J=[1,138],K=[1,142],ee=[1,143],Se=[1,144],Te=[1,145],Ae=[1,146],Ie=[1,147],Ge=[1,152],De=[1,153],He=[1,132],ze=[1,133],Ke=[1,140],we=[1,135],bt=[1,139],Ve=[1,137],vt=[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,125],Pt=[1,155],Xt=[1,157],It=[8,9,11],Ot=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Et=[1,177],Ee=[1,173],gt=[1,174],Ut=[1,178],ct=[1,175],Ne=[1,176],at=[77,116,119],ft=[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],Ct=[10,106],Er=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Wt=[1,248],Sr=[1,246],on=[1,250],ir=[1,244],Jt=[1,245],Ar=[1,247],ot=[1,249],wt=[1,251],zt=[1,269],Pr=[8,9,11,106],Dr=[8,9,10,11,60,84,105,106,109,110,111,112],Ln={trace:k(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,direction_td:125,$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",125:"direction_td"},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],[33,1]],performAction:k(function(At,tr,$t,Dt,kr,_e,aa){var We=_e.length-1;switch(kr){case 2:this.$=[];break;case 3:(!Array.isArray(_e[We])||_e[We].length>0)&&_e[We-1].push(_e[We]),this.$=_e[We-1];break;case 4:case 183:this.$=_e[We];break;case 11:Dt.setDirection("TB"),this.$="TB";break;case 12:Dt.setDirection(_e[We-1]),this.$=_e[We-1];break;case 27:this.$=_e[We-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=Dt.addSubGraph(_e[We-6],_e[We-1],_e[We-4]);break;case 34:this.$=Dt.addSubGraph(_e[We-3],_e[We-1],_e[We-3]);break;case 35:this.$=Dt.addSubGraph(void 0,_e[We-1],void 0);break;case 37:this.$=_e[We].trim(),Dt.setAccTitle(this.$);break;case 38:case 39:this.$=_e[We].trim(),Dt.setAccDescription(this.$);break;case 43:this.$=_e[We-1]+_e[We];break;case 44:this.$=_e[We];break;case 45:Dt.addVertex(_e[We-1][_e[We-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,_e[We]),Dt.addLink(_e[We-3].stmt,_e[We-1],_e[We-2]),this.$={stmt:_e[We-1],nodes:_e[We-1].concat(_e[We-3].nodes)};break;case 46:Dt.addLink(_e[We-2].stmt,_e[We],_e[We-1]),this.$={stmt:_e[We],nodes:_e[We].concat(_e[We-2].nodes)};break;case 47:Dt.addLink(_e[We-3].stmt,_e[We-1],_e[We-2]),this.$={stmt:_e[We-1],nodes:_e[We-1].concat(_e[We-3].nodes)};break;case 48:this.$={stmt:_e[We-1],nodes:_e[We-1]};break;case 49:Dt.addVertex(_e[We-1][_e[We-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,_e[We]),this.$={stmt:_e[We-1],nodes:_e[We-1],shapeData:_e[We]};break;case 50:this.$={stmt:_e[We],nodes:_e[We]};break;case 51:this.$=[_e[We]];break;case 52:Dt.addVertex(_e[We-5][_e[We-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,_e[We-4]),this.$=_e[We-5].concat(_e[We]);break;case 53:this.$=_e[We-4].concat(_e[We]);break;case 54:this.$=_e[We];break;case 55:this.$=_e[We-2],Dt.setClass(_e[We-2],_e[We]);break;case 56:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"square");break;case 57:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"doublecircle");break;case 58:this.$=_e[We-5],Dt.addVertex(_e[We-5],_e[We-2],"circle");break;case 59:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"ellipse");break;case 60:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"stadium");break;case 61:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"subroutine");break;case 62:this.$=_e[We-7],Dt.addVertex(_e[We-7],_e[We-1],"rect",void 0,void 0,void 0,Object.fromEntries([[_e[We-5],_e[We-3]]]));break;case 63:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"cylinder");break;case 64:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"round");break;case 65:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"diamond");break;case 66:this.$=_e[We-5],Dt.addVertex(_e[We-5],_e[We-2],"hexagon");break;case 67:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"odd");break;case 68:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"trapezoid");break;case 69:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"inv_trapezoid");break;case 70:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"lean_right");break;case 71:this.$=_e[We-3],Dt.addVertex(_e[We-3],_e[We-1],"lean_left");break;case 72:this.$=_e[We],Dt.addVertex(_e[We]);break;case 73:_e[We-1].text=_e[We],this.$=_e[We-1];break;case 74:case 75:_e[We-2].text=_e[We-1],this.$=_e[We-2];break;case 76:this.$=_e[We];break;case 77:var cn=Dt.destructLink(_e[We],_e[We-2]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,text:_e[We-1]};break;case 78:var cn=Dt.destructLink(_e[We],_e[We-2]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,text:_e[We-1],id:_e[We-3]};break;case 79:this.$={text:_e[We],type:"text"};break;case 80:this.$={text:_e[We-1].text+""+_e[We],type:_e[We-1].type};break;case 81:this.$={text:_e[We],type:"string"};break;case 82:this.$={text:_e[We],type:"markdown"};break;case 83:var cn=Dt.destructLink(_e[We]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length};break;case 84:var cn=Dt.destructLink(_e[We]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,id:_e[We-1]};break;case 85:this.$=_e[We-1];break;case 86:this.$={text:_e[We],type:"text"};break;case 87:this.$={text:_e[We-1].text+""+_e[We],type:_e[We-1].type};break;case 88:this.$={text:_e[We],type:"string"};break;case 89:case 104:this.$={text:_e[We],type:"markdown"};break;case 101:this.$={text:_e[We],type:"text"};break;case 102:this.$={text:_e[We-1].text+""+_e[We],type:_e[We-1].type};break;case 103:this.$={text:_e[We],type:"text"};break;case 105:this.$=_e[We-4],Dt.addClass(_e[We-2],_e[We]);break;case 106:this.$=_e[We-4],Dt.setClass(_e[We-2],_e[We]);break;case 107:case 115:this.$=_e[We-1],Dt.setClickEvent(_e[We-1],_e[We]);break;case 108:case 116:this.$=_e[We-3],Dt.setClickEvent(_e[We-3],_e[We-2]),Dt.setTooltip(_e[We-3],_e[We]);break;case 109:this.$=_e[We-2],Dt.setClickEvent(_e[We-2],_e[We-1],_e[We]);break;case 110:this.$=_e[We-4],Dt.setClickEvent(_e[We-4],_e[We-3],_e[We-2]),Dt.setTooltip(_e[We-4],_e[We]);break;case 111:this.$=_e[We-2],Dt.setLink(_e[We-2],_e[We]);break;case 112:this.$=_e[We-4],Dt.setLink(_e[We-4],_e[We-2]),Dt.setTooltip(_e[We-4],_e[We]);break;case 113:this.$=_e[We-4],Dt.setLink(_e[We-4],_e[We-2],_e[We]);break;case 114:this.$=_e[We-6],Dt.setLink(_e[We-6],_e[We-4],_e[We]),Dt.setTooltip(_e[We-6],_e[We-2]);break;case 117:this.$=_e[We-1],Dt.setLink(_e[We-1],_e[We]);break;case 118:this.$=_e[We-3],Dt.setLink(_e[We-3],_e[We-2]),Dt.setTooltip(_e[We-3],_e[We]);break;case 119:this.$=_e[We-3],Dt.setLink(_e[We-3],_e[We-2],_e[We]);break;case 120:this.$=_e[We-5],Dt.setLink(_e[We-5],_e[We-4],_e[We]),Dt.setTooltip(_e[We-5],_e[We-2]);break;case 121:this.$=_e[We-4],Dt.addVertex(_e[We-2],void 0,void 0,_e[We]);break;case 122:this.$=_e[We-4],Dt.updateLink([_e[We-2]],_e[We]);break;case 123:this.$=_e[We-4],Dt.updateLink(_e[We-2],_e[We]);break;case 124:this.$=_e[We-8],Dt.updateLinkInterpolate([_e[We-6]],_e[We-2]),Dt.updateLink([_e[We-6]],_e[We]);break;case 125:this.$=_e[We-8],Dt.updateLinkInterpolate(_e[We-6],_e[We-2]),Dt.updateLink(_e[We-6],_e[We]);break;case 126:this.$=_e[We-6],Dt.updateLinkInterpolate([_e[We-4]],_e[We]);break;case 127:this.$=_e[We-6],Dt.updateLinkInterpolate(_e[We-4],_e[We]);break;case 128:case 130:this.$=[_e[We]];break;case 129:case 131:_e[We-2].push(_e[We]),this.$=_e[We-2];break;case 133:this.$=_e[We-1]+_e[We];break;case 181:this.$=_e[We];break;case 182:this.$=_e[We-1]+""+_e[We];break;case 184:this.$=_e[We-1]+""+_e[We];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"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:t,10:r,12:n},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:r,12:n},{4:8,9:t,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:h,36:f,38:p,42:28,43:39,44:m,45:40,47:41,60:g,84:y,85:v,86:b,87:x,88:E,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A,121:P,122:D,123:M,124:O,125:_},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,55],9:[1,56],10:B,15:54,18:57},e(F,[2,3]),e(F,[2,4]),e(F,[2,5]),e(F,[2,6]),e(F,[2,7]),e(F,[2,8]),{8:G,9:z,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:G,9:z,11:V,21:68},{8:G,9:z,11:V,21:69},{8:G,9:z,11:V,21:70},{8:G,9:z,11:V,21:71},{8:G,9:z,11:V,21:72},{8:G,9:z,10:[1,73],11:V,21:74},e(F,[2,36]),{35:[1,75]},{37:[1,76]},e(F,[2,39]),e($,[2,50],{18:77,39:78,10:B,40:Z}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:re,44:Q,60:ge,80:[1,87],89:ie,95:[1,84],97:[1,85],101:86,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze,120:88},e(F,[2,185]),e(F,[2,186]),e(F,[2,187]),e(F,[2,188]),e(F,[2,189]),e(Qe,[2,51]),e(Qe,[2,54],{46:[1,100]}),e(ve,[2,72],{113:113,29:[1,101],44:m,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:g,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:w,102:T,105:C,106:S,109:R,111:U,114:L,115:I,116:A}),e(Fe,[2,181]),e(Fe,[2,142]),e(Fe,[2,143]),e(Fe,[2,144]),e(Fe,[2,145]),e(Fe,[2,146]),e(Fe,[2,147]),e(Fe,[2,148]),e(Fe,[2,149]),e(Fe,[2,150]),e(Fe,[2,151]),e(Fe,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,114]},e(Le,[2,26],{18:115,10:B}),e(F,[2,27]),{42:116,43:39,44:m,45:40,47:41,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},e(F,[2,40]),e(F,[2,41]),e(F,[2,42]),e(Be,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ae,81:he,116:de,119:me},{75:[1,126],77:[1,127]},e(ke,[2,83]),e(F,[2,28]),e(F,[2,29]),e(F,[2,30]),e(F,[2,31]),e(F,[2,32]),{10:le,12:W,14:X,27:q,28:128,32:j,44:se,60:J,75:K,80:[1,130],81:[1,131],83:141,84:ee,85:Se,86:Te,87:Ae,88:Ie,89:Ge,90:De,91:129,105:He,109:ze,111:Ke,114:we,115:bt,116:Ve},e(vt,a,{5:154}),e(F,[2,37]),e(F,[2,38]),e($,[2,48],{44:Pt}),e($,[2,49],{18:156,10:B,40:Xt}),e(Qe,[2,44]),{44:m,47:158,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},{102:[1,159],103:160,105:[1,161]},{44:m,47:162,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},{44:m,47:163,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},e(It,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(It,[2,115],{120:168,10:[1,167],14:re,44:Q,60:ge,89:ie,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze}),e(It,[2,117],{10:[1,169]}),e(Ot,[2,183]),e(Ot,[2,170]),e(Ot,[2,171]),e(Ot,[2,172]),e(Ot,[2,173]),e(Ot,[2,174]),e(Ot,[2,175]),e(Ot,[2,176]),e(Ot,[2,177]),e(Ot,[2,178]),e(Ot,[2,179]),e(Ot,[2,180]),{44:m,47:170,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},{30:171,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:179,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:181,50:[1,180],67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:182,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:183,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:184,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{109:[1,185]},{30:186,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:187,65:[1,188],67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:189,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:190,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{30:191,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},e(Fe,[2,182]),e(i,[2,20]),e(Le,[2,25]),e($,[2,46],{39:192,18:193,10:B,40:Z}),e(Be,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{77:[1,197],79:198,116:de,119:me},e(at,[2,79]),e(at,[2,81]),e(at,[2,82]),e(at,[2,168]),e(at,[2,169]),{76:199,79:121,80:ae,81:he,116:de,119:me},e(ke,[2,84]),{8:G,9:z,10:le,11:V,12:W,14:X,21:201,27:q,29:[1,200],32:j,44:se,60:J,75:K,83:141,84:ee,85:Se,86:Te,87:Ae,88:Ie,89:Ge,90:De,91:202,105:He,109:ze,111:Ke,114:we,115:bt,116:Ve},e(ft,[2,101]),e(ft,[2,103]),e(ft,[2,104]),e(ft,[2,157]),e(ft,[2,158]),e(ft,[2,159]),e(ft,[2,160]),e(ft,[2,161]),e(ft,[2,162]),e(ft,[2,163]),e(ft,[2,164]),e(ft,[2,165]),e(ft,[2,166]),e(ft,[2,167]),e(ft,[2,90]),e(ft,[2,91]),e(ft,[2,92]),e(ft,[2,93]),e(ft,[2,94]),e(ft,[2,95]),e(ft,[2,96]),e(ft,[2,97]),e(ft,[2,98]),e(ft,[2,99]),e(ft,[2,100]),{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:h,36:f,38:p,42:28,43:39,44:m,45:40,47:41,60:g,84:y,85:v,86:b,87:x,88:E,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A,121:P,122:D,123:M,124:O,125:_},{10:B,18:204},{44:[1,205]},e(Qe,[2,43]),{10:[1,206],44:m,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:113,114:L,115:I,116:A},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ct,[2,128]),{10:[1,210],44:m,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:113,114:L,115:I,116:A},{10:[1,211],44:m,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:113,114:L,115:I,116:A},{80:[1,212]},e(It,[2,109],{10:[1,213]}),e(It,[2,111],{10:[1,214]}),{80:[1,215]},e(Ot,[2,184]),{80:[1,216],98:[1,217]},e(Qe,[2,55],{113:113,44:m,60:g,89:w,102:T,105:C,106:S,109:R,111:U,114:L,115:I,116:A}),{31:[1,218],67:Et,82:219,116:Ut,117:ct,118:Ne},e(Er,[2,86]),e(Er,[2,88]),e(Er,[2,89]),e(Er,[2,153]),e(Er,[2,154]),e(Er,[2,155]),e(Er,[2,156]),{49:[1,220],67:Et,82:219,116:Ut,117:ct,118:Ne},{30:221,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{51:[1,222],67:Et,82:219,116:Ut,117:ct,118:Ne},{53:[1,223],67:Et,82:219,116:Ut,117:ct,118:Ne},{55:[1,224],67:Et,82:219,116:Ut,117:ct,118:Ne},{57:[1,225],67:Et,82:219,116:Ut,117:ct,118:Ne},{60:[1,226]},{64:[1,227],67:Et,82:219,116:Ut,117:ct,118:Ne},{66:[1,228],67:Et,82:219,116:Ut,117:ct,118:Ne},{30:229,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},{31:[1,230],67:Et,82:219,116:Ut,117:ct,118:Ne},{67:Et,69:[1,231],71:[1,232],82:219,116:Ut,117:ct,118:Ne},{67:Et,69:[1,234],71:[1,233],82:219,116:Ut,117:ct,118:Ne},e($,[2,45],{18:156,10:B,40:Xt}),e($,[2,47],{44:Pt}),e(Be,[2,75]),e(Be,[2,74]),{62:[1,235],67:Et,82:219,116:Ut,117:ct,118:Ne},e(Be,[2,77]),e(at,[2,80]),{77:[1,236],79:198,116:de,119:me},{30:237,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},e(vt,a,{5:238}),e(ft,[2,102]),e(F,[2,35]),{43:239,44:m,45:40,47:41,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},{10:B,18:240},{10:Wt,60:Sr,84:on,92:241,105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},{10:Wt,60:Sr,84:on,92:252,104:[1,253],105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},{10:Wt,60:Sr,84:on,92:254,104:[1,255],105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},{105:[1,256]},{10:Wt,60:Sr,84:on,92:257,105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},{44:m,47:258,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},e(It,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(It,[2,116]),e(It,[2,118],{10:[1,262]}),e(It,[2,119]),e(ve,[2,56]),e(Er,[2,87]),e(ve,[2,57]),{51:[1,263],67:Et,82:219,116:Ut,117:ct,118:Ne},e(ve,[2,64]),e(ve,[2,59]),e(ve,[2,60]),e(ve,[2,61]),{109:[1,264]},e(ve,[2,63]),e(ve,[2,65]),{66:[1,265],67:Et,82:219,116:Ut,117:ct,118:Ne},e(ve,[2,67]),e(ve,[2,68]),e(ve,[2,70]),e(ve,[2,69]),e(ve,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Be,[2,78]),{31:[1,266],67:Et,82:219,116:Ut,117:ct,118:Ne},{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:h,36:f,38:p,42:28,43:39,44:m,45:40,47:41,60:g,84:y,85:v,86:b,87:x,88:E,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A,121:P,122:D,123:M,124:O,125:_},e(Qe,[2,53]),{43:268,44:m,45:40,47:41,60:g,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A},e(It,[2,121],{106:zt}),e(Pr,[2,130],{108:270,10:Wt,60:Sr,84:on,105:ir,109:Jt,110:Ar,111:ot,112:wt}),e(Dr,[2,132]),e(Dr,[2,134]),e(Dr,[2,135]),e(Dr,[2,136]),e(Dr,[2,137]),e(Dr,[2,138]),e(Dr,[2,139]),e(Dr,[2,140]),e(Dr,[2,141]),e(It,[2,122],{106:zt}),{10:[1,271]},e(It,[2,123],{106:zt}),{10:[1,272]},e(Ct,[2,129]),e(It,[2,105],{106:zt}),e(It,[2,106],{113:113,44:m,60:g,89:w,102:T,105:C,106:S,109:R,111:U,114:L,115:I,116:A}),e(It,[2,110]),e(It,[2,112],{10:[1,273]}),e(It,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:G,9:z,11:V,21:278},e(F,[2,34]),e(Qe,[2,52]),{10:Wt,60:Sr,84:on,105:ir,107:279,108:243,109:Jt,110:Ar,111:ot,112:wt},e(Dr,[2,133]),{14:re,44:Q,60:ge,89:ie,101:280,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze,120:88},{14:re,44:Q,60:ge,89:ie,101:281,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze,120:88},{98:[1,282]},e(It,[2,120]),e(ve,[2,58]),{30:283,67:Et,80:Ee,81:gt,82:172,116:Ut,117:ct,118:Ne},e(ve,[2,66]),e(vt,a,{5:284}),e(Pr,[2,131],{108:270,10:Wt,60:Sr,84:on,105:ir,109:Jt,110:Ar,111:ot,112:wt}),e(It,[2,126],{120:168,10:[1,285],14:re,44:Q,60:ge,89:ie,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze}),e(It,[2,127],{120:168,10:[1,286],14:re,44:Q,60:ge,89:ie,105:pe,106:ue,109:fe,111:Me,114:Ce,115:Ye,116:Ze}),e(It,[2,114]),{31:[1,287],67:Et,82:219,116:Ut,117:ct,118:Ne},{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:h,36:f,38:p,42:28,43:39,44:m,45:40,47:41,60:g,84:y,85:v,86:b,87:x,88:E,89:w,102:T,105:C,106:S,109:R,111:U,113:42,114:L,115:I,116:A,121:P,122:D,123:M,124:O,125:_},{10:Wt,60:Sr,84:on,92:289,105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},{10:Wt,60:Sr,84:on,92:290,105:ir,107:242,108:243,109:Jt,110:Ar,111:ot,112:wt},e(ve,[2,62]),e(F,[2,33]),e(It,[2,124],{106:zt}),e(It,[2,125],{106:zt})],defaultActions:{},parseError:k(function(At,tr){if(tr.recoverable)this.trace(At);else{var $t=new Error(At);throw $t.hash=tr,$t}},"parseError"),parse:k(function(At){var tr=this,$t=[0],Dt=[],kr=[null],_e=[],aa=this.table,We="",cn=0,Fs=0,hp=0,Iv=2,Rv=1,bw=_e.slice.call(arguments,1),go=Object.create(this.lexer),Jd={yy:{}};for(var f1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f1)&&(Jd.yy[f1]=this.yy[f1]);go.setInput(At,Jd.yy),Jd.yy.lexer=go,Jd.yy.parser=this,typeof go.yylloc>"u"&&(go.yylloc={});var eh=go.yylloc;_e.push(eh);var Mv=go.options&&go.options.ranges;typeof Jd.yy.parseError=="function"?this.parseError=Jd.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yl(ou){$t.length=$t.length-2*ou,kr.length=kr.length-ou,_e.length=_e.length-ou}k(yl,"popStack");function p1(){var ou;return ou=Dt.pop()||go.lex()||Rv,typeof ou!="number"&&(ou instanceof Array&&(Dt=ou,ou=Dt.pop()),ou=tr.symbols_[ou]||ou),ou}k(p1,"lex");for(var Za,m1,zs,Ju,d7,h7,g1={},fp,th,f7,J6;;){if(zs=$t[$t.length-1],this.defaultActions[zs]?Ju=this.defaultActions[zs]:((Za===null||typeof Za>"u")&&(Za=p1()),Ju=aa[zs]&&aa[zs][Za]),typeof Ju>"u"||!Ju.length||!Ju[0]){var eE="";J6=[];for(fp in aa[zs])this.terminals_[fp]&&fp>Iv&&J6.push("'"+this.terminals_[fp]+"'");go.showPosition?eE="Parse error on line "+(cn+1)+`: -`+go.showPosition()+` -Expecting `+J6.join(", ")+", got '"+(this.terminals_[Za]||Za)+"'":eE="Parse error on line "+(cn+1)+": Unexpected "+(Za==Rv?"end of input":"'"+(this.terminals_[Za]||Za)+"'"),this.parseError(eE,{text:go.match,token:this.terminals_[Za]||Za,line:go.yylineno,loc:eh,expected:J6})}if(Ju[0]instanceof Array&&Ju.length>1)throw new Error("Parse Error: multiple actions possible at state: "+zs+", token: "+Za);switch(Ju[0]){case 1:$t.push(Za),kr.push(go.yytext),_e.push(go.yylloc),$t.push(Ju[1]),Za=null,m1?(Za=m1,m1=null):(Fs=go.yyleng,We=go.yytext,cn=go.yylineno,eh=go.yylloc,hp>0&&hp--);break;case 2:if(th=this.productions_[Ju[1]][1],g1.$=kr[kr.length-th],g1._$={first_line:_e[_e.length-(th||1)].first_line,last_line:_e[_e.length-1].last_line,first_column:_e[_e.length-(th||1)].first_column,last_column:_e[_e.length-1].last_column},Mv&&(g1._$.range=[_e[_e.length-(th||1)].range[0],_e[_e.length-1].range[1]]),h7=this.performAction.apply(g1,[We,Fs,cn,Jd.yy,Ju[1],kr,_e].concat(bw)),typeof h7<"u")return h7;th&&($t=$t.slice(0,-1*th*2),kr=kr.slice(0,-1*th),_e=_e.slice(0,-1*th)),$t.push(this.productions_[Ju[1]][0]),kr.push(g1.$),_e.push(g1._$),f7=aa[$t[$t.length-2]][$t[$t.length-1]],$t.push(f7);break;case 3:return!0}}return!0},"parse")},Si=(function(){var Vt={EOF:1,parseError:k(function(tr,$t){if(this.yy.parser)this.yy.parser.parseError(tr,$t);else throw new Error(tr)},"parseError"),setInput:k(function(At,tr){return this.yy=tr||this.yy||{},this._input=At,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var At=this._input[0];this.yytext+=At,this.yyleng++,this.offset++,this.match+=At,this.matched+=At;var tr=At.match(/(?:\r\n?|\n).*/g);return tr?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),At},"input"),unput:k(function(At){var tr=At.length,$t=At.split(/(?:\r\n?|\n)/g);this._input=At+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-tr),this.offset-=tr;var Dt=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),$t.length-1&&(this.yylineno-=$t.length-1);var kr=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:$t?($t.length===Dt.length?this.yylloc.first_column:0)+Dt[Dt.length-$t.length].length-$t[0].length:this.yylloc.first_column-tr},this.options.ranges&&(this.yylloc.range=[kr[0],kr[0]+this.yyleng-tr]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(At){this.unput(this.match.slice(At))},"less"),pastInput:k(function(){var At=this.matched.substr(0,this.matched.length-this.match.length);return(At.length>20?"...":"")+At.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var At=this.match;return At.length<20&&(At+=this._input.substr(0,20-At.length)),(At.substr(0,20)+(At.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var At=this.pastInput(),tr=new Array(At.length+1).join("-");return At+this.upcomingInput()+` -`+tr+"^"},"showPosition"),test_match:k(function(At,tr){var $t,Dt,kr;if(this.options.backtrack_lexer&&(kr={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&&(kr.yylloc.range=this.yylloc.range.slice(0))),Dt=At[0].match(/(?:\r\n?|\n).*/g),Dt&&(this.yylineno+=Dt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Dt?Dt[Dt.length-1].length-Dt[Dt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+At[0].length},this.yytext+=At[0],this.match+=At[0],this.matches=At,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(At[0].length),this.matched+=At[0],$t=this.performAction.call(this,this.yy,this,tr,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$t)return $t;if(this._backtrack){for(var _e in kr)this[_e]=kr[_e];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var At,tr,$t,Dt;this._more||(this.yytext="",this.match="");for(var kr=this._currentRules(),_e=0;_etr[0].length)){if(tr=$t,Dt=_e,this.options.backtrack_lexer){if(At=this.test_match($t,kr[_e]),At!==!1)return At;if(this._backtrack){tr=!1;continue}else return!1}else if(!this.options.flex)break}return tr?(At=this.test_match(tr,kr[Dt]),At!==!1?At:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var tr=this.next();return tr||this.lex()},"lex"),begin:k(function(tr){this.conditionStack.push(tr)},"begin"),popState:k(function(){var tr=this.conditionStack.length-1;return tr>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(tr){return tr=this.conditionStack.length-1-Math.abs(tr||0),tr>=0?this.conditionStack[tr]:"INITIAL"},"topState"),pushState:k(function(tr){this.begin(tr)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(tr,$t,Dt,kr){var _e=kr;switch(Dt){case 0:return this.begin("acc_title"),34;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),36;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),$t.yytext="",40;break;case 8:return this.pushState("shapeDataStr"),40;break;case 9:return this.popState(),40;break;case 10:let aa=/\n\s*/g;return $t.yytext=$t.yytext.replace(aa,"
    "),40;break;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return tr.lex.firstGraph()&&this.begin("dir"),12;break;case 36:return tr.lex.firstGraph()&&this.begin("dir"),12;break;case 37:return tr.lex.firstGraph()&&this.begin("dir"),12;break;case 38:return tr.lex.firstGraph()&&this.begin("dir"),12;break;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;break;case 46:return this.popState(),14;break;case 47:return this.popState(),14;break;case 48:return this.popState(),14;break;case 49:return this.popState(),14;break;case 50:return this.popState(),14;break;case 51:return this.popState(),14;break;case 52:return this.popState(),14;break;case 53:return this.popState(),14;break;case 54:return this.popState(),14;break;case 55:return this.popState(),14;break;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;break;case 71:return this.pushState("edgeText"),75;break;case 72:return 119;case 73:return this.popState(),77;break;case 74:return this.pushState("thickEdgeText"),75;break;case 75:return 119;case 76:return this.popState(),77;break;case 77:return this.pushState("dottedEdgeText"),75;break;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;break;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;break;case 83:return this.popState(),55;break;case 84:return this.pushState("text"),54;break;case 85:return this.popState(),57;break;case 86:return this.pushState("text"),56;break;case 87:return 58;case 88:return this.pushState("text"),67;break;case 89:return this.popState(),64;break;case 90:return this.pushState("text"),63;break;case 91:return this.popState(),49;break;case 92:return this.pushState("text"),48;break;case 93:return this.popState(),69;break;case 94:return this.popState(),71;break;case 95:return 117;case 96:return this.pushState("trapText"),68;break;case 97:return this.pushState("trapText"),70;break;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;break;case 110:return this.pushState("text"),62;break;case 111:return this.popState(),51;break;case 112:return this.pushState("text"),50;break;case 113:return this.popState(),31;break;case 114:return this.pushState("text"),29;break;case 115:return this.popState(),66;break;case 116:return this.pushState("text"),65;break;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\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]*)/,/^(?:.*direction\s+TD[^\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,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],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,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Vt})();Ln.lexer=Si;function wn(){this.yy={}}return k(wn,"Parser"),wn.prototype=Ln,Ln.Parser=wn,new wn})();ige.parser=ige;Vut=ige,Hut=Object.assign({},Vut);Hut.parse=e=>{let t=e.replace(/}\s*\n/g,`} -`);return Vut.parse(t)};Fxr=Hut,zxr=k((e,t)=>{let r=z5,n=r(e,"r"),i=r(e,"g"),a=r(e,"b");return ls(n,i,a,t)},"fade"),Gxr=k(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span { - color: ${e.titleColor}; - } - .cluster-label span p { - background-color: transparent; - } - - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${e.strokeWidth??1}px; - } - .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { - text-anchor: middle; - } - - .node .katex path { - fill: #000; - stroke: #000; - stroke-width: 1px; - } - - .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - - .root .anchor path { - fill: ${e.lineColor} !important; - stroke-width: 0; - stroke: ${e.lineColor}; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePaths .path { - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth??2}px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${zxr(e.edgeLabelBackground,.5)}; - // background-color: - } - - .cluster rect { - fill: ${e.clusterBkg}; - stroke: ${e.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - /* Collapsed subgraph node (@{ view: collapsed }) */ - .node .collapsed-indicator { - fill: ${e.clusterBorder}; - stroke: none; - opacity: 0.6; - } - - .node .collapsed-separator { - stroke: ${e.clusterBorder}; - stroke-width: 0.75px; - } - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - - rect.text { - fill: none; - stroke-width: 0; - } - - .icon-shape, .image-shape { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - padding: 2px; - } - .label rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - ${Lg()} -`,"getStyles"),age=Gxr,LM=k(({defaultLayout:e,styles:t=age}={})=>({parser:Fxr,get db(){return new _xr},renderer:Bxr,styles:t,init:k(r=>{r.flowchart||(r.flowchart={});let n=pz().layout??e??r.layout;n&&z9({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,z9({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),qut=LM()});var Mq={};gr(Mq,{createFlowDiagram:()=>LM,diagram:()=>qut});var Lq=H(()=>{oge();Dg();Oh();Fd();O4();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr()});var Yut={};gr(Yut,{diagram:()=>Hxr});var Wxr,Vxr,Hxr,jut=H(()=>{oge();Dg();Oh();Fd();O4();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();Wxr=k(e=>`${age(e)} - .swimlane.cluster rect { - stroke: ${e.clusterBorder} !important; - } - [data-look="neo"].cluster rect { - filter: none; - } -`,"getStyles"),Vxr=Wxr,Hxr=LM({defaultLayout:"swimlane",styles:Vxr})});var Kut={};gr(Kut,{diagram:()=>Zxr});var sge,qxr,Yxr,$ut,jxr,Xut,Dq,Xxr,$xr,Kxr,Zxr,Zut=H(()=>{Oh();Fd();_d();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();_n();Ts();sge=(function(){var e=k(function(Be,ae,he,de){for(he=he||{},de=Be.length;de--;he[Be[de]]=ae);return he},"o"),t=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],n=[1,7],i=[1,9],a=[1,10],o=[1,11],s=[1,12],l=[1,30],u=[1,23],d=[1,24],h=[1,25],f=[1,26],p=[1,27],m=[1,19],g=[1,28],y=[1,29],v=[1,20],b=[1,18],x=[1,21],E=[1,22],w=[2,6],T=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],C=[1,36],S=[1,37],R=[1,38],U=[1,39],L=[1,40],I=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],P=[1,47],D=[1,57],M=[43,51,53,54,55,74,75],O=[1,70],_=[1,68],B=[1,65],F=[1,69],G=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],V=[1,78],$=[1,77],Z=[1,76],re=[69,70,71,72,73],Q=[1,91],ge=[6,9,45,50],ie=[6,9,12,44,45,50,51,52],pe=[1,101],ue=[1,100],fe=[1,99],Me=[18,61],Ce=[1,110],Ye=[1,109],Ze=[20,43,51,53,54,55],Qe=[18,61,64,66],ve={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:k(function(ae,he,de,me,ke,le,W){var X=le.length-1;switch(ke){case 1:break;case 2:this.$=[];break;case 3:this.$=le[X-1].concat(le[X]);break;case 4:this.$=le[X];break;case 5:case 6:this.$=[];break;case 7:me.addEntity(le[X-4]),me.addEntity(le[X-2]),me.addRelationship(le[X-4],le[X],le[X-2],le[X-3]),this.$=[le[X-4],le[X-2]];break;case 8:me.addEntity(le[X-8]),me.addEntity(le[X-4]),me.addRelationship(le[X-8],le[X],le[X-4],le[X-5]),me.setClass([le[X-8]],le[X-6]),me.setClass([le[X-4]],le[X-2]),this.$=[le[X-8],le[X-4]];break;case 9:me.addEntity(le[X-6]),me.addEntity(le[X-2]),me.addRelationship(le[X-6],le[X],le[X-2],le[X-3]),me.setClass([le[X-6]],le[X-4]),this.$=[le[X-6],le[X-2]];break;case 10:me.addEntity(le[X-6]),me.addEntity(le[X-4]),me.addRelationship(le[X-6],le[X],le[X-4],le[X-5]),me.setClass([le[X-4]],le[X-2]),this.$=[le[X-6],le[X-4]];break;case 11:me.addEntity(le[X-3]),me.addAttributes(le[X-3],le[X-1]),this.$=[le[X-3]];break;case 12:me.addEntity(le[X-5]),me.addAttributes(le[X-5],le[X-1]),me.setClass([le[X-5]],le[X-3]),this.$=[le[X-5]];break;case 13:me.addEntity(le[X-2]),this.$=[le[X-2]];break;case 14:me.addEntity(le[X-4]),me.setClass([le[X-4]],le[X-2]),this.$=[le[X-4]];break;case 15:me.addEntity(le[X]),this.$=[le[X]];break;case 16:me.addEntity(le[X-2]),me.setClass([le[X-2]],le[X]),this.$=[le[X-2]];break;case 17:me.addEntity(le[X-6],le[X-4]),me.addAttributes(le[X-6],le[X-1]),this.$=[le[X-6]];break;case 18:me.addEntity(le[X-8],le[X-6]),me.addAttributes(le[X-8],le[X-1]),me.setClass([le[X-8]],le[X-3]),this.$=[le[X-8]];break;case 19:me.addEntity(le[X-5],le[X-3]),this.$=[le[X-5]];break;case 20:me.addEntity(le[X-7],le[X-5]),me.setClass([le[X-7]],le[X-2]),this.$=[le[X-7]];break;case 21:me.addEntity(le[X-3],le[X-1]);break;case 22:me.addEntity(le[X-5],le[X-3]),me.setClass([le[X-5]],le[X]);break;case 23:case 24:this.$=le[X].trim(),me.setAccTitle(this.$);break;case 25:case 26:this.$=le[X].trim(),me.setAccDescription(this.$);break;case 27:me.subgraphDepth?this.$=le[X]:(me.setDirection(le[X].value),this.$=[]);break;case 31:me.subgraphDepth=(me.subgraphDepth||1)-1,this.$=me.addSubGraph({text:le[X-2].id},le[X-1],{text:le[X-2].text});break;case 32:me.subgraphDepth=(me.subgraphDepth||0)+1,this.$={id:le[X-1],text:le[X-1]};break;case 33:me.subgraphDepth=(me.subgraphDepth||0)+1,this.$={id:le[X-4],text:le[X-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=le[X];break;case 35:this.$=le[X-1]+" "+le[X];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=le[X-3],me.addClass(le[X-2],le[X-1]);break;case 41:case 42:case 63:case 72:this.$=[le[X]];break;case 43:case 44:this.$=le[X-2].concat([le[X]]);break;case 45:this.$=le[X-2],me.setClass(le[X-1],le[X]);break;case 46:this.$=le[X-3],me.addCssStyles(le[X-2],le[X-1]);break;case 47:this.$=[le[X]];break;case 48:le[X-2].push(le[X]),this.$=le[X-2];break;case 50:this.$=le[X-1]+le[X];break;case 58:case 84:case 85:this.$=le[X].replace(/"/g,"");break;case 64:le[X].push(le[X-1]),this.$=le[X];break;case 65:this.$={type:le[X-1],name:le[X]};break;case 66:this.$={type:le[X-2],name:le[X-1],keys:le[X]};break;case 67:this.$={type:le[X-2],name:le[X-1],comment:le[X]};break;case 68:this.$={type:le[X-3],name:le[X-2],keys:le[X-1],comment:le[X]};break;case 69:case 71:case 74:this.$=le[X];break;case 70:this.$=le[X-1]+le[X];break;case 73:le[X-2].push(le[X]),this.$=le[X-2];break;case 75:this.$=le[X].replace(/"/g,"");break;case 76:this.$={cardA:le[X],relType:le[X-1],cardB:le[X-2]};break;case 77:this.$=me.Cardinality.ZERO_OR_ONE;break;case 78:this.$=me.Cardinality.ZERO_OR_MORE;break;case 79:this.$=me.Cardinality.ONE_OR_MORE;break;case 80:this.$=me.Cardinality.ONLY_ONE;break;case 81:this.$=me.Cardinality.MD_PARENT;break;case 82:this.$=me.Identification.NON_IDENTIFYING;break;case 83:this.$=me.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,r,{5:3}),{6:[1,4],7:5,8:6,9:n,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:h,40:f,41:p,43:m,46:g,47:y,51:v,53:b,54:x,55:E},e(t,w,{1:[2,1]}),e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:C,70:S,71:R,72:U,73:L}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(T,[2,26]),e(T,[2,27]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,r,{5:44}),e(I,[2,58]),e(I,[2,59]),e(I,[2,60]),e(I,[2,61]),e(I,[2,62]),e(T,[2,36]),e(T,[2,37]),e(T,[2,38]),e(T,[2,39]),{15:45,43:A,44:P},{15:48,43:A,44:P},{15:49,43:A,44:P},{10:50,43:m,51:v,53:b,54:x,55:E},{10:51,43:m,51:v,53:b,54:x,55:E},{15:52,43:A,44:P},{17:53,18:[1,54],56:55,57:56,61:D},{10:58,43:m,51:v,53:b,54:x,55:E},{68:59,74:[1,60],75:[1,61]},e(M,[2,77]),e(M,[2,78]),e(M,[2,79]),e(M,[2,80]),e(M,[2,81]),e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),{6:[1,63],7:5,8:6,9:n,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:h,40:f,41:p,43:m,46:g,47:y,51:v,53:b,54:x,55:E},{12:O,42:64,44:_,45:B,48:66,49:67,51:F,52:G},e(z,[2,41]),e(z,[2,42]),{15:72,43:A,44:P,45:B},{12:O,42:73,44:_,45:B,48:66,49:67,51:F,52:G},{6:V,9:$,19:[1,75],35:74,50:Z},{12:[1,79],14:[1,80]},e(T,[2,16],{67:35,11:81,16:[1,82],45:B,69:C,70:S,71:R,72:U,73:L}),{18:[1,83]},e(T,[2,13]),{17:84,18:[2,63],56:55,57:56,61:D},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:C,70:S,71:R,72:U,73:L},e(re,[2,82]),e(re,[2,83]),e(T,[2,31]),e(T,w),{6:V,9:$,35:90,45:Q,50:Z},{43:[1,92],44:[1,93]},e(ge,[2,47],{49:94,12:O,44:_,51:F,52:G}),e(ie,[2,49]),e(ie,[2,54]),e(ie,[2,55]),e(ie,[2,56]),e(ie,[2,57]),e(T,[2,45],{45:B}),{6:V,9:$,35:95,45:Q,50:Z},e(T,[2,32]),{10:97,36:96,43:m,51:v,53:b,54:x,55:E},e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),{13:98,43:pe,53:ue,76:fe},{15:102,43:A,44:P},{10:103,43:m,51:v,53:b,54:x,55:E},{17:104,18:[1,105],56:55,57:56,61:D},e(T,[2,11]),{18:[2,64]},e(Me,[2,65],{59:106,60:107,63:108,65:Ce,66:Ye}),e([18,61,65,66],[2,71]),{61:[2,70]},e(T,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(T,[2,40]),{12:O,44:_,48:113,49:67,51:F,52:G},e(z,[2,43]),e(z,[2,44]),e(ie,[2,50]),e(T,[2,46]),{10:115,20:[1,114],43:m,51:v,53:b,54:x,55:E},e(Ze,[2,34]),e(T,[2,7]),e(T,[2,84]),e(T,[2,85]),e(T,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},e(T,[2,14]),e(Me,[2,66],{60:120,64:[1,121],66:Ye}),e(Me,[2,67]),e(Qe,[2,72]),e(Me,[2,75]),e(Qe,[2,74]),{17:122,18:[1,123],56:55,57:56,61:D},{15:124,43:A,44:P},e(ge,[2,48],{49:94,12:O,44:_,51:F,52:G}),{6:V,9:$,35:125,50:Z},e(Ze,[2,35]),{13:126,43:pe,53:ue,76:fe},{15:127,43:A,44:P},{13:128,43:pe,53:ue,76:fe},e(T,[2,12]),e(Me,[2,68]),{63:129,65:Ce},{18:[1,130]},e(T,[2,19]),e(T,[2,22],{16:[1,131],45:B}),e(T,[2,33]),e(T,[2,10]),{12:[1,132],45:B},e(T,[2,9]),e(Qe,[2,73]),e(T,[2,17]),{17:133,18:[1,134],56:55,57:56,61:D},{13:135,43:pe,53:ue,76:fe},{18:[1,136]},e(T,[2,20]),e(T,[2,8]),e(T,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:k(function(ae,he){if(he.recoverable)this.trace(ae);else{var de=new Error(ae);throw de.hash=he,de}},"parseError"),parse:k(function(ae){var he=this,de=[0],me=[],ke=[null],le=[],W=this.table,X="",q=0,j=0,se=0,J=2,K=1,ee=le.slice.call(arguments,1),Se=Object.create(this.lexer),Te={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(Te.yy[Ae]=this.yy[Ae]);Se.setInput(ae,Te.yy),Te.yy.lexer=Se,Te.yy.parser=this,typeof Se.yylloc>"u"&&(Se.yylloc={});var Ie=Se.yylloc;le.push(Ie);var Ge=Se.options&&Se.options.ranges;typeof Te.yy.parseError=="function"?this.parseError=Te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(gt){de.length=de.length-2*gt,ke.length=ke.length-gt,le.length=le.length-gt}k(De,"popStack");function He(){var gt;return gt=me.pop()||Se.lex()||K,typeof gt!="number"&&(gt instanceof Array&&(me=gt,gt=me.pop()),gt=he.symbols_[gt]||gt),gt}k(He,"lex");for(var ze,Ke,we,bt,Ve,vt,Pt={},Xt,It,Ot,Et;;){if(we=de[de.length-1],this.defaultActions[we]?bt=this.defaultActions[we]:((ze===null||typeof ze>"u")&&(ze=He()),bt=W[we]&&W[we][ze]),typeof bt>"u"||!bt.length||!bt[0]){var Ee="";Et=[];for(Xt in W[we])this.terminals_[Xt]&&Xt>J&&Et.push("'"+this.terminals_[Xt]+"'");Se.showPosition?Ee="Parse error on line "+(q+1)+`: -`+Se.showPosition()+` -Expecting `+Et.join(", ")+", got '"+(this.terminals_[ze]||ze)+"'":Ee="Parse error on line "+(q+1)+": Unexpected "+(ze==K?"end of input":"'"+(this.terminals_[ze]||ze)+"'"),this.parseError(Ee,{text:Se.match,token:this.terminals_[ze]||ze,line:Se.yylineno,loc:Ie,expected:Et})}if(bt[0]instanceof Array&&bt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+we+", token: "+ze);switch(bt[0]){case 1:de.push(ze),ke.push(Se.yytext),le.push(Se.yylloc),de.push(bt[1]),ze=null,Ke?(ze=Ke,Ke=null):(j=Se.yyleng,X=Se.yytext,q=Se.yylineno,Ie=Se.yylloc,se>0&&se--);break;case 2:if(It=this.productions_[bt[1]][1],Pt.$=ke[ke.length-It],Pt._$={first_line:le[le.length-(It||1)].first_line,last_line:le[le.length-1].last_line,first_column:le[le.length-(It||1)].first_column,last_column:le[le.length-1].last_column},Ge&&(Pt._$.range=[le[le.length-(It||1)].range[0],le[le.length-1].range[1]]),vt=this.performAction.apply(Pt,[X,j,q,Te.yy,bt[1],ke,le].concat(ee)),typeof vt<"u")return vt;It&&(de=de.slice(0,-1*It*2),ke=ke.slice(0,-1*It),le=le.slice(0,-1*It)),de.push(this.productions_[bt[1]][0]),ke.push(Pt.$),le.push(Pt._$),Ot=W[de[de.length-2]][de[de.length-1]],de.push(Ot);break;case 3:return!0}}return!0},"parse")},Fe=(function(){var Be={EOF:1,parseError:k(function(he,de){if(this.yy.parser)this.yy.parser.parseError(he,de);else throw new Error(he)},"parseError"),setInput:k(function(ae,he){return this.yy=he||this.yy||{},this._input=ae,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var ae=this._input[0];this.yytext+=ae,this.yyleng++,this.offset++,this.match+=ae,this.matched+=ae;var he=ae.match(/(?:\r\n?|\n).*/g);return he?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ae},"input"),unput:k(function(ae){var he=ae.length,de=ae.split(/(?:\r\n?|\n)/g);this._input=ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-he),this.offset-=he;var me=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),de.length-1&&(this.yylineno-=de.length-1);var ke=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:de?(de.length===me.length?this.yylloc.first_column:0)+me[me.length-de.length].length-de[0].length:this.yylloc.first_column-he},this.options.ranges&&(this.yylloc.range=[ke[0],ke[0]+this.yyleng-he]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(ae){this.unput(this.match.slice(ae))},"less"),pastInput:k(function(){var ae=this.matched.substr(0,this.matched.length-this.match.length);return(ae.length>20?"...":"")+ae.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var ae=this.match;return ae.length<20&&(ae+=this._input.substr(0,20-ae.length)),(ae.substr(0,20)+(ae.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var ae=this.pastInput(),he=new Array(ae.length+1).join("-");return ae+this.upcomingInput()+` -`+he+"^"},"showPosition"),test_match:k(function(ae,he){var de,me,ke;if(this.options.backtrack_lexer&&(ke={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&&(ke.yylloc.range=this.yylloc.range.slice(0))),me=ae[0].match(/(?:\r\n?|\n).*/g),me&&(this.yylineno+=me.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:me?me[me.length-1].length-me[me.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ae[0].length},this.yytext+=ae[0],this.match+=ae[0],this.matches=ae,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(ae[0].length),this.matched+=ae[0],de=this.performAction.call(this,this.yy,this,he,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),de)return de;if(this._backtrack){for(var le in ke)this[le]=ke[le];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ae,he,de,me;this._more||(this.yytext="",this.match="");for(var ke=this._currentRules(),le=0;lehe[0].length)){if(he=de,me=le,this.options.backtrack_lexer){if(ae=this.test_match(de,ke[le]),ae!==!1)return ae;if(this._backtrack){he=!1;continue}else return!1}else if(!this.options.flex)break}return he?(ae=this.test_match(he,ke[me]),ae!==!1?ae:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var he=this.next();return he||this.lex()},"lex"),begin:k(function(he){this.conditionStack.push(he)},"begin"),popState:k(function(){var he=this.conditionStack.length-1;return he>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(he){return he=this.conditionStack.length-1-Math.abs(he||0),he>=0?this.conditionStack[he]:"INITIAL"},"topState"),pushState:k(function(he){this.begin(he)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(he,de,me,ke){var le=ke;switch(me){case 0:return this.begin("acc_title"),23;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),25;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;break;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;break;case 32:return de.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;break;case 36:return this.popState(),9;break;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;break;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return de.yytext[0];case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}};return Be})();ve.lexer=Fe;function Le(){this.yy={}}return k(Le,"Parser"),Le.prototype=ve,ve.Parser=Le,new Le})();sge.parser=sge;qxr=sge,Yxr=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,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=sn,this.getAccTitle=pn,this.setAccDescription=mn,this.getAccDescription=gn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getConfig=k(()=>je().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),this.addSubGraph=this.addSubGraph.bind(this)}static{k(this,"ErDB")}addEntity(e,t=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,ye.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:je().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ye.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){let r=this.addEntity(e),n;for(n=t.length-1;n>=0;n--)t[n].keys||(t[n].keys=[]),t[n].comment||(t[n].comment=""),r.attributes.push(t[n]),ye.debug("Added attribute ",t[n].name)}addRelationship(e,t,r,n){let i;if(this.subGraphLookup.has(e))i=e;else{let s=this.addEntity(e);if(!s)return;i=s.id}let a;if(this.subGraphLookup.has(r))a=r;else{let s=this.addEntity(r);if(!s)return;a=s.id}let o={entityA:i,roleA:t,entityB:a,relSpec:n};this.relationships.push(o),ye.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let r of e){let n=this.classes.get(r);n?.styles&&(t=[...t,...n.styles??[]].map(i=>i.trim())),n?.textStyles&&(t=[...t,...n.textStyles??[]].map(i=>i.trim()))}return t}addCssStyles(e,t){for(let r of e){let n=this.entities.get(r),i=this.subGraphLookup.get(r);if(t){if(n)for(let a of t)n.cssStyles.push(a);if(i){i.cssStyles||(i.cssStyles=[]);for(let a of t)i.cssStyles.push(a)}}}}addClass(e,t){e.forEach(r=>{let n=this.classes.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.classes.set(r,n)),t&&t.forEach(function(i){if(/color/.exec(i)){let a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)})})}addSubGraph(e,t,r){let n=e.text.trim(),i=r.text,o=k(d=>{let h=new Set,f;return{nodeList:d.filter(m=>{if(m?.stmt)return m.stmt==="dir"&&(f=m.value),!1;if(typeof m!="string")return!1;let g=m.trim();return!g||h.has(g)?!1:(h.add(g),!0)}),dir:f}},"uniq")(t.flat()),s=o.nodeList,l=o.dir;n=n??"subGraph"+this.subCount,i=i||"",i=this.sanitizeText(i),this.subCount=this.subCount+1;let u={id:n,nodes:s,title:i.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(r?.type)};return ye.info("Adding",u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(n,u),n}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let r of e){let n=this.entities.get(r);if(n)for(let a of t)n.cssClasses+=" "+a;let i=this.subGraphLookup.get(r);if(i)for(let a of t)i.classes.push(a)}}subgraphNodeCache(e){let t=new Set;for(let r of e)for(let n of r.nodes)t.add(n);return t}makeUniq(e,t){let r=this.subgraphNodeCache(t),n=[];return e.nodes.forEach((i,a)=>{r.has(i)?ye.warn(`Entity '${i}' already belongs to another subgraph and will be ignored`):n.push(e.nodes[a])}),{nodes:n}}sanitizeText(e){return Lt.sanitizeText(e,je())}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,$r()}getData(){let e=[],t=[],r=je(),n=this.getSubGraphs(),i=new Map,a=new Map;for(let u=n.length-1;u>=0;u--){let d=n[u];d.nodes.length>0&&a.set(d.id,!0);for(let h of d.nodes)i.set(h,d.id)}for(let u=n.length-1;u>=0;u--){let d=n[u];e.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:i.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssStyles:d.cssStyles,cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir,isGroup:!0,look:r.look})}let o=new Set(n.map(u=>u.id)),s=0;for(let u of this.entities.keys()){if(o.has(u))continue;let d=this.entities.get(u);d&&(d.cssCompiledStyles=this.getCompiledStyles(d.cssClasses.split(" ")),d.colorIndex=s++,e.push({...d,parentId:i.get(u),isGroup:!1}))}let l=0;for(let u of this.relationships){let d={id:tg(u.entityA,u.entityB,{prefix:"id",counter:l++}),type:"normal",curve:"basis",start:u.entityA,end:u.entityB,label:u.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:u.relSpec.cardB.toLowerCase(),arrowTypeEnd:u.relSpec.cardA.toLowerCase(),pattern:u.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:r.look,labelType:"markdown"};t.push(d)}return{nodes:e,edges:t,other:{},config:r,direction:this.direction}}},$ut={};Zb($ut,{draw:()=>jxr});jxr=k(async function(e,t,r,n){ye.info("REF0:"),ye.info("Drawing er diagram (unified)",t);let{securityLevel:i,er:a,layout:o}=je(),s=n.db.getData(),l=Hf(t,i);s.type=n.type,s.layoutAlgorithm=Rg(o),s.config.flowchart.nodeSpacing=a?.nodeSpacing||140,s.config.flowchart.rankSpacing=a?.rankSpacing||80,s.direction=n.db.getDirection();let{config:u}=s,{look:d}=u;d==="neo"?s.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],s.diagramId=t,await Gf(s,l),s.layoutAlgorithm==="elk"&&l.select(".edges").lower();let h=l.selectAll('[id*="-background"]');Array.from(h).length>0&&h.each(function(){let p=xt(this),g=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(g)}`);if(!y.empty()){let v=y.attr("transform");p.attr("transform",v)}});let f=8;Nr.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bd(l,f,"erDiagram",a?.useMaxWidth??!0)},"draw"),Xut=k((e,t)=>{let r=z5,n=r(e,"r"),i=r(e,"g"),a=r(e,"b");return ls(n,i,a,t)},"fade"),Dq=new Set(["redux-color","redux-dark-color"]),Xxr=k(e=>{let{theme:t,look:r,bkgColorArray:n,borderColorArray:i}=e;if(!Dq.has(t))return"";let a=n?.length>0,o="";for(let s=0;s{let{look:t,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=e;return` - ${Xxr(e)} - .entityBox { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - } - - .relationshipLabelBox { - fill: ${e.tertiaryColor}; - opacity: 0.7; - background-color: ${e.tertiaryColor}; - rect { - opacity: 0.5; - } - } - - .labelBkg { - background-color: ${Dq.has(r)&&n?n:Xut(e.tertiaryColor,.5)}; - } - - .edgeLabel { - background-color: ${Dq.has(r)&&n?n:e.edgeLabelBackground}; - } - .edgeLabel .label rect { - fill: ${Dq.has(r)&&n?n:e.edgeLabelBackground}; - } - .edgeLabel .label text { - fill: ${e.textColor}; - } - - .edgeLabel .label { - fill: ${e.nodeBorder}; - font-size: 14px; - } - - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - - .edge-pattern-dashed { - stroke-dasharray: 8,8; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon - { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${t==="neo"?i:"1px"}; - } - - .relationshipLine { - stroke: ${e.lineColor}; - stroke-width: ${t==="neo"?i:"1px"}; - fill: none; - } - - .marker { - fill: none !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; - } - [data-look=neo].labelBkg { - background-color: ${Xut(e.tertiaryColor,.5)}; - } - - .cluster rect { - fill: ${e.clusterBkg??e.mainBkg}; - stroke: ${e.clusterBorder??e.nodeBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor??e.textColor}; - } - - .cluster-label text { - fill: ${e.titleColor??e.textColor}; - } -`},"getStyles"),Kxr=$xr,Zxr={parser:qxr,get db(){return new Yxr},renderer:$ut,styles:Kxr}});var mS,Nq=H(()=>{xr();mS=class{constructor(e){this.init=e,this.records=this.init()}static{k(this,"ImperativeState")}reset(){this.records=this.init()}}});function ra(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}var _u=H(()=>{xr();k(ra,"populateCommonDb")});function Ds(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function Ou(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function Vg(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function fve(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function v3(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}function Yy(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function K3(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function xj(e){return Yy(e)&&typeof e.fullText=="string"}function Jht(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function vL(e){return!!e&&typeof e[Symbol.iterator]=="function"}function na(...e){if(e.length===1){let t=e[0];if(t instanceof Gg)return t;if(vL(t))return new Gg(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new Gg(()=>({index:0}),r=>r.index1?new Gg(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex{Ds(i)&&(i.$container=e,i.$containerProperty=r,i.$containerIndex=a,t.deep&&VS(i,t))}):Ds(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&VS(n,t)))}function Z3(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}function eft(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}function I0(e){let r=OS(e).$document;if(!r)throw new Error("AST node has no document.");return r}function OS(e){for(;e.$container;)e=e.$container;return e}function IY(e){return Ou(e)?e.ref?[e.ref]:[]:Vg(e)?e.items.map(t=>t.ref):[]}function BL(e,t){if(!e)throw new Error("Node must be an AstNode.");let r=t?.range;return new Gg(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexBL(r,t))}function R0(e,t){if(e){if(t?.range&&!RY(e,t.range))return new WS(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new WS(e,r=>BL(r,t),{includeRoot:!0})}function RY(e,t){if(!t)return!0;let r=e.$cstNode?.range;return r?Fve(r,t):!1}function HS(e){return new Gg(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexYy(t)?t.content:[],{includeRoot:!0})}function bft(e){return YS(e).filter(K3)}function Ove(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function xL(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function jS(e){if(!e)return;let{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}function Bve(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return zg.After;let r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.linezg.After}function xft(e,t,r=zve){if(e){if(t>0){let n=t-e.offset,i=e.text.charAt(n);r.test(i)||t--}return Aj(e,t)}}function Gve(e,t){if(e){let r=Hve(e,!0);if(r&&qY(r,t))return r;if(xj(e)){let n=e.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let a=e.content[i];if(qY(a,t))return a}}}}function qY(e,t){return K3(e)&&t.includes(e.tokenType.name)}function Aj(e,t){if(K3(e))return e;if(Yy(e)){let r=Vve(e,t,!1);if(r)return Aj(r,t)}}function Wve(e,t){if(K3(e))return e;if(Yy(e)){let r=Vve(e,t,!0);if(r)return Wve(r,t)}}function Vve(e,t,r){let n=0,i=e.content.length-1,a;for(;n<=i;){let o=Math.floor((n+i)/2),s=e.content[o];if(s.offset<=t&&s.end>t)return s;s.end<=t?(a=r?s:void 0,n=o+1):i=o-1}return a}function Hve(e,t=!0){for(;e.container;){let r=e.container,n=r.content.indexOf(e);for(;n>0;){n--;let i=r.content[n];if(t||!i.hidden)return i}e=r}}function wft(e,t=!0){for(;e.container;){let r=e.container,n=r.content.indexOf(e),i=r.content.length-1;for(;nt.test(r))}function eA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $ve(e,t){let r=Kve(e),n=t.match(r);return!!n&&n[0].length>0}function Kve(e){typeof e=="string"&&(e=new RegExp(e));let t=e,r=e.source,n=0;function i(){let a="",o;function s(u){a+=r.substr(n,u),n+=u}N(s,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(N(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?s(o[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":o=n,n+=3,i(),a+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,i(),a+=r.substr(o,n-o);break;default:s(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else s(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return N(i,"process"),new RegExp(i(),e.flags)}function Zve(e){return e.rules.find(t=>zu(t)&&t.entry)}function Qve(e){return e.rules.filter(t=>$f(t)&&t.hidden)}function Mj(e,t){let r=new Set,n=Zve(e);if(!n)return new Set(e.rules);let i=[n].concat(Qve(e));for(let o of i)Jve(o,r,t);let a=new Set;for(let o of e.rules)(r.has(o.name)||$f(o)&&o.hidden)&&a.add(o);return a}function Jve(e,t,r){t.add(e.name),rv(e).forEach(n=>{if($y(n)||r&&kj(n)){let i=n.rule.ref;i&&!t.has(i.name)&&Jve(i,t,r)}})}function Rft(e){let t=new Set;return rv(e).forEach(r=>{J3(r)&&(zu(r.type.ref)&&t.add(r.type.ref),FL(r.type.ref)&&zu(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}function ebe(e){if(e.terminal)return e.terminal;if(e.type.ref)return _j(e.type.ref)?.terminal}function tbe(e){return e.hidden&&!Rj(WL(e))}function rbe(e,t){return!e||!t?[]:Dj(e,t,e.astNode,!0)}function Lj(e,t,r){if(!e||!t)return;let n=Dj(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Dj(e,t,r,n){if(!n){let i=Z3(e.grammarSource,jy);if(i&&i.feature===t)return[e]}return Yy(e)&&e.astNode===r?e.content.flatMap(i=>Dj(i,t,r,!1)):[]}function Mft(e,t){return e?Nj(e,t,e?.astNode):[]}function nbe(e,t,r){if(!e)return;let n=Nj(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Nj(e,t,r){if(e.astNode!==r)return[];if(Xy(e.grammarSource)&&e.grammarSource.value===t)return[e];let n=YS(e).iterator(),i,a=[];do if(i=n.next(),!i.done){let o=i.value;o.astNode===r?Xy(o.grammarSource)&&o.grammarSource.value===t&&a.push(o):n.prune()}while(!i.done);return a}function ibe(e){let t=e.astNode;for(;t===e.container?.astNode;){let r=Z3(e.grammarSource,jy);if(r)return r;e=e.container}}function _j(e){let t=e;return FL(t)&&(Px(t.$container)?t=t.$container.$container:Q3(t.$container)?t=t.$container:Wx(t.$container)),abe(e,t,new Map)}function abe(e,t,r){function n(i,a){let o;return Z3(i,jy)||(o=abe(a,a,r)),r.set(e,o),o}if(N(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(let i of rv(t)){if(jy(i)&&i.feature.toLowerCase()==="name")return r.set(e,i),i;if($y(i)&&zu(i.rule.ref))return n(i,i.rule.ref);if(Tj(i)&&i.typeRef?.ref)return n(i,i.typeRef.ref)}}function obe(e){let t=e.$container;if(e6(t)){let r=t.elements,n=r.indexOf(e);for(let i=n-1;i>=0;i--){let a=r[i];if(Px(a))return a;{let o=rv(r[i]).find(Px);if(o)return o}}}if(wj(t))return obe(t)}function Lft(e,t){return e==="?"||e==="*"||e6(t)&&!!t.guardCondition}function Dft(e){return e==="*"||e==="+"}function Nft(e){return e==="+="}function zL(e){return sbe(e,new Set)}function sbe(e,t){if(t.has(e))return!0;t.add(e);for(let r of rv(e))if($y(r)){if(!r.rule.ref||zu(r.rule.ref)&&!sbe(r.rule.ref,t)||qS(r.rule.ref))return!1}else{if(jy(r))return!1;if(Px(r))return!1}return!!e.definition}function _ft(e){return XY(e.type,new Set)}function XY(e,t){if(t.has(e))return!0;if(t.add(e),vve(e))return!1;if(Uve(e))return!1;if(Dve(e))return e.types.every(r=>XY(r,t));if(Tj(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){let r=e.typeRef.ref;return Cj(r)?XY(r.type,t):!1}else return!1}else return!1}function GL(e){if(!$f(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){let t=e.returnType.ref;if(t)return t.name}}}function q3(e){if(Q3(e))return zu(e)&&zL(e)?e.name:GL(e)??e.name;if(kve(e)||Cj(e)||Rve(e))return e.name;if(Px(e)){let t=lbe(e);if(t)return t}else if(FL(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function lbe(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return q3(e.type.ref)}function Pft(e){return $f(e)?e.type?.name??"string":zu(e)&&zL(e)?e.name:GL(e)??e.name}function cbe(e){return $f(e)?e.type?.name??"string":GL(e)??e.name}function WL(e){let t={s:!1,i:!1,u:!1},r=t6(e.definition,t),n=Object.entries(t).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}function t6(e,t){if(Mve(e))return Oft(e);if(Lve(e))return Bft(e);if(xve(e))return Gft(e);if(kj(e)){let r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return Hg(t6(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(Cve(e))return zft(e);if(Nve(e))return Fft(e);if(Ive(e)){let r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),i=e.regex.substring(r+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),Hg(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(_ve(e))return Hg(ube,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}function Oft(e){return Hg(e.elements.map(t=>t6(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function Bft(e){return Hg(e.elements.map(t=>t6(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function Fft(e){return Hg(`${ube}*?${t6(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function zft(e){return Hg(`(?!${t6(e.terminal)})${ube}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function Gft(e){return e.right?Hg(`[${lY(e.left)}-${lY(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):Hg(lY(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function lY(e){return eA(e.value)}function Hg(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function dbe(e){let t=[],r=e.Grammar;for(let n of r.rules)$f(n)&&tbe(n)&&Xve(WL(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:zve}}function Hft(e){var t=Vwr.call(e,NM),r=e[NM];try{e[NM]=void 0;var n=!0}catch{}var i=Hwr.call(e);return n&&(t?e[NM]=r:delete e[NM]),i}function qft(e){return jwr.call(e)}function Yft(e){return e==null?e===void 0?Kwr:$wr:tdt&&tdt in Object(e)?qwr(e):Xwr(e)}function jft(e){return e!=null&&typeof e=="object"}function Xft(e){return typeof e=="symbol"||D0(e)&&Vx(e)==Zwr}function $ft(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=N5r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function fpt(e){return function(){return e}}function ppt(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}function Tpt(e,t){var r=typeof e;return t=t??Y5r,!!t&&(r=="number"||r!="symbol"&&j5r.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Z5r}function Mpt(e){return e!=null&&gbe(e.length)&&!nv(e)}function Lpt(e,t,r){if(!Xf(r))return!1;var n=typeof t;return(n=="number"?jg(r)&&Oj(t,r.length):n=="string"&&t in r)?YL(r[t],e):!1}function Dpt(e){return mbe(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&Fj(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n-1}function u0t(e,t){var r=this.__data__,n=Wj(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function a6(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(s)?t>1?wbe(s,t-1,r,n,i):xbe(i,s):n||(i[i.length]=s)}return i}function S0t(e){var t=e==null?0:e.length;return t?Ebe(e,1):[]}function U0t(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++ns))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=r&SEr?new Sbe:void 0;for(a.set(e,t),a.set(t,e);++h=bTr&&(a=Abe,o=!1,t=new Sbe(t));e:for(;++i-1?i[a?t[o]:o]:void 0}}function ugt(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:HL(r);return i<0&&(i=STr(n+i,0)),ypt(e,Xg(t,3),i)}function dgt(e){return e&&e.length?e[0]:void 0}function hgt(e,t){var r=-1,n=jg(e)?Array(e.length):[];return l6(e,function(i,a,o){n[++r]=t(i,a,o)}),n}function fgt(e,t){var r=wi(e)?VL:ITr;return r(e,Xg(t,3))}function pgt(e,t){return Ebe(Br(e,t),1)}function mgt(e,t){return e!=null&&_Tr.call(e,t)}function ggt(e,t){return e!=null&&Nmt(e,t,PTr)}function ygt(e){return typeof e=="string"||!wi(e)&&D0(e)&&Vx(e)==OTr}function vgt(e,t){return VL(t,function(r){return e[r]})}function bgt(e){return e==null?[]:BTr(e,zh(e))}function xgt(e,t,r,n){e=jg(e)?e:cl(e),r=r&&!n?HL(r):0;var i=e.length;return r<0&&(r=FTr(i+r,0)),Wd(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&fbe(e,t,r)>-1}function wgt(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:HL(r);return i<0&&(i=zTr(n+i,0)),fbe(e,t,i)}function Egt(e){if(e==null)return!0;if(jg(e)&&(wi(e)||typeof e=="string"||typeof e.splice=="function"||wL(e)||ybe(e)||zj(e)))return!e.length;var t=XS(e);if(t==GTr||t==WTr)return!e.size;if(XL(e))return!Xpt(e).length;for(var r in e)if(HTr.call(e,r))return!1;return!0}function Tgt(e){return D0(e)&&Vx(e)==qTr}function kgt(e){return e===void 0}function Cgt(e){if(typeof e!="function")throw new TypeError(XTr);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)}}function Sgt(e,t,r,n){if(!Xf(e))return e;t=jj(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=nkr){var u=t?null:rkr(e);if(u)return Ube(u);o=!1,i=Abe,l=new Sbe}else l=t?[]:s;e:for(;++nSL(n,t)):e instanceof Gu&&Hu(t,e)?!1:e instanceof $g?(e instanceof Gu&&t.push(e),L0(e.definition,n=>SL(n,t))):!1}function Ggt(e){return e instanceof qd}function A0(e){if(e instanceof Gu)return"SUBRULE";if(e instanceof pc)return"OPTION";if(e instanceof qd)return"OR";if(e instanceof Vh)return"AT_LEAST_ONE";if(e instanceof Hh)return"AT_LEAST_ONE_SEP";if(e instanceof Hd)return"MANY_SEP";if(e instanceof Zo)return"MANY";if(e instanceof ja)return"CONSUME";throw Error("non exhaustive match")}function O1e(e,t,r){return[new pc({definition:[new ja({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}function nA(e){if(e instanceof Gu)return nA(e.referencedRule);if(e instanceof ja)return Hgt(e);if(zgt(e))return Wgt(e);if(Ggt(e))return Vgt(e);throw Error("non exhaustive match")}function Wgt(e){let t=[],r=e.definition,n=0,i=r.length>n,a,o=!0;for(;i&&o;)a=r[n],o=SL(a),t=t.concat(nA(a)),n=n+1,i=r.length>n;return Mbe(t)}function Vgt(e){let t=Br(e.definition,r=>nA(r));return Mbe(M0(t))}function Hgt(e){return[e.terminalType]}function Ygt(e){let t={};return bn(e,r=>{let n=new akr(r).startWalking();Gh(t,n)}),t}function jgt(e,t){return e.name+t+qgt}function QL(e){let t=e.toString();if(cY.hasOwnProperty(t))return cY[t];{let r=okr.pattern(t);return cY[t]=r,r}}function Xgt(){cY={}}function Kgt(e,t=!1){try{let r=QL(e);return JY(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===$gt)t&&Lbe(`${QY} Unable to optimize: < ${e.toString()} > - Complement Sets cannot be automatically optimized. - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),ZY(`${QY} - Failed parsing: < ${e.toString()} > - Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function JY(e,t,r){switch(e.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")KM(l,t,r);else{let u=l;if(r===!0)for(let d=u.from;d<=u.to;d++)KM(d,t,r);else{for(let d=u.from;d<=u.to&&d=QM){let d=u.from>=QM?u.from:QM,h=u.to,f=Qy(d),p=Qy(h);for(let m=f;m<=p;m++)t[m]=m}}}});break;case"Group":JY(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}let s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&ej(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return cl(t)}function KM(e,t,r){let n=Qy(e);t[n]=n,r===!0&&Zgt(e,t)}function Zgt(e,t){let r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){let i=Qy(n.charCodeAt(0));t[i]=i}else{let i=r.toLowerCase();if(i!==r){let a=Qy(i.charCodeAt(0));t[a]=a}}}function B1e(e,t){return $S(e.value,r=>{if(typeof r=="number")return Hu(t,r);{let n=r;return $S(t,i=>n.from<=i&&i<=n.to)!==void 0}})}function ej(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?wi(e.value)?L0(e.value,ej):ej(e.value):!1}function Zj(e,t){if(t instanceof RegExp){let r=QL(t),n=new skr(e);return n.visit(r),n.found}else return $S(t,r=>Hu(e,r.charCodeAt(0)))!==void 0}function Qgt(e,t){t=Rbe(t,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:N((b,x)=>x(),"tracer")});let r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{b1t()});let n;r("Reject Lexer.NA",()=>{n=$j(e,b=>b[j3]===Fu.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Br(n,b=>{let x=b[j3];if(Ky(x)){let E=x.source;return E.length===1&&E!=="^"&&E!=="$"&&E!=="."&&!x.ignoreCase?E:E.length===2&&E[0]==="\\"&&!Hu(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],E[1])?E[1]:F1e(x)}else{if(nv(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{let E=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),w=new RegExp(E);return F1e(w)}}else throw Error("non exhaustive match")}})});let o,s,l,u,d;r("misc mapping",()=>{o=Br(n,b=>b.tokenTypeIdx),s=Br(n,b=>{let x=b.GROUP;if(x!==Fu.SKIPPED){if(Wd(x))return x;if(Zy(x))return!1;throw Error("non exhaustive match")}}),l=Br(n,b=>{let x=b.LONGER_ALT;if(x)return wi(x)?Br(x,w=>Ddt(n,w)):[Ddt(n,x)]}),u=Br(n,b=>b.PUSH_MODE),d=Br(n,b=>an(b,"POP_MODE"))});let h;r("Line Terminator Handling",()=>{let b=Obe(t.lineTerminatorCharacters);h=Br(n,x=>!1),t.positionTracking!=="onlyOffset"&&(h=Br(n,x=>an(x,"LINE_BREAKS")?!!x.LINE_BREAKS:Pbe(x,b)===!1&&Zj(b,x.PATTERN)))});let f,p,m,g;r("Misc Mapping #2",()=>{f=Br(n,_be),p=Br(a,y1t),m=Wh(n,(b,x)=>{let E=x.GROUP;return Wd(E)&&E!==Fu.SKIPPED&&(b[E]=[]),b},{}),g=Br(a,(b,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:h[x],isCustom:f[x],short:p[x],group:s[x],push:u[x],pop:d[x],tokenTypeIdx:o[x],tokenType:n[x]}))});let y=!0,v=[];return t.safeMode||r("First Char Optimization",()=>{v=Wh(n,(b,x,E)=>{if(typeof x.PATTERN=="string"){let w=x.PATTERN.charCodeAt(0),T=Qy(w);uY(b,T,g[E])}else if(wi(x.START_CHARS_HINT)){let w;bn(x.START_CHARS_HINT,T=>{let C=typeof T=="string"?T.charCodeAt(0):T,S=Qy(C);w!==S&&(w=S,uY(b,S,g[E]))})}else if(Ky(x.PATTERN))if(x.PATTERN.unicode)y=!1,t.ensureOptimizations&&ZY(`${QY} Unable to analyze < ${x.PATTERN.toString()} > pattern. - The regexp unicode flag is not currently supported by the regexp-to-ast library. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let w=Kgt(x.PATTERN,t.ensureOptimizations);Da(w)&&(y=!1),bn(w,T=>{uY(b,T,g[E])})}else t.ensureOptimizations&&ZY(`${QY} TokenType: <${x.name}> is using a custom token pattern without providing parameter. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return b},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}function Jgt(e,t){let r=[],n=t1t(e);r=r.concat(n.errors);let i=r1t(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(e1t(a)),r=r.concat(l1t(a)),r=r.concat(c1t(a,t)),r=r.concat(u1t(a)),r}function e1t(e){let t=[],r=Kf(e,n=>Ky(n[j3]));return t=t.concat(n1t(r)),t=t.concat(a1t(r)),t=t.concat(o1t(r)),t=t.concat(s1t(r)),t=t.concat(i1t(r)),t}function t1t(e){let t=Kf(e,i=>!an(i,j3)),r=Br(t,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Qo.MISSING_PATTERN,tokenTypes:[i]})),n=Xj(e,t);return{errors:r,valid:n}}function r1t(e){let t=Kf(e,i=>{let a=i[j3];return!Ky(a)&&!nv(a)&&!an(a,"exec")&&!Wd(a)}),r=Br(t,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Qo.INVALID_PATTERN,tokenTypes:[i]})),n=Xj(e,t);return{errors:r,valid:n}}function n1t(e){class t extends Ij{static{N(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}}let r=Kf(e,i=>{let a=i.PATTERN;try{let o=QL(a),s=new t;return s.visit(o),s.found}catch{return lkr.test(a.source)}});return Br(r,i=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Qo.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function i1t(e){let t=Kf(e,n=>n.PATTERN.test(""));return Br(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Qo.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}function a1t(e){class t extends Ij{static{N(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}}let r=Kf(e,i=>{let a=i.PATTERN;try{let o=QL(a),s=new t;return s.visit(o),s.found}catch{return ckr.test(a.source)}});return Br(r,i=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Qo.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function o1t(e){let t=Kf(e,n=>{let i=n[j3];return i instanceof RegExp&&(i.multiline||i.global)});return Br(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Qo.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function s1t(e){let t=[],r=Br(e,a=>Wh(e,(o,s)=>(a.PATTERN.source===s.PATTERN.source&&!Hu(t,s)&&s.PATTERN!==Fu.NA&&(t.push(s),o.push(s)),o),[]));r=ZL(r);let n=Kf(r,a=>a.length>1);return Br(n,a=>{let o=Br(a,l=>l.name);return{message:`The same RegExp pattern ->${N0(a).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Qo.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}function l1t(e){let t=Kf(e,n=>{if(!an(n,"GROUP"))return!1;let i=n.GROUP;return i!==Fu.SKIPPED&&i!==Fu.NA&&!Wd(i)});return Br(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Qo.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function c1t(e,t){let r=Kf(e,i=>i.PUSH_MODE!==void 0&&!Hu(t,i.PUSH_MODE));return Br(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Qo.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function u1t(e){let t=[],r=Wh(e,(n,i,a)=>{let o=i.PATTERN;return o===Fu.NA||(Wd(o)?n.push({str:o,idx:a,tokenType:i}):Ky(o)&&h1t(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return bn(e,(n,i)=>{bn(r,({str:a,idx:o,tokenType:s})=>{if(i${s.name}<- can never be matched. -Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:l,type:Qo.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),t}function d1t(e,t){if(Ky(t)){if(f1t(t))return!1;let r=t.exec(e);return r!==null&&r.index===0}else{if(nv(t))return t(e,0,[],{});if(an(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function h1t(e){return $S([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}function f1t(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:Qo.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),an(e,Oq)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Oq+`> property in its definition -`,type:Qo.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),an(e,Oq)&&an(e,ZM)&&!an(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${ZM}: <${e.defaultMode}>which does not exist -`,type:Qo.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),an(e,Oq)&&bn(e.modes,(i,a)=>{bn(i,(o,s)=>{if(Zy(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${s}> -`,type:Qo.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(an(o,"LONGER_ALT")){let l=wi(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];bn(l,u=>{!Zy(u)&&!Hu(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${a}> -`,type:Qo.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function m1t(e,t,r){let n=[],i=!1,a=ZL(M0(cl(e.modes))),o=$j(a,l=>l[j3]===Fu.NA),s=Obe(r);return t&&bn(o,l=>{let u=Pbe(l,s);if(u!==!1){let h={message:v1t(l,u),type:u.issue,tokenType:l};n.push(h)}else an(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Zj(s,l.PATTERN)&&(i=!0)}),t&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. - This Lexer has been defined to track line and column information, - But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:Qo.NO_LINE_BREAKS_FLAGS}),n}function g1t(e){let t={},r=zh(e);return bn(r,n=>{let i=e[n];if(wi(i))t[n]=[];else throw Error("non exhaustive match")}),t}function _be(e){let t=e.PATTERN;if(Ky(t))return!1;if(nv(t))return!0;if(an(t,"exec"))return!0;if(Wd(t))return!1;throw Error("non exhaustive match")}function y1t(e){return Wd(e)&&e.length===1?e.charCodeAt(0):!1}function Pbe(e,t){if(an(e,"LINE_BREAKS"))return!1;if(Ky(e.PATTERN)){try{Zj(t,e.PATTERN)}catch(r){return{issue:Qo.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Wd(e.PATTERN))return!1;if(_be(e))return{issue:Qo.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function v1t(e,t){if(t.issue===Qo.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern. - The problem is in the <${e.name}> Token Type - Root cause: ${t.errMsg}. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Qo.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. - The problem is in the <${e.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Obe(e){return Br(e,r=>Wd(r)?r.charCodeAt(0):r)}function uY(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function Qy(e){return e255?255+~~(e/255):e}}function iA(e,t){let r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}function AL(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}function aA(e){let t=w1t(e);E1t(t),k1t(t),T1t(t),bn(t,r=>{r.isParent=r.categoryMatches.length>0})}function w1t(e){let t=mc(e),r=e,n=!0;for(;n;){r=ZL(M0(Br(r,a=>a.CATEGORIES)));let i=Xj(r,t);t=t.concat(i),Da(i)?n=!1:r=i}return t}function E1t(e){bn(e,t=>{Fbe(t)||(x1t[_dt]=t,t.tokenTypeIdx=_dt++),z1e(t)&&!wi(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),z1e(t)||(t.CATEGORIES=[]),C1t(t)||(t.categoryMatches=[]),S1t(t)||(t.categoryMatchesMap={})})}function T1t(e){bn(e,t=>{t.categoryMatches=[],bn(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(x1t[n].tokenTypeIdx)})})}function k1t(e){bn(e,t=>{Bbe([],t)})}function Bbe(e,t){bn(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),bn(t.CATEGORIES,r=>{let n=e.concat(t);Hu(n,r)||Bbe(n,r)})}function Fbe(e){return an(e,"tokenTypeIdx")}function z1e(e){return an(e,"CATEGORIES")}function C1t(e){return an(e,"categoryMatches")}function S1t(e){return an(e,"categoryMatchesMap")}function A1t(e){return an(e,"tokenTypeIdx")}function V3(e){return zbe(e)?e.LABEL:e.name}function zbe(e){return Wd(e.LABEL)&&e.LABEL!==""}function FS(e){return U1t(e)}function U1t(e){let t=e.pattern,r={};if(r.name=e.name,Zy(t)||(r.PATTERN=t),an(e,dkr))throw`The parent property is no longer supported. -See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return an(e,Pdt)&&(r.CATEGORIES=e[Pdt]),aA([r]),an(e,Odt)&&(r.LABEL=e[Odt]),an(e,Bdt)&&(r.GROUP=e[Bdt]),an(e,zdt)&&(r.POP_MODE=e[zdt]),an(e,Fdt)&&(r.PUSH_MODE=e[Fdt]),an(e,Gdt)&&(r.LONGER_ALT=e[Gdt]),an(e,Wdt)&&(r.LINE_BREAKS=e[Wdt]),an(e,Vdt)&&(r.START_CHARS_HINT=e[Vdt]),r}function JL(e,t,r,n,i,a,o,s){return{image:t,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function Gbe(e,t){return iA(e,t)}function I1t(e,t){let r=new fkr(e,t);return r.resolveRefs(),r.errors}function tj(e,t,r=[]){r=mc(r);let n=[],i=0;function a(s){return s.concat(fc(e,i+1))}N(a,"remainingPathWith");function o(s){let l=tj(a(s),t,r);return n.concat(l)}for(N(o,"getAlternativesForProd");r.length{Da(l.definition)===!1&&(n=o(l.definition))}),n;if(s instanceof ja)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:fc(e,i)}),n}function Wbe(e,t,r,n){let i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE",s=!1,l=t.length,u=l-n-1,d=[],h=[];for(h.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!Da(h);){let f=h.pop();if(f===o){s&&Y3(h).idx<=u&&h.pop();continue}let p=f.def,m=f.idx,g=f.ruleStack,y=f.occurrenceStack;if(Da(p))continue;let v=p[0];if(v===i){let b={idx:m,def:fc(p),ruleStack:CL(g),occurrenceStack:CL(y)};h.push(b)}else if(v instanceof ja)if(m=0;b--){let x=v.definition[b],E={idx:m,def:x.definition.concat(fc(p)),ruleStack:g,occurrenceStack:y};h.push(E),h.push(o)}else if(v instanceof Vd)h.push({idx:m,def:v.definition.concat(fc(p)),ruleStack:g,occurrenceStack:y});else if(v instanceof tA)h.push(R1t(v,m,g,y));else throw Error("non exhaustive match")}return d}function R1t(e,t,r,n){let i=mc(r);i.push(e.name);let a=mc(n);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}function Jj(e){if(e instanceof pc||e==="Option")return Ro.OPTION;if(e instanceof Zo||e==="Repetition")return Ro.REPETITION;if(e instanceof Vh||e==="RepetitionMandatory")return Ro.REPETITION_MANDATORY;if(e instanceof Hh||e==="RepetitionMandatoryWithSeparator")return Ro.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof Hd||e==="RepetitionWithSeparator")return Ro.REPETITION_WITH_SEPARATOR;if(e instanceof qd||e==="Alternation")return Ro.ALTERNATION;throw Error("non exhaustive match")}function W1e(e){let{occurrence:t,rule:r,prodType:n,maxLookahead:i}=e,a=Jj(n);return a===Ro.ALTERNATION?eD(t,r,i):tD(t,r,a,i)}function M1t(e,t,r,n,i,a){let o=eD(e,t,r),s=Hbe(o)?AL:iA;return a(o,n,s,i)}function L1t(e,t,r,n,i,a){let o=tD(e,t,i,r),s=Hbe(o)?AL:iA;return a(o[0],s,n)}function D1t(e,t,r,n){let i=e.length,a=L0(e,o=>L0(o,s=>s.length===1));if(t)return function(o){let s=Br(o,l=>l.GATE);for(let l=0;lM0(l)),s=Wh(o,(l,u,d)=>(bn(u,h=>{an(l,h.tokenTypeIdx)||(l[h.tokenTypeIdx]=d),bn(h.categoryMatches,f=>{an(l,f)||(l[f]=d)})}),l),{});return function(){let l=this.LA(1);return s[l.tokenTypeIdx]}}else return function(){for(let o=0;oa.length===1),i=e.length;if(n&&!r){let a=M0(e);if(a.length===1&&Da(a[0].categoryMatches)){let s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{let o=Wh(a,(s,l,u)=>(s[l.tokenTypeIdx]=!0,bn(l.categoryMatches,d=>{s[d]=!0}),s),[]);return function(){let s=this.LA(1);return o[s.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;atj([o],1)),n=V1e(r.length),i=Br(r,o=>{let s={};return bn(o,l=>{let u=hY(l.partialPath);bn(u,d=>{s[d]=!0})}),s}),a=r;for(let o=1;o<=t;o++){let s=a;a=V1e(s.length);for(let l=0;l{let v=hY(y.partialPath);bn(v,b=>{i[l][b]=!0})})}}}}return n}function eD(e,t,r,n){let i=new _1t(e,Ro.ALTERNATION,n);return t.accept(i),Vbe(i.result,r)}function tD(e,t,r,n){let i=new _1t(e,r);t.accept(i);let a=i.result,s=new vkr(t,e,r).startWalking(),l=new Vd({definition:a}),u=new Vd({definition:s});return Vbe([l,u],n)}function rj(e,t){e:for(let r=0;r{let i=t[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Hbe(e){return L0(e,t=>L0(t,r=>L0(r,n=>Da(n.categoryMatches))))}function B1t(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return Br(t,r=>Object.assign({type:Wu.CUSTOM_LOOKAHEAD_VALIDATION},r))}function F1t(e,t,r,n){let i=Yf(e,l=>z1t(l,r)),a=K1t(e,t,r),o=Yf(e,l=>Y1t(l,r)),s=Yf(e,l=>W1t(l,e,n,r));return i.concat(a,o,s)}function z1t(e,t){let r=new bkr;e.accept(r);let n=r.allProductions,i=DTr(n,G1t),a=_0(i,s=>s.length>1);return Br(cl(a),s=>{let l=N0(s),u=t.buildDuplicateFoundError(e,s),d=A0(l),h={message:u,type:Wu.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:d,occurrence:l.idx},f=qbe(l);return f&&(h.parameter=f),h})}function G1t(e){return`${A0(e)}_#_${e.idx}_#_${qbe(e)}`}function qbe(e){return e instanceof ja?e.terminalType.name:e instanceof Gu?e.nonTerminalName:""}function W1t(e,t,r,n){let i=[];if(Wh(t,(o,s)=>s.name===e.name?o+1:o,0)>1){let o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:o,type:Wu.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function V1t(e,t,r){let n=[],i;return Hu(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:Wu.INVALID_RULE_OVERRIDE,ruleName:e})),n}function Ybe(e,t,r,n=[]){let i=[],a=hL(t.definition);if(Da(a))return[];{let o=e.name;Hu(a,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:Wu.LEFT_RECURSION,ruleName:o});let l=Xj(a,n.concat([e])),u=Yf(l,d=>{let h=mc(n);return h.push(d),Ybe(e,d,r,h)});return i.concat(u)}}function hL(e){let t=[];if(Da(e))return t;let r=N0(e);if(r instanceof Gu)t.push(r.referencedRule);else if(r instanceof Vd||r instanceof pc||r instanceof Vh||r instanceof Hh||r instanceof Hd||r instanceof Zo)t=t.concat(hL(r.definition));else if(r instanceof qd)t=M0(Br(r.definition,a=>hL(a.definition)));else if(!(r instanceof ja))throw Error("non exhaustive match");let n=SL(r),i=e.length>1;if(n&&i){let a=fc(e);return t.concat(hL(a))}else return t}function H1t(e,t){let r=new jbe;e.accept(r);let n=r.alternations;return Yf(n,a=>{let o=CL(a.definition);return Yf(o,(s,l)=>{let u=Wbe([s],[],iA,1);return Da(u)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:a,emptyChoiceIdx:l}),type:Wu.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:a.idx,alternative:l+1}]:[]})})}function q1t(e,t,r){let n=new jbe;e.accept(n);let i=n.alternations;return i=$j(i,o=>o.ignoreAmbiguities===!0),Yf(i,o=>{let s=o.idx,l=o.maxLookahead||t,u=eD(s,e,l,o),d=X1t(u,o,e,r),h=$1t(u,o,e,r);return d.concat(h)})}function Y1t(e,t){let r=new jbe;e.accept(r);let n=r.alternations;return Yf(n,a=>a.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:a}),type:Wu.TOO_MANY_ALTS,ruleName:e.name,occurrence:a.idx}]:[])}function j1t(e,t,r){let n=[];return bn(e,i=>{let a=new xkr;i.accept(a);let o=a.allProductions;bn(o,s=>{let l=Jj(s),u=s.maxLookahead||t,d=s.idx,f=tD(d,i,l,u)[0];if(Da(M0(f))){let p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:p,type:Wu.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function X1t(e,t,r,n){let i=[],a=Wh(e,(s,l,u)=>(t.definition[u].ignoreAmbiguities===!0||bn(l,d=>{let h=[u];bn(e,(f,p)=>{u!==p&&rj(f,d)&&t.definition[p].ignoreAmbiguities!==!0&&h.push(p)}),h.length>1&&!rj(i,d)&&(i.push(d),s.push({alts:h,path:d}))}),s),[]);return Br(a,s=>{let l=Br(s.alts,d=>d+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:l,prefixPath:s.path}),type:Wu.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:s.alts}})}function $1t(e,t,r,n){let i=Wh(e,(o,s,l)=>{let u=Br(s,d=>({idx:l,path:d}));return o.concat(u)},[]);return ZL(Yf(i,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];let l=o.idx,u=o.path,d=Kf(i,f=>t.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{let p=[f.idx+1,l+1],m=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:p,prefixPath:f.path}),type:Wu.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:p}})}))}function K1t(e,t,r){let n=[],i=Br(t,a=>a.name);return bn(e,a=>{let o=a.name;if(Hu(i,o)){let s=r.buildNamespaceConflictError(a);n.push({message:s,type:Wu.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}function Z1t(e){let t=Rbe(e,{errMsgProvider:hkr}),r={};return bn(e.rules,n=>{r[n.name]=n}),I1t(r,t.errMsgProvider)}function Q1t(e){return e=Rbe(e,{errMsgProvider:z3}),F1t(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}function UL(e){return Hu(nyt,e.name)}function oyt(e,t,r,n,i,a,o){let s=this.getKeyForAutomaticLookahead(n,i),l=this.firstAfterRepMap[s];if(l===void 0){let f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[s]=l}let u=l.token,d=l.occurrence,h=l.isEndOfRule;this.RULE_STACK.length===1&&h&&u===void 0&&(u=Bx,d=1),!(u===void 0||d===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,d,o)&&this.tryInRepetitionRecovery(e,t,r,u)}function pY(e,t,r){return r|t|e}function cyt(e){Bq.reset(),e.accept(Bq);let t=Bq.dslMethods;return Bq.reset(),t}function j1e(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: - ${a.join(` - -`).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}function pyt(e,t,r){let n=N(function(){},"derivedConstructor");$be(n,e+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return bn(t,a=>{i[a]=hyt}),n.prototype=i,n.prototype.constructor=n,n}function myt(e,t){return gyt(e,t)}function gyt(e,t){let r=Kf(t,i=>nv(e[i])===!1),n=Br(r,i=>({msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:$1e.MISSING_METHOD,methodName:i}));return ZL(n)}function TS(e,t,r,n=!1){IL(r);let i=Y3(this.recordingProdStack),a=nv(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),an(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),tX}function byt(e,t){IL(t);let r=Y3(this.recordingProdStack),n=wi(e)===!1,i=n===!1?e:e.DEF,a=new qd({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});an(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD);let o=Ngt(i,s=>nv(s.GATE));return a.hasPredicates=o,r.definition.push(a),bn(i,s=>{let l=new Vd({definition:[]});a.definition.push(l),an(s,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=s.IGNORE_AMBIGUITIES:an(s,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),s.ALT.call(this),this.recordingProdStack.pop()}),tX}function K1e(e){return e===0?"":`${e}`}function IL(e){if(e<0||e>jdt){let t=new Error(`Invalid DSL Method idx value: <${e}> - Idx value must be a none negative value smaller than ${jdt+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}function xyt(e,t){t.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(e.prototype,i,a):e.prototype[i]=r.prototype[i]})})}function Z1e(e=void 0){return function(){return e}}function Eyt(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r-1}function Myt(e,t){var r=this.__data__,n=rX(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function c6(e){var t=-1,r=e==null?0:e.length;for(this.clear();++ts))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=r&JCr?new uvt:void 0;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=NSr}function Nvt(e){return KS(e)&&Jbe(e.length)&&!!Ya[oA(e)]}function _vt(e){return function(t){return e(t)}}function Ovt(e,t){var r=Vu(e),n=!r&&oX(e),i=!r&&!n&&aj(e),a=!r&&!n&&!i&&e2e(e),o=r||n||i||a,s=o?TSr(e.length,String):[],l=s.length;for(var u in e)(t||dAr.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Lvt(u,l)))&&s.push(u);return s}function Bvt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fAr;return e===r}function zvt(e,t){return function(r){return e(t(r))}}function Gvt(e){if(!Fvt(e))return gAr(e);var t=[];for(var r in Object(e))vAr.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vvt(e){return e!=null&&Jbe(e.length)&&!Vyt(e)}function Hvt(e){return sX(e)?hAr(e):Wvt(e)}function qvt(e){return ySr(e,t2e,ESr)}function Yvt(e,t,r,n,i,a){var o=r&bAr,s=aht(e),l=s.length,u=aht(t),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var f=s[h];if(!(o?f in t:wAr.call(t,f)))return!1}var p=a.get(e),m=a.get(t);if(p&&m)return p==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);for(var y=o;++hc2e(e,t,o));return p6(e,t,n,r,...i)}function Fbt(e,t,r){let n=ul(e,t,r,{type:Fx});av(e,n);let i=p6(e,t,n,r,qx(e,t,r));return zbt(e,t,r,i)}function qx(e,t,r){let n=x7r(qy(r.definition,i=>c2e(e,t,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Wbt(e,n)}function u2e(e,t,r,n,i){let a=n.left,o=n.right,s=ul(e,t,r,{type:C7r});av(e,s);let l=ul(e,t,r,{type:Rbt});return a.loopback=s,l.loopback=s,e.decisionMap[X3(t,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=s,ps(o,s),i===void 0?(ps(s,a),ps(s,l)):(ps(s,l),ps(s,i.left),ps(i.right,a)),{left:a,right:l}}function d2e(e,t,r,n,i){let a=n.left,o=n.right,s=ul(e,t,r,{type:k7r});av(e,s);let l=ul(e,t,r,{type:Rbt}),u=ul(e,t,r,{type:T7r});return s.loopback=u,l.loopback=u,ps(s,a),ps(s,l),ps(o,u),i!==void 0?(ps(u,l),ps(u,i.left),ps(i.right,a)):ps(u,s),e.decisionMap[X3(t,i?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:l}}function zbt(e,t,r,n){let i=n.left,a=n.right;return ps(i,a),e.decisionMap[X3(t,"Option",r.idx)]=i,n}function av(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function p6(e,t,r,n,...i){let a=ul(e,t,n,{type:E7r,start:r});r.end=a;for(let s of i)s!==void 0?(ps(r,s.left),ps(s.right,a)):ps(r,a);let o={left:r,right:a};return e.decisionMap[X3(t,Gbt(n),n.idx)]=r,o}function Gbt(e){if(e instanceof qd)return"Alternation";if(e instanceof pc)return"Option";if(e instanceof Zo)return"Repetition";if(e instanceof Hd)return"RepetitionWithSeparator";if(e instanceof Vh)return"RepetitionMandatory";if(e instanceof Hh)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function Wbt(e,t){let r=t.length;for(let a=0;ar.stateNumber.toString()).join("_")}`}function Ybt(e,t,r){for(var n=-1,i=e.length;++n0&&r(s)?t>1?f2e(s,t-1,r,n,i):xvt(i,s):n||(i[i.length]=s)}return i}function Zbt(e,t){return Kbt(qy(e,t),1)}function Qbt(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a-1}function n2t(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=G7r){var u=t?null:z7r(e);if(u)return Qbe(u);o=!1,i=fvt,l=new uvt}else l=t?[]:s;e:for(;++n{let i=n.toString(),a=r[i];return a!==void 0||(a={atnStartState:e,decision:t,states:{}},r[i]=a),a}}function nye(e,t=!0){let r=new Set;for(let n of e){let i=new Set;for(let a of n){if(a===void 0){if(t)break;return!1}let o=[a.tokenTypeIdx].concat(a.categoryMatches);for(let s of o)if(r.has(s)){if(!i.has(s))return!1}else r.add(s),i.add(s)}}return!0}function y2t(e){let t=e.decisionStates.length,r=Array(t);for(let n=0;nV3(i)).join(", "),r=e.production.idx===0?"":e.production.idx,n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${E2t(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, -<${t}> may appears as a prefix path in all these alternatives. -`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}function E2t(e){if(e instanceof Gu)return"SUBRULE";if(e instanceof pc)return"OPTION";if(e instanceof qd)return"OR";if(e instanceof Vh)return"AT_LEAST_ONE";if(e instanceof Hh)return"AT_LEAST_ONE_SEP";if(e instanceof Hd)return"MANY_SEP";if(e instanceof Zo)return"MANY";if(e instanceof ja)return"CONSUME";throw Error("non exhaustive match")}function T2t(e,t,r){let n=R7r(t.configs.elements,a=>a.state.transitions),i=V7r(n.filter(a=>a instanceof s2e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:e}}function k2t(e,t){return e.edges[t.tokenTypeIdx]}function C2t(e,t,r){let n=new rye,i=[];for(let o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===rD){i.push(o);continue}let s=o.state.transitions.length;for(let l=0;l0&&!R2t(a))for(let o of i)a.add(o);return a}function S2t(e,t){if(e instanceof s2e&&Gbe(t,e.tokenType))return e.target}function A2t(e,t){let r;for(let n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function p2e(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function iye(e,t,r,n){return n=m2e(e,n),t.edges[r.tokenTypeIdx]=n,n}function m2e(e,t){if(t===oj)return t;let r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}function U2t(e){let t=new rye,r=e.transitions.length;for(let n=0;n0){let i=[...e.stack],o={state:i.pop(),alt:e.alt,stack:i};DL(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);let n=r.transitions.length;for(let i=0;i1)return!0;return!1}function _2t(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function yY(e){return e.$type===lj}function gX(e,t,r){return V2t({parser:t,tokens:r,ruleNames:new Map},e),t}function V2t(e,t){let r=Mj(t,!1),n=na(t.rules).filter(zu).filter(a=>r.has(a));for(let a of n){let o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(a,zx(o,a.definition))}let i=na(t.rules).filter(qS).filter(a=>r.has(a));for(let a of i)e.parser.rule(a,H2t(e,a))}function H2t(e,t){let r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if($f(r))throw new Error("Cannot use terminal rule in infix expression");let n=t.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,o);let l={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:o};o.elements.push(l,u);let h=n.map(p=>e.tokens[p.value]).map((p,m)=>({ALT:N(()=>e.parser.consume(m,p,l),"ALT")})),f;return p=>{f??(f=yX(e,r)),e.parser.subrule(0,f,!1,a,p),e.parser.many(0,{DEF:N(()=>{e.parser.alternatives(0,h),e.parser.subrule(1,f,!1,u,p)},"DEF")})}}function zx(e,t,r=!1){let n;if(Xy(t))n=Z2t(e,t);else if(Px(t))n=q2t(e,t);else if(jy(t))n=zx(e,t.terminal);else if(J3(t))n=x2e(e,t);else if($y(t))n=Y2t(e,t);else if(Ej(t))n=X2t(e,t);else if(Sj(t))n=$2t(e,t);else if(e6(t))n=K2t(e,t);else if(Tve(t)){let i=e.consume++;n=N(()=>e.parser.consume(i,Bx,t),"method")}else throw new Uj(t.$cstNode,`Unexpected element type: ${t.$type}`);return w2e(e,r?void 0:NL(t),n,t.cardinality)}function q2t(e,t){let r=q3(t);return()=>e.parser.action(r,t)}function Y2t(e,t){let r=t.rule.ref;if(Q3(r)){let n=e.subrule++,i=zu(r)&&r.fragment,a=t.arguments.length>0?j2t(r,t.arguments):()=>({}),o;return s=>{o??(o=yX(e,r)),e.parser.subrule(n,o,i,t,a(s))}}else if($f(r)){let n=e.consume++,i=cj(e,r.name);return()=>e.parser.consume(n,i,t)}else if(r)Wx(r);else throw new Uj(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}function j2t(e,t){if(t.some(n=>n.calledByName)){let n=t.map(i=>({parameterName:i.parameter?.ref?.name,predicate:U0(i.value)}));return i=>{let a={};for(let{parameterName:o,predicate:s}of n)o&&(a[o]=s(i));return a}}else{let n=t.map(i=>U0(i.value));return i=>{let a={};for(let o=0;ot(n)||r(n)}else if(wve(e)){let t=U0(e.left),r=U0(e.right);return n=>t(n)&&r(n)}else if(Sve(e)){let t=U0(e.value);return r=>!t(r)}else if(Ave(e)){let t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(bve(e)){let t=!!e.true;return()=>t}Wx(e)}function X2t(e,t){if(t.elements.length===1)return zx(e,t.elements[0]);{let r=[];for(let i of t.elements){let a={ALT:zx(e,i,!0)},o=NL(i);o&&(a.GATE=U0(o)),r.push(a)}let n=e.or++;return i=>e.parser.alternatives(n,r.map(a=>{let o={ALT:N(()=>a.ALT(i),"ALT")},s=a.GATE;return s&&(o.GATE=()=>s(i)),o}))}}function $2t(e,t){if(t.elements.length===1)return zx(e,t.elements[0]);let r=[];for(let s of t.elements){let l={ALT:zx(e,s,!0)},u=NL(s);u&&(l.GATE=U0(u)),r.push(l)}let n=e.or++,i=N((s,l)=>{let u=l.getRuleStack().join("-");return`uGroup_${s}_${u}`},"idFunc"),a=N(s=>e.parser.alternatives(n,r.map((l,u)=>{let d={ALT:N(()=>!0,"ALT")},h=e.parser;d.ALT=()=>{if(l.ALT(s),!h.isRecording()){let p=i(n,h);h.unorderedGroups.get(p)||h.unorderedGroups.set(p,[]);let m=h.unorderedGroups.get(p);typeof m?.[u]>"u"&&(m[u]=!0)}};let f=l.GATE;return f?d.GATE=()=>f(s):d.GATE=()=>!h.unorderedGroups.get(i(n,h))?.[u],d})),"alternatives"),o=w2e(e,NL(t),a,"*");return s=>{o(s),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(n,e.parser))}}function K2t(e,t){let r=t.elements.map(n=>zx(e,n));return n=>r.forEach(i=>i(n))}function NL(e){if(e6(e))return e.guardCondition}function x2e(e,t,r=t.terminal){if(r)if($y(r)&&zu(r.rule.ref)){let n=r.rule.ref,i=e.subrule++,a;return o=>{a??(a=yX(e,n)),e.parser.subrule(i,a,!1,t,o)}}else if($y(r)&&$f(r.rule.ref)){let n=e.consume++,i=cj(e,r.rule.ref.name);return()=>e.parser.consume(n,i,t)}else if(Xy(r)){let n=e.consume++,i=cj(e,r.value);return()=>e.parser.consume(n,i,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);let i=_j(t.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+q3(t.type.ref));return x2e(e,t,i)}}function Z2t(e,t){let r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}function w2e(e,t,r,n){let i=t&&U0(t);if(!n)if(i){let a=e.or++;return o=>e.parser.alternatives(a,[{ALT:N(()=>r(o),"ALT"),GATE:N(()=>i(o),"GATE")},{ALT:Z1e(),GATE:N(()=>!i(o),"GATE")}])}else return r;if(n==="*"){let a=e.many++;return o=>e.parser.many(a,{DEF:N(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else if(n==="+"){let a=e.many++;if(i){let o=e.or++;return s=>e.parser.alternatives(o,[{ALT:N(()=>e.parser.atLeastOne(a,{DEF:N(()=>r(s),"DEF")}),"ALT"),GATE:N(()=>i(s),"GATE")},{ALT:Z1e(),GATE:N(()=>!i(s),"GATE")}])}else return o=>e.parser.atLeastOne(a,{DEF:N(()=>r(o),"DEF")})}else if(n==="?"){let a=e.optional++;return o=>e.parser.optional(a,{DEF:N(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else Wx(n)}function yX(e,t){let r=Q2t(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function Q2t(e,t){if(Q3(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,i=t.$type;for(;!zu(n);)(e6(n)||Ej(n)||Sj(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,e.ruleNames.set(t,i),i}}function cj(e,t){let r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}function E2e(e){let t=e.Grammar,r=e.parser.Lexer,n=new G2t(e);return gX(t,n,r.definition),n.finalize(),n}function T2e(e){let t=k2e(e);return t.finalize(),t}function k2e(e){let t=e.Grammar,r=e.parser.Lexer,n=new F2t(e);return gX(t,n,r.definition)}function bX(){return new Promise(e=>{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}function xX(){return vY=performance.now(),new La.CancellationTokenSource}function S2e(e){J2t=e}function m6(e){return e===Wg}async function Wl(e){if(e===La.CancellationToken.None)return;let t=performance.now();if(t-vY>=J2t&&(vY=t,await bX(),vY=performance.now()),e.isCancellationRequested)throw Wg}function dj(e,t){if(e.length<=1)return e;let r=e.length/2|0,n=e.slice(0,r),i=e.slice(r);dj(n,t),dj(i,t);let a=0,o=0,s=0;for(;ar.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}function ext(e){let t=U2e(e.range);return t!==e.range?{newText:e.newText,range:t}:e}function R2e(e){return typeof e.name=="string"}function D2e(e){return typeof e.$comment=="string"}function lye(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}function G3(e){return{code:e}}function N2e(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Lj(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=nbe(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function pL(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 _2e(e){switch(e){case"error":return G3(qf.LexingError);case"warning":return G3(qf.LexingWarning);case"info":return G3(qf.LexingInfo);case"hint":return G3(qf.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}function kX(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}function CX(e){return e&&"modes"in e&&"defaultMode"in e}function pj(e){return!kX(e)&&!CX(e)}function B2e(e,t,r){let n,i;typeof e=="string"?(i=t,n=r):(i=e.range.start,n=t),i||(i=Yi.create(0,0));let a=z2e(e),o=SX(n),s=kxt({lines:a,position:i,options:o});return Axt({index:0,tokens:s,position:i})}function F2e(e,t){let r=SX(t),n=z2e(e);if(n.length===0)return!1;let i=n[0],a=n[n.length-1],o=r.start,s=r.end;return!!o?.exec(i)&&!!s?.exec(a)}function z2e(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(Sft)}function kxt(e){let t=[],r=e.position.line,n=e.position.character;for(let i=0;i=s.length){if(t.length>0){let d=Yi.create(r,n);t.push({type:"break",content:"",range:ui.create(d,d)})}}else{wht.lastIndex=l;let d=wht.exec(s);if(d){let h=d[0],f=d[1],p=Yi.create(r,n+l),m=Yi.create(r,n+l+h.length);t.push({type:"tag",content:f,range:ui.create(p,m)}),l+=h.length,l=mj(s,l)}if(l0&&t[t.length-1].type==="break"?t.slice(0,-1):t}function Cxt(e,t,r,n){let i=[];if(e.length===0){let a=Yi.create(r,n),o=Yi.create(r,n+t.length);i.push({type:"text",content:t,range:ui.create(a,o)})}else{let a=0;for(let s of e){let l=s.index,u=t.substring(a,l);u.length>0&&i.push({type:"text",content:t.substring(a,l),range:ui.create(Yi.create(r,a+n),Yi.create(r,l+n))});let d=u.length+1,h=s[1];if(i.push({type:"inline-tag",content:h,range:ui.create(Yi.create(r,a+d+n),Yi.create(r,a+d+h.length+n))}),d+=h.length,s.length===4){d+=s[2].length;let f=s[3];i.push({type:"text",content:f,range:ui.create(Yi.create(r,a+d+n),Yi.create(r,a+d+f.length+n))})}else i.push({type:"text",content:"",range:ui.create(Yi.create(r,a+d+n),Yi.create(r,a+d+n))});a=l+s[0].length}let o=t.substring(a);o.length>0&&i.push({type:"text",content:o,range:ui.create(Yi.create(r,a+n),Yi.create(r,a+n+o.length))})}return i}function mj(e,t){let r=e.substring(t).match(s8r);return r?t+r.index:e.length}function Sxt(e){let t=e.match(l8r);if(t&&typeof t.index=="number")return t.index}function Axt(e){let t=Yi.create(e.position.line,e.position.character);if(e.tokens.length===0)return new Eht([],ui.create(t,t));let r=[];for(;e.index0){let o=mj(t,n);i=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(i=`\`${i}\``),r.renderLink?.(t,i)??Lxt(t,i)}}function Lxt(e,t){try{return Fh.parse(e,!0),`[${t}](${e})`}catch{return e}}function uye(e){return e.endsWith(` -`)?` -`:` - -`}function Ei(e){return{documentation:{CommentProvider:N(t=>new _xt(t),"CommentProvider"),DocumentationProvider:N(t=>new Nxt(t),"DocumentationProvider")},parser:{AsyncParser:N(t=>new Pxt(t),"AsyncParser"),GrammarConfig:N(t=>dbe(t),"GrammarConfig"),LangiumParser:N(t=>T2e(t),"LangiumParser"),CompletionParser:N(t=>E2e(t),"CompletionParser"),ValueConverter:N(()=>new C2e,"ValueConverter"),TokenBuilder:N(()=>new vX,"TokenBuilder"),Lexer:N(t=>new O2e(t),"Lexer"),ParserErrorMessageProvider:N(()=>new b2e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:N(()=>new Txt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:N(()=>new vxt,"AstNodeLocator"),AstNodeDescriptionProvider:N(t=>new gxt(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:N(t=>new yxt(t),"ReferenceDescriptionProvider")},references:{Linker:N(t=>new ixt(t),"Linker"),NameProvider:N(()=>new axt,"NameProvider"),ScopeProvider:N(t=>new uxt(t),"ScopeProvider"),ScopeComputation:N(t=>new sxt(t),"ScopeComputation"),References:N(t=>new oxt(t),"References")},serializer:{Hydrator:N(t=>new Bxt(t),"Hydrator"),JsonSerializer:N(t=>new dxt(t),"JsonSerializer")},validation:{DocumentValidator:N(t=>new mxt(t),"DocumentValidator"),ValidationRegistry:N(t=>new fxt(t),"ValidationRegistry")},shared:N(()=>e.shared,"shared")}}function Ti(e){return{ServiceRegistry:N(t=>new hxt(t),"ServiceRegistry"),workspace:{LangiumDocuments:N(t=>new nxt(t),"LangiumDocuments"),LangiumDocumentFactory:N(t=>new rxt(t),"LangiumDocumentFactory"),DocumentBuilder:N(t=>new xxt(t),"DocumentBuilder"),IndexManager:N(t=>new wxt(t),"IndexManager"),WorkspaceManager:N(t=>new Ext(t),"WorkspaceManager"),FileSystemProvider:N(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:N(()=>new Oxt,"WorkspaceLock"),ConfigurationProvider:N(t=>new bxt(t),"ConfigurationProvider")},profilers:{}}}function xn(e,t,r,n,i,a,o,s,l){let u=[e,t,r,n,i,a,o,s,l].reduce(ZS,{});return q2e(u)}function H2e(e){if(e&&e[Fxt])for(let t of Object.values(e))H2e(t);return e}function q2e(e,t){let r=new Proxy({},{deleteProperty:N(()=>!1,"deleteProperty"),set:N(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:N((n,i)=>i===Fxt?!0:hye(n,i,e,t||r),"get"),getOwnPropertyDescriptor:N((n,i)=>(hye(n,i,e,t||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:N((n,i)=>i in e,"has"),ownKeys:N(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}function hye(e,t,r,n){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]===Tht)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){let i=r[t];e[t]=Tht;try{e[t]=typeof i=="function"?i(n):q2e(i,n)}catch(a){throw e[t]=a instanceof Error?a:void 0,a}return e[t]}else return}function ZS(e,t){if(t){for(let[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){let i=e[r];typeof i=="object"&&i!==null?e[r]=ZS(i,n):e[r]=ZS({},n)}else e[r]=n}return e}function Wxt(){let e=xn(Ti(Ni),f8r),t=xn(Ei({shared:e}),h8r);return e.ServiceRegistry.register(t),t}function Vl(e){let t=Wxt(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,Fh.parse(`memory:/${r.name??"grammar"}.langium`)),r}function Hxt(e){return ms.isInstance(e,S0.$type)}function qxt(e){return ms.isInstance(e,mL.$type)}function Yxt(e){return ms.isInstance(e,R3.$type)}function jxt(e){return ms.isInstance(e,Dx.$type)}function Xxt(e){return ms.isInstance(e,gL.$type)}function $xt(e){return ms.isInstance(e,gj.$type)}function Kxt(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}function AX(e){return ms.isInstance(e,Wy.$type)}function Zxt(e){return ms.isInstance(e,Nx.$type)}function Qxt(e){return ms.isInstance(e,_S.$type)}function Jxt(e){return ms.isInstance(e,M3.$type)}function ewt(e){return ms.isInstance(e,L3.$type)}function twt(e){return ms.isInstance(e,D3.$type)}function rwt(e){return ms.isInstance(e,_x.$type)}function nwt(e){return ms.isInstance(e,yL.$type)}function iwt(e){return ms.isInstance(e,N3.$type)}function awt(e){return ms.isInstance(e,_3.$type)}function owt(e){return ms.isInstance(e,P3.$type)}function swt(e){return ms.isInstance(e,O3.$type)}function lwt(e){return ms.isInstance(e,PS.$type)}function cwt(e){return ms.isInstance(e,B3.$type)}function uwt(e){return ms.isInstance(e,zl.$type)}var Qxr,_L,Jxr,lve,ewr,twr,N,rwr,On,Gx,UY,yj,cve,uve,vj,Rge,Jq,Mge,WM,Yi,ui,VM,Lge,eY,Dge,Nge,_ge,Pge,tY,Oge,Bge,Fge,HM,l3,_g,c3,hc,zy,qM,vS,bS,xS,rY,DM,lge,Vht,zge,Gge,YM,Wge,nY,wS,Vge,Hge,qge,Yge,jge,Xge,$ge,Kge,jM,Zge,Qge,Jge,e1e,t1e,r1e,n1e,i1e,a1e,o1e,s1e,XM,l1e,c1e,u1e,d1e,h1e,f1e,p1e,m1e,g1e,y1e,v1e,b1e,x1e,iY,aY,w1e,E1e,T1e,k1e,C1e,S1e,A1e,U1e,Hht,I1e,Qut,ut,PL,$3,OL,QS,bj,Yht,Xht,nwr,iwr,$ht,awr,owr,swr,lwr,R1e,cwr,JS,Jut,Mo,dve,uwr,dwr,hwr,fwr,pwr,mwr,gwr,ywr,vwr,bwr,xwr,wwr,Ewr,Twr,kwr,Cwr,Swr,Awr,Uwr,Iwr,Rwr,Mwr,Lwr,Dwr,Nwr,Qht,hve,pve,Gg,GS,Pu,WS,bL,mve,tft,_wr,zd,eL,AS,Bh,Ux,tL,LY,DY,Ix,NY,Rx,Mx,rL,Lx,nL,_Y,Vy,PY,b3,OY,Bg,iL,BY,US,IS,RS,x3,FY,zY,MS,GY,C0,aL,w3,WY,E3,LS,VY,T3,Gd,k3,Hy,C3,oL,S3,A3,HY,sL,U3,I3,DS,Pve,Jr,zg,zve,qve,Uj,jve,YY,jY,edt,Pwr,_q,Owr,Cft,Ij,Sft,Aft,Bwr,F3,Ift,ube,Fwr,Wft,zwr,Gwr,Yg,Wwr,jf,Vft,Vwr,Hwr,NM,qwr,Ywr,jwr,Xwr,$wr,Kwr,tdt,Vx,D0,Zwr,Pj,VL,Qwr,wi,Jwr,rdt,ndt,e5r,t5r,r5r,n5r,i5r,Xf,idt,a5r,o5r,s5r,l5r,c5r,adt,u5r,d5r,HL,qL,h5r,f5r,p5r,m5r,nv,g5r,cge,odt,y5r,v5r,b5r,r6,x5r,w5r,E5r,T5r,k5r,C5r,S5r,A5r,U5r,n6,I5r,D1e,sdt,R5r,M5r,L5r,Gl,D5r,N5r,_5r,P5r,O5r,B5r,F5r,$Y,z5r,G5r,W5r,V5r,mpt,ypt,H5r,q5r,fbe,Ept,Y5r,j5r,Oj,pbe,YL,X5r,$5r,Bj,jL,ldt,K5r,mbe,Z5r,gbe,jg,Fj,Q5r,J5r,XL,e4r,t4r,cdt,Opt,r4r,n4r,i4r,zj,a4r,Fpt,udt,o4r,ddt,s4r,l4r,wL,c4r,u4r,d4r,h4r,f4r,p4r,m4r,g4r,y4r,v4r,b4r,x4r,w4r,E4r,T4r,k4r,C4r,S4r,A4r,U4r,I4r,R4r,M4r,L4r,qa,D4r,$L,Wpt,lL,N4r,uge,_4r,Ox,hdt,P4r,ybe,O4r,B4r,Hpt,Ypt,F4r,z4r,G4r,W4r,Xpt,zh,V4r,H4r,q4r,Gh,Y4r,j4r,X4r,$4r,Gj,K4r,Z4r,vbe,Q4r,EL,J4r,e3r,t3r,r3r,n3r,i3r,a3r,o3r,s3r,l3r,c3r,fdt,u3r,Wj,d3r,h3r,f3r,p3r,m3r,g3r,Vj,y3r,TL,v3r,b3r,Hj,x3r,w3r,E3r,T3r,qj,k3r,C3r,S3r,A3r,U3r,I3r,R3r,M3r,L3r,jj,D3r,KL,bbe,N3r,xbe,pdt,_3r,Ebe,M0,P3r,A0t,I0t,O3r,B3r,F3r,z3r,G3r,W3r,V3r,cL,H3r,q3r,B0t,mdt,Y3r,gdt,ydt,j3r,Tbe,W0t,X3r,$3r,vdt,K3r,kbe,Z3r,Q3r,J3r,H0t,e6r,j0t,N1e,K0t,t6r,_1e,r6r,P1e,n6r,BS,bdt,i6r,xdt,wdt,Edt,Tdt,a6r,o6r,s6r,l6r,c6r,d3,XS,u6r,d6r,h6r,f6r,KY,Cbe,p6r,m6r,g6r,kdt,Cdt,y6r,v6r,b6r,x6r,w6r,E6r,T6r,k6r,C6r,S6r,A6r,U6r,I6r,R6r,M6r,L6r,D6r,N6r,_6r,P6r,O6r,B6r,F6r,z6r,G6r,Sdt,W6r,V6r,H6r,q6r,Adt,Y6r,j6r,X6r,$6r,K6r,smt,Z6r,Q6r,J6r,eEr,lmt,tEr,rEr,nEr,cmt,iEr,aEr,oEr,sEr,lEr,cEr,uEr,dEr,hEr,fEr,pEr,mEr,gEr,yEr,vEr,bEr,Ma,xEr,wEr,mc,ZL,EEr,TEr,kEr,Sbe,mmt,Abe,CEr,SEr,vmt,AEr,Ube,UEr,IEr,REr,MEr,LEr,DEr,NEr,_Er,PEr,OEr,BEr,FEr,zEr,Udt,dge,GEr,WEr,VEr,HEr,qEr,YEr,Idt,Rdt,Pq,jEr,Mdt,XEr,kmt,$Er,KEr,ZEr,Amt,QEr,Rmt,JEr,eTr,Nmt,tTr,rTr,nTr,iTr,aTr,oTr,sTr,Xg,lTr,cTr,uTr,dTr,hTr,fTr,pTr,l6,mTr,gTr,jmt,yTr,vTr,Rbe,Ldt,Kmt,bTr,xTr,wTr,Xj,Y3,fc,CL,ETr,bn,TTr,kTr,L0,sgt,Kf,CTr,STr,ATr,UTr,$S,N0,ITr,Br,Yf,RTr,MTr,LTr,DTr,NTr,_Tr,PTr,an,OTr,Wd,BTr,cl,FTr,Hu,zTr,Ddt,GTr,WTr,VTr,HTr,Da,qTr,YTr,Ndt,jTr,Ky,Zy,XTr,$Tr,KTr,ZTr,_0,QTr,Wh,$j,JTr,Ngt,ekr,tkr,rkr,nkr,ikr,Mbe,$g,Gu,tA,Vd,pc,Vh,Hh,Zo,Hd,qd,ja,rA,Kj,qgt,akr,cY,okr,$gt,QY,skr,j3,ZM,Oq,lkr,ckr,ukr,QM,dY,_dt,x1t,G1e,Qo,JM,Fu,dkr,Pdt,Odt,Bdt,Fdt,zdt,Gdt,Wdt,Vdt,Bx,NS,hkr,z3,fkr,pkr,mkr,Qj,gkr,Hdt,ykr,qdt,Ro,vkr,_1t,bkr,jbe,xkr,J1t,eyt,tyt,ryt,nyt,eX,iyt,wkr,Ekr,Tkr,hge,ayt,kkr,Ckr,Skr,Hx,Akr,syt,lyt,H1e,q1e,Y1e,fY,UMn,Xbe,Ukr,Ikr,Bq,Rkr,$1e,Mkr,Lkr,Dkr,Nkr,_kr,Pkr,tX,Ydt,jdt,yyt,vyt,Okr,Bkr,Fkr,nj,Jy,ij,Wu,Kbe,zkr,Tyt,Gkr,Syt,rX,Wkr,Vkr,Hkr,qkr,Ykr,jkr,nX,Xkr,$kr,Kkr,Zkr,Qkr,Pyt,Jkr,eCr,iv,tCr,qg,Oyt,rCr,nCr,_M,iCr,aCr,oCr,sCr,lCr,cCr,Xdt,oA,Zbe,uCr,dCr,hCr,fCr,Vyt,pCr,fge,$dt,mCr,gCr,yCr,u6,vCr,bCr,xCr,wCr,ECr,TCr,kCr,CCr,SCr,sA,ACr,RL,UCr,ML,ICr,RCr,MCr,LCr,DCr,NCr,_Cr,PCr,OCr,BCr,FCr,Kdt,zCr,GCr,iX,WCr,VCr,HCr,qCr,aX,YCr,jCr,mY,XCr,$Cr,KCr,uvt,ZCr,fvt,QCr,JCr,mvt,eSr,Zdt,tSr,Qbe,rSr,nSr,iSr,aSr,oSr,sSr,lSr,cSr,uSr,dSr,hSr,fSr,pSr,Qdt,pge,mSr,xvt,gSr,Vu,ySr,Tvt,vSr,bSr,xSr,Jdt,wSr,ESr,TSr,KS,kSr,eht,Uvt,CSr,SSr,ASr,oX,USr,Rvt,tht,ISr,rht,RSr,MSr,aj,LSr,DSr,Lvt,NSr,Jbe,_Sr,PSr,OSr,BSr,FSr,zSr,GSr,WSr,VSr,HSr,qSr,YSr,jSr,XSr,$Sr,KSr,ZSr,QSr,JSr,eAr,tAr,rAr,nAr,iAr,Ya,aAr,oAr,Pvt,fL,sAr,mge,lAr,nht,iht,cAr,e2e,uAr,dAr,hAr,fAr,Fvt,pAr,mAr,gAr,yAr,vAr,Wvt,sX,t2e,aht,bAr,xAr,wAr,EAr,TAr,Q1e,kAr,J1e,CAr,zS,SAr,eye,oht,AAr,sht,lht,cht,uht,UAr,IAr,RAr,MAr,LAr,h3,tye,DAr,dht,hht,Fq,NAr,fht,_Ar,Xvt,PAr,OAr,BAr,Zvt,FAr,ebt,zAr,GAr,lX,WAr,VAr,n2e,HAr,qAr,YAr,jAr,XAr,$Ar,KAr,ZAr,QAr,pht,mht,JAr,e7r,sbt,t7r,uX,ubt,r7r,n7r,i7r,a7r,o7r,s7r,l7r,a2e,c7r,u7r,d7r,dX,h7r,f7r,p7r,m7r,g7r,y7r,hX,v7r,qy,b7r,x7r,Fx,w7r,Ubt,Ibt,rD,E7r,T7r,k7r,C7r,Rbt,o2e,s2e,Mbt,l2e,oj,rye,S7r,A7r,U7r,ght,I7r,Kbt,R7r,M7r,L7r,D7r,N7r,_7r,P7r,O7r,B7r,F7r,z7r,G7r,W7r,V7r,H7r,q7r,Y7r,gge,j7r,X7r,$7r,K7r,Z7r,Q7r,J7r,yht,g2t,vht,e8r,P2t,g2e,sj,mX,t8r,y2e,lj,bht,B2t,v2e,F2t,z2t,b2e,G2t,r8r,W2t,n8r,vX,C2e,Fg,La,vY,J2t,Wg,ev,xht,uj,txt,Fh,PM,Bu,I2e,Zn,rxt,nxt,f3,ixt,axt,oxt,tv,hj,sxt,sye,i8r,lxt,a8r,wX,M2e,EX,cxt,L2e,uxt,dxt,hxt,fj,fxt,pxt,mxt,qf,gxt,yxt,vxt,TX,bxt,zq,H3,xxt,wxt,Ext,Txt,P2e,O2e,wht,o8r,s8r,l8r,Eht,yge,cye,Dxt,Nxt,_xt,Pxt,c8r,u8r,Oxt,Bxt,dye,Fxt,Tht,fye,W3,zxt,d8r,Y2e,Gxt,Ni,h8r,f8r,p8r,Vxt,pye,mye,gye,yye,vye,bye,xye,wye,Eye,Tye,kye,Cye,Sye,Aye,Uye,IMn,Iye,Rye,xY,Mye,Lye,Dye,p3,wY,Nye,_ye,Gq,vge,Wq,OM,bge,S0,Vq,mL,kht,Hq,xge,R3,qq,o3,Yq,Dx,jq,Cht,gS,gL,gj,Pye,Oye,Bye,Fye,zye,Gye,Wye,kS,Cx,Vye,EY,Hye,qye,TY,Yye,jye,Ng,m3,Sx,BM,Sht,wge,Xq,Wy,kx,Ege,Pg,Aht,$q,Tge,Nx,FM,_S,zM,kge,GM,Kq,s3,M3,Zq,Cge,L3,D3,Xye,$ye,Kye,Zye,Qye,kY,CS,CY,Jye,SY,_x,yL,Sge,Qq,Ax,N3,_3,eve,P3,Og,tve,rve,nve,O3,AY,ive,ave,ove,sve,Age,yS,Uge,g3,PS,B3,Ige,y3,SS,zl,dwt,ms,Uht,m8r,Iht,g8r,Rht,y8r,Mht,v8r,Lht,b8r,Dht,x8r,Nht,w8r,_ht,E8r,Pht,T8r,Oht,k8r,Bht,C8r,Fht,S8r,zht,A8r,Ght,U8r,Wht,I8r,R8r,M8r,L8r,D8r,N8r,_8r,P8r,O8r,B8r,F8r,z8r,G8r,W8r,V8r,H8r,ji,j2e,X2e,$2e,K2e,Z2e,Q2e,J2e,exe,txe,rxe,nxe,ixe,axe,oxe,sxe,q8r,Y8r,j8r,X8r,Ns,qh,Ki,$8r,_i=H(()=>{Qxr=Object.create,_L=Object.defineProperty,Jxr=Object.getOwnPropertyDescriptor,lve=Object.getOwnPropertyNames,ewr=Object.getPrototypeOf,twr=Object.prototype.hasOwnProperty,N=(e,t)=>_L(e,"name",{value:t,configurable:!0}),rwr=(e,t)=>function(){return e&&(t=(0,e[lve(e)[0]])(e=0)),t},On=(e,t)=>function(){return t||(0,e[lve(e)[0]])((t={exports:{}}).exports,t),t.exports},Gx=(e,t)=>{for(var r in t)_L(e,r,{get:t[r],enumerable:!0})},UY=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lve(t))!twr.call(e,i)&&i!==r&&_L(e,i,{get:()=>t[i],enumerable:!(n=Jxr(t,i))||n.enumerable});return e},yj=(e,t,r)=>(UY(e,t,"default"),r&&UY(r,t,"default")),cve=(e,t,r)=>(r=e!=null?Qxr(ewr(e)):{},UY(t||!e||!e.__esModule?_L(r,"default",{value:e,enumerable:!0}):r,e)),uve=e=>UY(_L({},"__esModule",{value:!0}),e),vj={};Gx(vj,{AnnotatedTextEdit:()=>zy,ChangeAnnotation:()=>c3,ChangeAnnotationIdentifier:()=>hc,CodeAction:()=>c1e,CodeActionContext:()=>l1e,CodeActionKind:()=>s1e,CodeActionTriggerKind:()=>XM,CodeDescription:()=>Fge,CodeLens:()=>u1e,Color:()=>eY,ColorInformation:()=>Dge,ColorPresentation:()=>Nge,Command:()=>l3,CompletionItem:()=>$ge,CompletionItemKind:()=>Vge,CompletionItemLabelDetails:()=>Xge,CompletionItemTag:()=>qge,CompletionList:()=>Kge,CreateFile:()=>vS,DeleteFile:()=>xS,Diagnostic:()=>HM,DiagnosticRelatedInformation:()=>tY,DiagnosticSeverity:()=>Oge,DiagnosticTag:()=>Bge,DocumentHighlight:()=>t1e,DocumentHighlightKind:()=>e1e,DocumentLink:()=>h1e,DocumentSymbol:()=>o1e,DocumentUri:()=>Rge,EOL:()=>Hht,FoldingRange:()=>Pge,FoldingRangeKind:()=>_ge,FormattingOptions:()=>d1e,Hover:()=>Zge,InlayHint:()=>w1e,InlayHintKind:()=>iY,InlayHintLabelPart:()=>aY,InlineCompletionContext:()=>A1e,InlineCompletionItem:()=>T1e,InlineCompletionList:()=>k1e,InlineCompletionTriggerKind:()=>C1e,InlineValueContext:()=>x1e,InlineValueEvaluatableExpression:()=>b1e,InlineValueText:()=>y1e,InlineValueVariableLookup:()=>v1e,InsertReplaceEdit:()=>Yge,InsertTextFormat:()=>Hge,InsertTextMode:()=>jge,Location:()=>VM,LocationLink:()=>Lge,MarkedString:()=>jM,MarkupContent:()=>wS,MarkupKind:()=>nY,OptionalVersionedTextDocumentIdentifier:()=>YM,ParameterInformation:()=>Qge,Position:()=>Yi,Range:()=>ui,RenameFile:()=>bS,SelectedCompletionInfo:()=>S1e,SelectionRange:()=>f1e,SemanticTokenModifiers:()=>m1e,SemanticTokenTypes:()=>p1e,SemanticTokens:()=>g1e,SignatureInformation:()=>Jge,StringValue:()=>E1e,SymbolInformation:()=>i1e,SymbolKind:()=>r1e,SymbolTag:()=>n1e,TextDocument:()=>I1e,TextDocumentEdit:()=>qM,TextDocumentIdentifier:()=>zge,TextDocumentItem:()=>Wge,TextEdit:()=>_g,URI:()=>Jq,VersionedTextDocumentIdentifier:()=>Gge,WorkspaceChange:()=>Vht,WorkspaceEdit:()=>rY,WorkspaceFolder:()=>U1e,WorkspaceSymbol:()=>a1e,integer:()=>Mge,uinteger:()=>WM});PL=rwr({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){"use strict";(function(e){function t(r){return typeof r=="string"}N(t,"is"),e.is=t})(Rge||(Rge={})),(function(e){function t(r){return typeof r=="string"}N(t,"is"),e.is=t})(Jq||(Jq={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}N(t,"is"),e.is=t})(Mge||(Mge={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}N(t,"is"),e.is=t})(WM||(WM={})),(function(e){function t(n,i){return n===Number.MAX_VALUE&&(n=WM.MAX_VALUE),i===Number.MAX_VALUE&&(i=WM.MAX_VALUE),{line:n,character:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ut.uinteger(i.line)&&ut.uinteger(i.character)}N(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(n,i,a,o){if(ut.uinteger(n)&&ut.uinteger(i)&&ut.uinteger(a)&&ut.uinteger(o))return{start:Yi.create(n,i),end:Yi.create(a,o)};if(Yi.is(n)&&Yi.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${o}]`)}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&Yi.is(i.start)&&Yi.is(i.end)}N(r,"is"),e.is=r})(ui||(ui={})),(function(e){function t(n,i){return{uri:n,range:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ui.is(i.range)&&(ut.string(i.uri)||ut.undefined(i.uri))}N(r,"is"),e.is=r})(VM||(VM={})),(function(e){function t(n,i,a,o){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:o}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ui.is(i.targetRange)&&ut.string(i.targetUri)&&ui.is(i.targetSelectionRange)&&(ui.is(i.originSelectionRange)||ut.undefined(i.originSelectionRange))}N(r,"is"),e.is=r})(Lge||(Lge={})),(function(e){function t(n,i,a,o){return{red:n,green:i,blue:a,alpha:o}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ut.numberRange(i.red,0,1)&&ut.numberRange(i.green,0,1)&&ut.numberRange(i.blue,0,1)&&ut.numberRange(i.alpha,0,1)}N(r,"is"),e.is=r})(eY||(eY={})),(function(e){function t(n,i){return{range:n,color:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ui.is(i.range)&&eY.is(i.color)}N(r,"is"),e.is=r})(Dge||(Dge={})),(function(e){function t(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ut.string(i.label)&&(ut.undefined(i.textEdit)||_g.is(i))&&(ut.undefined(i.additionalTextEdits)||ut.typedArray(i.additionalTextEdits,_g.is))}N(r,"is"),e.is=r})(Nge||(Nge={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_ge||(_ge={})),(function(e){function t(n,i,a,o,s,l){let u={startLine:n,endLine:i};return ut.defined(a)&&(u.startCharacter=a),ut.defined(o)&&(u.endCharacter=o),ut.defined(s)&&(u.kind=s),ut.defined(l)&&(u.collapsedText=l),u}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ut.uinteger(i.startLine)&&ut.uinteger(i.startLine)&&(ut.undefined(i.startCharacter)||ut.uinteger(i.startCharacter))&&(ut.undefined(i.endCharacter)||ut.uinteger(i.endCharacter))&&(ut.undefined(i.kind)||ut.string(i.kind))}N(r,"is"),e.is=r})(Pge||(Pge={})),(function(e){function t(n,i){return{location:n,message:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&VM.is(i.location)&&ut.string(i.message)}N(r,"is"),e.is=r})(tY||(tY={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Oge||(Oge={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Bge||(Bge={})),(function(e){function t(r){let n=r;return ut.objectLiteral(n)&&ut.string(n.href)}N(t,"is"),e.is=t})(Fge||(Fge={})),(function(e){function t(n,i,a,o,s,l){let u={range:n,message:i};return ut.defined(a)&&(u.severity=a),ut.defined(o)&&(u.code=o),ut.defined(s)&&(u.source=s),ut.defined(l)&&(u.relatedInformation=l),u}N(t,"create"),e.create=t;function r(n){var i;let a=n;return ut.defined(a)&&ui.is(a.range)&&ut.string(a.message)&&(ut.number(a.severity)||ut.undefined(a.severity))&&(ut.integer(a.code)||ut.string(a.code)||ut.undefined(a.code))&&(ut.undefined(a.codeDescription)||ut.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(ut.string(a.source)||ut.undefined(a.source))&&(ut.undefined(a.relatedInformation)||ut.typedArray(a.relatedInformation,tY.is))}N(r,"is"),e.is=r})(HM||(HM={})),(function(e){function t(n,i,...a){let o={title:n,command:i};return ut.defined(a)&&a.length>0&&(o.arguments=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.string(i.title)&&ut.string(i.command)}N(r,"is"),e.is=r})(l3||(l3={})),(function(e){function t(a,o){return{range:a,newText:o}}N(t,"replace"),e.replace=t;function r(a,o){return{range:{start:a,end:a},newText:o}}N(r,"insert"),e.insert=r;function n(a){return{range:a,newText:""}}N(n,"del"),e.del=n;function i(a){let o=a;return ut.objectLiteral(o)&&ut.string(o.newText)&&ui.is(o.range)}N(i,"is"),e.is=i})(_g||(_g={})),(function(e){function t(n,i,a){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),a!==void 0&&(o.description=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ut.string(i.label)&&(ut.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(ut.string(i.description)||i.description===void 0)}N(r,"is"),e.is=r})(c3||(c3={})),(function(e){function t(r){let n=r;return ut.string(n)}N(t,"is"),e.is=t})(hc||(hc={})),(function(e){function t(a,o,s){return{range:a,newText:o,annotationId:s}}N(t,"replace"),e.replace=t;function r(a,o,s){return{range:{start:a,end:a},newText:o,annotationId:s}}N(r,"insert"),e.insert=r;function n(a,o){return{range:a,newText:"",annotationId:o}}N(n,"del"),e.del=n;function i(a){let o=a;return _g.is(o)&&(c3.is(o.annotationId)||hc.is(o.annotationId))}N(i,"is"),e.is=i})(zy||(zy={})),(function(e){function t(n,i){return{textDocument:n,edits:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&YM.is(i.textDocument)&&Array.isArray(i.edits)}N(r,"is"),e.is=r})(qM||(qM={})),(function(e){function t(n,i,a){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),a!==void 0&&(o.annotationId=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return i&&i.kind==="create"&&ut.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||ut.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||ut.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||hc.is(i.annotationId))}N(r,"is"),e.is=r})(vS||(vS={})),(function(e){function t(n,i,a,o){let s={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(s.options=a),o!==void 0&&(s.annotationId=o),s}N(t,"create"),e.create=t;function r(n){let i=n;return i&&i.kind==="rename"&&ut.string(i.oldUri)&&ut.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||ut.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||ut.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||hc.is(i.annotationId))}N(r,"is"),e.is=r})(bS||(bS={})),(function(e){function t(n,i,a){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),a!==void 0&&(o.annotationId=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return i&&i.kind==="delete"&&ut.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||ut.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||ut.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||hc.is(i.annotationId))}N(r,"is"),e.is=r})(xS||(xS={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>ut.string(i.kind)?vS.is(i)||bS.is(i)||xS.is(i):qM.is(i)))}N(t,"is"),e.is=t})(rY||(rY={})),DM=class{static{N(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,i;if(r===void 0?n=_g.insert(e,t):hc.is(r)?(i=r,n=zy.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=zy.insert(e,t,i)),this.edits.push(n),i!==void 0)return i}replace(e,t,r){let n,i;if(r===void 0?n=_g.replace(e,t):hc.is(r)?(i=r,n=zy.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(r),n=zy.replace(e,t,i)),this.edits.push(n),i!==void 0)return i}delete(e,t){let r,n;if(t===void 0?r=_g.del(e):hc.is(t)?(n=t,r=zy.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=zy.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},lge=class{static{N(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(hc.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Vht=class{static{N(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new lge(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qM.is(t)){let r=new DM(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{let r=new DM(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(YM.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let t={uri:e.uri,version:e.version},r=this._textEditChanges[t.uri];if(!r){let n=[],i={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(i),r=new DM(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new DM(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lge,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;c3.is(t)||hc.is(t)?n=t:r=t;let i,a;if(n===void 0?i=vS.create(e,r):(a=hc.is(n)?n:this._changeAnnotations.manage(n),i=vS.create(e,r,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;c3.is(r)||hc.is(r)?i=r:n=r;let a,o;if(i===void 0?a=bS.create(e,t,n):(o=hc.is(i)?i:this._changeAnnotations.manage(i),a=bS.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;c3.is(t)||hc.is(t)?n=t:r=t;let i,a;if(n===void 0?i=xS.create(e,r):(a=hc.is(n)?n:this._changeAnnotations.manage(n),i=xS.create(e,r,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}},(function(e){function t(n){return{uri:n}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.string(i.uri)}N(r,"is"),e.is=r})(zge||(zge={})),(function(e){function t(n,i){return{uri:n,version:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.string(i.uri)&&ut.integer(i.version)}N(r,"is"),e.is=r})(Gge||(Gge={})),(function(e){function t(n,i){return{uri:n,version:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.string(i.uri)&&(i.version===null||ut.integer(i.version))}N(r,"is"),e.is=r})(YM||(YM={})),(function(e){function t(n,i,a,o){return{uri:n,languageId:i,version:a,text:o}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.string(i.uri)&&ut.string(i.languageId)&&ut.integer(i.version)&&ut.string(i.text)}N(r,"is"),e.is=r})(Wge||(Wge={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){let n=r;return n===e.PlainText||n===e.Markdown}N(t,"is"),e.is=t})(nY||(nY={})),(function(e){function t(r){let n=r;return ut.objectLiteral(r)&&nY.is(n.kind)&&ut.string(n.value)}N(t,"is"),e.is=t})(wS||(wS={})),(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})(Vge||(Vge={})),(function(e){e.PlainText=1,e.Snippet=2})(Hge||(Hge={})),(function(e){e.Deprecated=1})(qge||(qge={})),(function(e){function t(n,i,a){return{newText:n,insert:i,replace:a}}N(t,"create"),e.create=t;function r(n){let i=n;return i&&ut.string(i.newText)&&ui.is(i.insert)&&ui.is(i.replace)}N(r,"is"),e.is=r})(Yge||(Yge={})),(function(e){e.asIs=1,e.adjustIndentation=2})(jge||(jge={})),(function(e){function t(r){let n=r;return n&&(ut.string(n.detail)||n.detail===void 0)&&(ut.string(n.description)||n.description===void 0)}N(t,"is"),e.is=t})(Xge||(Xge={})),(function(e){function t(r){return{label:r}}N(t,"create"),e.create=t})($ge||($ge={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}N(t,"create"),e.create=t})(Kge||(Kge={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}N(t,"fromPlainText"),e.fromPlainText=t;function r(n){let i=n;return ut.string(i)||ut.objectLiteral(i)&&ut.string(i.language)&&ut.string(i.value)}N(r,"is"),e.is=r})(jM||(jM={})),(function(e){function t(r){let n=r;return!!n&&ut.objectLiteral(n)&&(wS.is(n.contents)||jM.is(n.contents)||ut.typedArray(n.contents,jM.is))&&(r.range===void 0||ui.is(r.range))}N(t,"is"),e.is=t})(Zge||(Zge={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}N(t,"create"),e.create=t})(Qge||(Qge={})),(function(e){function t(r,n,...i){let a={label:r};return ut.defined(n)&&(a.documentation=n),ut.defined(i)?a.parameters=i:a.parameters=[],a}N(t,"create"),e.create=t})(Jge||(Jge={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(e1e||(e1e={})),(function(e){function t(r,n){let i={range:r};return ut.number(n)&&(i.kind=n),i}N(t,"create"),e.create=t})(t1e||(t1e={})),(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})(r1e||(r1e={})),(function(e){e.Deprecated=1})(n1e||(n1e={})),(function(e){function t(r,n,i,a,o){let s={name:r,kind:n,location:{uri:a,range:i}};return o&&(s.containerName=o),s}N(t,"create"),e.create=t})(i1e||(i1e={})),(function(e){function t(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}N(t,"create"),e.create=t})(a1e||(a1e={})),(function(e){function t(n,i,a,o,s,l){let u={name:n,detail:i,kind:a,range:o,selectionRange:s};return l!==void 0&&(u.children=l),u}N(t,"create"),e.create=t;function r(n){let i=n;return i&&ut.string(i.name)&&ut.number(i.kind)&&ui.is(i.range)&&ui.is(i.selectionRange)&&(i.detail===void 0||ut.string(i.detail))&&(i.deprecated===void 0||ut.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}N(r,"is"),e.is=r})(o1e||(o1e={})),(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"})(s1e||(s1e={})),(function(e){e.Invoked=1,e.Automatic=2})(XM||(XM={})),(function(e){function t(n,i,a){let o={diagnostics:n};return i!=null&&(o.only=i),a!=null&&(o.triggerKind=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.typedArray(i.diagnostics,HM.is)&&(i.only===void 0||ut.typedArray(i.only,ut.string))&&(i.triggerKind===void 0||i.triggerKind===XM.Invoked||i.triggerKind===XM.Automatic)}N(r,"is"),e.is=r})(l1e||(l1e={})),(function(e){function t(n,i,a){let o={title:n},s=!0;return typeof i=="string"?(s=!1,o.kind=i):l3.is(i)?o.command=i:o.edit=i,s&&a!==void 0&&(o.kind=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return i&&ut.string(i.title)&&(i.diagnostics===void 0||ut.typedArray(i.diagnostics,HM.is))&&(i.kind===void 0||ut.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||l3.is(i.command))&&(i.isPreferred===void 0||ut.boolean(i.isPreferred))&&(i.edit===void 0||rY.is(i.edit))}N(r,"is"),e.is=r})(c1e||(c1e={})),(function(e){function t(n,i){let a={range:n};return ut.defined(i)&&(a.data=i),a}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ui.is(i.range)&&(ut.undefined(i.command)||l3.is(i.command))}N(r,"is"),e.is=r})(u1e||(u1e={})),(function(e){function t(n,i){return{tabSize:n,insertSpaces:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ut.uinteger(i.tabSize)&&ut.boolean(i.insertSpaces)}N(r,"is"),e.is=r})(d1e||(d1e={})),(function(e){function t(n,i,a){return{range:n,target:i,data:a}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ui.is(i.range)&&(ut.undefined(i.target)||ut.string(i.target))}N(r,"is"),e.is=r})(h1e||(h1e={})),(function(e){function t(n,i){return{range:n,parent:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&ui.is(i.range)&&(i.parent===void 0||e.is(i.parent))}N(r,"is"),e.is=r})(f1e||(f1e={})),(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"})(p1e||(p1e={})),(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"})(m1e||(m1e={})),(function(e){function t(r){let n=r;return ut.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}N(t,"is"),e.is=t})(g1e||(g1e={})),(function(e){function t(n,i){return{range:n,text:i}}N(t,"create"),e.create=t;function r(n){let i=n;return i!=null&&ui.is(i.range)&&ut.string(i.text)}N(r,"is"),e.is=r})(y1e||(y1e={})),(function(e){function t(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}N(t,"create"),e.create=t;function r(n){let i=n;return i!=null&&ui.is(i.range)&&ut.boolean(i.caseSensitiveLookup)&&(ut.string(i.variableName)||i.variableName===void 0)}N(r,"is"),e.is=r})(v1e||(v1e={})),(function(e){function t(n,i){return{range:n,expression:i}}N(t,"create"),e.create=t;function r(n){let i=n;return i!=null&&ui.is(i.range)&&(ut.string(i.expression)||i.expression===void 0)}N(r,"is"),e.is=r})(b1e||(b1e={})),(function(e){function t(n,i){return{frameId:n,stoppedLocation:i}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.defined(i)&&ui.is(n.stoppedLocation)}N(r,"is"),e.is=r})(x1e||(x1e={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}N(t,"is"),e.is=t})(iY||(iY={})),(function(e){function t(n){return{value:n}}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&(i.tooltip===void 0||ut.string(i.tooltip)||wS.is(i.tooltip))&&(i.location===void 0||VM.is(i.location))&&(i.command===void 0||l3.is(i.command))}N(r,"is"),e.is=r})(aY||(aY={})),(function(e){function t(n,i,a){let o={position:n,label:i};return a!==void 0&&(o.kind=a),o}N(t,"create"),e.create=t;function r(n){let i=n;return ut.objectLiteral(i)&&Yi.is(i.position)&&(ut.string(i.label)||ut.typedArray(i.label,aY.is))&&(i.kind===void 0||iY.is(i.kind))&&i.textEdits===void 0||ut.typedArray(i.textEdits,_g.is)&&(i.tooltip===void 0||ut.string(i.tooltip)||wS.is(i.tooltip))&&(i.paddingLeft===void 0||ut.boolean(i.paddingLeft))&&(i.paddingRight===void 0||ut.boolean(i.paddingRight))}N(r,"is"),e.is=r})(w1e||(w1e={})),(function(e){function t(r){return{kind:"snippet",value:r}}N(t,"createSnippet"),e.createSnippet=t})(E1e||(E1e={})),(function(e){function t(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}N(t,"create"),e.create=t})(T1e||(T1e={})),(function(e){function t(r){return{items:r}}N(t,"create"),e.create=t})(k1e||(k1e={})),(function(e){e.Invoked=0,e.Automatic=1})(C1e||(C1e={})),(function(e){function t(r,n){return{range:r,text:n}}N(t,"create"),e.create=t})(S1e||(S1e={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}N(t,"create"),e.create=t})(A1e||(A1e={})),(function(e){function t(r){let n=r;return ut.objectLiteral(n)&&Jq.is(n.uri)&&ut.string(n.name)}N(t,"is"),e.is=t})(U1e||(U1e={})),Hht=[` -`,`\r -`,"\r"],(function(e){function t(a,o,s,l){return new Qut(a,o,s,l)}N(t,"create"),e.create=t;function r(a){let o=a;return!!(ut.defined(o)&&ut.string(o.uri)&&(ut.undefined(o.languageId)||ut.string(o.languageId))&&ut.uinteger(o.lineCount)&&ut.func(o.getText)&&ut.func(o.positionAt)&&ut.func(o.offsetAt))}N(r,"is"),e.is=r;function n(a,o){let s=a.getText(),l=i(o,(d,h)=>{let f=d.range.start.line-h.range.start.line;return f===0?d.range.start.character-h.range.start.character:f}),u=s.length;for(let d=l.length-1;d>=0;d--){let h=l[d],f=a.offsetAt(h.range.start),p=a.offsetAt(h.range.end);if(p<=u)s=s.substring(0,f)+h.newText+s.substring(p,s.length);else throw new Error("Overlapping edit");u=f}return s}N(n,"applyEdits"),e.applyEdits=n;function i(a,o){if(a.length<=1)return a;let s=a.length/2|0,l=a.slice(0,s),u=a.slice(s);i(l,o),i(u,o);let d=0,h=0,f=0;for(;d0&&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(),r=0,n=t.length;if(n===0)return Yi.create(0,e);for(;re?n=a:r=a+1}let i=r-1;return Yi.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 r=t[e.line],n=e.line+1"u"}N(n,"undefined"),e.undefined=n;function i(p){return p===!0||p===!1}N(i,"boolean"),e.boolean=i;function a(p){return t.call(p)==="[object String]"}N(a,"string"),e.string=a;function o(p){return t.call(p)==="[object Number]"}N(o,"number"),e.number=o;function s(p,m,g){return t.call(p)==="[object Number]"&&m<=p&&p<=g}N(s,"numberRange"),e.numberRange=s;function l(p){return t.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}N(l,"integer"),e.integer=l;function u(p){return t.call(p)==="[object Number]"&&0<=p&&p<=2147483647}N(u,"uinteger"),e.uinteger=u;function d(p){return t.call(p)==="[object Function]"}N(d,"func"),e.func=d;function h(p){return p!==null&&typeof p=="object"}N(h,"objectLiteral"),e.objectLiteral=h;function f(p,m){return Array.isArray(p)&&p.every(m)}N(f,"typedArray"),e.typedArray=f})(ut||(ut={}))}}),$3=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}N(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");t=a}N(i,"install"),n.install=i})(r||(r={})),e.default=r}}),OL=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(l){return l===!0||l===!1}N(t,"boolean"),e.boolean=t;function r(l){return typeof l=="string"||l instanceof String}N(r,"string"),e.string=r;function n(l){return typeof l=="number"||l instanceof Number}N(n,"number"),e.number=n;function i(l){return l instanceof Error}N(i,"error"),e.error=i;function a(l){return typeof l=="function"}N(a,"func"),e.func=a;function o(l){return Array.isArray(l)}N(o,"array"),e.array=o;function s(l){return o(l)&&l.every(u=>r(u))}N(s,"stringArray"),e.stringArray=s}}),QS=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=$3(),r;(function(a){let o={dispose(){}};a.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{N(this,"CallbackList")}add(a,o=null,s){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(o),Array.isArray(s)&&s.push({dispose:N(()=>this.remove(a,o),"dispose")})}remove(a,o=null){if(!this._callbacks)return;let s=!1;for(let l=0,u=this._callbacks.length;l{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,s);let u={dispose:N(()=>{this._callbacks&&(this._callbacks.remove(o,s),u.dispose=qht._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(l)&&l.push(u),u}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=i,i._noop=function(){}}}),bj=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=$3(),r=OL(),n=QS(),i;(function(l){l.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),l.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function u(d){let h=d;return h&&(h===l.None||h===l.Cancelled||r.boolean(h.isCancellationRequested)&&!!h.onCancellationRequested)}N(u,"is"),l.is=u})(i||(e.CancellationToken=i={}));var a=Object.freeze(function(l,u){let d=(0,t.default)().timer.setTimeout(l.bind(u),0);return{dispose(){d.dispose()}}}),o=class{static{N(this,"MutableToken")}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?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},s=class{static{N(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}};e.CancellationTokenSource=s}}),Yht=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=OL(),r;(function(A){A.ParseError=-32700,A.InvalidRequest=-32600,A.MethodNotFound=-32601,A.InvalidParams=-32602,A.InternalError=-32603,A.jsonrpcReservedErrorRangeStart=-32099,A.serverErrorStart=-32099,A.MessageWriteError=-32099,A.MessageReadError=-32098,A.PendingResponseRejected=-32097,A.ConnectionInactive=-32096,A.ServerNotInitialized=-32002,A.UnknownErrorCode=-32001,A.jsonrpcReservedErrorRangeEnd=-32e3,A.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class jht extends Error{static{N(this,"ResponseError")}constructor(P,D,M){super(D),this.code=t.number(P)?P:r.UnknownErrorCode,this.data=M,Object.setPrototypeOf(this,jht.prototype)}toJson(){let P={code:this.code,message:this.message};return this.data!==void 0&&(P.data=this.data),P}};e.ResponseError=n;var i=class oY{static{N(this,"ParameterStructures")}constructor(P){this.kind=P}static is(P){return P===oY.auto||P===oY.byName||P===oY.byPosition}toString(){return this.kind}};e.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=class{static{N(this,"AbstractMessageSignature")}constructor(A,P){this.method=A,this.numberOfParams=P}get parameterStructures(){return i.auto}};e.AbstractMessageSignature=a;var o=class extends a{static{N(this,"RequestType0")}constructor(A){super(A,0)}};e.RequestType0=o;var s=class extends a{static{N(this,"RequestType")}constructor(A,P=i.auto){super(A,1),this._parameterStructures=P}get parameterStructures(){return this._parameterStructures}};e.RequestType=s;var l=class extends a{static{N(this,"RequestType1")}constructor(A,P=i.auto){super(A,1),this._parameterStructures=P}get parameterStructures(){return this._parameterStructures}};e.RequestType1=l;var u=class extends a{static{N(this,"RequestType2")}constructor(A){super(A,2)}};e.RequestType2=u;var d=class extends a{static{N(this,"RequestType3")}constructor(A){super(A,3)}};e.RequestType3=d;var h=class extends a{static{N(this,"RequestType4")}constructor(A){super(A,4)}};e.RequestType4=h;var f=class extends a{static{N(this,"RequestType5")}constructor(A){super(A,5)}};e.RequestType5=f;var p=class extends a{static{N(this,"RequestType6")}constructor(A){super(A,6)}};e.RequestType6=p;var m=class extends a{static{N(this,"RequestType7")}constructor(A){super(A,7)}};e.RequestType7=m;var g=class extends a{static{N(this,"RequestType8")}constructor(A){super(A,8)}};e.RequestType8=g;var y=class extends a{static{N(this,"RequestType9")}constructor(A){super(A,9)}};e.RequestType9=y;var v=class extends a{static{N(this,"NotificationType")}constructor(A,P=i.auto){super(A,1),this._parameterStructures=P}get parameterStructures(){return this._parameterStructures}};e.NotificationType=v;var b=class extends a{static{N(this,"NotificationType0")}constructor(A){super(A,0)}};e.NotificationType0=b;var x=class extends a{static{N(this,"NotificationType1")}constructor(A,P=i.auto){super(A,1),this._parameterStructures=P}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=x;var E=class extends a{static{N(this,"NotificationType2")}constructor(A){super(A,2)}};e.NotificationType2=E;var w=class extends a{static{N(this,"NotificationType3")}constructor(A){super(A,3)}};e.NotificationType3=w;var T=class extends a{static{N(this,"NotificationType4")}constructor(A){super(A,4)}};e.NotificationType4=T;var C=class extends a{static{N(this,"NotificationType5")}constructor(A){super(A,5)}};e.NotificationType5=C;var S=class extends a{static{N(this,"NotificationType6")}constructor(A){super(A,6)}};e.NotificationType6=S;var R=class extends a{static{N(this,"NotificationType7")}constructor(A){super(A,7)}};e.NotificationType7=R;var U=class extends a{static{N(this,"NotificationType8")}constructor(A){super(A,8)}};e.NotificationType8=U;var L=class extends a{static{N(this,"NotificationType9")}constructor(A){super(A,9)}};e.NotificationType9=L;var I;(function(A){function P(O){let _=O;return _&&t.string(_.method)&&(t.string(_.id)||t.number(_.id))}N(P,"isRequest"),A.isRequest=P;function D(O){let _=O;return _&&t.string(_.method)&&O.id===void 0}N(D,"isNotification"),A.isNotification=D;function M(O){let _=O;return _&&(_.result!==void 0||!!_.error)&&(t.string(_.id)||t.number(_.id)||_.id===null)}N(M,"isResponse"),A.isResponse=M})(I||(e.Message=I={}))}}),Xht=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){"use strict";var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(a){a.None=0,a.First=1,a.AsOld=a.First,a.Last=2,a.AsNew=a.Last})(r||(e.Touch=r={}));var n=class{static{N(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(a){return this._map.has(a)}get(a,o=r.None){let s=this._map.get(a);if(s)return o!==r.None&&this.touch(s,o),s.value}set(a,o,s=r.None){let l=this._map.get(a);if(l)l.value=o,s!==r.None&&this.touch(l,s);else{switch(l={key:a,value:o,next:void 0,previous:void 0},s){case r.None:this.addItemLast(l);break;case r.First:this.addItemFirst(l);break;case r.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(a,l),this._size++}return this}delete(a){return!!this.remove(a)}remove(a){let o=this._map.get(a);if(o)return this._map.delete(a),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let a=this._head;return this._map.delete(a.key),this.removeItem(a),this._size--,a.value}forEach(a,o){let s=this._state,l=this._head;for(;l;){if(o?a.bind(o)(l.value,l.key,this):a(l.value,l.key,this),this._state!==s)throw new Error("LinkedMap got modified during iteration.");l=l.next}}keys(){let a=this._state,o=this._head,s={[Symbol.iterator]:()=>s,next:N(()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(o){let l={value:o.key,done:!1};return o=o.next,l}else return{value:void 0,done:!0}},"next")};return s}values(){let a=this._state,o=this._head,s={[Symbol.iterator]:()=>s,next:N(()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(o){let l={value:o.value,done:!1};return o=o.next,l}else return{value:void 0,done:!0}},"next")};return s}entries(){let a=this._state,o=this._head,s={[Symbol.iterator]:()=>s,next:N(()=>{if(this._state!==a)throw new Error("LinkedMap got modified during iteration.");if(o){let l={value:[o.key,o.value],done:!1};return o=o.next,l}else return{value:void 0,done:!0}},"next")};return s}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(a){if(a>=this.size)return;if(a===0){this.clear();return}let o=this._head,s=this.size;for(;o&&s>a;)this._map.delete(o.key),o=o.next,s--;this._head=o,this._size=s,o&&(o.previous=void 0),this._state++}addItemFirst(a){if(!this._head&&!this._tail)this._tail=a;else if(this._head)a.next=this._head,this._head.previous=a;else throw new Error("Invalid list");this._head=a,this._state++}addItemLast(a){if(!this._head&&!this._tail)this._head=a;else if(this._tail)a.previous=this._tail,this._tail.next=a;else throw new Error("Invalid list");this._tail=a,this._state++}removeItem(a){if(a===this._head&&a===this._tail)this._head=void 0,this._tail=void 0;else if(a===this._head){if(!a.next)throw new Error("Invalid list");a.next.previous=void 0,this._head=a.next}else if(a===this._tail){if(!a.previous)throw new Error("Invalid list");a.previous.next=void 0,this._tail=a.previous}else{let o=a.next,s=a.previous;if(!o||!s)throw new Error("Invalid list");o.previous=s,s.next=o}a.next=void 0,a.previous=void 0,this._state++}touch(a,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(a===this._head)return;let s=a.next,l=a.previous;a===this._tail?(l.next=void 0,this._tail=l):(s.previous=l,l.next=s),a.previous=void 0,a.next=this._head,this._head.previous=a,this._head=a,this._state++}else if(o===r.Last){if(a===this._tail)return;let s=a.next,l=a.previous;a===this._head?(s.previous=void 0,this._head=s):(s.previous=l,l.next=s),a.next=void 0,a.previous=this._tail,this._tail.next=a,this._tail=a,this._state++}}}toJSON(){let a=[];return this.forEach((o,s)=>{a.push([s,o])}),a}fromJSON(a){this.clear();for(let[o,s]of a)this.set(o,s)}};e.LinkedMap=n;var i=class extends n{static{N(this,"LRUCache")}constructor(a,o=1){super(),this._limit=a,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(a){this._limit=a,this.checkTrim()}get ratio(){return this._ratio}set ratio(a){this._ratio=Math.min(Math.max(0,a),1),this.checkTrim()}get(a,o=r.AsNew){return super.get(a,o)}peek(a){return super.get(a,r.None)}set(a,o){return super.set(a,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=i}}),nwr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(i){return{dispose:i}}N(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),iwr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=bj(),r;(function(s){s.Continue=0,s.Cancelled=1})(r||(r={}));var n=class{static{N(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(s){if(s.id===null)return;let l=new SharedArrayBuffer(4),u=new Int32Array(l,0,1);u[0]=r.Continue,this.buffers.set(s.id,l),s.$cancellationData=l}async sendCancellation(s,l){let u=this.buffers.get(l);if(u===void 0)return;let d=new Int32Array(u,0,1);Atomics.store(d,0,r.Cancelled)}cleanup(s){this.buffers.delete(s)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var i=class{static{N(this,"SharedArrayBufferCancellationToken")}constructor(s){this.data=new Int32Array(s,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},a=class{static{N(this,"SharedArrayBufferCancellationTokenSource")}constructor(s){this.token=new i(s)}cancel(){}dispose(){}},o=class{static{N(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(s){let l=s.$cancellationData;return l===void 0?new t.CancellationTokenSource:new a(l)}};e.SharedArrayReceiverStrategy=o}}),$ht=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=$3(),r=class{static{N(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,a)=>{this._waiting.push({thunk:n,resolve:i,reject:a}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let i=n.thunk();i instanceof Promise?i.then(a=>{this._active--,n.resolve(a),this.runNext()},a=>{this._active--,n.reject(a),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}};e.Semaphore=r}}),awr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=$3(),r=OL(),n=QS(),i=$ht(),a;(function(u){function d(h){let f=h;return f&&r.func(f.listen)&&r.func(f.dispose)&&r.func(f.onError)&&r.func(f.onClose)&&r.func(f.onPartialMessage)}N(d,"is"),u.is=d})(a||(e.MessageReader=a={}));var o=class{static{N(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${r.string(u.message)?u.message:"unknown"}`)}};e.AbstractMessageReader=o;var s;(function(u){function d(h){let f,p,m,g=new Map,y,v=new Map;if(h===void 0||typeof h=="string")f=h??"utf-8";else{if(f=h.charset??"utf-8",h.contentDecoder!==void 0&&(m=h.contentDecoder,g.set(m.name,m)),h.contentDecoders!==void 0)for(let b of h.contentDecoders)g.set(b.name,b);if(h.contentTypeDecoder!==void 0&&(y=h.contentTypeDecoder,v.set(y.name,y)),h.contentTypeDecoders!==void 0)for(let b of h.contentTypeDecoders)v.set(b.name,b)}return y===void 0&&(y=(0,t.default)().applicationJson.decoder,v.set(y.name,y)),{charset:f,contentDecoder:m,contentDecoders:g,contentTypeDecoder:y,contentTypeDecoders:v}}N(d,"fromOptions"),u.fromOptions=d})(s||(s={}));var l=class extends o{static{N(this,"ReadableStreamMessageReader")}constructor(u,d){super(),this.readable=u,this.options=s.fromOptions(d),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;let d=this.readable.onData(h=>{this.onData(h)});return this.readable.onError(h=>this.fireError(h)),this.readable.onClose(()=>this.fireClose()),d}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){let h=this.buffer.tryReadHeaders(!0);if(!h)return;let f=h.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(h))}`));return}let p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=p}let d=this.buffer.tryReadBody(this.nextMessageLength);if(d===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let h=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(d):d,f=await this.options.contentTypeDecoder.decode(h,this.options);this.callback(f)}).catch(h=>{this.fireError(h)})}}catch(d){this.fireError(d)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,d)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:d}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=l}}),owr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=$3(),r=OL(),n=$ht(),i=QS(),a="Content-Length: ",o=`\r -`,s;(function(h){function f(p){let m=p;return m&&r.func(m.dispose)&&r.func(m.onClose)&&r.func(m.onError)&&r.func(m.write)}N(f,"is"),h.is=f})(s||(e.MessageWriter=s={}));var l=class{static{N(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h,f,p){this.errorEmitter.fire([this.asError(h),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(h){return h instanceof Error?h:new Error(`Writer received error. Reason: ${r.string(h.message)?h.message:"unknown"}`)}};e.AbstractMessageWriter=l;var u;(function(h){function f(p){return p===void 0||typeof p=="string"?{charset:p??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:p.charset??"utf-8",contentEncoder:p.contentEncoder,contentTypeEncoder:p.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}N(f,"fromOptions"),h.fromOptions=f})(u||(u={}));var d=class extends l{static{N(this,"WriteableStreamMessageWriter")}constructor(h,f){super(),this.writable=h,this.options=u.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(h){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(h,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{let m=[];return m.push(a,p.byteLength.toString(),o),m.push(o),this.doWrite(h,m,p)},p=>{throw this.fireError(p),p}))}async doWrite(h,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(m){return this.handleError(m,h),Promise.reject(m)}}handleError(h,f){this.errorCount++,this.fireError(h,f,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=d}}),swr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r -`,i=class{static{N(this,"AbstractMessageBuffer")}constructor(a="utf-8"){this._encoding=a,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(a){let o=typeof a=="string"?this.fromString(a,this._encoding):a;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(a=!1){if(this._chunks.length===0)return;let o=0,s=0,l=0,u=0;e:for(;sthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===a){let u=this._chunks[0];return this._chunks.shift(),this._totalLength-=a,this.asNative(u)}if(this._chunks[0].byteLength>a){let u=this._chunks[0],d=this.asNative(u,a);return this._chunks[0]=u.slice(a),this._totalLength-=a,d}let o=this.allocNative(a),s=0,l=0;for(;a>0;){let u=this._chunks[l];if(u.byteLength>a){let d=u.slice(0,a);o.set(d,s),s+=a,this._chunks[l]=u.slice(a),this._totalLength-=a,a-=a}else o.set(u,s),s+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,a-=u.byteLength}return o}};e.AbstractMessageBuffer=i}}),lwr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=$3(),r=OL(),n=Yht(),i=Xht(),a=QS(),o=bj(),s;(function(A){A.type=new n.NotificationType("$/cancelRequest")})(s||(s={}));var l;(function(A){function P(D){return typeof D=="string"||typeof D=="number"}N(P,"is"),A.is=P})(l||(e.ProgressToken=l={}));var u;(function(A){A.type=new n.NotificationType("$/progress")})(u||(u={}));var d=class{static{N(this,"ProgressType")}constructor(){}};e.ProgressType=d;var h;(function(A){function P(D){return r.func(D)}N(P,"is"),A.is=P})(h||(h={})),e.NullLogger=Object.freeze({error:N(()=>{},"error"),warn:N(()=>{},"warn"),info:N(()=>{},"info"),log:N(()=>{},"log")});var f;(function(A){A[A.Off=0]="Off",A[A.Messages=1]="Messages",A[A.Compact=2]="Compact",A[A.Verbose=3]="Verbose"})(f||(e.Trace=f={}));var p;(function(A){A.Off="off",A.Messages="messages",A.Compact="compact",A.Verbose="verbose"})(p||(e.TraceValues=p={})),(function(A){function P(M){if(!r.string(M))return A.Off;switch(M=M.toLowerCase(),M){case"off":return A.Off;case"messages":return A.Messages;case"compact":return A.Compact;case"verbose":return A.Verbose;default:return A.Off}}N(P,"fromString"),A.fromString=P;function D(M){switch(M){case A.Off:return"off";case A.Messages:return"messages";case A.Compact:return"compact";case A.Verbose:return"verbose";default:return"off"}}N(D,"toString"),A.toString=D})(f||(e.Trace=f={}));var m;(function(A){A.Text="text",A.JSON="json"})(m||(e.TraceFormat=m={})),(function(A){function P(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?A.JSON:A.Text):A.Text}N(P,"fromString"),A.fromString=P})(m||(e.TraceFormat=m={}));var g;(function(A){A.type=new n.NotificationType("$/setTrace")})(g||(e.SetTraceNotification=g={}));var y;(function(A){A.type=new n.NotificationType("$/logTrace")})(y||(e.LogTraceNotification=y={}));var v;(function(A){A[A.Closed=1]="Closed",A[A.Disposed=2]="Disposed",A[A.AlreadyListening=3]="AlreadyListening"})(v||(e.ConnectionErrors=v={}));var b=class Kht extends Error{static{N(this,"ConnectionError")}constructor(P,D){super(D),this.code=P,Object.setPrototypeOf(this,Kht.prototype)}};e.ConnectionError=b;var x;(function(A){function P(D){let M=D;return M&&r.func(M.cancelUndispatched)}N(P,"is"),A.is=P})(x||(e.ConnectionStrategy=x={}));var E;(function(A){function P(D){let M=D;return M&&(M.kind===void 0||M.kind==="id")&&r.func(M.createCancellationTokenSource)&&(M.dispose===void 0||r.func(M.dispose))}N(P,"is"),A.is=P})(E||(e.IdCancellationReceiverStrategy=E={}));var w;(function(A){function P(D){let M=D;return M&&M.kind==="request"&&r.func(M.createCancellationTokenSource)&&(M.dispose===void 0||r.func(M.dispose))}N(P,"is"),A.is=P})(w||(e.RequestCancellationReceiverStrategy=w={}));var T;(function(A){A.Message=Object.freeze({createCancellationTokenSource(D){return new o.CancellationTokenSource}});function P(D){return E.is(D)||w.is(D)}N(P,"is"),A.is=P})(T||(e.CancellationReceiverStrategy=T={}));var C;(function(A){A.Message=Object.freeze({sendCancellation(D,M){return D.sendNotification(s.type,{id:M})},cleanup(D){}});function P(D){let M=D;return M&&r.func(M.sendCancellation)&&r.func(M.cleanup)}N(P,"is"),A.is=P})(C||(e.CancellationSenderStrategy=C={}));var S;(function(A){A.Message=Object.freeze({receiver:T.Message,sender:C.Message});function P(D){let M=D;return M&&T.is(M.receiver)&&C.is(M.sender)}N(P,"is"),A.is=P})(S||(e.CancellationStrategy=S={}));var R;(function(A){function P(D){let M=D;return M&&r.func(M.handleMessage)}N(P,"is"),A.is=P})(R||(e.MessageStrategy=R={}));var U;(function(A){function P(D){let M=D;return M&&(S.is(M.cancellationStrategy)||x.is(M.connectionStrategy)||R.is(M.messageStrategy))}N(P,"is"),A.is=P})(U||(e.ConnectionOptions=U={}));var L;(function(A){A[A.New=1]="New",A[A.Listening=2]="Listening",A[A.Closed=3]="Closed",A[A.Disposed=4]="Disposed"})(L||(L={}));function I(A,P,D,M){let O=D!==void 0?D:e.NullLogger,_=0,B=0,F=0,G="2.0",z,V=new Map,$,Z=new Map,re=new Map,Q,ge=new i.LinkedMap,ie=new Map,pe=new Set,ue=new Map,fe=f.Off,Me=m.Text,Ce,Ye=L.New,Ze=new a.Emitter,Qe=new a.Emitter,ve=new a.Emitter,Fe=new a.Emitter,Le=new a.Emitter,Be=M&&M.cancellationStrategy?M.cancellationStrategy:S.Message;function ae(Ne){if(Ne===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ne.toString()}N(ae,"createRequestQueueKey");function he(Ne){return Ne===null?"res-unknown-"+(++F).toString():"res-"+Ne.toString()}N(he,"createResponseQueueKey");function de(){return"not-"+(++B).toString()}N(de,"createNotificationQueueKey");function me(Ne,at){n.Message.isRequest(at)?Ne.set(ae(at.id),at):n.Message.isResponse(at)?Ne.set(he(at.id),at):Ne.set(de(),at)}N(me,"addMessageToQueue");function ke(Ne){}N(ke,"cancelUndispatched");function le(){return Ye===L.Listening}N(le,"isListening");function W(){return Ye===L.Closed}N(W,"isClosed");function X(){return Ye===L.Disposed}N(X,"isDisposed");function q(){(Ye===L.New||Ye===L.Listening)&&(Ye=L.Closed,Qe.fire(void 0))}N(q,"closeHandler");function j(Ne){Ze.fire([Ne,void 0,void 0])}N(j,"readErrorHandler");function se(Ne){Ze.fire(Ne)}N(se,"writeErrorHandler"),A.onClose(q),A.onError(j),P.onClose(q),P.onError(se);function J(){Q||ge.size===0||(Q=(0,t.default)().timer.setImmediate(()=>{Q=void 0,ee()}))}N(J,"triggerMessageQueue");function K(Ne){n.Message.isRequest(Ne)?Te(Ne):n.Message.isNotification(Ne)?Ie(Ne):n.Message.isResponse(Ne)?Ae(Ne):Ge(Ne)}N(K,"handleMessage");function ee(){if(ge.size===0)return;let Ne=ge.shift();try{let at=M?.messageStrategy;R.is(at)?at.handleMessage(Ne,K):K(Ne)}finally{J()}}N(ee,"processMessageQueue");let Se=N(Ne=>{try{if(n.Message.isNotification(Ne)&&Ne.method===s.type.method){let at=Ne.params.id,ft=ae(at),Ct=ge.get(ft);if(n.Message.isRequest(Ct)){let Wt=M?.connectionStrategy,Sr=Wt&&Wt.cancelUndispatched?Wt.cancelUndispatched(Ct,ke):void 0;if(Sr&&(Sr.error!==void 0||Sr.result!==void 0)){ge.delete(ft),ue.delete(at),Sr.id=Ct.id,Ke(Sr,Ne.method,Date.now()),P.write(Sr).catch(()=>O.error("Sending response for canceled message failed."));return}}let Er=ue.get(at);if(Er!==void 0){Er.cancel(),bt(Ne);return}else pe.add(at)}me(ge,Ne)}finally{J()}},"callback");function Te(Ne){if(X())return;function at(ir,Jt,Ar){let ot={jsonrpc:G,id:Ne.id};ir instanceof n.ResponseError?ot.error=ir.toJson():ot.result=ir===void 0?null:ir,Ke(ot,Jt,Ar),P.write(ot).catch(()=>O.error("Sending response failed."))}N(at,"reply");function ft(ir,Jt,Ar){let ot={jsonrpc:G,id:Ne.id,error:ir.toJson()};Ke(ot,Jt,Ar),P.write(ot).catch(()=>O.error("Sending response failed."))}N(ft,"replyError");function Ct(ir,Jt,Ar){ir===void 0&&(ir=null);let ot={jsonrpc:G,id:Ne.id,result:ir};Ke(ot,Jt,Ar),P.write(ot).catch(()=>O.error("Sending response failed."))}N(Ct,"replySuccess"),we(Ne);let Er=V.get(Ne.method),Wt,Sr;Er&&(Wt=Er.type,Sr=Er.handler);let on=Date.now();if(Sr||z){let ir=Ne.id??String(Date.now()),Jt=E.is(Be.receiver)?Be.receiver.createCancellationTokenSource(ir):Be.receiver.createCancellationTokenSource(Ne);Ne.id!==null&&pe.has(Ne.id)&&Jt.cancel(),Ne.id!==null&&ue.set(ir,Jt);try{let Ar;if(Sr)if(Ne.params===void 0){if(Wt!==void 0&&Wt.numberOfParams!==0){ft(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ne.method} defines ${Wt.numberOfParams} params but received none.`),Ne.method,on);return}Ar=Sr(Jt.token)}else if(Array.isArray(Ne.params)){if(Wt!==void 0&&Wt.parameterStructures===n.ParameterStructures.byName){ft(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ne.method} defines parameters by name but received parameters by position`),Ne.method,on);return}Ar=Sr(...Ne.params,Jt.token)}else{if(Wt!==void 0&&Wt.parameterStructures===n.ParameterStructures.byPosition){ft(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ne.method} defines parameters by position but received parameters by name`),Ne.method,on);return}Ar=Sr(Ne.params,Jt.token)}else z&&(Ar=z(Ne.method,Ne.params,Jt.token));let ot=Ar;Ar?ot.then?ot.then(wt=>{ue.delete(ir),at(wt,Ne.method,on)},wt=>{ue.delete(ir),wt instanceof n.ResponseError?ft(wt,Ne.method,on):wt&&r.string(wt.message)?ft(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ne.method} failed with message: ${wt.message}`),Ne.method,on):ft(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ne.method} failed unexpectedly without providing any details.`),Ne.method,on)}):(ue.delete(ir),at(Ar,Ne.method,on)):(ue.delete(ir),Ct(Ar,Ne.method,on))}catch(Ar){ue.delete(ir),Ar instanceof n.ResponseError?at(Ar,Ne.method,on):Ar&&r.string(Ar.message)?ft(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ne.method} failed with message: ${Ar.message}`),Ne.method,on):ft(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ne.method} failed unexpectedly without providing any details.`),Ne.method,on)}}else ft(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ne.method}`),Ne.method,on)}N(Te,"handleRequest");function Ae(Ne){if(!X())if(Ne.id===null)Ne.error?O.error(`Received response message without id: Error is: -${JSON.stringify(Ne.error,void 0,4)}`):O.error("Received response message without id. No further error information provided.");else{let at=Ne.id,ft=ie.get(at);if(Ve(Ne,ft),ft!==void 0){ie.delete(at);try{if(Ne.error){let Ct=Ne.error;ft.reject(new n.ResponseError(Ct.code,Ct.message,Ct.data))}else if(Ne.result!==void 0)ft.resolve(Ne.result);else throw new Error("Should never happen.")}catch(Ct){Ct.message?O.error(`Response handler '${ft.method}' failed with message: ${Ct.message}`):O.error(`Response handler '${ft.method}' failed unexpectedly.`)}}}}N(Ae,"handleResponse");function Ie(Ne){if(X())return;let at,ft;if(Ne.method===s.type.method){let Ct=Ne.params.id;pe.delete(Ct),bt(Ne);return}else{let Ct=Z.get(Ne.method);Ct&&(ft=Ct.handler,at=Ct.type)}if(ft||$)try{if(bt(Ne),ft)if(Ne.params===void 0)at!==void 0&&at.numberOfParams!==0&&at.parameterStructures!==n.ParameterStructures.byName&&O.error(`Notification ${Ne.method} defines ${at.numberOfParams} params but received none.`),ft();else if(Array.isArray(Ne.params)){let Ct=Ne.params;Ne.method===u.type.method&&Ct.length===2&&l.is(Ct[0])?ft({token:Ct[0],value:Ct[1]}):(at!==void 0&&(at.parameterStructures===n.ParameterStructures.byName&&O.error(`Notification ${Ne.method} defines parameters by name but received parameters by position`),at.numberOfParams!==Ne.params.length&&O.error(`Notification ${Ne.method} defines ${at.numberOfParams} params but received ${Ct.length} arguments`)),ft(...Ct))}else at!==void 0&&at.parameterStructures===n.ParameterStructures.byPosition&&O.error(`Notification ${Ne.method} defines parameters by position but received parameters by name`),ft(Ne.params);else $&&$(Ne.method,Ne.params)}catch(Ct){Ct.message?O.error(`Notification handler '${Ne.method}' failed with message: ${Ct.message}`):O.error(`Notification handler '${Ne.method}' failed unexpectedly.`)}else ve.fire(Ne)}N(Ie,"handleNotification");function Ge(Ne){if(!Ne){O.error("Received empty message.");return}O.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ne,null,4)}`);let at=Ne;if(r.string(at.id)||r.number(at.id)){let ft=at.id,Ct=ie.get(ft);Ct&&Ct.reject(new Error("The received response has neither a result nor an error property."))}}N(Ge,"handleInvalidMessage");function De(Ne){if(Ne!=null)switch(fe){case f.Verbose:return JSON.stringify(Ne,null,4);case f.Compact:return JSON.stringify(Ne);default:return}}N(De,"stringifyTrace");function He(Ne){if(!(fe===f.Off||!Ce))if(Me===m.Text){let at;(fe===f.Verbose||fe===f.Compact)&&Ne.params&&(at=`Params: ${De(Ne.params)} - -`),Ce.log(`Sending request '${Ne.method} - (${Ne.id})'.`,at)}else vt("send-request",Ne)}N(He,"traceSendingRequest");function ze(Ne){if(!(fe===f.Off||!Ce))if(Me===m.Text){let at;(fe===f.Verbose||fe===f.Compact)&&(Ne.params?at=`Params: ${De(Ne.params)} - -`:at=`No parameters provided. - -`),Ce.log(`Sending notification '${Ne.method}'.`,at)}else vt("send-notification",Ne)}N(ze,"traceSendingNotification");function Ke(Ne,at,ft){if(!(fe===f.Off||!Ce))if(Me===m.Text){let Ct;(fe===f.Verbose||fe===f.Compact)&&(Ne.error&&Ne.error.data?Ct=`Error data: ${De(Ne.error.data)} - -`:Ne.result?Ct=`Result: ${De(Ne.result)} - -`:Ne.error===void 0&&(Ct=`No result returned. - -`)),Ce.log(`Sending response '${at} - (${Ne.id})'. Processing request took ${Date.now()-ft}ms`,Ct)}else vt("send-response",Ne)}N(Ke,"traceSendingResponse");function we(Ne){if(!(fe===f.Off||!Ce))if(Me===m.Text){let at;(fe===f.Verbose||fe===f.Compact)&&Ne.params&&(at=`Params: ${De(Ne.params)} - -`),Ce.log(`Received request '${Ne.method} - (${Ne.id})'.`,at)}else vt("receive-request",Ne)}N(we,"traceReceivedRequest");function bt(Ne){if(!(fe===f.Off||!Ce||Ne.method===y.type.method))if(Me===m.Text){let at;(fe===f.Verbose||fe===f.Compact)&&(Ne.params?at=`Params: ${De(Ne.params)} - -`:at=`No parameters provided. - -`),Ce.log(`Received notification '${Ne.method}'.`,at)}else vt("receive-notification",Ne)}N(bt,"traceReceivedNotification");function Ve(Ne,at){if(!(fe===f.Off||!Ce))if(Me===m.Text){let ft;if((fe===f.Verbose||fe===f.Compact)&&(Ne.error&&Ne.error.data?ft=`Error data: ${De(Ne.error.data)} - -`:Ne.result?ft=`Result: ${De(Ne.result)} - -`:Ne.error===void 0&&(ft=`No result returned. - -`)),at){let Ct=Ne.error?` Request failed: ${Ne.error.message} (${Ne.error.code}).`:"";Ce.log(`Received response '${at.method} - (${Ne.id})' in ${Date.now()-at.timerStart}ms.${Ct}`,ft)}else Ce.log(`Received response ${Ne.id} without active response promise.`,ft)}else vt("receive-response",Ne)}N(Ve,"traceReceivedResponse");function vt(Ne,at){if(!Ce||fe===f.Off)return;let ft={isLSPMessage:!0,type:Ne,message:at,timestamp:Date.now()};Ce.log(ft)}N(vt,"logLSPMessage");function Pt(){if(W())throw new b(v.Closed,"Connection is closed.");if(X())throw new b(v.Disposed,"Connection is disposed.")}N(Pt,"throwIfClosedOrDisposed");function Xt(){if(le())throw new b(v.AlreadyListening,"Connection is already listening")}N(Xt,"throwIfListening");function It(){if(!le())throw new Error("Call listen() first.")}N(It,"throwIfNotListening");function Ot(Ne){return Ne===void 0?null:Ne}N(Ot,"undefinedToNull");function Et(Ne){if(Ne!==null)return Ne}N(Et,"nullToUndefined");function Ee(Ne){return Ne!=null&&!Array.isArray(Ne)&&typeof Ne=="object"}N(Ee,"isNamedParam");function gt(Ne,at){switch(Ne){case n.ParameterStructures.auto:return Ee(at)?Et(at):[Ot(at)];case n.ParameterStructures.byName:if(!Ee(at))throw new Error("Received parameters by name but param is not an object literal.");return Et(at);case n.ParameterStructures.byPosition:return[Ot(at)];default:throw new Error(`Unknown parameter structure ${Ne.toString()}`)}}N(gt,"computeSingleParam");function Ut(Ne,at){let ft,Ct=Ne.numberOfParams;switch(Ct){case 0:ft=void 0;break;case 1:ft=gt(Ne.parameterStructures,at[0]);break;default:ft=[];for(let Er=0;Er{Pt();let ft,Ct;if(r.string(Ne)){ft=Ne;let Wt=at[0],Sr=0,on=n.ParameterStructures.auto;n.ParameterStructures.is(Wt)&&(Sr=1,on=Wt);let ir=at.length,Jt=ir-Sr;switch(Jt){case 0:Ct=void 0;break;case 1:Ct=gt(on,at[Sr]);break;default:if(on===n.ParameterStructures.byName)throw new Error(`Received ${Jt} parameters for 'by Name' notification parameter structure.`);Ct=at.slice(Sr,ir).map(Ar=>Ot(Ar));break}}else{let Wt=at;ft=Ne.method,Ct=Ut(Ne,Wt)}let Er={jsonrpc:G,method:ft,params:Ct};return ze(Er),P.write(Er).catch(Wt=>{throw O.error("Sending notification failed."),Wt})},"sendNotification"),onNotification:N((Ne,at)=>{Pt();let ft;return r.func(Ne)?$=Ne:at&&(r.string(Ne)?(ft=Ne,Z.set(Ne,{type:void 0,handler:at})):(ft=Ne.method,Z.set(Ne.method,{type:Ne,handler:at}))),{dispose:N(()=>{ft!==void 0?Z.delete(ft):$=void 0},"dispose")}},"onNotification"),onProgress:N((Ne,at,ft)=>{if(re.has(at))throw new Error(`Progress handler for token ${at} already registered`);return re.set(at,ft),{dispose:N(()=>{re.delete(at)},"dispose")}},"onProgress"),sendProgress:N((Ne,at,ft)=>ct.sendNotification(u.type,{token:at,value:ft}),"sendProgress"),onUnhandledProgress:Fe.event,sendRequest:N((Ne,...at)=>{Pt(),It();let ft,Ct,Er;if(r.string(Ne)){ft=Ne;let ir=at[0],Jt=at[at.length-1],Ar=0,ot=n.ParameterStructures.auto;n.ParameterStructures.is(ir)&&(Ar=1,ot=ir);let wt=at.length;o.CancellationToken.is(Jt)&&(wt=wt-1,Er=Jt);let zt=wt-Ar;switch(zt){case 0:Ct=void 0;break;case 1:Ct=gt(ot,at[Ar]);break;default:if(ot===n.ParameterStructures.byName)throw new Error(`Received ${zt} parameters for 'by Name' request parameter structure.`);Ct=at.slice(Ar,wt).map(Pr=>Ot(Pr));break}}else{let ir=at;ft=Ne.method,Ct=Ut(Ne,ir);let Jt=Ne.numberOfParams;Er=o.CancellationToken.is(ir[Jt])?ir[Jt]:void 0}let Wt=_++,Sr;Er&&(Sr=Er.onCancellationRequested(()=>{let ir=Be.sender.sendCancellation(ct,Wt);return ir===void 0?(O.log(`Received no promise from cancellation strategy when cancelling id ${Wt}`),Promise.resolve()):ir.catch(()=>{O.log(`Sending cancellation messages for id ${Wt} failed`)})}));let on={jsonrpc:G,id:Wt,method:ft,params:Ct};return He(on),typeof Be.sender.enableCancellation=="function"&&Be.sender.enableCancellation(on),new Promise(async(ir,Jt)=>{let Ar=N(zt=>{ir(zt),Be.sender.cleanup(Wt),Sr?.dispose()},"resolveWithCleanup"),ot=N(zt=>{Jt(zt),Be.sender.cleanup(Wt),Sr?.dispose()},"rejectWithCleanup"),wt={method:ft,timerStart:Date.now(),resolve:Ar,reject:ot};try{await P.write(on),ie.set(Wt,wt)}catch(zt){throw O.error("Sending request failed."),wt.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,zt.message?zt.message:"Unknown reason")),zt}})},"sendRequest"),onRequest:N((Ne,at)=>{Pt();let ft=null;return h.is(Ne)?(ft=void 0,z=Ne):r.string(Ne)?(ft=null,at!==void 0&&(ft=Ne,V.set(Ne,{handler:at,type:void 0}))):at!==void 0&&(ft=Ne.method,V.set(Ne.method,{type:Ne,handler:at})),{dispose:N(()=>{ft!==null&&(ft!==void 0?V.delete(ft):z=void 0)},"dispose")}},"onRequest"),hasPendingResponse:N(()=>ie.size>0,"hasPendingResponse"),trace:N(async(Ne,at,ft)=>{let Ct=!1,Er=m.Text;ft!==void 0&&(r.boolean(ft)?Ct=ft:(Ct=ft.sendNotification||!1,Er=ft.traceFormat||m.Text)),fe=Ne,Me=Er,fe===f.Off?Ce=void 0:Ce=at,Ct&&!W()&&!X()&&await ct.sendNotification(g.type,{value:f.toString(Ne)})},"trace"),onError:Ze.event,onClose:Qe.event,onUnhandledNotification:ve.event,onDispose:Le.event,end:N(()=>{P.end()},"end"),dispose:N(()=>{if(X())return;Ye=L.Disposed,Le.fire(void 0);let Ne=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let at of ie.values())at.reject(Ne);ie=new Map,ue=new Map,pe=new Set,ge=new i.LinkedMap,r.func(P.dispose)&&P.dispose(),r.func(A.dispose)&&A.dispose()},"dispose"),listen:N(()=>{Pt(),Xt(),Ye=L.Listening,A.listen(Se)},"listen"),inspect:N(()=>{(0,t.default)().console.log("inspect")},"inspect")};return ct.onNotification(y.type,Ne=>{if(fe===f.Off||!Ce)return;let at=fe===f.Verbose||fe===f.Compact;Ce.log(Ne.message,at?Ne.verbose:void 0)}),ct.onNotification(u.type,Ne=>{let at=re.get(Ne.token);at?at(Ne.value):Fe.fire(Ne)}),ct}N(I,"createMessageConnection"),e.createMessageConnection=I}}),R1e=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=Yht();Object.defineProperty(e,"Message",{enumerable:!0,get:N(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:N(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:N(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:N(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:N(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:N(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:N(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:N(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:N(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:N(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:N(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:N(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:N(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:N(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:N(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:N(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:N(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:N(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:N(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:N(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:N(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:N(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:N(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:N(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:N(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:N(function(){return t.ParameterStructures},"get")});var r=Xht();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:N(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:N(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:N(function(){return r.Touch},"get")});var n=nwr();Object.defineProperty(e,"Disposable",{enumerable:!0,get:N(function(){return n.Disposable},"get")});var i=QS();Object.defineProperty(e,"Event",{enumerable:!0,get:N(function(){return i.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:N(function(){return i.Emitter},"get")});var a=bj();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:N(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:N(function(){return a.CancellationToken},"get")});var o=iwr();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:N(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:N(function(){return o.SharedArrayReceiverStrategy},"get")});var s=awr();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:N(function(){return s.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:N(function(){return s.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:N(function(){return s.ReadableStreamMessageReader},"get")});var l=owr();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:N(function(){return l.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:N(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:N(function(){return l.WriteableStreamMessageWriter},"get")});var u=swr();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:N(function(){return u.AbstractMessageBuffer},"get")});var d=lwr();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:N(function(){return d.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:N(function(){return d.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:N(function(){return d.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:N(function(){return d.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:N(function(){return d.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:N(function(){return d.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:N(function(){return d.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:N(function(){return d.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:N(function(){return d.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:N(function(){return d.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:N(function(){return d.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:N(function(){return d.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:N(function(){return d.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:N(function(){return d.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:N(function(){return d.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:N(function(){return d.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:N(function(){return d.MessageStrategy},"get")});var h=$3();e.RAL=h.default}}),cwr=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=R1e(),r=class Zht extends t.AbstractMessageBuffer{static{N(this,"MessageBuffer")}constructor(u="utf-8"){super(u),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Zht.emptyBuffer}fromString(u,d){return new TextEncoder().encode(u)}toString(u,d){return d==="ascii"?this.asciiDecoder.decode(u):new TextDecoder(d).decode(u)}asNative(u,d){return d===void 0?u:u.slice(0,d)}allocNative(u){return new Uint8Array(u)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{N(this,"ReadableStreamWrapper")}constructor(l){this.socket=l,this._onData=new t.Emitter,this._messageListener=u=>{u.data.arrayBuffer().then(h=>{this._onData.fire(new Uint8Array(h))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}onData(l){return this._onData.event(l)}},i=class{static{N(this,"WritableStreamWrapper")}constructor(l){this.socket=l}onClose(l){return this.socket.addEventListener("close",l),t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){return this.socket.addEventListener("error",l),t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){return this.socket.addEventListener("end",l),t.Disposable.create(()=>this.socket.removeEventListener("end",l))}write(l,u){if(typeof l=="string"){if(u!==void 0&&u!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`);this.socket.send(l)}else this.socket.send(l);return Promise.resolve()}end(){this.socket.close()}},a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:N(l=>new r(l),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:N((l,u)=>{if(u.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`);return Promise.resolve(a.encode(JSON.stringify(l,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:N((l,u)=>{if(!(l instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(l)))},"decode")})}),stream:Object.freeze({asReadableStream:N(l=>new n(l),"asReadableStream"),asWritableStream:N(l=>new i(l),"asWritableStream")}),console,timer:Object.freeze({setTimeout(l,u,...d){let h=setTimeout(l,u,...d);return{dispose:N(()=>clearTimeout(h),"dispose")}},setImmediate(l,...u){let d=setTimeout(l,0,...u);return{dispose:N(()=>clearTimeout(d),"dispose")}},setInterval(l,u,...d){let h=setInterval(l,u,...d);return{dispose:N(()=>clearInterval(h),"dispose")}}})});function s(){return o}N(s,"RIL"),(function(l){function u(){t.RAL.install(o)}N(u,"install"),l.install=u})(s||(s={})),e.default=s}}),JS=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(l,u,d,h){h===void 0&&(h=d);var f=Object.getOwnPropertyDescriptor(u,d);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:N(function(){return u[d]},"get")}),Object.defineProperty(l,h,f)}):(function(l,u,d,h){h===void 0&&(h=d),l[h]=u[d]})),r=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=cwr();n.default.install();var i=R1e();r(R1e(),e);var a=class extends i.AbstractMessageReader{static{N(this,"BrowserMessageReader")}constructor(l){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},l.addEventListener("error",u=>this.fireError(u)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}};e.BrowserMessageReader=a;var o=class extends i.AbstractMessageWriter{static{N(this,"BrowserMessageWriter")}constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",u=>this.fireError(u))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(u){return this.handleError(u,l),Promise.reject(u)}}handleError(l,u){this.errorCount++,this.fireError(l,u,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function s(l,u,d,h){return d===void 0&&(d=i.NullLogger),i.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,i.createMessageConnection)(l,u,d,h)}N(s,"createMessageConnection"),e.createMessageConnection=s}}),Jut=On({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){"use strict";t.exports=JS()}}),Mo=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=JS(),r;(function(l){l.clientToServer="clientToServer",l.serverToClient="serverToClient",l.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{N(this,"RegistrationType")}constructor(l){this.method=l}};e.RegistrationType=n;var i=class extends t.RequestType0{static{N(this,"ProtocolRequestType0")}constructor(l){super(l)}};e.ProtocolRequestType0=i;var a=class extends t.RequestType{static{N(this,"ProtocolRequestType")}constructor(l){super(l,t.ParameterStructures.byName)}};e.ProtocolRequestType=a;var o=class extends t.NotificationType0{static{N(this,"ProtocolNotificationType0")}constructor(l){super(l)}};e.ProtocolNotificationType0=o;var s=class extends t.NotificationType{static{N(this,"ProtocolNotificationType")}constructor(l){super(l,t.ParameterStructures.byName)}};e.ProtocolNotificationType=s}}),dve=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(d){return d===!0||d===!1}N(t,"boolean"),e.boolean=t;function r(d){return typeof d=="string"||d instanceof String}N(r,"string"),e.string=r;function n(d){return typeof d=="number"||d instanceof Number}N(n,"number"),e.number=n;function i(d){return d instanceof Error}N(i,"error"),e.error=i;function a(d){return typeof d=="function"}N(a,"func"),e.func=a;function o(d){return Array.isArray(d)}N(o,"array"),e.array=o;function s(d){return o(d)&&d.every(h=>r(h))}N(s,"stringArray"),e.stringArray=s;function l(d,h){return Array.isArray(d)&&d.every(h)}N(l,"typedArray"),e.typedArray=l;function u(d){return d!==null&&typeof d=="object"}N(u,"objectLiteral"),e.objectLiteral=u}}),uwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Mo(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),dwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Mo(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),hwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Mo(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolNotificationType(i.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),fwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Mo(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),pwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Mo(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ColorPresentationRequest=n={}))}}),mwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Mo(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),gwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Mo(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),ywr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Mo(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),vwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=JS(),r=Mo(),n;(function(o){o.type=new t.ProgressType;function s(l){return l===o.type}N(s,"is"),o.is=s})(n||(e.WorkDoneProgress=n={}));var i;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))}}),bwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Mo(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))}}),xwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Mo(),r;(function(l){l.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new t.RegistrationType(l.method)})(n||(e.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method),l.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=t.MessageDirection.serverToClient,l.type=new t.ProtocolRequestType0(l.method)})(s||(e.SemanticTokensRefreshRequest=s={}))}}),wwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Mo(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),Ewr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Mo(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),Twr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Mo(),r;(function(u){u.file="file",u.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(e.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(s||(e.DidDeleteFilesNotification=s={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(l||(e.WillDeleteFilesRequest=l={}))}}),kwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Mo(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(e.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(i||(e.MonikerRequest=i={}))}}),Cwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Mo(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))}}),Swr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Mo(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(e.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),Awr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Mo(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(i||(e.InlayHintRefreshRequest=i={}))}}),Uwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=JS(),r=dve(),n=Mo(),i;(function(u){function d(h){let f=h;return f&&r.boolean(f.retriggerRequest)}N(d,"is"),u.is=d})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(e.DocumentDiagnosticReportKind=a={}));var o;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var s;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(e.DiagnosticRefreshRequest=l={}))}}),Iwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(PL(),uve(vj)),r=dve(),n=Mo(),i;(function(m){m.Markup=1,m.Code=2;function g(y){return y===1||y===2}N(g,"is"),m.is=g})(i||(e.NotebookCellKind=i={}));var a;(function(m){function g(b,x){let E={executionOrder:b};return(x===!0||x===!1)&&(E.success=x),E}N(g,"create"),m.create=g;function y(b){let x=b;return r.objectLiteral(x)&&t.uinteger.is(x.executionOrder)&&(x.success===void 0||r.boolean(x.success))}N(y,"is"),m.is=y;function v(b,x){return b===x?!0:b==null||x===null||x===void 0?!1:b.executionOrder===x.executionOrder&&b.success===x.success}N(v,"equals"),m.equals=v})(a||(e.ExecutionSummary=a={}));var o;(function(m){function g(x,E){return{kind:x,document:E}}N(g,"create"),m.create=g;function y(x){let E=x;return r.objectLiteral(E)&&i.is(E.kind)&&t.DocumentUri.is(E.document)&&(E.metadata===void 0||r.objectLiteral(E.metadata))}N(y,"is"),m.is=y;function v(x,E){let w=new Set;return x.document!==E.document&&w.add("document"),x.kind!==E.kind&&w.add("kind"),x.executionSummary!==E.executionSummary&&w.add("executionSummary"),(x.metadata!==void 0||E.metadata!==void 0)&&!b(x.metadata,E.metadata)&&w.add("metadata"),(x.executionSummary!==void 0||E.executionSummary!==void 0)&&!a.equals(x.executionSummary,E.executionSummary)&&w.add("executionSummary"),w}N(v,"diff"),m.diff=v;function b(x,E){if(x===E)return!0;if(x==null||E===null||E===void 0||typeof x!=typeof E||typeof x!="object")return!1;let w=Array.isArray(x),T=Array.isArray(E);if(w!==T)return!1;if(w&&T){if(x.length!==E.length)return!1;for(let C=0;C0}N(gt,"hasId"),Ee.hasId=gt})(_||(e.StaticRegistrationOptions=_={}));var B;(function(Ee){function gt(Ut){let ct=Ut;return ct&&(ct.documentSelector===null||I.is(ct.documentSelector))}N(gt,"is"),Ee.is=gt})(B||(e.TextDocumentRegistrationOptions=B={}));var F;(function(Ee){function gt(ct){let Ne=ct;return n.objectLiteral(Ne)&&(Ne.workDoneProgress===void 0||n.boolean(Ne.workDoneProgress))}N(gt,"is"),Ee.is=gt;function Ut(ct){let Ne=ct;return Ne&&n.boolean(Ne.workDoneProgress)}N(Ut,"hasWorkDoneProgress"),Ee.hasWorkDoneProgress=Ut})(F||(e.WorkDoneProgressOptions=F={}));var G;(function(Ee){Ee.method="initialize",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(G||(e.InitializeRequest=G={}));var z;(function(Ee){Ee.unknownProtocolVersion=1})(z||(e.InitializeErrorCodes=z={}));var V;(function(Ee){Ee.method="initialized",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(V||(e.InitializedNotification=V={}));var $;(function(Ee){Ee.method="shutdown",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType0(Ee.method)})($||(e.ShutdownRequest=$={}));var Z;(function(Ee){Ee.method="exit",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType0(Ee.method)})(Z||(e.ExitNotification=Z={}));var re;(function(Ee){Ee.method="workspace/didChangeConfiguration",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(re||(e.DidChangeConfigurationNotification=re={}));var Q;(function(Ee){Ee.Error=1,Ee.Warning=2,Ee.Info=3,Ee.Log=4,Ee.Debug=5})(Q||(e.MessageType=Q={}));var ge;(function(Ee){Ee.method="window/showMessage",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolNotificationType(Ee.method)})(ge||(e.ShowMessageNotification=ge={}));var ie;(function(Ee){Ee.method="window/showMessageRequest",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolRequestType(Ee.method)})(ie||(e.ShowMessageRequest=ie={}));var pe;(function(Ee){Ee.method="window/logMessage",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolNotificationType(Ee.method)})(pe||(e.LogMessageNotification=pe={}));var ue;(function(Ee){Ee.method="telemetry/event",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolNotificationType(Ee.method)})(ue||(e.TelemetryEventNotification=ue={}));var fe;(function(Ee){Ee.None=0,Ee.Full=1,Ee.Incremental=2})(fe||(e.TextDocumentSyncKind=fe={}));var Me;(function(Ee){Ee.method="textDocument/didOpen",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Me||(e.DidOpenTextDocumentNotification=Me={}));var Ce;(function(Ee){function gt(ct){let Ne=ct;return Ne!=null&&typeof Ne.text=="string"&&Ne.range!==void 0&&(Ne.rangeLength===void 0||typeof Ne.rangeLength=="number")}N(gt,"isIncremental"),Ee.isIncremental=gt;function Ut(ct){let Ne=ct;return Ne!=null&&typeof Ne.text=="string"&&Ne.range===void 0&&Ne.rangeLength===void 0}N(Ut,"isFull"),Ee.isFull=Ut})(Ce||(e.TextDocumentContentChangeEvent=Ce={}));var Ye;(function(Ee){Ee.method="textDocument/didChange",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Ye||(e.DidChangeTextDocumentNotification=Ye={}));var Ze;(function(Ee){Ee.method="textDocument/didClose",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Ze||(e.DidCloseTextDocumentNotification=Ze={}));var Qe;(function(Ee){Ee.method="textDocument/didSave",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Qe||(e.DidSaveTextDocumentNotification=Qe={}));var ve;(function(Ee){Ee.Manual=1,Ee.AfterDelay=2,Ee.FocusOut=3})(ve||(e.TextDocumentSaveReason=ve={}));var Fe;(function(Ee){Ee.method="textDocument/willSave",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Fe||(e.WillSaveTextDocumentNotification=Fe={}));var Le;(function(Ee){Ee.method="textDocument/willSaveWaitUntil",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Le||(e.WillSaveTextDocumentWaitUntilRequest=Le={}));var Be;(function(Ee){Ee.method="workspace/didChangeWatchedFiles",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolNotificationType(Ee.method)})(Be||(e.DidChangeWatchedFilesNotification=Be={}));var ae;(function(Ee){Ee.Created=1,Ee.Changed=2,Ee.Deleted=3})(ae||(e.FileChangeType=ae={}));var he;(function(Ee){function gt(Ut){let ct=Ut;return n.objectLiteral(ct)&&(r.URI.is(ct.baseUri)||r.WorkspaceFolder.is(ct.baseUri))&&n.string(ct.pattern)}N(gt,"is"),Ee.is=gt})(he||(e.RelativePattern=he={}));var de;(function(Ee){Ee.Create=1,Ee.Change=2,Ee.Delete=4})(de||(e.WatchKind=de={}));var me;(function(Ee){Ee.method="textDocument/publishDiagnostics",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolNotificationType(Ee.method)})(me||(e.PublishDiagnosticsNotification=me={}));var ke;(function(Ee){Ee.Invoked=1,Ee.TriggerCharacter=2,Ee.TriggerForIncompleteCompletions=3})(ke||(e.CompletionTriggerKind=ke={}));var le;(function(Ee){Ee.method="textDocument/completion",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(le||(e.CompletionRequest=le={}));var W;(function(Ee){Ee.method="completionItem/resolve",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(W||(e.CompletionResolveRequest=W={}));var X;(function(Ee){Ee.method="textDocument/hover",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(X||(e.HoverRequest=X={}));var q;(function(Ee){Ee.Invoked=1,Ee.TriggerCharacter=2,Ee.ContentChange=3})(q||(e.SignatureHelpTriggerKind=q={}));var j;(function(Ee){Ee.method="textDocument/signatureHelp",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(j||(e.SignatureHelpRequest=j={}));var se;(function(Ee){Ee.method="textDocument/definition",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(se||(e.DefinitionRequest=se={}));var J;(function(Ee){Ee.method="textDocument/references",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(J||(e.ReferencesRequest=J={}));var K;(function(Ee){Ee.method="textDocument/documentHighlight",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(K||(e.DocumentHighlightRequest=K={}));var ee;(function(Ee){Ee.method="textDocument/documentSymbol",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(ee||(e.DocumentSymbolRequest=ee={}));var Se;(function(Ee){Ee.method="textDocument/codeAction",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Se||(e.CodeActionRequest=Se={}));var Te;(function(Ee){Ee.method="codeAction/resolve",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Te||(e.CodeActionResolveRequest=Te={}));var Ae;(function(Ee){Ee.method="workspace/symbol",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ae||(e.WorkspaceSymbolRequest=Ae={}));var Ie;(function(Ee){Ee.method="workspaceSymbol/resolve",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ie||(e.WorkspaceSymbolResolveRequest=Ie={}));var Ge;(function(Ee){Ee.method="textDocument/codeLens",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ge||(e.CodeLensRequest=Ge={}));var De;(function(Ee){Ee.method="codeLens/resolve",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(De||(e.CodeLensResolveRequest=De={}));var He;(function(Ee){Ee.method="workspace/codeLens/refresh",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolRequestType0(Ee.method)})(He||(e.CodeLensRefreshRequest=He={}));var ze;(function(Ee){Ee.method="textDocument/documentLink",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(ze||(e.DocumentLinkRequest=ze={}));var Ke;(function(Ee){Ee.method="documentLink/resolve",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ke||(e.DocumentLinkResolveRequest=Ke={}));var we;(function(Ee){Ee.method="textDocument/formatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(we||(e.DocumentFormattingRequest=we={}));var bt;(function(Ee){Ee.method="textDocument/rangeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(bt||(e.DocumentRangeFormattingRequest=bt={}));var Ve;(function(Ee){Ee.method="textDocument/rangesFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ve||(e.DocumentRangesFormattingRequest=Ve={}));var vt;(function(Ee){Ee.method="textDocument/onTypeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(vt||(e.DocumentOnTypeFormattingRequest=vt={}));var Pt;(function(Ee){Ee.Identifier=1})(Pt||(e.PrepareSupportDefaultBehavior=Pt={}));var Xt;(function(Ee){Ee.method="textDocument/rename",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Xt||(e.RenameRequest=Xt={}));var It;(function(Ee){Ee.method="textDocument/prepareRename",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(It||(e.PrepareRenameRequest=It={}));var Ot;(function(Ee){Ee.method="workspace/executeCommand",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method)})(Ot||(e.ExecuteCommandRequest=Ot={}));var Et;(function(Ee){Ee.method="workspace/applyEdit",Ee.messageDirection=t.MessageDirection.serverToClient,Ee.type=new t.ProtocolRequestType("workspace/applyEdit")})(Et||(e.ApplyWorkspaceEditRequest=Et={}))}}),Lwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=JS();function r(n,i,a,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,i,a,o)}N(r,"createProtocolConnection"),e.createProtocolConnection=r}}),Dwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(a,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:N(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}):(function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]})),r=e&&e.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,a,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(JS(),e),r((PL(),uve(vj)),e),r(Mo(),e),r(Mwr(),e);var n=Lwr();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:N(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))}}),Nwr=On({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(a,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:N(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}):(function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]})),r=e&&e.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,a,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=Jut();r(Jut(),e),r(Dwr(),e);function i(a,o,s,l){return(0,n.createMessageConnection)(a,o,s,l)}N(i,"createProtocolConnection"),e.createProtocolConnection=i}}),Qht={};Gx(Qht,{AbstractAstReflection:()=>pve,AbstractCstNode:()=>g2e,AbstractLangiumParser:()=>v2e,AbstractParserErrorMessageProvider:()=>z2t,AbstractThreadedAsyncParser:()=>c8r,AstUtils:()=>mve,BiMap:()=>hj,Cancellation:()=>La,CompositeCstNodeImpl:()=>mX,ContextCache:()=>EX,CstNodeBuilder:()=>P2t,CstUtils:()=>hve,DEFAULT_TOKENIZE_OPTIONS:()=>P2e,DONE_RESULT:()=>Pu,DatatypeSymbol:()=>lj,DefaultAstNodeDescriptionProvider:()=>gxt,DefaultAstNodeLocator:()=>vxt,DefaultAsyncParser:()=>Pxt,DefaultCommentProvider:()=>_xt,DefaultConfigurationProvider:()=>bxt,DefaultDocumentBuilder:()=>xxt,DefaultDocumentValidator:()=>mxt,DefaultHydrator:()=>Bxt,DefaultIndexManager:()=>wxt,DefaultJsonSerializer:()=>dxt,DefaultLangiumDocumentFactory:()=>rxt,DefaultLangiumDocuments:()=>nxt,DefaultLangiumProfiler:()=>p8r,DefaultLexer:()=>O2e,DefaultLexerErrorMessageProvider:()=>Txt,DefaultLinker:()=>ixt,DefaultNameProvider:()=>axt,DefaultReferenceDescriptionProvider:()=>yxt,DefaultReferences:()=>oxt,DefaultScopeComputation:()=>sxt,DefaultScopeProvider:()=>uxt,DefaultServiceRegistry:()=>hxt,DefaultTokenBuilder:()=>vX,DefaultValueConverter:()=>C2e,DefaultWorkspaceLock:()=>Oxt,DefaultWorkspaceManager:()=>Ext,Deferred:()=>ev,Disposable:()=>H3,DisposableCache:()=>wX,DocumentCache:()=>cxt,DocumentState:()=>Zn,DocumentValidator:()=>qf,EMPTY_SCOPE:()=>a8r,EMPTY_STREAM:()=>GS,EmptyFileSystem:()=>Ni,EmptyFileSystemProvider:()=>Gxt,ErrorWithLocation:()=>Uj,GrammarAST:()=>tft,GrammarUtils:()=>qve,IndentationAwareLexer:()=>d8r,IndentationAwareTokenBuilder:()=>zxt,JSDocDocumentationProvider:()=>Nxt,LangiumCompletionParser:()=>G2t,LangiumParser:()=>F2t,LangiumParserErrorMessageProvider:()=>b2e,LeafCstNodeImpl:()=>sj,LexingMode:()=>W3,MapScope:()=>i8r,Module:()=>dye,MultiMap:()=>tv,MultiMapScope:()=>lxt,OperationCancelled:()=>Wg,ParserWorker:()=>u8r,ProfilingTask:()=>Vxt,Reduction:()=>bL,RefResolving:()=>f3,RegExpUtils:()=>jve,RootCstNodeImpl:()=>y2e,SimpleCache:()=>M2e,StreamImpl:()=>Gg,StreamScope:()=>sye,TextDocument:()=>uj,TreeStreamImpl:()=>WS,URI:()=>Fh,UriTrie:()=>I2e,UriUtils:()=>Bu,VALIDATE_EACH_NODE:()=>pxt,ValidationCategory:()=>fj,ValidationRegistry:()=>fxt,ValueConverter:()=>Fg,WorkspaceCache:()=>L2e,assertCondition:()=>Yve,assertUnreachable:()=>Wx,createCompletionParser:()=>E2e,createDefaultCoreModule:()=>Ei,createDefaultSharedCoreModule:()=>Ti,createGrammarConfig:()=>dbe,createLangiumParser:()=>T2e,createParser:()=>gX,delayNextTick:()=>bX,diagnosticData:()=>G3,eagerLoad:()=>H2e,getDiagnosticRange:()=>N2e,indentationBuilderDefaultOptions:()=>fye,inject:()=>xn,interruptAndCheck:()=>Wl,isAstNode:()=>Ds,isAstNodeDescription:()=>fve,isAstNodeWithComment:()=>D2e,isCompositeCstNode:()=>Yy,isIMultiModeLexerDefinition:()=>CX,isJSDoc:()=>F2e,isLeafCstNode:()=>K3,isLinkingError:()=>v3,isMultiReference:()=>Vg,isNamed:()=>R2e,isOperationCancelled:()=>m6,isReference:()=>Ou,isRootCstNode:()=>xj,isTokenTypeArray:()=>kX,isTokenTypeDictionary:()=>pj,loadGrammarFromJson:()=>Vl,parseJSDoc:()=>B2e,prepareLangiumParser:()=>k2e,setInterruptionPeriod:()=>S2e,startCancelableOperation:()=>xX,stream:()=>na,toDiagnosticData:()=>_2e,toDiagnosticSeverity:()=>pL});hve={};Gx(hve,{DefaultNameRegexp:()=>zve,RangeComparison:()=>zg,compareRange:()=>Bve,findCommentNode:()=>Gve,findDeclarationNodeAtOffset:()=>xft,findLeafNodeAtOffset:()=>Aj,findLeafNodeBeforeOffset:()=>Wve,flattenCst:()=>bft,getDatatypeNode:()=>vft,getInteriorNodes:()=>Tft,getNextNode:()=>wft,getPreviousNode:()=>Hve,getStartlineNode:()=>Eft,inRange:()=>Fve,isChildNode:()=>Ove,isCommentNode:()=>qY,streamCst:()=>YS,toDocumentSegment:()=>jS,tokenToRange:()=>xL});N(Ds,"isAstNode");N(Ou,"isReference");N(Vg,"isMultiReference");N(fve,"isAstNodeDescription");N(v3,"isLinkingError");pve=class{static{N(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);let r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){let t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Ds(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});let n=r[t];if(n!==void 0)return n;{let i=this.types[e],a=i?i.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=a,a}}getAllSubTypes(e){let t=this.allSubtypes[e];if(t)return t;{let r=this.getAllTypes(),n=[];for(let i of r)this.isSubtype(i,e)&&n.push(i);return this.allSubtypes[e]=n,n}}};N(Yy,"isCompositeCstNode");N(K3,"isLeafCstNode");N(xj,"isRootCstNode");Gg=class Gy{static{N(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){let t={state:this.startFn(),next:N(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let t=this.iterator(),r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){let t=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){let n=this.map(i=>[t?t(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(t){return new Gy(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Pu})}join(t=","){let r=this.iterator(),n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=t),n+=Jht(i.value)),a=!0;while(!i.done);return n}indexOf(t,r=0){let n=this.iterator(),i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===t)return i;a=n.next(),i++}return-1}every(t){let r=this.iterator(),n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){let r=this.iterator(),n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)t(i.value,n),i=r.next(),n++}map(t){return new Gy(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Pu:{done:!1,value:t(i)}})}filter(t){return new Gy(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return Pu})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){let n=this.iterator(),i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=t(i,a.value),a=n.next();return i}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){let i=t.next();if(i.done)return n;let a=this.recursiveReduce(t,r,n);return a===void 0?i.value:r(a,i.value)}find(t){let r=this.iterator(),n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(t(i.value))return n;i=r.next(),n++}return-1}includes(t){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new Gy(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}let{done:n,value:i}=this.nextFn(r.this);if(!n){let a=t(i);if(vL(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Pu})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let r=t>1?this.flat(t-1):this;return new Gy(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:i,value:a}=r.nextFn(n.this);if(!i)if(vL(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Pu})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new Gy(()=>{let r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?Pu:this.nextFn(r.state)))}distinct(t){return new Gy(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=t?t(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Pu})}exclude(t,r){let n=new Set;for(let i of t){let a=r?r(i):i;n.add(a)}return this.filter(i=>{let a=r?r(i):i;return!n.has(a)})}};N(Jht,"toString");N(vL,"isIterable");GS=new Gg(()=>{},()=>Pu),Pu=Object.freeze({done:!0,value:void 0});N(na,"stream");WS=class extends Gg{static{N(this,"TreeStreamImpl")}constructor(e,t,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){let a=n.iterators[n.iterators.length-1].next();if(a.done)n.iterators.pop();else return n.iterators.push(t(a.value)[Symbol.iterator]()),a}return Pu})}iterator(){let e={state:this.startFn(),next:N(()=>this.nextFn(e.state),"next"),prune:N(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}};(function(e){function t(a){return a.reduce((o,s)=>o+s,0)}N(t,"sum"),e.sum=t;function r(a){return a.reduce((o,s)=>o*s,0)}N(r,"product"),e.product=r;function n(a){return a.reduce((o,s)=>Math.min(o,s))}N(n,"min"),e.min=n;function i(a){return a.reduce((o,s)=>Math.max(o,s))}N(i,"max"),e.max=i})(bL||(bL={}));mve={};Gx(mve,{assignMandatoryProperties:()=>gve,copyAstNode:()=>MY,findRootNode:()=>OS,getContainerOfType:()=>Z3,getDocument:()=>I0,getReferenceNodes:()=>IY,hasContainerOfType:()=>eft,linkContentToContainer:()=>VS,streamAllContents:()=>rv,streamAst:()=>R0,streamContents:()=>BL,streamReferences:()=>HS});N(VS,"linkContentToContainer");N(Z3,"getContainerOfType");N(eft,"hasContainerOfType");N(I0,"getDocument");N(OS,"findRootNode");N(IY,"getReferenceNodes");N(BL,"streamContents");N(rv,"streamAllContents");N(R0,"streamAst");N(RY,"isAstNodeInRange");N(HS,"streamReferences");N(gve,"assignMandatoryProperties");N(yve,"copyDefaultValue");N(MY,"copyAstNode");tft={};Gx(tft,{AbstractElement:()=>zd,AbstractParserRule:()=>eL,AbstractRule:()=>AS,AbstractType:()=>Bh,Action:()=>Ux,Alternatives:()=>tL,ArrayLiteral:()=>LY,ArrayType:()=>DY,Assignment:()=>Ix,BooleanLiteral:()=>NY,CharacterRange:()=>Rx,Condition:()=>Mx,Conjunction:()=>rL,CrossReference:()=>Lx,Disjunction:()=>nL,EndOfFile:()=>_Y,Grammar:()=>Vy,GrammarImport:()=>PY,Group:()=>b3,InferredType:()=>OY,InfixRule:()=>Bg,InfixRuleOperatorList:()=>iL,InfixRuleOperators:()=>BY,Interface:()=>US,Keyword:()=>IS,LangiumGrammarAstReflection:()=>Pve,LangiumGrammarTerminals:()=>_wr,NamedArgument:()=>RS,NegatedToken:()=>x3,Negation:()=>FY,NumberLiteral:()=>zY,Parameter:()=>MS,ParameterReference:()=>GY,ParserRule:()=>C0,ReferenceType:()=>aL,RegexToken:()=>w3,ReturnType:()=>WY,RuleCall:()=>E3,SimpleType:()=>LS,StringLiteral:()=>VY,TerminalAlternatives:()=>T3,TerminalElement:()=>Gd,TerminalGroup:()=>k3,TerminalRule:()=>Hy,TerminalRuleCall:()=>C3,Type:()=>oL,TypeAttribute:()=>S3,TypeDefinition:()=>A3,UnionType:()=>HY,UnorderedGroup:()=>sL,UntilToken:()=>U3,ValueLiteral:()=>I3,Wildcard:()=>DS,isAbstractElement:()=>wj,isAbstractParserRule:()=>Q3,isAbstractRule:()=>rft,isAbstractType:()=>nft,isAction:()=>Px,isAlternatives:()=>Ej,isArrayLiteral:()=>ift,isArrayType:()=>vve,isAssignment:()=>jy,isBooleanLiteral:()=>bve,isCharacterRange:()=>xve,isCondition:()=>aft,isConjunction:()=>wve,isCrossReference:()=>J3,isDisjunction:()=>Eve,isEndOfFile:()=>Tve,isGrammar:()=>oft,isGrammarImport:()=>sft,isGroup:()=>e6,isInferredType:()=>FL,isInfixRule:()=>qS,isInfixRuleOperatorList:()=>lft,isInfixRuleOperators:()=>cft,isInterface:()=>kve,isKeyword:()=>Xy,isNamedArgument:()=>uft,isNegatedToken:()=>Cve,isNegation:()=>Sve,isNumberLiteral:()=>dft,isParameter:()=>hft,isParameterReference:()=>Ave,isParserRule:()=>zu,isReferenceType:()=>Uve,isRegexToken:()=>Ive,isReturnType:()=>Rve,isRuleCall:()=>$y,isSimpleType:()=>Tj,isStringLiteral:()=>fft,isTerminalAlternatives:()=>Mve,isTerminalElement:()=>pft,isTerminalGroup:()=>Lve,isTerminalRule:()=>$f,isTerminalRuleCall:()=>kj,isType:()=>Cj,isTypeAttribute:()=>mft,isTypeDefinition:()=>gft,isUnionType:()=>Dve,isUnorderedGroup:()=>Sj,isUntilToken:()=>Nve,isValueLiteral:()=>yft,isWildcard:()=>_ve,reflection:()=>Jr});_wr={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},zd={$type:"AbstractElement",cardinality:"cardinality"};N(wj,"isAbstractElement");eL={$type:"AbstractParserRule"};N(Q3,"isAbstractParserRule");AS={$type:"AbstractRule"};N(rft,"isAbstractRule");Bh={$type:"AbstractType"};N(nft,"isAbstractType");Ux={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};N(Px,"isAction");tL={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};N(Ej,"isAlternatives");LY={$type:"ArrayLiteral",elements:"elements"};N(ift,"isArrayLiteral");DY={$type:"ArrayType",elementType:"elementType"};N(vve,"isArrayType");Ix={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};N(jy,"isAssignment");NY={$type:"BooleanLiteral",true:"true"};N(bve,"isBooleanLiteral");Rx={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};N(xve,"isCharacterRange");Mx={$type:"Condition"};N(aft,"isCondition");rL={$type:"Conjunction",left:"left",right:"right"};N(wve,"isConjunction");Lx={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};N(J3,"isCrossReference");nL={$type:"Disjunction",left:"left",right:"right"};N(Eve,"isDisjunction");_Y={$type:"EndOfFile",cardinality:"cardinality"};N(Tve,"isEndOfFile");Vy={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};N(oft,"isGrammar");PY={$type:"GrammarImport",path:"path"};N(sft,"isGrammarImport");b3={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};N(e6,"isGroup");OY={$type:"InferredType",name:"name"};N(FL,"isInferredType");Bg={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};N(qS,"isInfixRule");iL={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};N(lft,"isInfixRuleOperatorList");BY={$type:"InfixRuleOperators",precedences:"precedences"};N(cft,"isInfixRuleOperators");US={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};N(kve,"isInterface");IS={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};N(Xy,"isKeyword");RS={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};N(uft,"isNamedArgument");x3={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};N(Cve,"isNegatedToken");FY={$type:"Negation",value:"value"};N(Sve,"isNegation");zY={$type:"NumberLiteral",value:"value"};N(dft,"isNumberLiteral");MS={$type:"Parameter",name:"name"};N(hft,"isParameter");GY={$type:"ParameterReference",parameter:"parameter"};N(Ave,"isParameterReference");C0={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};N(zu,"isParserRule");aL={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};N(Uve,"isReferenceType");w3={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};N(Ive,"isRegexToken");WY={$type:"ReturnType",name:"name"};N(Rve,"isReturnType");E3={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};N($y,"isRuleCall");LS={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};N(Tj,"isSimpleType");VY={$type:"StringLiteral",value:"value"};N(fft,"isStringLiteral");T3={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};N(Mve,"isTerminalAlternatives");Gd={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};N(pft,"isTerminalElement");k3={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};N(Lve,"isTerminalGroup");Hy={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};N($f,"isTerminalRule");C3={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};N(kj,"isTerminalRuleCall");oL={$type:"Type",name:"name",type:"type"};N(Cj,"isType");S3={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};N(mft,"isTypeAttribute");A3={$type:"TypeDefinition"};N(gft,"isTypeDefinition");HY={$type:"UnionType",types:"types"};N(Dve,"isUnionType");sL={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};N(Sj,"isUnorderedGroup");U3={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};N(Nve,"isUntilToken");I3={$type:"ValueLiteral"};N(yft,"isValueLiteral");DS={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};N(_ve,"isWildcard");Pve=class extends pve{static{N(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:zd.$type,properties:{cardinality:{name:zd.cardinality}},superTypes:[]},AbstractParserRule:{name:eL.$type,properties:{},superTypes:[AS.$type,Bh.$type]},AbstractRule:{name:AS.$type,properties:{},superTypes:[]},AbstractType:{name:Bh.$type,properties:{},superTypes:[]},Action:{name:Ux.$type,properties:{cardinality:{name:Ux.cardinality},feature:{name:Ux.feature},inferredType:{name:Ux.inferredType},operator:{name:Ux.operator},type:{name:Ux.type,referenceType:Bh.$type}},superTypes:[zd.$type]},Alternatives:{name:tL.$type,properties:{cardinality:{name:tL.cardinality},elements:{name:tL.elements,defaultValue:[]}},superTypes:[zd.$type]},ArrayLiteral:{name:LY.$type,properties:{elements:{name:LY.elements,defaultValue:[]}},superTypes:[I3.$type]},ArrayType:{name:DY.$type,properties:{elementType:{name:DY.elementType}},superTypes:[A3.$type]},Assignment:{name:Ix.$type,properties:{cardinality:{name:Ix.cardinality},feature:{name:Ix.feature},operator:{name:Ix.operator},predicate:{name:Ix.predicate},terminal:{name:Ix.terminal}},superTypes:[zd.$type]},BooleanLiteral:{name:NY.$type,properties:{true:{name:NY.true,defaultValue:!1}},superTypes:[Mx.$type,I3.$type]},CharacterRange:{name:Rx.$type,properties:{cardinality:{name:Rx.cardinality},left:{name:Rx.left},lookahead:{name:Rx.lookahead},parenthesized:{name:Rx.parenthesized,defaultValue:!1},right:{name:Rx.right}},superTypes:[Gd.$type]},Condition:{name:Mx.$type,properties:{},superTypes:[]},Conjunction:{name:rL.$type,properties:{left:{name:rL.left},right:{name:rL.right}},superTypes:[Mx.$type]},CrossReference:{name:Lx.$type,properties:{cardinality:{name:Lx.cardinality},deprecatedSyntax:{name:Lx.deprecatedSyntax,defaultValue:!1},isMulti:{name:Lx.isMulti,defaultValue:!1},terminal:{name:Lx.terminal},type:{name:Lx.type,referenceType:Bh.$type}},superTypes:[zd.$type]},Disjunction:{name:nL.$type,properties:{left:{name:nL.left},right:{name:nL.right}},superTypes:[Mx.$type]},EndOfFile:{name:_Y.$type,properties:{cardinality:{name:_Y.cardinality}},superTypes:[zd.$type]},Grammar:{name:Vy.$type,properties:{imports:{name:Vy.imports,defaultValue:[]},interfaces:{name:Vy.interfaces,defaultValue:[]},isDeclared:{name:Vy.isDeclared,defaultValue:!1},name:{name:Vy.name},rules:{name:Vy.rules,defaultValue:[]},types:{name:Vy.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:PY.$type,properties:{path:{name:PY.path}},superTypes:[]},Group:{name:b3.$type,properties:{cardinality:{name:b3.cardinality},elements:{name:b3.elements,defaultValue:[]},guardCondition:{name:b3.guardCondition},predicate:{name:b3.predicate}},superTypes:[zd.$type]},InferredType:{name:OY.$type,properties:{name:{name:OY.name}},superTypes:[Bh.$type]},InfixRule:{name:Bg.$type,properties:{call:{name:Bg.call},dataType:{name:Bg.dataType},inferredType:{name:Bg.inferredType},name:{name:Bg.name},operators:{name:Bg.operators},parameters:{name:Bg.parameters,defaultValue:[]},returnType:{name:Bg.returnType,referenceType:Bh.$type}},superTypes:[eL.$type]},InfixRuleOperatorList:{name:iL.$type,properties:{associativity:{name:iL.associativity},operators:{name:iL.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:BY.$type,properties:{precedences:{name:BY.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:US.$type,properties:{attributes:{name:US.attributes,defaultValue:[]},name:{name:US.name},superTypes:{name:US.superTypes,defaultValue:[],referenceType:Bh.$type}},superTypes:[Bh.$type]},Keyword:{name:IS.$type,properties:{cardinality:{name:IS.cardinality},predicate:{name:IS.predicate},value:{name:IS.value}},superTypes:[zd.$type]},NamedArgument:{name:RS.$type,properties:{calledByName:{name:RS.calledByName,defaultValue:!1},parameter:{name:RS.parameter,referenceType:MS.$type},value:{name:RS.value}},superTypes:[]},NegatedToken:{name:x3.$type,properties:{cardinality:{name:x3.cardinality},lookahead:{name:x3.lookahead},parenthesized:{name:x3.parenthesized,defaultValue:!1},terminal:{name:x3.terminal}},superTypes:[Gd.$type]},Negation:{name:FY.$type,properties:{value:{name:FY.value}},superTypes:[Mx.$type]},NumberLiteral:{name:zY.$type,properties:{value:{name:zY.value}},superTypes:[I3.$type]},Parameter:{name:MS.$type,properties:{name:{name:MS.name}},superTypes:[]},ParameterReference:{name:GY.$type,properties:{parameter:{name:GY.parameter,referenceType:MS.$type}},superTypes:[Mx.$type]},ParserRule:{name:C0.$type,properties:{dataType:{name:C0.dataType},definition:{name:C0.definition},entry:{name:C0.entry,defaultValue:!1},fragment:{name:C0.fragment,defaultValue:!1},inferredType:{name:C0.inferredType},name:{name:C0.name},parameters:{name:C0.parameters,defaultValue:[]},returnType:{name:C0.returnType,referenceType:Bh.$type}},superTypes:[eL.$type]},ReferenceType:{name:aL.$type,properties:{isMulti:{name:aL.isMulti,defaultValue:!1},referenceType:{name:aL.referenceType}},superTypes:[A3.$type]},RegexToken:{name:w3.$type,properties:{cardinality:{name:w3.cardinality},lookahead:{name:w3.lookahead},parenthesized:{name:w3.parenthesized,defaultValue:!1},regex:{name:w3.regex}},superTypes:[Gd.$type]},ReturnType:{name:WY.$type,properties:{name:{name:WY.name}},superTypes:[]},RuleCall:{name:E3.$type,properties:{arguments:{name:E3.arguments,defaultValue:[]},cardinality:{name:E3.cardinality},predicate:{name:E3.predicate},rule:{name:E3.rule,referenceType:AS.$type}},superTypes:[zd.$type]},SimpleType:{name:LS.$type,properties:{primitiveType:{name:LS.primitiveType},stringType:{name:LS.stringType},typeRef:{name:LS.typeRef,referenceType:Bh.$type}},superTypes:[A3.$type]},StringLiteral:{name:VY.$type,properties:{value:{name:VY.value}},superTypes:[I3.$type]},TerminalAlternatives:{name:T3.$type,properties:{cardinality:{name:T3.cardinality},elements:{name:T3.elements,defaultValue:[]},lookahead:{name:T3.lookahead},parenthesized:{name:T3.parenthesized,defaultValue:!1}},superTypes:[Gd.$type]},TerminalElement:{name:Gd.$type,properties:{cardinality:{name:Gd.cardinality},lookahead:{name:Gd.lookahead},parenthesized:{name:Gd.parenthesized,defaultValue:!1}},superTypes:[zd.$type]},TerminalGroup:{name:k3.$type,properties:{cardinality:{name:k3.cardinality},elements:{name:k3.elements,defaultValue:[]},lookahead:{name:k3.lookahead},parenthesized:{name:k3.parenthesized,defaultValue:!1}},superTypes:[Gd.$type]},TerminalRule:{name:Hy.$type,properties:{definition:{name:Hy.definition},fragment:{name:Hy.fragment,defaultValue:!1},hidden:{name:Hy.hidden,defaultValue:!1},name:{name:Hy.name},type:{name:Hy.type}},superTypes:[AS.$type]},TerminalRuleCall:{name:C3.$type,properties:{cardinality:{name:C3.cardinality},lookahead:{name:C3.lookahead},parenthesized:{name:C3.parenthesized,defaultValue:!1},rule:{name:C3.rule,referenceType:Hy.$type}},superTypes:[Gd.$type]},Type:{name:oL.$type,properties:{name:{name:oL.name},type:{name:oL.type}},superTypes:[Bh.$type]},TypeAttribute:{name:S3.$type,properties:{defaultValue:{name:S3.defaultValue},isOptional:{name:S3.isOptional,defaultValue:!1},name:{name:S3.name},type:{name:S3.type}},superTypes:[]},TypeDefinition:{name:A3.$type,properties:{},superTypes:[]},UnionType:{name:HY.$type,properties:{types:{name:HY.types,defaultValue:[]}},superTypes:[A3.$type]},UnorderedGroup:{name:sL.$type,properties:{cardinality:{name:sL.cardinality},elements:{name:sL.elements,defaultValue:[]}},superTypes:[zd.$type]},UntilToken:{name:U3.$type,properties:{cardinality:{name:U3.cardinality},lookahead:{name:U3.lookahead},parenthesized:{name:U3.parenthesized,defaultValue:!1},terminal:{name:U3.terminal}},superTypes:[Gd.$type]},ValueLiteral:{name:I3.$type,properties:{},superTypes:[]},Wildcard:{name:DS.$type,properties:{cardinality:{name:DS.cardinality},lookahead:{name:DS.lookahead},parenthesized:{name:DS.parenthesized,defaultValue:!1}},superTypes:[Gd.$type]}}}},Jr=new Pve;N(vft,"getDatatypeNode");N(YS,"streamCst");N(bft,"flattenCst");N(Ove,"isChildNode");N(xL,"tokenToRange");N(jS,"toDocumentSegment");(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"})(zg||(zg={}));N(Bve,"compareRange");N(Fve,"inRange");zve=/^[\w\p{L}]$/u;N(xft,"findDeclarationNodeAtOffset");N(Gve,"findCommentNode");N(qY,"isCommentNode");N(Aj,"findLeafNodeAtOffset");N(Wve,"findLeafNodeBeforeOffset");N(Vve,"binarySearch");N(Hve,"getPreviousNode");N(wft,"getNextNode");N(Eft,"getStartlineNode");N(Tft,"getInteriorNodes");N(kft,"getCommonParent");N(M1e,"getParentChain");qve={};Gx(qve,{findAssignment:()=>ibe,findNameAssignment:()=>_j,findNodeForKeyword:()=>nbe,findNodeForProperty:()=>Lj,findNodesForKeyword:()=>Mft,findNodesForKeywordInternal:()=>Nj,findNodesForProperty:()=>rbe,getActionAtElement:()=>obe,getActionType:()=>lbe,getAllReachableRules:()=>Mj,getAllRulesUsedForCrossReferences:()=>Rft,getCrossReferenceTerminal:()=>ebe,getEntryRule:()=>Zve,getExplicitRuleType:()=>GL,getHiddenRules:()=>Qve,getRuleType:()=>cbe,getRuleTypeName:()=>Pft,getTypeName:()=>q3,isArrayCardinality:()=>Dft,isArrayOperator:()=>Nft,isCommentTerminal:()=>tbe,isDataType:()=>_ft,isDataTypeRule:()=>zL,isOptionalCardinality:()=>Lft,terminalRegex:()=>WL});Uj=class extends Error{static{N(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};N(Wx,"assertUnreachable");N(Yve,"assertCondition");jve={};Gx(jve,{NEWLINE_REGEXP:()=>Sft,escapeRegExp:()=>eA,getTerminalParts:()=>Uft,isMultilineComment:()=>Xve,isWhitespace:()=>Rj,partialMatches:()=>$ve,partialRegExp:()=>Kve,whitespaceCharacters:()=>Ift});N(vn,"cc");N(sY,"insertToSet");N(ES,"addFlag");N(u3,"ASSERT_EXISTS");N($M,"ASSERT_NEVER_REACH_HERE");N(L1e,"isCharacter");YY=[];for(let e=vn("0");e<=vn("9");e++)YY.push(e);jY=[vn("_")].concat(YY);for(let e=vn("a");e<=vn("z");e++)jY.push(e);for(let e=vn("A");e<=vn("Z");e++)jY.push(e);edt=[vn(" "),vn("\f"),vn(` -`),vn("\r"),vn(" "),vn("\v"),vn(" "),vn("\xA0"),vn("\u1680"),vn("\u2000"),vn("\u2001"),vn("\u2002"),vn("\u2003"),vn("\u2004"),vn("\u2005"),vn("\u2006"),vn("\u2007"),vn("\u2008"),vn("\u2009"),vn("\u200A"),vn("\u2028"),vn("\u2029"),vn("\u202F"),vn("\u205F"),vn("\u3000"),vn("\uFEFF")],Pwr=/[0-9a-fA-F]/,_q=/[0-9]/,Owr=/[1-9]/,Cft=class{static{N(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let t=this.disjunction();this.consumeChar("/");let r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ES(r,"global");break;case"i":ES(r,"ignoreCase");break;case"m":ES(r,"multiLine");break;case"u":ES(r,"unicode");break;case"y":ES(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}u3(t);let r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return $M()}quantifier(e=!1){let t,r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":let n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),t={atLeast:n,atMost:i}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;u3(t);break}if(!(e===!0&&t===void 0)&&u3(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),u3(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):$M()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[vn(` -`),vn("\r"),vn("\u2028"),vn("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=YY;break;case"D":e=YY,t=!0;break;case"s":e=edt;break;case"S":e=edt,t=!0;break;case"w":e=jY;break;case"W":e=jY,t=!0;break}return u3(e)?{type:"Set",value:e,complement:t}:$M()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=vn("\f");break;case"n":e=vn(` -`);break;case"r":e=vn("\r");break;case"t":e=vn(" ");break;case"v":e=vn("\v");break}return u3(e)?{type:"Character",value:e}:$M()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:vn("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:vn(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:vn(e)}}}characterClass(){let e=[],t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){let r=this.classAtom(),n=r.type==="Character";if(L1e(r)&&this.isRangeDash()){this.consumeChar("-");let i=this.classAtom(),a=i.type==="Character";if(L1e(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Ij=class{static{N(this,"BaseRegExpVisitor")}visitChildren(e){for(let t in e){let r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Sft=/\r?\n/gm,Aft=new Cft,Bwr=class extends Ij{static{N(this,"TerminalRegExpVisitor")}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){let t=String.fromCharCode(e.value);if(!this.multiline&&t===` -`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=eA(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){let t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` -`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},F3=new Bwr;N(Uft,"getTerminalParts");N(Xve,"isMultilineComment");Ift=`\f -\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");N(Rj,"isWhitespace");N(eA,"escapeRegExp");N($ve,"partialMatches");N(Kve,"partialRegExp");N(Zve,"getEntryRule");N(Qve,"getHiddenRules");N(Mj,"getAllReachableRules");N(Jve,"ruleDfs");N(Rft,"getAllRulesUsedForCrossReferences");N(ebe,"getCrossReferenceTerminal");N(tbe,"isCommentTerminal");N(rbe,"findNodesForProperty");N(Lj,"findNodeForProperty");N(Dj,"findNodesForPropertyInternal");N(Mft,"findNodesForKeyword");N(nbe,"findNodeForKeyword");N(Nj,"findNodesForKeywordInternal");N(ibe,"findAssignment");N(_j,"findNameAssignment");N(abe,"findNameAssignmentInternal");N(obe,"getActionAtElement");N(Lft,"isOptionalCardinality");N(Dft,"isArrayCardinality");N(Nft,"isArrayOperator");N(zL,"isDataTypeRule");N(sbe,"isDataTypeRuleInternal");N(_ft,"isDataType");N(XY,"isDataTypeInternal");N(GL,"getExplicitRuleType");N(q3,"getTypeName");N(lbe,"getActionType");N(Pft,"getRuleTypeName");N(cbe,"getRuleType");N(WL,"terminalRegex");ube=/[\s\S]/.source;N(t6,"abstractElementToRegex");N(Oft,"terminalAlternativesToRegex");N(Bft,"terminalGroupToRegex");N(Fft,"untilTokenToRegex");N(zft,"negateTokenToRegex");N(Gft,"characterRangeToRegex");N(lY,"keywordToRegex");N(Hg,"withCardinality");N(dbe,"createGrammarConfig");Fwr=typeof global=="object"&&global&&global.Object===Object&&global,Wft=Fwr,zwr=typeof self=="object"&&self&&self.Object===Object&&self,Gwr=Wft||zwr||Function("return this")(),Yg=Gwr,Wwr=Yg.Symbol,jf=Wwr,Vft=Object.prototype,Vwr=Vft.hasOwnProperty,Hwr=Vft.toString,NM=jf?jf.toStringTag:void 0;N(Hft,"getRawTag");qwr=Hft,Ywr=Object.prototype,jwr=Ywr.toString;N(qft,"objectToString");Xwr=qft,$wr="[object Null]",Kwr="[object Undefined]",tdt=jf?jf.toStringTag:void 0;N(Yft,"baseGetTag");Vx=Yft;N(jft,"isObjectLike");D0=jft,Zwr="[object Symbol]";N(Xft,"isSymbol");Pj=Xft;N($ft,"arrayMap");VL=$ft,Qwr=Array.isArray,wi=Qwr,Jwr=1/0,rdt=jf?jf.prototype:void 0,ndt=rdt?rdt.toString:void 0;N(hbe,"baseToString");e5r=hbe,t5r=/\s/;N(Kft,"trimmedEndIndex");r5r=Kft,n5r=/^\s+/;N(Zft,"baseTrim");i5r=Zft;N(Qft,"isObject");Xf=Qft,idt=NaN,a5r=/^[-+]0x[0-9a-f]+$/i,o5r=/^0b[01]+$/i,s5r=/^0o[0-7]+$/i,l5r=parseInt;N(Jft,"toNumber");c5r=Jft,adt=1/0,u5r=17976931348623157e292;N(ept,"toFinite");d5r=ept;N(tpt,"toInteger");HL=tpt;N(rpt,"identity");qL=rpt,h5r="[object AsyncFunction]",f5r="[object Function]",p5r="[object GeneratorFunction]",m5r="[object Proxy]";N(npt,"isFunction");nv=npt,g5r=Yg["__core-js_shared__"],cge=g5r,odt=(function(){var e=/[^.]+$/.exec(cge&&cge.keys&&cge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();N(ipt,"isMasked");y5r=ipt,v5r=Function.prototype,b5r=v5r.toString;N(apt,"toSource");r6=apt,x5r=/[\\^$.*+?()[\]{}|]/g,w5r=/^\[object .+?Constructor\]$/,E5r=Function.prototype,T5r=Object.prototype,k5r=E5r.toString,C5r=T5r.hasOwnProperty,S5r=RegExp("^"+k5r.call(C5r).replace(x5r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");N(opt,"baseIsNative");A5r=opt;N(spt,"getValue");U5r=spt;N(lpt,"getNative");n6=lpt,I5r=n6(Yg,"WeakMap"),D1e=I5r,sdt=Object.create,R5r=(function(){function e(){}return N(e,"object"),function(t){if(!Xf(t))return{};if(sdt)return sdt(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),M5r=R5r;N(cpt,"apply");L5r=cpt;N(upt,"noop");Gl=upt;N(dpt,"copyArray");D5r=dpt,N5r=800,_5r=16,P5r=Date.now;N(hpt,"shortOut");O5r=hpt;N(fpt,"constant");B5r=fpt,F5r=(function(){try{var e=n6(Object,"defineProperty");return e({},"",{}),e}catch{}})(),$Y=F5r,z5r=$Y?function(e,t){return $Y(e,"toString",{configurable:!0,enumerable:!1,value:B5r(t),writable:!0})}:qL,G5r=z5r,W5r=O5r(G5r),V5r=W5r;N(ppt,"arrayEach");mpt=ppt;N(gpt,"baseFindIndex");ypt=gpt;N(vpt,"baseIsNaN");H5r=vpt;N(bpt,"strictIndexOf");q5r=bpt;N(xpt,"baseIndexOf");fbe=xpt;N(wpt,"arrayIncludes");Ept=wpt,Y5r=9007199254740991,j5r=/^(?:0|[1-9]\d*)$/;N(Tpt,"isIndex");Oj=Tpt;N(kpt,"baseAssignValue");pbe=kpt;N(Cpt,"eq");YL=Cpt,X5r=Object.prototype,$5r=X5r.hasOwnProperty;N(Spt,"assignValue");Bj=Spt;N(Apt,"copyObject");jL=Apt,ldt=Math.max;N(Upt,"overRest");K5r=Upt;N(Ipt,"baseRest");mbe=Ipt,Z5r=9007199254740991;N(Rpt,"isLength");gbe=Rpt;N(Mpt,"isArrayLike");jg=Mpt;N(Lpt,"isIterateeCall");Fj=Lpt;N(Dpt,"createAssigner");Q5r=Dpt,J5r=Object.prototype;N(Npt,"isPrototype");XL=Npt;N(_pt,"baseTimes");e4r=_pt,t4r="[object Arguments]";N(Ppt,"baseIsArguments");cdt=Ppt,Opt=Object.prototype,r4r=Opt.hasOwnProperty,n4r=Opt.propertyIsEnumerable,i4r=cdt((function(){return arguments})())?cdt:function(e){return D0(e)&&r4r.call(e,"callee")&&!n4r.call(e,"callee")},zj=i4r;N(Bpt,"stubFalse");a4r=Bpt,Fpt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,udt=Fpt&&typeof module=="object"&&module&&!module.nodeType&&module,o4r=udt&&udt.exports===Fpt,ddt=o4r?Yg.Buffer:void 0,s4r=ddt?ddt.isBuffer:void 0,l4r=s4r||a4r,wL=l4r,c4r="[object Arguments]",u4r="[object Array]",d4r="[object Boolean]",h4r="[object Date]",f4r="[object Error]",p4r="[object Function]",m4r="[object Map]",g4r="[object Number]",y4r="[object Object]",v4r="[object RegExp]",b4r="[object Set]",x4r="[object String]",w4r="[object WeakMap]",E4r="[object ArrayBuffer]",T4r="[object DataView]",k4r="[object Float32Array]",C4r="[object Float64Array]",S4r="[object Int8Array]",A4r="[object Int16Array]",U4r="[object Int32Array]",I4r="[object Uint8Array]",R4r="[object Uint8ClampedArray]",M4r="[object Uint16Array]",L4r="[object Uint32Array]",qa={};qa[k4r]=qa[C4r]=qa[S4r]=qa[A4r]=qa[U4r]=qa[I4r]=qa[R4r]=qa[M4r]=qa[L4r]=!0;qa[c4r]=qa[u4r]=qa[E4r]=qa[d4r]=qa[T4r]=qa[h4r]=qa[f4r]=qa[p4r]=qa[m4r]=qa[g4r]=qa[y4r]=qa[v4r]=qa[b4r]=qa[x4r]=qa[w4r]=!1;N(zpt,"baseIsTypedArray");D4r=zpt;N(Gpt,"baseUnary");$L=Gpt,Wpt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lL=Wpt&&typeof module=="object"&&module&&!module.nodeType&&module,N4r=lL&&lL.exports===Wpt,uge=N4r&&Wft.process,_4r=(function(){try{var e=lL&&lL.require&&lL.require("util").types;return e||uge&&uge.binding&&uge.binding("util")}catch{}})(),Ox=_4r,hdt=Ox&&Ox.isTypedArray,P4r=hdt?$L(hdt):D4r,ybe=P4r,O4r=Object.prototype,B4r=O4r.hasOwnProperty;N(Vpt,"arrayLikeKeys");Hpt=Vpt;N(qpt,"overArg");Ypt=qpt,F4r=Ypt(Object.keys,Object),z4r=F4r,G4r=Object.prototype,W4r=G4r.hasOwnProperty;N(jpt,"baseKeys");Xpt=jpt;N($pt,"keys");zh=$pt,V4r=Object.prototype,H4r=V4r.hasOwnProperty,q4r=Q5r(function(e,t){if(XL(t)||jg(t)){jL(t,zh(t),e);return}for(var r in t)H4r.call(t,r)&&Bj(e,r,t[r])}),Gh=q4r;N(Kpt,"nativeKeysIn");Y4r=Kpt,j4r=Object.prototype,X4r=j4r.hasOwnProperty;N(Zpt,"baseKeysIn");$4r=Zpt;N(Qpt,"keysIn");Gj=Qpt,K4r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z4r=/^\w*$/;N(Jpt,"isKey");vbe=Jpt,Q4r=n6(Object,"create"),EL=Q4r;N(e0t,"hashClear");J4r=e0t;N(t0t,"hashDelete");e3r=t0t,t3r="__lodash_hash_undefined__",r3r=Object.prototype,n3r=r3r.hasOwnProperty;N(r0t,"hashGet");i3r=r0t,a3r=Object.prototype,o3r=a3r.hasOwnProperty;N(n0t,"hashHas");s3r=n0t,l3r="__lodash_hash_undefined__";N(i0t,"hashSet");c3r=i0t;N(i6,"Hash");i6.prototype.clear=J4r;i6.prototype.delete=e3r;i6.prototype.get=i3r;i6.prototype.has=s3r;i6.prototype.set=c3r;fdt=i6;N(a0t,"listCacheClear");u3r=a0t;N(o0t,"assocIndexOf");Wj=o0t,d3r=Array.prototype,h3r=d3r.splice;N(s0t,"listCacheDelete");f3r=s0t;N(l0t,"listCacheGet");p3r=l0t;N(c0t,"listCacheHas");m3r=c0t;N(u0t,"listCacheSet");g3r=u0t;N(a6,"ListCache");a6.prototype.clear=u3r;a6.prototype.delete=f3r;a6.prototype.get=p3r;a6.prototype.has=m3r;a6.prototype.set=g3r;Vj=a6,y3r=n6(Yg,"Map"),TL=y3r;N(d0t,"mapCacheClear");v3r=d0t;N(h0t,"isKeyable");b3r=h0t;N(f0t,"getMapData");Hj=f0t;N(p0t,"mapCacheDelete");x3r=p0t;N(m0t,"mapCacheGet");w3r=m0t;N(g0t,"mapCacheHas");E3r=g0t;N(y0t,"mapCacheSet");T3r=y0t;N(o6,"MapCache");o6.prototype.clear=v3r;o6.prototype.delete=x3r;o6.prototype.get=w3r;o6.prototype.has=E3r;o6.prototype.set=T3r;qj=o6,k3r="Expected a function";N(Yj,"memoize");Yj.Cache=qj;C3r=Yj,S3r=500;N(v0t,"memoizeCapped");A3r=v0t,U3r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I3r=/\\(\\)?/g,R3r=A3r(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(U3r,function(r,n,i,a){t.push(i?a.replace(I3r,"$1"):n||r)}),t}),M3r=R3r;N(b0t,"toString");L3r=b0t;N(x0t,"castPath");jj=x0t,D3r=1/0;N(w0t,"toKey");KL=w0t;N(E0t,"baseGet");bbe=E0t;N(T0t,"get");N3r=T0t;N(k0t,"arrayPush");xbe=k0t,pdt=jf?jf.isConcatSpreadable:void 0;N(C0t,"isFlattenable");_3r=C0t;N(wbe,"baseFlatten");Ebe=wbe;N(S0t,"flatten");M0=S0t,P3r=Ypt(Object.getPrototypeOf,Object),A0t=P3r;N(U0t,"baseSlice");I0t=U0t;N(R0t,"arrayReduce");O3r=R0t;N(M0t,"stackClear");B3r=M0t;N(L0t,"stackDelete");F3r=L0t;N(D0t,"stackGet");z3r=D0t;N(N0t,"stackHas");G3r=N0t,W3r=200;N(_0t,"stackSet");V3r=_0t;N(s6,"Stack");s6.prototype.clear=B3r;s6.prototype.delete=F3r;s6.prototype.get=z3r;s6.prototype.has=G3r;s6.prototype.set=V3r;cL=s6;N(P0t,"baseAssign");H3r=P0t;N(O0t,"baseAssignIn");q3r=O0t,B0t=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mdt=B0t&&typeof module=="object"&&module&&!module.nodeType&&module,Y3r=mdt&&mdt.exports===B0t,gdt=Y3r?Yg.Buffer:void 0,ydt=gdt?gdt.allocUnsafe:void 0;N(F0t,"cloneBuffer");j3r=F0t;N(z0t,"arrayFilter");Tbe=z0t;N(G0t,"stubArray");W0t=G0t,X3r=Object.prototype,$3r=X3r.propertyIsEnumerable,vdt=Object.getOwnPropertySymbols,K3r=vdt?function(e){return e==null?[]:(e=Object(e),Tbe(vdt(e),function(t){return $3r.call(e,t)}))}:W0t,kbe=K3r;N(V0t,"copySymbols");Z3r=V0t,Q3r=Object.getOwnPropertySymbols,J3r=Q3r?function(e){for(var t=[];e;)xbe(t,kbe(e)),e=A0t(e);return t}:W0t,H0t=J3r;N(q0t,"copySymbolsIn");e6r=q0t;N(Y0t,"baseGetAllKeys");j0t=Y0t;N(X0t,"getAllKeys");N1e=X0t;N($0t,"getAllKeysIn");K0t=$0t,t6r=n6(Yg,"DataView"),_1e=t6r,r6r=n6(Yg,"Promise"),P1e=r6r,n6r=n6(Yg,"Set"),BS=n6r,bdt="[object Map]",i6r="[object Object]",xdt="[object Promise]",wdt="[object Set]",Edt="[object WeakMap]",Tdt="[object DataView]",a6r=r6(_1e),o6r=r6(TL),s6r=r6(P1e),l6r=r6(BS),c6r=r6(D1e),d3=Vx;(_1e&&d3(new _1e(new ArrayBuffer(1)))!=Tdt||TL&&d3(new TL)!=bdt||P1e&&d3(P1e.resolve())!=xdt||BS&&d3(new BS)!=wdt||D1e&&d3(new D1e)!=Edt)&&(d3=N(function(e){var t=Vx(e),r=t==i6r?e.constructor:void 0,n=r?r6(r):"";if(n)switch(n){case a6r:return Tdt;case o6r:return bdt;case s6r:return xdt;case l6r:return wdt;case c6r:return Edt}return t},"getTag"));XS=d3,u6r=Object.prototype,d6r=u6r.hasOwnProperty;N(Z0t,"initCloneArray");h6r=Z0t,f6r=Yg.Uint8Array,KY=f6r;N(Q0t,"cloneArrayBuffer");Cbe=Q0t;N(J0t,"cloneDataView");p6r=J0t,m6r=/\w*$/;N(emt,"cloneRegExp");g6r=emt,kdt=jf?jf.prototype:void 0,Cdt=kdt?kdt.valueOf:void 0;N(tmt,"cloneSymbol");y6r=tmt;N(rmt,"cloneTypedArray");v6r=rmt,b6r="[object Boolean]",x6r="[object Date]",w6r="[object Map]",E6r="[object Number]",T6r="[object RegExp]",k6r="[object Set]",C6r="[object String]",S6r="[object Symbol]",A6r="[object ArrayBuffer]",U6r="[object DataView]",I6r="[object Float32Array]",R6r="[object Float64Array]",M6r="[object Int8Array]",L6r="[object Int16Array]",D6r="[object Int32Array]",N6r="[object Uint8Array]",_6r="[object Uint8ClampedArray]",P6r="[object Uint16Array]",O6r="[object Uint32Array]";N(nmt,"initCloneByTag");B6r=nmt;N(imt,"initCloneObject");F6r=imt,z6r="[object Map]";N(amt,"baseIsMap");G6r=amt,Sdt=Ox&&Ox.isMap,W6r=Sdt?$L(Sdt):G6r,V6r=W6r,H6r="[object Set]";N(omt,"baseIsSet");q6r=omt,Adt=Ox&&Ox.isSet,Y6r=Adt?$L(Adt):q6r,j6r=Y6r,X6r=1,$6r=2,K6r=4,smt="[object Arguments]",Z6r="[object Array]",Q6r="[object Boolean]",J6r="[object Date]",eEr="[object Error]",lmt="[object Function]",tEr="[object GeneratorFunction]",rEr="[object Map]",nEr="[object Number]",cmt="[object Object]",iEr="[object RegExp]",aEr="[object Set]",oEr="[object String]",sEr="[object Symbol]",lEr="[object WeakMap]",cEr="[object ArrayBuffer]",uEr="[object DataView]",dEr="[object Float32Array]",hEr="[object Float64Array]",fEr="[object Int8Array]",pEr="[object Int16Array]",mEr="[object Int32Array]",gEr="[object Uint8Array]",yEr="[object Uint8ClampedArray]",vEr="[object Uint16Array]",bEr="[object Uint32Array]",Ma={};Ma[smt]=Ma[Z6r]=Ma[cEr]=Ma[uEr]=Ma[Q6r]=Ma[J6r]=Ma[dEr]=Ma[hEr]=Ma[fEr]=Ma[pEr]=Ma[mEr]=Ma[rEr]=Ma[nEr]=Ma[cmt]=Ma[iEr]=Ma[aEr]=Ma[oEr]=Ma[sEr]=Ma[gEr]=Ma[yEr]=Ma[vEr]=Ma[bEr]=!0;Ma[eEr]=Ma[lmt]=Ma[lEr]=!1;N(uL,"baseClone");xEr=uL,wEr=4;N(umt,"clone");mc=umt;N(dmt,"compact");ZL=dmt,EEr="__lodash_hash_undefined__";N(hmt,"setCacheAdd");TEr=hmt;N(fmt,"setCacheHas");kEr=fmt;N(kL,"SetCache");kL.prototype.add=kL.prototype.push=TEr;kL.prototype.has=kEr;Sbe=kL;N(pmt,"arraySome");mmt=pmt;N(gmt,"cacheHas");Abe=gmt,CEr=1,SEr=2;N(ymt,"equalArrays");vmt=ymt;N(bmt,"mapToArray");AEr=bmt;N(xmt,"setToArray");Ube=xmt,UEr=1,IEr=2,REr="[object Boolean]",MEr="[object Date]",LEr="[object Error]",DEr="[object Map]",NEr="[object Number]",_Er="[object RegExp]",PEr="[object Set]",OEr="[object String]",BEr="[object Symbol]",FEr="[object ArrayBuffer]",zEr="[object DataView]",Udt=jf?jf.prototype:void 0,dge=Udt?Udt.valueOf:void 0;N(wmt,"equalByTag");GEr=wmt,WEr=1,VEr=Object.prototype,HEr=VEr.hasOwnProperty;N(Emt,"equalObjects");qEr=Emt,YEr=1,Idt="[object Arguments]",Rdt="[object Array]",Pq="[object Object]",jEr=Object.prototype,Mdt=jEr.hasOwnProperty;N(Tmt,"baseIsEqualDeep");XEr=Tmt;N(Ibe,"baseIsEqual");kmt=Ibe,$Er=1,KEr=2;N(Cmt,"baseIsMatch");ZEr=Cmt;N(Smt,"isStrictComparable");Amt=Smt;N(Umt,"getMatchData");QEr=Umt;N(Imt,"matchesStrictComparable");Rmt=Imt;N(Mmt,"baseMatches");JEr=Mmt;N(Lmt,"baseHasIn");eTr=Lmt;N(Dmt,"hasPath");Nmt=Dmt;N(_mt,"hasIn");tTr=_mt,rTr=1,nTr=2;N(Pmt,"baseMatchesProperty");iTr=Pmt;N(Omt,"baseProperty");aTr=Omt;N(Bmt,"basePropertyDeep");oTr=Bmt;N(Fmt,"property");sTr=Fmt;N(zmt,"baseIteratee");Xg=zmt;N(Gmt,"arrayAggregator");lTr=Gmt;N(Wmt,"createBaseFor");cTr=Wmt,uTr=cTr(),dTr=uTr;N(Vmt,"baseForOwn");hTr=Vmt;N(Hmt,"createBaseEach");fTr=Hmt,pTr=fTr(hTr),l6=pTr;N(qmt,"baseAggregator");mTr=qmt;N(Ymt,"createAggregator");gTr=Ymt,jmt=Object.prototype,yTr=jmt.hasOwnProperty,vTr=mbe(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Fj(t[0],t[1],i)&&(n=1);++r{t.accept(e)})}},Gu=class extends $g{static{N(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},tA=class extends $g{static{N(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Gh(this,_0(e,t=>t!==void 0))}},Vd=class extends $g{static{N(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Gh(this,_0(e,t=>t!==void 0))}},pc=class extends $g{static{N(this,"Option")}constructor(e){super(e.definition),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}},Vh=class extends $g{static{N(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}},Hh=class extends $g{static{N(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}},Zo=class extends $g{static{N(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}},Hd=class extends $g{static{N(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Gh(this,_0(e,t=>t!==void 0))}},qd=class extends $g{static{N(this,"Alternation")}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,Gh(this,_0(e,t=>t!==void 0))}},ja=class{static{N(this,"Terminal")}constructor(e){this.idx=1,Gh(this,_0(e,t=>t!==void 0))}accept(e){e.visit(this)}};N(Fgt,"serializeGrammar");N(dL,"serializeProduction");rA=class{static{N(this,"GAstVisitor")}visit(e){let t=e;switch(t.constructor){case Gu:return this.visitNonTerminal(t);case Vd:return this.visitAlternative(t);case pc:return this.visitOption(t);case Vh:return this.visitRepetitionMandatory(t);case Hh:return this.visitRepetitionMandatoryWithSeparator(t);case Hd:return this.visitRepetitionWithSeparator(t);case Zo:return this.visitRepetition(t);case qd:return this.visitAlternation(t);case ja:return this.visitTerminal(t);case tA: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){}};N(zgt,"isSequenceProd");N(SL,"isOptionalProd");N(Ggt,"isBranchingProd");N(A0,"getProductionDslName");Kj=class{static{N(this,"RestWalker")}walk(e,t=[]){bn(e.definition,(r,n)=>{let i=fc(e.definition,n+1);if(r instanceof Gu)this.walkProdRef(r,i,t);else if(r instanceof ja)this.walkTerminal(r,i,t);else if(r instanceof Vd)this.walkFlat(r,i,t);else if(r instanceof pc)this.walkOption(r,i,t);else if(r instanceof Vh)this.walkAtLeastOne(r,i,t);else if(r instanceof Hh)this.walkAtLeastOneSep(r,i,t);else if(r instanceof Hd)this.walkManySep(r,i,t);else if(r instanceof Zo)this.walkMany(r,i,t);else if(r instanceof qd)this.walkOr(r,i,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){let n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){let n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){let n=[new pc({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){let n=O1e(e,t,r);this.walk(e,n)}walkMany(e,t,r){let n=[new pc({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){let n=O1e(e,t,r);this.walk(e,n)}walkOr(e,t,r){let n=t.concat(r);bn(e.definition,i=>{let a=new Vd({definition:[i]});this.walk(a,n)})}};N(O1e,"restForRepetitionWithSeparator");N(nA,"first");N(Wgt,"firstForSequence");N(Vgt,"firstForBranching");N(Hgt,"firstForTerminal");qgt="_~IN~_",akr=class extends Kj{static{N(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){let n=jgt(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(r),a=new Vd({definition:i}),o=nA(a);this.follows[n]=o}};N(Ygt,"computeAllProdsFollows");N(jgt,"buildBetweenProdsFollowPrefix");cY={},okr=new Cft;N(QL,"getRegExpAst");N(Xgt,"clearRegExpParserCache");$gt="Complement Sets are not supported for first char optimization",QY=`Unable to use "first char" lexer optimizations: -`;N(Kgt,"getOptimizedStartCodesIndices");N(JY,"firstCharOptimizedIndices");N(KM,"addOptimizedIdxToResult");N(Zgt,"handleIgnoreCase");N(B1e,"findCode");N(ej,"isWholeOptional");skr=class extends Ij{static{N(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Hu(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?B1e(e,this.targetCharCodes)===void 0&&(this.found=!0):B1e(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};N(Zj,"canMatchCharCode");j3="PATTERN",ZM="defaultMode",Oq="modes";N(Qgt,"analyzeTokenTypes");N(Jgt,"validatePatterns");N(e1t,"validateRegExpPattern");N(t1t,"findMissingPatterns");N(r1t,"findInvalidPatterns");lkr=/[^\\][$]/;N(n1t,"findEndOfInputAnchor");N(i1t,"findEmptyMatchRegExps");ckr=/[^\\[][\^]|^\^/;N(a1t,"findStartOfInputAnchor");N(o1t,"findUnsupportedFlags");N(s1t,"findDuplicatePatterns");N(l1t,"findInvalidGroupType");N(c1t,"findModesThatDoNotExist");N(u1t,"findUnreachablePatterns");N(d1t,"tryToMatchStrToPattern");N(h1t,"noMetaChar");N(f1t,"usesLookAheadOrBehind");N(F1e,"addStickyFlag");N(p1t,"performRuntimeChecks");N(m1t,"performWarningRuntimeChecks");N(g1t,"cloneEmptyGroups");N(_be,"isCustomPattern");N(y1t,"isShortPattern");ukr={test:N(function(e){let t=e.length;for(let r=this.lastIndex;r${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,i,a){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}};(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"})(Qo||(Qo={}));JM={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:G1e,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(JM);Fu=class{static{N(this,"Lexer")}constructor(e,t=JM){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=(n,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);let{time:o,value:s}=Dbe(i),l=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,s}else return i()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=Gh({},JM,t);let r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===JM.lineTerminatorsPattern)this.config.lineTerminatorsPattern=ukr;else if(this.config.lineTerminatorCharacters===JM.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For 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),wi(e)?n={modes:{defaultMode:mc(e)},defaultMode:ZM}:(i=!1,n=mc(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(p1t(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(m1t(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},bn(n.modes,(o,s)=>{n.modes[s]=$j(o,l=>Zy(l))});let a=zh(n.modes);if(bn(n.modes,(o,s)=>{this.TRACE_INIT(`Mode: <${s}> processing`,()=>{if(this.modes.push(s),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Jgt(o,a))}),Da(this.lexerDefinitionErrors)){aA(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Qgt(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[s]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[s]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Gh({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[s]=l.canBeOptimized}})}),this.defaultMode=n.defaultMode,!Da(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let s=Br(this.lexerDefinitionErrors,l=>l.message).join(`----------------------- -`);throw new Error(`Errors detected in definition of Lexer: -`+s)}bn(this.lexerDefinitionWarning,o=>{Lbe(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i&&(this.handleModes=Gl),this.trackStartLines===!1&&(this.computeNewColumn=qL),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Gl),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let o=Wh(this.canModeBeOptimized,(s,l,u)=>(l===!1&&s.push(u),s),[]);if(t.ensureOptimizations&&!Da(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. - Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Xgt()}),this.TRACE_INIT("toFastProperties",()=>{Nbe(this)})})}tokenize(e,t=this.defaultMode){if(!Da(this.lexerDefinitionErrors)){let n=Br(this.lexerDefinitionErrors,i=>i.message).join(`----------------------- -`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,i,a,o,s,l,u,d,h,f,p,m,g,y,v=e,b=v.length,x=0,E=0,w=this.hasCustom?0:Math.floor(e.length/10),T=new Array(w),C=[],S=this.trackStartLines?1:void 0,R=this.trackStartLines?1:void 0,U=g1t(this.emptyGroups),L=this.trackStartLines,I=this.config.lineTerminatorsPattern,A=0,P=[],D=[],M=[],O=[];Object.freeze(O);let _=!1,B=N(V=>{if(M.length===1&&V.tokenType.PUSH_MODE===void 0){let $=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(V);C.push({offset:V.startOffset,line:V.startLine,column:V.startColumn,length:V.image.length,message:$})}else{M.pop();let $=Y3(M);P=this.patternIdxToConfig[$],D=this.charCodeToPatternIdxToConfig[$],A=P.length;let Z=this.canModeBeOptimized[$]&&this.config.safeMode===!1;D&&Z?_=!0:_=!1}},"pop_mode");function F(V){M.push(V),D=this.charCodeToPatternIdxToConfig[V],P=this.patternIdxToConfig[V],A=P.length,A=P.length;let $=this.canModeBeOptimized[V]&&this.config.safeMode===!1;D&&$?_=!0:_=!1}N(F,"push_mode"),F.call(this,t);let G,z=this.config.recoveryEnabled;for(;xs.length){s=a,d=a.length,l=u,G=ie;break}}}break}}if(d!==-1){if(h=G.group,h!==void 0&&(s=s!==null?s:e.substring(x,x+d),f=G.tokenTypeIdx,p=this.createTokenInstance(s,x,f,G.tokenType,S,R,d),this.handlePayload(p,l),h===!1?E=this.addToken(T,E,p):U[h].push(p)),L===!0&&G.canLineTerminator===!0){let re=0,Q,ge;I.lastIndex=0;do s=s!==null?s:e.substring(x,x+d),Q=I.test(s),Q===!0&&(ge=I.lastIndex-1,re++);while(Q===!0);re!==0?(S=S+re,R=d-ge,this.updateTokenEndLineColumnLocation(p,h,ge,re,S,R,d)):R=this.computeNewColumn(R,d)}else R=this.computeNewColumn(R,d);x=x+d,this.handleModes(G,B,F,p)}else{let re=x,Q=S,ge=R,ie=z===!1;for(;ie===!1&&x ${V3(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:i}){let a="Expecting: ",s=` -but found: '`+N0(t).image+"'";if(n)return a+n+s;{let l=Wh(e,(f,p)=>f.concat(p),[]),u=Br(l,f=>`[${Br(f,p=>V3(p)).join(", ")}]`),h=`one of these possible Token sequences: -${Br(u,(f,p)=>` ${p+1}. ${f}`).join(` -`)}`;return a+h+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){let i="Expecting: ",o=` -but found: '`+N0(t).image+"'";if(r)return i+r+o;{let l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${Br(e,u=>`[${Br(u,d=>V3(d)).join(",")}]`).join(" ,")}>`;return i+l+o}}};Object.freeze(NS);hkr={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- -inside top level rule: ->`+e.name+"<-"}},z3={buildDuplicateFoundError(e,t){function r(d){return d instanceof ja?d.terminalType.name:d instanceof Gu?d.nonTerminalName:""}N(r,"getExtraProductionArgument");let n=e.name,i=N0(t),a=i.idx,o=A0(i),s=r(i),l=a>0,u=`->${o}${l?a:""}<- ${s?`with argument: ->${s}<-`:""} - appears more than once (${t.length} times) in the top level rule: ->${n}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES - `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` -`),u},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. -The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. -To resolve this make sure each Terminal and Non-Terminal names are unique -This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=Br(e.prefixPath,i=>V3(i)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix -in inside <${e.topLevelRule.name}> Rule, -<${t}> may appears as a prefix path in all these alternatives. -See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX -For Further details.`},buildAlternationAmbiguityError(e){let t=e.alternation.idx===0?"":e.alternation.idx,r=e.prefixPath.length===0,n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, -`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. -Only the last alternative may be empty. -`;else{let i=Br(e.prefixPath,a=>V3(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. -`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n},buildEmptyRepetitionError(e){let t=A0(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. -This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. -Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: - inside <${e.topLevelRule.name}> Rule. - has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name,r=Br(e.leftRecursionPath,a=>a.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. -rule: <${t}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: - ${n} - To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof tA?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};N(I1t,"resolveGrammar");fkr=class extends rA{static{N(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){bn(cl(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:Wu.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},pkr=class extends Kj{static{N(this,"AbstractNextPossibleTokensWalker")}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=mc(this.path.ruleStack).reverse(),this.occurrenceStack=mc(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,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){Da(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},mkr=class extends pkr{static{N(this,"NextAfterTokenWalker")}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,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let n=t.concat(r),i=new Vd({definition:n});this.possibleTokTypes=nA(i),this.found=!0}}},Qj=class extends Kj{static{N(this,"AbstractNextTerminalAfterProductionWalker")}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}},gkr=class extends Qj{static{N(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){let n=N0(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ja&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},Hdt=class extends Qj{static{N(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){let n=N0(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ja&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},ykr=class extends Qj{static{N(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){let n=N0(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ja&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},qdt=class extends Qj{static{N(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){let n=N0(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ja&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};N(tj,"possiblePathsFrom");N(Wbe,"nextPossibleTokensAfter");N(R1t,"expandTopLevelRule");(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Ro||(Ro={}));N(Jj,"getProdType");N(W1e,"getLookaheadPaths");N(M1t,"buildLookaheadFuncForOr");N(L1t,"buildLookaheadFuncForOptionalProd");N(D1t,"buildAlternativesLookAheadFunc");N(N1t,"buildSingleAlternativeLookaheadFunction");vkr=class extends Kj{static{N(this,"RestDefinitionFinderWalker")}constructor(e,t,r){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=r.concat(n),!0):!1}walkOption(e,t,r){this.checkIsTarget(e,Ro.OPTION,t,r)||super.walkOption(e,t,r)}walkAtLeastOne(e,t,r){this.checkIsTarget(e,Ro.REPETITION_MANDATORY,t,r)||super.walkOption(e,t,r)}walkAtLeastOneSep(e,t,r){this.checkIsTarget(e,Ro.REPETITION_MANDATORY_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}walkMany(e,t,r){this.checkIsTarget(e,Ro.REPETITION,t,r)||super.walkOption(e,t,r)}walkManySep(e,t,r){this.checkIsTarget(e,Ro.REPETITION_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}},_1t=class extends rA{static{N(this,"InsideDefinitionFinderVisitor")}constructor(e,t,r){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=r,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Ro.OPTION)}visitRepetition(e){this.checkIsTarget(e,Ro.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Ro.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Ro.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Ro.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Ro.ALTERNATION)}};N(V1e,"initializeArrayOfArrays");N(hY,"pathToHashKeys");N(P1t,"isUniquePrefixHash");N(Vbe,"lookAheadSequenceFromAlternatives");N(eD,"getLookaheadPathsForOr");N(tD,"getLookaheadPathsForOptionalProd");N(rj,"containsPath");N(O1t,"isStrictPrefixOfPath");N(Hbe,"areTokenCategoriesNotUsed");N(B1t,"validateLookahead");N(F1t,"validateGrammar");N(z1t,"validateDuplicateProductions");N(G1t,"identifyProductionForDuplicates");N(qbe,"getExtraProductionArgument");bkr=class extends rA{static{N(this,"OccurrenceValidationCollector")}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)}};N(W1t,"validateRuleDoesNotAlreadyExist");N(V1t,"validateRuleIsOverridden");N(Ybe,"validateNoLeftRecursion");N(hL,"getFirstNoneTerminal");jbe=class extends rA{static{N(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};N(H1t,"validateEmptyOrAlternative");N(q1t,"validateAmbiguousAlternationAlternatives");xkr=class extends rA{static{N(this,"RepetitionCollector")}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)}};N(Y1t,"validateTooManyAlts");N(j1t,"validateSomeNonEmptyLookaheadPath");N(X1t,"checkAlternativesAmbiguities");N($1t,"checkPrefixAlternativesAmbiguities");N(K1t,"checkTerminalAndNoneTerminalsNameSpace");N(Z1t,"resolveGrammar");N(Q1t,"validateGrammar");J1t="MismatchedTokenException",eyt="NoViableAltException",tyt="EarlyExitException",ryt="NotAllInputParsedException",nyt=[J1t,eyt,tyt,ryt];Object.freeze(nyt);N(UL,"isRecognitionException");eX=class extends Error{static{N(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},iyt=class extends eX{static{N(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=J1t}},wkr=class extends eX{static{N(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=eyt}},Ekr=class extends eX{static{N(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=ryt}},Tkr=class extends eX{static{N(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=tyt}},hge={},ayt="InRuleRecoveryException",kkr=class extends Error{static{N(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=ayt}},Ckr=class{static{N(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=an(e,"recoveryEnabled")?e.recoveryEnabled:Jy.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=oyt)}getTokenToInsert(e){let t=JL(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,l=this.LA(1),u=this.LA(1),d=N(()=>{let h=this.LA(0),f=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:l,previous:h,ruleName:this.getCurrRuleFullName()}),p=new iyt(f,l,this.LA(0));p.resyncedTokens=CL(o),this.SAVE_ERROR(p)},"generateErrorMessage");for(;!s;)if(this.tokenMatcher(u,n)){d();return}else if(r.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,i)?s=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new kkr("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||Da(t))return!1;let r=this.LA(1);return $S(t,i=>this.tokenMatcher(r,i))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return Hu(r,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),r=2;for(;;){let n=$S(e,i=>Gbe(t,i));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return hge;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return Br(e,(r,n)=>n===0?hge:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){let e=Br(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return M0(e)}getFollowSetFromFollowKey(e){if(e===hge)return[Bx];let t=e.ruleName+e.idxInCallingRule+qgt+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Bx)||t.push(e),t}reSyncTo(e){let t=[],r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return CL(t)}attemptInRepetitionRecovery(e,t,r,n,i,a,o){}getCurrentGrammarPath(e,t){let r=this.getHumanReadableRuleStack(),n=mc(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return Br(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};N(oyt,"attemptInRepetitionRecovery");Skr=4,Hx=8,Akr=8,syt=1<Ybe(t,t,z3))}validateEmptyOrAlternatives(e){return Yf(e,t=>H1t(t,z3))}validateAmbiguousAlternationAlternatives(e,t){return Yf(e,r=>q1t(r,t,z3))}validateSomeNonEmptyLookaheadPath(e,t){return j1t(e,t,z3)}buildLookaheadForAlternation(e){return M1t(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,D1t)}buildLookaheadForOptional(e){return L1t(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Jj(e.prodType),N1t)}},Ukr=class{static{N(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=an(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Jy.dynamicTokensEnabled,this.maxLookahead=an(e,"maxLookahead")?e.maxLookahead:Jy.maxLookahead,this.lookaheadStrategy=an(e,"lookaheadStrategy")?e.lookaheadStrategy:new Xbe({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){bn(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{let{alternation:r,repetition:n,option:i,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:s}=cyt(t);bn(r,l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${A0(l)}${u}`,()=>{let d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:t,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=pY(this.fullRuleNameToShort[t.name],syt,l.idx);this.setLaFuncCache(h,d)})}),bn(n,l=>{this.computeLookaheadFunc(t,l.idx,H1e,"Repetition",l.maxLookahead,A0(l))}),bn(i,l=>{this.computeLookaheadFunc(t,l.idx,lyt,"Option",l.maxLookahead,A0(l))}),bn(a,l=>{this.computeLookaheadFunc(t,l.idx,q1e,"RepetitionMandatory",l.maxLookahead,A0(l))}),bn(o,l=>{this.computeLookaheadFunc(t,l.idx,fY,"RepetitionMandatoryWithSeparator",l.maxLookahead,A0(l))}),bn(s,l=>{this.computeLookaheadFunc(t,l.idx,Y1e,"RepetitionWithSeparator",l.maxLookahead,A0(l))})})})}computeLookaheadFunc(e,t,r,n,i,a){this.TRACE_INIT(`${a}${t===0?"":t}`,()=>{let o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),s=pY(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(s,o)})}getKeyForAutomaticLookahead(e,t){let r=this.getLastExplicitRuleShortName();return pY(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},Ikr=class extends rA{static{N(this,"DslMethodsCollectorVisitor")}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)}},Bq=new Ikr;N(cyt,"collectMethods");N(j1e,"setNodeLocationOnlyOffset");N(X1e,"setNodeLocationFull");N(uyt,"addTerminalToCst");N(dyt,"addNoneTerminalToCst");Rkr="name";N($be,"defineNameProp");N(hyt,"defaultVisit");N(fyt,"createBaseSemanticVisitorConstructor");N(pyt,"createBaseVisitorConstructorWithDefaults");(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})($1e||($1e={}));N(myt,"validateVisitor");N(gyt,"validateMissingCstMethods");Mkr=class{static{N(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=an(e,"nodeLocationTracking")?e.nodeLocationTracking:Jy.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Gl,this.cstFinallyStateUpdate=Gl,this.cstPostTerminal=Gl,this.cstPostNonTerminal=Gl,this.cstPostRule=Gl;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=X1e,this.setNodeLocationFromNode=X1e,this.cstPostRule=Gl,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Gl,this.setNodeLocationFromNode=Gl,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=j1e,this.setNodeLocationFromNode=j1e,this.cstPostRule=Gl,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Gl,this.setNodeLocationFromNode=Gl,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Gl,this.setNodeLocationFromNode=Gl,this.cstPostRule=Gl,this.setInitialNodeLocation=Gl;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){let r=this.CST_STACK[this.CST_STACK.length-1];uyt(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){let r=this.CST_STACK[this.CST_STACK.length-1];dyt(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(Zy(this.baseCstVisitorConstructor)){let e=fyt(this.className,zh(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Zy(this.baseCstVisitorWithDefaultsConstructor)){let e=pyt(this.className,zh(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},Lkr=class{static{N(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)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)):nj}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?nj: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()}},Dkr=class{static{N(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}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,r=ij){if(Hu(this.definedRulesNames,e)){let a={message:z3.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Wu.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);let n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=ij){let n=V1t(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);let i=this.defineRule(e,t,r);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(UL(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Fgt(cl(this.gastProductionsCache))}},Nkr=class{static{N(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=AL,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},an(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if(wi(e)){if(Da(e))throw Error(`A Token Vocabulary cannot be empty. - Note that the first argument for the parser constructor - is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(wi(e))this.tokensMap=Wh(e,(i,a)=>(i[a.name]=a,i),{});else if(an(e,"modes")&&L0(M0(cl(e.modes)),A1t)){let i=M0(cl(e.modes)),a=Mbe(i);this.tokensMap=Wh(a,(o,s)=>(o[s.name]=s,o),{})}else if(Xf(e))this.tokensMap=mc(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Bx;let r=an(e,"modes")?M0(cl(e.modes)):cl(e),n=L0(r,i=>Da(i.categoryMatches));this.tokenMatcher=n?AL:iA,aA(cl(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let n=an(r,"resyncEnabled")?r.resyncEnabled:ij.resyncEnabled,i=an(r,"recoveryValueFunc")?r.recoveryValueFunc:ij.recoveryValueFunc,a=this.ruleShortNameIdx<a.call(this)&&o.call(this),"lookAheadFunc")}}else i=e;if(n.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){let r=this.getKeyForAutomaticLookahead(q1e,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),i;if(typeof t!="function"){i=t.DEF;let a=t.GATE;if(a!==void 0){let o=n;n=N(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else i=t;if(n.call(this)===!0){let a=this.doSingleRepetition(i);for(;n.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Ro.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,q1e,e,ykr)}atLeastOneSepFirstInternal(e,t){let r=this.getKeyForAutomaticLookahead(fY,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){let n=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);let o=N(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,o,n,qdt],o,fY,e,qdt)}else throw this.raiseEarlyExitException(e,Ro.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let r=this.getKeyForAutomaticLookahead(H1e,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),i;if(typeof t!="function"){i=t.DEF;let o=t.GATE;if(o!==void 0){let s=n;n=N(()=>o.call(this)&&s.call(this),"lookaheadFunction")}}else i=t;let a=!0;for(;n.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,H1e,e,gkr,a)}manySepFirstInternal(e,t){let r=this.getKeyForAutomaticLookahead(Y1e,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){let n=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);let o=N(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,o,n,Hdt],o,Y1e,e,Hdt)}}repetitionSepSecondInternal(e,t,r,n,i){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,i],r,fY,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let r=this.getKeyForAutomaticLookahead(syt,t),n=wi(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,n);if(a!==void 0)return n[a].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Ekr(t,e))}}subruleInternal(e,t,r){let n;try{let i=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,i),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(i){throw this.subruleInternalError(i,r,e.ruleName)}}subruleInternalError(e,t,r){throw UL(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{let i=this.LA(1);this.tokenMatcher(i,e)===!0?(this.consumeToken(),n=i):this.consumeInternalError(e,i,r)}catch(i){n=this.consumeInternalRecovery(e,t,i)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n,i=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new iyt(n,t,i))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){let n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(i){throw i.name===ayt?r:i}}else throw r}saveRecogState(){let e=this.errors,t=mc(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,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Bx)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},_kr=class{static{N(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=an(e,"errorMessageProvider")?e.errorMessageProvider:Jy.errorMessageProvider}SAVE_ERROR(e){if(UL(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:mc(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return mc(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=tD(e,i,t,this.maxLookahead)[0],s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:s,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new Tkr(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],i=eD(e,n,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));let o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new wkr(s,this.LA(1),o))}},Pkr=class{static{N(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){let r=this.gastProductionsCache[e];if(Zy(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Wbe([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=N0(e.ruleStack),n=this.getGAstProductions()[t];return new mkr(n,e).startWalking()}},tX={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(tX);Ydt=!0,jdt=Math.pow(2,Hx)-1,yyt=FS({name:"RECORDING_PHASE_TOKEN",pattern:Fu.NA});aA([yyt]);vyt=JL(yyt,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(vyt);Okr={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Bkr=class{static{N(this,"GastRecorder")}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++){let t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},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",()=>{let e=this;for(let t=0;t<10;t++){let r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}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 nj}topLevelRuleRecord(e,t){try{let r=new tA({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` - This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return TS.call(this,pc,e,t)}atLeastOneInternalRecord(e,t){TS.call(this,Vh,t,e)}atLeastOneSepFirstInternalRecord(e,t){TS.call(this,Hh,t,e,Ydt)}manyInternalRecord(e,t){TS.call(this,Zo,t,e)}manySepFirstInternalRecord(e,t){TS.call(this,Hd,t,e,Ydt)}orInternalRecord(e,t){return byt.call(this,e,t)}subruleInternalRecord(e,t,r){if(IL(t),!e||an(e,"ruleName")===!1){let o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}let n=Y3(this.recordingProdStack),i=e.ruleName,a=new Gu({idx:t,nonTerminalName:i,label:r?.LABEL,referencedRule:void 0});return n.definition.push(a),this.outputCst?Okr:tX}consumeInternalRecord(e,t,r){if(IL(t),!Fbe(e)){let a=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let n=Y3(this.recordingProdStack),i=new ja({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(i),vyt}};N(TS,"recordProd");N(byt,"recordOrProd");N(K1e,"getIdxSuffix");N(IL,"assertMethodIdxIsValid");Fkr=class{static{N(this,"PerformanceTracer")}initPerformanceTracer(e){if(an(e,"traceInitPerf")){let t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Jy.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;let r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);let{time:n,value:i}=Dbe(t),a=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,i}else return t()}};N(xyt,"applyMixins");nj=JL(Bx,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(nj);Jy=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:NS,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ij=Object.freeze({recoveryValueFunc:N(()=>{},"recoveryValueFunc"),resyncEnabled:!0});(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"})(Wu||(Wu={}));N(Z1e,"EMPTY_ALT");Kbe=class wyt{static{N(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Nbe(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),bn(this.definedRulesNames,i=>{let o=this[i].originalGrammarAction,s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Z1t({rules:cl(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Da(n)&&this.skipValidations===!1){let i=Q1t({rules:cl(this.gastProductionsCache),tokenTypes:cl(this.tokensMap),errMsgProvider:z3,grammarName:r}),a=B1t({lookaheadStrategy:this.lookaheadStrategy,rules:cl(this.gastProductionsCache),tokenTypes:cl(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Da(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Ygt(cl(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:cl(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(cl(this.gastProductionsCache))})),!wyt.DEFER_DEFINITION_ERRORS_HANDLING&&!Da(this.definitionErrors))throw t=Br(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: - ${t.join(` -------------------------------- -`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),an(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. - Please use the flag on the relevant DSL method instead. - See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=an(r,"skipValidations")?r.skipValidations:Jy.skipValidations}};Kbe.DEFER_DEFINITION_ERRORS_HANDLING=!1;xyt(Kbe,[Ckr,Ukr,Mkr,Lkr,Nkr,Dkr,_kr,Pkr,Bkr,Fkr]);zkr=class extends Kbe{static{N(this,"EmbeddedActionsParser")}constructor(e,t=Jy){let r=mc(t);r.outputCst=!1,super(e,r)}};N(Eyt,"arrayMap");Tyt=Eyt;N(kyt,"listCacheClear");Gkr=kyt;N(Cyt,"eq");Syt=Cyt;N(Ayt,"assocIndexOf");rX=Ayt,Wkr=Array.prototype,Vkr=Wkr.splice;N(Uyt,"listCacheDelete");Hkr=Uyt;N(Iyt,"listCacheGet");qkr=Iyt;N(Ryt,"listCacheHas");Ykr=Ryt;N(Myt,"listCacheSet");jkr=Myt;N(c6,"ListCache");c6.prototype.clear=Gkr;c6.prototype.delete=Hkr;c6.prototype.get=qkr;c6.prototype.has=Ykr;c6.prototype.set=jkr;nX=c6;N(Lyt,"stackClear");Xkr=Lyt;N(Dyt,"stackDelete");$kr=Dyt;N(Nyt,"stackGet");Kkr=Nyt;N(_yt,"stackHas");Zkr=_yt,Qkr=typeof global=="object"&&global&&global.Object===Object&&global,Pyt=Qkr,Jkr=typeof self=="object"&&self&&self.Object===Object&&self,eCr=Pyt||Jkr||Function("return this")(),iv=eCr,tCr=iv.Symbol,qg=tCr,Oyt=Object.prototype,rCr=Oyt.hasOwnProperty,nCr=Oyt.toString,_M=qg?qg.toStringTag:void 0;N(Byt,"getRawTag");iCr=Byt,aCr=Object.prototype,oCr=aCr.toString;N(Fyt,"objectToString");sCr=Fyt,lCr="[object Null]",cCr="[object Undefined]",Xdt=qg?qg.toStringTag:void 0;N(zyt,"baseGetTag");oA=zyt;N(Gyt,"isObject");Zbe=Gyt,uCr="[object AsyncFunction]",dCr="[object Function]",hCr="[object GeneratorFunction]",fCr="[object Proxy]";N(Wyt,"isFunction");Vyt=Wyt,pCr=iv["__core-js_shared__"],fge=pCr,$dt=(function(){var e=/[^.]+$/.exec(fge&&fge.keys&&fge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();N(Hyt,"isMasked");mCr=Hyt,gCr=Function.prototype,yCr=gCr.toString;N(qyt,"toSource");u6=qyt,vCr=/[\\^$.*+?()[\]{}|]/g,bCr=/^\[object .+?Constructor\]$/,xCr=Function.prototype,wCr=Object.prototype,ECr=xCr.toString,TCr=wCr.hasOwnProperty,kCr=RegExp("^"+ECr.call(TCr).replace(vCr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");N(Yyt,"baseIsNative");CCr=Yyt;N(jyt,"getValue");SCr=jyt;N(Xyt,"getNative");sA=Xyt,ACr=sA(iv,"Map"),RL=ACr,UCr=sA(Object,"create"),ML=UCr;N($yt,"hashClear");ICr=$yt;N(Kyt,"hashDelete");RCr=Kyt,MCr="__lodash_hash_undefined__",LCr=Object.prototype,DCr=LCr.hasOwnProperty;N(Zyt,"hashGet");NCr=Zyt,_Cr=Object.prototype,PCr=_Cr.hasOwnProperty;N(Qyt,"hashHas");OCr=Qyt,BCr="__lodash_hash_undefined__";N(Jyt,"hashSet");FCr=Jyt;N(d6,"Hash");d6.prototype.clear=ICr;d6.prototype.delete=RCr;d6.prototype.get=NCr;d6.prototype.has=OCr;d6.prototype.set=FCr;Kdt=d6;N(evt,"mapCacheClear");zCr=evt;N(tvt,"isKeyable");GCr=tvt;N(rvt,"getMapData");iX=rvt;N(nvt,"mapCacheDelete");WCr=nvt;N(ivt,"mapCacheGet");VCr=ivt;N(avt,"mapCacheHas");HCr=avt;N(ovt,"mapCacheSet");qCr=ovt;N(h6,"MapCache");h6.prototype.clear=zCr;h6.prototype.delete=WCr;h6.prototype.get=VCr;h6.prototype.has=HCr;h6.prototype.set=qCr;aX=h6,YCr=200;N(svt,"stackSet");jCr=svt;N(f6,"Stack");f6.prototype.clear=Xkr;f6.prototype.delete=$kr;f6.prototype.get=Kkr;f6.prototype.has=Zkr;f6.prototype.set=jCr;mY=f6,XCr="__lodash_hash_undefined__";N(lvt,"setCacheAdd");$Cr=lvt;N(cvt,"setCacheHas");KCr=cvt;N(LL,"SetCache");LL.prototype.add=LL.prototype.push=$Cr;LL.prototype.has=KCr;uvt=LL;N(dvt,"arraySome");ZCr=dvt;N(hvt,"cacheHas");fvt=hvt,QCr=1,JCr=2;N(pvt,"equalArrays");mvt=pvt,eSr=iv.Uint8Array,Zdt=eSr;N(gvt,"mapToArray");tSr=gvt;N(yvt,"setToArray");Qbe=yvt,rSr=1,nSr=2,iSr="[object Boolean]",aSr="[object Date]",oSr="[object Error]",sSr="[object Map]",lSr="[object Number]",cSr="[object RegExp]",uSr="[object Set]",dSr="[object String]",hSr="[object Symbol]",fSr="[object ArrayBuffer]",pSr="[object DataView]",Qdt=qg?qg.prototype:void 0,pge=Qdt?Qdt.valueOf:void 0;N(vvt,"equalByTag");mSr=vvt;N(bvt,"arrayPush");xvt=bvt,gSr=Array.isArray,Vu=gSr;N(wvt,"baseGetAllKeys");ySr=wvt;N(Evt,"arrayFilter");Tvt=Evt;N(kvt,"stubArray");vSr=kvt,bSr=Object.prototype,xSr=bSr.propertyIsEnumerable,Jdt=Object.getOwnPropertySymbols,wSr=Jdt?function(e){return e==null?[]:(e=Object(e),Tvt(Jdt(e),function(t){return xSr.call(e,t)}))}:vSr,ESr=wSr;N(Cvt,"baseTimes");TSr=Cvt;N(Svt,"isObjectLike");KS=Svt,kSr="[object Arguments]";N(Avt,"baseIsArguments");eht=Avt,Uvt=Object.prototype,CSr=Uvt.hasOwnProperty,SSr=Uvt.propertyIsEnumerable,ASr=eht((function(){return arguments})())?eht:function(e){return KS(e)&&CSr.call(e,"callee")&&!SSr.call(e,"callee")},oX=ASr;N(Ivt,"stubFalse");USr=Ivt,Rvt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,tht=Rvt&&typeof module=="object"&&module&&!module.nodeType&&module,ISr=tht&&tht.exports===Rvt,rht=ISr?iv.Buffer:void 0,RSr=rht?rht.isBuffer:void 0,MSr=RSr||USr,aj=MSr,LSr=9007199254740991,DSr=/^(?:0|[1-9]\d*)$/;N(Mvt,"isIndex");Lvt=Mvt,NSr=9007199254740991;N(Dvt,"isLength");Jbe=Dvt,_Sr="[object Arguments]",PSr="[object Array]",OSr="[object Boolean]",BSr="[object Date]",FSr="[object Error]",zSr="[object Function]",GSr="[object Map]",WSr="[object Number]",VSr="[object Object]",HSr="[object RegExp]",qSr="[object Set]",YSr="[object String]",jSr="[object WeakMap]",XSr="[object ArrayBuffer]",$Sr="[object DataView]",KSr="[object Float32Array]",ZSr="[object Float64Array]",QSr="[object Int8Array]",JSr="[object Int16Array]",eAr="[object Int32Array]",tAr="[object Uint8Array]",rAr="[object Uint8ClampedArray]",nAr="[object Uint16Array]",iAr="[object Uint32Array]",Ya={};Ya[KSr]=Ya[ZSr]=Ya[QSr]=Ya[JSr]=Ya[eAr]=Ya[tAr]=Ya[rAr]=Ya[nAr]=Ya[iAr]=!0;Ya[_Sr]=Ya[PSr]=Ya[XSr]=Ya[OSr]=Ya[$Sr]=Ya[BSr]=Ya[FSr]=Ya[zSr]=Ya[GSr]=Ya[WSr]=Ya[VSr]=Ya[HSr]=Ya[qSr]=Ya[YSr]=Ya[jSr]=!1;N(Nvt,"baseIsTypedArray");aAr=Nvt;N(_vt,"baseUnary");oAr=_vt,Pvt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fL=Pvt&&typeof module=="object"&&module&&!module.nodeType&&module,sAr=fL&&fL.exports===Pvt,mge=sAr&&Pyt.process,lAr=(function(){try{var e=fL&&fL.require&&fL.require("util").types;return e||mge&&mge.binding&&mge.binding("util")}catch{}})(),nht=lAr,iht=nht&&nht.isTypedArray,cAr=iht?oAr(iht):aAr,e2e=cAr,uAr=Object.prototype,dAr=uAr.hasOwnProperty;N(Ovt,"arrayLikeKeys");hAr=Ovt,fAr=Object.prototype;N(Bvt,"isPrototype");Fvt=Bvt;N(zvt,"overArg");pAr=zvt,mAr=pAr(Object.keys,Object),gAr=mAr,yAr=Object.prototype,vAr=yAr.hasOwnProperty;N(Gvt,"baseKeys");Wvt=Gvt;N(Vvt,"isArrayLike");sX=Vvt;N(Hvt,"keys");t2e=Hvt;N(qvt,"getAllKeys");aht=qvt,bAr=1,xAr=Object.prototype,wAr=xAr.hasOwnProperty;N(Yvt,"equalObjects");EAr=Yvt,TAr=sA(iv,"DataView"),Q1e=TAr,kAr=sA(iv,"Promise"),J1e=kAr,CAr=sA(iv,"Set"),zS=CAr,SAr=sA(iv,"WeakMap"),eye=SAr,oht="[object Map]",AAr="[object Object]",sht="[object Promise]",lht="[object Set]",cht="[object WeakMap]",uht="[object DataView]",UAr=u6(Q1e),IAr=u6(RL),RAr=u6(J1e),MAr=u6(zS),LAr=u6(eye),h3=oA;(Q1e&&h3(new Q1e(new ArrayBuffer(1)))!=uht||RL&&h3(new RL)!=oht||J1e&&h3(J1e.resolve())!=sht||zS&&h3(new zS)!=lht||eye&&h3(new eye)!=cht)&&(h3=N(function(e){var t=oA(e),r=t==AAr?e.constructor:void 0,n=r?u6(r):"";if(n)switch(n){case UAr:return uht;case IAr:return oht;case RAr:return sht;case MAr:return lht;case LAr:return cht}return t},"getTag"));tye=h3,DAr=1,dht="[object Arguments]",hht="[object Array]",Fq="[object Object]",NAr=Object.prototype,fht=NAr.hasOwnProperty;N(jvt,"baseIsEqualDeep");_Ar=jvt;N(r2e,"baseIsEqual");Xvt=r2e,PAr=1,OAr=2;N($vt,"baseIsMatch");BAr=$vt;N(Kvt,"isStrictComparable");Zvt=Kvt;N(Qvt,"getMatchData");FAr=Qvt;N(Jvt,"matchesStrictComparable");ebt=Jvt;N(tbt,"baseMatches");zAr=tbt,GAr="[object Symbol]";N(rbt,"isSymbol");lX=rbt,WAr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VAr=/^\w*$/;N(nbt,"isKey");n2e=nbt,HAr="Expected a function";N(cX,"memoize");cX.Cache=aX;qAr=cX,YAr=500;N(ibt,"memoizeCapped");jAr=ibt,XAr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$Ar=/\\(\\)?/g,KAr=jAr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(XAr,function(r,n,i,a){t.push(i?a.replace($Ar,"$1"):n||r)}),t}),ZAr=KAr,QAr=1/0,pht=qg?qg.prototype:void 0,mht=pht?pht.toString:void 0;N(i2e,"baseToString");JAr=i2e;N(abt,"toString");e7r=abt;N(obt,"castPath");sbt=obt,t7r=1/0;N(lbt,"toKey");uX=lbt;N(cbt,"baseGet");ubt=cbt;N(dbt,"get");r7r=dbt;N(hbt,"baseHasIn");n7r=hbt;N(fbt,"hasPath");i7r=fbt;N(pbt,"hasIn");a7r=pbt,o7r=1,s7r=2;N(mbt,"baseMatchesProperty");l7r=mbt;N(gbt,"identity");a2e=gbt;N(ybt,"baseProperty");c7r=ybt;N(vbt,"basePropertyDeep");u7r=vbt;N(bbt,"property");d7r=bbt;N(xbt,"baseIteratee");dX=xbt;N(wbt,"createBaseFor");h7r=wbt,f7r=h7r(),p7r=f7r;N(Ebt,"baseForOwn");m7r=Ebt;N(Tbt,"createBaseEach");g7r=Tbt,y7r=g7r(m7r),hX=y7r;N(kbt,"baseMap");v7r=kbt;N(Cbt,"map");qy=Cbt;N(Sbt,"baseFilter");b7r=Sbt;N(Abt,"filter");x7r=Abt;N(X3,"buildATNKey");Fx=1,w7r=2,Ubt=4,Ibt=5,rD=7,E7r=8,T7r=9,k7r=10,C7r=11,Rbt=12,o2e=class{static{N(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return!1}},s2e=class extends o2e{static{N(this,"AtomTransition")}constructor(e,t){super(e),this.tokenType=t}},Mbt=class extends o2e{static{N(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return!0}},l2e=class extends o2e{static{N(this,"RuleTransition")}constructor(e,t,r){super(e),this.rule=t,this.followState=r}isEpsilon(){return!0}};N(Lbt,"createATN");N(Dbt,"createRuleStartAndStopATNStates");N(c2e,"atom");N(Nbt,"repetition");N(_bt,"repetitionSep");N(Pbt,"repetitionMandatory");N(Obt,"repetitionMandatorySep");N(Bbt,"alternation");N(Fbt,"option");N(qx,"block");N(u2e,"plus");N(d2e,"star");N(zbt,"optional");N(av,"defineDecisionState");N(p6,"makeAlts");N(Gbt,"getProdType");N(Wbt,"makeBlock");N(fX,"tokenRef");N(Vbt,"ruleRef");N(Hbt,"buildRuleHandle");N(ps,"epsilon");N(ul,"newState");N(pX,"addTransition");N(qbt,"removeState");oj={},rye=class{static{N(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=h2e(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return qy(this.configs,e=>e.alt)}get key(){let e="";for(let t in this.map)e+=t+":";return e}};N(h2e,"getATNConfigKey");N(Ybt,"baseExtremum");S7r=Ybt;N(jbt,"baseLt");A7r=jbt;N(Xbt,"min");U7r=Xbt,ght=qg?qg.isConcatSpreadable:void 0;N($bt,"isFlattenable");I7r=$bt;N(f2e,"baseFlatten");Kbt=f2e;N(Zbt,"flatMap");R7r=Zbt;N(Qbt,"baseFindIndex");M7r=Qbt;N(Jbt,"baseIsNaN");L7r=Jbt;N(e2t,"strictIndexOf");D7r=e2t;N(t2t,"baseIndexOf");N7r=t2t;N(r2t,"arrayIncludes");_7r=r2t;N(n2t,"arrayIncludesWith");P7r=n2t;N(i2t,"noop");O7r=i2t,B7r=1/0,F7r=zS&&1/Qbe(new zS([,-0]))[1]==B7r?function(e){return new zS(e)}:O7r,z7r=F7r,G7r=200;N(a2t,"baseUniq");W7r=a2t;N(o2t,"uniqBy");V7r=o2t;N(s2t,"flatten");H7r=s2t;N(l2t,"arrayEach");q7r=l2t;N(c2t,"castFunction");Y7r=c2t;N(u2t,"forEach");gge=u2t,j7r="[object Map]",X7r="[object Set]",$7r=Object.prototype,K7r=$7r.hasOwnProperty;N(d2t,"isEmpty");Z7r=d2t;N(h2t,"arrayReduce");Q7r=h2t;N(f2t,"baseReduce");J7r=f2t;N(p2t,"reduce");yht=p2t;N(m2t,"createDFACache");g2t=class{static{N(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="",t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=Lbt(e.rules),this.dfas=y2t(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:i}=e,a=this.dfas,o=this.logging,s=X3(r,"Alternation",t),u=this.atn.decisionMap[s].decision,d=qy(W1e({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),h=>qy(h,f=>f[0]));if(nye(d,!1)&&!i){let h=yht(d,(f,p,m)=>(gge(p,g=>{g&&(f[g.tokenTypeIdx]=m,gge(g.categoryMatches,y=>{f[y]=m}))}),f),{});return n?function(f){var p;let m=this.LA(1),g=h[m.tokenTypeIdx];if(f!==void 0&&g!==void 0){let y=(p=f[g])===null||p===void 0?void 0:p.GATE;if(y!==void 0&&y.call(this)===!1)return}return g}:function(){let f=this.LA(1);return h[f.tokenTypeIdx]}}else return n?function(h){let f=new g2t,p=h===void 0?0:h.length;for(let g=0;gqy(h,f=>f[0]));if(nye(d)&&d[0][0]&&!i){let h=d[0],f=H7r(h);if(f.length===1&&Z7r(f[0].categoryMatches)){let m=f[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{let p=yht(f,(m,g)=>(g!==void 0&&(m[g.tokenTypeIdx]=!0,gge(g.categoryMatches,y=>{m[y]=!0})),m),{});return function(){let m=this.LA(1);return p[m.tokenTypeIdx]===!0}}}return function(){let h=gY.call(this,a,u,vht,o);return typeof h=="object"?!1:h===0}}};N(nye,"isLL1Sequence");N(y2t,"initATNSimulator");N(gY,"adaptivePredict");N(v2t,"performLookahead");N(b2t,"computeLookaheadTarget");N(x2t,"reportLookaheadAmbiguity");N(w2t,"buildAmbiguityError");N(E2t,"getProductionDslName");N(T2t,"buildAdaptivePredictError");N(k2t,"getExistingTargetState");N(C2t,"computeReachSet");N(S2t,"getReachableTarget");N(A2t,"getUniqueAlt");N(p2e,"newDFAState");N(iye,"addDFAEdge");N(m2e,"addDFAState");N(U2t,"computeStartState");N(DL,"closure");N(I2t,"getEpsilonTarget");N(R2t,"hasConfigInRuleStopState");N(M2t,"allConfigsInRuleStopStates");N(L2t,"hasConflictTerminatingPrediction");N(D2t,"getConflictingAltSets");N(N2t,"hasConflictingAltSet");N(_2t,"hasStateAssociatedWithOneAlt");PL();P2t=class{static{N(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new y2e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let t=new mX;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){let r=new sj(e.startOffset,e.image.length,xL(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){let t=e.container;if(t){let r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){let t=[];for(let i of e){let a=new sj(i.startOffset,i.image.length,xL(i),i.tokenType,!0);a.root=this.rootNode,t.push(a)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){let i=r.container.content.indexOf(r);if(i>0){r.container.content.splice(i,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){let t=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=t;let r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},g2e=class{static{N(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},sj=class extends g2e{static{N(this,"LeafCstNodeImpl")}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,r,n,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},mX=class extends g2e{static{N(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new t8r(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){let{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){let t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},t8r=class O2t extends Array{static{N(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,O2t.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(let r of t)r.container=this.parent}},y2e=class extends mX{static{N(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},lj=Symbol("Datatype");N(yY,"isDataTypeNode");bht="\u200B",B2t=N(e=>e.endsWith(bht)?e:e+bht,"withRuleSuffix"),v2e=class{static{N(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new n8r(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new W2t(t,{...e.parser.ParserConfig,skipValidations:r,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()}},F2t=class extends v2e{static{N(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new P2t,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){let r=this.computeRuleType(e),n;qS(e)&&(n=e.name,this.registerPrecedenceMap(e));let i=this.wrapper.DEFINE_RULE(B2t(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,i),zu(e)&&e.entry&&(this.mainRule=i),i}registerPrecedenceMap(e){let t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{let i=!this.isRecording()&&e!==void 0;if(i){let a={$type:e};this.stack.push(a),e===lj?a.value="":t!==void 0&&(a.$infixName=t)}return r(n),i?this.construct():void 0}}extractHiddenTokens(e){let t=this.lexerResult.hidden;if(!t.length)return[];let r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){let n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){let i=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(i);let a=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:s}=this.getAssignment(r),l=this.current;if(o){let u=Xy(r)?n.image:this.converter.convert(n.image,a);this.assign(o.operator,o.feature,u,a,s)}else if(yY(l)){let u=n.image;Xy(r)||(u=this.converter.convert(u,a).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,i){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,i)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,n,a))}}performSubruleAssignment(e,t,r){let{assignment:n,crossRef:i}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,i);else if(!n){let a=this.current;if(yY(a))a.value+=e.toString();else if(typeof e=="object"&&e){let s=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(s)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);let i={$type:e};this.stack.push(i),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):yY(e)?this.converter.convert(e.value,e.$cstNode):(gve(this.astReflection,e),e)}constructInfix(e,t){let r=e.parts;if(!Array.isArray(r)||r.length===0)return;let n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let i=0,a=-1;for(let m=0;ma?(a=y.precedence,i=m):y.precedence===a&&(y.rightAssoc||(i=m))}let o=n.slice(0,i),s=n.slice(i+1),l=r.slice(0,i+1),u=r.slice(i+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},h={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:s},f=this.constructInfix(d,t),p=this.constructInfix(h,t);return{$type:e.$type,$cstNode:e.$cstNode,left:f,operator:n[i],right:p}}getAssignment(e){if(!this.assignmentMap.has(e)){let t=Z3(e,jy);this.assignmentMap.set(e,{assignment:t,crossRef:t&&J3(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,i){let a=this.current,o;switch(i==="single"&&typeof r=="string"?o=this.linker.buildReference(a,t,n,r):i==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(a,t,n,r):o=r,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(let[n,i]of Object.entries(t)){let a=e[n];a===void 0?e[n]=i:Array.isArray(a)&&Array.isArray(i)&&(i.push(...a),e[n]=i)}let r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},z2t=class{static{N(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return NS.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return NS.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return NS.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return NS.buildEarlyExitMessage(e)}},b2e=class extends z2t{static{N(this,"LangiumParserErrorMessageProvider")}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}\`.`}},G2t=class extends v2e{static{N(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let 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){let r=this.wrapper.DEFINE_RULE(B2t(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{let r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,i){this.before(n),this.wrapper.wrapSubrule(e,t,i),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},r8r={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new b2e},W2t=class extends zkr{static{N(this,"ChevrotainWrapper")}constructor(e,t){let r=t&&"maxLookahead"in t;super(e,{...r8r,lookaheadStrategy:r?new Xbe({maxLookahead:t.maxLookahead}):new e8r({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}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)}rule(e){return e.call(this,{})}},n8r=class extends W2t{static{N(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};N(gX,"createParser");N(V2t,"buildRules");N(H2t,"buildInfixRule");N(zx,"buildElement");N(q2t,"buildAction");N(Y2t,"buildRuleCall");N(j2t,"buildRuleCallPredicate");N(U0,"buildPredicate");N(X2t,"buildAlternatives");N($2t,"buildUnorderedGroup");N(K2t,"buildGroup");N(NL,"getGuardCondition");N(x2e,"buildCrossReference");N(Z2t,"buildKeyword");N(w2e,"wrap");N(yX,"getRule");N(Q2t,"getRuleName");N(cj,"getToken");N(E2e,"createCompletionParser");N(T2e,"createLangiumParser");N(k2e,"prepareLangiumParser");vX=class{static{N(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){let r=na(Mj(e,!1)),n=this.buildTerminalTokens(r),i=this.buildKeywordTokens(r,n,t);return i.push(...n),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter($f).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){let t=WL(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=Rj(t)?Fu.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){let t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Q3).flatMap(n=>rv(n).filter(Xy)).distinct(n=>n.value).toArray().sort((n,i)=>i.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){let n=this.buildKeywordPattern(e,r),i={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,t){return t?new RegExp(eA(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{let i=n?.PATTERN;return i?.source&&$ve("^"+i.source+"$",e.value)&&r.push(n),r},[])}},C2e=class{static{N(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(J3(r)&&(r=ebe(r)),$y(r)){let n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Fg.convertInt(t);case"STRING":return Fg.convertString(t);case"ID":return Fg.convertID(t)}switch(cbe(e)?.toLowerCase()){case"number":return Fg.convertNumber(t);case"boolean":return Fg.convertBoolean(t);case"bigint":return Fg.convertBigint(t);case"date":return Fg.convertDate(t);default:return t}}};(function(e){function t(u){let d="";for(let h=1;h{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},xht=class aye{static{N(this,"FullTextDocument")}constructor(t,r,n,i){this._uri=t,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(let n of t)if(aye.isIncremental(n)){let i=U2e(n.range),a=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(o,this._content.length);let s=Math.max(i.start.line,0),l=Math.max(i.end.line,0),u=this._lineOffsets,d=oye(n.text,!1,a);if(l-s===d.length)for(let f=0,p=d.length;ft?i=o:n=o+1}let a=n-1;return t=this.ensureBeforeEOL(t,r[a]),{line:a,character:t-r[a]}}offsetAt(t){let r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;let n=r[t.line];if(t.character<=0)return n;let i=t.line+1r&&A2e(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){let r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(e){function t(i,a,o,s){return new xht(i,a,o,s)}N(t,"create"),e.create=t;function r(i,a,o){if(i instanceof xht)return i.update(a,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}N(r,"update"),e.update=r;function n(i,a){let o=i.getText(),s=dj(a.map(ext),(d,h)=>{let f=d.range.start.line-h.range.start.line;return f===0?d.range.start.character-h.range.start.character:f}),l=0,u=[];for(let d of s){let h=i.offsetAt(d.range.start);if(hl&&u.push(o.substring(l,h)),d.newText.length&&u.push(d.newText),l=i.offsetAt(d.range.end)}return u.push(o.substr(l)),u.join("")}N(n,"applyEdits"),e.applyEdits=n})(uj||(uj={}));N(dj,"mergeSort");N(oye,"computeLineOffsets");N(A2e,"isEOL");N(U2e,"getWellformedRange");N(ext,"getWellformedEdit");(()=>{"use strict";var e={975:L=>{function I(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}N(I,"e");function A(D,M){for(var O,_="",B=0,F=-1,G=0,z=0;z<=D.length;++z){if(z2){var V=_.lastIndexOf("/");if(V!==_.length-1){V===-1?(_="",B=0):B=(_=_.slice(0,V)).length-1-_.lastIndexOf("/"),F=z,G=0;continue}}else if(_.length===2||_.length===1){_="",B=0,F=z,G=0;continue}}M&&(_.length>0?_+="/..":_="..",B=2)}else _.length>0?_+="/"+D.slice(F+1,z):_=D.slice(F+1,z),B=z-F-1;F=z,G=0}else O===46&&G!==-1?++G:G=-1}return _}N(A,"r");var P={resolve:N(function(){for(var D,M="",O=!1,_=arguments.length-1;_>=-1&&!O;_--){var B;_>=0?B=arguments[_]:(D===void 0&&(D=process.cwd()),B=D),I(B),B.length!==0&&(M=B+"/"+M,O=B.charCodeAt(0)===47)}return M=A(M,!O),O?M.length>0?"/"+M:"/":M.length>0?M:"."},"resolve"),normalize:N(function(D){if(I(D),D.length===0)return".";var M=D.charCodeAt(0)===47,O=D.charCodeAt(D.length-1)===47;return(D=A(D,!M)).length!==0||M||(D="."),D.length>0&&O&&(D+="/"),M?"/"+D:D},"normalize"),isAbsolute:N(function(D){return I(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:N(function(){if(arguments.length===0)return".";for(var D,M=0;M0&&(D===void 0?D=O:D+="/"+O)}return D===void 0?".":P.normalize(D)},"join"),relative:N(function(D,M){if(I(D),I(M),D===M||(D=P.resolve(D))===(M=P.resolve(M)))return"";for(var O=1;Oz){if(M.charCodeAt(F+$)===47)return M.slice(F+$+1);if($===0)return M.slice(F+$)}else B>z&&(D.charCodeAt(O+$)===47?V=$:$===0&&(V=0));break}var Z=D.charCodeAt(O+$);if(Z!==M.charCodeAt(F+$))break;Z===47&&(V=$)}var re="";for($=O+V+1;$<=_;++$)$!==_&&D.charCodeAt($)!==47||(re.length===0?re+="..":re+="/..");return re.length>0?re+M.slice(F+V):(F+=V,M.charCodeAt(F)===47&&++F,M.slice(F))},"relative"),_makeLong:N(function(D){return D},"_makeLong"),dirname:N(function(D){if(I(D),D.length===0)return".";for(var M=D.charCodeAt(0),O=M===47,_=-1,B=!0,F=D.length-1;F>=1;--F)if((M=D.charCodeAt(F))===47){if(!B){_=F;break}}else B=!1;return _===-1?O?"/":".":O&&_===1?"//":D.slice(0,_)},"dirname"),basename:N(function(D,M){if(M!==void 0&&typeof M!="string")throw new TypeError('"ext" argument must be a string');I(D);var O,_=0,B=-1,F=!0;if(M!==void 0&&M.length>0&&M.length<=D.length){if(M.length===D.length&&M===D)return"";var G=M.length-1,z=-1;for(O=D.length-1;O>=0;--O){var V=D.charCodeAt(O);if(V===47){if(!F){_=O+1;break}}else z===-1&&(F=!1,z=O+1),G>=0&&(V===M.charCodeAt(G)?--G==-1&&(B=O):(G=-1,B=z))}return _===B?B=z:B===-1&&(B=D.length),D.slice(_,B)}for(O=D.length-1;O>=0;--O)if(D.charCodeAt(O)===47){if(!F){_=O+1;break}}else B===-1&&(F=!1,B=O+1);return B===-1?"":D.slice(_,B)},"basename"),extname:N(function(D){I(D);for(var M=-1,O=0,_=-1,B=!0,F=0,G=D.length-1;G>=0;--G){var z=D.charCodeAt(G);if(z!==47)_===-1&&(B=!1,_=G+1),z===46?M===-1?M=G:F!==1&&(F=1):M!==-1&&(F=-1);else if(!B){O=G+1;break}}return M===-1||_===-1||F===0||F===1&&M===_-1&&M===O+1?"":D.slice(M,_)},"extname"),format:N(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function(M,O){var _=O.dir||O.root,B=O.base||(O.name||"")+(O.ext||"");return _?_===O.root?_+B:_+"/"+B:B})(0,D)},"format"),parse:N(function(D){I(D);var M={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return M;var O,_=D.charCodeAt(0),B=_===47;B?(M.root="/",O=1):O=0;for(var F=-1,G=0,z=-1,V=!0,$=D.length-1,Z=0;$>=O;--$)if((_=D.charCodeAt($))!==47)z===-1&&(V=!1,z=$+1),_===46?F===-1?F=$:Z!==1&&(Z=1):F!==-1&&(Z=-1);else if(!V){G=$+1;break}return F===-1||z===-1||Z===0||Z===1&&F===z-1&&F===G+1?z!==-1&&(M.base=M.name=G===0&&B?D.slice(1,z):D.slice(G,z)):(G===0&&B?(M.name=D.slice(1,F),M.base=D.slice(1,z)):(M.name=D.slice(G,F),M.base=D.slice(G,z)),M.ext=D.slice(F,z)),G>0?M.dir=D.slice(0,G-1):B&&(M.dir="/"),M},"parse"),sep:"/",delimiter:":",win32:null,posix:null};P.posix=P,L.exports=P}},t={};function r(L){var I=t[L];if(I!==void 0)return I.exports;var A=t[L]={exports:{}};return e[L](A,A.exports,r),A.exports}N(r,"r"),r.d=(L,I)=>{for(var A in I)r.o(I,A)&&!r.o(L,A)&&Object.defineProperty(L,A,{enumerable:!0,get:I[A]})},r.o=(L,I)=>Object.prototype.hasOwnProperty.call(L,I),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:N(()=>f,"URI"),Utils:N(()=>U,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let a=/^\w[\w\d+.-]*$/,o=/^\//,s=/^\/\//;function l(L,I){if(!L.scheme&&I)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!a.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!o.test(L.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(s.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}N(l,"a");let u="",d="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static{N(this,"l")}static isUri(I){return I instanceof f||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"}scheme;authority;path;query;fragment;constructor(I,A,P,D,M,O=!1){typeof I=="object"?(this.scheme=I.scheme||u,this.authority=I.authority||u,this.path=I.path||u,this.query=I.query||u,this.fragment=I.fragment||u):(this.scheme=(function(_,B){return _||B?_:"file"})(I,O),this.authority=A||u,this.path=(function(_,B){switch(_){case"https":case"http":case"file":B?B[0]!==d&&(B=d+B):B=d}return B})(this.scheme,P||u),this.query=D||u,this.fragment=M||u,l(this,O))}get fsPath(){return b(this,!1)}with(I){if(!I)return this;let{scheme:A,authority:P,path:D,query:M,fragment:O}=I;return A===void 0?A=this.scheme:A===null&&(A=u),P===void 0?P=this.authority:P===null&&(P=u),D===void 0?D=this.path:D===null&&(D=u),M===void 0?M=this.query:M===null&&(M=u),O===void 0?O=this.fragment:O===null&&(O=u),A===this.scheme&&P===this.authority&&D===this.path&&M===this.query&&O===this.fragment?this:new m(A,P,D,M,O)}static parse(I,A=!1){let P=h.exec(I);return P?new m(P[2]||u,T(P[4]||u),T(P[5]||u),T(P[7]||u),T(P[9]||u),A):new m(u,u,u,u,u)}static file(I){let A=u;if(i&&(I=I.replace(/\\/g,d)),I[0]===d&&I[1]===d){let P=I.indexOf(d,2);P===-1?(A=I.substring(2),I=d):(A=I.substring(2,P),I=I.substring(P)||d)}return new m("file",A,I,u,u)}static from(I){let A=new m(I.scheme,I.authority,I.path,I.query,I.fragment);return l(A,!0),A}toString(I=!1){return x(this,I)}toJSON(){return this}static revive(I){if(I){if(I instanceof f)return I;{let A=new m(I);return A._formatted=I.external,A._fsPath=I._sep===p?I.fsPath:null,A}}return I}}let p=i?1:void 0;class m extends f{static{N(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(I=!1){return I?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)}toJSON(){let I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}}let g={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 y(L,I,A){let P,D=-1;for(let M=0;M=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||I&&O===47||A&&O===91||A&&O===93||A&&O===58)D!==-1&&(P+=encodeURIComponent(L.substring(D,M)),D=-1),P!==void 0&&(P+=L.charAt(M));else{P===void 0&&(P=L.substr(0,M));let _=g[O];_!==void 0?(D!==-1&&(P+=encodeURIComponent(L.substring(D,M)),D=-1),P+=_):D===-1&&(D=M)}}return D!==-1&&(P+=encodeURIComponent(L.substring(D))),P!==void 0?P:L}N(y,"m");function v(L){let I;for(let A=0;A1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?I?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,i&&(A=A.replace(/\//g,"\\")),A}N(b,"v");function x(L,I){let A=I?v:y,P="",{scheme:D,authority:M,path:O,query:_,fragment:B}=L;if(D&&(P+=D,P+=":"),(M||D==="file")&&(P+=d,P+=d),M){let F=M.indexOf("@");if(F!==-1){let G=M.substr(0,F);M=M.substr(F+1),F=G.lastIndexOf(":"),F===-1?P+=A(G,!1,!1):(P+=A(G.substr(0,F),!1,!1),P+=":",P+=A(G.substr(F+1),!1,!0)),P+="@"}M=M.toLowerCase(),F=M.lastIndexOf(":"),F===-1?P+=A(M,!1,!0):(P+=A(M.substr(0,F),!1,!0),P+=M.substr(F))}if(O){if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){let F=O.charCodeAt(1);F>=65&&F<=90&&(O=`/${String.fromCharCode(F+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){let F=O.charCodeAt(0);F>=65&&F<=90&&(O=`${String.fromCharCode(F+32)}:${O.substr(2)}`)}P+=A(O,!0,!1)}return _&&(P+="?",P+=A(_,!1,!1)),B&&(P+="#",P+=I?B:y(B,!1,!1)),P}N(x,"b");function E(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+E(L.substr(3)):L}}N(E,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function T(L){return L.match(w)?L.replace(w,(I=>E(I))):L}N(T,"w");var C=r(975);let S=C.posix||C,R="/";var U;(function(L){L.joinPath=function(I,...A){return I.with({path:S.join(I.path,...A)})},L.resolvePath=function(I,...A){let P=I.path,D=!1;P[0]!==R&&(P=R+P,D=!0);let M=S.resolve(P,...A);return D&&M[0]===R&&!I.authority&&(M=M.substring(1)),I.with({path:M})},L.dirname=function(I){if(I.path.length===0||I.path===R)return I;let A=S.dirname(I.path);return A.length===1&&A.charCodeAt(0)===46&&(A=""),I.with({path:A})},L.basename=function(I){return S.basename(I.path)},L.extname=function(I){return S.extname(I.path)}})(U||(U={})),txt=n})();({URI:Fh,Utils:PM}=txt);(function(e){e.basename=PM.basename,e.dirname=PM.dirname,e.extname=PM.extname,e.joinPath=PM.joinPath,e.resolvePath=PM.resolvePath;let t=typeof process=="object"&&process?.platform==="win32";function r(o,s){return o?.toString()===s?.toString()}N(r,"equals"),e.equals=r;function n(o,s){let l=typeof o=="string"?Fh.parse(o).path:o.path,u=typeof s=="string"?Fh.parse(s).path:s.path,d=l.split("/").filter(g=>g.length>0),h=u.split("/").filter(g=>g.length>0);if(t){let g=/^[A-Z]:$/;if(d[0]&&g.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]&&g.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]!==h[0])return u.substring(1)}let f=0;for(;f({name:n.name,uri:Bu.joinPath(Fh.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let t=this.getNode(Bu.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){let r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(let i of r){let a=n.children.get(i);if(!a)if(t)a={name:i,children:new Map,parent:n},n.children.set(i,a);else return;n=a}return n}collectValues(e){let t=[];e.element&&t.push(e.element);for(let r of e.children.values())t.push(...this.collectValues(r));return t}};(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(Zn||(Zn={}));rxt=class{static{N(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=La.CancellationToken.None){let r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??Fh.parse(e.uri),La.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return La.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){let n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){let n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{let n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){let n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{let n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let i;if(r)i={parseResult:e,uri:t,state:Zn.Parsed,references:[],textDocument:r};else{let a=this.createTextDocumentGetter(t,n);i={parseResult:e,uri:t,state:Zn.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=i,i}async update(e,t){let r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),i=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{let a=this.createTextDocumentGetter(e.uri,i);Object.defineProperty(e,"textDocument",{get:a})}return r!==i&&(e.parseResult=await this.parseAsync(e.uri,i,t),e.parseResult.value.$document=e),e.state=Zn.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){let r=this.serviceRegistry,n;return()=>n??(n=uj.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},nxt=class{static{N(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new I2e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return na(this.documentTrie.all())}addDocument(e){let t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){let t=e.toString();return this.documentTrie.find(t)}getDocuments(e){let t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{let n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,Zn.Changed),r}deleteDocument(e){let t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=Zn.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){let t=e.toString(),r=this.documentTrie.findAll(t);for(let n of r)n.state=Zn.Changed;return this.documentTrie.delete(t),r}},f3=Symbol("RefResolving"),ixt=class{static{N(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=La.CancellationToken.None){if(this.profiler?.isActive("linking")){let r=this.profiler.createTask("linking",this.languageId);r.start();try{for(let n of R0(e.parseResult.value))await Wl(t),HS(n).forEach(i=>{let a=`${n.$type}:${i.property}`;r.startSubTask(a);try{this.doLink(i,e)}finally{r.stopSubTask(a)}})}finally{r.stop()}}else for(let r of R0(e.parseResult.value))await Wl(t),HS(r).forEach(n=>this.doLink(n,e))}doLink(e,t){let r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=f3;try{let n=this.getCandidate(e);if(v3(n))r._ref=n;else{r._nodeDescription=n;let i=this.loadAstNode(n);r._ref=i??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);let i=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=f3;try{let n=this.getCandidates(e),i=[];if(v3(n))r._linkingError=n;else for(let a of n){let o=this.loadAstNode(a);o&&i.push({ref:o,$nodeDescription:a})}r._items=i}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(let t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){let i=this,a={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Ds(this._ref))return this._ref;if(fve(this._nodeDescription)){let o=i.loadAstNode(this._nodeDescription);this._ref=o??i.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=f3;let o=OS(e).$document,s=i.getLinkedNode({reference:a,container:e,property:t});if(s.error&&o&&o.state0))return this._linkingError=i.createLinkingError({reference:a,container:e,property:t})}};return a}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{let t=this.getCandidate(e);if(v3(t))return{error:t};let r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);let r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;let t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){let r=OS(e.container).$document;r&&r.stateJ3(t)&&t.isMulti)}findDeclarations(e){if(e){let t=ibe(e),r=e.astNode;if(t&&r){let n=r[t.feature];if(Ou(n)||Vg(n))return IY(n);if(Array.isArray(n)){for(let i of n)if((Ou(i)||Vg(i))&&i.$refNode&&i.$refNode.offset<=e.offset&&i.$refNode.end>=e.end)return IY(i)}}if(r){let n=this.nameProvider.getNameNode(r);if(n&&(n===e||Ove(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(let n of HS(r))if(Vg(n.reference)&&n.reference.items.some(i=>i.ref===e))return n.reference.items.map(i=>i.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;let t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let t=this.findDeclarations(e),r=[];for(let n of t){let i=this.nameProvider.getNameNode(n)??n.$cstNode;i&&r.push(i)}return r}findReferences(e,t){let r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(i=>Bu.equals(i.sourceUri,t.documentUri))),r.push(...n),na(r)}getSelfReferences(e){let t=this.getSelfNodes(e),r=[];for(let n of t){let i=this.nameProvider.getNameNode(n);if(i){let a=I0(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:jS(i),local:!0})}}return r}},tv=class{static{N(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(let[t,r]of e)this.add(t,r)}get size(){return bL.sum(na(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{let r=this.map.get(e);if(r){let n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let t=this.map.get(e);return t?na(t):GS}has(e,t){if(t===void 0)return this.map.has(e);{let r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}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,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return na(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return na(this.map.keys())}values(){return na(this.map.values()).flat()}entriesGroupedByKey(){return na(this.map.entries())}},hj=class{static{N(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[t,r]of e)this.set(t,r)}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){let t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},sxt=class{static{N(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=La.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=BL,n=La.CancellationToken.None){let i=[];this.addExportedSymbol(e,i,t);for(let a of r(e))await Wl(n),this.addExportedSymbol(a,i,t);return i}addExportedSymbol(e,t,r){let n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=La.CancellationToken.None){let r=e.parseResult.value,n=new tv;for(let i of rv(r))await Wl(t),this.addLocalSymbol(i,e,n);return n}addLocalSymbol(e,t,r){let n=e.$container;if(n){let i=this.nameProvider.getName(e);i&&r.add(n,this.descriptions.createDescription(e,i,t))}}},sye=class{static{N(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},i8r=class{static{N(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(let n of e){let i=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(i,n)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?na(n).concat(this.outerScope.getElements(e)):na(n)}getAllElements(){let e=na(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},lxt=class{static{N(this,"MultiMapScope")}constructor(e,t,r){this.elements=new tv,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(let n of e){let i=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(i,n)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?na(r).concat(this.outerScope.getElements(e)):na(r)}getAllElements(){let e=na(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},a8r={getElement(){},getElements(){return GS},getAllElements(){return GS}},wX=class{static{N(this,"DisposableCache")}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")}},M2e=class extends wX{static{N(this,"SimpleCache")}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){let r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},EX=class extends wX{static{N(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();let n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){let i=r();return n.set(t,i),i}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){let t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){let t=this.converter(e),r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},cxt=class extends EX{static{N(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(let i of n)this.clear(i)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{let i=r.concat(n);for(let a of i)this.clear(a)}))}},L2e=class extends M2e{static{N(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},uxt=class{static{N(this,"DefaultScopeProvider")}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 L2e(e.shared)}getScope(e){let t=[],r=this.reflection.getReferenceType(e),n=I0(e.container).localSymbols;if(n){let a=e.container;do n.has(a)&&t.push(n.getStream(a).filter(o=>this.reflection.isSubtype(o.type,r))),a=a.$container;while(a)}let i=this.getGlobalScope(r,e);for(let a=t.length-1;a>=0;a--)i=this.createScope(t[a],i);return i}createScope(e,t,r){return new sye(na(e),t,r)}createScopeForNodes(e,t,r){let n=na(e).map(i=>{let a=this.nameProvider.getName(i);if(a)return this.descriptions.createDescription(i,a)}).nonNullable();return new sye(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new lxt(this.indexManager.allElements(e)))}};N(D2e,"isAstNodeWithComment");N(lye,"isIntermediateReference");dxt=class{static{N(this,"DefaultJsonSerializer")}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){let r=t??{},n=t?.replacer,i=N((o,s)=>this.replacer(o,s,r),"defaultReplacer"),a=n?(o,s)=>n(o,s,i):i;try{return this.currentDocument=I0(e),JSON.stringify(e,a,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){let r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:i,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e))if(Ou(t)){let s=t.ref,l=r?t.$refText:void 0;if(s){let u=I0(s),d="";this.currentDocument&&this.currentDocument!==u&&(o?d=o(u.uri,s):d=u.uri.toString());let h=this.astNodeLocator.getAstNodePath(s);return{$ref:`${d}#${h}`,$refText:l}}else return{$error:t.error?.message??"Could not resolve reference",$refText:l}}else if(Vg(t)){let s=r?t.$refText:void 0,l=[];for(let u of t.items){let d=u.ref,h=I0(u.ref),f="";this.currentDocument&&this.currentDocument!==h&&(o?f=o(h.uri,d):f=h.uri.toString());let p=this.astNodeLocator.getAstNodePath(d);l.push(`${f}#${p}`)}return{$refs:l,$refText:s}}else if(Ds(t)){let s;if(i&&(s=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&s?.$textRegion&&(s.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(s??(s={...t}),s.$sourceText=t.$cstNode?.text),a){s??(s={...t});let l=this.commentProvider.getComment(t);l&&(s.$comment=l.replace(/\r/g,""))}return s??t}else return t}addAstNodeRegionWithAssignmentsTo(e){let t=N(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){let r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(i=>!i.startsWith("$")).forEach(i=>{let a=rbe(e.$cstNode,i).map(t);a.length!==0&&(n[i]=a)}),e}}linkNode(e,t,r,n,i,a){for(let[s,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u{await this.handleException(()=>e.call(t,r,n,i),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(i){if(m6(i))throw i;console.error(`${t}:`,i),i instanceof Error&&i.stack&&console.error(i.stack);let a=i instanceof Error?i.message:String(i);r("error",`${t}: ${a}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(let r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=na(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.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,r){return async(n,i,a,o)=>{await this.handleException(()=>e.call(r,n,i,a,o),t,i,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},pxt=Object.freeze({validateNode:!0,validateChildren:!0}),mxt=class{static{N(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=La.CancellationToken.None){let n=e.parseResult,i=[];if(await Wl(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,i,t),t.stopAfterLexingErrors&&i.some(a=>a.data?.code===qf.LexingError)||(this.processParsingErrors(n,i,t),t.stopAfterParsingErrors&&i.some(a=>a.data?.code===qf.ParsingError))||(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some(a=>a.data?.code===qf.LinkingError))))return i;try{i.push(...await this.validateAst(n.value,t,r))}catch(a){if(m6(a))throw a;console.error("An error occurred during validation:",a)}return await Wl(r),i}processLexingErrors(e,t,r){let n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let i of n){let a=i.severity??"error",o={severity:pL(a),range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:_2e(a),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(let n of e.parserErrors){let i;if(isNaN(n.token.startOffset)){if("previousToken"in n){let a=n.previousToken;if(isNaN(a.startOffset)){let o={line:0,character:0};i={start:o,end:o}}else{let o={line:a.endLine-1,character:a.endColumn};i={start:o,end:o}}}}else i=xL(n.token);if(i){let a={severity:pL("error"),range:i,message:n.message,data:G3(qf.ParsingError),source:this.getSource()};t.push(a)}}}processLinkingErrors(e,t,r){for(let n of e.references){let i=n.error;if(i){let a={node:i.info.container,range:n.$refNode?.range,property:i.info.property,index:i.info.index,data:{code:qf.LinkingError,containerType:i.info.container.$type,property:i.info.property,refText:i.info.reference.$refText}};t.push(this.toDiagnostic("error",i.message,a))}}}async validateAst(e,t,r=La.CancellationToken.None){let n=[],i=N((a,o,s)=>{n.push(this.toDiagnostic(a,o,s))},"acceptor");return await this.validateAstBefore(e,t,i,r),await this.validateAstNodes(e,t,i,r),await this.validateAstAfter(e,t,i,r),n}async validateAstBefore(e,t,r,n=La.CancellationToken.None){let i=this.validationRegistry.checksBefore;for(let a of i)await Wl(n),await a(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=La.CancellationToken.None){if(this.profiler?.isActive("validating")){let i=this.profiler.createTask("validating",this.languageId);i.start();try{let a=R0(e).iterator();for(let o of a){i.startSubTask(o.$type);let s=this.validateSingleNodeOptions(o,t);if(s.validateNode)try{let l=this.validationRegistry.getChecks(o.$type,t.categories);for(let u of l)await u(o,r,n)}finally{i.stopSubTask(o.$type)}s.validateChildren||a.prune()}}finally{i.stop()}}else{let i=R0(e).iterator();for(let a of i){await Wl(n);let o=this.validateSingleNodeOptions(a,t);if(o.validateNode){let s=this.validationRegistry.getChecks(a.$type,t.categories);for(let l of s)await l(a,r,n)}o.validateChildren||i.prune()}}}validateSingleNodeOptions(e,t){return pxt}async validateAstAfter(e,t,r,n=La.CancellationToken.None){let i=this.validationRegistry.checksAfter;for(let a of i)await Wl(n),await a(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:N2e(r),severity:pL(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};N(N2e,"getDiagnosticRange");N(pL,"toDiagnosticSeverity");N(_2e,"toDiagnosticData");(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"})(qf||(qf={}));gxt=class{static{N(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){let n=r??I0(e);t??(t=this.nameProvider.getName(e));let i=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${i} has no name.`);let a,o=N(()=>a??(a=jS(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:jS(e.$cstNode),type:e.$type,documentUri:n.uri,path:i}}},yxt=class{static{N(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=La.CancellationToken.None){let r=[],n=e.parseResult.value;for(let i of R0(n))await Wl(t),HS(i).forEach(a=>{a.reference.error||r.push(...this.createInfoDescriptions(a))});return r}createInfoDescriptions(e){let t=e.reference;if(t.error||!t.$refNode)return[];let r=[];Ou(t)&&t.$nodeDescription?r=[t.$nodeDescription]:Vg(t)&&(r=t.items.map(s=>s.$nodeDescription).filter(s=>s!==void 0));let n=I0(e.container).uri,i=this.nodeLocator.getAstNodePath(e.container),a=[],o=jS(t.$refNode);for(let s of r)a.push({sourceUri:n,sourcePath:i,targetUri:s.documentUri,targetPath:s.path,segment:o,local:Bu.equals(s.documentUri,n)});return a}},vxt=class{static{N(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){let t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,i)=>{if(!n||i.length===0)return n;let a=i.indexOf(this.indexSeparator);if(a>0){let o=i.substring(0,a),s=parseInt(i.substring(a+1));return n[o]?.[s]}return n[i]},e)}},TX={};yj(TX,cve(QS(),1));bxt=class{static{N(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new ev,this.onConfigurationSectionUpdateEmitter=new TX.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,i)=>{this.updateSectionConfiguration(n.section,r[i])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;let r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},zq=cve(Nwr(),1);(function(e){function t(r){return{dispose:N(async()=>await r(),"dispose")}}N(t,"create"),e.create=t})(H3||(H3={}));xxt=class{static{N(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new tv,this.documentPhaseListeners=new tv,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Zn.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=La.CancellationToken.None){for(let n of e){let i=n.uri.toString();if(n.state===Zn.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,Zn.IndexedReferences);else if(typeof t.validation=="object"){let a=this.findMissingValidationCategories(n,t);a.length>0&&(this.buildState.set(i,{completed:!1,options:{validation:{categories:a}},result:this.buildState.get(i)?.result}),n.state=Zn.IndexedReferences)}}else this.buildState.delete(i)}this.currentState=Zn.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=La.CancellationToken.None){this.currentState=Zn.Changed;let n=[];for(let s of t){let l=this.langiumDocuments.deleteDocuments(s);for(let u of l)n.push(u.uri),this.cleanUpDeleted(u)}let i=(await Promise.all(e.map(s=>this.findChangedUris(s)))).flat();for(let s of i){let l=this.langiumDocuments.getDocument(s);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s),l.state=Zn.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,Zn.Changed)}let a=na(i).concat(n).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!a.has(s.uri.toString())&&this.shouldRelink(s,a)).forEach(s=>this.resetToState(s,Zn.ComputedScopes)),await this.emitUpdate(i,n),await Wl(r);let o=this.sortDocuments(this.langiumDocuments.all.filter(s=>s.state=1}findMissingValidationCategories(e,t){let r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),i=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,a=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return na(a).filter(o=>!i.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),H3.create(()=>{let t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case Zn.Changed:case Zn.Parsed:this.indexManager.removeContent(e.uri);case Zn.IndexedContent:e.localSymbols=void 0;case Zn.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Zn.Linked:this.indexManager.removeReferences(e.uri);case Zn.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Zn.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Zn.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,Zn.Parsed,r,a=>this.langiumDocumentFactory.update(a,r)),await this.runCancelable(e,Zn.IndexedContent,r,a=>this.indexManager.updateContent(a,r)),await this.runCancelable(e,Zn.ComputedScopes,r,async a=>{let o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,r)});let n=e.filter(a=>this.shouldLink(a));await this.runCancelable(n,Zn.Linked,r,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,r)),await this.runCancelable(n,Zn.IndexedReferences,r,a=>this.indexManager.updateReferences(a,r));let i=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(i,Zn.Validated,r,async a=>{await this.validate(a,r),this.markAsCompleted(a)})}markAsCompleted(e){let t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(let r of e){let n=r.uri.toString(),i=this.buildState.get(n);(!i||i.completed)&&this.buildState.set(n,{completed:!1,options:t,result:i?.result})}}async runCancelable(e,t,r,n){for(let a of e)a.statea.state===t);await this.notifyBuildPhase(i,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),H3.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),H3.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=La.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){let n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(Wg);if(this.currentState>=e&&e>n.state)return Promise.reject(new zq.ResponseError(zq.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${Zn[n.state]}, requiring ${Zn[e]}, but workspace state is already ${Zn[this.currentState]}. Returning undefined.`))}else return Promise.reject(new zq.ResponseError(zq.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((i,a)=>{let o=this.onDocumentPhase(e,l=>{Bu.equals(l.uri,t)&&(o.dispose(),s.dispose(),i(l.uri))}),s=r.onCancellationRequested(()=>{o.dispose(),s.dispose(),a(Wg)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(Wg):new Promise((r,n)=>{let i=this.onBuildPhase(e,()=>{i.dispose(),a.dispose(),r()}),a=t.onCancellationRequested(()=>{i.dispose(),a.dispose(),n(Wg)})})}async notifyDocumentPhase(e,t,r){let i=this.documentPhaseListeners.get(t).slice();for(let a of i)try{await Wl(r),await a(e,r)}catch(o){if(!m6(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;let i=this.buildPhaseListeners.get(t).slice();for(let a of i)await Wl(r),await a(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){let r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),i=typeof n.validation=="object"?{...n.validation}:{};i.categories=this.findMissingValidationCategories(e,n);let a=await r.validateDocument(e,i,t);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;let o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=na(o.result.validationChecks).concat(i.categories).distinct().toArray():o.result.validationChecks=[...i.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},wxt=class{static{N(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new EX,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){let r=I0(e).uri,n=[];return this.referenceIndex.forEach(i=>{i.forEach(a=>{Bu.equals(a.targetUri,r)&&a.targetPath===t&&n.push(a)})}),na(n)}allElements(e,t){let r=na(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(i=>this.astReflection.isSubtype(i.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){let t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=La.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),i=e.uri.toString();this.symbolIndex.set(i,n),this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=La.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){let r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},Ext=class{static{N(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new ev,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){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=La.CancellationToken.None){let r=await this.performStartup(e);await Wl(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){let t=[],r=N(a=>{t.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");await this.loadAdditionalDocuments(e,r);let n=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,n)));let i=na(n).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(i,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{let n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return Fh.parse(e.uri)}async traverseFolder(e,t){try{let r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){let t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){let t=Bu.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},Txt=class{static{N(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,i){return G1e.buildUnexpectedCharactersMessage(e,t,r,n,i)}buildUnableToPopLexerModeMessage(e){return G1e.buildUnableToPopLexerModeMessage(e)}},P2e={mode:"full"},O2e=class{static{N(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);let r=pj(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Fu(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=P2e){let r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(pj(e))return e;let t=CX(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};N(kX,"isTokenTypeArray");N(CX,"isIMultiModeLexerDefinition");N(pj,"isTokenTypeDictionary");PL();N(B2e,"parseJSDoc");N(F2e,"isJSDoc");N(z2e,"getLines");wht=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,o8r=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;N(kxt,"tokenize");N(Cxt,"buildInlineTokens");s8r=/\S/,l8r=/\s*$/;N(mj,"skipWhitespace");N(Sxt,"lastCharacter");N(Axt,"parseJSDocComment");N(Uxt,"parseJSDocElement");N(Ixt,"appendEmptyLine");N(G2e,"parseJSDocText");N(Rxt,"parseJSDocInline");N(W2e,"parseJSDocTag");N(V2e,"parseJSDocLine");N(SX,"normalizeOptions");N(bY,"normalizeOption");Eht=class{static{N(this,"JSDocCommentImpl")}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(let t of this.elements)if(e.length===0)e=t.toString();else{let r=t.toString();e+=uye(e)+r}return e.trim()}toMarkdown(e){let t="";for(let r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{let n=r.toMarkdown(e);t+=uye(t)+n}return t.trim()}},yge=class{static{N(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`,t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} -${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let t=this.content.toMarkdown(e);if(this.inline){let i=Mxt(this.name,t,e??{});if(typeof i=="string")return i}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} \u2014 ${t}`:this.content.inlines.length>1&&(n=`${n} -${t}`),this.inline?`{${n}}`:n}};N(Mxt,"renderInlineTag");N(Lxt,"renderLinkDefault");cye=class{static{N(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` -`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` -`)}return t}},Dxt=class{static{N(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};N(uye,"fillNewlines");Nxt=class{static{N(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let t=this.commentProvider.getComment(e);if(t&&F2e(t))return B2e(t).toMarkdown({renderLink:N((n,i)=>this.documentationLinkRenderer(e,n,i),"renderLink"),renderTag:N(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){let n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){let i=n.nameSegment.range.start.line+1,a=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${i},${a}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){let n=I0(e).localSymbols;if(!n)return;let i=e;do{let o=n.getStream(i).find(s=>s.name===t);if(o)return o;i=i.$container}while(i)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},_xt=class{static{N(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return D2e(e)?e.$comment:Gve(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},Pxt=class{static{N(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},c8r=class{static{N(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){let t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){let r=await this.acquireParserWorker(t),n=new ev,i,a=t.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{let s=this.hydrator.hydrate(o);n.resolve(s)}).catch(o=>{n.reject(o)}).finally(()=>{a.dispose(),clearTimeout(i)}),n.promise}terminateWorker(e){e.terminate();let t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(let r of this.workerPool)if(r.ready)return r.lock(),r;let t=new ev;return e.onCancellationRequested(()=>{let r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(Wg)}),this.queue.push(t),t.promise}},u8r=class{static{N(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new TX.Emitter,this.deferred=new ev,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(i=>{let a=i;this.deferred.resolve(a),this.unlock()}),r(i=>{this.deferred.reject(i),this.unlock()})}terminate(){this.deferred.reject(Wg),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new ev,this.sendMessage(e),this.deferred.promise}},Oxt=class{static{N(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new La.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let t=xX();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=La.CancellationToken.None){let n=new ev,i={action:t,deferred:n,cancellationToken:r};return e.push(i),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{let i=await Promise.resolve().then(()=>t(n));r.resolve(i)}catch(i){m6(i)?r.resolve(void 0):r.reject(i)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Bxt=class{static{N(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new hj,this.tokenTypeIdMap=new hj,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(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let t=new Map,r=new Map;for(let n of R0(e))t.set(n,{});if(e.$cstNode)for(let n of YS(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){let r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(let[n,i]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(i)){let a=[];r[n]=a;for(let o of i)Ds(o)?a.push(this.dehydrateAstNode(o,t)):Ou(o)?a.push(this.dehydrateReference(o,t)):a.push(o)}else Ds(i)?r[n]=this.dehydrateAstNode(i,t):Ou(i)?r[n]=this.dehydrateReference(i,t):i!==void 0&&(r[n]=i);return r}dehydrateReference(e,t){let r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){let r=t.cstNodes.get(e);return xj(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),Yy(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):K3(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){let t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){let t=new Map,r=new Map;for(let i of R0(e))t.set(i,{});let n;if(e.$cstNode)for(let i of YS(e.$cstNode)){let a;"fullText"in i?(a=new y2e(i.fullText),n=a):"content"in i?a=new mX:"tokenType"in i&&(a=this.hydrateCstLeafNode(i)),a&&(r.set(i,a),a.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){let r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(let[n,i]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(i)){let a=[];r[n]=a;for(let o of i)Ds(o)?a.push(this.setParent(this.hydrateAstNode(o,t),r)):Ou(o)?a.push(this.hydrateReference(o,r,n,t)):a.push(o)}else Ds(i)?r[n]=this.setParent(this.hydrateAstNode(i,t),r):Ou(i)?r[n]=this.hydrateReference(i,r,n,t):i!==void 0&&(r[n]=i);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){let n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),Yy(n))for(let i of e.content){let a=this.hydrateCstNode(i,t,r++);n.content.push(a)}return n}hydrateCstLeafNode(e){let t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,i=e.startLine,a=e.startColumn,o=e.endLine,s=e.endColumn,l=e.hidden;return new sj(r,n,{start:{line:i,character:a},end:{line:o,character:s}},t,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let t of R0(this.grammar))wj(t)&&this.grammarElementIdMap.set(t,e++)}};N(Ei,"createDefaultCoreModule");N(Ti,"createDefaultSharedCoreModule");(function(e){e.merge=(t,r)=>ZS(ZS({},t),r)})(dye||(dye={}));N(xn,"inject");Fxt=Symbol("isProxy");N(H2e,"eagerLoad");N(q2e,"_inject");Tht=Symbol();N(hye,"_resolve");N(ZS,"_merge");fye={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]};(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(W3||(W3={}));zxt=class extends vX{static{N(this,"IndentationAwareTokenBuilder")}constructor(e=fye){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...fye,...e},this.indentTokenType=FS({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=FS({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){let r=super.buildTokens(e,t);if(!kX(r))throw new Error("Invalid tokens built by default builder");let{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options,s,l,u,d=[];for(let h of r){for(let[f,p]of o)h.name===f?h.PUSH_MODE=W3.IGNORE_INDENTATION:h.name===p&&(h.POP_MODE=!0);h.name===i?s=h:h.name===n?l=h:h.name===a?u=h:d.push(h)}if(!s||!l||!u)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[W3.REGULAR]:[s,l,...d,u],[W3.IGNORE_INDENTATION]:[...d,u]},defaultMode:W3.REGULAR}:[s,l,u,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r -`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;let i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,t,r,n){let i=this.getLineNumber(t,n);return JL(e,r,n,n+r.length,i,i,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,r,n);return i<=a?null:(this.indentationStack.push(i),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,r,n);if(i>=a)return null;let s=this.indentationStack.lastIndexOf(i);if(s===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${i} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;let l=this.indentationStack.length-s-1,u=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},d8r=class extends O2e{static{N(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof zxt)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=P2e){let r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];let{indentTokenType:i,dedentTokenType:a}=this.indentationTokenBuilder,o=i.tokenTypeIdx,s=a.tokenTypeIdx,l=[],u=r.tokens.length-1;for(let d=0;d=0&&l.push(r.tokens[u]),r.tokens=l,r}},Y2e={};Gx(Y2e,{AstUtils:()=>mve,BiMap:()=>hj,Cancellation:()=>La,ContextCache:()=>EX,CstUtils:()=>hve,DONE_RESULT:()=>Pu,Deferred:()=>ev,Disposable:()=>H3,DisposableCache:()=>wX,DocumentCache:()=>cxt,EMPTY_STREAM:()=>GS,ErrorWithLocation:()=>Uj,GrammarUtils:()=>qve,MultiMap:()=>tv,OperationCancelled:()=>Wg,Reduction:()=>bL,RegExpUtils:()=>jve,SimpleCache:()=>M2e,StreamImpl:()=>Gg,TreeStreamImpl:()=>WS,URI:()=>Fh,UriTrie:()=>I2e,UriUtils:()=>Bu,WorkspaceCache:()=>L2e,assertCondition:()=>Yve,assertUnreachable:()=>Wx,delayNextTick:()=>bX,interruptAndCheck:()=>Wl,isOperationCancelled:()=>m6,loadGrammarFromJson:()=>Vl,setInterruptionPeriod:()=>S2e,startCancelableOperation:()=>xX,stream:()=>na});yj(Y2e,TX);Gxt=class{static{N(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Ni={fileSystemProvider:N(()=>new Gxt,"fileSystemProvider")},h8r={Grammar:N(()=>{},"Grammar"),LanguageMetaData:N(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},f8r={AstReflection:N(()=>new Pve,"AstReflection")};N(Wxt,"createMinimalGrammarServices");N(Vl,"loadGrammarFromJson");yj(Qht,Y2e);p8r=class{static{N(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new tv}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new Vxt(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);let r=[];for(let a of t.entries.keys()){let o=t.entries.get(a),s=o.reduce((l,u)=>l+u);r.push({name:`${t.identifier}.${a}`,count:o.length,duration:s})}let n=t.duration-r.map(a=>a.duration).reduce((a,o)=>a+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((a,o)=>o.duration-a.duration);function i(a){return Math.round(100*a)/100}return N(i,"Round"),console.table(r.map(a=>({Element:a.name,Count:a.count,"Self %":i(100*a.duration/t.duration),"Time (ms)":i(a.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},Vxt=class{static{N(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new tv,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);let r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);let n=r-t.content;this.entries.add(e,n)}};(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(pye||(pye={}));(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(mye||(mye={}));(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(gye||(gye={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(yye||(yye={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(vye||(vye={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(bye||(bye={}));(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(xye||(xye={}));(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(wye||(wye={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(Eye||(Eye={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(Tye||(Tye={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(kye||(kye={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(Cye||(Cye={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Sye||(Sye={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(Aye||(Aye={}));(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Uye||(Uye={}));IMn={...pye.Terminals,...mye.Terminals,...gye.Terminals,...yye.Terminals,...vye.Terminals,...bye.Terminals,...xye.Terminals,...wye.Terminals,...Eye.Terminals,...Tye.Terminals,...kye.Terminals,...Cye.Terminals,...Aye.Terminals,...Sye.Terminals,...Uye.Terminals},Iye={$type:"AbnfAlternation",alternatives:"alternatives"},Rye={$type:"AbnfConcatenation",elements:"elements"},xY={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Mye={$type:"AbnfGroup",element:"element"},Lye={$type:"AbnfNumVal",value:"value"},Dye={$type:"AbnfOptionalGroup",element:"element"},p3={$type:"AbnfPrimary"},wY={$type:"AbnfRule",definition:"definition",name:"name"},Nye={$type:"AbnfRuleName",name:"name"},_ye={$type:"AbnfStringLiteral",value:"value"},Gq={$type:"Accelerator",name:"name",x:"x",y:"y"},vge={$type:"Alignment",direction:"direction",members:"members"},Wq={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},OM={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},bge={$type:"Annotations",x:"x",y:"y"},S0={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};N(Hxt,"isArchitecture");Vq={$type:"Axis",label:"label",name:"name"},mL={$type:"Branch",name:"name",order:"order"};N(qxt,"isBranch");kht={$type:"Checkout",branch:"branch"},Hq={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},xge={$type:"ClassDefStatement",className:"className",styleText:"styleText"},R3={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};N(Yxt,"isCommit");qq={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},o3={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},Yq={$type:"Curve",entries:"entries",label:"label",name:"name"},Dx={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};N(jxt,"isCynefin");jq={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Cht={$type:"Decorator",strategy:"strategy"},gS={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},gL={$type:"DomainBlock",domain:"domain",items:"items"};N(Xxt,"isDomainBlock");gj={$type:"DomainItem",label:"label"};N($xt,"isDomainItem");Pye={$type:"EbnfChoice",alternatives:"alternatives"},Oye={$type:"EbnfExceptionPostfix",except:"except"},Bye={$type:"EbnfGroup",element:"element"},Fye={$type:"EbnfNonTerminal",name:"name"},zye={$type:"EbnfOneOrMorePostfix",operator:"operator"},Gye={$type:"EbnfOptional",element:"element"},Wye={$type:"EbnfOptionalPostfix",operator:"operator"},kS={$type:"EbnfPostfix"},Cx={$type:"EbnfPrimary"},Vye={$type:"EbnfRepetition",element:"element"},EY={$type:"EbnfRule",definition:"definition",name:"name"},Hye={$type:"EbnfSequence",elements:"elements"},qye={$type:"EbnfSpecial",text:"text"},TY={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Yye={$type:"EbnfTerminal",value:"value"},jye={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Ng={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},m3={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},Sx={$type:"EmFrame"},BM={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Sht={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},wge={$type:"EmModelEntity",name:"name"};N(Kxt,"isEmModelEntityType");Xq={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Wy={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};N(AX,"isEmResetFrame");kx={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},Ege={$type:"Entry",axis:"axis",value:"value"},Pg={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Aht={$type:"Evolution",stages:"stages"},$q={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},Tge={$type:"Evolve",component:"component",target:"target"},Nx={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};N(Zxt,"isGitGraph");FM={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},_S={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};N(Qxt,"isInfo");zM={$type:"Item",classSelector:"classSelector",name:"name"},kge={$type:"Junction",id:"id",in:"in"},GM={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},Kq={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},s3={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},M3={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};N(Jxt,"isMerge");Zq={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},Cge={$type:"Option",name:"name",value:"value"},L3={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};N(ewt,"isPacket");D3={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};N(twt,"isPacketBlock");Xye={$type:"PegAny",dot:"dot"},$ye={$type:"PegGroup",element:"element"},Kye={$type:"PegIdentifier",name:"name"},Zye={$type:"PegLiteral",value:"value"},Qye={$type:"PegOrderedChoice",alternatives:"alternatives"},kY={$type:"PegPrefix",operator:"operator",suffix:"suffix"},CS={$type:"PegPrimary"},CY={$type:"PegRule",definition:"definition",name:"name"},Jye={$type:"PegSequence",elements:"elements"},SY={$type:"PegSuffix",operator:"operator",primary:"primary"},_x={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};N(rwt,"isPie");yL={$type:"PieSection",label:"label",value:"value"};N(nwt,"isPieSection");Sge={$type:"Pipeline",components:"components",parent:"parent"},Qq={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},Ax={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},N3={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};N(iwt,"isRailroad");_3={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};N(awt,"isRailroadAbnf");eve={$type:"RailroadChoiceExpr",alternatives:"alternatives"},P3={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};N(owt,"isRailroadEbnf");Og={$type:"RailroadExpression"},tve={$type:"RailroadNonTerminalExpr",name:"name"},rve={$type:"RailroadOneOrMoreExpr",element:"element"},nve={$type:"RailroadOptionalExpr",element:"element"},O3={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};N(swt,"isRailroadPeg");AY={$type:"RailroadRule",definition:"definition",name:"name"},ive={$type:"RailroadSequenceExpr",elements:"elements"},ave={$type:"RailroadSpecialExpr",text:"text"},ove={$type:"RailroadTerminalExpr",value:"value"},sve={$type:"RailroadZeroOrMoreExpr",element:"element"},Age={$type:"Section",classSelector:"classSelector",name:"name"},yS={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Uge={$type:"Size",height:"height",width:"width"},g3={$type:"Statement"},PS={$type:"Transition",from:"from",label:"label",to:"to"};N(lwt,"isTransition");B3={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};N(cwt,"isTreemap");Ige={$type:"TreemapRow",indent:"indent",item:"item"},y3={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},SS={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},zl={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};N(uwt,"isWardley");dwt=class extends pve{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Iye.$type,properties:{alternatives:{name:Iye.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Rye.$type,properties:{elements:{name:Rye.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:xY.$type,properties:{primary:{name:xY.primary},repeat:{name:xY.repeat}},superTypes:[]},AbnfGroup:{name:Mye.$type,properties:{element:{name:Mye.element}},superTypes:[p3.$type]},AbnfNumVal:{name:Lye.$type,properties:{value:{name:Lye.value}},superTypes:[p3.$type]},AbnfOptionalGroup:{name:Dye.$type,properties:{element:{name:Dye.element}},superTypes:[p3.$type]},AbnfPrimary:{name:p3.$type,properties:{},superTypes:[]},AbnfRule:{name:wY.$type,properties:{definition:{name:wY.definition},name:{name:wY.name}},superTypes:[]},AbnfRuleName:{name:Nye.$type,properties:{name:{name:Nye.name}},superTypes:[p3.$type]},AbnfStringLiteral:{name:_ye.$type,properties:{value:{name:_ye.value}},superTypes:[p3.$type]},Accelerator:{name:Gq.$type,properties:{name:{name:Gq.name},x:{name:Gq.x},y:{name:Gq.y}},superTypes:[]},Alignment:{name:vge.$type,properties:{direction:{name:vge.direction},members:{name:vge.members,defaultValue:[]}},superTypes:[]},Anchor:{name:Wq.$type,properties:{evolution:{name:Wq.evolution},name:{name:Wq.name},visibility:{name:Wq.visibility}},superTypes:[]},Annotation:{name:OM.$type,properties:{number:{name:OM.number},text:{name:OM.text},x:{name:OM.x},y:{name:OM.y}},superTypes:[]},Annotations:{name:bge.$type,properties:{x:{name:bge.x},y:{name:bge.y}},superTypes:[]},Architecture:{name:S0.$type,properties:{accDescr:{name:S0.accDescr},accTitle:{name:S0.accTitle},alignments:{name:S0.alignments,defaultValue:[]},edges:{name:S0.edges,defaultValue:[]},groups:{name:S0.groups,defaultValue:[]},junctions:{name:S0.junctions,defaultValue:[]},services:{name:S0.services,defaultValue:[]},title:{name:S0.title}},superTypes:[]},Axis:{name:Vq.$type,properties:{label:{name:Vq.label},name:{name:Vq.name}},superTypes:[]},Branch:{name:mL.$type,properties:{name:{name:mL.name},order:{name:mL.order}},superTypes:[g3.$type]},Checkout:{name:kht.$type,properties:{branch:{name:kht.branch}},superTypes:[g3.$type]},CherryPicking:{name:Hq.$type,properties:{id:{name:Hq.id},parent:{name:Hq.parent},tags:{name:Hq.tags,defaultValue:[]}},superTypes:[g3.$type]},ClassDefStatement:{name:xge.$type,properties:{className:{name:xge.className},styleText:{name:xge.styleText}},superTypes:[]},Commit:{name:R3.$type,properties:{id:{name:R3.id},message:{name:R3.message},tags:{name:R3.tags,defaultValue:[]},type:{name:R3.type}},superTypes:[g3.$type]},Common:{name:qq.$type,properties:{accDescr:{name:qq.accDescr},accTitle:{name:qq.accTitle},title:{name:qq.title}},superTypes:[]},Component:{name:o3.$type,properties:{decorator:{name:o3.decorator},evolution:{name:o3.evolution},inertia:{name:o3.inertia,defaultValue:!1},label:{name:o3.label},name:{name:o3.name},visibility:{name:o3.visibility}},superTypes:[]},Curve:{name:Yq.$type,properties:{entries:{name:Yq.entries,defaultValue:[]},label:{name:Yq.label},name:{name:Yq.name}},superTypes:[]},Cynefin:{name:Dx.$type,properties:{accDescr:{name:Dx.accDescr},accTitle:{name:Dx.accTitle},domains:{name:Dx.domains,defaultValue:[]},title:{name:Dx.title},transitions:{name:Dx.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:jq.$type,properties:{name:{name:jq.name},x:{name:jq.x},y:{name:jq.y}},superTypes:[]},Decorator:{name:Cht.$type,properties:{strategy:{name:Cht.strategy}},superTypes:[]},Direction:{name:gS.$type,properties:{accDescr:{name:gS.accDescr},accTitle:{name:gS.accTitle},dir:{name:gS.dir},statements:{name:gS.statements,defaultValue:[]},title:{name:gS.title}},superTypes:[Nx.$type]},DomainBlock:{name:gL.$type,properties:{domain:{name:gL.domain},items:{name:gL.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:gj.$type,properties:{label:{name:gj.label}},superTypes:[]},EbnfChoice:{name:Pye.$type,properties:{alternatives:{name:Pye.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Oye.$type,properties:{except:{name:Oye.except}},superTypes:[kS.$type]},EbnfGroup:{name:Bye.$type,properties:{element:{name:Bye.element}},superTypes:[Cx.$type]},EbnfNonTerminal:{name:Fye.$type,properties:{name:{name:Fye.name}},superTypes:[Cx.$type]},EbnfOneOrMorePostfix:{name:zye.$type,properties:{operator:{name:zye.operator}},superTypes:[kS.$type]},EbnfOptional:{name:Gye.$type,properties:{element:{name:Gye.element}},superTypes:[Cx.$type]},EbnfOptionalPostfix:{name:Wye.$type,properties:{operator:{name:Wye.operator}},superTypes:[kS.$type]},EbnfPostfix:{name:kS.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Cx.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Vye.$type,properties:{element:{name:Vye.element}},superTypes:[Cx.$type]},EbnfRule:{name:EY.$type,properties:{definition:{name:EY.definition},name:{name:EY.name}},superTypes:[]},EbnfSequence:{name:Hye.$type,properties:{elements:{name:Hye.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:qye.$type,properties:{text:{name:qye.text}},superTypes:[Cx.$type]},EbnfTerm:{name:TY.$type,properties:{base:{name:TY.base},postfixes:{name:TY.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Yye.$type,properties:{value:{name:Yye.value}},superTypes:[Cx.$type]},EbnfZeroOrMorePostfix:{name:jye.$type,properties:{operator:{name:jye.operator}},superTypes:[kS.$type]},Edge:{name:Ng.$type,properties:{lhsDir:{name:Ng.lhsDir},lhsGroup:{name:Ng.lhsGroup,defaultValue:!1},lhsId:{name:Ng.lhsId},lhsInto:{name:Ng.lhsInto,defaultValue:!1},rhsDir:{name:Ng.rhsDir},rhsGroup:{name:Ng.rhsGroup,defaultValue:!1},rhsId:{name:Ng.rhsId},rhsInto:{name:Ng.rhsInto,defaultValue:!1},title:{name:Ng.title}},superTypes:[]},EmDataEntity:{name:m3.$type,properties:{dataBlockValue:{name:m3.dataBlockValue},dataType:{name:m3.dataType},name:{name:m3.name}},superTypes:[]},EmFrame:{name:Sx.$type,properties:{},superTypes:[]},EmGwt:{name:BM.$type,properties:{givenStatements:{name:BM.givenStatements,defaultValue:[]},sourceFrame:{name:BM.sourceFrame,referenceType:Sx.$type},thenStatements:{name:BM.thenStatements,defaultValue:[]},whenStatements:{name:BM.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Sht.$type,properties:{entityIdentifier:{name:Sht.entityIdentifier,referenceType:wge.$type}},superTypes:[]},EmModelEntity:{name:wge.$type,properties:{name:{name:wge.name}},superTypes:[]},EmNoteEntity:{name:Xq.$type,properties:{dataBlockValue:{name:Xq.dataBlockValue},dataType:{name:Xq.dataType},sourceFrame:{name:Xq.sourceFrame,referenceType:Sx.$type}},superTypes:[]},EmResetFrame:{name:Wy.$type,properties:{dataInlineValue:{name:Wy.dataInlineValue},dataReference:{name:Wy.dataReference,referenceType:m3.$type},dataType:{name:Wy.dataType},entityIdentifier:{name:Wy.entityIdentifier},modelEntityType:{name:Wy.modelEntityType},name:{name:Wy.name},sourceFrames:{name:Wy.sourceFrames,defaultValue:[],referenceType:Sx.$type}},superTypes:[Sx.$type]},EmTimeFrame:{name:kx.$type,properties:{dataInlineValue:{name:kx.dataInlineValue},dataReference:{name:kx.dataReference,referenceType:m3.$type},dataType:{name:kx.dataType},entityIdentifier:{name:kx.entityIdentifier},modelEntityType:{name:kx.modelEntityType},name:{name:kx.name},sourceFrames:{name:kx.sourceFrames,defaultValue:[],referenceType:Sx.$type}},superTypes:[Sx.$type]},Entry:{name:Ege.$type,properties:{axis:{name:Ege.axis,referenceType:Vq.$type},value:{name:Ege.value}},superTypes:[]},EventModel:{name:Pg.$type,properties:{accDescr:{name:Pg.accDescr},accTitle:{name:Pg.accTitle},dataEntities:{name:Pg.dataEntities,defaultValue:[]},frames:{name:Pg.frames,defaultValue:[]},gwtEntities:{name:Pg.gwtEntities,defaultValue:[]},modelEntities:{name:Pg.modelEntities,defaultValue:[]},noteEntities:{name:Pg.noteEntities,defaultValue:[]},title:{name:Pg.title}},superTypes:[]},Evolution:{name:Aht.$type,properties:{stages:{name:Aht.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:$q.$type,properties:{boundary:{name:$q.boundary},name:{name:$q.name},secondName:{name:$q.secondName}},superTypes:[]},Evolve:{name:Tge.$type,properties:{component:{name:Tge.component},target:{name:Tge.target}},superTypes:[]},GitGraph:{name:Nx.$type,properties:{accDescr:{name:Nx.accDescr},accTitle:{name:Nx.accTitle},statements:{name:Nx.statements,defaultValue:[]},title:{name:Nx.title}},superTypes:[]},Group:{name:FM.$type,properties:{icon:{name:FM.icon},id:{name:FM.id},in:{name:FM.in},title:{name:FM.title}},superTypes:[]},Info:{name:_S.$type,properties:{accDescr:{name:_S.accDescr},accTitle:{name:_S.accTitle},title:{name:_S.title}},superTypes:[]},Item:{name:zM.$type,properties:{classSelector:{name:zM.classSelector},name:{name:zM.name}},superTypes:[]},Junction:{name:kge.$type,properties:{id:{name:kge.id},in:{name:kge.in}},superTypes:[]},Label:{name:GM.$type,properties:{negX:{name:GM.negX,defaultValue:!1},negY:{name:GM.negY,defaultValue:!1},offsetX:{name:GM.offsetX},offsetY:{name:GM.offsetY}},superTypes:[]},Leaf:{name:Kq.$type,properties:{classSelector:{name:Kq.classSelector},name:{name:Kq.name},value:{name:Kq.value}},superTypes:[zM.$type]},Link:{name:s3.$type,properties:{arrow:{name:s3.arrow},from:{name:s3.from},fromPort:{name:s3.fromPort},linkLabel:{name:s3.linkLabel},to:{name:s3.to},toPort:{name:s3.toPort}},superTypes:[]},Merge:{name:M3.$type,properties:{branch:{name:M3.branch},id:{name:M3.id},tags:{name:M3.tags,defaultValue:[]},type:{name:M3.type}},superTypes:[g3.$type]},Note:{name:Zq.$type,properties:{evolution:{name:Zq.evolution},text:{name:Zq.text},visibility:{name:Zq.visibility}},superTypes:[]},Option:{name:Cge.$type,properties:{name:{name:Cge.name},value:{name:Cge.value,defaultValue:!1}},superTypes:[]},Packet:{name:L3.$type,properties:{accDescr:{name:L3.accDescr},accTitle:{name:L3.accTitle},blocks:{name:L3.blocks,defaultValue:[]},title:{name:L3.title}},superTypes:[]},PacketBlock:{name:D3.$type,properties:{bits:{name:D3.bits},end:{name:D3.end},label:{name:D3.label},start:{name:D3.start}},superTypes:[]},PegAny:{name:Xye.$type,properties:{dot:{name:Xye.dot}},superTypes:[CS.$type]},PegGroup:{name:$ye.$type,properties:{element:{name:$ye.element}},superTypes:[CS.$type]},PegIdentifier:{name:Kye.$type,properties:{name:{name:Kye.name}},superTypes:[CS.$type]},PegLiteral:{name:Zye.$type,properties:{value:{name:Zye.value}},superTypes:[CS.$type]},PegOrderedChoice:{name:Qye.$type,properties:{alternatives:{name:Qye.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:kY.$type,properties:{operator:{name:kY.operator},suffix:{name:kY.suffix}},superTypes:[]},PegPrimary:{name:CS.$type,properties:{},superTypes:[]},PegRule:{name:CY.$type,properties:{definition:{name:CY.definition},name:{name:CY.name}},superTypes:[]},PegSequence:{name:Jye.$type,properties:{elements:{name:Jye.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:SY.$type,properties:{operator:{name:SY.operator},primary:{name:SY.primary}},superTypes:[]},Pie:{name:_x.$type,properties:{accDescr:{name:_x.accDescr},accTitle:{name:_x.accTitle},sections:{name:_x.sections,defaultValue:[]},showData:{name:_x.showData,defaultValue:!1},title:{name:_x.title}},superTypes:[]},PieSection:{name:yL.$type,properties:{label:{name:yL.label},value:{name:yL.value}},superTypes:[]},Pipeline:{name:Sge.$type,properties:{components:{name:Sge.components,defaultValue:[]},parent:{name:Sge.parent}},superTypes:[]},PipelineComponent:{name:Qq.$type,properties:{evolution:{name:Qq.evolution},label:{name:Qq.label},name:{name:Qq.name}},superTypes:[]},Radar:{name:Ax.$type,properties:{accDescr:{name:Ax.accDescr},accTitle:{name:Ax.accTitle},axes:{name:Ax.axes,defaultValue:[]},curves:{name:Ax.curves,defaultValue:[]},options:{name:Ax.options,defaultValue:[]},title:{name:Ax.title}},superTypes:[]},Railroad:{name:N3.$type,properties:{accDescr:{name:N3.accDescr},accTitle:{name:N3.accTitle},rules:{name:N3.rules,defaultValue:[]},title:{name:N3.title}},superTypes:[]},RailroadAbnf:{name:_3.$type,properties:{accDescr:{name:_3.accDescr},accTitle:{name:_3.accTitle},rules:{name:_3.rules,defaultValue:[]},title:{name:_3.title}},superTypes:[]},RailroadChoiceExpr:{name:eve.$type,properties:{alternatives:{name:eve.alternatives,defaultValue:[]}},superTypes:[Og.$type]},RailroadEbnf:{name:P3.$type,properties:{accDescr:{name:P3.accDescr},accTitle:{name:P3.accTitle},rules:{name:P3.rules,defaultValue:[]},title:{name:P3.title}},superTypes:[]},RailroadExpression:{name:Og.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:tve.$type,properties:{name:{name:tve.name}},superTypes:[Og.$type]},RailroadOneOrMoreExpr:{name:rve.$type,properties:{element:{name:rve.element}},superTypes:[Og.$type]},RailroadOptionalExpr:{name:nve.$type,properties:{element:{name:nve.element}},superTypes:[Og.$type]},RailroadPeg:{name:O3.$type,properties:{accDescr:{name:O3.accDescr},accTitle:{name:O3.accTitle},rules:{name:O3.rules,defaultValue:[]},title:{name:O3.title}},superTypes:[]},RailroadRule:{name:AY.$type,properties:{definition:{name:AY.definition},name:{name:AY.name}},superTypes:[]},RailroadSequenceExpr:{name:ive.$type,properties:{elements:{name:ive.elements,defaultValue:[]}},superTypes:[Og.$type]},RailroadSpecialExpr:{name:ave.$type,properties:{text:{name:ave.text}},superTypes:[Og.$type]},RailroadTerminalExpr:{name:ove.$type,properties:{value:{name:ove.value}},superTypes:[Og.$type]},RailroadZeroOrMoreExpr:{name:sve.$type,properties:{element:{name:sve.element}},superTypes:[Og.$type]},Section:{name:Age.$type,properties:{classSelector:{name:Age.classSelector},name:{name:Age.name}},superTypes:[zM.$type]},Service:{name:yS.$type,properties:{icon:{name:yS.icon},iconText:{name:yS.iconText},id:{name:yS.id},in:{name:yS.in},title:{name:yS.title}},superTypes:[]},Size:{name:Uge.$type,properties:{height:{name:Uge.height},width:{name:Uge.width}},superTypes:[]},Statement:{name:g3.$type,properties:{},superTypes:[]},Transition:{name:PS.$type,properties:{from:{name:PS.from},label:{name:PS.label},to:{name:PS.to}},superTypes:[]},TreeNode:{name:y3.$type,properties:{classAnnotation:{name:y3.classAnnotation},descAnnotation:{name:y3.descAnnotation},iconAnnotation:{name:y3.iconAnnotation},indent:{name:y3.indent},name:{name:y3.name}},superTypes:[]},TreeView:{name:SS.$type,properties:{accDescr:{name:SS.accDescr},accTitle:{name:SS.accTitle},nodes:{name:SS.nodes,defaultValue:[]},title:{name:SS.title}},superTypes:[]},Treemap:{name:B3.$type,properties:{accDescr:{name:B3.accDescr},accTitle:{name:B3.accTitle},title:{name:B3.title},TreemapRows:{name:B3.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Ige.$type,properties:{indent:{name:Ige.indent},item:{name:Ige.item}},superTypes:[]},Wardley:{name:zl.$type,properties:{accDescr:{name:zl.accDescr},accelerators:{name:zl.accelerators,defaultValue:[]},accTitle:{name:zl.accTitle},anchors:{name:zl.anchors,defaultValue:[]},annotation:{name:zl.annotation,defaultValue:[]},annotations:{name:zl.annotations,defaultValue:[]},components:{name:zl.components,defaultValue:[]},deaccelerators:{name:zl.deaccelerators,defaultValue:[]},evolution:{name:zl.evolution},evolves:{name:zl.evolves,defaultValue:[]},links:{name:zl.links,defaultValue:[]},notes:{name:zl.notes,defaultValue:[]},pipelines:{name:zl.pipelines,defaultValue:[]},size:{name:zl.size},title:{name:zl.title}},superTypes:[]}}}static{N(this,"MermaidAstReflection")}},ms=new dwt,m8r=N(()=>Uht??(Uht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$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":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$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@12"},"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@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),g8r=N(()=>Iht??(Iht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),y8r=N(()=>Rht??(Rht=Vl('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","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","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),v8r=N(()=>Mht??(Mht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"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@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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"}]}},"entry":false,"fragment":false,"parameters":[]},{"$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@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$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@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),b8r=N(()=>Lht??(Lht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$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@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),x8r=N(()=>Dht??(Dht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),w8r=N(()=>Nht??(Nht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),E8r=N(()=>_ht??(_ht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$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@11"},"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@17"},"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@17"},"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@17"},"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@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),T8r=N(()=>Pht??(Pht=Vl('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),k8r=N(()=>Oht??(Oht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),C8r=N(()=>Bht??(Bht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"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":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),S8r=N(()=>Fht??(Fht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),A8r=N(()=>zht??(zht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),U8r=N(()=>Ght??(Ght=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),I8r=N(()=>Wht??(Wht=Vl(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),R8r={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},M8r={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},L8r={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},D8r={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},N8r={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_8r={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},P8r={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},O8r={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},B8r={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},F8r={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},z8r={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},G8r={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},W8r={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},V8r={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},H8r={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ji={AstReflection:N(()=>new dwt,"AstReflection")},j2e={Grammar:N(()=>m8r(),"Grammar"),LanguageMetaData:N(()=>R8r,"LanguageMetaData"),parser:{}},X2e={Grammar:N(()=>g8r(),"Grammar"),LanguageMetaData:N(()=>M8r,"LanguageMetaData"),parser:{}},$2e={Grammar:N(()=>y8r(),"Grammar"),LanguageMetaData:N(()=>L8r,"LanguageMetaData"),parser:{}},K2e={Grammar:N(()=>v8r(),"Grammar"),LanguageMetaData:N(()=>D8r,"LanguageMetaData"),parser:{}},Z2e={Grammar:N(()=>b8r(),"Grammar"),LanguageMetaData:N(()=>N8r,"LanguageMetaData"),parser:{}},Q2e={Grammar:N(()=>x8r(),"Grammar"),LanguageMetaData:N(()=>_8r,"LanguageMetaData"),parser:{}},J2e={Grammar:N(()=>w8r(),"Grammar"),LanguageMetaData:N(()=>P8r,"LanguageMetaData"),parser:{}},exe={Grammar:N(()=>E8r(),"Grammar"),LanguageMetaData:N(()=>O8r,"LanguageMetaData"),parser:{}},txe={Grammar:N(()=>T8r(),"Grammar"),LanguageMetaData:N(()=>B8r,"LanguageMetaData"),parser:{}},rxe={Grammar:N(()=>k8r(),"Grammar"),LanguageMetaData:N(()=>F8r,"LanguageMetaData"),parser:{}},nxe={Grammar:N(()=>C8r(),"Grammar"),LanguageMetaData:N(()=>z8r,"LanguageMetaData"),parser:{}},ixe={Grammar:N(()=>S8r(),"Grammar"),LanguageMetaData:N(()=>G8r,"LanguageMetaData"),parser:{}},axe={Grammar:N(()=>A8r(),"Grammar"),LanguageMetaData:N(()=>W8r,"LanguageMetaData"),parser:{}},oxe={Grammar:N(()=>U8r(),"Grammar"),LanguageMetaData:N(()=>V8r,"LanguageMetaData"),parser:{}},sxe={Grammar:N(()=>I8r(),"Grammar"),LanguageMetaData:N(()=>H8r,"LanguageMetaData"),parser:{}},q8r=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Y8r=/accTitle[\t ]*:([^\n\r]*)/,j8r=/title([\t ][^\n\r]*|)/,X8r={ACC_DESCR:q8r,ACC_TITLE:Y8r,TITLE:j8r},Ns=class extends C2e{static{N(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){let n=X8r[e.name];if(n===void 0)return;let i=n.exec(t);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},qh=class extends Ns{static{N(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},Ki=class extends vX{static{N(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){let n=super.buildKeywordTokens(e,t,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},$8r=class extends Ki{static{N(this,"CommonTokenBuilder")}};});function IX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),exe,UX);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}var K8r,UX,lxe=H(()=>{_i();K8r=class extends Ki{static{N(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},UX={parser:{TokenBuilder:N(()=>new K8r,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")}};N(IX,"createRadarServices")});function lA(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),nxe,RX);return t.ServiceRegistry.register(r),{shared:t,Railroad:r}}var Z8r,hwt,Q8r,RX,cxe=H(()=>{_i();Z8r=class extends Ki{static{N(this,"RailroadTokenBuilder")}constructor(){super(["railroad-beta"])}},hwt=N(e=>{let t=e.slice(1,-1),r="";for(let n=0;nnew Z8r,"TokenBuilder"),ValueConverter:N(()=>new Q8r,"ValueConverter")}};N(lA,"createRailroadServices")});function cA(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),rxe,MX);return t.ServiceRegistry.register(r),{shared:t,RailroadEbnf:r}}var J8r,fwt,eUr,MX,uxe=H(()=>{_i();J8r=class extends Ki{static{N(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},fwt=N(e=>{let t=e.slice(1,-1),r="";for(let n=0;nnew J8r,"TokenBuilder"),ValueConverter:N(()=>new eUr,"ValueConverter")}};N(cA,"createRailroadEbnfServices")});function uA(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),txe,LX);return t.ServiceRegistry.register(r),{shared:t,RailroadAbnf:r}}var tUr,rUr,LX,dxe=H(()=>{_i();tUr=class extends Ki{static{N(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},rUr=class extends Ns{static{N(this,"RailroadAbnfValueConverter")}runConverter(e,t,r){let n=super.runConverter(e,t,r);if(e.name==="TITLE"&&typeof n=="string"){let i=n.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1)}return n}runCustomConverter(e,t,r){if(e.name==="ABNF_STRING")return t.slice(1,-1)}},LX={parser:{TokenBuilder:N(()=>new tUr,"TokenBuilder"),ValueConverter:N(()=>new rUr,"ValueConverter")}};N(uA,"createRailroadAbnfServices")});function dA(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),ixe,DX);return t.ServiceRegistry.register(r),{shared:t,RailroadPeg:r}}var nUr,pwt,iUr,DX,hxe=H(()=>{_i();nUr=class extends Ki{static{N(this,"RailroadPegTokenBuilder")}constructor(){super(["railroad-peg-beta"])}},pwt=N(e=>{let t=e.slice(1,-1),r="";for(let n=0;nnew nUr,"TokenBuilder"),ValueConverter:N(()=>new iUr,"ValueConverter")}};N(dA,"createRailroadPegServices")});function mwt(e){let t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){let n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}function _X(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),axe,NX);return t.ServiceRegistry.register(r),mwt(r),{shared:t,Treemap:r}}var aUr,oUr,sUr,lUr,NX,fxe=H(()=>{_i();aUr=class extends Ki{static{N(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},oUr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,sUr=class extends Ns{static{N(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;let n=oUr.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};N(mwt,"registerValidationChecks");lUr=class{static{N(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(let n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},NX={parser:{TokenBuilder:N(()=>new aUr,"TokenBuilder"),ValueConverter:N(()=>new sUr,"ValueConverter")},validation:{TreemapValidator:N(()=>new lUr,"TreemapValidator")}};N(_X,"createTreemapServices")});function OX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),sxe,PX);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}var cUr,PX,pxe=H(()=>{_i();cUr=class extends Ns{static{N(this,"WardleyValueConverter")}runCustomConverter(e,t,r){if(e.name.toUpperCase()==="LINK_LABEL")return t.substring(1).trim()}},PX={parser:{ValueConverter:N(()=>new cUr,"ValueConverter")}};N(OX,"createWardleyServices")});function FX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),X2e,BX);return t.ServiceRegistry.register(r),{shared:t,Cynefin:r}}var uUr,BX,mxe=H(()=>{_i();uUr=class extends Ki{static{N(this,"CynefinTokenBuilder")}constructor(){super(["cynefin-beta"])}},BX={parser:{TokenBuilder:N(()=>new uUr,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")}};N(FX,"createCynefinServices")});function GX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),K2e,zX);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}var dUr,zX,gxe=H(()=>{_i();dUr=class extends Ki{static{N(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},zX={parser:{TokenBuilder:N(()=>new dUr,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")}};N(GX,"createGitGraphServices")});function VX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),Z2e,WX);return t.ServiceRegistry.register(r),{shared:t,Info:r}}var hUr,WX,yxe=H(()=>{_i();hUr=class extends Ki{static{N(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},WX={parser:{TokenBuilder:N(()=>new hUr,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")}};N(VX,"createInfoServices")});function qX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),Q2e,HX);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}var fUr,HX,vxe=H(()=>{_i();fUr=class extends Ki{static{N(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},HX={parser:{TokenBuilder:N(()=>new fUr,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")}};N(qX,"createPacketServices")});function jX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),J2e,YX);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}var pUr,mUr,YX,bxe=H(()=>{_i();pUr=class extends Ki{static{N(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},mUr=class extends Ns{static{N(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},YX={parser:{TokenBuilder:N(()=>new pUr,"TokenBuilder"),ValueConverter:N(()=>new mUr,"ValueConverter")}};N(jX,"createPieServices")});function $X(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),oxe,XX);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}var gUr,yUr,XX,xxe=H(()=>{_i();gUr=class extends Ns{static{N(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="QUOTED_NAME")return t.substring(1,t.length-1);if(e.name==="BARE_NAME")return t.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return t.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){let n=t.trim();return n.substring(5,n.length-1)}if(e.name==="DESC_ANNOTATION")return t.trim().substring(2).trim()}},yUr=class extends Ki{static{N(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},XX={parser:{TokenBuilder:N(()=>new yUr,"TokenBuilder"),ValueConverter:N(()=>new gUr,"ValueConverter")}};N($X,"createTreeViewServices")});function ZX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),j2e,KX);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}var vUr,bUr,KX,wxe=H(()=>{_i();vUr=class extends Ki{static{N(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},bUr=class extends Ns{static{N(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},KX={parser:{TokenBuilder:N(()=>new vUr,"TokenBuilder"),ValueConverter:N(()=>new bUr,"ValueConverter")}};N(ZX,"createArchitectureServices")});function xwt(e){let t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){let n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}function JX(e=Ni){let t=xn(Ti(e),ji),r=xn(Ei({shared:t}),$2e,QX);return t.ServiceRegistry.register(r),xwt(r),{shared:t,EventModel:r}}var xUr,gwt,ywt,Exe,vwt,bwt,wUr,QX,Txe=H(()=>{_i();xUr=class extends Ki{static{N(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},gwt=new Set(["cmd","command"]),ywt=new Set(["evt","event"]),Exe=new Set(["rmo","readmodel"]),vwt=new Set(["pcr","processor"]),bwt=new Set(["ui"]);N(xwt,"registerValidationChecks");wUr=class{static{N(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(gwt.has(e.modelEntityType)?this.validateSources(e,new Set([...bwt,...vwt]),"command","ui or processor",t):ywt.has(e.modelEntityType)?this.validateSources(e,gwt,"event","command",t):Exe.has(e.modelEntityType)?this.validateSources(e,ywt,"read model","event",t):vwt.has(e.modelEntityType)?this.validateSources(e,Exe,"processor","read model",t):bwt.has(e.modelEntityType)&&this.validateSources(e,Exe,"ui","read model",t))}validateSources(e,t,r,n,i){for(let a of e.sourceFrames){let o=a.ref;o!==void 0&&!t.has(o.modelEntityType)&&i("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},QX={parser:{TokenBuilder:N(()=>new xUr,"TokenBuilder"),ValueConverter:N(()=>new qh,"ValueConverter")},validation:{EventModelingValidator:N(()=>new wUr,"EventModelingValidator")}};N(JX,"createEventModelingServices")});var wwt={};gr(wwt,{InfoModule:()=>WX,createInfoServices:()=>VX});var Ewt=H(()=>{yxe();_i()});var Twt={};gr(Twt,{PacketModule:()=>HX,createPacketServices:()=>qX});var kwt=H(()=>{vxe();_i()});var Cwt={};gr(Cwt,{PieModule:()=>YX,createPieServices:()=>jX});var Swt=H(()=>{bxe();_i()});var Awt={};gr(Awt,{TreeViewModule:()=>XX,createTreeViewServices:()=>$X});var Uwt=H(()=>{xxe();_i()});var Iwt={};gr(Iwt,{ArchitectureModule:()=>KX,createArchitectureServices:()=>ZX});var Rwt=H(()=>{wxe();_i()});var Mwt={};gr(Mwt,{GitGraphModule:()=>zX,createGitGraphServices:()=>GX});var Lwt=H(()=>{gxe();_i()});var Dwt={};gr(Dwt,{EventModelingModule:()=>QX,createEventModelingServices:()=>JX});var Nwt=H(()=>{Txe();_i()});var _wt={};gr(_wt,{RadarModule:()=>UX,createRadarServices:()=>IX});var Pwt=H(()=>{lxe();_i()});var Owt={};gr(Owt,{RailroadModule:()=>RX,createRailroadServices:()=>lA});var Bwt=H(()=>{cxe();_i()});var Fwt={};gr(Fwt,{RailroadEbnfModule:()=>MX,createRailroadEbnfServices:()=>cA});var zwt=H(()=>{uxe();_i()});var Gwt={};gr(Gwt,{RailroadAbnfModule:()=>LX,createRailroadAbnfServices:()=>uA});var Wwt=H(()=>{dxe();_i()});var Vwt={};gr(Vwt,{RailroadPegModule:()=>DX,createRailroadPegServices:()=>dA});var Hwt=H(()=>{hxe();_i()});var qwt={};gr(qwt,{TreemapModule:()=>NX,createTreemapServices:()=>_X});var Ywt=H(()=>{fxe();_i()});var jwt={};gr(jwt,{WardleyModule:()=>PX,createWardleyServices:()=>OX});var Xwt=H(()=>{pxe();_i()});var $wt={};gr($wt,{CynefinModule:()=>BX,createCynefinServices:()=>FX});var Kwt=H(()=>{mxe();_i()});async function Lo(e,t){let r=EUr[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);gc[e]||await r();let i=gc[e].parse(t);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new ov(i);return i.value}var gc,EUr,ov,yc=H(()=>{lxe();cxe();uxe();dxe();hxe();fxe();pxe();mxe();gxe();yxe();vxe();bxe();xxe();wxe();Txe();_i();gc={},EUr={info:N(async()=>{let{createInfoServices:e}=await Promise.resolve().then(()=>(Ewt(),wwt)),t=e().Info.parser.LangiumParser;gc.info=t},"info"),packet:N(async()=>{let{createPacketServices:e}=await Promise.resolve().then(()=>(kwt(),Twt)),t=e().Packet.parser.LangiumParser;gc.packet=t},"packet"),pie:N(async()=>{let{createPieServices:e}=await Promise.resolve().then(()=>(Swt(),Cwt)),t=e().Pie.parser.LangiumParser;gc.pie=t},"pie"),treeView:N(async()=>{let{createTreeViewServices:e}=await Promise.resolve().then(()=>(Uwt(),Awt)),t=e().TreeView.parser.LangiumParser;gc.treeView=t},"treeView"),architecture:N(async()=>{let{createArchitectureServices:e}=await Promise.resolve().then(()=>(Rwt(),Iwt)),t=e().Architecture.parser.LangiumParser;gc.architecture=t},"architecture"),gitGraph:N(async()=>{let{createGitGraphServices:e}=await Promise.resolve().then(()=>(Lwt(),Mwt)),t=e().GitGraph.parser.LangiumParser;gc.gitGraph=t},"gitGraph"),eventmodeling:N(async()=>{let{createEventModelingServices:e}=await Promise.resolve().then(()=>(Nwt(),Dwt)),t=e().EventModel.parser.LangiumParser;gc.eventmodeling=t},"eventmodeling"),radar:N(async()=>{let{createRadarServices:e}=await Promise.resolve().then(()=>(Pwt(),_wt)),t=e().Radar.parser.LangiumParser;gc.radar=t},"radar"),railroad:N(async()=>{let{createRailroadServices:e}=await Promise.resolve().then(()=>(Bwt(),Owt)),t=e().Railroad.parser.LangiumParser;gc.railroad=t},"railroad"),railroadEbnf:N(async()=>{let{createRailroadEbnfServices:e}=await Promise.resolve().then(()=>(zwt(),Fwt)),t=e().RailroadEbnf.parser.LangiumParser;gc.railroadEbnf=t},"railroadEbnf"),railroadAbnf:N(async()=>{let{createRailroadAbnfServices:e}=await Promise.resolve().then(()=>(Wwt(),Gwt)),t=e().RailroadAbnf.parser.LangiumParser;gc.railroadAbnf=t},"railroadAbnf"),railroadPeg:N(async()=>{let{createRailroadPegServices:e}=await Promise.resolve().then(()=>(Hwt(),Vwt)),t=e().RailroadPeg.parser.LangiumParser;gc.railroadPeg=t},"railroadPeg"),treemap:N(async()=>{let{createTreemapServices:e}=await Promise.resolve().then(()=>(Ywt(),qwt)),t=e().Treemap.parser.LangiumParser;gc.treemap=t},"treemap"),wardley:N(async()=>{let{createWardleyServices:e}=await Promise.resolve().then(()=>(Xwt(),jwt)),t=e().Wardley.parser.LangiumParser;gc.wardley=t},"wardley"),cynefin:N(async()=>{let{createCynefinServices:e}=await Promise.resolve().then(()=>(Kwt(),$wt)),t=e().Cynefin.parser.LangiumParser;gc.cynefin=t},"cynefin")};N(Lo,"parse");ov=class extends Error{constructor(e){let t=e.lexerErrors.map(n=>{let i=n.line!==void 0&&!isNaN(n.line)?n.line:"?",a=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${i}, column ${a}: ${n.message}`}).join(` -`),r=e.parserErrors.map(n=>{let i=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",a=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${i}, column ${a}: ${n.message}`}).join(` -`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{N(this,"MermaidParseError")}}});var o5t={};gr(o5t,{diagram:()=>T9r});function r$(){return Zce({length:7})}function Qwt(e,t){let r=Object.create(null);return e.reduce((n,i)=>{let a=t(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}function kxe(e,t,r){let n=e.indexOf(t);n===-1?e.push(r):e.splice(n,1,r)}function Sxe(e){let t=e.reduce((i,a)=>i.seq>a.seq?i:a,e[0]),r="";e.forEach(function(i){i===t?r+=" *":r+=" |"});let n=[r,t.id,t.seq];for(let i in lr.records.branches)lr.records.branches.get(i)===t.id&&n.push(i);if(ye.debug(n.join(" ")),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let i=lr.records.commits.get(t.parents[0]);kxe(e,t,i),t.parents[1]&&e.push(lr.records.commits.get(t.parents[1]))}else{if(t.parents.length==0)return;if(t.parents[0]){let i=lr.records.commits.get(t.parents[0]);kxe(e,t,i)}}e=Qwt(e,i=>i.id),Sxe(e)}var ha,TUr,v6,lr,kUr,CUr,SUr,AUr,UUr,IUr,RUr,Jwt,MUr,LUr,DUr,NUr,_Ur,e5t,PUr,OUr,BUr,t5t,FUr,zUr,GUr,WUr,VUr,HUr,qUr,YUr,Yx,jx,Kg,sv,g6,n$,Cxe,Axe,jUr,y6,Yd,jd,e$,nD,t$,lv,ei,XUr,r5t,n5t,$Ur,KUr,ZUr,QUr,JUr,e9r,t9r,r9r,n9r,i9r,a9r,o9r,Zwt,s9r,iD,l9r,c9r,u9r,d9r,h9r,f9r,i5t,a5t,p9r,m9r,g9r,y9r,v9r,b9r,x9r,w9r,E9r,T9r,s5t=H(()=>{Nq();_u();Vn();Wr();Gr();xr();yc();_n();ha={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},TUr=Xr.gitGraph,v6=k(()=>Kn({...TUr,...Kt().gitGraph}),"getConfig"),lr=new mS(()=>{let e=v6(),t=e.mainBranchName,r=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:r}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});k(r$,"getID");k(Qwt,"uniqBy");kUr=k(function(e){lr.records.direction=e},"setDirection"),CUr=k(function(e){ye.debug("options str",e),e=e?.trim(),e=e||"{}";try{lr.records.options=JSON.parse(e)}catch(t){ye.error("error while parsing gitGraph options",t.message)}},"setOptions"),SUr=k(function(){return lr.records.options},"getOptions"),AUr=k(function(e){let t=e.msg,r=e.id,n=e.type,i=e.tags;ye.info("commit",t,r,n,i),ye.debug("Entering commit:",t,r,n,i);let a=v6();r=Lt.sanitizeText(r,a),t=Lt.sanitizeText(t,a),i=i?.map(s=>Lt.sanitizeText(s,a));let o={id:r||lr.records.seq+"-"+r$(),message:t,seq:lr.records.seq++,type:n??ha.NORMAL,tags:i??[],parents:lr.records.head==null?[]:[lr.records.head.id],branch:lr.records.currBranch};lr.records.head=o,ye.info("main branch",a.mainBranchName),lr.records.commits.has(o.id)&&ye.warn(`Commit ID ${o.id} already exists`),lr.records.commits.set(o.id,o),lr.records.branches.set(lr.records.currBranch,o.id),ye.debug("in pushCommit "+o.id)},"commit"),UUr=k(function(e){let t=e.name,r=e.order;if(t=Lt.sanitizeText(t,v6()),lr.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}")`);lr.records.branches.set(t,lr.records.head!=null?lr.records.head.id:null),lr.records.branchConfig.set(t,{name:t,order:r}),Jwt(t),ye.debug("in createBranch")},"branch"),IUr=k(e=>{let t=e.branch,r=e.id,n=e.type,i=e.tags,a=v6();t=Lt.sanitizeText(t,a),r&&(r=Lt.sanitizeText(r,a));let o=lr.records.branches.get(lr.records.currBranch),s=lr.records.branches.get(t),l=o?lr.records.commits.get(o):void 0,u=s?lr.records.commits.get(s):void 0;if(l&&u&&l.branch===t)throw new Error(`Cannot merge branch '${t}' into itself.`);if(lr.records.currBranch===t){let f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},f}if(l===void 0||!l){let f=new Error(`Incorrect usage of "merge". Current branch (${lr.records.currBranch})has no commits`);throw f.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]},f}if(!lr.records.branches.has(t)){let f=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw f.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},f}if(u===void 0||!u){let f=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw f.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']},f}if(l===u){let f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},f}if(r&&lr.records.commits.has(r)){let f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${t} ${r} ${n} ${i?.join(" ")}`,token:`merge ${t} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${t} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},f}let d=s||"",h={id:r||`${lr.records.seq}-${r$()}`,message:`merged branch ${t} into ${lr.records.currBranch}`,seq:lr.records.seq++,parents:lr.records.head==null?[]:[lr.records.head.id,d],branch:lr.records.currBranch,type:ha.MERGE,customType:n,customId:!!r,tags:i??[]};lr.records.head=h,lr.records.commits.set(h.id,h),lr.records.branches.set(lr.records.currBranch,h.id),ye.debug(lr.records.branches),ye.debug("in mergeBranch")},"merge"),RUr=k(function(e){let t=e.id,r=e.targetId,n=e.tags,i=e.parent;ye.debug("Entering cherryPick:",t,r,n);let a=v6();if(t=Lt.sanitizeText(t,a),r=Lt.sanitizeText(r,a),n=n?.map(l=>Lt.sanitizeText(l,a)),i=Lt.sanitizeText(i,a),!t||!lr.records.commits.has(t)){let l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:["cherry-pick abc"]},l}let o=lr.records.commits.get(t);if(o===void 0||!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.");let s=o.branch;if(o.type===ha.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(!r||!lr.records.commits.has(r)){if(s===lr.records.currBranch){let h=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw h.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:["cherry-pick abc"]},h}let l=lr.records.branches.get(lr.records.currBranch);if(l===void 0||!l){let h=new Error(`Incorrect usage of "cherry-pick". Current branch (${lr.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:["cherry-pick abc"]},h}let u=lr.records.commits.get(l);if(u===void 0||!u){let h=new Error(`Incorrect usage of "cherry-pick". Current branch (${lr.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:["cherry-pick abc"]},h}let d={id:lr.records.seq+"-"+r$(),message:`cherry-picked ${o?.message} into ${lr.records.currBranch}`,seq:lr.records.seq++,parents:lr.records.head==null?[]:[lr.records.head.id,o.id],branch:lr.records.currBranch,type:ha.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===ha.MERGE?`|parent:${i}`:""}`]};lr.records.head=d,lr.records.commits.set(d.id,d),lr.records.branches.set(lr.records.currBranch,d.id),ye.debug(lr.records.branches),ye.debug("in cherryPick")}},"cherryPick"),Jwt=k(function(e){if(e=Lt.sanitizeText(e,v6()),lr.records.branches.has(e)){lr.records.currBranch=e;let t=lr.records.branches.get(lr.records.currBranch);t===void 0||!t?lr.records.head=null:lr.records.head=lr.records.commits.get(t)??null}else{let 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}},"checkout");k(kxe,"upsert");k(Sxe,"prettyPrintCommitHistory");MUr=k(function(){ye.debug(lr.records.commits);let e=e5t()[0];Sxe([e])},"prettyPrint"),LUr=k(function(){lr.reset(),$r()},"clear"),DUr=k(function(){return[...lr.records.branchConfig.values()].map((t,r)=>t.order!==null&&t.order!==void 0?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),NUr=k(function(){return lr.records.branches},"getBranches"),_Ur=k(function(){return lr.records.commits},"getCommits"),e5t=k(function(){let e=[...lr.records.commits.values()];return e.forEach(function(t){ye.debug(t.id)}),e.sort((t,r)=>t.seq-r.seq),e},"getCommitsArray"),PUr=k(function(){return lr.records.currBranch},"getCurrentBranch"),OUr=k(function(){return lr.records.direction},"getDirection"),BUr=k(function(){return lr.records.head},"getHead"),t5t={commitType:ha,getConfig:v6,setDirection:kUr,setOptions:CUr,getOptions:SUr,commit:AUr,branch:UUr,merge:IUr,cherryPick:RUr,checkout:Jwt,prettyPrint:MUr,clear:LUr,getBranchesAsObjArray:DUr,getBranches:NUr,getCommits:_Ur,getCommitsArray:e5t,getCurrentBranch:PUr,getDirection:OUr,getHead:BUr,setAccTitle:sn,getAccTitle:pn,getAccDescription:gn,setAccDescription:mn,setDiagramTitle:Sn,getDiagramTitle:yn},FUr=k((e,t)=>{ra(e,t),e.dir&&t.setDirection(e.dir);for(let r of e.statements)zUr(r,t)},"populate"),zUr=k((e,t)=>{let n={Commit:k(i=>t.commit(GUr(i)),"Commit"),Branch:k(i=>t.branch(WUr(i)),"Branch"),Merge:k(i=>t.merge(VUr(i)),"Merge"),Checkout:k(i=>t.checkout(HUr(i)),"Checkout"),CherryPicking:k(i=>t.cherryPick(qUr(i)),"CherryPicking")}[e.$type];n?n(e):ye.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),GUr=k(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?ha[e.type]:ha.NORMAL,tags:e.tags??void 0}),"parseCommit"),WUr=k(e=>({name:e.name,order:e.order??0}),"parseBranch"),VUr=k(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?ha[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),HUr=k(e=>e.branch,"parseCheckout"),qUr=k(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),YUr={parse:k(async e=>{let t=await Lo("gitGraph",e);ye.debug(t),FUr(t,t5t)},"parse")},Yx=10,jx=40,Kg=4,sv=2,g6=8,n$=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Cxe=12,Axe=new Set(["redux-color","redux-dark-color"]),jUr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),y6=k((e,t,r=!1)=>r&&e>0?(e-1)%(t-1)+1:e%t,"calcColorIndex"),Yd=new Map,jd=new Map,e$=30,nD=new Map,t$=[],lv=0,ei="LR",XUr=k(()=>{Yd.clear(),jd.clear(),nD.clear(),lv=0,t$=[],ei="LR"},"clear"),r5t=k(e=>{let t=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(n=>{let i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),t.appendChild(i)}),t},"drawText"),n5t=k(e=>{let t,r,n;return ei==="BT"?(r=k((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=k((i,a)=>i>=a,"comparisonFunc"),n=0),e.forEach(i=>{let a=ei==="TB"||ei=="BT"?jd.get(i)?.y:jd.get(i)?.x;a!==void 0&&r(a,n)&&(t=i,n=a)}),t},"findClosestParent"),$Ur=k(e=>{let t="",r=1/0;return e.forEach(n=>{let i=jd.get(n).y;i<=r&&(t=n,r=i)}),t||void 0},"findClosestParentBT"),KUr=k((e,t,r)=>{let n=r,i=r,a=[];e.forEach(o=>{let s=t.get(o);if(!s)throw new Error(`Commit not found for key ${o}`);s.parents.length?(n=QUr(s),i=Math.max(n,i)):a.push(s),JUr(s,n)}),n=i,a.forEach(o=>{e9r(o,n,r)}),e.forEach(o=>{let s=t.get(o);if(s?.parents.length){let l=$Ur(s.parents);n=jd.get(l).y-jx,n<=i&&(i=n);let u=Yd.get(s.branch).pos,d=n-Yx;jd.set(s.id,{x:u,y:d})}})},"setParallelBTPos"),ZUr=k(e=>{let t=n5t(e.parents.filter(n=>n!==null));if(!t)throw new Error(`Closest parent not found for commit ${e.id}`);let r=jd.get(t)?.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return r},"findClosestParentPos"),QUr=k(e=>ZUr(e)+jx,"calculateCommitPosition"),JUr=k((e,t)=>{let r=Yd.get(e.branch);if(!r)throw new Error(`Branch not found for commit ${e.id}`);let n=r.pos,i=t+Yx;return jd.set(e.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),e9r=k((e,t,r)=>{let n=Yd.get(e.branch);if(!n)throw new Error(`Branch not found for commit ${e.id}`);let i=t+r,a=n.pos;jd.set(e.id,{x:a,y:i})},"setRootPosition"),t9r=k((e,t,r,n,i,a)=>{let{theme:o}=je(),s=n$.has(o??""),l=Axe.has(o??""),u=jUr.has(o??"");if(a===ha.HIGHLIGHT)e.append("rect").attr("x",r.x-10+(s?3:0)).attr("y",r.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${t.id} commit-highlight${y6(i,g6,l)} ${n}-outer`),e.append("rect").attr("x",r.x-6+(s?2:0)).attr("y",r.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${t.id} commit${y6(i,g6,l)} ${n}-inner`);else if(a===ha.CHERRY_PICK)e.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",s?7:10).attr("class",`commit ${t.id} ${n}`),e.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",s?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${t.id} ${n}`),e.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",s?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${t.id} ${n}`),e.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${t.id} ${n}`),e.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${t.id} ${n}`);else{let d=e.append("circle");if(d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",s?7:10),d.attr("class",`commit ${t.id} commit${y6(i,g6,l)}`),a===ha.MERGE){let h=e.append("circle");h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",s?5:6),h.attr("class",`commit ${n} ${t.id} commit${y6(i,g6,l)}`)}if(a===ha.REVERSE){let h=e.append("path"),f=s?4:5;h.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${t.id} commit${y6(i,g6,l)}`)}}},"drawCommitBullet"),r9r=k((e,t,r,n,i)=>{if(t.type!==ha.CHERRY_PICK&&(t.customId&&t.type===ha.MERGE||t.type!==ha.MERGE)&&i.showCommitLabel){let a=e.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),s=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(t.id),l=s.node()?.getBBox();if(l&&(o.attr("x",r.posWithOffset-l.width/2-sv).attr("y",r.y+13.5).attr("width",l.width+2*sv).attr("height",l.height+2*sv),ei==="TB"||ei==="BT"?(o.attr("x",r.x-(l.width+4*Kg+5)).attr("y",r.y-12),s.attr("x",r.x-(l.width+4*Kg)).attr("y",r.y+l.height-12)):s.attr("x",r.posWithOffset-l.width/2),i.rotateCommitLabel))if(ei==="TB"||ei==="BT")s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{let u=-7.5-(l.width+10)/25*9.5,d=10+l.width/25*8.5;a.attr("transform","translate("+u+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),n9r=k((e,t,r,n)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let l of t.tags.reverse()){let u=e.insert("polygon"),d=e.append("circle"),h=e.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(l),f=h.node()?.getBBox();if(!f)throw new Error("Tag bbox not found");a=Math.max(a,f.width),o=Math.max(o,f.height),h.attr("x",r.posWithOffset-f.width/2),s.push({tag:h,hole:d,rect:u,yOffset:i}),i+=20}for(let{tag:l,hole:u,rect:d,yOffset:h}of s){let f=o/2,p=r.y-19.2-h;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-a/2-Kg/2},${p+sv} - ${n-a/2-Kg/2},${p-sv} - ${r.posWithOffset-a/2-Kg},${p-f-sv} - ${r.posWithOffset+a/2+Kg},${p-f-sv} - ${r.posWithOffset+a/2+Kg},${p+f+sv} - ${r.posWithOffset-a/2-Kg},${p+f+sv}`),u.attr("cy",p).attr("cx",n-a/2+Kg/2).attr("r",1.5).attr("class","tag-hole"),ei==="TB"||ei==="BT"){let m=n+h;d.attr("class","tag-label-bkg").attr("points",` - ${r.x},${m+2} - ${r.x},${m-2} - ${r.x+Yx},${m-f-2} - ${r.x+Yx+a+4},${m-f-2} - ${r.x+Yx+a+4},${m+f+2} - ${r.x+Yx},${m+f+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("cx",r.x+Kg/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),l.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),i9r=k(e=>{switch(e.customType??e.type){case ha.NORMAL:return"commit-normal";case ha.REVERSE:return"commit-reverse";case ha.HIGHLIGHT:return"commit-highlight";case ha.MERGE:return"commit-merge";case ha.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),a9r=k((e,t,r,n)=>{let i={x:0,y:0};if(e.parents.length>0){let a=n5t(e.parents);if(a){let o=n.get(a)??i;return t==="TB"?o.y+jx:t==="BT"?(n.get(e.id)??i).y-jx:o.x+jx}}else return t==="TB"?e$:t==="BT"?(n.get(e.id)??i).y-jx:0;return 0},"calculatePosition"),o9r=k((e,t,r)=>{let n=ei==="BT"&&r?t:t+Yx,i=Yd.get(e.branch)?.pos,a=ei==="TB"||ei==="BT"?Yd.get(e.branch)?.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${e.id}`);let o=n$.has(je().theme??""),s=ei==="TB"||ei==="BT"?n:i+(o?Cxe/2+1:-2);return{x:a,y:s,posWithOffset:n}},"getCommitPosition"),Zwt=k((e,t,r,n)=>{let i=e.append("g").attr("class","commit-bullets"),a=e.append("g").attr("class","commit-labels"),o=ei==="TB"||ei==="BT"?e$:0,s=[...t.keys()],l=n.parallelCommits??!1,u=k((h,f)=>{let p=t.get(h)?.seq,m=t.get(f)?.seq;return p!==void 0&&m!==void 0?p-m:0},"sortKeys"),d=s.sort(u);ei==="BT"&&(l&&KUr(d,t,o),d=d.reverse()),d.forEach(h=>{let f=t.get(h);if(!f)throw new Error(`Commit not found for key ${h}`);l&&(o=a9r(f,ei,o,jd));let p=o9r(f,o,l);if(r){let m=i9r(f),g=f.customType??f.type,y=Yd.get(f.branch)?.index??0;t9r(i,f,p,m,y,g),r9r(a,f,p,o,n),n9r(a,f,p,o)}ei==="TB"||ei==="BT"?jd.set(f.id,{x:p.x,y:p.posWithOffset}):jd.set(f.id,{x:p.posWithOffset,y:p.y}),o=ei==="BT"&&l?o+jx:o+jx+Yx,o>lv&&(lv=o)})},"drawCommits"),s9r=k((e,t,r,n,i)=>{let o=(ei==="TB"||ei==="BT"?r.xu.branch===o,"isOnBranchToGetCurve"),l=k(u=>u.seq>e.seq&&u.seql(u)&&s(u))},"shouldRerouteArrow"),iD=k((e,t,r=0)=>{let n=e+Math.abs(e-t)/2;if(r>5)return n;if(t$.every(o=>Math.abs(o-n)>=10))return t$.push(n),n;let a=Math.abs(e-t);return iD(e,t-a/5,r+1)},"findLane"),l9r=k((e,t,r,n)=>{let{theme:i}=je(),a=Axe.has(i??""),o=jd.get(t.id),s=jd.get(r.id);if(o===void 0||s===void 0)throw new Error(`Commit positions not found for commits ${t.id} and ${r.id}`);let l=s9r(t,r,o,s,n),u="",d="",h=0,f=0,p=Yd.get(r.branch)?.index;r.type===ha.MERGE&&t.id!==r.parents[0]&&(p=Yd.get(t.branch)?.index);let m;if(l){u="A 10 10, 0, 0, 0,",d="A 10 10, 0, 0, 1,",h=10,f=10;let g=o.ys.x&&(u="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,f=20,r.type===ha.MERGE&&t.id!==r.parents[0]?m=`M ${o.x} ${o.y} L ${o.x} ${s.y-h} ${d} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:m=`M ${o.x} ${o.y} L ${s.x+h} ${o.y} ${u} ${s.x} ${o.y+f} L ${s.x} ${s.y}`),o.x===s.x&&(m=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):ei==="BT"?(o.xs.x&&(u="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,f=20,r.type===ha.MERGE&&t.id!==r.parents[0]?m=`M ${o.x} ${o.y} L ${o.x} ${s.y+h} ${u} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:m=`M ${o.x} ${o.y} L ${s.x+h} ${o.y} ${d} ${s.x} ${o.y-f} L ${s.x} ${s.y}`),o.x===s.x&&(m=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.ys.y&&(r.type===ha.MERGE&&t.id!==r.parents[0]?m=`M ${o.x} ${o.y} L ${s.x-h} ${o.y} ${u} ${s.x} ${o.y-f} L ${s.x} ${s.y}`:m=`M ${o.x} ${o.y} L ${o.x} ${s.y+h} ${d} ${o.x+f} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(m=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(m===void 0)throw new Error("Line definition not found");e.append("path").attr("d",m).attr("class","arrow arrow"+y6(p,g6,a))},"drawArrow"),c9r=k((e,t)=>{let r=e.append("g").attr("class","commit-arrows");[...t.keys()].forEach(n=>{let i=t.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{l9r(r,t.get(a),i,t)})})},"drawArrows"),u9r=k((e,t,r,n)=>{let{look:i,theme:a,themeVariables:o}=je(),{dropShadow:s,THEME_COLOR_LIMIT:l}=o,u=n$.has(a??""),d=Axe.has(a??""),h=e.append("g");t.forEach((f,p)=>{let m=y6(p,u?l:g6,d),g=Yd.get(f.name)?.pos;if(g===void 0)throw new Error(`Position not found for branch ${f.name}`);let y=ei==="TB"||ei==="BT"?g:u?g+Cxe/2+1:g-2,v=h.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",lv),v.attr("y2",y),v.attr("class","branch branch"+m),ei==="TB"?(v.attr("y1",e$),v.attr("x1",g),v.attr("y2",lv),v.attr("x2",g)):ei==="BT"&&(v.attr("y1",lv),v.attr("x1",g),v.attr("y2",e$),v.attr("x2",g)),t$.push(y);let b=f.name,x=r5t(b),E=h.insert("rect"),T=h.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+m);T.node().appendChild(x);let C=x.getBBox(),S=u?0:4,R=u?16:0,U=u?Cxe:0;i==="neo"&&E.attr("data-look","neo"),E.attr("class","branchLabelBkg label"+m).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:s}`:"").attr("rx",S).attr("ry",S).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+R).attr("height",C.height+4+U),T.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+R/2)+", "+(y-C.height/2-2)+")"),ei==="TB"?(E.attr("x",g-C.width/2-10).attr("y",0),T.attr("transform","translate("+(g-C.width/2-5)+", 0)"),u&&(E.attr("transform",`translate(${-R/2-3}, ${-U-10})`),T.attr("transform","translate("+(g-C.width/2-5)+", "+(-U*2+7)+")"))):ei==="BT"?(E.attr("x",g-C.width/2-10).attr("y",lv),T.attr("transform","translate("+(g-C.width/2-5)+", "+lv+")"),u&&(E.attr("transform",`translate(${-R/2-3}, ${U+10})`),T.attr("transform","translate("+(g-C.width/2-5)+", "+(lv+U*2+4)+")"))):E.attr("transform","translate(-19, "+(y-12-U/2)+")")})},"drawBranches"),d9r=k(function(e,t,r,n,i){return Yd.set(e,{pos:t,index:r}),t+=50+(i?40:0)+(ei==="TB"||ei==="BT"?n.width/2:0),t},"setBranchPosition"),h9r=k(function(e,t,r,n){XUr(),ye.debug("in gitgraph renderer",e+` -`,"id:",t,r);let i=n.db;if(!i.getConfig){ye.error("getConfig method is not available on db");return}let a=i.getConfig(),o=a.rotateCommitLabel??!1;nD=i.getCommits();let s=i.getBranchesAsObjArray();ei=i.getDirection();let l=xt(`[id="${t}"]`),{look:u,theme:d,themeVariables:h}=je(),{useGradient:f,gradientStart:p,gradientStop:m,filterColor:g}=h;if(f){let v=l.append("defs").append("linearGradient").attr("id",t+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}u==="neo"&&n$.has(d??"")&&l.append("defs").append("filter").attr("id",t+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",g);let y=0;s.forEach((v,b)=>{let x=r5t(v.name),E=l.append("g"),w=E.insert("g").attr("class","branchLabel"),T=w.insert("g").attr("class","label branch-label");T.node()?.appendChild(x);let C=x.getBBox();y=d9r(v.name,y,b,C,o),T.remove(),w.remove(),E.remove()}),Zwt(l,nD,!1,a),a.showBranches&&u9r(l,s,a,t),c9r(l,nD),Zwt(l,nD,!0,a),Nr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),G9(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),f9r={draw:h9r},i5t=8,a5t=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),p9r=new Set(["redux-color","redux-dark-color"]),m9r=new Set(["neo","neo-dark"]),g9r=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),y9r=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),v9r=k(e=>{let{svgId:t}=e,r="";if(e.useGradient&&t)for(let n=0;n{let t=Kt(),{theme:r,themeVariables:n}=t,{borderColorArray:i}=n,a=a5t.has(r);if(m9r.has(r)){let o="";for(let s=0;s`${Array.from({length:e.THEME_COLOR_LIMIT},(t,r)=>r).map(t=>{let r=t%i5t;return` - .branch-label${t} { fill: ${e["gitBranchLabel"+r]}; } - .commit${t} { stroke: ${e["git"+r]}; fill: ${e["git"+r]}; } - .commit-highlight${t} { stroke: ${e["gitInv"+r]}; fill: ${e["gitInv"+r]}; } - .label${t} { fill: ${e["git"+r]}; } - .arrow${t} { stroke: ${e["git"+r]}; } - `}).join(` -`)}`,"normalTheme"),w9r=k(e=>{let t=Kt(),{theme:r}=t,n=y9r.has(r);return` - .commit-id, - .commit-msg, - .branch-label { - fill: lightgrey; - color: lightgrey; - font-family: 'trebuchet ms', verdana, arial, sans-serif; - font-family: var(--mermaid-font-family); - } - - ${n?b9r(e):x9r(e)} - - .branch { - stroke-width: ${e.strokeWidth}; - stroke: ${e.commitLineColor??e.lineColor}; - stroke-dasharray: ${n?"4 2":"2"}; - } - .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n?e.nodeBorder:e.commitLabelColor}; ${n?`font-weight:${e.noteFontWeight};`:""}} - .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n?"transparent":e.commitLabelBackground}; opacity: ${n?"":.5}; } - .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} - .tag-label-bkg { fill: ${n?e.mainBkg:e.tagLabelBackground}; stroke: ${n?e.nodeBorder:e.tagLabelBorder}; ${n?`filter:${e.dropShadow}`:""} } - .tag-hole { fill: ${e.textColor}; } - - .commit-merge { - stroke: ${n?e.mainBkg:e.primaryColor}; - fill: ${n?e.mainBkg:e.primaryColor}; - } - .commit-reverse { - stroke: ${n?e.mainBkg:e.primaryColor}; - fill: ${n?e.mainBkg:e.primaryColor}; - stroke-width: ${n?e.strokeWidth:3}; - } - .commit-highlight-outer { - } - .commit-highlight-inner { - stroke: ${n?e.mainBkg:e.primaryColor}; - fill: ${n?e.mainBkg:e.primaryColor}; - } - - .arrow { - /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${a5t.has(r)?e.strokeWidth:8}; - stroke-linecap: round; - fill: none - } - .gitTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } -`},"getStyles"),E9r=w9r,T9r={parser:YUr,db:t5t,renderer:f9r,styles:E9r}});var l5t=Bn((Uxe,Ixe)=>{(function(e,t){typeof Uxe=="object"&&typeof Ixe<"u"?Ixe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_isoWeek=t()})(Uxe,(function(){"use strict";var e="day";return function(t,r,n){var i=function(s){return s.add(4-s.isoWeekday(),e)},a=r.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(s){if(!this.$utils().u(s))return this.add(7*(s-this.isoWeek()),e);var l,u,d,h,f=i(this),p=(l=this.isoWeekYear(),u=this.$u,d=(u?n.utc:n)().year(l).startOf("year"),h=4-d.isoWeekday(),d.isoWeekday()>4&&(h+=7),d.add(h,e));return f.diff(p,"week")+1},a.isoWeekday=function(s){return this.$utils().u(s)?this.day()||7:this.day(this.day()%7?s:s-7)};var o=a.startOf;a.startOf=function(s,l){var u=this.$utils(),d=!!u.u(l)||l;return u.p(s)==="isoweek"?d?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):o.bind(this)(s,l)}}}))});var c5t=Bn((Rxe,Mxe)=>{(function(e,t){typeof Rxe=="object"&&typeof Mxe<"u"?Mxe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})(Rxe,(function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(m){return(m=+m)+(m>68?1900:2e3)},l=function(m){return function(g){this[m]=+g}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=(function(g){if(!g||g==="Z")return 0;var y=g.match(/([+-]|\d\d)/g),v=60*y[1]+(+y[2]||0);return v===0?0:y[0]==="+"?-v:v})(m)}],d=function(m){var g=o[m];return g&&(g.indexOf?g:g.s.concat(g.f))},h=function(m,g){var y,v=o.meridiem;if(v){for(var b=1;b<=24;b+=1)if(m.indexOf(v(b,0,g))>-1){y=b>12;break}}else y=m===(g?"pm":"PM");return y},f={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],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:[n,l("day")],Do:[a,function(m){var g=o.ordinal,y=m.match(/\d+/);if(this.day=y[0],g)for(var v=1;v<=31;v+=1)g(v).replace(/\[|\]/g,"")===m&&(this.day=v)}],w:[i,l("week")],ww:[n,l("week")],M:[i,l("month")],MM:[n,l("month")],MMM:[a,function(m){var g=d("months"),y=(d("monthsShort")||g.map((function(v){return v.slice(0,3)}))).indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(m){var g=d("months").indexOf(m)+1;if(g<1)throw new Error;this.month=g%12||g}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(m){this.year=s(m)}],YYYY:[/\d{4}/,l("year")],Z:u,ZZ:u};function p(m){var g,y;g=m,y=o&&o.formats;for(var v=(m=g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(S,R,U){var L=U&&U.toUpperCase();return R||y[U]||e[U]||y[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(I,A,P){return A||P.slice(1)}))}))).match(t),b=v.length,x=0;x-1)return new Date((M==="X"?1e3:1)*D);var B=p(M)(D),F=B.year,G=B.month,z=B.day,V=B.hours,$=B.minutes,Z=B.seconds,re=B.milliseconds,Q=B.zone,ge=B.week,ie=new Date,pe=z||(F||G?1:ie.getDate()),ue=F||ie.getFullYear(),fe=0;F&&!G||(fe=G>0?G-1:ie.getMonth());var Me,Ce=V||0,Ye=$||0,Ze=Z||0,Qe=re||0;return Q?new Date(Date.UTC(ue,fe,pe,Ce,Ye,Ze,Qe+60*Q.offset*1e3)):O?new Date(Date.UTC(ue,fe,pe,Ce,Ye,Ze,Qe)):(Me=new Date(ue,fe,pe,Ce,Ye,Ze,Qe),ge&&(Me=_(Me).week(ge).toDate()),Me)}catch{return new Date("")}})(E,C,w,y),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),U&&E!=this.format(C)&&(this.$d=new Date("")),o={}}else if(C instanceof Array)for(var I=C.length,A=1;A<=I;A+=1){T[1]=C[A-1];var P=y.apply(this,T);if(P.isValid()){this.$d=P.$d,this.$L=P.$L,this.init();break}A===I&&(this.$d=new Date(""))}else b.call(this,x)}}}))});var u5t=Bn((Lxe,Dxe)=>{(function(e,t){typeof Lxe=="object"&&typeof Dxe<"u"?Dxe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_advancedFormat=t()})(Lxe,(function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(i){var a=this,o=this.$locale();if(!this.isValid())return n.bind(this)(i);var s=this.$utils(),l=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(u){switch(u){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return o.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return o.ordinal(a.week(),"W");case"w":case"ww":return s.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return s.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return s.s(String(a.$H===0?24:a.$H),u==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return u}}));return n.bind(this)(l)}}}))});var d5t=Bn((Nxe,_xe)=>{(function(e,t){typeof Nxe=="object"&&typeof _xe<"u"?_xe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_duration=t()})(Nxe,(function(){"use strict";var e,t,r=1e3,n=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,d={years:o,months:s,days:a,hours:i,minutes:n,seconds:r,milliseconds:1,weeks:6048e5},h=function(E){return E instanceof b},f=function(E,w,T){return new b(E,T,w.$l)},p=function(E){return t.p(E)+"s"},m=function(E){return E<0},g=function(E){return m(E)?Math.ceil(E):Math.floor(E)},y=function(E){return Math.abs(E)},v=function(E,w){return E?m(E)?{negative:!0,format:""+y(E)+w}:{negative:!1,format:""+E+w}:{negative:!1,format:""}},b=(function(){function E(T,C,S){var R=this;if(this.$d={},this.$l=S,T===void 0&&(this.$ms=0,this.parseFromMilliseconds()),C)return f(T*d[p(C)],this);if(typeof T=="number")return this.$ms=T,this.parseFromMilliseconds(),this;if(typeof T=="object")return Object.keys(T).forEach((function(I){R.$d[p(I)]=T[I]})),this.calMilliseconds(),this;if(typeof T=="string"){var U=T.match(l);if(U){var L=U.slice(2).map((function(I){return I!=null?Number(I):0}));return this.$d.years=L[0],this.$d.months=L[1],this.$d.weeks=L[2],this.$d.days=L[3],this.$d.hours=L[4],this.$d.minutes=L[5],this.$d.seconds=L[6],this.calMilliseconds(),this}}return this}var w=E.prototype;return w.calMilliseconds=function(){var T=this;this.$ms=Object.keys(this.$d).reduce((function(C,S){return C+(T.$d[S]||0)*d[S]}),0)},w.parseFromMilliseconds=function(){var T=this.$ms;this.$d.years=g(T/o),T%=o,this.$d.months=g(T/s),T%=s,this.$d.days=g(T/a),T%=a,this.$d.hours=g(T/i),T%=i,this.$d.minutes=g(T/n),T%=n,this.$d.seconds=g(T/r),T%=r,this.$d.milliseconds=T},w.toISOString=function(){var T=v(this.$d.years,"Y"),C=v(this.$d.months,"M"),S=+this.$d.days||0;this.$d.weeks&&(S+=7*this.$d.weeks);var R=v(S,"D"),U=v(this.$d.hours,"H"),L=v(this.$d.minutes,"M"),I=this.$d.seconds||0;this.$d.milliseconds&&(I+=this.$d.milliseconds/1e3,I=Math.round(1e3*I)/1e3);var A=v(I,"S"),P=T.negative||C.negative||R.negative||U.negative||L.negative||A.negative,D=U.format||L.format||A.format?"T":"",M=(P?"-":"")+"P"+T.format+C.format+R.format+D+U.format+L.format+A.format;return M==="P"||M==="-P"?"P0D":M},w.toJSON=function(){return this.toISOString()},w.format=function(T){var C=T||"YYYY-MM-DDTHH:mm:ss",S={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return C.replace(u,(function(R,U){return U||String(S[R])}))},w.as=function(T){return this.$ms/d[p(T)]},w.get=function(T){var C=this.$ms,S=p(T);return S==="milliseconds"?C%=1e3:C=S==="weeks"?g(C/d[S]):this.$d[S],C||0},w.add=function(T,C,S){var R;return R=C?T*d[p(C)]:h(T)?T.$ms:f(T,this).$ms,f(this.$ms+R*(S?-1:1),this)},w.subtract=function(T,C){return this.add(T,C,!0)},w.locale=function(T){var C=this.clone();return C.$l=T,C},w.clone=function(){return f(this.$ms,this)},w.humanize=function(T){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!T)},w.valueOf=function(){return this.asMilliseconds()},w.milliseconds=function(){return this.get("milliseconds")},w.asMilliseconds=function(){return this.as("milliseconds")},w.seconds=function(){return this.get("seconds")},w.asSeconds=function(){return this.as("seconds")},w.minutes=function(){return this.get("minutes")},w.asMinutes=function(){return this.as("minutes")},w.hours=function(){return this.get("hours")},w.asHours=function(){return this.as("hours")},w.days=function(){return this.get("days")},w.asDays=function(){return this.as("days")},w.weeks=function(){return this.get("weeks")},w.asWeeks=function(){return this.as("weeks")},w.months=function(){return this.get("months")},w.asMonths=function(){return this.as("months")},w.years=function(){return this.get("years")},w.asYears=function(){return this.as("years")},E})(),x=function(E,w,T){return E.add(w.years()*T,"y").add(w.months()*T,"M").add(w.days()*T,"d").add(w.hours()*T,"h").add(w.minutes()*T,"m").add(w.seconds()*T,"s").add(w.milliseconds()*T,"ms")};return function(E,w,T){e=T,t=T().$utils(),T.duration=function(R,U){var L=T.locale();return f(R,{$l:L},U)},T.isDuration=h;var C=w.prototype.add,S=w.prototype.subtract;w.prototype.add=function(R,U){return h(R)?x(this,R,1):C.bind(this)(R,U)},w.prototype.subtract=function(R,U){return h(R)?x(this,R,-1):S.bind(this)(R,U)}}}))});var I5t={};gr(I5t,{diagram:()=>pIr});function Kxe(e,t,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){let a="^\\s*"+i+"\\s*$",o=new RegExp(a);e[0].match(o)&&(t[i]=!0,e.shift(1),n=!0)})}var m5t,Yh,g5t,y5t,v5t,fA,U5t,Oxe,k9r,h5t,Zg,Gxe,Wxe,Vxe,mA,gA,Hxe,qxe,o$,yA,Yxe,b5t,jxe,hA,aD,Xxe,$xe,s$,Bxe,C9r,S9r,A9r,U9r,I9r,R9r,M9r,L9r,D9r,N9r,_9r,P9r,O9r,B9r,F9r,z9r,x5t,G9r,W9r,V9r,H9r,q9r,Y9r,j9r,X9r,w5t,$9r,K9r,Z9r,E5t,Q9r,Fxe,T5t,k5t,i$,pA,J9r,eIr,zxe,a$,dl,C5t,tIr,b6,rIr,f5t,nIr,S5t,iIr,A5t,aIr,oIr,sIr,lIr,p5t,cIr,cv,Pxe,uIr,dIr,hIr,fIr,pIr,R5t=H(()=>{Vn();Wr();Gr();xr();m5t=Ue(PI(),1),Yh=Ue(wF(),1),g5t=Ue(l5t(),1),y5t=Ue(c5t(),1),v5t=Ue(u5t(),1),fA=Ue(wF(),1),U5t=Ue(d5t(),1);_n();Oxe=(function(){var e=k(function(A,P,D,M){for(D=D||{},M=A.length;M--;D[A[M]]=P);return D},"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],r=[1,26],n=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],l=[1,32],u=[1,33],d=[1,34],h=[1,9],f=[1,10],p=[1,11],m=[1,12],g=[1,13],y=[1,14],v=[1,15],b=[1,16],x=[1,19],E=[1,20],w=[1,21],T=[1,22],C=[1,23],S=[1,25],R=[1,35],U={trace:k(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:k(function(P,D,M,O,_,B,F){var G=B.length-1;switch(_){case 1:return B[G-1];case 2:this.$=[];break;case 3:B[G-1].push(B[G]),this.$=B[G-1];break;case 4:case 5:this.$=B[G];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(B[G].substr(11)),this.$=B[G].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=B[G].substr(18);break;case 19:O.TopAxis(),this.$=B[G].substr(8);break;case 20:O.setAxisFormat(B[G].substr(11)),this.$=B[G].substr(11);break;case 21:O.setTickInterval(B[G].substr(13)),this.$=B[G].substr(13);break;case 22:O.setExcludes(B[G].substr(9)),this.$=B[G].substr(9);break;case 23:O.setIncludes(B[G].substr(9)),this.$=B[G].substr(9);break;case 24:O.setTodayMarker(B[G].substr(12)),this.$=B[G].substr(12);break;case 27:O.setDiagramTitle(B[G].substr(6)),this.$=B[G].substr(6);break;case 28:this.$=B[G].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=B[G].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(B[G].substr(8)),this.$=B[G].substr(8);break;case 33:O.addTask(B[G-1],B[G]),this.$="task";break;case 34:this.$=B[G-1],O.setClickEvent(B[G-1],B[G],null);break;case 35:this.$=B[G-2],O.setClickEvent(B[G-2],B[G-1],B[G]);break;case 36:this.$=B[G-2],O.setClickEvent(B[G-2],B[G-1],null),O.setLink(B[G-2],B[G]);break;case 37:this.$=B[G-3],O.setClickEvent(B[G-3],B[G-2],B[G-1]),O.setLink(B[G-3],B[G]);break;case 38:this.$=B[G-2],O.setClickEvent(B[G-2],B[G],null),O.setLink(B[G-2],B[G-1]);break;case 39:this.$=B[G-3],O.setClickEvent(B[G-3],B[G-1],B[G]),O.setLink(B[G-3],B[G-2]);break;case 40:this.$=B[G-1],O.setLink(B[G-1],B[G]);break;case 41:case 47:this.$=B[G-1]+" "+B[G];break;case 42:case 43:case 45:this.$=B[G-2]+" "+B[G-1]+" "+B[G];break;case 44:case 46:this.$=B[G-3]+" "+B[G-2]+" "+B[G-1]+" "+B[G];break}},"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:r,13:n,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:h,23:f,24:p,25:m,26:g,27:y,28:v,29:b,30:x,31:E,33:w,35:T,36:C,37:24,38:S,40:R},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:h,23:f,24:p,25:m,26:g,27:y,28:v,29:b,30:x,31:E,33:w,35:T,36:C,37:24,38:S,40:R},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:k(function(P,D){if(D.recoverable)this.trace(P);else{var M=new Error(P);throw M.hash=D,M}},"parseError"),parse:k(function(P){var D=this,M=[0],O=[],_=[null],B=[],F=this.table,G="",z=0,V=0,$=0,Z=2,re=1,Q=B.slice.call(arguments,1),ge=Object.create(this.lexer),ie={yy:{}};for(var pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pe)&&(ie.yy[pe]=this.yy[pe]);ge.setInput(P,ie.yy),ie.yy.lexer=ge,ie.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var ue=ge.yylloc;B.push(ue);var fe=ge.options&&ge.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Me(le){M.length=M.length-2*le,_.length=_.length-le,B.length=B.length-le}k(Me,"popStack");function Ce(){var le;return le=O.pop()||ge.lex()||re,typeof le!="number"&&(le instanceof Array&&(O=le,le=O.pop()),le=D.symbols_[le]||le),le}k(Ce,"lex");for(var Ye,Ze,Qe,ve,Fe,Le,Be={},ae,he,de,me;;){if(Qe=M[M.length-1],this.defaultActions[Qe]?ve=this.defaultActions[Qe]:((Ye===null||typeof Ye>"u")&&(Ye=Ce()),ve=F[Qe]&&F[Qe][Ye]),typeof ve>"u"||!ve.length||!ve[0]){var ke="";me=[];for(ae in F[Qe])this.terminals_[ae]&&ae>Z&&me.push("'"+this.terminals_[ae]+"'");ge.showPosition?ke="Parse error on line "+(z+1)+`: -`+ge.showPosition()+` -Expecting `+me.join(", ")+", got '"+(this.terminals_[Ye]||Ye)+"'":ke="Parse error on line "+(z+1)+": Unexpected "+(Ye==re?"end of input":"'"+(this.terminals_[Ye]||Ye)+"'"),this.parseError(ke,{text:ge.match,token:this.terminals_[Ye]||Ye,line:ge.yylineno,loc:ue,expected:me})}if(ve[0]instanceof Array&&ve.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Qe+", token: "+Ye);switch(ve[0]){case 1:M.push(Ye),_.push(ge.yytext),B.push(ge.yylloc),M.push(ve[1]),Ye=null,Ze?(Ye=Ze,Ze=null):(V=ge.yyleng,G=ge.yytext,z=ge.yylineno,ue=ge.yylloc,$>0&&$--);break;case 2:if(he=this.productions_[ve[1]][1],Be.$=_[_.length-he],Be._$={first_line:B[B.length-(he||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(he||1)].first_column,last_column:B[B.length-1].last_column},fe&&(Be._$.range=[B[B.length-(he||1)].range[0],B[B.length-1].range[1]]),Le=this.performAction.apply(Be,[G,V,z,ie.yy,ve[1],_,B].concat(Q)),typeof Le<"u")return Le;he&&(M=M.slice(0,-1*he*2),_=_.slice(0,-1*he),B=B.slice(0,-1*he)),M.push(this.productions_[ve[1]][0]),_.push(Be.$),B.push(Be._$),de=F[M[M.length-2]][M[M.length-1]],M.push(de);break;case 3:return!0}}return!0},"parse")},L=(function(){var A={EOF:1,parseError:k(function(D,M){if(this.yy.parser)this.yy.parser.parseError(D,M);else throw new Error(D)},"parseError"),setInput:k(function(P,D){return this.yy=D||this.yy||{},this._input=P,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var P=this._input[0];this.yytext+=P,this.yyleng++,this.offset++,this.match+=P,this.matched+=P;var D=P.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),P},"input"),unput:k(function(P){var D=P.length,M=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===O.length?this.yylloc.first_column:0)+O[O.length-M.length].length-M[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(P){this.unput(this.match.slice(P))},"less"),pastInput:k(function(){var P=this.matched.substr(0,this.matched.length-this.match.length);return(P.length>20?"...":"")+P.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var P=this.match;return P.length<20&&(P+=this._input.substr(0,20-P.length)),(P.substr(0,20)+(P.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var P=this.pastInput(),D=new Array(P.length+1).join("-");return P+this.upcomingInput()+` -`+D+"^"},"showPosition"),test_match:k(function(P,D){var M,O,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),O=P[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,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(P[0].length),this.matched+=P[0],M=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var B in _)this[B]=_[B];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var P,D,M,O;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),B=0;B<_.length;B++)if(M=this._input.match(this.rules[_[B]]),M&&(!D||M[0].length>D[0].length)){if(D=M,O=B,this.options.backtrack_lexer){if(P=this.test_match(M,_[B]),P!==!1)return P;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(P=this.test_match(D,_[O]),P!==!1?P:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var D=this.next();return D||this.lex()},"lex"),begin:k(function(D){this.conditionStack.push(D)},"begin"),popState:k(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:k(function(D){this.begin(D)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(D,M,O,_){var B=_;switch(O){case 0:return this.begin("open_directive"),"open_directive";break;case 1:return this.begin("acc_title"),31;break;case 2:return this.popState(),"acc_title_value";break;case 3:return this.begin("acc_descr"),33;break;case 4:return this.popState(),"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return A})();U.lexer=L;function I(){this.yy={}}return k(I,"Parser"),I.prototype=U,U.Parser=I,new I})();Oxe.parser=Oxe;k9r=Oxe;Yh.default.extend(g5t.default);Yh.default.extend(y5t.default);Yh.default.extend(v5t.default);h5t={friday:5,saturday:6},Zg="",Gxe="",Wxe=void 0,Vxe="",mA=[],gA=[],Hxe=new Map,qxe=[],o$=[],yA="",Yxe="",b5t=["active","done","crit","milestone","vert"],jxe=[],hA="",aD=!1,Xxe=!1,$xe="sunday",s$="saturday",Bxe=0,C9r=k(function(){qxe=[],o$=[],yA="",jxe=[],i$=0,zxe=void 0,a$=void 0,dl=[],Zg="",Gxe="",Yxe="",Wxe=void 0,Vxe="",mA=[],gA=[],aD=!1,Xxe=!1,Bxe=0,Hxe=new Map,hA="",$r(),$xe="sunday",s$="saturday"},"clear"),S9r=k(function(e){hA=e},"setDiagramId"),A9r=k(function(e){Gxe=e},"setAxisFormat"),U9r=k(function(){return Gxe},"getAxisFormat"),I9r=k(function(e){Wxe=e},"setTickInterval"),R9r=k(function(){return Wxe},"getTickInterval"),M9r=k(function(e){Vxe=e},"setTodayMarker"),L9r=k(function(){return Vxe},"getTodayMarker"),D9r=k(function(e){Zg=e},"setDateFormat"),N9r=k(function(){aD=!0},"enableInclusiveEndDates"),_9r=k(function(){return aD},"endDatesAreInclusive"),P9r=k(function(){Xxe=!0},"enableTopAxis"),O9r=k(function(){return Xxe},"topAxisEnabled"),B9r=k(function(e){Yxe=e},"setDisplayMode"),F9r=k(function(){return Yxe},"getDisplayMode"),z9r=k(function(){return Zg},"getDateFormat"),x5t=k((e,t)=>{let r=t.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...e,...r])]},"mergeTokens"),G9r=k(function(e){mA=x5t(mA,e)},"setIncludes"),W9r=k(function(){return mA},"getIncludes"),V9r=k(function(e){gA=x5t(gA,e)},"setExcludes"),H9r=k(function(){return gA},"getExcludes"),q9r=k(function(){return Hxe},"getLinks"),Y9r=k(function(e){yA=e,qxe.push(e)},"addSection"),j9r=k(function(){return qxe},"getSections"),X9r=k(function(){let e=f5t(),t=10,r=0;for(;!e&&rs))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");e=e.add(1,"d")}return[t,o]},"fixTaskDates"),Fxe=k(function(e,t,r){if(r=r.trim(),k(s=>{let l=s.trim();return l==="x"||l==="X"},"isTimestampFormat")(t)&&/^\d+$/.test(r))return new Date(Number(r));let a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let s=null;for(let u of a.groups.ids.split(" ")){let d=b6(u);d!==void 0&&(!s||d.endTime>s.endTime)&&(s=d)}if(s)return s.endTime;let l=new Date;return l.setHours(0,0,0,0),l}let o=(0,Yh.default)(r,t.trim(),!0);if(o.isValid())return o.toDate();{ye.debug("Invalid date:"+r),ye.debug("With date format:"+t.trim());let s=new Date(r);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4)throw new Error("Invalid date:"+r);return s}},"getStartDate"),T5t=k(function(e){let t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return t!==null?[Number.parseFloat(t[1]),t[2]]:[NaN,"ms"]},"parseDuration"),k5t=k(function(e,t,r,n=!1){r=r.trim();let a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let d=null;for(let f of a.groups.ids.split(" ")){let p=b6(f);p!==void 0&&(!d||p.startTime{window.open(r,"_self")}),Hxe.set(n,r))}),S5t(e,"clickable")},"setLink"),S5t=k(function(e,t){e.split(",").forEach(function(r){let n=b6(r);n!==void 0&&n.classes.push(t)})},"setClass"),iIr=k(function(e,t,r){if(je().securityLevel!=="loose"||t===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Nr.runFunc(t,...n)})},"setClickFun"),A5t=k(function(e,t){jxe.push(function(){let r=hA?`${hA}-${e}`:e,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){t()})},function(){let r=hA?`${hA}-${e}`:e,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){t()})})},"pushFun"),aIr=k(function(e,t,r){e.split(",").forEach(function(n){iIr(n,t,r)}),S5t(e,"clickable")},"setClickEvent"),oIr=k(function(e){jxe.forEach(function(t){t(e)})},"bindFunctions"),sIr={getConfig:k(()=>je().gantt,"getConfig"),clear:C9r,setDateFormat:D9r,getDateFormat:z9r,enableInclusiveEndDates:N9r,endDatesAreInclusive:_9r,enableTopAxis:P9r,topAxisEnabled:O9r,setAxisFormat:A9r,getAxisFormat:U9r,setTickInterval:I9r,getTickInterval:R9r,setTodayMarker:M9r,getTodayMarker:L9r,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,setDiagramId:S9r,setDisplayMode:B9r,getDisplayMode:F9r,setAccDescription:mn,getAccDescription:gn,addSection:Y9r,getSections:j9r,getTasks:X9r,addTask:tIr,findTaskById:b6,addTaskOrg:rIr,setIncludes:G9r,getIncludes:W9r,setExcludes:V9r,getExcludes:H9r,setClickEvent:aIr,setLink:nIr,getLinks:q9r,bindFunctions:oIr,parseDuration:T5t,isInvalidDate:w5t,setWeekday:$9r,getWeekday:K9r,setWeekend:Z9r};k(Kxe,"getTaskTags");fA.default.extend(U5t.default);lIr=k(function(){ye.debug("Something is calling, setConf, remove the call")},"setConf"),p5t={monday:m2,tuesday:dG,wednesday:hG,thursday:Qm,friday:fG,saturday:pG,sunday:c0},cIr=k((e,t)=>{let r=[...e].map(()=>-1/0),n=[...e].sort((a,o)=>a.startTime-o.startTime||a.order-o.order),i=0;for(let a of n)for(let o=0;o=r[o]){r[o]=a.endTime,a.order=o+t,o>i&&(i=o);break}return i},"getMaxIntersections"),Pxe=1e4,uIr=k(function(e,t,r,n){let i=je().gantt;n.db.setDiagramId(t);let a=je().securityLevel,o;a==="sandbox"&&(o=xt("#i"+t));let s=a==="sandbox"?xt(o.nodes()[0].contentDocument.body):xt("body"),l=a==="sandbox"?o.nodes()[0].contentDocument:document,u=l.getElementById(t);cv=u.parentElement.offsetWidth,cv===void 0&&(cv=1200),i.useWidth!==void 0&&(cv=i.useWidth);let d=n.db.getTasks(),h=d.filter(U=>!U.vert),f=[];for(let U of h)f.push(U.type);f=R(f);let p={},m=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){let U={};for(let I of h)U[I.section]===void 0?U[I.section]=[I]:U[I.section].push(I);let L=0;for(let I of Object.keys(U)){let A=cIr(U[I],L)+1;L+=A,m+=A*(i.barHeight+i.barGap),p[I]=A}}else{m+=h.length*(i.barHeight+i.barGap);for(let U of f)p[U]=h.filter(L=>L.type===U).length}u.setAttribute("viewBox","0 0 "+cv+" "+m);let g=s.select(`[id="${t}"]`),y=yG().domain([kz(d,function(U){return U.startTime}),Tz(d,function(U){return U.endTime})]).rangeRound([0,cv-i.leftPadding-i.rightPadding]);function v(U,L){let I=U.startTime,A=L.startTime,P=0;return I>A?P=1:IV.vert===$.vert?0:V.vert?1:-1);let O=U.filter(V=>!V.vert),B=[...new Set(O.map(V=>V.order))].map(V=>O.find($=>$.order===V));g.append("g").selectAll("rect").data(B).enter().append("rect").attr("x",0).attr("y",function(V,$){return $=V.order,$*L+I-2}).attr("width",function(){return M-i.rightPadding/2}).attr("height",L).attr("class",function(V){for(let[$,Z]of f.entries())if(V.type===Z)return"section section"+$%i.numberSectionStyles;return"section section0"}).enter();let F=g.append("g").selectAll("rect").data(U).enter(),G=n.db.getLinks();if(F.append("rect").attr("id",function(V){return t+"-"+V.id}).attr("rx",3).attr("ry",3).attr("x",function(V){return V.milestone?y(V.startTime)+A+.5*(y(V.endTime)-y(V.startTime))-.5*P:y(V.startTime)+A}).attr("y",function(V,$){return $=V.order,V.vert?i.gridLineStartPadding:$*L+I}).attr("width",function(V){return V.milestone?P:V.vert?.08*P:y(V.renderEndTime||V.endTime)-y(V.startTime)}).attr("height",function(V){return V.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:P}).attr("transform-origin",function(V,$){return $=V.order,(y(V.startTime)+A+.5*(y(V.endTime)-y(V.startTime))).toString()+"px "+($*L+I+.5*P).toString()+"px"}).attr("class",function(V){let $="task",Z="";V.classes.length>0&&(Z=V.classes.join(" "));let re=0;for(let[ge,ie]of f.entries())V.type===ie&&(re=ge%i.numberSectionStyles);let Q="";return V.active?V.crit?Q+=" activeCrit":Q=" active":V.done?V.crit?Q=" doneCrit":Q=" done":V.crit&&(Q+=" crit"),Q.length===0&&(Q=" task"),V.milestone&&(Q=" milestone "+Q),V.vert&&(Q=" vert "+Q),Q+=re,Q+=" "+Z,$+Q}),F.append("text").attr("id",function(V){return t+"-"+V.id+"-text"}).text(function(V){return V.task}).attr("font-size",i.fontSize).attr("x",function(V){let $=y(V.startTime),Z=y(V.renderEndTime||V.endTime);if(V.milestone&&($+=.5*(y(V.endTime)-y(V.startTime))-.5*P,Z=$+P),V.vert)return y(V.startTime)+A;let re=this.getBBox().width;return re>Z-$?Z+re+1.5*i.leftPadding>M?$+A-5:Z+A+5:(Z-$)/2+$+A}).attr("y",function(V,$){return V.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:($=V.order,$*L+i.barHeight/2+(i.fontSize/2-2)+I)}).attr("text-height",P).attr("class",function(V){let $=y(V.startTime),Z=y(V.endTime);V.milestone&&(Z=$+P);let re=this.getBBox().width,Q="";V.classes.length>0&&(Q=V.classes.join(" "));let ge=0;for(let[pe,ue]of f.entries())V.type===ue&&(ge=pe%i.numberSectionStyles);let ie="";return V.active&&(V.crit?ie="activeCritText"+ge:ie="activeText"+ge),V.done?V.crit?ie=ie+" doneCritText"+ge:ie=ie+" doneText"+ge:V.crit&&(ie=ie+" critText"+ge),V.milestone&&(ie+=" milestoneText"),V.vert&&(ie+=" vertText"),re>Z-$?Z+re+1.5*i.leftPadding>M?Q+" taskTextOutsideLeft taskTextOutside"+ge+" "+ie:Q+" taskTextOutsideRight taskTextOutside"+ge+" "+ie+" width-"+re:Q+" taskText taskText"+ge+" "+ie+" width-"+re}),je().securityLevel==="sandbox"){let V;V=xt("#i"+t);let $=V.nodes()[0].contentDocument;F.filter(function(Z){return G.has(Z.id)}).each(function(Z){var re=$.querySelector("#"+CSS.escape(t+"-"+Z.id)),Q=$.querySelector("#"+CSS.escape(t+"-"+Z.id+"-text"));let ge=re.parentNode;var ie=$.createElement("a");ie.setAttribute("xlink:href",G.get(Z.id)),ie.setAttribute("target","_top"),ge.appendChild(ie),ie.appendChild(re),ie.appendChild(Q)})}}k(x,"drawRects");function E(U,L,I,A,P,D,M,O){if(M.length===0&&O.length===0)return;let _,B;for(let{startTime:Z,endTime:re}of D)(_===void 0||Z<_)&&(_=Z),(B===void 0||re>B)&&(B=re);if(!_||!B)return;if((0,fA.default)(B).diff((0,fA.default)(_),"year")>5){ye.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}let F=n.db.getDateFormat(),G=[],z=null,V=(0,fA.default)(_);for(;V.valueOf()<=B;)n.db.isInvalidDate(V,F,M,O)?z?z.end=V:z={start:V,end:V}:z&&(G.push(z),z=null),V=V.add(1,"d");g.append("g").selectAll("rect").data(G).enter().append("rect").attr("id",Z=>t+"-exclude-"+Z.start.format("YYYY-MM-DD")).attr("x",Z=>y(Z.start.startOf("day"))+I).attr("y",i.gridLineStartPadding).attr("width",Z=>y(Z.end.endOf("day"))-y(Z.start.startOf("day"))).attr("height",P-L-i.gridLineStartPadding).attr("transform-origin",function(Z,re){return(y(Z.start)+I+.5*(y(Z.end)-y(Z.start))).toString()+"px "+(re*U+.5*P).toString()+"px"}).attr("class","exclude-range")}k(E,"drawExcludeDays");function w(U,L,I,A){if(I<=0||U>L)return 1/0;let P=L-U,D=fA.default.duration({[A??"day"]:I}).asMilliseconds();return D<=0?1/0:Math.ceil(P/D)}k(w,"getEstimatedTickCount");function T(U,L,I,A){let P=n.db.getDateFormat(),D=n.db.getAxisFormat(),M;D?M=D:P==="D"?M="%d":M=i.axisFormat??"%Y-%m-%d";let O=Mse(y).tickSize(-A+L+i.gridLineStartPadding).tickFormat(h4(M)),B=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(B!==null){let F=parseInt(B[1],10);if(isNaN(F)||F<=0)ye.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{let G=B[2],z=n.db.getWeekday()||i.weekday,V=y.domain(),$=V[0],Z=V[1],re=w($,Z,F,G);if(re>Pxe)ye.warn(`The tick interval "${F}${G}" would generate ${re} ticks, which exceeds the maximum allowed (${Pxe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(G){case"millisecond":O.ticks(Km.every(F));break;case"second":O.ticks(Ch.every(F));break;case"minute":O.ticks(fy.every(F));break;case"hour":O.ticks(py.every(F));break;case"day":O.ticks(Uf.every(F));break;case"week":O.ticks(p5t[z].every(F));break;case"month":O.ticks(my.every(F));break}}}if(g.append("g").attr("class","grid").attr("transform","translate("+U+", "+(A-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let F=Rse(y).tickSize(-A+L+i.gridLineStartPadding).tickFormat(h4(M));if(B!==null){let G=parseInt(B[1],10);if(isNaN(G)||G<=0)ye.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{let z=B[2],V=n.db.getWeekday()||i.weekday,$=y.domain(),Z=$[0],re=$[1];if(w(Z,re,G,z)<=Pxe)switch(z){case"millisecond":F.ticks(Km.every(G));break;case"second":F.ticks(Ch.every(G));break;case"minute":F.ticks(fy.every(G));break;case"hour":F.ticks(py.every(G));break;case"day":F.ticks(Uf.every(G));break;case"week":F.ticks(p5t[V].every(G));break;case"month":F.ticks(my.every(G));break}}}g.append("g").attr("class","grid").attr("transform","translate("+U+", "+L+")").call(F).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}k(T,"makeGrid");function C(U,L){let I=0,A=Object.keys(p).map(P=>[P,p[P]]);g.append("g").selectAll("text").data(A).enter().append(function(P){let D=P[0].split(Lt.lineBreakRegex),M=-(D.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",M+"em");for(let[_,B]of D.entries()){let F=l.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttribute("alignment-baseline","central"),F.setAttribute("x","10"),_>0&&F.setAttribute("dy","1em"),F.textContent=B,O.appendChild(F)}return O}).attr("x",10).attr("y",function(P,D){if(D>0)for(let M=0;M` - .mermaid-main-font { - font-family: ${e.fontFamily}; - } - - .exclude-range { - fill: ${e.excludeBkgColor}; - } - - .section { - stroke: none; - opacity: 0.2; - } - - .section0 { - fill: ${e.sectionBkgColor}; - } - - .section2 { - fill: ${e.sectionBkgColor2}; - } - - .section1, - .section3 { - fill: ${e.altSectionBkgColor}; - opacity: 0.2; - } - - .sectionTitle0 { - fill: ${e.titleColor}; - } - - .sectionTitle1 { - fill: ${e.titleColor}; - } - - .sectionTitle2 { - fill: ${e.titleColor}; - } - - .sectionTitle3 { - fill: ${e.titleColor}; - } - - .sectionTitle { - text-anchor: start; - font-family: ${e.fontFamily}; - } - - - /* Grid and axis */ - - .grid .tick { - stroke: ${e.gridColor}; - opacity: 0.8; - shape-rendering: crispEdges; - } - - .grid .tick text { - font-family: ${e.fontFamily}; - fill: ${e.textColor}; - } - - .grid path { - stroke-width: 0; - } - - - /* Today line */ - - .today { - fill: none; - stroke: ${e.todayLineColor}; - stroke-width: 2px; - } - - - /* Task styling */ - - /* Default task */ - - .task { - stroke-width: 2; - } - - .taskText { - text-anchor: middle; - font-family: ${e.fontFamily}; - } - - .taskTextOutsideRight { - fill: ${e.taskTextDarkColor}; - text-anchor: start; - font-family: ${e.fontFamily}; - } - - .taskTextOutsideLeft { - fill: ${e.taskTextDarkColor}; - text-anchor: end; - } - - - /* Special case clickable */ - - .task.clickable { - cursor: pointer; - } - - .taskText.clickable { - cursor: pointer; - fill: ${e.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideLeft.clickable { - cursor: pointer; - fill: ${e.taskTextClickableColor} !important; - font-weight: bold; - } - - .taskTextOutsideRight.clickable { - cursor: pointer; - fill: ${e.taskTextClickableColor} !important; - font-weight: bold; - } - - - /* Specific task settings for the sections*/ - - .taskText0, - .taskText1, - .taskText2, - .taskText3 { - fill: ${e.taskTextColor}; - } - - .task0, - .task1, - .task2, - .task3 { - fill: ${e.taskBkgColor}; - stroke: ${e.taskBorderColor}; - } - - .taskTextOutside0, - .taskTextOutside2 - { - fill: ${e.taskTextOutsideColor}; - } - - .taskTextOutside1, - .taskTextOutside3 { - fill: ${e.taskTextOutsideColor}; - } - - - /* Active task */ - - .active0, - .active1, - .active2, - .active3 { - fill: ${e.activeTaskBkgColor}; - stroke: ${e.activeTaskBorderColor}; - } - - .activeText0, - .activeText1, - .activeText2, - .activeText3 { - fill: ${e.taskTextDarkColor} !important; - } - - - /* Completed task */ - - .done0, - .done1, - .done2, - .done3 { - stroke: ${e.doneTaskBorderColor}; - fill: ${e.doneTaskBkgColor}; - stroke-width: 2; - } - - .doneText0, - .doneText1, - .doneText2, - .doneText3 { - fill: ${e.taskTextDarkColor} !important; - } - - /* Done task text displayed outside the bar sits against the diagram background, - not against the done-task bar, so it must use the outside/contrast color. */ - .doneText0.taskTextOutsideLeft, - .doneText0.taskTextOutsideRight, - .doneText1.taskTextOutsideLeft, - .doneText1.taskTextOutsideRight, - .doneText2.taskTextOutsideLeft, - .doneText2.taskTextOutsideRight, - .doneText3.taskTextOutsideLeft, - .doneText3.taskTextOutsideRight { - fill: ${e.taskTextOutsideColor} !important; - } - - - /* Tasks on the critical line */ - - .crit0, - .crit1, - .crit2, - .crit3 { - stroke: ${e.critBorderColor}; - fill: ${e.critBkgColor}; - stroke-width: 2; - } - - .activeCrit0, - .activeCrit1, - .activeCrit2, - .activeCrit3 { - stroke: ${e.critBorderColor}; - fill: ${e.activeTaskBkgColor}; - stroke-width: 2; - } - - .doneCrit0, - .doneCrit1, - .doneCrit2, - .doneCrit3 { - stroke: ${e.critBorderColor}; - fill: ${e.doneTaskBkgColor}; - stroke-width: 2; - cursor: pointer; - shape-rendering: crispEdges; - } - - .milestone { - transform: rotate(45deg) scale(0.8,0.8); - } - - .milestoneText { - font-style: italic; - } - .doneCritText0, - .doneCritText1, - .doneCritText2, - .doneCritText3 { - fill: ${e.taskTextDarkColor} !important; - } - - /* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */ - .doneCritText0.taskTextOutsideLeft, - .doneCritText0.taskTextOutsideRight, - .doneCritText1.taskTextOutsideLeft, - .doneCritText1.taskTextOutsideRight, - .doneCritText2.taskTextOutsideLeft, - .doneCritText2.taskTextOutsideRight, - .doneCritText3.taskTextOutsideLeft, - .doneCritText3.taskTextOutsideRight { - fill: ${e.taskTextOutsideColor} !important; - } - - .vert { - stroke: ${e.vertLineColor}; - } - - .vertText { - font-size: 15px; - text-anchor: middle; - fill: ${e.vertLineColor} !important; - } - - .activeCritText0, - .activeCritText1, - .activeCritText2, - .activeCritText3 { - fill: ${e.taskTextDarkColor} !important; - } - - .titleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.titleColor||e.textColor}; - font-family: ${e.fontFamily}; - } -`,"getStyles"),fIr=hIr,pIr={parser:k9r,db:sIr,renderer:dIr,styles:fIr}});var M5t={};gr(M5t,{diagram:()=>wIr});var mIr,gIr,yIr,vIr,bIr,xIr,wIr,L5t=H(()=>{cs();Wr();Gr();xr();yc();mIr={parse:k(async e=>{let t=await Lo("info",e);ye.debug(t)},"parse")},gIr={version:"11.17.2"},yIr=k(()=>gIr.version,"getVersion"),vIr={getVersion:yIr},bIr=k((e,t,r)=>{ye.debug(`rendering info diagram -`+e);let n=Mi(t);zn(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),xIr={draw:bIr},wIr={parser:mIr,db:vIr,renderer:xIr}});var _5t={};gr(_5t,{diagram:()=>PIr});var D5t,Zxe,l$,Qxe,EIr,TIr,kIr,CIr,SIr,AIr,UIr,N5t,IIr,RIr,MIr,LIr,DIr,NIr,_Ir,PIr,P5t=H(()=>{_u();cs();Vn();Wr();Gr();xr();yc();_n();D5t=Xr.pie,Zxe={sections:new Map,showData:!1,config:D5t},l$=Zxe.sections,Qxe=Zxe.showData,EIr=structuredClone(D5t),TIr=k(()=>structuredClone(EIr),"getConfig"),kIr=k(()=>{l$=new Map,Qxe=Zxe.showData,$r()},"clear"),CIr=k(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);l$.has(e)||(l$.set(e,t),ye.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),SIr=k(()=>l$,"getSections"),AIr=k(e=>{Qxe=e},"setShowData"),UIr=k(()=>Qxe,"getShowData"),N5t={getConfig:TIr,clear:kIr,setDiagramTitle:Sn,getDiagramTitle:yn,setAccTitle:sn,getAccTitle:pn,setAccDescription:mn,getAccDescription:gn,addSection:CIr,getSections:SIr,setShowData:AIr,getShowData:UIr},IIr=k((e,t)=>{ra(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),RIr={parse:k(async e=>{let t=await Lo("pie",e);ye.debug(t),IIr(t,N5t)},"parse")},MIr=k(e=>` - .pieCircle{ - stroke: ${e.pieStrokeColor}; - stroke-width : ${e.pieStrokeWidth}; - opacity : ${e.pieOpacity}; - } - .pieCircle.highlighted{ - scale: 1.05; - opacity: 1; - } - .pieCircle.highlightedOnHover:hover{ - transition-duration: 250ms; - scale: 1.05; - opacity: 1; - } - .pieOuterCircle{ - stroke: ${e.pieOuterStrokeColor}; - stroke-width: ${e.pieOuterStrokeWidth}; - fill: none; - } - .pieTitleText { - text-anchor: middle; - font-size: ${e.pieTitleTextSize}; - fill: ${e.pieTitleTextColor}; - font-family: ${e.fontFamily}; - } - .slice { - font-family: ${e.fontFamily}; - fill: ${e.pieSectionTextColor}; - font-size:${e.pieSectionTextSize}; - // fill: white; - } - .legend text { - fill: ${e.pieLegendTextColor}; - font-family: ${e.fontFamily}; - font-size: ${e.pieLegendTextSize}; - } -`,"getStyles"),LIr=MIr,DIr=k(e=>{let t=[...e.values()].reduce((i,a)=>i+a,0),r=[...e.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/t*100>=1);return cce().value(i=>i.value).sort(null)(r)},"createPieArcs"),NIr=k((e,t,r,n)=>{ye.debug(`rendering pie chart -`+e);let i=n.db,a=je(),o=Kn(i.getConfig(),a.pie),s=40,l=18,u=4,d=450,h=d,f=Mi(t),p=f.append("g");p.attr("transform","translate("+h/2+","+d/2+")");let{themeVariables:m}=a,[g]=kd(m.pieOuterStrokeWidth);g??=2;let y=o.legendPosition,v=o.textPosition,b=o.donutHole>0&&o.donutHole<=.9?o.donutHole:0,x=Math.min(h,d)/2-s,E=Jm().innerRadius(b*x).outerRadius(x),w=Jm().innerRadius(x*v).outerRadius(x*v),T=p.append("g");T.append("circle").attr("cx",0).attr("cy",0).attr("r",x+g/2).attr("class","pieOuterCircle");let C=i.getSections(),S=DIr(C),R=[m.pie1,m.pie2,m.pie3,m.pie4,m.pie5,m.pie6,m.pie7,m.pie8,m.pie9,m.pie10,m.pie11,m.pie12],U=0;C.forEach(Q=>{U+=Q});let L=S.filter(Q=>(Q.data.value/U*100).toFixed(0)!=="0"),I=kh(R).domain([...C.keys()]);T.selectAll("mySlices").data(L).enter().append("path").attr("d",E).attr("fill",Q=>I(Q.data.label)).attr("class",Q=>{let ge="pieCircle";return o.highlightSlice==="hover"?ge+=" highlightedOnHover":o.highlightSlice===Q.data.label&&(ge+=" highlighted"),ge}),T.selectAll("mySlices").data(L).enter().append("text").text(Q=>(Q.data.value/U*100).toFixed(0)+"%").attr("transform",Q=>"translate("+w.centroid(Q)+")").style("text-anchor","middle").attr("class","slice");let A=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-(d-50)/2).attr("class","pieTitleText"),P=[...C.entries()].map(([Q,ge])=>({label:Q,value:ge})),D=p.selectAll(".legend").data(P).enter().append("g").attr("class","legend");D.append("rect").attr("width",l).attr("height",l).style("fill",Q=>I(Q.label)).style("stroke",Q=>I(Q.label)),D.append("text").attr("x",l+u).attr("y",l-u).text(Q=>i.getShowData()?`${Q.label} [${Q.value}]`:Q.label);let M=Math.max(...D.selectAll("text").nodes().map(Q=>Q?.getBoundingClientRect().width??0)),O=d,_=h+s,B=l+u,F=P.length*B;switch(y){case"center":D.attr("transform",(Q,ge)=>{let ie=B*P.length/2,pe=-M/2-(l+u),ue=ge*B-ie;return"translate("+pe+","+ue+")"});break;case"top":O+=F,D.attr("transform",(Q,ge)=>{let ie=x,pe=-M/2-(l+u),ue=ge*B-ie;return`translate(${pe}, ${ue})`}),T.attr("transform",()=>`translate(0, ${F+B})`);break;case"bottom":O+=F,D.attr("transform",(Q,ge)=>{let ie=-x-B,pe=-M/2-(l+u),ue=ge*B-ie;return"translate("+pe+","+ue+")"});break;case"left":_+=l+u+M,D.attr("transform",(Q,ge)=>{let ie=B*P.length/2,pe=-x-(l+u),ue=ge*B-ie;return"translate("+pe+","+ue+")"}),T.attr("transform",()=>`translate(${M+l+u}, 0)`);break;default:_+=l+u+M,D.attr("transform",(Q,ge)=>{let ie=B*P.length/2,pe=12*l,ue=ge*B-ie;return"translate("+pe+","+ue+")"});break}let G=A.node()?.getBoundingClientRect().width??0,z=h/2-G/2,V=h/2+G/2,$=Math.min(0,z),re=Math.max(_,V)-$;f.attr("viewBox",`${$} 0 ${re} ${O}`),zn(f,O,re,o.useMaxWidth)},"draw"),_Ir={draw:NIr},PIr={parser:RIr,db:N5t,renderer:_Ir,styles:LIr}});var Q5t={};gr(Q5t,{diagram:()=>VIr});function ewe(e){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(e)}function O5t(e){return!/^\d+$/.test(e)}function B5t(e){return!/^\d+px$/.test(e)}function Qg(e){return rn(e.trim(),je())}function F5t(e){vc.setData({quadrant1Text:Qg(e.text)})}function z5t(e){vc.setData({quadrant2Text:Qg(e.text)})}function G5t(e){vc.setData({quadrant3Text:Qg(e.text)})}function W5t(e){vc.setData({quadrant4Text:Qg(e.text)})}function V5t(e){vc.setData({xAxisLeftText:Qg(e.text)})}function H5t(e){vc.setData({xAxisRightText:Qg(e.text)})}function q5t(e){vc.setData({yAxisTopText:Qg(e.text)})}function Y5t(e){vc.setData({yAxisBottomText:Qg(e.text)})}function u$(e){let t={};for(let r of e){let[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(O5t(i))throw new c$(n,i,"number");t.radius=parseInt(i)}else if(n==="color"){if(ewe(i))throw new c$(n,i,"hex code");t.color=i}else if(n==="stroke-color"){if(ewe(i))throw new c$(n,i,"hex code");t.strokeColor=i}else if(n==="stroke-width"){if(B5t(i))throw new c$(n,i,"number of pixels (eg. 10px)");t.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return t}function j5t(e,t,r,n,i){let a=u$(i);vc.addPoints([{x:r,y:n,text:Qg(e.text),className:t,...a}])}function X5t(e,t){vc.addClass(e,u$(t))}function $5t(e){vc.setConfig({chartWidth:e})}function K5t(e){vc.setConfig({chartHeight:e})}function Z5t(){let e=je(),{themeVariables:t,quadrantChart:r}=e;return r&&vc.setConfig(r),vc.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}),vc.setData({titleText:yn()}),vc.build()}var Jxe,OIr,qu,BIr,c$,vc,FIr,zIr,GIr,WIr,VIr,J5t=H(()=>{Wr();Gr();xr();_n();_n();Jxe=(function(){var e=k(function(J,K,ee,Se){for(ee=ee||{},Se=J.length;Se--;ee[J[Se]]=K);return ee},"o"),t=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],o=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],s=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],h=[1,36],f=[1,38],p=[1,35],m=[1,43],g=[1,41],y=[1,45],v=[1,14],b=[1,23],x=[1,18],E=[1,19],w=[1,20],T=[1,21],C=[1,22],S=[1,24],R=[1,25],U=[1,26],L=[1,27],I=[1,28],A=[1,29],P=[1,32],D=[1,33],M=[1,34],O=[1,39],_=[1,40],B=[1,42],F=[1,44],G=[1,63],z=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],$=[1,66],Z=[1,67],re=[1,68],Q=[1,69],ge=[1,70],ie=[1,71],pe=[1,72],ue=[1,73],fe=[1,74],Me=[1,75],Ce=[1,76],Ye=[1,77],Ze=[4,5,6,7,8,9,10,11,12,13,14,15,18],Qe=[1,91],ve=[1,92],Fe=[1,93],Le=[1,100],Be=[1,94],ae=[1,97],he=[1,95],de=[1,96],me=[1,98],ke=[1,99],le=[1,103],W=[10,55,56,57],X=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],q={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:k(function(K,ee,Se,Te,Ae,Ie,Ge){var De=Ie.length-1;switch(Ae){case 23:this.$=Ie[De];break;case 24:this.$=Ie[De-1]+""+Ie[De];break;case 26:this.$=Ie[De-1]+Ie[De];break;case 27:this.$=[Ie[De].trim()];break;case 28:Ie[De-2].push(Ie[De].trim()),this.$=Ie[De-2];break;case 29:this.$=Ie[De-4],Te.addClass(Ie[De-2],Ie[De]);break;case 37:this.$=[];break;case 42:this.$=Ie[De].trim(),Te.setDiagramTitle(this.$);break;case 43:this.$=Ie[De].trim(),Te.setAccTitle(this.$);break;case 44:case 45:this.$=Ie[De].trim(),Te.setAccDescription(this.$);break;case 46:Te.addSection(Ie[De].substr(8)),this.$=Ie[De].substr(8);break;case 47:Te.addPoint(Ie[De-3],"",Ie[De-1],Ie[De],[]);break;case 48:Te.addPoint(Ie[De-4],Ie[De-3],Ie[De-1],Ie[De],[]);break;case 49:Te.addPoint(Ie[De-4],"",Ie[De-2],Ie[De-1],Ie[De]);break;case 50:Te.addPoint(Ie[De-5],Ie[De-4],Ie[De-2],Ie[De-1],Ie[De]);break;case 51:Te.setXAxisLeftText(Ie[De-2]),Te.setXAxisRightText(Ie[De]);break;case 52:Ie[De-1].text+=" \u27F6 ",Te.setXAxisLeftText(Ie[De-1]);break;case 53:Te.setXAxisLeftText(Ie[De]);break;case 54:Te.setYAxisBottomText(Ie[De-2]),Te.setYAxisTopText(Ie[De]);break;case 55:Ie[De-1].text+=" \u27F6 ",Te.setYAxisBottomText(Ie[De-1]);break;case 56:Te.setYAxisBottomText(Ie[De]);break;case 57:Te.setQuadrant1Text(Ie[De]);break;case 58:Te.setQuadrant2Text(Ie[De]);break;case 59:Te.setQuadrant3Text(Ie[De]);break;case 60:Te.setQuadrant4Text(Ie[De]);break;case 64:this.$={text:Ie[De],type:"text"};break;case 65:this.$={text:Ie[De-1].text+""+Ie[De],type:Ie[De-1].type};break;case 66:this.$={text:Ie[De],type:"text"};break;case 67:this.$={text:Ie[De],type:"markdown"};break;case 68:this.$=Ie[De];break;case 69:this.$=Ie[De-1]+""+Ie[De];break}},"anonymous"),table:[{18:t,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:t,26:8,27:2,28:r,55:n,56:i,57:a},{18:t,26:9,27:2,28:r,55:n,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,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:h,10:f,12:p,13:m,14:g,15:y,18:v,25:b,35:x,37:E,39:w,41:T,42:C,48:S,50:R,51:U,52:L,53:I,54:A,60:P,61:D,63:M,64:O,65:_,66:B,67:F}),e(o,[2,34]),{27:46,55:n,56:i,57:a},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:h,10:f,12:p,13:m,14:g,15:y,18:v,25:b,35:x,37:E,39:w,41:T,42:C,48:S,50:R,51:U,52:L,53:I,54:A,60:P,61:D,63:M,64:O,65:_,66:B,67:F}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},e(l,[2,45]),e(l,[2,46]),{18:[1,51]},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:52,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:53,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:54,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:55,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:56,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,10:f,12:p,13:m,14:g,15:y,43:57,58:31,60:P,61:D,63:M,64:O,65:_,66:B,67:F},{4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,44:[1,58],47:[1,59],58:61,59:60,63:M,64:O,65:_,66:B,67:F},e(V,[2,64]),e(V,[2,66]),e(V,[2,67]),e(V,[2,70]),e(V,[2,71]),e(V,[2,72]),e(V,[2,73]),e(V,[2,74]),e(V,[2,75]),e(V,[2,76]),e(V,[2,77]),e(V,[2,78]),e(V,[2,79]),e(V,[2,80]),e(V,[2,81]),e(o,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:65,4:$,5:Z,6:re,7:Q,8:ge,9:ie,10:pe,11:ue,12:fe,13:Me,14:Ce,15:Ye,21:64},e(l,[2,53],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,49:[1,78],63:M,64:O,65:_,66:B,67:F}),e(l,[2,56],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,49:[1,79],63:M,64:O,65:_,66:B,67:F}),e(l,[2,57],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),e(l,[2,58],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),e(l,[2,59],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),e(l,[2,60],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),{45:[1,80]},{44:[1,81]},e(V,[2,65]),e(V,[2,82]),e(V,[2,83]),e(V,[2,84]),{3:83,4:$,5:Z,6:re,7:Q,8:ge,9:ie,10:pe,11:ue,12:fe,13:Me,14:Ce,15:Ye,18:[1,82]},e(Ze,[2,23]),e(Ze,[2,1]),e(Ze,[2,2]),e(Ze,[2,3]),e(Ze,[2,4]),e(Ze,[2,5]),e(Ze,[2,6]),e(Ze,[2,7]),e(Ze,[2,8]),e(Ze,[2,9]),e(Ze,[2,10]),e(Ze,[2,11]),e(Ze,[2,12]),e(l,[2,52],{58:31,43:84,4:d,5:h,10:f,12:p,13:m,14:g,15:y,60:P,61:D,63:M,64:O,65:_,66:B,67:F}),e(l,[2,55],{58:31,43:85,4:d,5:h,10:f,12:p,13:m,14:g,15:y,60:P,61:D,63:M,64:O,65:_,66:B,67:F}),{46:[1,86]},{45:[1,87]},{4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,16:90,17:he,18:de,19:me,20:ke,22:89,23:88},e(Ze,[2,24]),e(l,[2,51],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),e(l,[2,54],{59:60,58:61,4:d,5:h,8:G,10:f,12:p,13:m,14:g,15:y,18:z,63:M,64:O,65:_,66:B,67:F}),e(l,[2,47],{22:89,16:90,23:101,4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,17:he,18:de,19:me,20:ke}),{46:[1,102]},e(l,[2,29],{10:le}),e(W,[2,27],{16:104,4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,17:he,18:de,19:me,20:ke}),e(X,[2,25]),e(X,[2,13]),e(X,[2,14]),e(X,[2,15]),e(X,[2,16]),e(X,[2,17]),e(X,[2,18]),e(X,[2,19]),e(X,[2,20]),e(X,[2,21]),e(X,[2,22]),e(l,[2,49],{10:le}),e(l,[2,48],{22:89,16:90,23:105,4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,17:he,18:de,19:me,20:ke}),{4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,16:90,17:he,18:de,19:me,20:ke,22:106},e(X,[2,26]),e(l,[2,50],{10:le}),e(W,[2,28],{16:104,4:Qe,5:ve,6:Fe,8:Le,11:Be,13:ae,17:he,18:de,19:me,20:ke})],defaultActions:{8:[2,30],9:[2,31]},parseError:k(function(K,ee){if(ee.recoverable)this.trace(K);else{var Se=new Error(K);throw Se.hash=ee,Se}},"parseError"),parse:k(function(K){var ee=this,Se=[0],Te=[],Ae=[null],Ie=[],Ge=this.table,De="",He=0,ze=0,Ke=0,we=2,bt=1,Ve=Ie.slice.call(arguments,1),vt=Object.create(this.lexer),Pt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(Pt.yy[Xt]=this.yy[Xt]);vt.setInput(K,Pt.yy),Pt.yy.lexer=vt,Pt.yy.parser=this,typeof vt.yylloc>"u"&&(vt.yylloc={});var It=vt.yylloc;Ie.push(It);var Ot=vt.options&&vt.options.ranges;typeof Pt.yy.parseError=="function"?this.parseError=Pt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Et(Jt){Se.length=Se.length-2*Jt,Ae.length=Ae.length-Jt,Ie.length=Ie.length-Jt}k(Et,"popStack");function Ee(){var Jt;return Jt=Te.pop()||vt.lex()||bt,typeof Jt!="number"&&(Jt instanceof Array&&(Te=Jt,Jt=Te.pop()),Jt=ee.symbols_[Jt]||Jt),Jt}k(Ee,"lex");for(var gt,Ut,ct,Ne,at,ft,Ct={},Er,Wt,Sr,on;;){if(ct=Se[Se.length-1],this.defaultActions[ct]?Ne=this.defaultActions[ct]:((gt===null||typeof gt>"u")&&(gt=Ee()),Ne=Ge[ct]&&Ge[ct][gt]),typeof Ne>"u"||!Ne.length||!Ne[0]){var ir="";on=[];for(Er in Ge[ct])this.terminals_[Er]&&Er>we&&on.push("'"+this.terminals_[Er]+"'");vt.showPosition?ir="Parse error on line "+(He+1)+`: -`+vt.showPosition()+` -Expecting `+on.join(", ")+", got '"+(this.terminals_[gt]||gt)+"'":ir="Parse error on line "+(He+1)+": Unexpected "+(gt==bt?"end of input":"'"+(this.terminals_[gt]||gt)+"'"),this.parseError(ir,{text:vt.match,token:this.terminals_[gt]||gt,line:vt.yylineno,loc:It,expected:on})}if(Ne[0]instanceof Array&&Ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ct+", token: "+gt);switch(Ne[0]){case 1:Se.push(gt),Ae.push(vt.yytext),Ie.push(vt.yylloc),Se.push(Ne[1]),gt=null,Ut?(gt=Ut,Ut=null):(ze=vt.yyleng,De=vt.yytext,He=vt.yylineno,It=vt.yylloc,Ke>0&&Ke--);break;case 2:if(Wt=this.productions_[Ne[1]][1],Ct.$=Ae[Ae.length-Wt],Ct._$={first_line:Ie[Ie.length-(Wt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(Wt||1)].first_column,last_column:Ie[Ie.length-1].last_column},Ot&&(Ct._$.range=[Ie[Ie.length-(Wt||1)].range[0],Ie[Ie.length-1].range[1]]),ft=this.performAction.apply(Ct,[De,ze,He,Pt.yy,Ne[1],Ae,Ie].concat(Ve)),typeof ft<"u")return ft;Wt&&(Se=Se.slice(0,-1*Wt*2),Ae=Ae.slice(0,-1*Wt),Ie=Ie.slice(0,-1*Wt)),Se.push(this.productions_[Ne[1]][0]),Ae.push(Ct.$),Ie.push(Ct._$),Sr=Ge[Se[Se.length-2]][Se[Se.length-1]],Se.push(Sr);break;case 3:return!0}}return!0},"parse")},j=(function(){var J={EOF:1,parseError:k(function(ee,Se){if(this.yy.parser)this.yy.parser.parseError(ee,Se);else throw new Error(ee)},"parseError"),setInput:k(function(K,ee){return this.yy=ee||this.yy||{},this._input=K,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var K=this._input[0];this.yytext+=K,this.yyleng++,this.offset++,this.match+=K,this.matched+=K;var ee=K.match(/(?:\r\n?|\n).*/g);return ee?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),K},"input"),unput:k(function(K){var ee=K.length,Se=K.split(/(?:\r\n?|\n)/g);this._input=K+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ee),this.offset-=ee;var Te=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),Se.length-1&&(this.yylineno-=Se.length-1);var Ae=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:Se?(Se.length===Te.length?this.yylloc.first_column:0)+Te[Te.length-Se.length].length-Se[0].length:this.yylloc.first_column-ee},this.options.ranges&&(this.yylloc.range=[Ae[0],Ae[0]+this.yyleng-ee]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(K){this.unput(this.match.slice(K))},"less"),pastInput:k(function(){var K=this.matched.substr(0,this.matched.length-this.match.length);return(K.length>20?"...":"")+K.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var K=this.match;return K.length<20&&(K+=this._input.substr(0,20-K.length)),(K.substr(0,20)+(K.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var K=this.pastInput(),ee=new Array(K.length+1).join("-");return K+this.upcomingInput()+` -`+ee+"^"},"showPosition"),test_match:k(function(K,ee){var Se,Te,Ae;if(this.options.backtrack_lexer&&(Ae={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&&(Ae.yylloc.range=this.yylloc.range.slice(0))),Te=K[0].match(/(?:\r\n?|\n).*/g),Te&&(this.yylineno+=Te.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Te?Te[Te.length-1].length-Te[Te.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+K[0].length},this.yytext+=K[0],this.match+=K[0],this.matches=K,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(K[0].length),this.matched+=K[0],Se=this.performAction.call(this,this.yy,this,ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Se)return Se;if(this._backtrack){for(var Ie in Ae)this[Ie]=Ae[Ie];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var K,ee,Se,Te;this._more||(this.yytext="",this.match="");for(var Ae=this._currentRules(),Ie=0;Ieee[0].length)){if(ee=Se,Te=Ie,this.options.backtrack_lexer){if(K=this.test_match(Se,Ae[Ie]),K!==!1)return K;if(this._backtrack){ee=!1;continue}else return!1}else if(!this.options.flex)break}return ee?(K=this.test_match(ee,Ae[Te]),K!==!1?K:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var ee=this.next();return ee||this.lex()},"lex"),begin:k(function(ee){this.conditionStack.push(ee)},"begin"),popState:k(function(){var ee=this.conditionStack.length-1;return ee>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(ee){return ee=this.conditionStack.length-1-Math.abs(ee||0),ee>=0?this.conditionStack[ee]:"INITIAL"},"topState"),pushState:k(function(ee){this.begin(ee)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(ee,Se,Te,Ae){var Ie=Ae;switch(Te){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;break;case 5:return this.popState(),"title_value";break;case 6:return this.begin("acc_title"),37;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),39;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;break;case 29:return this.begin("point_start"),44;break;case 30:return this.begin("point_x"),45;break;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;break;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return J})();q.lexer=j;function se(){this.yy={}}return k(se,"Parser"),se.prototype=q,q.Parser=se,new se})();Jxe.parser=Jxe;OIr=Jxe,qu=Bc(),BIr=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{k(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:Xr.quadrantChart?.chartWidth||500,chartWidth:Xr.quadrantChart?.chartHeight||500,titlePadding:Xr.quadrantChart?.titlePadding||10,titleFontSize:Xr.quadrantChart?.titleFontSize||20,quadrantPadding:Xr.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:Xr.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:Xr.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:Xr.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:Xr.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:Xr.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:Xr.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:Xr.quadrantChart?.pointTextPadding||5,pointLabelFontSize:Xr.quadrantChart?.pointLabelFontSize||12,pointRadius:Xr.quadrantChart?.pointRadius||5,xAxisPosition:Xr.quadrantChart?.xAxisPosition||"top",yAxisPosition:Xr.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:Xr.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:Xr.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:qu.quadrant1Fill,quadrant2Fill:qu.quadrant2Fill,quadrant3Fill:qu.quadrant3Fill,quadrant4Fill:qu.quadrant4Fill,quadrant1TextFill:qu.quadrant1TextFill,quadrant2TextFill:qu.quadrant2TextFill,quadrant3TextFill:qu.quadrant3TextFill,quadrant4TextFill:qu.quadrant4TextFill,quadrantPointFill:qu.quadrantPointFill,quadrantPointTextFill:qu.quadrantPointTextFill,quadrantXAxisTextFill:qu.quadrantXAxisTextFill,quadrantYAxisTextFill:qu.quadrantYAxisTextFill,quadrantTitleFill:qu.quadrantTitleFill,quadrantInternalBorderStrokeFill:qu.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:qu.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ye.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){ye.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ye.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,t,r,n){let i=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:e==="top"&&t?i:0,bottom:e==="bottom"&&t?i:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,s={left:this.config.yAxisPosition==="left"&&r?o:0,right:this.config.yAxisPosition==="right"&&r?o:0},l=this.config.titleFontSize+this.config.titlePadding*2,u={top:n?l:0},d=this.config.quadrantPadding+s.left,h=this.config.quadrantPadding+a.top+u.top,f=this.config.chartWidth-this.config.quadrantPadding*2-s.left-s.right,p=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-u.top,m=f/2,g=p/2;return{xAxisSpace:a,yAxisSpace:s,titleSpace:u,quadrantSpace:{quadrantLeft:d,quadrantTop:h,quadrantWidth:f,quadrantHalfWidth:m,quadrantHeight:p,quadrantHalfHeight:g}}}getAxisLabels(e,t,r,n){let{quadrantSpace:i,titleSpace:a}=n,{quadrantHalfHeight:o,quadrantHeight:s,quadrantLeft:l,quadrantHalfWidth:u,quadrantTop:d,quadrantWidth:h}=i,f=!!this.data.xAxisRightText,p=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&t&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(f?u/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:f?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&t&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+u+(f?u/2:0),y:e==="top"?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:f?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&r&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:d+s-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&r&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+h+this.config.quadrantPadding,y:d+o-(p?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){let{quadrantSpace:t}=e,{quadrantHalfHeight:r,quadrantLeft:n,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:n+i,y:a,width:i,height:r,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:n,y:a,width:i,height:r,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:n,y:a+r,width:i,height:r,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:n+i,y:a+r,width:i,height:r,fill:this.themeConfig.quadrant4Fill}];for(let s of o)s.text.x=s.x+s.width/2,this.data.points.length===0?(s.text.y=s.y+s.height/2,s.text.horizontalPos="middle"):(s.text.y=s.y+this.config.quadrantTextTopPadding,s.text.horizontalPos="top");return o}getQuadrantPoints(e){let{quadrantSpace:t}=e,{quadrantHeight:r,quadrantLeft:n,quadrantTop:i,quadrantWidth:a}=t,o=l0().domain([0,1]).range([n,a+n]),s=l0().domain([0,1]).range([r+i,i]);return this.data.points.map(u=>{let d=this.classes.get(u.className);return d&&(u={...d,...u}),{x:o(u.x),y:s(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:o(u.x),y:s(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(e){let t=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:s,quadrantWidth:l}=r;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+n,x2:a+l-t,y2:s+n}]}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(){let e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),t=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),r=this.config.showTitle&&!!this.data.titleText,n=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(n,e,t,r);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(n,e,t,i),borderLines:this.getBorders(i),title:this.getTitle(r)}}},c$=class extends Error{static{k(this,"InvalidStyleError")}constructor(e,t,r){super(`value for ${e} ${t} is invalid, please use a valid ${r}`),this.name="InvalidStyleError"}};k(ewe,"validateHexCode");k(O5t,"validateNumber");k(B5t,"validateSizeInPixels");k(Qg,"textSanitizer");vc=new BIr;k(F5t,"setQuadrant1Text");k(z5t,"setQuadrant2Text");k(G5t,"setQuadrant3Text");k(W5t,"setQuadrant4Text");k(V5t,"setXAxisLeftText");k(H5t,"setXAxisRightText");k(q5t,"setYAxisTopText");k(Y5t,"setYAxisBottomText");k(u$,"parseStyles");k(j5t,"addPoint");k(X5t,"addClass");k($5t,"setWidth");k(K5t,"setHeight");k(Z5t,"getQuadrantData");FIr=k(function(){vc.clear(),$r()},"clear"),zIr={setWidth:$5t,setHeight:K5t,setQuadrant1Text:F5t,setQuadrant2Text:z5t,setQuadrant3Text:G5t,setQuadrant4Text:W5t,setXAxisLeftText:V5t,setXAxisRightText:H5t,setYAxisTopText:q5t,setYAxisBottomText:Y5t,parseStyles:u$,addPoint:j5t,addClass:X5t,getQuadrantData:Z5t,clear:FIr,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn},GIr=k((e,t,r,n)=>{function i(S){return S==="top"?"hanging":"middle"}k(i,"getDominantBaseLine");function a(S){return S==="left"?"start":"middle"}k(a,"getTextAnchor");function o(S){return`translate(${S.x}, ${S.y}) rotate(${S.rotation||0})`}k(o,"getTransformation");let s=je();ye.debug(`Rendering quadrant chart -`+e);let l=s.securityLevel,u;l==="sandbox"&&(u=xt("#i"+t));let h=(l==="sandbox"?xt(u.nodes()[0].contentDocument.body):xt("body")).select(`[id="${t}"]`),f=h.append("g").attr("class","main"),p=s.quadrantChart?.chartWidth??500,m=s.quadrantChart?.chartHeight??500;zn(h,m,p,s.quadrantChart?.useMaxWidth??!0),h.attr("viewBox","0 0 "+p+" "+m),n.db.setHeight(m),n.db.setWidth(p);let g=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),b=f.append("g").attr("class","data-points"),x=f.append("g").attr("class","labels"),E=f.append("g").attr("class","title");g.title&&E.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",i(g.title.horizontalPos)).attr("text-anchor",a(g.title.verticalPos)).attr("transform",o(g.title)).text(g.title.text),g.borderLines&&v.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",S=>S.x1).attr("y1",S=>S.y1).attr("x2",S=>S.x2).attr("y2",S=>S.y2).style("stroke",S=>S.strokeFill).style("stroke-width",S=>S.strokeWidth);let w=y.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");w.append("rect").attr("x",S=>S.x).attr("y",S=>S.y).attr("width",S=>S.width).attr("height",S=>S.height).attr("fill",S=>S.fill),w.append("text").attr("x",0).attr("y",0).attr("fill",S=>S.text.fill).attr("font-size",S=>S.text.fontSize).attr("dominant-baseline",S=>i(S.text.horizontalPos)).attr("text-anchor",S=>a(S.text.verticalPos)).attr("transform",S=>o(S.text)).text(S=>S.text.text),x.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(S=>S.text).attr("fill",S=>S.fill).attr("font-size",S=>S.fontSize).attr("dominant-baseline",S=>i(S.horizontalPos)).attr("text-anchor",S=>a(S.verticalPos)).attr("transform",S=>o(S));let C=b.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",S=>S.x).attr("cy",S=>S.y).attr("r",S=>S.radius).attr("fill",S=>S.fill).attr("stroke",S=>S.strokeColor).attr("stroke-width",S=>S.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(S=>S.text.text).attr("fill",S=>S.text.fill).attr("font-size",S=>S.text.fontSize).attr("dominant-baseline",S=>i(S.text.horizontalPos)).attr("text-anchor",S=>a(S.text.verticalPos)).attr("transform",S=>o(S.text))},"draw"),WIr={draw:GIr},VIr={parser:OIr,db:zIr,renderer:WIr,styles:k(()=>"","styles")}});var x4t={};gr(x4t,{diagram:()=>sRr});function d$(e){return e.type==="bar"}function h$(e){return e.type==="band"}function vA(e){return e.type==="linear"}function rwe(e,t,r,n){let i=new awe(n);return h$(e)?new qIr(t,r,e.categories,e.title,i):new YIr(t,r,[e.min,e.max],e.title,i)}function n4t(e,t,r,n){let i=new awe(n);return new jIr(i,e,t,r)}function nwe(e){return{fontSize:e,markerSize:e*XIr,markerSpacing:e*KIr,itemSpacing:e*$Ir}}function i4t(e,t,r,n){let i=new awe(n);return new ZIr(i,e,t,r)}function a4t(e,t,r){return new eRr(e,t,r)}function swe(){let e=Bc(),t=Kt();return Kn(e.xyChart,t.themeVariables.xyChart)}function lwe(){let e=Kt();return Kn(Xr.xyChart,e.xyChart)}function cwe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function x6(e){let t=Kt();return rn(e.trim(),t)}function s4t(e){o4t=e}function l4t(e){e==="horizontal"?sD.chartOrientation="horizontal":sD.chartOrientation="vertical"}function c4t(e){ki.xAxis.title=x6(e.text)}function uwe(e,t){ki.xAxis={type:"linear",title:ki.xAxis.title,min:e,max:t},f$=!0}function u4t(e){ki.xAxis={type:"band",title:ki.xAxis.title,categories:e.map(t=>x6(t.text))},f$=!0}function d4t(e){ki.yAxis.title=x6(e.text)}function h4t(e,t){ki.yAxis={type:"linear",title:ki.yAxis.title,min:e,max:t},owe=!0}function f4t(e){let t=Math.min(...e),r=Math.max(...e),n=vA(ki.yAxis)?ki.yAxis.min:1/0,i=vA(ki.yAxis)?ki.yAxis.max:-1/0;ki.yAxis={type:"linear",title:ki.yAxis.title,min:Math.min(n,t),max:Math.max(i,r)}}function dwe(e){let t=[];if(e.length===0)return t;if(!f$){let r=vA(ki.xAxis)?ki.xAxis.min:1/0,n=vA(ki.xAxis)?ki.xAxis.max:-1/0;uwe(Math.min(r,1),Math.max(n,e.length))}if(h$(ki.xAxis)&&e.length>ki.xAxis.categories.length&&(e=e.slice(0,ki.xAxis.categories.length)),owe||f4t(e),h$(ki.xAxis)&&(t=ki.xAxis.categories.map((r,n)=>[r,e[n]])),vA(ki.xAxis)){let r=ki.xAxis.min,n=ki.xAxis.max;if(e.length===1)t=[[`${r}`,e[0]]];else{let i=(n-r)/(e.length-1);t=e.map((a,o)=>[`${r+o*i}`,a])}}return t}function hwe(e){return iwe[e===0?0:e%iwe.length]}function p4t(e,t){let r=t.map(o=>o.value),n=t.map(o=>o.label?x6(o.label):""),i=dwe(r),a=n.some(o=>o!=="");ki.plots.push({type:"line",title:x6(e.text),strokeFill:hwe(oD),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),oD++}function m4t(e,t){let r=t.map(i=>i.value),n=dwe(r);ki.plots.push({type:"bar",title:x6(e.text),fill:hwe(oD),data:n}),oD++}function g4t(){if(ki.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return ki.title=yn(),rRr.build(sD,ki,lD,o4t)}function y4t(){return lD}function v4t(){return sD}function b4t(){return ki}var twe,HIr,awe,e4t,t4t,r4t,qIr,YIr,jIr,XIr,$Ir,KIr,ZIr,QIr,JIr,eRr,tRr,rRr,oD,o4t,sD,lD,ki,iwe,f$,owe,nRr,iRr,aRr,oRr,sRr,w4t=H(()=>{cs();ds();us();Vn();Wr();Gr();xr();_n();_n();_n();twe=(function(){var e=k(function(M,O,_,B){for(_=_||{},B=M.length;B--;_[M[B]]=O);return _},"o"),t=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],o=[1,7],s=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],h=[1,29],f=[1,30],p=[1,31],m=[1,32],g=[1,33],y=[1,34],v=[1,35],b=[1,36],x=[1,37],E=[1,43],w=[1,42],T=[1,47],C=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],R=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],U=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],L=[1,65],I=[26,28],A={trace:k(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,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$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",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"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],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:k(function(O,_,B,F,G,z,V){var $=z.length-1;switch(G){case 5:F.setOrientation(z[$]);break;case 9:F.setDiagramTitle(z[$].text.trim());break;case 12:F.setLineData({text:"",type:"text"},z[$]);break;case 13:F.setLineData(z[$-1],z[$]);break;case 14:F.setBarData({text:"",type:"text"},z[$]);break;case 15:F.setBarData(z[$-1],z[$]);break;case 16:this.$=z[$].trim(),F.setAccTitle(this.$);break;case 17:case 18:this.$=z[$].trim(),F.setAccDescription(this.$);break;case 19:this.$=z[$-1];break;case 20:case 30:this.$=[z[$-2],...z[$]];break;case 21:case 31:this.$=[z[$]];break;case 22:this.$={value:Number(z[$-1]),label:z[$]};break;case 23:this.$={value:Number(z[$]),label:""};break;case 24:F.setXAxisTitle(z[$]);break;case 25:F.setXAxisTitle(z[$-1]);break;case 26:F.setXAxisTitle({type:"text",text:""});break;case 27:F.setXAxisBand(z[$]);break;case 28:F.setXAxisRangeData(Number(z[$-2]),Number(z[$]));break;case 29:this.$=z[$-1];break;case 32:F.setYAxisTitle(z[$]);break;case 33:F.setYAxisTitle(z[$-1]);break;case 34:F.setYAxisTitle({type:"text",text:""});break;case 35:F.setYAxisRangeData(Number(z[$-2]),Number(z[$]));break;case 39:this.$={text:z[$],type:"text"};break;case 40:this.$={text:z[$],type:"text"};break;case 41:this.$={text:z[$],type:"markdown"};break;case 42:this.$=z[$];break;case 43:this.$=z[$-1]+""+z[$];break}},"anonymous"),table:[e(t,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:o}),{1:[3]},e(t,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:o}),e(t,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38: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,36]),e(s,[2,37]),e(s,[2,38]),{1:[2,1]},e(t,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:o}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,36:i,37:a,38:o}),{11:23,30:l,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},{11:39,13:38,24:E,29:w,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},{11:45,15:44,29:T,30:l,35:46,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},{11:49,17:48,24:C,30:l,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},{11:52,17:51,24:C,30:l,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(R,[2,39],{41:55,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x}),e(R,[2,40]),e(R,[2,41]),e(U,[2,42]),e(U,[2,44]),e(U,[2,45]),e(U,[2,46]),e(U,[2,47]),e(U,[2,48]),e(U,[2,49]),e(U,[2,50]),e(U,[2,51]),e(U,[2,52]),e(U,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:E,29:w}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},e(S,[2,11]),e(S,[2,32],{35:60,29:T}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:C},{25:63,27:64,29:L},e(S,[2,14]),{17:66,24:C},e(S,[2,16]),e(S,[2,17]),e(U,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(I,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:h,44:f,45:p,46:m,47:g,48:y,49:v,50:b,51:x},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:L},e(I,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:k(function(O,_){if(_.recoverable)this.trace(O);else{var B=new Error(O);throw B.hash=_,B}},"parseError"),parse:k(function(O){var _=this,B=[0],F=[],G=[null],z=[],V=this.table,$="",Z=0,re=0,Q=0,ge=2,ie=1,pe=z.slice.call(arguments,1),ue=Object.create(this.lexer),fe={yy:{}};for(var Me in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Me)&&(fe.yy[Me]=this.yy[Me]);ue.setInput(O,fe.yy),fe.yy.lexer=ue,fe.yy.parser=this,typeof ue.yylloc>"u"&&(ue.yylloc={});var Ce=ue.yylloc;z.push(Ce);var Ye=ue.options&&ue.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(q){B.length=B.length-2*q,G.length=G.length-q,z.length=z.length-q}k(Ze,"popStack");function Qe(){var q;return q=F.pop()||ue.lex()||ie,typeof q!="number"&&(q instanceof Array&&(F=q,q=F.pop()),q=_.symbols_[q]||q),q}k(Qe,"lex");for(var ve,Fe,Le,Be,ae,he,de={},me,ke,le,W;;){if(Le=B[B.length-1],this.defaultActions[Le]?Be=this.defaultActions[Le]:((ve===null||typeof ve>"u")&&(ve=Qe()),Be=V[Le]&&V[Le][ve]),typeof Be>"u"||!Be.length||!Be[0]){var X="";W=[];for(me in V[Le])this.terminals_[me]&&me>ge&&W.push("'"+this.terminals_[me]+"'");ue.showPosition?X="Parse error on line "+(Z+1)+`: -`+ue.showPosition()+` -Expecting `+W.join(", ")+", got '"+(this.terminals_[ve]||ve)+"'":X="Parse error on line "+(Z+1)+": Unexpected "+(ve==ie?"end of input":"'"+(this.terminals_[ve]||ve)+"'"),this.parseError(X,{text:ue.match,token:this.terminals_[ve]||ve,line:ue.yylineno,loc:Ce,expected:W})}if(Be[0]instanceof Array&&Be.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+ve);switch(Be[0]){case 1:B.push(ve),G.push(ue.yytext),z.push(ue.yylloc),B.push(Be[1]),ve=null,Fe?(ve=Fe,Fe=null):(re=ue.yyleng,$=ue.yytext,Z=ue.yylineno,Ce=ue.yylloc,Q>0&&Q--);break;case 2:if(ke=this.productions_[Be[1]][1],de.$=G[G.length-ke],de._$={first_line:z[z.length-(ke||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(ke||1)].first_column,last_column:z[z.length-1].last_column},Ye&&(de._$.range=[z[z.length-(ke||1)].range[0],z[z.length-1].range[1]]),he=this.performAction.apply(de,[$,re,Z,fe.yy,Be[1],G,z].concat(pe)),typeof he<"u")return he;ke&&(B=B.slice(0,-1*ke*2),G=G.slice(0,-1*ke),z=z.slice(0,-1*ke)),B.push(this.productions_[Be[1]][0]),G.push(de.$),z.push(de._$),le=V[B[B.length-2]][B[B.length-1]],B.push(le);break;case 3:return!0}}return!0},"parse")},P=(function(){var M={EOF:1,parseError:k(function(_,B){if(this.yy.parser)this.yy.parser.parseError(_,B);else throw new Error(_)},"parseError"),setInput:k(function(O,_){return this.yy=_||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var _=O.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:k(function(O){var _=O.length,B=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var F=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),B.length-1&&(this.yylineno-=B.length-1);var G=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:B?(B.length===F.length?this.yylloc.first_column:0)+F[F.length-B.length].length-B[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(O){this.unput(this.match.slice(O))},"less"),pastInput:k(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var O=this.pastInput(),_=new Array(O.length+1).join("-");return O+this.upcomingInput()+` -`+_+"^"},"showPosition"),test_match:k(function(O,_){var B,F,G;if(this.options.backtrack_lexer&&(G={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&&(G.yylloc.range=this.yylloc.range.slice(0))),F=O[0].match(/(?:\r\n?|\n).*/g),F&&(this.yylineno+=F.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:F?F[F.length-1].length-F[F.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],B=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var z in G)this[z]=G[z];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,_,B,F;this._more||(this.yytext="",this.match="");for(var G=this._currentRules(),z=0;z_[0].length)){if(_=B,F=z,this.options.backtrack_lexer){if(O=this.test_match(B,G[z]),O!==!1)return O;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(O=this.test_match(_,G[F]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var _=this.next();return _||this.lex()},"lex"),begin:k(function(_){this.conditionStack.push(_)},"begin"),popState:k(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:k(function(_){this.begin(_)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(_,B,F,G){var z=G;switch(F){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"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,/^(?:xychart\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,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],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:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return M})();A.lexer=P;function D(){this.yy={}}return k(D,"Parser"),D.prototype=A,A.Parser=D,new D})();twe.parser=twe;HIr=twe;k(d$,"isBarPlot");k(h$,"isBandAxisData");k(vA,"isLinearAxisData");awe=class{constructor(e){this.parentGroup=e}static{k(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((i,a)=>Math.max(a.length,i),0)*t,height:t};let r={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",t);for(let i of e){let a=bue(n,1,i),o=a?a.width:i.length*t,s=a?a.height:t;r.width=Math.max(r.width,o),r.height=Math.max(r.height,s)}return n.remove(),r}},e4t=.7,t4t=.2,r4t=class{constructor(e,t,r,n){this.axisConfig=e,this.title=t,this.textDimensionCalculator=r,this.axisThemeConfig=n,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.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{k(this,"BaseAxis")}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?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(){let 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(){e4t*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(e4t*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){let r=this.getLabelDimension(),n=t4t*e.width;this.outerPadding=Math.min(r.width/2,n);let i=r.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*r.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*r.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=r.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){let r=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=r.height+this.axisConfig.titlePadding*2;this.titleTextHeight=r.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){let r=this.getLabelDimension(),n=t4t*e.height;this.outerPadding=Math.min(r.height/2,n);let i=r.width+this.axisConfig.labelPadding*2;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){let r=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=r.height+this.axisConfig.titlePadding*2;this.titleTextHeight=r.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?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}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let 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(t=>({text:t.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(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let 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(r=>({path:`M ${t},${this.getScaleValue(r)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(r)}`,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(){let e=[];if(this.showAxisLine){let 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(t=>({text:t.toString(),x:this.getScaleValue(t)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(r=>({path:`M ${this.getScaleValue(r)},${t} L ${this.getScaleValue(r)},${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(){let e=[];if(this.showAxisLine){let 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(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let t=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(r=>({path:`M ${this.getScaleValue(r)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(r)},${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(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},qIr=class extends r4t{static{k(this,"BandAxis")}constructor(e,t,r,n,i){super(e,n,i,t),this.categories=r,this.scale=Nk().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Nk().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ye.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},YIr=class extends r4t{static{k(this,"LinearAxis")}constructor(e,t,r,n,i){super(e,n,i,t),this.domain=r,this.scale=l0().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=l0().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};k(rwe,"getAxis");jIr=class{constructor(e,t,r,n){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{k(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),r=Math.max(t.width,e.width),n=t.height+2*this.chartConfig.titlePadding;return t.width<=r&&t.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=r,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let 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}};k(n4t,"getChartTitleComponent");XIr=.75,$Ir=.5,KIr=.35;k(nwe,"getLegendLayout");ZIr=class{constructor(e,t,r,n){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{k(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(l=>l.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:t,markerSize:r,markerSpacing:n,itemSpacing:i}=nwe(this.chartConfig.legendFontSize),a=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(l=>l.title),t),o=this.chartConfig.legendPadding*2+r+n+a.width,s=this.chartConfig.legendPadding*2+this.visiblePlots.length*t+(this.visiblePlots.length-1)*i;return o<=e.width&&s<=e.height?(this.boundingRect.width=o,this.boundingRect.height=s):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:t,markerSpacing:r,itemSpacing:n}=nwe(this.chartConfig.legendFontSize),i=e+n,a=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,s=[],l=[];for(let[u,d]of this.visiblePlots.entries())if(d$(d))s.push({x:a,y:o+u*i,width:t,height:t,fill:d.fill,strokeFill:d.fill,strokeWidth:0});else{let h=o+u*i+t/2;l.push({path:`M ${a},${h} L ${a+t},${h}`,strokeFill:d.strokeFill,strokeWidth:d.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:s},{groupTexts:["legend","markers"],type:"path",data:l},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((u,d)=>({text:u.title,x:a+t+r,y:o+d*i+t/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};k(i4t,"getChartLegendComponent");QIr=class{constructor(e,t,r,n,i){this.plotData=e,this.xAxis=t,this.yAxis=r,this.orientation=n,this.plotIndex=i}static{k(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),t;if(this.orientation==="horizontal"?t=v2().y(n=>n[0]).x(n=>n[1])(e):t=v2().x(n=>n[0]).y(n=>n[1])(e),!t)return[];let r=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let a=[];for(let[o,[s,l]]of e.entries()){let u=this.plotData.pointLabels[o];u&&(this.orientation==="horizontal"?a.push({x:l+10,y:s,text:u,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):a.push({x:s,y:l-10,text:u,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}a.length>0&&r.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return r}},JIr=class{constructor(e,t,r,n,i,a){this.barData=e,this.boundingRect=t,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}static{k(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]),r=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=r/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(i=>({x:this.boundingRect.x,y:i[0]-n,height:r,width:i[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(i=>({x:i[0]-n,y:i[1],width:r,height:this.boundingRect.y+this.boundingRect.height-i[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},eRr=class{constructor(e,t,r){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0}}static{k(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");let e=[];for(let[t,r]of this.chartData.plots.entries())switch(r.type){case"line":{let n=new QIr(r,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...n.getDrawableElement())}break;case"bar":{let n=new JIr(r,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...n.getDrawableElement())}break}return e}};k(a4t,"getPlotComponent");tRr=class{constructor(e,t,r,n){this.chartConfig=e,this.chartData=t,this.componentStore={title:n4t(e,t,r,n),plot:a4t(e,t,r),legend:i4t(e,t,r,n),xAxis:rwe(t.xAxis,e.xAxis,{titleColor:r.xAxisTitleColor,labelColor:r.xAxisLabelColor,tickColor:r.xAxisTickColor,axisLineColor:r.xAxisLineColor},n),yAxis:rwe(t.yAxis,e.yAxis,{titleColor:r.yAxisTitleColor,labelColor:r.yAxisLabelColor,tickColor:r.yAxisTickColor,axisLineColor:r.yAxisLineColor},n)}}static{k(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,r=0,n=0,i={width:0,height: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("bottom"),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),r=s.width,e-=s.width,i=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=i.width,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:n}),this.componentStore.legend.setBoundingBoxXY({x:r+a,y:n+Math.max((o-i.height)/2,0)}),this.componentStore.xAxis.setRange([r,r+a]),this.componentStore.xAxis.setBoundingBoxXY({x:r,y:n+o}),this.componentStore.yAxis.setRange([n,n+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(l=>d$(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,r=0,n=0,i=0,a={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:o,height:s});e-=l.width,t-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=l.height,t-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=l.width,n=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=l.height,i=r+l.height,a=this.componentStore.legend.calculateSpace({width:e,height:s}),e-=a.width,e>0&&(o+=e,e=0),t>0&&(s+=t,t=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.legend.setBoundingBoxXY({x:n+o,y:i+Math.max((s-a.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+o]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(u=>d$(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},rRr=class{static{k(this,"XYChartBuilder")}static build(e,t,r,n){return new tRr(e,t,r,n).getDrawableElement()}},oD=0,sD=lwe(),lD=swe(),ki=cwe(),iwe=lD.plotColorPalette.split(",").map(e=>e.trim()),f$=!1,owe=!1;k(swe,"getChartDefaultThemeConfig");k(lwe,"getChartDefaultConfig");k(cwe,"getChartDefaultData");k(x6,"textSanitizer");k(s4t,"setTmpSVGG");k(l4t,"setOrientation");k(c4t,"setXAxisTitle");k(uwe,"setXAxisRangeData");k(u4t,"setXAxisBand");k(d4t,"setYAxisTitle");k(h4t,"setYAxisRangeData");k(f4t,"setYAxisRangeFromPlotData");k(dwe,"transformDataWithoutCategory");k(hwe,"getPlotColorFromPalette");k(p4t,"setLineData");k(m4t,"setBarData");k(g4t,"getDrawableElem");k(y4t,"getChartThemeConfig");k(v4t,"getChartConfig");k(b4t,"getXYChartData");nRr=k(function(){$r(),oD=0,sD=lwe(),ki=cwe(),lD=swe(),iwe=lD.plotColorPalette.split(",").map(e=>e.trim()),f$=!1,owe=!1},"clear"),iRr={getDrawableElem:g4t,clear:nRr,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn,setOrientation:l4t,setXAxisTitle:c4t,setXAxisRangeData:uwe,setXAxisBand:u4t,setYAxisTitle:d4t,setYAxisRangeData:h4t,setLineData:p4t,setBarData:m4t,setTmpSVGG:s4t,getChartThemeConfig:y4t,getChartConfig:v4t,getXYChartData:b4t},aRr=k((e,t,r,n)=>{let i=n.db,a=i.getChartThemeConfig(),o=i.getChartConfig(),s=i.getXYChartData().plots[0].data.map(x=>x[1]);function l(x){return x==="top"?"text-before-edge":"middle"}k(l,"getDominantBaseLine");function u(x){return x==="left"?"start":x==="right"?"end":"middle"}k(u,"getTextAnchor");function d(x){return`translate(${x.x}, ${x.y}) rotate(${x.rotation||0})`}k(d,"getTextTransformation"),ye.debug(`Rendering xychart chart -`+e);let h=Mi(t),f=h.append("g").attr("class","main"),p=f.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");zn(h,o.height,o.width,!0),h.attr("viewBox",`0 0 ${o.width} ${o.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(h.append("g").attr("class","mermaid-tmp-group"));let m=i.getDrawableElem(),g={};function y(x){let E=f,w="";for(let[T]of x.entries()){let C=f;T>0&&g[w]&&(C=g[w]),w+=x[T],E=g[w],E||(E=g[w]=C.append("g").attr("class",x[T]))}return E}k(y,"getGroup");for(let x of m){if(x.data.length===0)continue;let E=y(x.groupTexts);switch(x.type){case"rect":if(E.selectAll("rect").data(x.data).enter().append("rect").attr("x",w=>w.x).attr("y",w=>w.y).attr("width",w=>w.width).attr("height",w=>w.height).attr("fill",w=>w.fill).attr("stroke",w=>w.strokeFill).attr("stroke-width",w=>w.strokeWidth),o.showDataLabel){let w=o.showDataLabelOutsideBar;if(o.chartOrientation==="horizontal"){let T=function(A,P){let{data:D,label:M}=A;return P*M.length*C<=D.width-S};var v=T;k(T,"fitsHorizontally");let C=.7,S=10,R=x.data.map((A,P)=>({data:A,label:s[P].toString()})).filter(A=>A.data.width>0&&A.data.height>0),U=R.map(A=>{let{data:P}=A,D=P.height*.7;for(;!T(A,D)&&D>0;)D-=1;return D}),L=Math.floor(Math.min(...U)),I=k(A=>w?A.data.x+A.data.width+S:A.data.x+A.data.width-S,"determineLabelXPosition");E.selectAll("text").data(R).enter().append("text").attr("x",I).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",w?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${L}px`).text(A=>A.label)}else{let T=function(I,A,P){let{data:D,label:M}=I,_=A*M.length*.7,B=D.x+D.width/2,F=B-_/2,G=B+_/2,z=F>=D.x&&G<=D.x+D.width,V=D.y+P+A<=D.y+D.height;return z&&V};var b=T;k(T,"fitsInBar");let C=10,S=x.data.map((I,A)=>({data:I,label:s[A].toString()})).filter(I=>I.data.width>0&&I.data.height>0),R=S.map(I=>{let{data:A,label:P}=I,D=A.width/(P.length*.7);for(;!T(I,D,C)&&D>0;)D-=1;return D}),U=Math.floor(Math.min(...R)),L=k(I=>w?I.data.y-C:I.data.y+C,"determineLabelYPosition");E.selectAll("text").data(S).enter().append("text").attr("x",I=>I.data.x+I.data.width/2).attr("y",L).attr("text-anchor","middle").attr("dominant-baseline",w?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${U}px`).text(I=>I.label)}}break;case"text":E.selectAll("text").data(x.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",w=>w.fill).attr("font-size",w=>w.fontSize).attr("dominant-baseline",w=>l(w.verticalPos)).attr("text-anchor",w=>u(w.horizontalPos)).attr("transform",w=>d(w)).text(w=>w.text);break;case"path":E.selectAll("path").data(x.data).enter().append("path").attr("d",w=>w.path).attr("fill",w=>w.fill?w.fill:"none").attr("stroke",w=>w.strokeFill).attr("stroke-width",w=>w.strokeWidth);break}}},"draw"),oRr={draw:aRr},sRr={parser:HIr,db:iRr,renderer:oRr}});var T4t={};gr(T4t,{diagram:()=>pRr});var fwe,lRr,cRr,uRr,dRr,hRr,E4t,fRr,pRr,k4t=H(()=>{Oh();Fd();_d();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();fwe=(function(){var e=k(function(X,q,j,se){for(j=j||{},se=X.length;se--;j[X[se]]=q);return j},"o"),t=[1,3],r=[1,4],n=[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],u=[1,27],d=[1,28],h=[1,29],f=[1,33],p=[1,34],m=[1,35],g=[1,36],y=[1,37],v=[1,38],b=[1,24],x=[1,31],E=[1,32],w=[1,30],T=[1,39],C=[1,40],S=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],R=[1,61],U=[89,90],L=[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],I=[27,29],A=[1,70],P=[1,71],D=[1,72],M=[1,73],O=[1,74],_=[1,75],B=[1,76],F=[1,83],G=[1,80],z=[1,84],V=[1,85],$=[1,86],Z=[1,87],re=[1,88],Q=[1,89],ge=[1,90],ie=[1,91],pe=[1,92],ue=[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],fe=[63,64],Me=[1,101],Ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Ye=[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],Ze=[1,110],Qe=[1,106],ve=[1,107],Fe=[1,108],Le=[1,109],Be=[1,111],ae=[1,116],he=[1,117],de=[1,114],me=[1,115],ke={trace:k(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:k(function(q,j,se,J,K,ee,Se){var Te=ee.length-1;switch(K){case 4:this.$=ee[Te].trim(),J.setAccTitle(this.$);break;case 5:case 6:this.$=ee[Te].trim(),J.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:J.setDirection("TB");break;case 18:J.setDirection("BT");break;case 19:J.setDirection("RL");break;case 20:J.setDirection("LR");break;case 21:J.addRequirement(ee[Te-3],ee[Te-4]);break;case 22:J.addRequirement(ee[Te-5],ee[Te-6]),J.setClass([ee[Te-5]],ee[Te-3]);break;case 23:J.setNewReqId(ee[Te-2]);break;case 24:J.setNewReqText(ee[Te-2]);break;case 25:J.setNewReqRisk(ee[Te-2]);break;case 26:J.setNewReqVerifyMethod(ee[Te-2]);break;case 29:this.$=J.RequirementType.REQUIREMENT;break;case 30:this.$=J.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=J.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=J.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=J.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=J.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=J.RiskLevel.LOW_RISK;break;case 36:this.$=J.RiskLevel.MED_RISK;break;case 37:this.$=J.RiskLevel.HIGH_RISK;break;case 38:this.$=J.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=J.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=J.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=J.VerifyType.VERIFY_TEST;break;case 42:J.addElement(ee[Te-3]);break;case 43:J.addElement(ee[Te-5]),J.setClass([ee[Te-5]],ee[Te-3]);break;case 44:J.setNewElementType(ee[Te-2]);break;case 45:J.setNewElementDocRef(ee[Te-2]);break;case 48:J.addRelationship(ee[Te-2],ee[Te],ee[Te-4]);break;case 49:J.addRelationship(ee[Te-2],ee[Te-4],ee[Te]);break;case 50:this.$=J.Relationships.CONTAINS;break;case 51:this.$=J.Relationships.COPIES;break;case 52:this.$=J.Relationships.DERIVES;break;case 53:this.$=J.Relationships.SATISFIES;break;case 54:this.$=J.Relationships.VERIFIES;break;case 55:this.$=J.Relationships.REFINES;break;case 56:this.$=J.Relationships.TRACES;break;case 57:this.$=ee[Te-2],J.defineClass(ee[Te-1],ee[Te]);break;case 58:J.setClass(ee[Te-1],ee[Te]);break;case 59:J.setClass([ee[Te-2]],ee[Te]);break;case 60:case 62:this.$=[ee[Te]];break;case 61:case 63:this.$=ee[Te-2].concat([ee[Te]]);break;case 64:this.$=ee[Te-2],J.setCssStyle(ee[Te-1],ee[Te]);break;case 65:this.$=[ee[Te]];break;case 66:ee[Te-2].push(ee[Te]),this.$=ee[Te-2];break;case 68:this.$=ee[Te-1]+ee[Te];break}},"anonymous"),table:[{3:1,4:2,6:t,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:t,9:r,11:n,13:i},{1:[2,2]},{4:17,5:o,7:13,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:o,7:42,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:43,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:44,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:45,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:46,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:47,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:48,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:49,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{4:17,5:o,7:50,8:s,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:h,25:23,33:25,41:f,42:p,43:m,44:g,45:y,46:v,54:b,72:x,74:E,77:w,89:T,90:C},{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(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),{30:60,33:62,75:R,89:T,90:C},{30:63,33:62,75:R,89:T,90:C},{30:64,33:62,75:R,89:T,90:C},e(U,[2,29]),e(U,[2,30]),e(U,[2,31]),e(U,[2,32]),e(U,[2,33]),e(U,[2,34]),e(L,[2,81]),e(L,[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(I,[2,79]),e(I,[2,80]),{27:[1,67],29:[1,68]},e(I,[2,85]),e(I,[2,86]),{62:69,65:A,66:P,67:D,68:M,69:O,70:_,71:B},{62:77,65:A,66:P,67:D,68:M,69:O,70:_,71:B},{30:78,33:62,75:R,89:T,90:C},{73:79,75:F,76:G,78:81,79:82,80:z,81:V,82:$,83:Z,84:re,85:Q,86:ge,87:ie,88:pe},e(ue,[2,60]),e(ue,[2,62]),{73:93,75:F,76:G,78:81,79:82,80:z,81:V,82:$,83:Z,84:re,85:Q,86:ge,87:ie,88:pe},{30:94,33:62,75:R,76:G,89:T,90:C},{5:[1,95]},{30:96,33:62,75:R,89:T,90:C},{5:[1,97]},{30:98,33:62,75:R,89:T,90:C},{63:[1,99]},e(fe,[2,50]),e(fe,[2,51]),e(fe,[2,52]),e(fe,[2,53]),e(fe,[2,54]),e(fe,[2,55]),e(fe,[2,56]),{64:[1,100]},e(S,[2,59],{76:G}),e(S,[2,64],{76:Me}),{33:103,75:[1,102],89:T,90:C},e(Ce,[2,65],{79:104,75:F,80:z,81:V,82:$,83:Z,84:re,85:Q,86:ge,87:ie,88:pe}),e(Ye,[2,67]),e(Ye,[2,69]),e(Ye,[2,70]),e(Ye,[2,71]),e(Ye,[2,72]),e(Ye,[2,73]),e(Ye,[2,74]),e(Ye,[2,75]),e(Ye,[2,76]),e(Ye,[2,77]),e(Ye,[2,78]),e(S,[2,57],{76:Me}),e(S,[2,58],{76:G}),{5:Ze,28:105,31:Qe,34:ve,36:Fe,38:Le,40:Be},{27:[1,112],76:G},{5:ae,40:he,56:113,57:de,59:me},{27:[1,118],76:G},{33:119,89:T,90:C},{33:120,89:T,90:C},{75:F,78:121,79:82,80:z,81:V,82:$,83:Z,84:re,85:Q,86:ge,87:ie,88:pe},e(ue,[2,61]),e(ue,[2,63]),e(Ye,[2,68]),e(S,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ze,28:126,31:Qe,34:ve,36:Fe,38:Le,40:Be},e(S,[2,28]),{5:[1,127]},e(S,[2,42]),{32:[1,128]},{32:[1,129]},{5:ae,40:he,56:130,57:de,59:me},e(S,[2,47]),{5:[1,131]},e(S,[2,48]),e(S,[2,49]),e(Ce,[2,66],{79:104,75:F,80:z,81:V,82:$,83:Z,84:re,85:Q,86:ge,87:ie,88:pe}),{33:132,89:T,90:C},{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(S,[2,27]),{5:Ze,28:145,31:Qe,34:ve,36:Fe,38:Le,40:Be},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(S,[2,46]),{5:ae,40:he,56:152,57:de,59:me},{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(S,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(S,[2,43]),{5:Ze,28:159,31:Qe,34:ve,36:Fe,38:Le,40:Be},{5:Ze,28:160,31:Qe,34:ve,36:Fe,38:Le,40:Be},{5:Ze,28:161,31:Qe,34:ve,36:Fe,38:Le,40:Be},{5:Ze,28:162,31:Qe,34:ve,36:Fe,38:Le,40:Be},{5:ae,40:he,56:163,57:de,59:me},{5:ae,40:he,56:164,57:de,59:me},e(S,[2,23]),e(S,[2,24]),e(S,[2,25]),e(S,[2,26]),e(S,[2,44]),e(S,[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:k(function(q,j){if(j.recoverable)this.trace(q);else{var se=new Error(q);throw se.hash=j,se}},"parseError"),parse:k(function(q){var j=this,se=[0],J=[],K=[null],ee=[],Se=this.table,Te="",Ae=0,Ie=0,Ge=0,De=2,He=1,ze=ee.slice.call(arguments,1),Ke=Object.create(this.lexer),we={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&(we.yy[bt]=this.yy[bt]);Ke.setInput(q,we.yy),we.yy.lexer=Ke,we.yy.parser=this,typeof Ke.yylloc>"u"&&(Ke.yylloc={});var Ve=Ke.yylloc;ee.push(Ve);var vt=Ke.options&&Ke.options.ranges;typeof we.yy.parseError=="function"?this.parseError=we.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pt(Wt){se.length=se.length-2*Wt,K.length=K.length-Wt,ee.length=ee.length-Wt}k(Pt,"popStack");function Xt(){var Wt;return Wt=J.pop()||Ke.lex()||He,typeof Wt!="number"&&(Wt instanceof Array&&(J=Wt,Wt=J.pop()),Wt=j.symbols_[Wt]||Wt),Wt}k(Xt,"lex");for(var It,Ot,Et,Ee,gt,Ut,ct={},Ne,at,ft,Ct;;){if(Et=se[se.length-1],this.defaultActions[Et]?Ee=this.defaultActions[Et]:((It===null||typeof It>"u")&&(It=Xt()),Ee=Se[Et]&&Se[Et][It]),typeof Ee>"u"||!Ee.length||!Ee[0]){var Er="";Ct=[];for(Ne in Se[Et])this.terminals_[Ne]&&Ne>De&&Ct.push("'"+this.terminals_[Ne]+"'");Ke.showPosition?Er="Parse error on line "+(Ae+1)+`: -`+Ke.showPosition()+` -Expecting `+Ct.join(", ")+", got '"+(this.terminals_[It]||It)+"'":Er="Parse error on line "+(Ae+1)+": Unexpected "+(It==He?"end of input":"'"+(this.terminals_[It]||It)+"'"),this.parseError(Er,{text:Ke.match,token:this.terminals_[It]||It,line:Ke.yylineno,loc:Ve,expected:Ct})}if(Ee[0]instanceof Array&&Ee.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+It);switch(Ee[0]){case 1:se.push(It),K.push(Ke.yytext),ee.push(Ke.yylloc),se.push(Ee[1]),It=null,Ot?(It=Ot,Ot=null):(Ie=Ke.yyleng,Te=Ke.yytext,Ae=Ke.yylineno,Ve=Ke.yylloc,Ge>0&&Ge--);break;case 2:if(at=this.productions_[Ee[1]][1],ct.$=K[K.length-at],ct._$={first_line:ee[ee.length-(at||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(at||1)].first_column,last_column:ee[ee.length-1].last_column},vt&&(ct._$.range=[ee[ee.length-(at||1)].range[0],ee[ee.length-1].range[1]]),Ut=this.performAction.apply(ct,[Te,Ie,Ae,we.yy,Ee[1],K,ee].concat(ze)),typeof Ut<"u")return Ut;at&&(se=se.slice(0,-1*at*2),K=K.slice(0,-1*at),ee=ee.slice(0,-1*at)),se.push(this.productions_[Ee[1]][0]),K.push(ct.$),ee.push(ct._$),ft=Se[se[se.length-2]][se[se.length-1]],se.push(ft);break;case 3:return!0}}return!0},"parse")},le=(function(){var X={EOF:1,parseError:k(function(j,se){if(this.yy.parser)this.yy.parser.parseError(j,se);else throw new Error(j)},"parseError"),setInput:k(function(q,j){return this.yy=j||this.yy||{},this._input=q,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var q=this._input[0];this.yytext+=q,this.yyleng++,this.offset++,this.match+=q,this.matched+=q;var j=q.match(/(?:\r\n?|\n).*/g);return j?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),q},"input"),unput:k(function(q){var j=q.length,se=q.split(/(?:\r\n?|\n)/g);this._input=q+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j),this.offset-=j;var J=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),se.length-1&&(this.yylineno-=se.length-1);var K=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:se?(se.length===J.length?this.yylloc.first_column:0)+J[J.length-se.length].length-se[0].length:this.yylloc.first_column-j},this.options.ranges&&(this.yylloc.range=[K[0],K[0]+this.yyleng-j]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(q){this.unput(this.match.slice(q))},"less"),pastInput:k(function(){var q=this.matched.substr(0,this.matched.length-this.match.length);return(q.length>20?"...":"")+q.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var q=this.match;return q.length<20&&(q+=this._input.substr(0,20-q.length)),(q.substr(0,20)+(q.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var q=this.pastInput(),j=new Array(q.length+1).join("-");return q+this.upcomingInput()+` -`+j+"^"},"showPosition"),test_match:k(function(q,j){var se,J,K;if(this.options.backtrack_lexer&&(K={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&&(K.yylloc.range=this.yylloc.range.slice(0))),J=q[0].match(/(?:\r\n?|\n).*/g),J&&(this.yylineno+=J.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:J?J[J.length-1].length-J[J.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+q[0].length},this.yytext+=q[0],this.match+=q[0],this.matches=q,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(q[0].length),this.matched+=q[0],se=this.performAction.call(this,this.yy,this,j,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var ee in K)this[ee]=K[ee];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var q,j,se,J;this._more||(this.yytext="",this.match="");for(var K=this._currentRules(),ee=0;eej[0].length)){if(j=se,J=ee,this.options.backtrack_lexer){if(q=this.test_match(se,K[ee]),q!==!1)return q;if(this._backtrack){j=!1;continue}else return!1}else if(!this.options.flex)break}return j?(q=this.test_match(j,K[J]),q!==!1?q:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var j=this.next();return j||this.lex()},"lex"),begin:k(function(j){this.conditionStack.push(j)},"begin"),popState:k(function(){var j=this.conditionStack.length-1;return j>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(j){return j=this.conditionStack.length-1-Math.abs(j||0),j>=0?this.conditionStack[j]:"INITIAL"},"topState"),pushState:k(function(j){this.begin(j)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(j,se,J,K){var ee=K;switch(J){case 0:return"title";case 1:return this.begin("acc_title"),9;break;case 2:return this.popState(),"acc_title_value";break;case 3:return this.begin("acc_descr"),11;break;case 4:return this.popState(),"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;break;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;break;case 60:return this.begin("style"),74;break;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return se.yytext=se.yytext.trim(),89;break;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return X})();ke.lexer=le;function W(){this.yy={}}return k(W,"Parser"),W.prototype=ke,ke.Parser=W,new W})();fwe.parser=fwe;lRr=fwe,cRr=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=sn,this.getAccTitle=pn,this.setAccDescription=mn,this.getAccDescription=gn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getConfig=k(()=>je().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{k(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){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(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"]}),ye.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,t,r){this.relations.push({type:e,src:t,dst:r})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,$r()}setCssStyle(e,t){for(let r of e){let n=this.requirements.get(r)??this.elements.get(r);if(!t||!n)return;for(let i of t)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(e,t){for(let r of e){let n=this.requirements.get(r)??this.elements.get(r);if(n)for(let i of t){n.classes.push(i);let a=this.classes.get(i)?.styles;a&&n.cssStyles.push(...a)}}}defineClass(e,t){for(let r of e){let n=this.classes.get(r);n===void 0&&(n={id:r,styles:[],textStyles:[]},this.classes.set(r,n)),t&&t.forEach(function(i){if(/color/.exec(i)){let a=i.replace("fill","bgFill");n.textStyles.push(a)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(r)&&i.cssStyles.push(...t.flatMap(a=>a.split(",")))}),this.elements.forEach(i=>{i.classes.includes(r)&&i.cssStyles.push(...t.flatMap(a=>a.split(",")))})}}getClasses(){return this.classes}getData(){let e=je(),t=[],r=[];for(let i of this.requirements.values()){let a=i;a.id=i.name,a.cssStyles=i.cssStyles,a.cssClasses=i.classes.join(" "),a.shape="requirementBox",a.look=e.look,a.colorIndex=t.length,t.push(a)}for(let i of this.elements.values()){let a=i;a.shape="requirementBox",a.look=e.look,a.id=i.name,a.cssStyles=i.cssStyles,a.cssClasses=i.classes.join(" "),a.colorIndex=t.length,t.push(a)}let n=0;for(let i of this.relations){let a=i.type===this.Relationships.CONTAINS,o={id:`${i.src}-${i.dst}-${n++}`,start:this.requirements.get(i.src)?.name??this.elements.get(i.src)?.name,end:this.requirements.get(i.dst)?.name??this.elements.get(i.dst)?.name,label:`<<${i.type}>>`,classes:"relationshipLine",style:["fill:none",a?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:a?"normal":"dashed",arrowTypeStart:a?"requirement_contains":"",arrowTypeEnd:a?"":"requirement_arrow",look:e.look,labelType:"markdown"};r.push(o)}return{nodes:t,edges:r,other:{},config:e,direction:this.getDirection()}}},uRr=k(e=>{let t=Kt(),{themeVariables:r,look:n}=t,{bkgColorArray:i,borderColorArray:a}=r;if(!a?.length)return"";let o="";for(let s=0;s{let t=Kt(),{look:r,themeVariables:n}=t,{requirementEdgeLabelBackground:i}=n;return` - ${uRr(e)} - marker { - fill: ${e.relationColor}; - stroke: ${e.relationColor}; - } - - marker.cross { - stroke: ${e.lineColor}; - } - - svg { - font-family: ${e.fontFamily}; - font-size: ${e.fontSize}; - } - - .reqBox { - fill: ${e.requirementBackground}; - fill-opacity: 1.0; - stroke: ${e.requirementBorderColor}; - stroke-width: ${e.requirementBorderSize}; - } - - .reqTitle, .reqLabel{ - fill: ${e.requirementTextColor}; - } - .reqLabelBox { - fill: ${e.relationLabelBackground}; - fill-opacity: 1.0; - } - - .req-title-line { - stroke: ${e.requirementBorderColor}; - stroke-width: ${e.requirementBorderSize}; - } - .relationshipLine { - stroke: ${e.relationColor}; - stroke-width: ${r==="neo"?e.strokeWidth:"1px"}; - } - .relationshipLabel { - fill: ${e.relationLabelColor}; - } - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - } - .edgeLabel .label rect { - fill: ${e.edgeLabelBackground}; - } - .edgeLabel .label text { - fill: ${e.relationLabelColor}; - } - .divider { - stroke: ${e.nodeBorder}; - stroke-width: 1; - } - .label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - .labelBkg { - background-color: ${i??e.edgeLabelBackground}; - } - -`},"getStyles"),hRr=dRr,E4t={};Zb(E4t,{draw:()=>fRr});fRr=k(async function(e,t,r,n){ye.info("REF0:"),ye.info("Drawing requirement diagram (unified)",t);let{securityLevel:i,state:a,layout:o,look:s}=je(),l=n.db.getData(),u=Hf(t,i);l.type=n.type,l.layoutAlgorithm=Rg(o),l.nodeSpacing=a?.nodeSpacing??50,l.rankSpacing=a?.rankSpacing??50,l.markers=s==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=t,await Gf(l,u);let d=8;Nr.insertTitle(u,"requirementDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bd(u,d,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),pRr={parser:lRr,get db(){return new cRr},renderer:E4t,styles:hRr}});var B4t={};gr(B4t,{diagram:()=>cMr});async function M4t(e,t){_t.bumpVerticalPos(10);let{startx:r,stopx:n,message:i}=t,a=Lt.splitBreaks(i).length,o=uo(i),s=o?await vk(i,je()):Nr.calculateTextDimensions(i,T6(rt));if(!o){let h=s.height/a;t.height+=h,_t.bumpVerticalPos(h)}let l,u=s.height-10,d=s.width;if(r===n){l=_t.getVerticalPos()+u,rt.rightAngles||(u+=rt.boxMargin,l=_t.getVerticalPos()+u),u+=30;let h=Lt.getMax(d/2,rt.width/2);_t.insert(r-h,_t.getVerticalPos()-10+u,n+h,_t.getVerticalPos()+30+u)}else u+=rt.boxMargin,l=_t.getVerticalPos()+u,_t.insert(r,l-10,n,l);return _t.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,_t.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}function P0(e,t,r,n,i){_t.bumpVerticalPos(r);let a=n;if(t.id&&t.message&&e[t.id]){let o=e[t.id].width,s=T6(rt);t.message=Nr.wrapLabel(`[${t.message}]`,o-2*rt.wrapPadding,s),t.width=o,t.wrap=!0;let l=Nr.calculateTextDimensions(t.message,s),u=Lt.getMax(l.height,rt.labelBoxHeight);a=n+u,ye.debug(`${u} - ${t.message}`)}i(t),_t.bumpVerticalPos(a)}function N4t(e,t,r,n,i,a,o){function s(d,h){d.x{let o=T6(rt),s=a.actorKeys.reduce((h,f)=>h+=e.get(f).width+(e.get(f).margin||0),0),l=rt.boxMargin*8;s+=l,s-=2*rt.boxTextMargin,a.wrap&&(a.name=Nr.wrapLabel(a.name,s-2*rt.wrapPadding,o));let u=Nr.calculateTextDimensions(a.name,o);i=Lt.getMax(u.height,i);let d=Lt.getMax(s,u.width+2*rt.wrapPadding);if(a.margin=rt.boxTextMargin,sa.textMaxHeight=i),Lt.getMax(n,rt.height)}var vwe,mwe,mRr,gRr,yRr,vRr,p$,bRr,xRr,wRr,w6,Xx,$x,g$,E6,uv,cD,ERr,y$,m$,xA,A4t,ni,U4t,TRr,kRr,CRr,SRr,ARr,URr,IRr,RRr,MRr,LRr,DRr,NRr,_Rr,I4t,PRr,ORr,BRr,FRr,zRr,GRr,WRr,VRr,R4t,HRr,dv,qRr,YRr,jRr,XRr,$Rr,Na,rt,_t,KRr,C4t,T6,bA,gwe,ZRr,QRr,ywe,L4t,D4t,v$,S4t,JRr,eMr,tMr,rMr,nMr,pwe,iMr,O4t,aMr,oMr,sMr,lMr,cMr,F4t=H(()=>{Nq();O4();Ph();Vn();Wr();Gr();xr();_n();vwe=Ue(PI(),1),mwe=(function(){var e=k(function(Ie,Ge,De,He){for(De=De||{},He=Ie.length;He--;De[Ie[He]]=Ge);return De},"o"),t=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,12],l=[1,14],u=[1,15],d=[1,17],h=[1,18],f=[1,19],p=[1,25],m=[1,26],g=[1,27],y=[1,28],v=[1,29],b=[1,30],x=[1,31],E=[1,32],w=[1,33],T=[1,34],C=[1,35],S=[1,36],R=[1,37],U=[1,38],L=[1,39],I=[1,40],A=[1,42],P=[1,43],D=[1,44],M=[1,45],O=[1,46],_=[1,47],B=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],F=[1,74],G=[1,80],z=[1,81],V=[1,82],$=[1,83],Z=[1,84],re=[1,85],Q=[1,86],ge=[1,87],ie=[1,88],pe=[1,89],ue=[1,90],fe=[1,91],Me=[1,92],Ce=[1,93],Ye=[1,94],Ze=[1,95],Qe=[1,96],ve=[1,97],Fe=[1,98],Le=[1,99],Be=[1,100],ae=[1,101],he=[1,102],de=[1,103],me=[1,104],ke=[1,105],le=[2,78],W=[4,5,17,51,53,54],X=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],q=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],j=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],J=[5,52],K=[70,71,72,73],ee=[1,151],Se={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:k(function(Ge,De,He,ze,Ke,we,bt){var Ve=we.length-1;switch(Ke){case 3:return ze.apply(we[Ve]),we[Ve];break;case 4:case 10:this.$=[];break;case 5:case 11:we[Ve-1].push(we[Ve]),this.$=we[Ve-1];break;case 6:case 7:case 12:case 13:this.$=we[Ve];break;case 8:case 9:case 14:this.$=[];break;case 16:we[Ve].type="createParticipant",this.$=we[Ve];break;case 17:we[Ve-1].unshift({type:"boxStart",boxData:ze.parseBoxData(we[Ve-2])}),we[Ve-1].push({type:"boxEnd",boxText:we[Ve-2]}),this.$=we[Ve-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(we[Ve-2]),sequenceIndexStep:Number(we[Ve-1]),sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(we[Ve-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:ze.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:ze.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:we[Ve-1].actor};break;case 24:this.$={type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:we[Ve-1].actor};break;case 30:ze.setDiagramTitle(we[Ve].substring(6)),this.$=we[Ve].substring(6);break;case 31:ze.setDiagramTitle(we[Ve].substring(7)),this.$=we[Ve].substring(7);break;case 32:this.$=we[Ve].trim(),ze.setAccTitle(this.$);break;case 33:case 34:this.$=we[Ve].trim(),ze.setAccDescription(this.$);break;case 35:we[Ve-1].unshift({type:"loopStart",loopText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.LOOP_START}),we[Ve-1].push({type:"loopEnd",loopText:we[Ve-2],signalType:ze.LINETYPE.LOOP_END}),this.$=we[Ve-1];break;case 36:we[Ve-1].unshift({type:"rectStart",color:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.RECT_START}),we[Ve-1].push({type:"rectEnd",color:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.RECT_END}),this.$=we[Ve-1];break;case 37:we[Ve-1].unshift({type:"optStart",optText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.OPT_START}),we[Ve-1].push({type:"optEnd",optText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.OPT_END}),this.$=we[Ve-1];break;case 38:we[Ve-1].unshift({type:"altStart",altText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.ALT_START}),we[Ve-1].push({type:"altEnd",signalType:ze.LINETYPE.ALT_END}),this.$=we[Ve-1];break;case 39:we[Ve-1].unshift({type:"parStart",parText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.PAR_START}),we[Ve-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=we[Ve-1];break;case 40:we[Ve-1].unshift({type:"parStart",parText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.PAR_OVER_START}),we[Ve-1].push({type:"parEnd",signalType:ze.LINETYPE.PAR_END}),this.$=we[Ve-1];break;case 41:we[Ve-1].unshift({type:"criticalStart",criticalText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.CRITICAL_START}),we[Ve-1].push({type:"criticalEnd",signalType:ze.LINETYPE.CRITICAL_END}),this.$=we[Ve-1];break;case 42:we[Ve-1].unshift({type:"breakStart",breakText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.BREAK_START}),we[Ve-1].push({type:"breakEnd",optText:ze.parseMessage(we[Ve-2]),signalType:ze.LINETYPE.BREAK_END}),this.$=we[Ve-1];break;case 44:this.$=we[Ve-3].concat([{type:"option",optionText:ze.parseMessage(we[Ve-1]),signalType:ze.LINETYPE.CRITICAL_OPTION},we[Ve]]);break;case 46:this.$=we[Ve-3].concat([{type:"and",parText:ze.parseMessage(we[Ve-1]),signalType:ze.LINETYPE.PAR_AND},we[Ve]]);break;case 48:this.$=we[Ve-3].concat([{type:"else",altText:ze.parseMessage(we[Ve-1]),signalType:ze.LINETYPE.ALT_ELSE},we[Ve]]);break;case 49:we[Ve-3].draw="participant",we[Ve-3].type="addParticipant",we[Ve-3].description=ze.parseMessage(we[Ve-1]),this.$=we[Ve-3];break;case 50:we[Ve-1].draw="participant",we[Ve-1].type="addParticipant",this.$=we[Ve-1];break;case 51:we[Ve-3].draw="actor",we[Ve-3].type="addParticipant",we[Ve-3].description=ze.parseMessage(we[Ve-1]),this.$=we[Ve-3];break;case 52:case 57:we[Ve-1].draw="actor",we[Ve-1].type="addParticipant",this.$=we[Ve-1];break;case 53:we[Ve-1].type="destroyParticipant",this.$=we[Ve-1];break;case 54:we[Ve-3].draw="participant",we[Ve-3].type="addParticipant",we[Ve-3].description=ze.parseMessage(we[Ve-1]),this.$=we[Ve-3];break;case 55:we[Ve-1].draw="participant",we[Ve-1].type="addParticipant",this.$=we[Ve-1];break;case 56:we[Ve-3].draw="actor",we[Ve-3].type="addParticipant",we[Ve-3].description=ze.parseMessage(we[Ve-1]),this.$=we[Ve-3];break;case 58:this.$=[we[Ve-1],{type:"addNote",placement:we[Ve-2],actor:we[Ve-1].actor,text:we[Ve]}];break;case 59:we[Ve-2]=[].concat(we[Ve-1],we[Ve-1]).slice(0,2),we[Ve-2][0]=we[Ve-2][0].actor,we[Ve-2][1]=we[Ve-2][1].actor,this.$=[we[Ve-1],{type:"addNote",placement:ze.PLACEMENT.OVER,actor:we[Ve-2].slice(0,2),text:we[Ve]}];break;case 60:this.$=[we[Ve-1],{type:"addLinks",actor:we[Ve-1].actor,text:we[Ve]}];break;case 61:this.$=[we[Ve-1],{type:"addALink",actor:we[Ve-1].actor,text:we[Ve]}];break;case 62:this.$=[we[Ve-1],{type:"addProperties",actor:we[Ve-1].actor,text:we[Ve]}];break;case 63:this.$=[we[Ve-1],{type:"addDetails",actor:we[Ve-1].actor,text:we[Ve]}];break;case 66:this.$=[we[Ve-2],we[Ve]];break;case 67:this.$=we[Ve];break;case 68:this.$=ze.PLACEMENT.LEFTOF;break;case 69:this.$=ze.PLACEMENT.RIGHTOF;break;case 70:this.$=[we[Ve-4],we[Ve-1],{type:"addMessage",from:we[Ve-4].actor,to:we[Ve-1].actor,signalType:we[Ve-3],msg:we[Ve],activate:!0},{type:"activeStart",signalType:ze.LINETYPE.ACTIVE_START,actor:we[Ve-1].actor}];break;case 71:this.$=[we[Ve-4],we[Ve-1],{type:"addMessage",from:we[Ve-4].actor,to:we[Ve-1].actor,signalType:we[Ve-3],msg:we[Ve]},{type:"activeEnd",signalType:ze.LINETYPE.ACTIVE_END,actor:we[Ve-4].actor}];break;case 72:this.$=[we[Ve-4],we[Ve-1],{type:"addMessage",from:we[Ve-4].actor,to:we[Ve-1].actor,signalType:we[Ve-3],msg:we[Ve],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:we[Ve-1].actor}];break;case 73:this.$=[we[Ve-4],we[Ve-1],{type:"addMessage",from:we[Ve-4].actor,to:we[Ve-1].actor,signalType:we[Ve-2],msg:we[Ve],activate:!1,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[Ve-4].actor}];break;case 74:this.$=[we[Ve-5],we[Ve-1],{type:"addMessage",from:we[Ve-5].actor,to:we[Ve-1].actor,signalType:we[Ve-3],msg:we[Ve],activate:!0,centralConnection:ze.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:ze.LINETYPE.CENTRAL_CONNECTION,actor:we[Ve-1].actor},{type:"centralConnectionReverse",signalType:ze.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:we[Ve-5].actor}];break;case 75:this.$=[we[Ve-3],we[Ve-1],{type:"addMessage",from:we[Ve-3].actor,to:we[Ve-1].actor,signalType:we[Ve-2],msg:we[Ve]}];break;case 76:this.$={type:"addParticipant",actor:we[Ve-1],config:we[Ve]};break;case 77:this.$=we[Ve-1].trim();break;case 78:this.$={type:"addParticipant",actor:we[Ve]};break;case 79:this.$=ze.LINETYPE.SOLID_OPEN;break;case 80:this.$=ze.LINETYPE.DOTTED_OPEN;break;case 81:this.$=ze.LINETYPE.SOLID;break;case 82:this.$=ze.LINETYPE.SOLID_TOP;break;case 83:this.$=ze.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=ze.LINETYPE.STICK_TOP;break;case 85:this.$=ze.LINETYPE.STICK_BOTTOM;break;case 86:this.$=ze.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=ze.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=ze.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=ze.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=ze.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=ze.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=ze.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=ze.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=ze.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=ze.LINETYPE.DOTTED;break;case 100:this.$=ze.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=ze.LINETYPE.SOLID_CROSS;break;case 102:this.$=ze.LINETYPE.DOTTED_CROSS;break;case 103:this.$=ze.LINETYPE.SOLID_POINT;break;case 104:this.$=ze.LINETYPE.DOTTED_POINT;break;case 105:this.$=ze.parseMessage(we[Ve].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:r,6:n},{1:[3]},{3:5,4:t,5:r,6:n},{3:6,4:t,5:r,6:n},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},e(B,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},e(B,[2,7]),e(B,[2,8]),e(B,[2,9]),e(B,[2,15]),{13:49,51:U,53:L,54:I},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:_},{23:56,73:_},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(B,[2,30]),e(B,[2,31]),{33:[1,62]},{35:[1,63]},e(B,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:F},{23:75,55:76,73:F},{23:77,73:_},{69:78,72:[1,79],78:G,79:z,80:V,81:$,82:Z,83:re,84:Q,85:ge,86:ie,87:pe,88:ue,89:fe,90:Me,91:Ce,92:Ye,93:Ze,94:Qe,95:ve,96:Fe,97:Le,98:Be,99:ae,100:he,101:de,102:me,103:ke},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:_},{23:111,73:_},{23:112,73:_},{23:113,73:_},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],le),e(B,[2,6]),e(B,[2,16]),e(W,[2,10],{11:114}),e(B,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(B,[2,22]),{5:[1,118]},{5:[1,119]},e(B,[2,25]),e(B,[2,26]),e(B,[2,27]),e(B,[2,28]),e(B,[2,29]),e(B,[2,32]),e(B,[2,33]),e(X,i,{7:120}),e(X,i,{7:121}),e(X,i,{7:122}),e(q,i,{41:123,7:124}),e(j,i,{43:125,7:126}),e(j,i,{7:126,43:127}),e(se,i,{46:128,7:129}),e(X,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(J,le,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:_},{69:146,78:G,79:z,80:V,81:$,82:Z,83:re,84:Q,85:ge,86:ie,87:pe,88:ue,89:fe,90:Me,91:Ce,92:Ye,93:Ze,94:Qe,95:ve,96:Fe,97:Le,98:Be,99:ae,100:he,101:de,102:me,103:ke},e(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[2,104]),{23:147,73:_},{23:149,60:148,73:_},{73:[2,68]},{73:[2,69]},{58:150,104:ee},{58:152,104:ee},{58:153,104:ee},{58:154,104:ee},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:L,54:I},{5:[1,160]},e(B,[2,20]),e(B,[2,21]),e(B,[2,23]),e(B,[2,24]),{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{17:[1,164]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,50:[1,165],51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{17:[1,166]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,49:[1,167],51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{17:[1,168]},{17:[1,169]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,48:[1,170],51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:h,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:m,32:g,34:y,36:v,37:b,38:x,39:E,40:w,42:T,44:C,45:S,47:R,51:U,53:L,54:I,56:A,61:P,62:D,63:M,64:O,73:_},{16:[1,172]},e(B,[2,50]),{16:[1,173]},e(B,[2,55]),e(J,[2,76]),{76:[1,174]},{16:[1,175]},e(B,[2,52]),{16:[1,176]},e(B,[2,57]),e(B,[2,53]),{23:177,73:_},{23:178,73:_},{23:179,73:_},{58:180,104:ee},{23:181,72:[1,182],73:_},{58:183,104:ee},{58:184,104:ee},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(B,[2,17]),e(W,[2,11]),{13:186,51:U,53:L,54:I},e(W,[2,13]),e(W,[2,14]),e(B,[2,19]),e(B,[2,35]),e(B,[2,36]),e(B,[2,37]),e(B,[2,38]),{16:[1,187]},e(B,[2,39]),{16:[1,188]},e(B,[2,40]),e(B,[2,41]),{16:[1,189]},e(B,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ee},{58:196,104:ee},{58:197,104:ee},{5:[2,75]},{58:198,104:ee},{23:199,73:_},{5:[2,58]},{5:[2,59]},{23:200,73:_},e(W,[2,12]),e(q,i,{7:124,41:201}),e(j,i,{7:126,43:202}),e(se,i,{7:129,46:203}),e(B,[2,49]),e(B,[2,54]),e(J,[2,77]),e(B,[2,51]),e(B,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ee},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:k(function(Ge,De){if(De.recoverable)this.trace(Ge);else{var He=new Error(Ge);throw He.hash=De,He}},"parseError"),parse:k(function(Ge){var De=this,He=[0],ze=[],Ke=[null],we=[],bt=this.table,Ve="",vt=0,Pt=0,Xt=0,It=2,Ot=1,Et=we.slice.call(arguments,1),Ee=Object.create(this.lexer),gt={yy:{}};for(var Ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ut)&&(gt.yy[Ut]=this.yy[Ut]);Ee.setInput(Ge,gt.yy),gt.yy.lexer=Ee,gt.yy.parser=this,typeof Ee.yylloc>"u"&&(Ee.yylloc={});var ct=Ee.yylloc;we.push(ct);var Ne=Ee.options&&Ee.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function at(Dr){He.length=He.length-2*Dr,Ke.length=Ke.length-Dr,we.length=we.length-Dr}k(at,"popStack");function ft(){var Dr;return Dr=ze.pop()||Ee.lex()||Ot,typeof Dr!="number"&&(Dr instanceof Array&&(ze=Dr,Dr=ze.pop()),Dr=De.symbols_[Dr]||Dr),Dr}k(ft,"lex");for(var Ct,Er,Wt,Sr,on,ir,Jt={},Ar,ot,wt,zt;;){if(Wt=He[He.length-1],this.defaultActions[Wt]?Sr=this.defaultActions[Wt]:((Ct===null||typeof Ct>"u")&&(Ct=ft()),Sr=bt[Wt]&&bt[Wt][Ct]),typeof Sr>"u"||!Sr.length||!Sr[0]){var Pr="";zt=[];for(Ar in bt[Wt])this.terminals_[Ar]&&Ar>It&&zt.push("'"+this.terminals_[Ar]+"'");Ee.showPosition?Pr="Parse error on line "+(vt+1)+`: -`+Ee.showPosition()+` -Expecting `+zt.join(", ")+", got '"+(this.terminals_[Ct]||Ct)+"'":Pr="Parse error on line "+(vt+1)+": Unexpected "+(Ct==Ot?"end of input":"'"+(this.terminals_[Ct]||Ct)+"'"),this.parseError(Pr,{text:Ee.match,token:this.terminals_[Ct]||Ct,line:Ee.yylineno,loc:ct,expected:zt})}if(Sr[0]instanceof Array&&Sr.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Wt+", token: "+Ct);switch(Sr[0]){case 1:He.push(Ct),Ke.push(Ee.yytext),we.push(Ee.yylloc),He.push(Sr[1]),Ct=null,Er?(Ct=Er,Er=null):(Pt=Ee.yyleng,Ve=Ee.yytext,vt=Ee.yylineno,ct=Ee.yylloc,Xt>0&&Xt--);break;case 2:if(ot=this.productions_[Sr[1]][1],Jt.$=Ke[Ke.length-ot],Jt._$={first_line:we[we.length-(ot||1)].first_line,last_line:we[we.length-1].last_line,first_column:we[we.length-(ot||1)].first_column,last_column:we[we.length-1].last_column},Ne&&(Jt._$.range=[we[we.length-(ot||1)].range[0],we[we.length-1].range[1]]),ir=this.performAction.apply(Jt,[Ve,Pt,vt,gt.yy,Sr[1],Ke,we].concat(Et)),typeof ir<"u")return ir;ot&&(He=He.slice(0,-1*ot*2),Ke=Ke.slice(0,-1*ot),we=we.slice(0,-1*ot)),He.push(this.productions_[Sr[1]][0]),Ke.push(Jt.$),we.push(Jt._$),wt=bt[He[He.length-2]][He[He.length-1]],He.push(wt);break;case 3:return!0}}return!0},"parse")},Te=(function(){var Ie={EOF:1,parseError:k(function(De,He){if(this.yy.parser)this.yy.parser.parseError(De,He);else throw new Error(De)},"parseError"),setInput:k(function(Ge,De){return this.yy=De||this.yy||{},this._input=Ge,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var Ge=this._input[0];this.yytext+=Ge,this.yyleng++,this.offset++,this.match+=Ge,this.matched+=Ge;var De=Ge.match(/(?:\r\n?|\n).*/g);return De?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ge},"input"),unput:k(function(Ge){var De=Ge.length,He=Ge.split(/(?:\r\n?|\n)/g);this._input=Ge+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var ze=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),He.length-1&&(this.yylineno-=He.length-1);var Ke=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:He?(He.length===ze.length?this.yylloc.first_column:0)+ze[ze.length-He.length].length-He[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[Ke[0],Ke[0]+this.yyleng-De]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(Ge){this.unput(this.match.slice(Ge))},"less"),pastInput:k(function(){var Ge=this.matched.substr(0,this.matched.length-this.match.length);return(Ge.length>20?"...":"")+Ge.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var Ge=this.match;return Ge.length<20&&(Ge+=this._input.substr(0,20-Ge.length)),(Ge.substr(0,20)+(Ge.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var Ge=this.pastInput(),De=new Array(Ge.length+1).join("-");return Ge+this.upcomingInput()+` -`+De+"^"},"showPosition"),test_match:k(function(Ge,De){var He,ze,Ke;if(this.options.backtrack_lexer&&(Ke={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&&(Ke.yylloc.range=this.yylloc.range.slice(0))),ze=Ge[0].match(/(?:\r\n?|\n).*/g),ze&&(this.yylineno+=ze.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ze?ze[ze.length-1].length-ze[ze.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ge[0].length},this.yytext+=Ge[0],this.match+=Ge[0],this.matches=Ge,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(Ge[0].length),this.matched+=Ge[0],He=this.performAction.call(this,this.yy,this,De,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),He)return He;if(this._backtrack){for(var we in Ke)this[we]=Ke[we];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ge,De,He,ze;this._more||(this.yytext="",this.match="");for(var Ke=this._currentRules(),we=0;weDe[0].length)){if(De=He,ze=we,this.options.backtrack_lexer){if(Ge=this.test_match(He,Ke[we]),Ge!==!1)return Ge;if(this._backtrack){De=!1;continue}else return!1}else if(!this.options.flex)break}return De?(Ge=this.test_match(De,Ke[ze]),Ge!==!1?Ge:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var De=this.next();return De||this.lex()},"lex"),begin:k(function(De){this.conditionStack.push(De)},"begin"),popState:k(function(){var De=this.conditionStack.length-1;return De>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:k(function(De){this.begin(De)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(De,He,ze,Ke){var we=Ke;switch(ze){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;break;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;break;case 10:return this.popState(),this.popState(),77;break;case 11:return He.yytext=He.yytext.trim(),73;break;case 12:return He.yytext=He.yytext.trim(),this.begin("ALIAS"),73;break;case 13:return He.yytext=He.yytext.trim(),this.popState(),73;break;case 14:return this.popState(),10;break;case 15:return He.yytext=He.yytext.trim(),this.popState(),10;break;case 16:return this.begin("LINE"),15;break;case 17:return this.begin("ID"),51;break;case 18:return this.begin("ID"),53;break;case 19:return 14;case 20:return this.begin("ID"),54;break;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;break;case 22:return this.popState(),this.popState(),5;break;case 23:return this.begin("LINE"),37;break;case 24:return this.begin("LINE"),38;break;case 25:return this.begin("LINE"),39;break;case 26:return this.begin("LINE"),40;break;case 27:return this.begin("LINE"),50;break;case 28:return this.begin("LINE"),42;break;case 29:return this.begin("LINE"),44;break;case 30:return this.begin("LINE"),49;break;case 31:return this.begin("LINE"),45;break;case 32:return this.begin("LINE"),48;break;case 33:return this.begin("LINE"),47;break;case 34:return this.popState(),16;break;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;break;case 45:return this.begin("ID"),24;break;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;break;case 49:return this.popState(),"acc_title_value";break;case 50:return this.begin("acc_descr"),34;break;case 51:return this.popState(),"acc_descr_value";break;case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return He.yytext=He.yytext.trim(),73;break;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,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],inclusive:!0}}};return Ie})();Se.lexer=Te;function Ae(){this.yy={}}return k(Ae,"Parser"),Ae.prototype=Se,Se.Parser=Ae,new Ae})();mwe.parser=mwe;mRr=mwe,gRr={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,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},yRr={FILLED:0,OPEN:1},vRr={LEFTOF:0,RIGHTOF:1,OVER:2},p$={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"},bRr=class{constructor(){this.state=new mS(()=>({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=sn,this.setAccDescription=mn,this.setDiagramTitle=Sn,this.getAccTitle=pn,this.getAccDescription=gn,this.getDiagramTitle=yn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(je().wrap),this.LINETYPE=gRr,this.ARROWTYPE=yRr,this.PLACEMENT=vRr}static{k(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,r,n,i){let a=this.state.records.currentBox,o;if(i!==void 0){let l;i.includes(` -`)?l=i+` -`:l=`{ -`+i+` -}`,o=$2(l,{schema:X2})}n=o?.type??n,o?.alias&&(!r||r.text===t)&&(r={text:o.alias,wrap:r?.wrap,type:n});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw new Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&r==null)return}if(r?.text==null&&(r={text:t,type:n}),(n==null||r.text==null)&&(r={text:t,type:n}),this.state.records.actors.set(e,{box:a,name:t,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){let l=this.state.records.actors.get(this.state.records.prevActor);l&&(l.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,r=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'"]},s}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i,centralConnection:a??0}),!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(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:je().sequence?.wrap??!1}clear(){this.state.reset(),$r()}parseMessage(e){let t=e.trim(),{wrap:r,cleanedText:n}=this.extractWrap(t),i={text:n,wrap:r};return ye.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),r=t?.[1]?t[1].trim():"transparent",n=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=e.trim());else{let o=new Option().style;o.color=r,o.color!==r&&(r="transparent",n=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?rn(a,je()):void 0,color:r,wrap:i}}addNote(e,t,r){let n={actor:e,placement:t,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){let r=this.getActor(e);try{let n=rn(t.text,je());n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");let i=JSON.parse(n);this.insertLinks(r,i)}catch(n){ye.error("error while parsing actor link text",n)}}addALink(e,t){let r=this.getActor(e);try{let n={},i=rn(t.text,je()),a=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");let o=i.slice(0,a-1).trim(),s=i.slice(a+1).trim();n[o]=s,this.insertLinks(r,n)}catch(n){ye.error("error while parsing actor link text",n)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let r in t)e.links[r]=t[r]}addProperties(e,t){let r=this.getActor(e);try{let n=rn(t.text,je()),i=JSON.parse(n);this.insertProperties(r,i)}catch(n){ye.error("error while parsing actor properties text",n)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let r in t)e.properties[r]=t[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){let r=this.getActor(e),n=document.getElementById(t.text);try{let i=n.innerHTML,a=JSON.parse(i);a.properties&&this.insertProperties(r,a.properties),a.links&&this.insertLinks(r,a.links)}catch(i){ye.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});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,e.config);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,e.config),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":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;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,e.centralConnection);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":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"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":sn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,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"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return je().sequence}},xRr=k(e=>{let t=e.dropShadow??"none",{look:r}=je();return`.actor { - stroke: ${e.actorBorder}; - fill: ${e.actorBkg}; - stroke-width: ${e.strokeWidth??1}; - } - - rect.actor.outer-path[data-look="neo"] { - filter: ${t}; - } - - rect.note[data-look="neo"] { - stroke:${e.noteBorderColor}; - fill:${e.noteBkgColor}; - filter: ${t}; - } - - text.actor > tspan { - fill: ${e.actorTextColor}; - stroke: none; - } - - .actor-line { - stroke: ${e.actorLineColor}; - } - - .innerArc { - stroke-width: 1.5; - stroke-dasharray: none; - } - - .messageLine0 { - stroke-width: 1.5; - stroke-dasharray: none; - stroke: ${e.signalColor}; - } - - .messageLine1 { - stroke-width: 1.5; - stroke-dasharray: 2, 2; - stroke: ${e.signalColor}; - } - - [id$="-arrowhead"] path { - fill: ${e.signalColor}; - stroke: ${e.signalColor}; - } - - .sequenceNumber { - fill: ${e.sequenceNumberColor}; - } - - [id$="-sequencenumber"] { - fill: ${e.signalColor}; - } - - [id$="-crosshead"] path { - fill: ${e.signalColor}; - stroke: ${e.signalColor}; - } - - .messageText { - fill: ${e.signalTextColor}; - stroke: none; - } - - .labelBox { - stroke: ${e.labelBoxBorderColor}; - fill: ${e.labelBoxBkgColor}; - filter: ${r==="neo"?t:"none"}; - } - - .labelText, .labelText > tspan { - fill: ${e.labelTextColor}; - stroke: none; - } - - .loopText, .loopText > tspan { - fill: ${e.loopTextColor}; - stroke: none; - } - - .sectionTitle, .sectionTitle > tspan { - fill: ${e.loopTextColor}; - stroke: none; - } - - .loopLine { - stroke-width: 2px; - stroke-dasharray: 2, 2; - stroke: ${e.labelBoxBorderColor}; - fill: ${e.labelBoxBorderColor}; - } - - .note { - //stroke: #decc93; - stroke: ${e.noteBorderColor}; - fill: ${e.noteBkgColor}; - } - - .noteText, .noteText > tspan { - fill: ${e.noteTextColor}; - stroke: none; - ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} - } - - .activation0 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .activation1 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .activation2 { - fill: ${e.activationBkgColor}; - stroke: ${e.activationBorderColor}; - } - - .actorPopupMenu { - position: absolute; - } - - .actorPopupMenuPanel { - position: absolute; - fill: ${e.actorBkg}; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); -} - .actor-man circle, line { - fill: ${e.actorBkg}; - stroke-width: 2px; - } - - g rect.rect { - filter: ${t}; - stroke: ${e.nodeBorder}; - } -`},"getStyles"),wRr=xRr,w6=36,Xx="actor-top",$x="actor-bottom",g$="actor-box",E6="actor-man",uv=new Set(["redux-color","redux-dark-color"]),cD=k(function(e,t){let r=i3(e,t);return Kt().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),ERr=k(function(e,t,r,n,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var l="none";i&&(l="block !important");let u=e.append("g");u.attr("id","actor"+o+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var d="";s.class!==void 0&&(d=" "+s.class);let h=s.width>r?s.width:r,f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+d),f.attr("x",s.x),f.attr("y",s.height),f.attr("fill",s.fill),f.attr("stroke",s.stroke),f.attr("width",h),f.attr("height",s.height),f.attr("rx",s.rx),f.attr("ry",s.ry),a!=null){var p=20;for(let y in a){var m=u.append("a"),g=(0,vwe.sanitizeUrl)(a[y]);m.attr("xlink:href",g),m.attr("target","_blank"),qRr(n)(y,m,s.x+10,s.height+p,h,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:s.height+p,width:h}},"drawPopup"),y$=k(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),m$=k(async function(e,t,r=null){let n=e.append("foreignObject"),i=await bk(t.text,Kt()),o=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(o.height)).attr("width",Math.round(o.width)),t.class==="noteText"){let s=e.node().firstChild;s.setAttribute("height",o.height+2*t.textMargin);let l=s.getBBox();n.attr("x",Math.round(l.x+l.width/2-o.width/2)).attr("y",Math.round(l.y+l.height/2-o.height/2))}else if(r){let{startx:s,stopx:l,starty:u}=r;if(s>l){let d=s;s=l,l=d}n.attr("x",Math.round(s+Math.abs(s-l)/2-o.width/2)),t.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-o.height))}return[n]},"drawKatex"),xA=k(function(e,t){let r=0,n=0,i=t.text.split(Lt.lineBreakRegex),[a,o]=kd(t.fontSize),s=[],l=0,u=k(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":u=k(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":u=k(()=>Math.round(t.y+(r+n+t.textMargin)/2),"yfunc");break;case"bottom":case"end":u=k(()=>Math.round(t.y+(r+n+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[d,h]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&a!==void 0&&(l=d*a);let f=e.append("text");f.attr("x",t.x),f.attr("y",u()),t.anchor!==void 0&&f.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&f.style("font-family",t.fontFamily),o!==void 0&&f.style("font-size",o),t.fontWeight!==void 0&&f.style("font-weight",t.fontWeight),t.fill!==void 0&&f.attr("fill",t.fill),t.class!==void 0&&f.attr("class",t.class),t.dy!==void 0?f.attr("dy",t.dy):l!==0&&f.attr("dy",l);let p=h||jce;if(t.tspan){let m=f.append("tspan");m.attr("x",t.x),t.fill!==void 0&&m.attr("fill",t.fill),m.text(p)}else f.text(p);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),s.push(f)}return s},"drawText"),A4t=k(function(e,t){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}k(r,"genPoints");let n=e.append("polygon");return n.attr("points",r(t.x,t.y,t.width,t.height,7)),n.attr("class","labelBox"),t.y=t.y+t.height/2,xA(e,t),n},"drawLabel"),ni=-1,U4t=k((e,t,r,n)=>{e.select&&r.forEach(i=>{let a=t.get(i),o=e.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?o.attr("y2",a.stopy+a.height/2):n.mirrorActors&&o.attr("y2",a.stopy)})},"fixLifeLineHeights"),TRr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=r,{bkgColorArray:h,borderColorArray:f}=d,p=e.append("g").lower();var m=p;n||(ni++,Object.keys(t.links||{}).length&&!r.forceMenus&&m.attr("onclick",y$(`actor${ni}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),m=p.append("g"),t.actorCnt=ni,t.links!=null&&m.attr("id","root-"+ni),l==="neo"&&m.attr("data-look","neo"));let g=Od();var y="actor";t.properties?.class?y=t.properties.class:g.fill="#eaeaea",n?y+=` ${$x}`:y+=` ${Xx}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=y,g.rx=3,g.ry=3,g.name=t.name,l==="neo"&&(g.rx=6,g.ry=6);let v=cD(m,g),b=i.get(t.name)??0;if(uv.has(u)&&(v.style("stroke",f[b%f.length]),v.style("fill",h[b%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),t.rectData=g,t.properties?.icon){let E=t.properties.icon.trim();E.charAt(0)==="@"?Cq(m,g.x+g.width-20,g.y+10,E.substr(1)):kq(m,g.x+g.width-20,g.y+10,E)}n||(m.attr("data-et","participant"),m.attr("data-type","participant"),m.attr("data-id",t.name)),dv(r,uo(t.description))(t.description,m,g.x,g.y,g.width,g.height,{class:`actor ${g$}`},r);let x=t.height;if(v.node){let E=v.node().getBBox();t.height=E.height,x=E.height}return x},"drawActorTypeParticipant"),kRr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=r,{bkgColorArray:h,borderColorArray:f}=d,p=e.append("g").lower();var m=p;n||(ni++,Object.keys(t.links||{}).length&&!r.forceMenus&&m.attr("onclick",y$(`actor${ni}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),m=p.append("g"),t.actorCnt=ni,t.links!=null&&m.attr("id","root-"+ni),l==="neo"&&m.attr("data-look","neo"));let g=Od();var y="actor";t.properties?.class?y=t.properties.class:g.fill="#eaeaea",n?y+=` ${$x}`:y+=` ${Xx}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=y,g.name=t.name;let v=6,b={...g,x:g.x+-v,y:g.y+ +v,class:"actor"},x=cD(m,g),E=cD(m,b);t.rectData=g,l==="neo"&&m.attr("filter","url(#drop-shadow)");let w=i.get(t.name)??0;if(uv.has(u)&&(x.style("stroke",f[w%f.length]),x.style("fill",h[w%f.length]),E.style("stroke",f[w%f.length]),E.style("fill",h[w%f.length])),t.properties?.icon){let C=t.properties.icon.trim();C.charAt(0)==="@"?Cq(m,g.x+g.width-20,g.y+10,C.substr(1)):kq(m,g.x+g.width-20,g.y+10,C)}dv(r,uo(t.description))(t.description,m,g.x-v,g.y+v,g.width,g.height,{class:`actor ${g$}`},r);let T=t.height;if(x.node){let C=x.node().getBBox();t.height=C.height,T=C.height}return n||(m.attr("data-et","participant"),m.attr("data-type","collections"),m.attr("data-id",t.name)),T},"drawActorTypeCollections"),CRr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=r,{bkgColorArray:h,borderColorArray:f}=d,p=e.append("g").lower(),m=p;n||(ni++,Object.keys(t.links||{}).length&&!r.forceMenus&&m.attr("onclick",y$(`actor${ni}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),m=p.append("g"),t.actorCnt=ni,t.links!=null&&m.attr("id","root-"+ni),l==="neo"&&m.attr("data-look","neo"));let g=Od(),y="actor";t.properties?.class?y=t.properties.class:g.fill="#eaeaea",n?y+=` ${$x}`:y+=` ${Xx}`,m.attr("class",y),g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.name=t.name;let v=g.height/2,b=v/(2.5+g.height/50),x=m.append("g"),E=m.append("g"),w=`M ${g.x},${g.y+v} - a ${b},${v} 0 0 0 0,${g.height} - h ${g.width-2*b} - a ${b},${v} 0 0 0 0,-${g.height} - Z - `;x.append("path").attr("d",w),E.append("path").attr("d",`M ${g.x},${g.y+v} - a ${b},${v} 0 0 0 0,${g.height}`),x.attr("transform",`translate(${b}, ${-(g.height/2)})`),E.attr("transform",`translate(${g.width-b}, ${-g.height/2})`),t.rectData=g,l==="neo"&&x.attr("filter","url(#drop-shadow)");let T=i.get(t.name)??0;if(uv.has(u)&&(x.style("stroke",f[T%f.length]),x.style("fill",h[T%f.length]),E.style("stroke",f[T%f.length]),E.style("fill",h[T%f.length])),t.properties?.icon){let R=t.properties.icon.trim(),U=g.x+g.width-20,L=g.y+10;R.charAt(0)==="@"?Cq(m,U,L,R.substr(1)):kq(m,U,L,R)}dv(r,uo(t.description))(t.description,m,g.x,g.y,g.width,g.height,{class:`actor ${g$}`},r);let C=t.height,S=x.select("path:last-child");if(S.node()){let R=S.node().getBBox();t.height=R.height,C=R.height}return n||(m.attr("data-et","participant"),m.attr("data-type","queue"),m.attr("data-id",t.name)),C},"drawActorTypeQueue"),SRr=k(function(e,t,r,n,i,a){let o=n?t.stopy:t.starty,s=t.x+t.width/2,l=o+75,{look:u,theme:d,themeVariables:h}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:m,actorBkg:g}=h,y=e.append("g").lower();n||(ni++,y.append("line").attr("id","actor"+ni).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=ni);let v=e.append("g"),b=E6;n?b+=` ${$x}`:b+=` ${Xx}`,v.attr("class",b),v.attr("name",t.name);let x=Od();x.x=t.x,x.y=o,x.fill="#eaeaea",x.width=t.width,x.height=t.height,x.class="actor";let E=t.x+t.width/2,w=o+32,T=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",E).attr("cy",w).attr("r",T).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${E}, ${w-T})`);let C=a.get(t.name)??0;uv.has(d)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",m),v.style("fill",g));let S=v.node().getBBox();return t.height=S.height+2*(r?.sequence?.labelBoxHeight??0),dv(r,uo(t.description))(t.description,v,x.x,x.y+T+(n?5:12),x.width,x.height,{class:`actor ${E6}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",t.name)),t.height},"drawActorTypeControl"),ARr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+75,{look:l,theme:u,themeVariables:d}=r,{bkgColorArray:h,borderColorArray:f}=d,p=e.append("g").lower(),m=e.append("g"),g="actor";n?g+=` ${$x}`:g+=` ${Xx}`,m.attr("class",g),m.attr("name",t.name);let y=Od();y.x=t.x,y.y=a,y.fill="#eaeaea",y.width=t.width,y.height=t.height,y.class="actor";let v=t.x+t.width/2,b=a+(n?10:25),x=22;m.append("circle").attr("cx",v).attr("cy",b).attr("r",x).attr("width",t.width).attr("height",t.height),m.append("line").attr("x1",v-x).attr("x2",v+x).attr("y1",b+x).attr("y2",b+x).attr("stroke-width",2),l==="neo"&&m.attr("filter","url(#drop-shadow)");let E=i.get(t.name)??0;uv.has(u)&&(m.style("stroke",f[E%f.length]),m.style("fill",h[E%f.length]));let w=m.node().getBBox();return t.height=w.height+(r?.sequence?.labelBoxHeight??0),n||(ni++,p.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=ni),dv(r,uo(t.description))(t.description,m,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${E6}`},r),n?m.attr("transform",`translate(0, ${x})`):(m.attr("transform",`translate(0, ${x/2-5})`),m.attr("data-et","participant"),m.attr("data-type","entity"),m.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),URr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:d}=r,{bkgColorArray:h,borderColorArray:f,actorBorder:p}=u,m=e.append("g").lower(),g=m;n||(ni++,Object.keys(t.links||{}).length&&!r.forceMenus&&g.attr("onclick",y$(`actor${ni}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),g=m.append("g"),t.actorCnt=ni,t.links!=null&&g.attr("id","root-"+ni),d==="neo"&&g.attr("data-look","neo"));let y=Od(),v="actor";t.properties?.class?v=t.properties.class:y.fill="#eaeaea",n?v+=` ${$x}`:v+=` ${Xx}`,y.x=t.x,y.y=a,y.width=t.width,y.height=t.height,y.class=v,y.name=t.name,y.x=t.x,y.y=a;let b=y.width/3,x=y.width/3,E=b/2,w=E/(2.5+b/50),T=g.append("g");T.attr("class",v);let C=` - M ${y.x},${y.y+w} - a ${E},${w} 0 0 0 ${b},0 - a ${E},${w} 0 0 0 -${b},0 - l 0,${x-2*w} - a ${E},${w} 0 0 0 ${b},0 - l 0,-${x-2*w} -`;T.append("path").attr("d",C),d==="neo"&&T.attr("filter","url(#drop-shadow)");let S=i.get(t.name)??0;uv.has(l)?(T.style("stroke",f[S%f.length]),T.style("fill",h[S%f.length])):T.style("stroke",p),T.attr("transform",`translate(${b}, ${w})`),t.rectData=y,dv(r,uo(t.description))(t.description,g,y.x,y.y+35,y.width,y.height,{class:`actor ${g$}`},r);let R=T.select("path:last-child");if(R.node()){let U=R.node().getBBox();t.height=U.height+(r.sequence.labelBoxHeight??0)}return n||(g.attr("data-et","participant"),g.attr("data-type","database"),g.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),IRr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,l=22,u=e.append("g").lower(),{look:d,theme:h,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:m,actorBorder:g}=f;n||(ni++,u.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=ni);let y=e.append("g"),v=E6;n?v+=` ${$x}`:v+=` ${Xx}`,y.attr("class",v),y.attr("name",t.name);let b=Od();b.x=t.x,b.y=a,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor",y.append("line").attr("id","actor-man-torso"+ni).attr("x1",t.x+t.width/2-l*2.5).attr("y1",a+12).attr("x2",t.x+t.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+ni).attr("x1",t.x+t.width/2-l*2.5).attr("y1",a+2).attr("x2",t.x+t.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",t.x+t.width/2).attr("cy",a+12).attr("r",l),d==="neo"&&y.attr("filter","url(#drop-shadow)");let x=i.get(t.name)??0;uv.has(h)?(y.style("stroke",m[x%m.length]),y.style("fill",p[x%m.length])):y.style("stroke",g);let E=y.node().getBBox();return t.height=E.height+(r.sequence.labelBoxHeight??0),dv(r,uo(t.description))(t.description,y,b.x,b.y+15,b.width,b.height,{class:`actor ${E6}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),RRr=k(function(e,t,r,n,i){let a=n?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,{look:l,theme:u,themeVariables:d}=r,{bkgColorArray:h,borderColorArray:f,actorBorder:p}=d,m=e.append("g").lower();n||(ni++,m.append("line").attr("id","actor"+ni).attr("x1",o).attr("y1",s).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=ni);let g=e.append("g"),y=E6;n?y+=` ${$x}`:y+=` ${Xx}`,g.attr("class",y),g.attr("name",t.name),n||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);let v=l==="neo"?.5:1,b=l==="neo"?a+(1-v)*30:a;g.append("line").attr("id","actor-man-torso"+ni).attr("x1",o).attr("y1",b+25*v).attr("x2",o).attr("y2",b+45*v),g.append("line").attr("id","actor-man-arms"+ni).attr("x1",o-w6/2*v).attr("y1",b+33*v).attr("x2",o+w6/2*v).attr("y2",b+33*v),g.append("line").attr("x1",o-w6/2*v).attr("y1",b+60*v).attr("x2",o).attr("y2",b+45*v),g.append("line").attr("x1",o).attr("y1",b+45*v).attr("x2",o+(w6/2-2)*v).attr("y2",b+60*v);let x=g.append("circle");x.attr("cx",t.x+t.width/2),x.attr("cy",b+10*v),x.attr("r",15*v),x.attr("width",t.width*v),x.attr("height",t.height*v);let E=g.node().getBBox();t.height=E.height;let w=Od();w.x=t.x,w.y=b,w.fill="#eaeaea",w.width=t.width,w.height=t.height/v,w.class="actor",w.rx=3,w.ry=3;let T=i.get(t.name)??0;return uv.has(u)?(g.style("stroke",f[T%f.length]),g.style("fill",h[T%f.length])):g.style("stroke",p),dv(r,uo(t.description))(t.description,g,w.x,b+35*v-(l==="neo"?10:0),w.width,w.height,{class:`actor ${E6}`},r),t.height},"drawActorTypeActor"),MRr=k(async function(e,t,r,n,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(t.type){case"actor":return await RRr(e,t,r,n,s);case"participant":return await TRr(e,t,r,n,s);case"boundary":return await IRr(e,t,r,n,s);case"control":return await SRr(e,t,r,n,i,s);case"entity":return await ARr(e,t,r,n,s);case"database":return await URr(e,t,r,n,s);case"collections":return await kRr(e,t,r,n,s);case"queue":return await CRr(e,t,r,n,s)}},"drawActor"),LRr=k(function(e,t,r){let i=e.append("g");I4t(i,t),t.name&&dv(r)(t.name,i,t.x,t.y+r.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},r),i.lower()},"drawBox"),DRr=k(function(e){return e.append("g")},"anchorElement"),NRr=k(function(e,t,r,n,i,a,o){let{theme:s,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:d,mainBkg:h}=l,f=Od(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class="activation"+i%3,f.width=t.stopx-t.startx,f.height=r-t.starty;let g=cD(p,f),v=(o??new Map([...a.db.getActors().values()].map((b,x)=>[b.name,x]))).get(m)??0;uv.has(s)&&(g.style("stroke",d[v%d.length]),g.style("fill",u[v%d.length]??h))},"drawActivation"),_Rr=k(async function(e,t,r,n,i){let{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:u,messageFontSize:d,messageFontWeight:h}=n,f=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=k(function(y,v,b,x){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",b).attr("y2",x).attr("class","loopLine")},"drawLoopLine");p(t.startx,t.starty,t.stopx,t.starty),p(t.stopx,t.starty,t.stopx,t.stopy),p(t.startx,t.stopy,t.stopx,t.stopy),p(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(y){p(t.startx,y.y,t.stopx,y.y).style("stroke-dasharray","3, 3")});let m=Sq();m.text=r,m.x=t.startx,m.y=t.starty,m.fontFamily=u,m.fontSize=d,m.fontWeight=h,m.anchor="middle",m.valign="middle",m.tspan=!1,m.width=Math.max(l??0,50),m.height=s+(n.look==="neo"?15:0)||20,m.textMargin=o,m.class="labelText",A4t(f,m),m=R4t(),m.text=t.title,m.x=t.startx+l/2+(t.stopx-t.startx)/2,m.y=t.starty+a+o,m.anchor="middle",m.valign="middle",m.textMargin=o,m.class="loopText",m.fontFamily=u,m.fontSize=d,m.fontWeight=h,m.wrap=!0;let g=uo(m.text)?await m$(f,m,t):xA(f,m);if(t.sectionTitles!==void 0){for(let[y,v]of Object.entries(t.sectionTitles))if(v.message){m.text=v.message,m.x=t.startx+(t.stopx-t.startx)/2,m.y=t.sections[y].y+a+o,m.class="sectionTitle",m.anchor="middle",m.valign="middle",m.tspan=!1,m.fontFamily=u,m.fontSize=d,m.fontWeight=h,m.wrap=t.wrap,uo(m.text)?(t.starty=t.sections[y].y,await m$(f,m,t)):xA(f,m);let b=Math.round(g.map(x=>(x._groups||x)[0][0].getBBox().height).reduce((x,E)=>x+E));t.sections[y].height+=b-(a+o)}}return t.height=Math.round(t.stopy-t.starty),f},"drawLoop"),I4t=k(function(e,t){Tq(e,t)},"drawBackgroundRect"),PRr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),ORr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),BRr=k(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),FRr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),zRr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),GRr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),WRr=k(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),VRr=k(function(e,t){let{theme:r}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),R4t=k(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"),HRr=k(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),dv=(function(){function e(a,o,s,l,u,d,h){let f=o.append("text").attr("x",s+u/2).attr("y",l+d/2+5).style("text-anchor","middle").text(a);i(f,h)}k(e,"byText");function t(a,o,s,l,u,d,h,f){let{actorFontSize:p,actorFontFamily:m,actorFontWeight:g}=f,[y,v]=kd(p),b=a.split(Lt.lineBreakRegex);for(let x=0;xe.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:k(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:k(function(e){this.boxes.push(e)},"addBox"),addActor:k(function(e){this.actors.push(e)},"addActor"),addLoop:k(function(e){this.loops.push(e)},"addLoop"),addMessage:k(function(e){this.messages.push(e)},"addMessage"),addNote:k(function(e){this.notes.push(e)},"addNote"),lastActor:k(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:k(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:k(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:k(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:k(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,D4t(je())},"init"),updateVal:k(function(e,t,r,n){e[t]===void 0?e[t]=r:e[t]=n(r,e[t])},"updateVal"),updateBounds:k(function(e,t,r,n){let i=this,a=0;function o(s){return k(function(u){a++;let d=i.sequenceItems.length-a+1;i.updateVal(u,"starty",t-d*rt.boxMargin,Math.min),i.updateVal(u,"stopy",n+d*rt.boxMargin,Math.max),i.updateVal(_t.data,"startx",e-d*rt.boxMargin,Math.min),i.updateVal(_t.data,"stopx",r+d*rt.boxMargin,Math.max),s!=="activation"&&(i.updateVal(u,"startx",e-d*rt.boxMargin,Math.min),i.updateVal(u,"stopx",r+d*rt.boxMargin,Math.max),i.updateVal(_t.data,"starty",t-d*rt.boxMargin,Math.min),i.updateVal(_t.data,"stopy",n+d*rt.boxMargin,Math.max))},"updateItemBounds")}k(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:k(function(e,t,r,n){let i=Lt.getMin(e,r),a=Lt.getMax(e,r),o=Lt.getMin(t,n),s=Lt.getMax(t,n);this.updateVal(_t.data,"startx",i,Math.min),this.updateVal(_t.data,"starty",o,Math.min),this.updateVal(_t.data,"stopx",a,Math.max),this.updateVal(_t.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),newActivation:k(function(e,t,r){let n=r.get(e.from),i=v$(e.from).length||0,a=n.x+n.width/2+(i-1)*rt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+rt.activationWidth,stopy:void 0,actor:e.from,anchored:Na.anchorElement(t)})},"newActivation"),endActivation:k(function(e){let t=this.activations.map(function(r){return r.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:k(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:k(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:k(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:k(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:k(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:_t.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:k(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:k(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:k(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=Lt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:k(function(){return this.verticalPos},"getVerticalPos"),getBounds:k(function(){return{bounds:this.data,models:this.models}},"getBounds")},KRr=k(async function(e,t,r){_t.bumpVerticalPos(rt.boxMargin),t.height=rt.boxMargin,t.starty=_t.getVerticalPos();let n=Od();n.x=t.startx,n.y=t.starty,n.width=t.width||rt.width,n.class="note";let i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);let a=Na.drawRect(i,n),o=Sq();o.x=t.startx,o.y=t.starty,o.width=n.width,o.dy="1em",o.text=t.message,o.class="noteText",o.fontFamily=rt.noteFontFamily,o.fontSize=rt.noteFontSize,o.fontWeight=rt.noteFontWeight,o.anchor=rt.noteAlign,o.textMargin=rt.noteMargin,o.valign="center";let s=uo(o.text)?await m$(i,o):xA(i,o),l=Math.round(s.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,d)=>u+d));a.attr("height",l+2*rt.noteMargin),t.height+=l+2*rt.noteMargin,_t.bumpVerticalPos(l+2*rt.noteMargin),t.stopy=t.starty+l+2*rt.noteMargin,t.stopx=t.startx+n.width,_t.insert(t.startx,t.starty,t.stopx,t.stopy),_t.models.addNote(t)},"drawNote"),C4t=k(function(e,t,r,n,i,a,o){let s=n.db.getActors(),l=s.get(t.from),u=s.get(t.to),d=r.sequenceVisible,h=l.x+l.width/2,f=u.x+u.width/2,p=h<=f,m=O4t(t,n),g=e.append("g"),y=16.5,v=k((T,C)=>{let S=T?y:-y;return C?-S:S},"getCircleOffset"),b=k(T=>{g.append("circle").attr("cx",T).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:x,CENTRAL_CONNECTION_REVERSE:E,CENTRAL_CONNECTION_DUAL:w}=n.db.LINETYPE;if(d)switch(t.centralConnection){case x:m&&(f+=v(p,!0));break;case E:m||(h+=v(p,!1));break;case w:m?f+=v(p,!0):h+=v(p,!1);break}switch(t.centralConnection){case x:b(f);break;case E:b(h);break;case w:b(h),b(f);break}},"drawCentralConnection"),T6=k(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),bA=k(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),gwe=k(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");k(M4t,"boundMessage");ZRr=k(async function(e,t,r,n,i,a){let{startx:o,stopx:s,starty:l,message:u,type:d,sequenceIndex:h,sequenceVisible:f}=t,p=Nr.calculateTextDimensions(u,T6(rt)),m=Sq();m.x=Math.min(o,s),m.y=l+10,m.width=Math.abs(s-o),m.class="messageText",m.dy="1em",m.text=u,m.fontFamily=rt.messageFontFamily,m.fontSize=rt.messageFontSize,m.fontWeight=rt.messageFontWeight,m.anchor=rt.messageAlign,m.valign="center",m.textMargin=rt.wrapPadding,m.tspan=!1,uo(m.text)?await m$(e,m,{startx:o,stopx:s,starty:r}):xA(e,m);let g=p.width,y;if(o===s){let b=f||rt.showSequenceNumbers,x=O4t(i,n),E=aMr(i,n),w=o+(b&&(x||E)?10:0);rt.rightAngles?y=e.append("path").attr("d",`M ${w},${r} H ${o+Lt.getMax(rt.width/2,g/2)} V ${r+25} H ${o}`):y=e.append("path").attr("d","M "+w+","+r+" C "+(w+60)+","+(r-10)+" "+(o+60)+","+(r+30)+" "+o+","+(r+20)),pwe(i,n)&&C4t(e,i,t,n,o,s,r)}else y=e.append("line"),y.attr("x1",o),y.attr("y1",r),y.attr("x2",s),y.attr("y2",r),pwe(i,n)&&C4t(e,i,t,n,o,s,r);d===n.db.LINETYPE.DOTTED||d===n.db.LINETYPE.DOTTED_CROSS||d===n.db.LINETYPE.DOTTED_POINT||d===n.db.LINETYPE.DOTTED_OPEN||d===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||d===n.db.LINETYPE.SOLID_TOP_DOTTED||d===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||d===n.db.LINETYPE.STICK_TOP_DOTTED||d===n.db.LINETYPE.STICK_BOTTOM_DOTTED||d===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+t.id),y.attr("data-from",t.from),y.attr("data-to",t.to);let v="";if(rt.arrowMarkerAbsolute&&(v=F9(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(d===n.db.LINETYPE.SOLID_TOP||d===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(d===n.db.LINETYPE.SOLID_BOTTOM||d===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(d===n.db.LINETYPE.STICK_TOP||d===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(d===n.db.LINETYPE.STICK_BOTTOM||d===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(d===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(d===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(d===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(d===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(d===n.db.LINETYPE.SOLID||d===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(d===n.db.LINETYPE.BIDIRECTIONAL_SOLID||d===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(d===n.db.LINETYPE.SOLID_POINT||d===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(d===n.db.LINETYPE.SOLID_CROSS||d===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||rt.showSequenceNumbers){let b=d===n.db.LINETYPE.BIDIRECTIONAL_SOLID||d===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,x=d===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,E=6,w=pwe(i,n),T=o,C=s;b?(oo?C=s-2*E:(C=s-E,T+=i?.centralConnection===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),C+=w?15:0,y.attr("x2",C),y.attr("x1",T)):y.attr("x1",o+E);let S=0,R=o===s,U=o<=s;R?S=t.fromBounds+1:x?S=U?t.toBounds-1:t.fromBounds+1:S=U?t.fromBounds+1:t.toBounds-1;let L="12px",I=h.toString().length;I>5?L="7px":I>3&&(L="9px"),e.append("line").attr("x1",S).attr("y1",r).attr("x2",S).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),e.append("text").attr("x",S).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",L).attr("text-anchor","middle").attr("class","sequenceNumber").text(h)}},"drawMessage"),QRr=k(function(e,t,r,n,i,a,o){let s=0,l=0,u,d=0;for(let h of n){let f=t.get(h),p=f.box;u&&u!=p&&(o||_t.models.addBox(u),l+=rt.boxMargin+u.margin),p&&p!=u&&(o||(p.x=s+l,p.y=i),l+=p.margin),f.width=Lt.getMax(f.width||rt.width,rt.width),f.height=Lt.getMax(f.height||rt.height,rt.height),f.margin=f.margin||rt.actorMargin,d=Lt.getMax(d,f.height),r.get(f.name)&&(l+=f.width/2),f.x=s+l,f.starty=_t.getVerticalPos(),_t.insert(f.x,i,f.x+f.width,f.height),s+=f.width+l,f.box&&(f.box.width=s+p.margin-f.box.x),l=f.margin,u=f.box,_t.models.addActor(f)}u&&!o&&_t.models.addBox(u),_t.bumpVerticalPos(d)},"addActorRenderingData"),ywe=k(async function(e,t,r,n,i,a,o){if(n){let s=0;_t.bumpVerticalPos(rt.boxMargin*2);for(let l of r){let u=t.get(l);u.stopy||(u.stopy=_t.getVerticalPos());let d=await Na.drawActor(e,u,rt,!0,i,a,o);s=Lt.getMax(s,d)}_t.bumpVerticalPos(s+rt.boxMargin)}else for(let s of r){let l=t.get(s);await Na.drawActor(e,l,rt,!1,i,a,o)}},"drawActors"),L4t=k(function(e,t,r,n){let i=0,a=0;for(let o of r){let s=t.get(o),l=eMr(s),u=Na.drawPopup(e,s,l,rt,rt.forceMenus,n);u.height>i&&(i=u.height),u.width+s.x>a&&(a=u.width+s.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),D4t=k(function(e){co(rt,e),e.fontFamily&&(rt.actorFontFamily=rt.noteFontFamily=rt.messageFontFamily=e.fontFamily),e.fontSize&&(rt.actorFontSize=rt.noteFontSize=rt.messageFontSize=e.fontSize),e.fontWeight&&(rt.actorFontWeight=rt.noteFontWeight=rt.messageFontWeight=e.fontWeight)},"setConf"),v$=k(function(e){return _t.activations.filter(function(t){return t.actor===e})},"actorActivations"),S4t=k(function(e,t){let r=t.get(e),n=v$(e),i=n.reduce(function(o,s){return Lt.getMin(o,s.startx)},r.x+r.width/2-1),a=n.reduce(function(o,s){return Lt.getMax(o,s.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");k(P0,"adjustLoopHeightForWrap");k(N4t,"adjustCreatedDestroyedData");JRr=k(async function(e,t,r,n){let{securityLevel:i,sequence:a,look:o,themeVariables:s}=je();rt=a;let l;i==="sandbox"&&(l=xt("#i"+t));let u=i==="sandbox"?xt(l.nodes()[0].contentDocument.body):xt("body"),d=i==="sandbox"?l.nodes()[0].contentDocument:document;_t.init(),ye.debug(n.db);let h=i==="sandbox"?u.select(`[id="${t}"]`):xt(`[id="${t}"]`),f=n.db.getActors(),p=n.db.getCreatedActors(),m=n.db.getDestroyedActors(),g=n.db.getBoxes(),y=n.db.getActorKeys(),v=n.db.getMessages(),b=n.db.getDiagramTitle(),x=n.db.hasAtLeastOneBox(),E=n.db.hasAtLeastOneBoxWithTitle(),w=await _4t(f,v,n);if(rt.height=await P4t(f,w,g),Na.insertComputerIcon(h,t),Na.insertDatabaseIcon(h,t),Na.insertClockIcon(h,t),x&&(_t.bumpVerticalPos(rt.boxMargin),E&&_t.bumpVerticalPos(g[0].textMaxHeight)),rt.hideUnusedParticipants===!0){let z=new Set;v.forEach(V=>{z.add(V.from),z.add(V.to)}),y=y.filter(V=>z.has(V))}let T=new Map(y.map((z,V)=>[f.get(z)?.name??z,V]));QRr(h,f,p,y,0,v,!1);let C=await sMr(v,f,w,n);Na.insertArrowHead(h,t),Na.insertArrowCrossHead(h,t),Na.insertArrowFilledHead(h,t),Na.insertSequenceNumber(h,t),Na.insertSolidTopArrowHead(h,t),Na.insertSolidBottomArrowHead(h,t),Na.insertStickTopArrowHead(h,t),Na.insertStickBottomArrowHead(h,t),o==="neo"&&Na.insertDropShadow(h,rt);function S(z,V){let $=_t.endActivation(z);$.starty+18>V&&($.starty=V-6,V+=12),Na.drawActivation(h,$,V,rt,v$(z.from).length,n,T),_t.insert($.startx,V-10,$.stopx,V)}k(S,"activeEnd");let R=1,U=1,L=[],I=[],A=0;for(let z of v){let V,$,Z;switch(z.type){case n.db.LINETYPE.NOTE:_t.resetVerticalPos(),$=z.noteModel,await KRr(h,$,z.id);break;case n.db.LINETYPE.ACTIVE_START:_t.newActivation(z,h,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:_t.newActivation(z,h,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:_t.newActivation(z,h,f);break;case n.db.LINETYPE.ACTIVE_END:S(z,_t.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re));break;case n.db.LINETYPE.LOOP_END:V=_t.endLoop(),await Na.drawLoop(h,V,"loop",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.RECT_START:P0(C,z,rt.boxMargin,rt.boxMargin,re=>{let Q=re.message;Q||(Q=s?.rectBkgColor||s?.actorBkg||"rgba(128, 128, 128, 0.5)"),_t.newLoop(void 0,Q)});break;case n.db.LINETYPE.RECT_END:V=_t.endLoop(),I.push(V),_t.models.addLoop(V),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos());break;case n.db.LINETYPE.OPT_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re));break;case n.db.LINETYPE.OPT_END:V=_t.endLoop(),await Na.drawLoop(h,V,"opt",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.ALT_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re));break;case n.db.LINETYPE.ALT_ELSE:P0(C,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,re=>_t.addSectionToLoop(re));break;case n.db.LINETYPE.ALT_END:V=_t.endLoop(),await Na.drawLoop(h,V,"alt",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re)),_t.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:P0(C,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,re=>_t.addSectionToLoop(re));break;case n.db.LINETYPE.PAR_END:V=_t.endLoop(),await Na.drawLoop(h,V,"par",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.AUTONUMBER:R=z.message.start||R,U=z.message.step||U,z.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re));break;case n.db.LINETYPE.CRITICAL_OPTION:P0(C,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,re=>_t.addSectionToLoop(re));break;case n.db.LINETYPE.CRITICAL_END:V=_t.endLoop(),await Na.drawLoop(h,V,"critical",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.BREAK_START:P0(C,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,re=>_t.newLoop(re));break;case n.db.LINETYPE.BREAK_END:V=_t.endLoop(),await Na.drawLoop(h,V,"break",rt,z),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;default:try{Z=z.msgModel,Z.starty=_t.getVerticalPos(),Z.sequenceIndex=R,Z.sequenceVisible=n.db.showSequenceNumbers(),Z.id=z.id,Z.from=z.from,Z.to=z.to;let re=await M4t(h,Z);N4t(z,Z,re,A,f,p,m),L.push({messageModel:Z,lineStartY:re,msg:z}),_t.models.addMessage(Z)}catch(re){ye.error("error while drawing message",re)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(z.type)&&(R=Math.round((R+U)*100)/100),A++}ye.debug("createdActors",p),ye.debug("destroyedActors",m),await ywe(h,f,y,!1,t,n,T);for(let z of L)await ZRr(h,z.messageModel,z.lineStartY,n,z.msg,t);rt.mirrorActors&&await ywe(h,f,y,!0,t,n,T),I.forEach(z=>Na.drawBackgroundRect(h,z)),U4t(h,f,y,rt);for(let z of _t.models.boxes){z.height=_t.getVerticalPos()-z.y,_t.insert(z.x,z.y,z.x+z.width,z.height);let V=rt.boxMargin*2;z.startx=z.x-V,z.starty=z.y-V*.25,z.stopx=z.startx+z.width+2*V,z.stopy=z.starty+z.height+V*.75,z.stroke="rgb(0,0,0, 0.5)",Na.drawBox(h,z,rt)}x&&_t.bumpVerticalPos(rt.boxMargin);let P=L4t(h,f,y,d),{bounds:D}=_t.getBounds();D.startx===void 0&&(D.startx=0),D.starty===void 0&&(D.starty=0),D.stopx===void 0&&(D.stopx=0),D.stopy===void 0&&(D.stopy=0);let M=D.stopy-D.starty;M2,f=k(y=>l?-y:y,"adjustValue");e.from===e.to?d=u:(e.activate&&!h&&(d+=f(rt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(d+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(u-=f(3)));let p=[i,a,o,s],m=Math.abs(u-d);e.wrap&&e.message&&(e.message=Nr.wrapLabel(e.message,Lt.getMax(m+2*rt.wrapPadding,rt.width),T6(rt)));let g=Nr.calculateTextDimensions(e.message,T6(rt));return{width:Lt.getMax(e.wrap?0:g.width+2*rt.wrapPadding,m+2*rt.wrapPadding,rt.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),sMr=k(async function(e,t,r,n){let i={},a=[],o,s,l;for(let u of e){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(o=a.pop(),i[o.id]=o,i[u.id]=o,a.push(o));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:o=a.pop(),i[o.id]=o;break;case n.db.LINETYPE.ACTIVE_START:{let h=t.get(u.from?u.from:u.to.actor),f=v$(u.from?u.from:u.to.actor).length,p=h.x+h.width/2+(f-1)*rt.activationWidth/2,m={startx:p,stopx:p+rt.activationWidth,actor:u.from,enabled:!0};_t.activations.push(m)}break;case n.db.LINETYPE.ACTIVE_END:{let h=_t.activations.map(f=>f.actor).lastIndexOf(u.from);_t.activations.splice(h,1).splice(0,1)}break}u.placement!==void 0?(s=await tMr(u,t,n),u.noteModel=s,a.forEach(h=>{o=h,o.from=Lt.getMin(o.from,s.startx),o.to=Lt.getMax(o.to,s.startx+s.width),o.width=Lt.getMax(o.width,Math.abs(o.from-o.to))-rt.labelBoxWidth})):(l=oMr(u,t,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(h=>{if(o=h,l.startx===l.stopx){let f=t.get(u.from),p=t.get(u.to);o.from=Lt.getMin(f.x-l.width/2,f.x-f.width/2,o.from),o.to=Lt.getMax(p.x+l.width/2,p.x+f.width/2,o.to),o.width=Lt.getMax(o.width,Math.abs(o.to-o.from))-rt.labelBoxWidth}else o.from=Lt.getMin(l.startx,o.from),o.to=Lt.getMax(l.stopx,o.to),o.width=Lt.getMax(o.width,l.width)-rt.labelBoxWidth}))}return _t.activations=[],ye.debug("Loop type widths:",i),i},"calculateLoopBounds"),lMr={bounds:_t,drawActors:ywe,drawActorsPopup:L4t,setConf:D4t,draw:JRr},cMr={parser:mRr,get db(){return new bRr},renderer:lMr,styles:wRr,init:k(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,z9({sequence:{wrap:e.wrap}}))},"init")}});var bwe,x$,z4t,G4t,b$,W4t,k6,w$,uMr,E$,dMr,hMr,fMr,T$,wwe=H(()=>{Dg();Oh();Fd();_d();Ph();Vn();Wr();Gr();xr();_n();lk();bwe=(function(){var e=k(function(le,W,X,q){for(X=X||{},q=le.length;q--;X[le[q]]=W);return X},"o"),t=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],o=[1,42],s=[1,24],l=[1,25],u=[1,32],d=[1,33],h=[1,34],f=[1,45],p=[1,35],m=[1,36],g=[1,37],y=[1,38],v=[1,27],b=[1,28],x=[1,29],E=[1,30],w=[1,31],T=[1,44],C=[1,46],S=[1,43],R=[1,47],U=[1,9],L=[1,8,9],I=[1,58],A=[1,59],P=[1,60],D=[1,61],M=[1,62],O=[1,63],_=[1,64],B=[1,8,9,41],F=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],V=[13,60,86,100,102,103],$=[13,60,73,74,86,100,102,103],Z=[13,60,68,69,70,71,72,86,100,102,103],re=[1,103],Q=[1,121],ge=[1,117],ie=[1,113],pe=[1,119],ue=[1,114],fe=[1,115],Me=[1,116],Ce=[1,118],Ye=[1,120],Ze=[22,50,60,61,82,86,87,88,89,90],Qe=[1,128],ve=[12,39],Fe=[1,8,9,39,41,44,46],Le=[1,8,9,22],Be=[1,153],ae=[1,8,9,61],he=[1,8,9,22,50,60,61,82,86,87,88,89,90],de={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:k(function(W,X,q,j,se,J,K){var ee=J.length-1;switch(se){case 8:this.$=J[ee-1];break;case 9:case 10:case 13:case 15:this.$=J[ee];break;case 11:case 14:this.$=J[ee-2]+"."+J[ee];break;case 12:case 16:this.$=J[ee-1]+J[ee];break;case 17:case 18:this.$=J[ee-1]+"~"+J[ee]+"~";break;case 19:j.addRelation(J[ee]);break;case 20:J[ee-1].title=j.cleanupLabel(J[ee]),j.addRelation(J[ee-1]);break;case 31:this.$=J[ee].trim(),j.setAccTitle(this.$);break;case 32:case 33:this.$=J[ee].trim(),j.setAccDescription(this.$);break;case 34:j.addClassesToNamespace(J[ee-3],J[ee-1][0],J[ee-1][1]),j.popNamespace();break;case 35:j.addClassesToNamespace(J[ee-4],J[ee-1][0],J[ee-1][1]),j.popNamespace();break;case 36:this.$=j.addNamespace(J[ee]);break;case 37:this.$=j.addNamespace(J[ee-1],J[ee]);break;case 38:this.$=[[J[ee]],[]];break;case 39:this.$=[[J[ee-1]],[]];break;case 40:J[ee][0].unshift(J[ee-2]),this.$=J[ee];break;case 41:this.$=[[],[J[ee]]];break;case 42:this.$=[[],[J[ee-1]]];break;case 43:J[ee][1].unshift(J[ee-2]),this.$=J[ee];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=J[ee];break;case 48:j.setCssClass(J[ee-2],J[ee]);break;case 49:j.addMembers(J[ee-3],J[ee-1]);break;case 51:j.setCssClass(J[ee-5],J[ee-3]),j.addMembers(J[ee-5],J[ee-1]);break;case 52:j.addAnnotation(J[ee-3],J[ee-1]);break;case 53:j.addAnnotation(J[ee-6],J[ee-4]),j.addMembers(J[ee-6],J[ee-1]);break;case 54:j.addAnnotation(J[ee-5],J[ee-3]);break;case 55:this.$=J[ee],j.addClass(J[ee]);break;case 56:this.$=J[ee-1],j.addClass(J[ee-1]),j.setClassLabel(J[ee-1],J[ee]);break;case 60:j.addAnnotation(J[ee],J[ee-2]);break;case 61:case 74:this.$=[J[ee]];break;case 62:J[ee].push(J[ee-1]),this.$=J[ee];break;case 63:break;case 64:j.addMember(J[ee-1],j.cleanupLabel(J[ee]));break;case 65:break;case 66:break;case 67:this.$={id1:J[ee-2],id2:J[ee],relation:J[ee-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:J[ee-3],id2:J[ee],relation:J[ee-1],relationTitle1:J[ee-2],relationTitle2:"none"};break;case 69:this.$={id1:J[ee-3],id2:J[ee],relation:J[ee-2],relationTitle1:"none",relationTitle2:J[ee-1]};break;case 70:this.$={id1:J[ee-4],id2:J[ee],relation:J[ee-2],relationTitle1:J[ee-3],relationTitle2:J[ee-1]};break;case 71:this.$=j.addNote(J[ee],J[ee-1]);break;case 72:this.$=j.addNote(J[ee]);break;case 73:this.$=J[ee-2],j.defineClass(J[ee-1],J[ee]);break;case 75:this.$=J[ee-2].concat([J[ee]]);break;case 76:j.setDirection("TB");break;case 77:j.setDirection("BT");break;case 78:j.setDirection("RL");break;case 79:j.setDirection("LR");break;case 80:this.$={type1:J[ee-2],type2:J[ee],lineType:J[ee-1]};break;case 81:this.$={type1:"none",type2:J[ee],lineType:J[ee-1]};break;case 82:this.$={type1:J[ee-1],type2:"none",lineType:J[ee]};break;case 83:this.$={type1:"none",type2:"none",lineType:J[ee]};break;case 84:this.$=j.relationType.AGGREGATION;break;case 85:this.$=j.relationType.EXTENSION;break;case 86:this.$=j.relationType.COMPOSITION;break;case 87:this.$=j.relationType.DEPENDENCY;break;case 88:this.$=j.relationType.LOLLIPOP;break;case 89:this.$=j.lineType.LINE;break;case 90:this.$=j.lineType.DOTTED_LINE;break;case 91:case 97:this.$=J[ee-2],j.setClickEvent(J[ee-1],J[ee]);break;case 92:case 98:this.$=J[ee-3],j.setClickEvent(J[ee-2],J[ee-1]),j.setTooltip(J[ee-2],J[ee]);break;case 93:this.$=J[ee-2],j.setLink(J[ee-1],J[ee]);break;case 94:this.$=J[ee-3],j.setLink(J[ee-2],J[ee-1],J[ee]);break;case 95:this.$=J[ee-3],j.setLink(J[ee-2],J[ee-1]),j.setTooltip(J[ee-2],J[ee]);break;case 96:this.$=J[ee-4],j.setLink(J[ee-3],J[ee-2],J[ee]),j.setTooltip(J[ee-3],J[ee-1]);break;case 99:this.$=J[ee-3],j.setClickEvent(J[ee-2],J[ee-1],J[ee]);break;case 100:this.$=J[ee-4],j.setClickEvent(J[ee-3],J[ee-2],J[ee-1]),j.setTooltip(J[ee-3],J[ee]);break;case 101:this.$=J[ee-3],j.setLink(J[ee-2],J[ee]);break;case 102:this.$=J[ee-4],j.setLink(J[ee-3],J[ee-1],J[ee]);break;case 103:this.$=J[ee-4],j.setLink(J[ee-3],J[ee-1]),j.setTooltip(J[ee-3],J[ee]);break;case 104:this.$=J[ee-5],j.setLink(J[ee-4],J[ee-2],J[ee]),j.setTooltip(J[ee-4],J[ee-1]);break;case 105:this.$=J[ee-2],j.setCssStyle(J[ee-1],J[ee]);break;case 106:j.setCssClass(J[ee-1],J[ee]);break;case 107:this.$=[J[ee]];break;case 108:J[ee-2].push(J[ee]),this.$=J[ee-2];break;case 110:this.$=J[ee-1]+J[ee];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,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:r,37:n,38:22,42:i,43:23,46:a,48:o,51:s,52:l,54:u,56:d,57:h,60:f,62:p,63:m,64:g,65:y,75:v,76:b,78:x,82:E,83:w,86:T,100:C,102:S,103:R},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(U,[2,5],{8:[1,48]}),{8:[1,49]},e(L,[2,19],{22:[1,50]}),e(L,[2,21]),e(L,[2,22]),e(L,[2,23]),e(L,[2,24]),e(L,[2,25]),e(L,[2,26]),e(L,[2,27]),e(L,[2,28]),e(L,[2,29]),e(L,[2,30]),{34:[1,51]},{36:[1,52]},e(L,[2,33]),e(L,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:I,69:A,70:P,71:D,72:M,73:O,74:_}),{39:[1,65]},e(B,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(L,[2,65]),e(L,[2,66]),{16:69,60:f,86:T,100:C,102:S},{16:39,17:40,19:70,60:f,86:T,100:C,102:S,103:R},{16:39,17:40,19:71,60:f,86:T,100:C,102:S,103:R},{16:39,17:40,19:72,60:f,86:T,100:C,102:S,103:R},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:T,100:C,102:S,103:R},{13:F,55:76},{58:78,60:[1,79]},e(L,[2,76]),e(L,[2,77]),e(L,[2,78]),e(L,[2,79]),e(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:T,100:C,102:S,103:R}),e(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:T,100:C,102:S,103:R},{16:39,17:40,19:87,60:f,86:T,100:C,102:S,103:R},e(z,[2,133]),e(z,[2,134]),e(z,[2,135]),e(z,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(U,[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,19:21,38:22,43:23,16:39,17:40,5:88,33:t,35:r,37:n,42:i,46:a,48:o,51:s,52:l,54:u,56:d,57:h,60:f,62:p,63:m,64:g,65:y,75:v,76:b,78:x,82:E,83:w,86:T,100:C,102:S,103:R}),{5:89,10:5,16:39,17:40,19:21,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:r,37:n,38:22,42:i,43:23,46:a,48:o,51:s,52:l,54:u,56:d,57:h,60:f,62:p,63:m,64:g,65:y,75:v,76:b,78:x,82:E,83:w,86:T,100:C,102:S,103:R},e(L,[2,20]),e(L,[2,31]),e(L,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:T,100:C,102:S,103:R},{53:92,66:56,67:57,68:I,69:A,70:P,71:D,72:M,73:O,74:_},e(L,[2,64]),{67:93,73:O,74:_},e(V,[2,83],{66:94,68:I,69:A,70:P,71:D,72:M}),e($,[2,84]),e($,[2,85]),e($,[2,86]),e($,[2,87]),e($,[2,88]),e(Z,[2,89]),e(Z,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:o,54:u,56:d},{16:100,60:f,86:T,100:C,102:S},{41:[1,102],45:101,51:re},{16:104,60:f,86:T,100:C,102:S},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Q,50:ge,59:110,60:ie,82:pe,84:111,85:112,86:ue,87:fe,88:Me,89:Ce,90:Ye},{60:[1,122]},{13:F,55:123},e(B,[2,72]),e(B,[2,138]),{22:Q,50:ge,59:124,60:ie,61:[1,125],82:pe,84:111,85:112,86:ue,87:fe,88:Me,89:Ce,90:Ye},e(Ze,[2,74]),{16:39,17:40,19:126,60:f,86:T,100:C,102:S,103:R},e(G,[2,16]),e(G,[2,17]),e(G,[2,18]),{11:127,12:Qe,39:[2,36]},e(ve,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:T,100:C,102:S,103:R}),e(ve,[2,10]),e(Fe,[2,55],{11:131,12:Qe}),e(U,[2,7]),{9:[1,132]},e(Le,[2,67]),{16:39,17:40,19:133,60:f,86:T,100:C,102:S,103:R},{13:[1,135],16:39,17:40,19:134,60:f,86:T,100:C,102:S,103:R},e(V,[2,82],{66:136,68:I,69:A,70:P,71:D,72:M}),e(V,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:o,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(B,[2,48],{39:[1,142]}),{41:[1,143]},e(B,[2,50]),{41:[2,61],45:144,51:re},{47:[1,145]},{16:39,17:40,19:146,60:f,86:T,100:C,102:S,103:R},e(L,[2,91],{13:[1,147]}),e(L,[2,93],{13:[1,149],77:[1,148]}),e(L,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(L,[2,105],{61:Be}),e(ae,[2,107],{85:154,22:Q,50:ge,60:ie,82:pe,86:ue,87:fe,88:Me,89:Ce,90:Ye}),e(he,[2,109]),e(he,[2,111]),e(he,[2,112]),e(he,[2,113]),e(he,[2,114]),e(he,[2,115]),e(he,[2,116]),e(he,[2,117]),e(he,[2,118]),e(he,[2,119]),e(L,[2,106]),e(B,[2,71]),e(L,[2,73],{61:Be}),{60:[1,155]},e(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:T,100:C,102:S,103:R},e(ve,[2,12]),e(Fe,[2,56]),{1:[2,4]},e(Le,[2,69]),e(Le,[2,68]),{16:39,17:40,19:158,60:f,86:T,100:C,102:S,103:R},e(V,[2,80]),e(B,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:o,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:o,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:o,54:u,56:d},{45:163,51:re},e(B,[2,49]),{41:[2,62]},e(B,[2,52],{39:[1,164]}),e(L,[2,60]),e(L,[2,92]),e(L,[2,94]),e(L,[2,95],{77:[1,165]}),e(L,[2,98]),e(L,[2,99],{13:[1,166]}),e(L,[2,101],{13:[1,168],77:[1,167]}),{22:Q,50:ge,60:ie,82:pe,84:169,85:112,86:ue,87:fe,88:Me,89:Ce,90:Ye},e(he,[2,110]),e(Ze,[2,75]),{14:[1,170]},e(ve,[2,11]),e(Le,[2,70]),e(B,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:re},e(L,[2,96]),e(L,[2,100]),e(L,[2,102]),e(L,[2,103],{77:[1,174]}),e(ae,[2,108],{85:154,22:Q,50:ge,60:ie,82:pe,86:ue,87:fe,88:Me,89:Ce,90:Ye}),e(Fe,[2,8]),e(B,[2,51]),{41:[1,175]},e(B,[2,54]),e(L,[2,104]),e(B,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:k(function(W,X){if(X.recoverable)this.trace(W);else{var q=new Error(W);throw q.hash=X,q}},"parseError"),parse:k(function(W){var X=this,q=[0],j=[],se=[null],J=[],K=this.table,ee="",Se=0,Te=0,Ae=0,Ie=2,Ge=1,De=J.slice.call(arguments,1),He=Object.create(this.lexer),ze={yy:{}};for(var Ke in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ke)&&(ze.yy[Ke]=this.yy[Ke]);He.setInput(W,ze.yy),ze.yy.lexer=He,ze.yy.parser=this,typeof He.yylloc>"u"&&(He.yylloc={});var we=He.yylloc;J.push(we);var bt=He.options&&He.options.ranges;typeof ze.yy.parseError=="function"?this.parseError=ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ve(Ct){q.length=q.length-2*Ct,se.length=se.length-Ct,J.length=J.length-Ct}k(Ve,"popStack");function vt(){var Ct;return Ct=j.pop()||He.lex()||Ge,typeof Ct!="number"&&(Ct instanceof Array&&(j=Ct,Ct=j.pop()),Ct=X.symbols_[Ct]||Ct),Ct}k(vt,"lex");for(var Pt,Xt,It,Ot,Et,Ee,gt={},Ut,ct,Ne,at;;){if(It=q[q.length-1],this.defaultActions[It]?Ot=this.defaultActions[It]:((Pt===null||typeof Pt>"u")&&(Pt=vt()),Ot=K[It]&&K[It][Pt]),typeof Ot>"u"||!Ot.length||!Ot[0]){var ft="";at=[];for(Ut in K[It])this.terminals_[Ut]&&Ut>Ie&&at.push("'"+this.terminals_[Ut]+"'");He.showPosition?ft="Parse error on line "+(Se+1)+`: -`+He.showPosition()+` -Expecting `+at.join(", ")+", got '"+(this.terminals_[Pt]||Pt)+"'":ft="Parse error on line "+(Se+1)+": Unexpected "+(Pt==Ge?"end of input":"'"+(this.terminals_[Pt]||Pt)+"'"),this.parseError(ft,{text:He.match,token:this.terminals_[Pt]||Pt,line:He.yylineno,loc:we,expected:at})}if(Ot[0]instanceof Array&&Ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+Pt);switch(Ot[0]){case 1:q.push(Pt),se.push(He.yytext),J.push(He.yylloc),q.push(Ot[1]),Pt=null,Xt?(Pt=Xt,Xt=null):(Te=He.yyleng,ee=He.yytext,Se=He.yylineno,we=He.yylloc,Ae>0&&Ae--);break;case 2:if(ct=this.productions_[Ot[1]][1],gt.$=se[se.length-ct],gt._$={first_line:J[J.length-(ct||1)].first_line,last_line:J[J.length-1].last_line,first_column:J[J.length-(ct||1)].first_column,last_column:J[J.length-1].last_column},bt&&(gt._$.range=[J[J.length-(ct||1)].range[0],J[J.length-1].range[1]]),Ee=this.performAction.apply(gt,[ee,Te,Se,ze.yy,Ot[1],se,J].concat(De)),typeof Ee<"u")return Ee;ct&&(q=q.slice(0,-1*ct*2),se=se.slice(0,-1*ct),J=J.slice(0,-1*ct)),q.push(this.productions_[Ot[1]][0]),se.push(gt.$),J.push(gt._$),Ne=K[q[q.length-2]][q[q.length-1]],q.push(Ne);break;case 3:return!0}}return!0},"parse")},me=(function(){var le={EOF:1,parseError:k(function(X,q){if(this.yy.parser)this.yy.parser.parseError(X,q);else throw new Error(X)},"parseError"),setInput:k(function(W,X){return this.yy=X||this.yy||{},this._input=W,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var W=this._input[0];this.yytext+=W,this.yyleng++,this.offset++,this.match+=W,this.matched+=W;var X=W.match(/(?:\r\n?|\n).*/g);return X?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),W},"input"),unput:k(function(W){var X=W.length,q=W.split(/(?:\r\n?|\n)/g);this._input=W+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-X),this.offset-=X;var j=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),q.length-1&&(this.yylineno-=q.length-1);var se=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:q?(q.length===j.length?this.yylloc.first_column:0)+j[j.length-q.length].length-q[0].length:this.yylloc.first_column-X},this.options.ranges&&(this.yylloc.range=[se[0],se[0]+this.yyleng-X]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(W){this.unput(this.match.slice(W))},"less"),pastInput:k(function(){var W=this.matched.substr(0,this.matched.length-this.match.length);return(W.length>20?"...":"")+W.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var W=this.match;return W.length<20&&(W+=this._input.substr(0,20-W.length)),(W.substr(0,20)+(W.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var W=this.pastInput(),X=new Array(W.length+1).join("-");return W+this.upcomingInput()+` -`+X+"^"},"showPosition"),test_match:k(function(W,X){var q,j,se;if(this.options.backtrack_lexer&&(se={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&&(se.yylloc.range=this.yylloc.range.slice(0))),j=W[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+W[0].length},this.yytext+=W[0],this.match+=W[0],this.matches=W,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(W[0].length),this.matched+=W[0],q=this.performAction.call(this,this.yy,this,X,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),q)return q;if(this._backtrack){for(var J in se)this[J]=se[J];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var W,X,q,j;this._more||(this.yytext="",this.match="");for(var se=this._currentRules(),J=0;JX[0].length)){if(X=q,j=J,this.options.backtrack_lexer){if(W=this.test_match(q,se[J]),W!==!1)return W;if(this._backtrack){X=!1;continue}else return!1}else if(!this.options.flex)break}return X?(W=this.test_match(X,se[j]),W!==!1?W:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var X=this.next();return X||this.lex()},"lex"),begin:k(function(X){this.conditionStack.push(X)},"begin"),popState:k(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:k(function(X){this.begin(X)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(X,q,j,se){var J=se;switch(j){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;break;case 7:return this.popState(),"acc_title_value";break;case 8:return this.begin("acc_descr"),35;break;case 9:return this.popState(),"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;break;case 30:return this.popState(),8;break;case 31:break;case 32:return this.begin("namespace-body"),39;break;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;break;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;break;case 40:return this.popState(),8;break;case 41:break;case 42:return this.popState(),this.popState(),41;break;case 43:return this.begin("class-body"),39;break;case 44:return this.popState(),41;break;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\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,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,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,98],inclusive:!0}}};return le})();de.lexer=me;function ke(){this.yy={}}return k(ke,"Parser"),ke.prototype=de,de.Parser=ke,new ke})();bwe.parser=bwe;x$=bwe,z4t=["#","+","~","-",""],G4t=class{static{k(this,"ClassMember")}constructor(e,t){this.memberType=t,this.visibility="",this.classifier="",this.text="";let r=rn(e,je());this.parseMember(r)}getDisplayDetails(){let e=this.visibility+Hm(this.id);this.memberType==="method"&&(e+=`(${Hm(this.parameters.trim())})`,this.returnType&&(e+=" : "+Hm(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t="";if(this.memberType==="method"){let i=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(i){let a=i[1]?i[1].trim():"";if(z4t.includes(a)&&(this.visibility=a),this.id=i[2],this.parameters=i[3]?i[3].trim():"",t=i[4]?i[4].trim():"",this.returnType=i[5]?i[5].trim():"",t===""){let o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(t=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,i=e.substring(0,1),a=e.substring(n-1);z4t.includes(i)&&(this.visibility=i),/[$*]/.exec(a)&&(t=a),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();let r=`${this.visibility?"\\"+this.visibility:""}${Hm(this.id)}${this.memberType==="method"?`(${Hm(this.parameters)})${this.returnType?" : "+Hm(this.returnType):""}`:""}`;this.text=r.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""}}},b$="classId-",W4t=0,k6=k(e=>Lt.sanitizeText(e,je()),"sanitizeText"),w$=class xwe{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=k(t=>{let r=pS();xt(t).select("svg").selectAll("g").filter(function(){return xt(this).attr("title")!==null}).on("mouseover",a=>{let o=xt(a.currentTarget),s=o.attr("title");if(!s)return;let l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(xd.sanitize(s)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),xt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=sn,this.getAccTitle=pn,this.setAccDescription=mn,this.getAccDescription=gn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getConfig=k(()=>je().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.popNamespace=this.popNamespace.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{k(this,"ClassDB")}splitClassNameAndType(t){let r=Lt.sanitizeText(t,je()),n="",i=r;if(r.indexOf("~")>0){let a=r.split("~");i=k6(a[0]),n=k6(a[1])}return{className:i,type:n}}setClassLabel(t,r){let n=Lt.sanitizeText(t,je());r&&(r=k6(r));let{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(t){let r=Lt.sanitizeText(t,je()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;let a=Lt.sanitizeText(n,je());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:b$+a+"-"+W4t}),W4t++}addInterface(t,r){let n={id:`interface${this.interfaces.length}`,label:t,classId:r};this.interfaces.push(n)}setDiagramId(t){this.diagramId=t}lookUpDomId(t){let r=Lt.sanitizeText(t,je());if(this.classes.has(r)){let n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",$r()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(t){let r=typeof t=="number"?`note${t}`:t;return this.notes.get(r)}getNotes(){return this.notes}addRelation(t){ye.debug("Adding relation: "+JSON.stringify(t));let r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1===this.relationType.LOLLIPOP&&!r.includes(t.relation.type2)?(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1=`interface${this.interfaces.length-1}`):t.relation.type2===this.relationType.LOLLIPOP&&!r.includes(t.relation.type1)?(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2=`interface${this.interfaces.length-1}`):(this.addClass(t.id1),this.addClass(t.id2)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=Lt.sanitizeText(t.relationTitle1.trim(),je()),t.relationTitle2=Lt.sanitizeText(t.relationTitle2.trim(),je()),this.relations.push(t)}addAnnotation(t,r){let n=this.splitClassNameAndType(t).className;this.classes.get(n).annotations.push(r)}addMember(t,r){this.addClass(t);let n=this.splitClassNameAndType(t).className,i=this.classes.get(n);if(typeof r=="string"){let a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(k6(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new G4t(a,"method")):a&&i.members.push(new G4t(a,"attribute"))}}addMembers(t,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(t,n)))}addNote(t,r){let n=this.notes.size,i={id:`note${n}`,class:r,text:t,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),k6(t.trim())}setCssClass(t,r){t.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=b$+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(t,r){for(let n of t){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){let o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(o=>o.split(",")))})}}setTooltip(t,r){t.split(",").forEach(n=>{if(r!==void 0){let i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=k6(r))}})}getTooltip(t,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,r,n){let i=je();t.split(",").forEach(a=>{let o=a;/\d/.exec(a[0])&&(o=b$+o),o=this.splitClassNameAndType(o).className;let s=this.classes.get(o);s&&(s.link=Nr.formatUrl(r,i),i.securityLevel==="sandbox"?s.linkTarget="_top":typeof n=="string"?s.linkTarget=k6(n):s.linkTarget="_blank")}),this.setCssClass(t,"clickable")}setClickEvent(t,r,n){t.split(",").forEach(i=>{this.setClickFunc(i,r,n);let a=this.splitClassNameAndType(i).className,o=this.classes.get(a);o&&(o.haveCallback=!0)}),this.setCssClass(t,"clickable")}setClickFunc(t,r,n){let i=Lt.sanitizeText(t,je());if(je().securityLevel!=="loose"||r===void 0)return;let o=this.splitClassNameAndType(i).className;if(this.classes.has(o)){let s=[];if(typeof n=="string"){s=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{let l=this.lookUpDomId(o),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Nr.runFunc(r,...s)},!1)})}}bindFunctions(t){this.functions.forEach(r=>{r(t)})}escapeHtml(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(t){this.direction=t}static resolveQualifiedId(t,r){let n=r.at(-1);return n?`${n}.${t}`:t}static getAncestorIds(t){let r=t.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[o-1]:void 0,u=o===a.length-1,d=u&&r?r:i[o];this.namespaces.has(s)?u&&(this.namespaces.get(s).explicit=!0):this.namespaces.set(s,this.createNamespaceNode(s,d,l,u)),l&&this.linkParentChild(l,s)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,r,n){if(this.namespaces.has(t)){for(let i of r){let{className:a}=this.splitClassNameAndType(i),o=this.getClass(a);o.parent=t,this.namespaces.get(t).classes.set(a,o)}for(let i of n){let a=this.getNote(i);a.parent=t,this.namespaces.get(t).notes.set(i,a)}}}setCssStyle(t,r){let n=this.classes.get(t);if(!(!r||!n))for(let i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(t){let r;switch(t){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(t){let r=t;for(;r;){let n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){let t=[],r=[],n=je(),i=n.class?.hierarchicalNamespaces??!0;for(let o of this.namespaces.values()){if(!i&&!o.explicit)continue;let s={id:o.id,label:i?o.label:o.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?o.parent:void 0};t.push(s)}for(let o of this.classes.values()){let s=i?o.parent:this.resolveExplicitAncestor(o.parent),l={...o,type:void 0,isGroup:!1,parentId:s,look:n.look};t.push(l)}for(let o of this.notes.values()){let s=i?o.parent:this.resolveExplicitAncestor(o.parent),l={id:o.id,label:o.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,parentId:s,labelType:"markdown"};t.push(l);let u=this.classes.get(o.class)?.id;if(u){let d={id:`edgeNote${o.index}`,start:o.id,end:u,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(d)}}for(let o of this.interfaces){let s={id:o.id,label:o.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};t.push(s)}let a=0;for(let o of this.relations){a++;let s={id:tg(o.id1,o.id2,{prefix:"id",counter:a}),start:o.id1,end:o.id2,type:"normal",label:o.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(o.relation.type1),arrowTypeEnd:this.getArrowMarker(o.relation.type2),startLabelRight:o.relationTitle1==="none"?"":o.relationTitle1,endLabelLeft:o.relationTitle2==="none"?"":o.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:o.style||"",pattern:o.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(s)}return{nodes:t,edges:r,other:{},config:n,direction:this.getDirection()}}},uMr=k(e=>`g.classGroup text { - fill: ${e.nodeBorder||e.classText}; - stroke: none; - font-family: ${e.fontFamily}; - font-size: 10px; - - .title { - font-weight: bolder; - } - -} - - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span { - color: ${e.titleColor}; - } - .cluster-label span p { - background-color: transparent; - } - - .cluster rect { - fill: ${e.clusterBkg}; - stroke: ${e.clusterBorder}; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span { - color: ${e.titleColor}; - } - -.nodeLabel, .edgeLabel { - color: ${e.classText}; -} - -.noteLabel .nodeLabel, .noteLabel .edgeLabel { - color: ${e.noteTextColor}; -} -.edgeLabel .label rect { - fill: ${e.mainBkg}; -} -.label text { - fill: ${e.classText}; -} - -.labelBkg { - background: ${e.mainBkg}; -} -.edgeLabel .label span { - background: ${e.mainBkg}; -} - -.classTitle { - font-weight: bolder; -} -.node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: ${e.strokeWidth}; - } - - -.divider { - stroke: ${e.nodeBorder}; - stroke-width: 1; -} - -g.clickable { - cursor: pointer; -} - -g.classGroup rect { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; -} - -g.classGroup line { - stroke: ${e.nodeBorder}; - stroke-width: 1; -} - -.classLabel .box { - stroke: none; - stroke-width: 0; - fill: ${e.mainBkg}; - opacity: 0.5; -} - -.classLabel .label { - fill: ${e.nodeBorder}; - font-size: 10px; -} - -.relation { - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth}; - fill: none; -} - -.dashed-line{ - stroke-dasharray: 3; -} - -.dotted-line{ - stroke-dasharray: 1 2; -} - -[id$="-compositionStart"], .composition { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-compositionEnd"], .composition { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-dependencyStart"], .dependency { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-dependencyEnd"], .dependency { - fill: ${e.lineColor} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-extensionStart"], .extension { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-extensionEnd"], .extension { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-aggregationStart"], .aggregation { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-aggregationEnd"], .aggregation { - fill: transparent !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-lollipopStart"], .lollipop { - fill: ${e.mainBkg} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -[id$="-lollipopEnd"], .lollipop { - fill: ${e.mainBkg} !important; - stroke: ${e.lineColor} !important; - stroke-width: 1; -} - -.edgeTerminals { - font-size: 11px; - line-height: initial; -} - -.classTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; -} - -.edgeLabel[data-look="neo"] { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; -} - ${Lg()} -`,"getStyles"),E$=uMr,dMr=k((e,t="TB")=>{if(!e.doc)return t;let r=t;for(let n of e.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),hMr=k(function(e,t){return t.db.getClasses()},"getClasses"),fMr=k(async function(e,t,r,n){ye.info("REF0:"),ye.info("Drawing class diagram (v3)",t);let{securityLevel:i,state:a,layout:o}=je();n.db.setDiagramId(t);let s=n.db.getData(),l=Hf(t,i);s.type=n.type,s.layoutAlgorithm=Rg(o),s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=["aggregation","extension","composition","dependency","lollipop"],s.diagramId=t,await Gf(s,l);let u=8;Nr.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bd(l,u,"classDiagram",a?.useMaxWidth??!0)},"draw"),T$={getClasses:hMr,draw:fMr,getDir:dMr}});var V4t={};gr(V4t,{diagram:()=>pMr});var pMr,H4t=H(()=>{wwe();Dg();Oh();Fd();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();pMr={parser:x$,get db(){return new w$},renderer:T$,styles:E$,init:k(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var q4t={};gr(q4t,{diagram:()=>mMr});var mMr,Y4t=H(()=>{wwe();Dg();Oh();Fd();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();mMr={parser:x$,get db(){return new w$},renderer:T$,styles:E$,init:k(e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});function S$(e="",t=0,r="",n=Swe){let i=r!==null&&r.length>0?`${n}${r}`:"";return`${NMr}-${e}${i}-${t}`}function uD(e,t,r){if(!t.id||t.id===""||t.id==="")return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(" ").forEach(i=>{let a=r.get(i);a&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...a.styles])}));let n=e.find(i=>i.id===t.id);n?Object.assign(n,t):e.push(t)}function h3t(e){return e?.classes?.join(" ")??""}function f3t(e){return e?.styles??[]}var kwe,A$,gMr,e3t,j4t,EA,wA,Cwe,yMr,vMr,bMr,hD,t3t,r3t,n3t,i3t,a3t,o3t,Ewe,Twe,xMr,wMr,X4t,$4t,EMr,TMr,fD,kMr,CMr,s3t,SMr,AMr,UMr,IMr,RMr,MMr,LMr,DMr,l3t,c3t,NMr,Swe,_Mr,K4t,u3t,PMr,OMr,d3t,C$,Kx,BMr,Z4t,dD,FMr,Yu,Q4t,J4t,k$,hv,zMr,U$,Awe=H(()=>{Oh();Fd();_d();Ph();Vn();Wr();Gr();xr();_n();lk();kwe=(function(){var e=k(function(B,F,G,z){for(G=G||{},z=B.length;z--;G[B[z]]=F);return G},"o"),t=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,16],l=[1,17],u=[1,18],d=[1,19],h=[1,33],f=[1,20],p=[1,21],m=[1,22],g=[1,23],y=[1,24],v=[1,26],b=[1,27],x=[1,28],E=[1,29],w=[1,30],T=[1,31],C=[1,32],S=[1,35],R=[1,36],U=[1,37],L=[1,38],I=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],P=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],D=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],M={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:k(function(F,G,z,V,$,Z,re){var Q=Z.length-1;switch($){case 3:return V.setRootDoc(Z[Q]),Z[Q];break;case 4:this.$=[];break;case 5:Z[Q]!="nl"&&(Z[Q-1].push(Z[Q]),this.$=Z[Q-1]);break;case 6:case 7:this.$=Z[Q];break;case 8:this.$="nl";break;case 12:this.$=Z[Q];break;case 13:let ue=Z[Q-1];ue.description=V.trimColon(Z[Q]),this.$=ue;break;case 14:this.$={stmt:"relation",state1:Z[Q-2],state2:Z[Q]};break;case 15:let fe=V.trimColon(Z[Q]);this.$={stmt:"relation",state1:Z[Q-3],state2:Z[Q-1],description:fe};break;case 19:this.$={stmt:"state",id:Z[Q-3],type:"default",description:"",doc:Z[Q-1]};break;case 20:var ge=Z[Q],ie=Z[Q-2].trim();if(Z[Q].match(":")){var pe=Z[Q].split(":");ge=pe[0],ie=[ie,pe[1]]}this.$={stmt:"state",id:ge,type:"default",description:ie};break;case 21:this.$={stmt:"state",id:Z[Q-3],type:"default",description:Z[Q-5],doc:Z[Q-1]};break;case 22:this.$={stmt:"state",id:Z[Q],type:"fork"};break;case 23:this.$={stmt:"state",id:Z[Q],type:"join"};break;case 24:this.$={stmt:"state",id:Z[Q],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:Z[Q-1].trim(),note:{position:Z[Q-2].trim(),text:Z[Q].trim()}};break;case 29:this.$=Z[Q].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=Z[Q].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:Z[Q-3],url:Z[Q-2],tooltip:Z[Q-1]};break;case 33:this.$={stmt:"click",id:Z[Q-3],url:Z[Q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:Z[Q-1].trim(),classes:Z[Q].trim()};break;case 36:this.$={stmt:"style",id:Z[Q-1].trim(),styleClass:Z[Q].trim()};break;case 37:this.$={stmt:"applyClass",id:Z[Q-1].trim(),styleClass:Z[Q].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:Z[Q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:Z[Q-2].trim(),classes:[Z[Q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:Z[Q-2].trim(),classes:[Z[Q].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:t,5:r,6:n},{1:[3]},{3:5,4:t,5:r,6:n},{3:6,4:t,5:r,6:n},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],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:u,22:d,24:h,25:f,26:p,27:m,28:g,29:y,32:25,33:v,35:b,37:x,38:E,41:w,45:T,48:C,51:S,52:R,53:U,54:L,57:I},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:s,17:l,19:u,22:d,24:h,25:f,26:p,27:m,28:g,29:y,32:25,33:v,35:b,37:x,38:E,41:w,45:T,48:C,51:S,52:R,53:U,54:L,57:I},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,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:h,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(P,[2,44],{58:[1,56]}),e(P,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:h,57:I},e(A,[2,17]),e(D,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,72],22:d,24:h,25:f,26:p,27:m,28:g,29:y,32:25,33:v,35:b,37:x,38:E,41:w,45:T,48:C,51:S,52:R,53:U,54:L,57:I},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(P,[2,46]),e(P,[2,47]),e(A,[2,15]),e(A,[2,19]),e(D,i,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,81],22:d,24:h,25:f,26:p,27:m,28:g,29:y,32:25,33:v,35:b,37:x,38:E,41:w,45:T,48:C,51:S,52:R,53:U,54:L,57:I},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:k(function(F,G){if(G.recoverable)this.trace(F);else{var z=new Error(F);throw z.hash=G,z}},"parseError"),parse:k(function(F){var G=this,z=[0],V=[],$=[null],Z=[],re=this.table,Q="",ge=0,ie=0,pe=0,ue=2,fe=1,Me=Z.slice.call(arguments,1),Ce=Object.create(this.lexer),Ye={yy:{}};for(var Ze in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ze)&&(Ye.yy[Ze]=this.yy[Ze]);Ce.setInput(F,Ye.yy),Ye.yy.lexer=Ce,Ye.yy.parser=this,typeof Ce.yylloc>"u"&&(Ce.yylloc={});var Qe=Ce.yylloc;Z.push(Qe);var ve=Ce.options&&Ce.options.ranges;typeof Ye.yy.parseError=="function"?this.parseError=Ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Fe(J){z.length=z.length-2*J,$.length=$.length-J,Z.length=Z.length-J}k(Fe,"popStack");function Le(){var J;return J=V.pop()||Ce.lex()||fe,typeof J!="number"&&(J instanceof Array&&(V=J,J=V.pop()),J=G.symbols_[J]||J),J}k(Le,"lex");for(var Be,ae,he,de,me,ke,le={},W,X,q,j;;){if(he=z[z.length-1],this.defaultActions[he]?de=this.defaultActions[he]:((Be===null||typeof Be>"u")&&(Be=Le()),de=re[he]&&re[he][Be]),typeof de>"u"||!de.length||!de[0]){var se="";j=[];for(W in re[he])this.terminals_[W]&&W>ue&&j.push("'"+this.terminals_[W]+"'");Ce.showPosition?se="Parse error on line "+(ge+1)+`: -`+Ce.showPosition()+` -Expecting `+j.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":se="Parse error on line "+(ge+1)+": Unexpected "+(Be==fe?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(se,{text:Ce.match,token:this.terminals_[Be]||Be,line:Ce.yylineno,loc:Qe,expected:j})}if(de[0]instanceof Array&&de.length>1)throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+Be);switch(de[0]){case 1:z.push(Be),$.push(Ce.yytext),Z.push(Ce.yylloc),z.push(de[1]),Be=null,ae?(Be=ae,ae=null):(ie=Ce.yyleng,Q=Ce.yytext,ge=Ce.yylineno,Qe=Ce.yylloc,pe>0&&pe--);break;case 2:if(X=this.productions_[de[1]][1],le.$=$[$.length-X],le._$={first_line:Z[Z.length-(X||1)].first_line,last_line:Z[Z.length-1].last_line,first_column:Z[Z.length-(X||1)].first_column,last_column:Z[Z.length-1].last_column},ve&&(le._$.range=[Z[Z.length-(X||1)].range[0],Z[Z.length-1].range[1]]),ke=this.performAction.apply(le,[Q,ie,ge,Ye.yy,de[1],$,Z].concat(Me)),typeof ke<"u")return ke;X&&(z=z.slice(0,-1*X*2),$=$.slice(0,-1*X),Z=Z.slice(0,-1*X)),z.push(this.productions_[de[1]][0]),$.push(le.$),Z.push(le._$),q=re[z[z.length-2]][z[z.length-1]],z.push(q);break;case 3:return!0}}return!0},"parse")},O=(function(){var B={EOF:1,parseError:k(function(G,z){if(this.yy.parser)this.yy.parser.parseError(G,z);else throw new Error(G)},"parseError"),setInput:k(function(F,G){return this.yy=G||this.yy||{},this._input=F,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var F=this._input[0];this.yytext+=F,this.yyleng++,this.offset++,this.match+=F,this.matched+=F;var G=F.match(/(?:\r\n?|\n).*/g);return G?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),F},"input"),unput:k(function(F){var G=F.length,z=F.split(/(?:\r\n?|\n)/g);this._input=F+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-G),this.offset-=G;var V=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),z.length-1&&(this.yylineno-=z.length-1);var $=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===V.length?this.yylloc.first_column:0)+V[V.length-z.length].length-z[0].length:this.yylloc.first_column-G},this.options.ranges&&(this.yylloc.range=[$[0],$[0]+this.yyleng-G]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(F){this.unput(this.match.slice(F))},"less"),pastInput:k(function(){var F=this.matched.substr(0,this.matched.length-this.match.length);return(F.length>20?"...":"")+F.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var F=this.match;return F.length<20&&(F+=this._input.substr(0,20-F.length)),(F.substr(0,20)+(F.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var F=this.pastInput(),G=new Array(F.length+1).join("-");return F+this.upcomingInput()+` -`+G+"^"},"showPosition"),test_match:k(function(F,G){var z,V,$;if(this.options.backtrack_lexer&&($={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&($.yylloc.range=this.yylloc.range.slice(0))),V=F[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+F[0].length},this.yytext+=F[0],this.match+=F[0],this.matches=F,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(F[0].length),this.matched+=F[0],z=this.performAction.call(this,this.yy,this,G,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),z)return z;if(this._backtrack){for(var Z in $)this[Z]=$[Z];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var F,G,z,V;this._more||(this.yytext="",this.match="");for(var $=this._currentRules(),Z=0;Z<$.length;Z++)if(z=this._input.match(this.rules[$[Z]]),z&&(!G||z[0].length>G[0].length)){if(G=z,V=Z,this.options.backtrack_lexer){if(F=this.test_match(z,$[Z]),F!==!1)return F;if(this._backtrack){G=!1;continue}else return!1}else if(!this.options.flex)break}return G?(F=this.test_match(G,$[V]),F!==!1?F:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var G=this.next();return G||this.lex()},"lex"),begin:k(function(G){this.conditionStack.push(G)},"begin"),popState:k(function(){var G=this.conditionStack.length-1;return G>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(G){return G=this.conditionStack.length-1-Math.abs(G||0),G>=0?this.conditionStack[G]:"INITIAL"},"topState"),pushState:k(function(G){this.begin(G)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(G,z,V,$){function Z(){let Q=z.yytext.indexOf("%%");if(Q===0)return!1;if(Q>0){let ge=z.yytext.slice(0,Q),ie=z.yytext.slice(Q);ie&&G.lexer.unput(ie),z.yytext=ge}return!0}k(Z,"processId");var re=$;switch(V){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;break;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;break;case 17:return this.popState(),"acc_title_value";break;case 18:return this.begin("acc_descr"),35;break;case 19:return this.popState(),"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;break;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 25:return this.popState(),this.pushState("CLASSDEFID"),42;break;case 26:return this.popState(),43;break;case 27:return this.pushState("CLASS"),48;break;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;break;case 29:return this.popState(),50;break;case 30:return this.pushState("STYLE"),45;break;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;break;case 32:return this.popState(),47;break;case 33:return this.pushState("SCALE"),17;break;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;break;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;break;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;break;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;break;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;break;case 42:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;break;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";break;case 49:if(!Z())return;return this.popState(),"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+z.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;break;case 56:return this.popState(),21;break;case 57:break;case 58:return this.begin("NOTE"),29;break;case 59:return this.popState(),this.pushState("NOTE_ID"),59;break;case 60:return this.popState(),this.pushState("NOTE_ID"),60;break;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";break;case 63:break;case 64:return"NOTE_TEXT";case 65:if(!Z())return;return this.popState(),"ID";break;case 66:if(!Z())return;return this.popState(),this.pushState("NOTE_TEXT"),24;break;case 67:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;break;case 68:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;break;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return Z()?24:void 0;case 74:return z.yytext=z.yytext.trim(),14;break;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return B})();M.lexer=O;function _(){this.yy={}}return k(_,"Parser"),_.prototype=M,M.Parser=_,new _})();kwe.parser=kwe;A$=kwe,gMr="TB",e3t="TB",j4t="dir",EA="state",wA="root",Cwe="relation",yMr="classDef",vMr="style",bMr="applyClass",hD="default",t3t="divider",r3t="fill:none",n3t="fill: #333",i3t="c",a3t="markdown",o3t="normal",Ewe="rect",Twe="rectWithTitle",xMr="stateStart",wMr="stateEnd",X4t="divider",$4t="roundedWithTitle",EMr="note",TMr="noteGroup",fD="statediagram",kMr="state",CMr=`${fD}-${kMr}`,s3t="transition",SMr="note",AMr="note-edge",UMr=`${s3t} ${AMr}`,IMr=`${fD}-${SMr}`,RMr="cluster",MMr=`${fD}-${RMr}`,LMr="cluster-alt",DMr=`${fD}-${LMr}`,l3t="parent",c3t="note",NMr="state",Swe="----",_Mr=`${Swe}${c3t}`,K4t=`${Swe}${l3t}`,u3t=k((e,t=e3t)=>{if(!e.doc)return t;let r=t;for(let n of e.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),PMr=k(function(e,t){return t.db.getClasses()},"getClasses"),OMr=k(async function(e,t,r,n){ye.info("REF0:"),ye.info("Drawing state diagram (v2)",t);let{securityLevel:i,state:a,layout:o}=je();n.db.extract(n.db.getRootDocV2());let s=n.db.getData(),l=Hf(t,i);s.type=n.type,s.layoutAlgorithm=o,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,je().look==="neo"?s.markers=["barbNeo"]:s.markers=["barb"],s.diagramId=t,await Gf(s,l);let d=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{let m=typeof p=="string"?p:typeof p?.id=="string"?p.id:"",g=s.nodes.find(w=>w.id===m);if(!m){ye.warn("\u26A0\uFE0F Invalid or missing stateId from key:",JSON.stringify(p));return}let y=l.node()?.querySelectorAll("g.node, g.rough-node"),v;if(y?.forEach(w=>{let T=w.textContent?.trim();(w.id===g?.domId||T===m)&&(v=w)}),!v){ye.warn("\u26A0\uFE0F Could not find node matching text:",m);return}let b=v.parentNode;if(!b){ye.warn("\u26A0\uFE0F Node has no parent, cannot wrap:",m);return}let x=document.createElementNS("http://www.w3.org/2000/svg","a"),E=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",E),x.setAttribute("target","_blank"),f.tooltip){let w=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",w),v.setAttribute("title",w)}b.replaceChild(x,v),x.appendChild(v),ye.info("\u{1F517} Wrapped node in
    tag for:",m,f.url)})}catch(h){ye.error("\u274C Error injecting clickable links:",h)}Nr.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),Bd(l,d,fD,a?.useMaxWidth??!0)},"draw"),d3t={getClasses:PMr,draw:OMr,getDir:u3t},C$=new Map,Kx=0;k(S$,"stateDomId");BMr=k((e,t,r,n,i,a,o,s)=>{ye.trace("items",t),t.forEach(l=>{switch(l.stmt){case EA:dD(e,l,r,n,i,a,o,s);break;case hD:dD(e,l,r,n,i,a,o,s);break;case Cwe:{dD(e,l.state1,r,n,i,a,o,s),dD(e,l.state2,r,n,i,a,o,s);let u=o==="neo",d={id:"edge"+Kx,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:r3t,labelStyle:"",label:Lt.sanitizeText(l.description??"",je()),arrowheadStyle:n3t,labelpos:i3t,labelType:a3t,thickness:o3t,classes:s3t,look:o};i.push(d),Kx++}break}})},"setupDoc"),Z4t=k((e,t=e3t)=>{let r=t;if(e.doc)for(let n of e.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");k(uD,"insertOrUpdateNode");k(h3t,"getClassesFromDbInfo");k(f3t,"getStylesFromDbInfo");dD=k((e,t,r,n,i,a,o,s)=>{let l=t.id,u=r.get(l),d=h3t(u),h=f3t(u),f=je();if(ye.info("dataFetcher parsedItem",t,u,h),l!=="root"){let p=Ewe;t.start===!0?p=xMr:t.start===!1&&(p=wMr),t.type!==hD&&(p=t.type),C$.get(l)||C$.set(l,{id:l,shape:p,description:Lt.sanitizeText(l,f),cssClasses:`${d} ${CMr}`,cssStyles:h});let m=C$.get(l);t.description&&(Array.isArray(m.description)?(m.shape=Twe,m.description.push(t.description)):m.description?.length&&m.description.length>0?(m.shape=Twe,m.description===l?m.description=[t.description]:m.description=[m.description,t.description]):(m.shape=Ewe,m.description=t.description),m.description=Lt.sanitizeTextOrArray(m.description,f)),m.description?.length===1&&m.shape===Twe&&(m.type==="group"?m.shape=$4t:m.shape=Ewe),!m.type&&t.doc&&(ye.info("Setting cluster for XCX",l,Z4t(t)),m.type="group",m.isGroup=!0,m.dir=Z4t(t),m.shape=t.type===t3t?X4t:$4t,m.cssClasses=`${m.cssClasses} ${MMr} ${a?DMr:""}`);let g={labelStyle:"",shape:m.shape,label:m.description,cssClasses:m.cssClasses,cssCompiledStyles:[],cssStyles:m.cssStyles,id:l,dir:m.dir,domId:S$(l,Kx),type:m.type,isGroup:m.type==="group",padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(g.shape===X4t&&(g.label=""),e&&e.id!=="root"&&(ye.trace("Setting node ",l," to be child of its parent ",e.id),g.parentId=e.id),g.centerLabel=!0,t.note){let y={labelStyle:"",shape:EMr,label:t.note.text,labelType:"markdown",cssClasses:IMr,cssStyles:[],cssCompiledStyles:[],id:l+_Mr+"-"+Kx,domId:S$(l,Kx,c3t),type:m.type,isGroup:m.type==="group",padding:f.flowchart?.padding,look:o,position:t.note.position},v=l+K4t,b={labelStyle:"",shape:TMr,label:t.note.text,cssClasses:m.cssClasses,cssStyles:[],id:l+K4t,domId:S$(l,Kx,l3t),type:"group",isGroup:!0,padding:16,look:o,position:t.note.position};Kx++,b.id=v,y.parentId=v,uD(n,b,s),uD(n,y,s),uD(n,g,s);let x=l,E=y.id;t.note.position==="left of"&&(x=y.id,E=l),i.push({id:x+"-"+E,start:x,end:E,arrowhead:"none",arrowTypeEnd:"",style:r3t,labelStyle:"",classes:UMr,arrowheadStyle:n3t,labelpos:i3t,labelType:a3t,thickness:o3t,look:o})}else uD(n,g,s)}t.doc&&(ye.trace("Adding nodes children "),BMr(t,t.doc,r,n,i,!a,o,s))},"dataFetcher"),FMr=k(()=>{C$.clear(),Kx=0},"reset"),Yu={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Q4t=k(()=>new Map,"newClassesList"),J4t=k(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),k$=k(e=>JSON.parse(JSON.stringify(e)),"clone"),hv=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Q4t(),this.documents={root:J4t()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=pn,this.setAccTitle=sn,this.getAccDescription=gn,this.setAccDescription=mn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{k(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let n of Array.isArray(e)?e:e.doc)switch(n.stmt){case EA:this.addState(n.id.trim(),n.type,n.doc,n.description,n.note);break;case Cwe:this.addRelation(n.state1,n.state2,n.description);break;case yMr:this.addStyleClass(n.id.trim(),n.classes);break;case vMr:this.handleStyleDef(n);break;case bMr:this.setCssClass(n.id.trim(),n.styleClass);break;case"click":this.addLink(n.id,n.url,n.tooltip);break}let t=this.getStates(),r=je();FMr(),dD(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,r.look,this.classes);for(let n of this.nodes)if(Array.isArray(n.label)){if(n.description=n.label.slice(1),n.isGroup&&n.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${n.id}]`);n.label=n.label[0]}}handleStyleDef(e){let t=e.id.trim().split(","),r=e.styleClass.split(",");for(let n of t){let i=this.getState(n);if(!i){let a=n.trim();this.addState(a),i=this.getState(a)}i&&(i.styles=r.map(a=>a.replace(/;/g,"")?.trim()))}}setRootDoc(e){ye.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,r){if(t.stmt===Cwe){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===EA&&(t.id===Yu.START_NODE?(t.id=e.id+(r?"_start":"_end"),t.start=r):t.id=t.id.trim()),t.stmt!==wA&&t.stmt!==EA||!t.doc)return;let n=[],i=[];for(let a of t.doc)if(a.type===t3t){let o=k$(a);o.doc=k$(i),n.push(o),i=[]}else i.push(a);if(n.length>0&&i.length>0){let a={stmt:EA,id:Kce(),type:"divider",doc:k$(i)};n.push(k$(a)),t.doc=n}t.doc.forEach(a=>this.docTranslator(t,a,!0))}getRootDocV2(){return this.docTranslator({id:wA,stmt:wA},{id:wA,stmt:wA,doc:this.rootDoc},!0),{id:wA,doc:this.rootDoc}}addState(e,t=hD,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0){let l=e?.trim();if(!this.currentDocument.states.has(l))ye.info("Adding state ",l,n),this.currentDocument.states.set(l,{stmt:EA,id:l,descriptions:[],type:t,doc:r,note:i,classes:[],styles:[],textStyles:[]});else{let u=this.currentDocument.states.get(l);if(!u)throw new Error(`State not found: ${l}`);u.doc||(u.doc=r),u.type||(u.type=t)}if(n&&(ye.info("Setting state description",l,n),(Array.isArray(n)?n:[n]).forEach(d=>this.addDescription(l,d.trim()))),i){let u=this.currentDocument.states.get(l);if(!u)throw new Error(`State not found: ${l}`);u.note=i,u.note.text=Lt.sanitizeText(u.note.text,je())}a&&(ye.info("Setting state classes",l,a),(Array.isArray(a)?a:[a]).forEach(d=>this.setCssClass(l,d.trim()))),o&&(ye.info("Setting state styles",l,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(l,d.trim()))),s&&(ye.info("Setting state styles",l,o),(Array.isArray(s)?s:[s]).forEach(d=>this.setTextStyle(l,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:J4t()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Q4t(),e||(this.links=new Map,$r())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ye.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),ye.warn("Adding link",e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===Yu.START_NODE?(this.startEndCount++,`${Yu.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",t=hD){return e===Yu.START_NODE?Yu.START_TYPE:t}endIdIfNeeded(e=""){return e===Yu.END_NODE?(this.startEndCount++,`${Yu.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",t=hD){return e===Yu.END_NODE?Yu.END_TYPE:t}addRelationObjs(e,t,r=""){let n=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(n,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:n,id2:a,relationTitle:Lt.sanitizeText(r,je())})}addRelation(e,t,r){if(typeof e=="object"&&typeof t=="object")this.addRelationObjs(e,t,r);else if(typeof e=="string"&&typeof t=="string"){let n=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(n,i),this.addState(a,o),this.currentDocument.relations.push({id1:n,id2:a,relationTitle:r?Lt.sanitizeText(r,je()):void 0})}}addDescription(e,t){let r=this.currentDocument.states.get(e),n=t.startsWith(":")?t.replace(":","").trim():t;r?.descriptions?.push(Lt.sanitizeText(n,je()))}cleanupLabel(e){return e.startsWith(":")?e.slice(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:[]});let r=this.classes.get(e);t&&r&&t.split(Yu.STYLECLASS_SEP).forEach(n=>{let i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Yu.COLOR_KEYWORD).exec(n)){let o=i.replace(Yu.FILL_KEYWORD,Yu.BG_FILL).replace(Yu.COLOR_KEYWORD,Yu.FILL_KEYWORD);r.textStyles.push(o)}r.styles.push(i)})}getClasses(){return this.classes}setupToolTips(e){let t=pS();xt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",i=>{let a=xt(i.currentTarget),o=a.attr("title");if(o===null)return;let s=i.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9"),t.style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px"),t.html(xd.sanitize(o)),a.classed("hover",!0)}).on("mouseout",i=>{t.transition().duration(500).style("opacity",0),xt(i.currentTarget).classed("hover",!1)})}setCssClass(e,t){e.split(",").forEach(r=>{let n=this.getState(r);if(!n){let i=r.trim();this.addState(i),n=this.getState(i)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===j4t)}getDirection(){return this.getDirectionStatement()?.value??gMr}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:j4t,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){let e=je();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:u3t(this.getRootDocV2())}}getConfig(){return je().state}},zMr=k(e=>` -defs [id$="-barbEnd"] { - fill: ${e.transitionColor}; - stroke: ${e.transitionColor}; - } -g.stateGroup text { - fill: ${e.nodeBorder}; - stroke: none; - font-size: 10px; -} -g.stateGroup text { - fill: ${e.textColor}; - stroke: none; - font-size: 10px; - -} -g.stateGroup .state-title { - font-weight: bolder; - fill: ${e.stateLabelColor}; -} - -g.stateGroup rect { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; -} - -g.stateGroup line { - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth||1}; -} - -.transition { - stroke: ${e.transitionColor}; - stroke-width: ${e.strokeWidth||1}; - fill: none; -} - -.stateGroup .composit { - fill: ${e.background}; - border-bottom: 1px -} - -.stateGroup .alt-composit { - fill: #e0e0e0; - border-bottom: 1px -} - -.state-note { - stroke: ${e.noteBorderColor}; - fill: ${e.noteBkgColor}; - - text { - fill: ${e.noteTextColor}; - stroke: none; - font-size: 10px; - } -} - -.stateLabel .box { - stroke: none; - stroke-width: 0; - fill: ${e.mainBkg}; - opacity: 0.5; -} - -.edgeLabel .label rect { - fill: ${e.labelBackgroundColor}; - opacity: 0.5; -} -.edgeLabel { - background-color: ${e.edgeLabelBackground}; - p { - background-color: ${e.edgeLabelBackground}; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; -} -.edgeLabel .label text { - fill: ${e.transitionLabelColor||e.tertiaryTextColor}; -} -.label div .edgeLabel { - color: ${e.transitionLabelColor||e.tertiaryTextColor}; -} - -.stateLabel text { - fill: ${e.stateLabelColor}; - font-size: 10px; - font-weight: bold; -} - -.node circle.state-start { - fill: ${e.specialStateColor}; - stroke: ${e.specialStateColor}; -} - -.node .fork-join { - fill: ${e.specialStateColor}; - stroke: ${e.specialStateColor}; -} - -.node circle.state-end { - fill: ${e.innerEndBackground}; - stroke: ${e.background}; - stroke-width: 1.5 -} -.end-state-inner { - fill: ${e.compositeBackground||e.background}; - // stroke: ${e.background}; - stroke-width: 1.5 -} - -.node rect { - fill: ${e.stateBkg||e.mainBkg}; - stroke: ${e.stateBorder||e.nodeBorder}; - stroke-width: ${e.strokeWidth||1}px; -} -.node polygon { - fill: ${e.mainBkg}; - stroke: ${e.stateBorder||e.nodeBorder};; - stroke-width: ${e.strokeWidth||1}px; -} -[id$="-barbEnd"] { - fill: ${e.lineColor}; -} - -.statediagram-cluster rect { - fill: ${e.compositeTitleBackground}; - stroke: ${e.stateBorder||e.nodeBorder}; - stroke-width: ${e.strokeWidth||1}px; -} - -.cluster-label, .nodeLabel { - color: ${e.stateLabelColor}; - // line-height: 1; -} - -.statediagram-cluster rect.outer { - rx: 5px; - ry: 5px; -} -.statediagram-state .divider { - stroke: ${e.stateBorder||e.nodeBorder}; -} - -.statediagram-state .title-state { - rx: 5px; - ry: 5px; -} -.statediagram-cluster.statediagram-cluster .inner { - fill: ${e.compositeBackground||e.background}; -} -.statediagram-cluster.statediagram-cluster-alt .inner { - fill: ${e.altBackground?e.altBackground:"#efefef"}; -} - -.statediagram-cluster .inner { - rx:0; - ry:0; -} - -.statediagram-state rect.basic { - rx: 5px; - ry: 5px; -} -.statediagram-state rect.divider { - stroke-dasharray: 10,10; - fill: ${e.altBackground?e.altBackground:"#efefef"}; -} - -.note-edge { - stroke-dasharray: 5; -} - -.statediagram-note rect { - fill: ${e.noteBkgColor}; - stroke: ${e.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} -.statediagram-note rect { - fill: ${e.noteBkgColor}; - stroke: ${e.noteBorderColor}; - stroke-width: 1px; - rx: 0; - ry: 0; -} - -.statediagram-note text { - fill: ${e.noteTextColor}; -} - -.statediagram-note .nodeLabel { - color: ${e.noteTextColor}; -} -.statediagram .edgeLabel { - color: red; // ${e.noteTextColor}; -} - -[id$="-dependencyStart"], [id$="-dependencyEnd"] { - fill: ${e.lineColor}; - stroke: ${e.lineColor}; - stroke-width: ${e.strokeWidth||1}; -} - -.statediagramTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; -} - -[data-look="neo"].statediagram-cluster rect { - fill: ${e.mainBkg}; - stroke: ${e.useGradient?"url("+e.svgId+"-gradient)":e.stateBorder||e.nodeBorder}; - stroke-width: ${e.strokeWidth??1}; -} -[data-look="neo"].statediagram-cluster rect.outer { - rx: ${e.radius}px; - ry: ${e.radius}px; - filter: ${e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${e.svgId}-drop-shadow)`):"none"} -} -`,"getStyles"),U$=zMr});var y3t={};gr(y3t,{diagram:()=>rLr});var GMr,WMr,VMr,HMr,qMr,YMr,jMr,XMr,$Mr,p3t,m3t,KMr,jh,Uwe,ZMr,QMr,JMr,eLr,g3t,tLr,rLr,v3t=H(()=>{Awe();Oh();Fd();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();_n();pfe();Dh();_n();GMr=k(e=>e.append("circle").attr("class","start-state").attr("r",je().state.sizeUnit).attr("cx",je().state.padding+je().state.sizeUnit).attr("cy",je().state.padding+je().state.sizeUnit),"drawStartState"),WMr=k(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",je().state.textHeight).attr("class","divider").attr("x2",je().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),VMr=k((e,t)=>{let r=e.append("text").attr("x",2*je().state.padding).attr("y",je().state.textHeight+2*je().state.padding).attr("font-size",je().state.fontSize).attr("class","state-title").text(t.id),n=r.node().getBBox();return e.insert("rect",":first-child").attr("x",je().state.padding).attr("y",je().state.padding).attr("width",n.width+2*je().state.padding).attr("height",n.height+2*je().state.padding).attr("rx",je().state.radius),r},"drawSimpleState"),HMr=k((e,t)=>{let r=k(function(f,p,m){let g=f.append("tspan").attr("x",2*je().state.padding).text(p);m||g.attr("dy",je().state.textHeight)},"addTspan"),i=e.append("text").attr("x",2*je().state.padding).attr("y",je().state.textHeight+1.3*je().state.padding).attr("font-size",je().state.fontSize).attr("class","state-title").text(t.descriptions[0]).node().getBBox(),a=i.height,o=e.append("text").attr("x",je().state.padding).attr("y",a+je().state.padding*.4+je().state.dividerMargin+je().state.textHeight).attr("class","state-description"),s=!0,l=!0;t.descriptions.forEach(function(f){s||(r(o,f,l),l=!1),s=!1});let u=e.append("line").attr("x1",je().state.padding).attr("y1",je().state.padding+a+je().state.dividerMargin/2).attr("y2",je().state.padding+a+je().state.dividerMargin/2).attr("class","descr-divider"),d=o.node().getBBox(),h=Math.max(d.width,i.width);return u.attr("x2",h+3*je().state.padding),e.insert("rect",":first-child").attr("x",je().state.padding).attr("y",je().state.padding).attr("width",h+2*je().state.padding).attr("height",d.height+a+2*je().state.padding).attr("rx",je().state.radius),e},"drawDescrState"),qMr=k((e,t,r)=>{let n=je().state.padding,i=2*je().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append("text").attr("x",0).attr("y",je().state.titleShift).attr("font-size",je().state.fontSize).attr("class","state-title").text(t.id),d=l.node().getBBox().width+i,h=Math.max(d,o);h===o&&(h=h+i);let f,p=e.node().getBBox();t.doc,f=s-n,d>o&&(f=(o-h)/2+n),Math.abs(s-p.x)o&&(f=s-(d-o)/2);let m=1-je().state.textHeight;return e.insert("rect",":first-child").attr("x",f).attr("y",m).attr("class",r?"alt-composit":"composit").attr("width",h).attr("height",p.height+je().state.textHeight+je().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),d<=o&&l.attr("x",s+(h-i)/2-d/2+n),e.insert("rect",":first-child").attr("x",f).attr("y",je().state.titleShift-je().state.textHeight-je().state.padding).attr("width",h).attr("height",je().state.textHeight*3).attr("rx",je().state.radius),e.insert("rect",":first-child").attr("x",f).attr("y",je().state.titleShift-je().state.textHeight-je().state.padding).attr("width",h).attr("height",p.height+3+2*je().state.textHeight).attr("rx",je().state.radius),e},"addTitleAndBox"),YMr=k(e=>(e.append("circle").attr("class","end-state-outer").attr("r",je().state.sizeUnit+je().state.miniPadding).attr("cx",je().state.padding+je().state.sizeUnit+je().state.miniPadding).attr("cy",je().state.padding+je().state.sizeUnit+je().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",je().state.sizeUnit).attr("cx",je().state.padding+je().state.sizeUnit+2).attr("cy",je().state.padding+je().state.sizeUnit+2)),"drawEndState"),jMr=k((e,t)=>{let r=je().state.forkWidth,n=je().state.forkHeight;if(t.parentId){let i=r;r=n,n=i}return e.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",je().state.padding).attr("y",je().state.padding)},"drawForkJoinState"),XMr=k((e,t,r,n)=>{let i=0,a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let o=e.replace(/\r\n/g,"
    ");o=o.replace(/\n/g,"
    ");let s=o.split(Lt.lineBreakRegex),l=1.25*je().state.noteMargin;for(let u of s){let d=u.trim();if(d.length>0){let h=a.append("tspan");if(h.text(d),l===0){let f=h.node().getBBox();l+=f.height}i+=l,h.attr("x",t+je().state.noteMargin),h.attr("y",r+i+1.25*je().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),$Mr=k((e,t)=>{t.attr("class","state-note");let r=t.append("rect").attr("x",0).attr("y",je().state.padding),n=t.append("g"),{textWidth:i,textHeight:a}=XMr(e,0,0,n);return r.attr("height",a+2*je().state.noteMargin),r.attr("width",i+je().state.noteMargin*2),r},"drawNote"),p3t=k(function(e,t){let r=t.id,n={id:r,label:t.id,width:0,height:0},i=e.append("g").attr("id",r).attr("class","stateGroup");t.type==="start"&&GMr(i),t.type==="end"&&YMr(i),(t.type==="fork"||t.type==="join")&&jMr(i,t),t.type==="note"&&$Mr(t.note.text,i),t.type==="divider"&&WMr(i),t.type==="default"&&t.descriptions.length===0&&VMr(i,t),t.type==="default"&&t.descriptions.length>0&&HMr(i,t);let a=i.node().getBBox();return n.width=a.width+2*je().state.padding,n.height=a.height+2*je().state.padding,n},"drawState"),m3t=0,KMr=k(function(e,t,r){let n=k(function(l){switch(l){case hv.relationType.AGGREGATION:return"aggregation";case hv.relationType.EXTENSION:return"extension";case hv.relationType.COMPOSITION:return"composition";case hv.relationType.DEPENDENCY:return"dependency"}},"getRelationType");t.points=t.points.filter(l=>!Number.isNaN(l.y));let i=t.points,a=v2().x(function(l){return l.x}).y(function(l){return l.y}).curve(b2),o=e.append("path").attr("d",a(i)).attr("id","edge"+m3t).attr("class","transition"),s="";if(je().state.arrowMarkerAbsolute&&(s=F9(!0)),o.attr("marker-end","url("+s+"#"+n(hv.relationType.DEPENDENCY)+"End)"),r.title!==void 0){let l=e.append("g").attr("class","stateLabel"),{x:u,y:d}=Nr.calcLabelPosition(t.points),h=Lt.getRows(r.title),f=0,p=[],m=0,g=0;for(let b=0;b<=h.length;b++){let x=l.append("text").attr("text-anchor","middle").text(h[b]).attr("x",u).attr("y",d+f),E=x.node().getBBox();m=Math.max(m,E.width),g=Math.min(g,E.x),ye.info(E.x,u,d+f),f===0&&(f=x.node().getBBox().height,ye.info("Title height",f,d)),p.push(x)}let y=f*h.length;if(h.length>1){let b=(h.length-1)*f*.5;p.forEach((x,E)=>x.attr("y",d+E*f-b)),y=f*h.length}let v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-m/2-je().state.padding/2).attr("y",d-y/2-je().state.padding/2-3.5).attr("width",m+je().state.padding).attr("height",y+je().state.padding),ye.info(v)}m3t++},"drawEdge"),Uwe={},ZMr=k(function(){},"setConf"),QMr=k(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"),JMr=k(function(e,t,r,n){jh=je().state;let i=je().securityLevel,a;i==="sandbox"&&(a=xt("#i"+t));let o=i==="sandbox"?xt(a.nodes()[0].contentDocument.body):xt("body"),s=i==="sandbox"?a.nodes()[0].contentDocument:document;ye.debug("Rendering diagram "+e);let l=o.select(`[id='${t}']`);QMr(l);let u=n.db.getRootDoc(),d=l.append("g").attr("id",t+"-root");g3t(u,d,void 0,!1,o,s,n);let h=jh.padding,f=l.node().getBBox(),p=f.width+h*2,m=f.height+h*2,g=p*1.75;zn(l,m,g,jh.useMaxWidth),l.attr("viewBox",`${f.x-jh.padding} ${f.y-jh.padding} `+p+" "+m)},"draw"),eLr=k(e=>e?e.length*jh.fontSizeFactor:1,"getLabelWidth"),g3t=k((e,t,r,n,i,a,o)=>{let s=new qi({compound:!0,multigraph:!0}),l,u=!0;for(l=0;l{let w=E.parentElement,T=0,C=0;w&&(w.parentElement&&(T=w.parentElement.getBBox().width),C=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(C)&&(C=0)),E.setAttribute("x1",0-C+8),E.setAttribute("x2",T-C-8)})):ye.debug("No Node "+b+": "+JSON.stringify(s.node(b)))});let y=g.getBBox();s.edges().forEach(function(b){b!==void 0&&s.edge(b)!==void 0&&(ye.debug("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(s.edge(b))),KMr(t,s.edge(b),s.edge(b).relation))}),y=g.getBBox();let v={id:r||"root",label:r||"root",width:0,height:0};return v.width=y.width+2*jh.padding,v.height=y.height+2*jh.padding,ye.debug("Doc rendered",v,s),v},"renderDoc"),tLr={setConf:ZMr,draw:JMr},rLr={parser:A$,get db(){return new hv(1)},renderer:tLr,styles:U$,init:k(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var b3t={};gr(b3t,{diagram:()=>nLr});var nLr,x3t=H(()=>{Awe();Oh();Fd();_d();Ph();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();nLr={parser:A$,get db(){return new hv(2)},renderer:d3t,styles:U$,init:k(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var I3t={};gr(I3t,{diagram:()=>kLr});function U3t(e){let t=je().journey,r=t.maxLabelWidth;I$=0;let n=60;Object.keys(fv).forEach(i=>{let a=fv[i].color,o={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:fv[i].position};gD.drawCircle(e,o);let s=e.append("text").attr("visibility","hidden").text(i),l=s.node().getBoundingClientRect().width;s.remove();let u=[];if(l<=r)u=[i];else{let d=i.split(" "),h="";s=e.append("text").attr("visibility","hidden"),d.forEach(f=>{let p=h?`${h} ${f}`:f;if(s.text(p),s.node().getBoundingClientRect().width>r){if(h&&u.push(h),h=f,s.text(f),s.node().getBoundingClientRect().width>r){let g="";for(let y of f)g+=y,s.text(g+"-"),s.node().getBoundingClientRect().width>r&&(u.push(g.slice(0,-1)+"-"),g=y);h=g}}else h=p}),h&&u.push(h),s.remove()}u.forEach((d,h)=>{let f={x:40,y:n+7+h*20,fill:"#666",text:d,textMargin:t.boxTextMargin??5},m=gD.drawText(e,f).node().getBoundingClientRect().width;m>I$&&m>t.leftMargin-m&&(I$=m)}),n+=Math.max(20,u.length*20)})}var Rwe,iLr,TA,Lwe,pD,mD,aLr,oLr,sLr,lLr,cLr,uLr,dLr,w3t,hLr,E3t,fLr,pLr,Dwe,mLr,C3t,S3t,gLr,yLr,Mwe,vLr,bLr,A3t,xLr,gD,wLr,fv,I$,O0,Zx,ELr,Zf,Iwe,T3t,TLr,k3t,kLr,R3t=H(()=>{Dg();Ph();Wr();Gr();xr();_n();_n();Rwe=(function(){var e=k(function(h,f,p,m){for(p=p||{},m=h.length;m--;p[h[m]]=f);return p},"o"),t=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,14],l={trace:k(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:k(function(f,p,m,g,y,v,b){var x=v.length-1;switch(y){case 1:return v[x-1];case 2:this.$=[];break;case 3:v[x-1].push(v[x]),this.$=v[x-1];break;case 4:case 5:this.$=v[x];break;case 6:case 7:this.$=[];break;case 8:g.setDiagramTitle(v[x].substr(6)),this.$=v[x].substr(6);break;case 9:this.$=v[x].trim(),g.setAccTitle(this.$);break;case 10:case 11:this.$=v[x].trim(),g.setAccDescription(this.$);break;case 12:g.addSection(v[x].substr(8)),this.$=v[x].substr(8);break;case 13:g.addTask(v[x-1],v[x]),this.$="task";break}},"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:r,12:n,14:i,16:a,17:o,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:r,12:n,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:k(function(f,p){if(p.recoverable)this.trace(f);else{var m=new Error(f);throw m.hash=p,m}},"parseError"),parse:k(function(f){var p=this,m=[0],g=[],y=[null],v=[],b=this.table,x="",E=0,w=0,T=0,C=2,S=1,R=v.slice.call(arguments,1),U=Object.create(this.lexer),L={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(L.yy[I]=this.yy[I]);U.setInput(f,L.yy),L.yy.lexer=U,L.yy.parser=this,typeof U.yylloc>"u"&&(U.yylloc={});var A=U.yylloc;v.push(A);var P=U.options&&U.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(ie){m.length=m.length-2*ie,y.length=y.length-ie,v.length=v.length-ie}k(D,"popStack");function M(){var ie;return ie=g.pop()||U.lex()||S,typeof ie!="number"&&(ie instanceof Array&&(g=ie,ie=g.pop()),ie=p.symbols_[ie]||ie),ie}k(M,"lex");for(var O,_,B,F,G,z,V={},$,Z,re,Q;;){if(B=m[m.length-1],this.defaultActions[B]?F=this.defaultActions[B]:((O===null||typeof O>"u")&&(O=M()),F=b[B]&&b[B][O]),typeof F>"u"||!F.length||!F[0]){var ge="";Q=[];for($ in b[B])this.terminals_[$]&&$>C&&Q.push("'"+this.terminals_[$]+"'");U.showPosition?ge="Parse error on line "+(E+1)+`: -`+U.showPosition()+` -Expecting `+Q.join(", ")+", got '"+(this.terminals_[O]||O)+"'":ge="Parse error on line "+(E+1)+": Unexpected "+(O==S?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(ge,{text:U.match,token:this.terminals_[O]||O,line:U.yylineno,loc:A,expected:Q})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+O);switch(F[0]){case 1:m.push(O),y.push(U.yytext),v.push(U.yylloc),m.push(F[1]),O=null,_?(O=_,_=null):(w=U.yyleng,x=U.yytext,E=U.yylineno,A=U.yylloc,T>0&&T--);break;case 2:if(Z=this.productions_[F[1]][1],V.$=y[y.length-Z],V._$={first_line:v[v.length-(Z||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(Z||1)].first_column,last_column:v[v.length-1].last_column},P&&(V._$.range=[v[v.length-(Z||1)].range[0],v[v.length-1].range[1]]),z=this.performAction.apply(V,[x,w,E,L.yy,F[1],y,v].concat(R)),typeof z<"u")return z;Z&&(m=m.slice(0,-1*Z*2),y=y.slice(0,-1*Z),v=v.slice(0,-1*Z)),m.push(this.productions_[F[1]][0]),y.push(V.$),v.push(V._$),re=b[m[m.length-2]][m[m.length-1]],m.push(re);break;case 3:return!0}}return!0},"parse")},u=(function(){var h={EOF:1,parseError:k(function(p,m){if(this.yy.parser)this.yy.parser.parseError(p,m);else throw new Error(p)},"parseError"),setInput:k(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:k(function(f){var p=f.length,m=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=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:m?(m.length===g.length?this.yylloc.first_column:0)+g[g.length-m.length].length-m[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(f){this.unput(this.match.slice(f))},"less"),pastInput:k(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` -`+p+"^"},"showPosition"),test_match:k(function(f,p){var m,g,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),g=f[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,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(f[0].length),this.matched+=f[0],m=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,m,g;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;vp[0].length)){if(p=m,g=v,this.options.backtrack_lexer){if(f=this.test_match(m,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[g]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var p=this.next();return p||this.lex()},"lex"),begin:k(function(p){this.conditionStack.push(p)},"begin"),popState:k(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:k(function(p){this.begin(p)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(p,m,g,y){var v=y;switch(g){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h})();l.lexer=u;function d(){this.yy={}}return k(d,"Parser"),d.prototype=l,l.Parser=d,new d})();Rwe.parser=Rwe;iLr=Rwe,TA="",Lwe=[],pD=[],mD=[],aLr=k(function(){Lwe.length=0,pD.length=0,TA="",mD.length=0,$r()},"clear"),oLr=k(function(e){TA=e,Lwe.push(e)},"addSection"),sLr=k(function(){return Lwe},"getSections"),lLr=k(function(){let e=w3t(),t=100,r=0;for(;!e&&r{r.people&&e.push(...r.people)}),[...new Set(e)].sort()},"updateActors"),uLr=k(function(e,t){let r=t.substr(1).split(":"),n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));let a=i.map(s=>s.trim()),o={section:TA,type:TA,people:a,task:e,score:n};mD.push(o)},"addTask"),dLr=k(function(e){let t={section:TA,type:TA,description:e,task:e,classes:[]};pD.push(t)},"addTaskOrg"),w3t=k(function(){let e=k(function(r){return mD[r].processed},"compileTask"),t=!0;for(let[r,n]of mD.entries())e(r),t=t&&n.processed;return t},"compileTasks"),hLr=k(function(){return cLr()},"getActors"),E3t={getConfig:k(()=>je().journey,"getConfig"),clear:aLr,setDiagramTitle:Sn,getDiagramTitle:yn,setAccTitle:sn,getAccTitle:pn,setAccDescription:mn,getAccDescription:gn,addSection:oLr,getSections:sLr,getTasks:lLr,addTask:uLr,addTaskOrg:dLr,getActors:hLr},fLr=k(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.textColor}; - } - .mouth { - stroke: #666; - } - - line { - stroke: ${e.textColor} - } - - .legend { - fill: ${e.textColor}; - font-family: ${e.fontFamily}; - } - - .label text { - fill: #333; - } - .label { - color: ${e.textColor} - } - - .face { - ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"}; - stroke: #999; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePaths .path { - stroke: ${e.lineColor}; - stroke-width: 1.5px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - rect { - opacity: 0.5; - } - text-align: center; - } - - .cluster rect { - } - - .cluster text { - fill: ${e.titleColor}; - } - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .task-type-0, .section-type-0 { - ${e.fillType0?`fill: ${e.fillType0}`:""}; - } - .task-type-1, .section-type-1 { - ${e.fillType0?`fill: ${e.fillType1}`:""}; - } - .task-type-2, .section-type-2 { - ${e.fillType0?`fill: ${e.fillType2}`:""}; - } - .task-type-3, .section-type-3 { - ${e.fillType0?`fill: ${e.fillType3}`:""}; - } - .task-type-4, .section-type-4 { - ${e.fillType0?`fill: ${e.fillType4}`:""}; - } - .task-type-5, .section-type-5 { - ${e.fillType0?`fill: ${e.fillType5}`:""}; - } - .task-type-6, .section-type-6 { - ${e.fillType0?`fill: ${e.fillType6}`:""}; - } - .task-type-7, .section-type-7 { - ${e.fillType0?`fill: ${e.fillType7}`:""}; - } - - .actor-0 { - ${e.actor0?`fill: ${e.actor0}`:""}; - } - .actor-1 { - ${e.actor1?`fill: ${e.actor1}`:""}; - } - .actor-2 { - ${e.actor2?`fill: ${e.actor2}`:""}; - } - .actor-3 { - ${e.actor3?`fill: ${e.actor3}`:""}; - } - .actor-4 { - ${e.actor4?`fill: ${e.actor4}`:""}; - } - .actor-5 { - ${e.actor5?`fill: ${e.actor5}`:""}; - } - ${Lg()} -`,"getStyles"),pLr=fLr,Dwe=k(function(e,t){return i3(e,t)},"drawRect"),mLr=k(function(e,t){let n=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){let u=Jm().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}k(a,"smile");function o(l){let u=Jm().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}k(o,"sad");function s(l){l.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 k(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),n},"drawFace"),C3t=k(function(e,t){let r=e.append("circle");return r.attr("cx",t.cx),r.attr("cy",t.cy),r.attr("class","actor-"+t.pos),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("r",t.r),r.class!==void 0&&r.attr("class",r.class),t.title!==void 0&&r.append("title").text(t.title),r},"drawCircle"),S3t=k(function(e,t){return Cut(e,t)},"drawText"),gLr=k(function(e,t){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}k(r,"genPoints");let n=e.append("polygon");n.attr("points",r(t.x,t.y,50,20,7)),n.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,S3t(e,t)},"drawLabel"),yLr=k(function(e,t,r){let n=e.append("g"),i=Od();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=r.width*t.taskCount+r.diagramMarginX*(t.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,Dwe(n,i),A3t(r)(t.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},r,t.colour)},"drawSection"),Mwe=-1,vLr=k(function(e,t,r,n){let i=t.x+r.width/2,a=e.append("g");Mwe++,a.append("line").attr("id",n+"-task"+Mwe).attr("x1",i).attr("y1",t.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),mLr(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let s=Od();s.x=t.x,s.y=t.y,s.fill=t.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+t.num,s.rx=3,s.ry=3,Dwe(a,s);let l=t.x+14;t.people.forEach(u=>{let d=t.actors[u].color,h={cx:l,cy:t.y,r:7,fill:d,stroke:"#000",title:u,pos:t.actors[u].position};C3t(a,h),l+=10}),A3t(r)(t.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,t.colour)},"drawTask"),bLr=k(function(e,t){Tq(e,t)},"drawBackgroundRect"),A3t=(function(){function e(i,a,o,s,l,u,d,h){let f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(e,"byText");function t(i,a,o,s,l,u,d,h,f){let{taskFontSize:p,taskFontFamily:m}=h,g=i.split(//gi);for(let y=0;y{fv[E]={color:O0.actorColours[g%O0.actorColours.length],position:g},g++}),U3t(h),Zx=O0.leftMargin+I$,Zf.insert(0,0,Zx,Object.keys(fv).length*50),TLr(h,f,0,t);let y=Zf.getBounds();p&&h.append("text").text(p).attr("x",Zx).attr("font-size",o).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",s);let v=y.stopy-y.starty+2*O0.diagramMarginY,b=Zx+y.stopx+2*O0.diagramMarginX;zn(h,v,b,O0.useMaxWidth),h.append("line").attr("x1",Zx).attr("y1",O0.height*4).attr("x2",b-Zx-4).attr("y2",O0.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+t+"-arrowhead)");let x=p?70:0;h.attr("viewBox",`${y.startx} -25 ${b} ${v+x}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",v+x+25)},"draw"),Zf={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:k(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:k(function(e,t,r,n){e[t]===void 0?e[t]=r:e[t]=n(r,e[t])},"updateVal"),updateBounds:k(function(e,t,r,n){let i=je().journey,a=this,o=0;function s(l){return k(function(d){o++;let h=a.sequenceItems.length-o+1;a.updateVal(d,"starty",t-h*i.boxMargin,Math.min),a.updateVal(d,"stopy",n+h*i.boxMargin,Math.max),a.updateVal(Zf.data,"startx",e-h*i.boxMargin,Math.min),a.updateVal(Zf.data,"stopx",r+h*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(d,"startx",e-h*i.boxMargin,Math.min),a.updateVal(d,"stopx",r+h*i.boxMargin,Math.max),a.updateVal(Zf.data,"starty",t-h*i.boxMargin,Math.min),a.updateVal(Zf.data,"stopy",n+h*i.boxMargin,Math.max))},"updateItemBounds")}k(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:k(function(e,t,r,n){let i=Math.min(e,r),a=Math.max(e,r),o=Math.min(t,n),s=Math.max(t,n);this.updateVal(Zf.data,"startx",i,Math.min),this.updateVal(Zf.data,"starty",o,Math.min),this.updateVal(Zf.data,"stopx",a,Math.max),this.updateVal(Zf.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:k(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:k(function(){return this.verticalPos},"getVerticalPos"),getBounds:k(function(){return this.data},"getBounds")},Iwe=O0.sectionFills,T3t=O0.sectionColours,TLr=k(function(e,t,r,n){let i=je().journey,a="",o=i.height*2+i.diagramMarginY,s=r+o,l=0,u="#CCC",d="black",h=0;for(let[f,p]of t.entries()){if(a!==p.section){u=Iwe[l%Iwe.length],h=l%Iwe.length,d=T3t[l%T3t.length];let g=0,y=p.section;for(let b=f;b(fv[y]&&(g[y]=fv[y]),g),{});p.x=f*i.taskMargin+f*i.width+Zx,p.y=s,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=d,p.fill=u,p.num=h,p.actors=m,gD.drawTask(e,p,i,n),Zf.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),k3t={setConf:wLr,draw:ELr},kLr={parser:iLr,db:E3t,renderer:k3t,styles:pLr,init:k(e=>{k3t.setConf(e.journey),E3t.clear()},"init")}});var e6t={};gr(e6t,{diagram:()=>QLr});function Fwe(e,t){e.each(function(){var r=xt(this),n=r.text().split(/(\s+|
    )/).reverse(),i,a=[],o=1.1,s=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",s).attr("dy",l+"em");for(let d=0;dt||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",s).attr("dy",o+"em").text(i))})}var Nwe,CLr,P3t,kA,O3t,Pwe,Owe,R$,CA,B3t,F3t,z3t,G3t,W3t,V3t,H3t,q3t,Y3t,j3t,M3t,SLr,X3t,M$,ALr,ULr,$3t,ILr,RLr,_we,MLr,LLr,DLr,Bwe,K3t,NLr,_Lr,PLr,OLr,Xd,BLr,L3t,FLr,zLr,L$,pv,GLr,zwe,WLr,Z3t,VLr,D3t,Q3t,N3t,J3t,HLr,_3t,qLr,YLr,jLr,XLr,$Lr,KLr,ZLr,QLr,t6t=H(()=>{cs();Vn();Wr();Gr();xr();_n();_n();Ts();Nwe=(function(){var e=k(function(f,p,m,g){for(m=m||{},g=f.length;g--;m[f[g]]=p);return m},"o"),t=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],o=[1,16],s=[1,19],l=[1,20],u={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:k(function(p,m,g,y,v,b,x){var E=b.length-1;switch(v){case 1:return b[E-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:b[E-1].push(b[E]),this.$=b[E-1];break;case 7:case 8:this.$=b[E];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(b[E].substr(6)),this.$=b[E].substr(6);break;case 12:this.$=b[E].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=b[E].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(b[E].substr(8)),this.$=b[E].substr(8);break;case 18:y.addTask(b[E],0,""),this.$=b[E];break;case 19:y.addEvent(b[E].substr(2)),this.$=b[E];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:o,21:17,22:18,23:s,24:l},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:o,21:17,22:18,23:s,24:l},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:k(function(p,m){if(m.recoverable)this.trace(p);else{var g=new Error(p);throw g.hash=m,g}},"parseError"),parse:k(function(p){var m=this,g=[0],y=[],v=[null],b=[],x=this.table,E="",w=0,T=0,C=0,S=2,R=1,U=b.slice.call(arguments,1),L=Object.create(this.lexer),I={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(I.yy[A]=this.yy[A]);L.setInput(p,I.yy),I.yy.lexer=L,I.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var P=L.yylloc;b.push(P);var D=L.options&&L.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(pe){g.length=g.length-2*pe,v.length=v.length-pe,b.length=b.length-pe}k(M,"popStack");function O(){var pe;return pe=y.pop()||L.lex()||R,typeof pe!="number"&&(pe instanceof Array&&(y=pe,pe=y.pop()),pe=m.symbols_[pe]||pe),pe}k(O,"lex");for(var _,B,F,G,z,V,$={},Z,re,Q,ge;;){if(F=g[g.length-1],this.defaultActions[F]?G=this.defaultActions[F]:((_===null||typeof _>"u")&&(_=O()),G=x[F]&&x[F][_]),typeof G>"u"||!G.length||!G[0]){var ie="";ge=[];for(Z in x[F])this.terminals_[Z]&&Z>S&&ge.push("'"+this.terminals_[Z]+"'");L.showPosition?ie="Parse error on line "+(w+1)+`: -`+L.showPosition()+` -Expecting `+ge.join(", ")+", got '"+(this.terminals_[_]||_)+"'":ie="Parse error on line "+(w+1)+": Unexpected "+(_==R?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(ie,{text:L.match,token:this.terminals_[_]||_,line:L.yylineno,loc:P,expected:ge})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+_);switch(G[0]){case 1:g.push(_),v.push(L.yytext),b.push(L.yylloc),g.push(G[1]),_=null,B?(_=B,B=null):(T=L.yyleng,E=L.yytext,w=L.yylineno,P=L.yylloc,C>0&&C--);break;case 2:if(re=this.productions_[G[1]][1],$.$=v[v.length-re],$._$={first_line:b[b.length-(re||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(re||1)].first_column,last_column:b[b.length-1].last_column},D&&($._$.range=[b[b.length-(re||1)].range[0],b[b.length-1].range[1]]),V=this.performAction.apply($,[E,T,w,I.yy,G[1],v,b].concat(U)),typeof V<"u")return V;re&&(g=g.slice(0,-1*re*2),v=v.slice(0,-1*re),b=b.slice(0,-1*re)),g.push(this.productions_[G[1]][0]),v.push($.$),b.push($._$),Q=x[g[g.length-2]][g[g.length-1]],g.push(Q);break;case 3:return!0}}return!0},"parse")},d=(function(){var f={EOF:1,parseError:k(function(m,g){if(this.yy.parser)this.yy.parser.parseError(m,g);else throw new Error(m)},"parseError"),setInput:k(function(p,m){return this.yy=m||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var m=p.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:k(function(p){var m=p.length,g=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var v=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:g?(g.length===y.length?this.yylloc.first_column:0)+y[y.length-g.length].length-g[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(p){this.unput(this.match.slice(p))},"less"),pastInput:k(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var p=this.pastInput(),m=new Array(p.length+1).join("-");return p+this.upcomingInput()+` -`+m+"^"},"showPosition"),test_match:k(function(p,m){var g,y,v;if(this.options.backtrack_lexer&&(v={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&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,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(p[0].length),this.matched+=p[0],g=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var b in v)this[b]=v[b];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,m,g,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),b=0;bm[0].length)){if(m=g,y=b,this.options.backtrack_lexer){if(p=this.test_match(g,v[b]),p!==!1)return p;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(p=this.test_match(m,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var m=this.next();return m||this.lex()},"lex"),begin:k(function(m){this.conditionStack.push(m)},"begin"),popState:k(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:k(function(m){this.begin(m)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(m,g,y,v){var b=v;switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;break;case 10:return this.popState(),"acc_title_value";break;case 11:return this.begin("acc_descr"),17;break;case 12:return this.popState(),"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/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]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=d;function h(){this.yy={}}return k(h,"Parser"),h.prototype=u,u.Parser=h,new h})();Nwe.parser=Nwe;CLr=Nwe,P3t={};Zb(P3t,{addEvent:()=>Y3t,addSection:()=>W3t,addTask:()=>q3t,addTaskOrg:()=>j3t,clear:()=>F3t,default:()=>SLr,getCommonDb:()=>B3t,getDirection:()=>G3t,getSections:()=>V3t,getTasks:()=>H3t,setDirection:()=>z3t});kA="",O3t=0,Pwe="LR",Owe=[],R$=[],CA=[],B3t=k(()=>yz,"getCommonDb"),F3t=k(function(){Owe.length=0,R$.length=0,kA="",CA.length=0,Pwe="LR",$r()},"clear"),z3t=k(function(e){Pwe=e},"setDirection"),G3t=k(function(){return Pwe},"getDirection"),W3t=k(function(e){kA=e,Owe.push(e)},"addSection"),V3t=k(function(){return Owe},"getSections"),H3t=k(function(){let e=M3t(),t=100,r=0;for(;!e&&rr.id===O3t-1).events.push(e)},"addEvent"),j3t=k(function(e){let t={section:kA,type:kA,description:e,task:e,classes:[]};R$.push(t)},"addTaskOrg"),M3t=k(function(){let e=k(function(r){return CA[r].processed},"compileTask"),t=!0;for(let[r,n]of CA.entries())e(r),t=t&&n.processed;return t},"compileTasks"),SLr={clear:F3t,getCommonDb:B3t,getDirection:G3t,setDirection:z3t,addSection:W3t,getSections:V3t,getTasks:H3t,addTask:q3t,addTaskOrg:j3t,addEvent:Y3t},X3t=0,M$=k(function(e,t){let r=e.append("rect");return r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),r.attr("rx",t.rx),r.attr("ry",t.ry),t.class!==void 0&&r.attr("class",t.class),r},"drawRect"),ALr=k(function(e,t){let n=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){let u=Jm().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}k(a,"smile");function o(l){let u=Jm().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}k(o,"sad");function s(l){l.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 k(s,"ambivalent"),t.score>3?a(i):t.score<3?o(i):s(i),n},"drawFace"),ULr=k(function(e,t){let r=e.append("circle");return r.attr("cx",t.cx),r.attr("cy",t.cy),r.attr("class","actor-"+t.pos),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("r",t.r),r.class!==void 0&&r.attr("class",r.class),t.title!==void 0&&r.append("title").text(t.title),r},"drawCircle"),$3t=k(function(e,t){let r=t.text.replace(//gi," "),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.attr("class","legend"),n.style("text-anchor",t.anchor),t.class!==void 0&&n.attr("class",t.class);let i=n.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),n},"drawText"),ILr=k(function(e,t){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}k(r,"genPoints");let n=e.append("polygon");n.attr("points",r(t.x,t.y,50,20,7)),n.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,$3t(e,t)},"drawLabel"),RLr=k(function(e,t,r){let n=e.append("g"),i=Bwe();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,M$(n,i),K3t(r)(t.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},r,t.colour)},"drawSection"),_we=-1,MLr=k(function(e,t,r,n){let i=t.x+r.width/2,a=e.append("g");_we++,a.append("line").attr("id",n+"-task"+_we).attr("x1",i).attr("y1",t.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),ALr(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let s=Bwe();s.x=t.x,s.y=t.y,s.fill=t.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+t.num,s.rx=3,s.ry=3,M$(a,s),K3t(r)(t.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,t.colour)},"drawTask"),LLr=k(function(e,t){M$(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),DLr=k(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Bwe=k(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),K3t=(function(){function e(i,a,o,s,l,u,d,h){let f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",h).style("text-anchor","middle").text(i);n(f,d)}k(e,"byText");function t(i,a,o,s,l,u,d,h,f){let{taskFontSize:p,taskFontFamily:m}=h,g=i.split(//gi);for(let y=0;y0?`M0 ${t.height-s} v${-t.height+2*s} q0,-${o},${o},-${o} h${t.width-2*s} q${o},0,${o},${o} v${t.height-s} H0 Z`:`M0 ${t.height-s} v${-(t.height-s)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",n+"-node-"+X3t++).attr("class","node-bkg node-"+t.type).attr("d",l),a?.includes("redux")||e.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),Xd={drawRect:M$,drawCircle:ULr,drawSection:RLr,drawText:$3t,drawLabel:ILr,drawTask:MLr,drawBackgroundRect:LLr,getTextObj:DLr,getNoteRect:Bwe,initGraphics:NLr,drawNode:_Lr,getVirtualNodeHeight:PLr},BLr=k(function(e,t,r,n){let i=je(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:d}=s,h=i.timeline?.leftMargin??50;ye.debug("timeline",n.db);let f=i.securityLevel,p;f==="sandbox"&&(p=xt("#i"+t));let g=(f==="sandbox"?xt(p.nodes()[0].contentDocument.body):xt("body")).select("#"+t);g.append("g");let y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();ye.debug("task",y),Xd.initGraphics(g,t);let b=n.db.getSections();ye.debug("sections",b);let x=0,E=0,w=0,T=0,C=50+h,S=50;T=50;let R=0,U=!0;b.forEach(function(D){let M={number:R,descr:D,section:R,width:150,padding:20,maxHeight:x},O=Xd.getVirtualNodeHeight(g,M,i);ye.debug("sectionHeight before draw",O),x=Math.max(x,O+20)});let L=0,I=0;ye.debug("tasks.length",y.length);for(let[D,M]of y.entries()){let O={number:D,descr:M,section:M.section,width:150,padding:20,maxHeight:E},_=Xd.getVirtualNodeHeight(g,O,i);ye.debug("taskHeight before draw",_),E=Math.max(E,_+20),L=Math.max(L,M.events.length);let B=0;for(let F of M.events){let G={descr:F,section:M.section,number:M.section,width:150,padding:20,maxHeight:50};B+=Xd.getVirtualNodeHeight(g,G,i)}M.events.length>0&&(B+=(M.events.length-1)*10),I=Math.max(I,B)}ye.debug("maxSectionHeight before draw",x),ye.debug("maxTaskHeight before draw",E),b&&b.length>0?b.forEach(D=>{let M=y.filter(F=>F.section===D),O={number:R,descr:D,section:R,width:200*Math.max(M.length,1)-50,padding:20,maxHeight:x};ye.debug("sectionNode",O);let _=g.append("g"),B=Xd.drawNode(_,O,R,i,t);ye.debug("sectionNode output",B),_.attr("transform",`translate(${C}, ${T})`),S+=x+50,M.length>0&&L3t(g,M,R,C,S,E,i,L,I,x,!1,t),C+=200*Math.max(M.length,1),S=T,R++}):(U=!1,L3t(g,y,R,C,S,E,i,L,I,x,!0,t));let A=g.node().getBBox();if(ye.debug("bounds",A),v&&g.append("text").text(v).attr("x",a==="neo"?A.x*2+h:A.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=U?x+E+150:E+100,g.append("g").attr("class","lineWrapper").append("line").attr("x1",h).attr("y1",w).attr("x2",A.width+3*h).attr("y2",w).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),a==="neo"&&l&&o!=="neutral"){let D=g.select("defs"),O=(D.empty()?g.append("defs"):D).append("linearGradient").attr("id",g.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");O.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),O.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}qm(void 0,g,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),L3t=k(function(e,t,r,n,i,a,o,s,l,u,d,h){for(let f of t){let p={descr:f.task,section:r,number:r,width:150,padding:20,maxHeight:a};ye.debug("taskNode",p);let m=e.append("g").attr("class","taskWrapper"),y=Xd.drawNode(m,p,r,o,h).height;if(ye.debug("taskHeight after draw",y),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,y),f.events){let v=e.append("g").attr("class","lineWrapper"),b=a;i+=100,b=b+FLr(e,f.events,r,n,i,o,h),i-=100,v.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${h}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,d&&!o.timeline?.disableMulticolor&&r++}i=i-10},"drawTasks"),FLr=k(function(e,t,r,n,i,a,o){let s=0,l=i;i=i+100;for(let u of t){let d={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};ye.debug("eventNode",d);let h=e.append("g").attr("class","eventWrapper"),p=Xd.drawNode(h,d,r,a,o,!0).height;s=s+p,h.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),zLr={setConf:k(()=>{},"setConf"),draw:BLr},L$=200,pv=5,GLr=L$+pv*2,zwe=L$+100,WLr=zwe+pv*2,Z3t=10,VLr=0,D3t=20,Q3t=20,N3t=30,J3t=50,HLr=k(function(e,t,r,n){let i=je(),a=i.timeline?.leftMargin??50;ye.debug("timeline",n.db);let o=Mi(t);o.append("g");let s=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ye.debug("task",s),Xd.initGraphics(o);let u=n.db.getSections();ye.debug("sections",u);let d=0,h=0,f=50+a,p=50,m=p,g=f,y=GLr+Q3t,v=WLr+J3t,b=g+y,x=0,E=u&&u.length>0,w=E?b:f+y,T=Math.max(50,y+v-pv*2);u.forEach(function(D){let M={number:x,descr:D,section:x,width:T,padding:pv,maxHeight:d},O=Xd.getVirtualNodeHeight(o,M,i);ye.debug("sectionHeight before draw",O),d=Math.max(d,O)});let C=0;ye.debug("tasks.length",s.length);for(let[D,M]of s.entries()){let O={number:D,descr:M,section:M.section,width:L$,padding:pv,maxHeight:h},_=Xd.getVirtualNodeHeight(o,O,i);ye.debug("taskHeight before draw",_),h=Math.max(h,_);let B=0;for(let F of M.events){let G={descr:F,section:M.section,number:M.section,width:zwe,padding:pv,maxHeight:50};B+=Xd.getVirtualNodeHeight(o,G,i)}M.events.length>0&&(B+=(M.events.length-1)*Z3t),C=Math.max(C,B)+VLr}ye.debug("maxSectionHeight before draw",d),ye.debug("maxTaskHeight before draw",h);let R=Math.max(h,C)+N3t;E?u.forEach(D=>{let M=s.filter($=>$.section===D),O={number:x,descr:D,section:x,width:T,padding:pv,maxHeight:d};ye.debug("sectionNode",O);let _=o.append("g"),B=Xd.drawNode(_,O,x,i);ye.debug("sectionNode output",B);let F=w-y;_.attr("transform",`translate(${F}, ${p})`);let G=p+B.height+D3t;M.length>0&&_3t(o,M,x,w,G,h,i,R,!1);let z=M.length,V=B.height+D3t+R*Math.max(z,1)-(z>0?N3t*2:0);p+=V,x++}):_3t(o,s,x,w,p,h,i,R,!0);let U=o.node()?.getBBox();if(!U)throw new Error("bbox not found");if(ye.debug("bounds",U),l){if(o.append("text").text(l).attr("x",U.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),U=o.node()?.getBBox(),!U)throw new Error("bbox not found");ye.debug("bounds after title",U)}let[L]=kd(i.fontSize),I=(L??16)*2,A=(L??16)*.5+20,P=o.append("g").attr("class","lineWrapper");P.append("line").attr("x1",w).attr("y1",m-I).attr("x2",w).attr("y2",U.y+U.height+A).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),P.lower(),qm(void 0,o,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),_3t=k(function(e,t,r,n,i,a,o,s,l){for(let u of t){let d={descr:u.task,section:r,number:r,width:L$,padding:pv,maxHeight:a};ye.debug("taskNode",d);let h=e.append("g").attr("class","taskWrapper"),f=Xd.drawNode(h,d,r,o),p=f.height;ye.debug("taskHeight after draw",p);let m=n-Q3t-f.width;if(h.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,p),u.events&&u.events.length>0){let g=i,y=n+J3t;qLr(e,u.events,r,n,y,g,o)}i=i+s,l&&!o.timeline?.disableMulticolor&&r++}},"drawTasks"),qLr=k(function(e,t,r,n,i,a,o){let s=a;for(let l of t){let u={descr:l,section:r,number:r,width:zwe,padding:pv,maxHeight:0};ye.debug("eventNode",u);let d=e.append("g").attr("class","eventWrapper"),f=Xd.drawNode(d,u,r,o).height;d.attr("transform",`translate(${i}, ${s})`);let p=e.append("g").attr("class","lineWrapper"),m=s+f/2;p.append("line").attr("x1",n).attr("y1",m).attr("x2",i).attr("y2",m).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),s=s+f+Z3t}return s-a},"drawEvents"),YLr={setConf:k(()=>{},"setConf"),draw:HLr},jLr=k(e=>{let{theme:t}=Kt(),r=t?.includes("dark"),n=t?.includes("color"),i=e.svgId?.replace(/^#/,"")??"",a=i?`url(#${i}-drop-shadow)`:e.dropShadow??"none",o="";for(let s=0;s{let t="";for(let r=0;r{let{theme:t}=Kt(),r=t?.includes("redux"),n=t==="neutral",i=e.svgId?.replace(/^#/,"")??"",a="";if(e.useGradient&&i&&e.THEME_COLOR_LIMIT&&!n)for(let o=0;o{},"setConf"),draw:k((e,t,r,n)=>(n?.db?.getDirection?.()??"LR")==="TD"?YLr.draw(e,t,r,n):zLr.draw(e,t,r,n),"draw")},QLr={db:P3t,renderer:ZLr,parser:CLr,styles:KLr}});function r6t(e,t=0){return(bc[e[t+0]]+bc[e[t+1]]+bc[e[t+2]]+bc[e[t+3]]+"-"+bc[e[t+4]]+bc[e[t+5]]+"-"+bc[e[t+6]]+bc[e[t+7]]+"-"+bc[e[t+8]]+bc[e[t+9]]+"-"+bc[e[t+10]]+bc[e[t+11]]+bc[e[t+12]]+bc[e[t+13]]+bc[e[t+14]]+bc[e[t+15]]).toLowerCase()}var bc,n6t=H(()=>{bc=[];for(let e=0;e<256;++e)bc.push((e+256).toString(16).slice(1))});function Gwe(){return crypto.getRandomValues(JLr)}var JLr,i6t=H(()=>{JLr=new Uint8Array(16)});function eDr(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():tDr(e,t,r)}function tDr(e,t,r){e=e||{};let n=e.random??e.rng?.()??Gwe();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return r6t(n)}var Wwe,a6t=H(()=>{i6t();n6t();Wwe=eDr});var o6t=H(()=>{a6t()});var s6t={};gr(s6t,{diagram:()=>dDr});var Vwe,rDr,nDr,mv,iDr,aDr,oDr,sDr,lDr,cDr,uDr,dDr,l6t=H(()=>{Oh();Fd();_d();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();o6t();Ts();Vwe=(function(){var e=k(function(E,w,T,C){for(T=T||{},C=E.length;C--;T[E[C]]=w);return T},"o"),t=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],h=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],m=[1,33],g=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:k(function(w,T,C,S,R,U,L){var I=U.length-1;switch(R){case 6:case 7:return S;case 8:S.getLogger().trace("Stop NL ");break;case 9:S.getLogger().trace("Stop EOF ");break;case 11:S.getLogger().trace("Stop NL2 ");break;case 12:S.getLogger().trace("Stop EOF2 ");break;case 15:S.getLogger().info("Node: ",U[I].id),S.addNode(U[I-1].length,U[I].id,U[I].descr,U[I].type);break;case 16:S.getLogger().trace("Icon: ",U[I]),S.decorateNode({icon:U[I]});break;case 17:case 21:S.decorateNode({class:U[I]});break;case 18:S.getLogger().trace("SPACELIST");break;case 19:S.getLogger().trace("Node: ",U[I].id),S.addNode(0,U[I].id,U[I].descr,U[I].type);break;case 20:S.decorateNode({icon:U[I]});break;case 25:S.getLogger().trace("node found ..",U[I-2]),this.$={id:U[I-1],descr:U[I-1],type:S.getType(U[I-2],U[I])};break;case 26:this.$={id:U[I],descr:U[I],type:S.nodeType.DEFAULT};break;case 27:S.getLogger().trace("node found ..",U[I-3]),this.$={id:U[I-3],descr:U[I-1],type:S.getType(U[I-2],U[I])};break}},"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:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:u,7:d,10:23,11:h},e(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:s}),e(f,[2,18]),e(f,[2,19]),e(f,[2,20]),e(f,[2,21]),e(f,[2,23]),e(f,[2,24]),e(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:h},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(p,[2,14],{7:m,11:g}),e(y,[2,8]),e(y,[2,9]),e(y,[2,10]),e(f,[2,15]),e(f,[2,16]),e(f,[2,17]),{20:[1,35]},{21:[1,36]},e(p,[2,13],{7:m,11:g}),e(y,[2,11]),e(y,[2,12]),{21:[1,37]},e(f,[2,25]),e(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:k(function(w,T){if(T.recoverable)this.trace(w);else{var C=new Error(w);throw C.hash=T,C}},"parseError"),parse:k(function(w){var T=this,C=[0],S=[],R=[null],U=[],L=this.table,I="",A=0,P=0,D=0,M=2,O=1,_=U.slice.call(arguments,1),B=Object.create(this.lexer),F={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(F.yy[G]=this.yy[G]);B.setInput(w,F.yy),F.yy.lexer=B,F.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var z=B.yylloc;U.push(z);var V=B.options&&B.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(ve){C.length=C.length-2*ve,R.length=R.length-ve,U.length=U.length-ve}k($,"popStack");function Z(){var ve;return ve=S.pop()||B.lex()||O,typeof ve!="number"&&(ve instanceof Array&&(S=ve,ve=S.pop()),ve=T.symbols_[ve]||ve),ve}k(Z,"lex");for(var re,Q,ge,ie,pe,ue,fe={},Me,Ce,Ye,Ze;;){if(ge=C[C.length-1],this.defaultActions[ge]?ie=this.defaultActions[ge]:((re===null||typeof re>"u")&&(re=Z()),ie=L[ge]&&L[ge][re]),typeof ie>"u"||!ie.length||!ie[0]){var Qe="";Ze=[];for(Me in L[ge])this.terminals_[Me]&&Me>M&&Ze.push("'"+this.terminals_[Me]+"'");B.showPosition?Qe="Parse error on line "+(A+1)+`: -`+B.showPosition()+` -Expecting `+Ze.join(", ")+", got '"+(this.terminals_[re]||re)+"'":Qe="Parse error on line "+(A+1)+": Unexpected "+(re==O?"end of input":"'"+(this.terminals_[re]||re)+"'"),this.parseError(Qe,{text:B.match,token:this.terminals_[re]||re,line:B.yylineno,loc:z,expected:Ze})}if(ie[0]instanceof Array&&ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+re);switch(ie[0]){case 1:C.push(re),R.push(B.yytext),U.push(B.yylloc),C.push(ie[1]),re=null,Q?(re=Q,Q=null):(P=B.yyleng,I=B.yytext,A=B.yylineno,z=B.yylloc,D>0&&D--);break;case 2:if(Ce=this.productions_[ie[1]][1],fe.$=R[R.length-Ce],fe._$={first_line:U[U.length-(Ce||1)].first_line,last_line:U[U.length-1].last_line,first_column:U[U.length-(Ce||1)].first_column,last_column:U[U.length-1].last_column},V&&(fe._$.range=[U[U.length-(Ce||1)].range[0],U[U.length-1].range[1]]),ue=this.performAction.apply(fe,[I,P,A,F.yy,ie[1],R,U].concat(_)),typeof ue<"u")return ue;Ce&&(C=C.slice(0,-1*Ce*2),R=R.slice(0,-1*Ce),U=U.slice(0,-1*Ce)),C.push(this.productions_[ie[1]][0]),R.push(fe.$),U.push(fe._$),Ye=L[C[C.length-2]][C[C.length-1]],C.push(Ye);break;case 3:return!0}}return!0},"parse")},b=(function(){var E={EOF:1,parseError:k(function(T,C){if(this.yy.parser)this.yy.parser.parseError(T,C);else throw new Error(T)},"parseError"),setInput:k(function(w,T){return this.yy=T||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var T=w.match(/(?:\r\n?|\n).*/g);return T?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:k(function(w){var T=w.length,C=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-T]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(w){this.unput(this.match.slice(w))},"less"),pastInput:k(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var w=this.pastInput(),T=new Array(w.length+1).join("-");return w+this.upcomingInput()+` -`+T+"^"},"showPosition"),test_match:k(function(w,T){var C,S,R;if(this.options.backtrack_lexer&&(R={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&&(R.yylloc.range=this.yylloc.range.slice(0))),S=w[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],C=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var U in R)this[U]=R[U];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,T,C,S;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),U=0;UT[0].length)){if(T=C,S=U,this.options.backtrack_lexer){if(w=this.test_match(C,R[U]),w!==!1)return w;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(w=this.test_match(T,R[S]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var T=this.next();return T||this.lex()},"lex"),begin:k(function(T){this.conditionStack.push(T)},"begin"),popState:k(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:k(function(T){this.begin(T)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(T,C,S,R){var U=R;switch(S){case 0:return T.getLogger().trace("Found comment",C.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:T.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return T.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:T.getLogger().trace("end icon"),this.popState();break;case 10:return T.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return T.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return T.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return T.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:T.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return T.getLogger().trace("description:",C.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),T.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),T.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),T.getLogger().trace("node end ...",C.yytext),"NODE_DEND";break;case 30:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),T.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),T.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return T.getLogger().trace("Long description:",C.yytext),20;break;case 36:return T.getLogger().trace("Long description:",C.yytext),20;break}},"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})();v.lexer=b;function x(){this.yy={}}return k(x,"Parser"),x.prototype=v,v.Parser=x,new x})();Vwe.parser=Vwe;rDr=Vwe,nDr=12,mv={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iDr=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=mv,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{k(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--)if(this.nodes[t].level0?this.nodes[0]:null}addNode(e,t,r,n){ye.info("addNode",e,t,r,n);let i=!1;this.nodes.length===0?(this.baseLevel=e,e=0,i=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,i=!1);let a=je(),o=a.mindmap?.padding??Xr.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}let s={id:this.count++,nodeId:rn(t,a),level:e,descr:rn(r,a),type:n,children:[],width:a.mindmap?.maxNodeWidth??Xr.mindmap.maxNodeWidth,padding:o,isRoot:i},l=this.getParent(e);if(l)l.children.push(s),this.nodes.push(s);else if(i)this.nodes.push(s);else throw new Error(`There can be only one root. No parent could be found for ("${s.descr}")`)}getType(e,t){switch(ye.debug("In get type",e,t),e){case"[":return this.nodeType.RECT;case"(":return t===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let t=je(),r=this.nodes[this.nodes.length-1];e.icon&&(r.icon=rn(e.icon,t)),e.class&&(r.class=rn(e.class,t))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,t){if(e.level===0?e.section=void 0:e.section=t,e.children)for(let[r,n]of e.children.entries()){let i=e.level===0?r%(nDr-1):t;this.assignSections(n,i)}}flattenNodes(e,t){let r=je(),n=["mindmap-node"];e.isRoot===!0?n.push("section-root","section--1"):e.section!==void 0&&n.push(`section-${e.section}`),e.class&&n.push(e.class);let i=n.join(" "),a=k(s=>{let u=(r.theme?.toLowerCase()??"").includes("redux");switch(s){case mv.CIRCLE:return"mindmapCircle";case mv.RECT:return"rect";case mv.ROUNDED_RECT:return"rounded";case mv.CLOUD:return"cloud";case mv.BANG:return"bang";case mv.HEXAGON:return"hexagon";case mv.DEFAULT:return u?"rounded":"defaultMindmapNode";case mv.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:a(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:i,cssStyles:[],look:r.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(t.push(o),e.children)for(let s of e.children)this.flattenNodes(s,t)}generateEdges(e,t){if(!e.children)return;let r=je();for(let n of e.children){let i="edge";n.section!==void 0&&(i+=` section-edge-${n.section}`);let a=e.level+1;i+=` edge-depth-${a}`;let o={id:`edge_${e.id}_${n.id}`,start:e.id.toString(),end:n.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:r.look,classes:i,depth:e.level,section:n.section};t.push(o),this.generateEdges(n,t)}}getData(){let e=this.getMindmap(),t=je(),n=pz().layout!==void 0,i=t;if(n||(i.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:i};ye.debug("getData: mindmapRoot",e,t),this.assignSections(e);let a=[],o=[];this.flattenNodes(e,a),this.generateEdges(e,o),ye.debug(`getData: processed ${a.length} nodes and ${o.length} edges`);let s=new Map;for(let l of a)s.set(l.id,{shape:l.shape,width:l.width,height:l.height,padding:l.padding});return{nodes:a,edges:o,config:i,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(s),type:"mindmap",diagramId:"mindmap-"+Wwe()}}getLogger(){return ye}},aDr=k(async(e,t,r,n)=>{ye.debug(`Rendering mindmap diagram -`+e);let i=n.db,a=i.getData(),o=Hf(t,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=Rg(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=t,!i.getMindmap())return;a.nodes.forEach(f=>{f.shape==="rounded"?(f.radius=15,f.taper=15,f.stroke="none",f.width=0,f.padding=15):f.shape==="circle"?f.padding=10:f.shape==="rect"?(f.width=0,f.padding=10):f.shape==="hexagon"&&(f.width=0,f.height=0)}),await Gf(a,o);let{themeVariables:l}=Kt(),{useGradient:u,gradientStart:d,gradientStop:h}=l;if(u&&d&&h){let f=o.attr("id"),p=o.append("defs").append("linearGradient").attr("id",`${f}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");p.append("stop").attr("offset","0%").attr("stop-color",d).attr("stop-opacity",1),p.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}Bd(o,a.config.mindmap?.padding??Xr.mindmap.padding,"mindmapDiagram",a.config.mindmap?.useMaxWidth??Xr.mindmap.useMaxWidth)},"draw"),oDr={draw:aDr},sDr=k(e=>{let{theme:t,look:r}=e,n="";for(let i=0;i{let n="";for(let i=0;i{let{theme:t}=e,r=e.svgId,n=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` - .edge { - stroke-width: 3; - } - ${sDr(e)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${e.git0}; - } - .section-root text { - fill: ${e.gitBranchLabel0}; - } - .section-root span { - color: ${t?.includes("redux")?e.nodeBorder:e.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .mindmap-node-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; - } - [data-look="neo"].mindmap-node { - filter: ${n}; - } - [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { - fill: ${t?.includes("redux")?e.mainBkg:e.git0}; - } - [data-look="neo"].mindmap-node.section-root .text-inner-tspan { - fill: ${t?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(t==="neutral"?1:0)]}; - } - ${e.useGradient&&r&&e.mainBkg?lDr(e.THEME_COLOR_LIMIT,r,e.mainBkg):""} -`},"getStyles"),uDr=cDr,dDr={get db(){return new iDr},renderer:oDr,parser:rDr,styles:uDr}});var u6t={};gr(u6t,{diagram:()=>RDr});var Hwe,hDr,Qf,Ywe,qwe,jwe,fDr,pDr,c6t,mDr,gDr,hl,yDr,vDr,bDr,xDr,wDr,EDr,TDr,kDr,CDr,SDr,ADr,UDr,IDr,RDr,d6t=H(()=>{cs();Dg();O4();Gc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();Ts();Hwe=(function(){var e=k(function(C,S,R,U){for(R=R||{},U=C.length;U--;R[C[U]]=S);return R},"o"),t=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],h=[1,25],f=[6,7,11],p=[1,31],m=[6,7,11,24],g=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],b=[1,6,7,11,13,16,17,20,23],x=[1,38],E={trace:k(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:k(function(S,R,U,L,I,A,P){var D=A.length-1;switch(I){case 6:case 7:return L;case 8:L.getLogger().trace("Stop NL ");break;case 9:L.getLogger().trace("Stop EOF ");break;case 11:L.getLogger().trace("Stop NL2 ");break;case 12:L.getLogger().trace("Stop EOF2 ");break;case 15:L.getLogger().info("Node: ",A[D-1].id),L.addNode(A[D-2].length,A[D-1].id,A[D-1].descr,A[D-1].type,A[D]);break;case 16:L.getLogger().info("Node: ",A[D].id),L.addNode(A[D-1].length,A[D].id,A[D].descr,A[D].type);break;case 17:L.getLogger().trace("Icon: ",A[D]),L.decorateNode({icon:A[D]});break;case 18:case 23:L.decorateNode({class:A[D]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",A[D-1].id),L.addNode(0,A[D-1].id,A[D-1].descr,A[D-1].type,A[D]);break;case 21:L.getLogger().trace("Node: ",A[D].id),L.addNode(0,A[D].id,A[D].descr,A[D].type);break;case 22:L.decorateNode({icon:A[D]});break;case 27:L.getLogger().trace("node found ..",A[D-2]),this.$={id:A[D-1],descr:A[D-1],type:L.getType(A[D-2],A[D])};break;case 28:this.$={id:A[D],descr:A[D],type:0};break;case 29:L.getLogger().trace("node found ..",A[D-3]),this.$={id:A[D-3],descr:A[D-1],type:L.getType(A[D-2],A[D])};break;case 30:this.$=A[D-1]+A[D];break;case 31:this.$=A[D];break}},"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:r,7:[1,10],9:9,12:11,13:n,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:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:u,7:d,10:23,11:h},e(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:s}),e(f,[2,19]),e(f,[2,21],{15:30,24:p}),e(f,[2,22]),e(f,[2,23]),e(m,[2,25]),e(m,[2,26]),e(m,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:h},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(g,[2,14],{7:y,11:v}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(f,[2,16],{15:37,24:p}),e(f,[2,17]),e(f,[2,18]),e(f,[2,20],{24:x}),e(m,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:y,11:v}),e(b,[2,11]),e(b,[2,12]),e(f,[2,15],{24:x}),e(m,[2,30]),{22:[1,41]},e(m,[2,27]),e(m,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:k(function(S,R){if(R.recoverable)this.trace(S);else{var U=new Error(S);throw U.hash=R,U}},"parseError"),parse:k(function(S){var R=this,U=[0],L=[],I=[null],A=[],P=this.table,D="",M=0,O=0,_=0,B=2,F=1,G=A.slice.call(arguments,1),z=Object.create(this.lexer),V={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(V.yy[$]=this.yy[$]);z.setInput(S,V.yy),V.yy.lexer=z,V.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var Z=z.yylloc;A.push(Z);var re=z.options&&z.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Q(Be){U.length=U.length-2*Be,I.length=I.length-Be,A.length=A.length-Be}k(Q,"popStack");function ge(){var Be;return Be=L.pop()||z.lex()||F,typeof Be!="number"&&(Be instanceof Array&&(L=Be,Be=L.pop()),Be=R.symbols_[Be]||Be),Be}k(ge,"lex");for(var ie,pe,ue,fe,Me,Ce,Ye={},Ze,Qe,ve,Fe;;){if(ue=U[U.length-1],this.defaultActions[ue]?fe=this.defaultActions[ue]:((ie===null||typeof ie>"u")&&(ie=ge()),fe=P[ue]&&P[ue][ie]),typeof fe>"u"||!fe.length||!fe[0]){var Le="";Fe=[];for(Ze in P[ue])this.terminals_[Ze]&&Ze>B&&Fe.push("'"+this.terminals_[Ze]+"'");z.showPosition?Le="Parse error on line "+(M+1)+`: -`+z.showPosition()+` -Expecting `+Fe.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":Le="Parse error on line "+(M+1)+": Unexpected "+(ie==F?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(Le,{text:z.match,token:this.terminals_[ie]||ie,line:z.yylineno,loc:Z,expected:Fe})}if(fe[0]instanceof Array&&fe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ue+", token: "+ie);switch(fe[0]){case 1:U.push(ie),I.push(z.yytext),A.push(z.yylloc),U.push(fe[1]),ie=null,pe?(ie=pe,pe=null):(O=z.yyleng,D=z.yytext,M=z.yylineno,Z=z.yylloc,_>0&&_--);break;case 2:if(Qe=this.productions_[fe[1]][1],Ye.$=I[I.length-Qe],Ye._$={first_line:A[A.length-(Qe||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Qe||1)].first_column,last_column:A[A.length-1].last_column},re&&(Ye._$.range=[A[A.length-(Qe||1)].range[0],A[A.length-1].range[1]]),Ce=this.performAction.apply(Ye,[D,O,M,V.yy,fe[1],I,A].concat(G)),typeof Ce<"u")return Ce;Qe&&(U=U.slice(0,-1*Qe*2),I=I.slice(0,-1*Qe),A=A.slice(0,-1*Qe)),U.push(this.productions_[fe[1]][0]),I.push(Ye.$),A.push(Ye._$),ve=P[U[U.length-2]][U[U.length-1]],U.push(ve);break;case 3:return!0}}return!0},"parse")},w=(function(){var C={EOF:1,parseError:k(function(R,U){if(this.yy.parser)this.yy.parser.parseError(R,U);else throw new Error(R)},"parseError"),setInput:k(function(S,R){return this.yy=R||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var R=S.match(/(?:\r\n?|\n).*/g);return R?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:k(function(S){var R=S.length,U=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),U.length-1&&(this.yylineno-=U.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:U?(U.length===L.length?this.yylloc.first_column:0)+L[L.length-U.length].length-U[0].length:this.yylloc.first_column-R},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-R]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(S){this.unput(this.match.slice(S))},"less"),pastInput:k(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var S=this.pastInput(),R=new Array(S.length+1).join("-");return S+this.upcomingInput()+` -`+R+"^"},"showPosition"),test_match:k(function(S,R){var U,L,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))),L=S[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],U=this.performAction.call(this,this.yy,this,R,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),U)return U;if(this._backtrack){for(var A in I)this[A]=I[A];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,R,U,L;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),A=0;AR[0].length)){if(R=U,L=A,this.options.backtrack_lexer){if(S=this.test_match(U,I[A]),S!==!1)return S;if(this._backtrack){R=!1;continue}else return!1}else if(!this.options.flex)break}return R?(S=this.test_match(R,I[L]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var R=this.next();return R||this.lex()},"lex"),begin:k(function(R){this.conditionStack.push(R)},"begin"),popState:k(function(){var R=this.conditionStack.length-1;return R>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(R){return R=this.conditionStack.length-1-Math.abs(R||0),R>=0?this.conditionStack[R]:"INITIAL"},"topState"),pushState:k(function(R){this.begin(R)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(R,U,L,I){var A=I;switch(L){case 0:return this.pushState("shapeData"),U.yytext="",24;break;case 1:return this.pushState("shapeDataStr"),24;break;case 2:return this.popState(),24;break;case 3:let P=/\n\s*/g;return U.yytext=U.yytext.replace(P,"
    "),24;break;case 4:return 24;case 5:this.popState();break;case 6:return R.getLogger().trace("Found comment",U.yytext),6;break;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;break;case 10:this.popState();break;case 11:R.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return R.getLogger().trace("SPACELINE"),6;break;case 13:return 7;case 14:return 16;case 15:R.getLogger().trace("end icon"),this.popState();break;case 16:return R.getLogger().trace("Exploding node"),this.begin("NODE"),20;break;case 17:return R.getLogger().trace("Cloud"),this.begin("NODE"),20;break;case 18:return R.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;break;case 19:return R.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;break;case 20:return this.begin("NODE"),20;break;case 21:return this.begin("NODE"),20;break;case 22:return this.begin("NODE"),20;break;case 23:return this.begin("NODE"),20;break;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:R.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return R.getLogger().trace("description:",U.yytext),"NODE_DESCR";break;case 32:this.popState();break;case 33:return this.popState(),R.getLogger().trace("node end ))"),"NODE_DEND";break;case 34:return this.popState(),R.getLogger().trace("node end )"),"NODE_DEND";break;case 35:return this.popState(),R.getLogger().trace("node end ...",U.yytext),"NODE_DEND";break;case 36:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";break;case 37:return this.popState(),R.getLogger().trace("node end (-"),"NODE_DEND";break;case 38:return this.popState(),R.getLogger().trace("node end (-"),"NODE_DEND";break;case 39:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";break;case 40:return this.popState(),R.getLogger().trace("node end (("),"NODE_DEND";break;case 41:return R.getLogger().trace("Long description:",U.yytext),21;break;case 42:return R.getLogger().trace("Long description:",U.yytext),21;break}},"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 C})();E.lexer=w;function T(){this.yy={}}return k(T,"Parser"),T.prototype=E,E.Parser=T,new T})();Hwe.parser=Hwe;hDr=Hwe,Qf=[],Ywe=[],qwe=0,jwe={},fDr=k(()=>{Qf=[],Ywe=[],qwe=0,jwe={}},"clear"),pDr=k(e=>{if(Qf.length===0)return null;let t=Qf[0].level,r=null;for(let n=Qf.length-1;n>=0;n--)if(Qf[n].level===t&&!r&&(r=Qf[n]),Qf[n].levels.parentId===i.id);for(let s of o){let l={id:s.id,parentId:i.id,label:rn(s.label??"",n),labelType:"markdown",isGroup:!1,ticket:s?.ticket,priority:s?.priority,assigned:s?.assigned,icon:s?.icon,shape:"kanbanItem",level:s.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(l)}}return{nodes:t,edges:e,other:{},config:je()}},"getData"),gDr=k((e,t,r,n,i)=>{let a=je(),o=a.mindmap?.padding??Xr.mindmap.padding;switch(n){case hl.ROUNDED_RECT:case hl.RECT:case hl.HEXAGON:o*=2}let s={id:rn(t,a)||"kbn"+qwe++,level:e,label:rn(r,a),width:a.mindmap?.maxNodeWidth??Xr.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(i!==void 0){let u;i.includes(` -`)?u=i+` -`:u=`{ -`+i+` -}`;let d=$2(u,{schema:X2});if(d.shape&&(d.shape!==d.shape.toLowerCase()||d.shape.includes("_")))throw new Error(`No such shape: ${d.shape}. Shape names should be lowercase.`);d?.shape&&d.shape==="kanbanItem"&&(s.shape=d?.shape),d?.label&&(s.label=d?.label),d?.icon&&(s.icon=d?.icon.toString()),d?.assigned&&(s.assigned=d?.assigned.toString()),d?.ticket&&(s.ticket=d?.ticket.toString()),d?.priority&&(s.priority=d?.priority)}let l=pDr(e);l?s.parentId=l.id||"kbn"+qwe++:Ywe.push(s),Qf.push(s)},"addNode"),hl={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},yDr=k((e,t)=>{switch(ye.debug("In get type",e,t),e){case"[":return hl.RECT;case"(":return t===")"?hl.ROUNDED_RECT:hl.CLOUD;case"((":return hl.CIRCLE;case")":return hl.CLOUD;case"))":return hl.BANG;case"{{":return hl.HEXAGON;default:return hl.DEFAULT}},"getType"),vDr=k((e,t)=>{jwe[e]=t},"setElementForId"),bDr=k(e=>{if(!e)return;let t=je(),r=Qf[Qf.length-1];e.icon&&(r.icon=rn(e.icon,t)),e.class&&(r.cssClasses=rn(e.class,t))},"decorateNode"),xDr=k(e=>{switch(e){case hl.DEFAULT:return"no-border";case hl.RECT:return"rect";case hl.ROUNDED_RECT:return"rounded-rect";case hl.CIRCLE:return"circle";case hl.CLOUD:return"cloud";case hl.BANG:return"bang";case hl.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),wDr=k(()=>ye,"getLogger"),EDr=k(e=>jwe[e],"getElementById"),TDr={clear:fDr,addNode:gDr,getSections:c6t,getData:mDr,nodeType:hl,getType:yDr,setElementForId:vDr,decorateNode:bDr,type2Str:xDr,getLogger:wDr,getElementById:EDr},kDr=TDr,CDr=k(async(e,t,r,n)=>{ye.debug(`Rendering kanban diagram -`+e);let a=n.db.getData(),o=je();o.htmlLabels=!1;let s=Mi(t);for(let y of a.nodes)y.domId=`${t}-${y.id}`;let l=s.append("g");l.attr("class","sections");let u=s.append("g");u.attr("class","items");let d=a.nodes.filter(y=>y.isGroup),h=0,f=10,p=[],m=25;for(let y of d){let v=o?.kanban?.sectionWidth||200;h=h+1,y.x=v*h+(h-1)*f/2,y.width=v,y.y=0,y.height=v*3,y.rx=5,y.ry=5,y.cssClasses=y.cssClasses+" section-"+h;let b=await C2(l,y);m=Math.max(m,b?.labelBBox?.height),p.push(b)}let g=0;for(let y of d){let v=p[g];g=g+1;let b=o?.kanban?.sectionWidth||200,x=-b*3/2+m,E=x,w=a.nodes.filter(S=>S.parentId===y.id);for(let S of w){if(S.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");S.x=y.x,S.width=b-1.5*f;let U=(await sg(u,S,{config:o})).node().getBBox();S.y=E+U.height/2,await lg(S),E=S.y+U.height/2+f/2}let T=v.cluster.select("rect"),C=Math.max(E-x+3*f,50)+(m-25);T.attr("height",C)}qm(void 0,s,o.mindmap?.padding??Xr.kanban.padding,o.mindmap?.useMaxWidth??Xr.kanban.useMaxWidth)},"draw"),SDr={draw:CDr},ADr=k(e=>{let t="";for(let n=0;ne.darkMode?lt(n,i):st(n,i),"adjuster");for(let n=0;n` - .edge { - stroke-width: 3; - } - ${ADr(e)} - .section-root rect, .section-root path, .section-root circle, .section-root polygon { - fill: ${e.git0}; - } - .section-root text { - fill: ${e.gitBranchLabel0}; - } - .icon-container { - height:100%; - display: flex; - justify-content: center; - align-items: center; - } - .edge { - fill: none; - } - .cluster-label, .label { - color: ${e.textColor}; - fill: ${e.textColor}; - } - .kanban-label { - dy: 1em; - alignment-baseline: middle; - text-anchor: middle; - dominant-baseline: middle; - text-align: center; - } - ${Lg()} -`,"getStyles"),IDr=UDr,RDr={db:kDr,renderer:SDr,parser:hDr,styles:IDr}});function yD(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var h6t=H(()=>{});function SA(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var f6t=H(()=>{});function AA(e,t){let r=0;if(t===void 0)for(let n of e)(n=+n)&&(r+=n);else{let n=-1;for(let i of e)(i=+t(i,++n,e))&&(r+=i)}return r}var p6t=H(()=>{});var Xwe=H(()=>{h6t();f6t();p6t()});function MDr(e){return e.target.depth}function $we(e){return e.depth}function Kwe(e,t){return t-1-e.height}function vD(e,t){return e.sourceLinks.length?e.depth:t-1}function Zwe(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?SA(e.sourceLinks,MDr)-1:0}var Qwe=H(()=>{Xwe()});function UA(e){return function(){return e}}var m6t=H(()=>{});function g6t(e,t){return D$(e.source,t.source)||e.index-t.index}function y6t(e,t){return D$(e.target,t.target)||e.index-t.index}function D$(e,t){return e.y0-t.y0}function Jwe(e){return e.value}function LDr(e){return e.index}function DDr(e){return e.nodes}function NDr(e){return e.links}function v6t(e,t){let r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function b6t({nodes:e}){for(let t of e){let r=t.y0,n=r;for(let i of t.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(let i of t.targetLinks)i.y1=n+i.width/2,n+=i.width}}function N$(){let e=0,t=0,r=1,n=1,i=24,a=8,o,s=LDr,l=vD,u,d,h=DDr,f=NDr,p=6;function m(){let D={nodes:h.apply(null,arguments),links:f.apply(null,arguments)};return g(D),y(D),v(D),b(D),w(D),b6t(D),D}m.update=function(D){return b6t(D),D},m.nodeId=function(D){return arguments.length?(s=typeof D=="function"?D:UA(D),m):s},m.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:UA(D),m):l},m.nodeSort=function(D){return arguments.length?(u=D,m):u},m.nodeWidth=function(D){return arguments.length?(i=+D,m):i},m.nodePadding=function(D){return arguments.length?(a=o=+D,m):a},m.nodes=function(D){return arguments.length?(h=typeof D=="function"?D:UA(D),m):h},m.links=function(D){return arguments.length?(f=typeof D=="function"?D:UA(D),m):f},m.linkSort=function(D){return arguments.length?(d=D,m):d},m.size=function(D){return arguments.length?(e=t=0,r=+D[0],n=+D[1],m):[r-e,n-t]},m.extent=function(D){return arguments.length?(e=+D[0][0],r=+D[1][0],t=+D[0][1],n=+D[1][1],m):[[e,t],[r,n]]},m.iterations=function(D){return arguments.length?(p=+D,m):p};function g({nodes:D,links:M}){for(let[_,B]of D.entries())B.index=_,B.sourceLinks=[],B.targetLinks=[];let O=new Map(D.map((_,B)=>[s(_,B,D),_]));for(let[_,B]of M.entries()){B.index=_;let{source:F,target:G}=B;typeof F!="object"&&(F=B.source=v6t(O,F)),typeof G!="object"&&(G=B.target=v6t(O,G)),F.sourceLinks.push(B),G.targetLinks.push(B)}if(d!=null)for(let{sourceLinks:_,targetLinks:B}of D)_.sort(d),B.sort(d)}function y({nodes:D}){for(let M of D)M.value=M.fixedValue===void 0?Math.max(AA(M.sourceLinks,Jwe),AA(M.targetLinks,Jwe)):M.fixedValue}function v({nodes:D}){let M=D.length,O=new Set(D),_=new Set,B=0;for(;O.size;){for(let F of O){F.depth=B;for(let{target:G}of F.sourceLinks)_.add(G)}if(++B>M)throw new Error("circular link");O=_,_=new Set}}function b({nodes:D}){let M=D.length,O=new Set(D),_=new Set,B=0;for(;O.size;){for(let F of O){F.height=B;for(let{source:G}of F.targetLinks)_.add(G)}if(++B>M)throw new Error("circular link");O=_,_=new Set}}function x({nodes:D}){let M=yD(D,B=>B.depth)+1,O=(r-e-i)/(M-1),_=new Array(M);for(let B of D){let F=Math.max(0,Math.min(M-1,Math.floor(l.call(null,B,M))));B.layer=F,B.x0=e+F*O,B.x1=B.x0+i,_[F]?_[F].push(B):_[F]=[B]}if(u)for(let B of _)B.sort(u);return _}function E(D){let M=SA(D,O=>(n-t-(O.length-1)*o)/AA(O,Jwe));for(let O of D){let _=t;for(let B of O){B.y0=_,B.y1=_+B.value*M,_=B.y1+o;for(let F of B.sourceLinks)F.width=F.value*M}_=(n-_+o)/(O.length+1);for(let B=0;BO.length)-1)),E(M);for(let O=0;O0))continue;let $=(z/V-G.y0)*M;G.y0+=$,G.y1+=$,L(G)}u===void 0&&F.sort(D$),S(F,O)}}function C(D,M,O){for(let _=D.length,B=_-2;B>=0;--B){let F=D[B];for(let G of F){let z=0,V=0;for(let{target:Z,value:re}of G.sourceLinks){let Q=re*(Z.layer-G.layer);z+=P(G,Z)*Q,V+=Q}if(!(V>0))continue;let $=(z/V-G.y0)*M;G.y0+=$,G.y1+=$,L(G)}u===void 0&&F.sort(D$),S(F,O)}}function S(D,M){let O=D.length>>1,_=D[O];U(D,_.y0-o,O-1,M),R(D,_.y1+o,O+1,M),U(D,n,D.length-1,M),R(D,t,0,M)}function R(D,M,O,_){for(;O1e-6&&(B.y0+=F,B.y1+=F),M=B.y1+o}}function U(D,M,O,_){for(;O>=0;--O){let B=D[O],F=(B.y1-M)*_;F>1e-6&&(B.y0-=F,B.y1-=F),M=B.y0-o}}function L({sourceLinks:D,targetLinks:M}){if(d===void 0){for(let{source:{sourceLinks:O}}of M)O.sort(y6t);for(let{target:{targetLinks:O}}of D)O.sort(g6t)}}function I(D){if(d===void 0)for(let{sourceLinks:M,targetLinks:O}of D)M.sort(y6t),O.sort(g6t)}function A(D,M){let O=D.y0-(D.sourceLinks.length-1)*o/2;for(let{target:_,width:B}of D.sourceLinks){if(_===M)break;O+=B+o}for(let{source:_,width:B}of M.targetLinks){if(_===D)break;O-=B}return O}function P(D,M){let O=M.y0-(M.targetLinks.length-1)*o/2;for(let{source:_,width:B}of M.targetLinks){if(_===D)break;O+=B+o}for(let{target:_,width:B}of D.sourceLinks){if(_===M)break;O-=B}return O}return m}var x6t=H(()=>{Xwe();Qwe();m6t()});function r5e(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function w6t(){return new r5e}var e5e,t5e,C6,_Dr,n5e,E6t=H(()=>{e5e=Math.PI,t5e=2*e5e,C6=1e-6,_Dr=t5e-C6;r5e.prototype=w6t.prototype={constructor:r5e,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(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,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,r,n,i){e=+e,t=+t,r=+r,n=+n,i=+i;var a=this._x1,o=this._y1,s=r-e,l=n-t,u=a-e,d=o-t,h=u*u+d*d;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>C6)if(!(Math.abs(d*s-l*u)>C6)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var f=r-a,p=n-o,m=s*s+l*l,g=f*f+p*p,y=Math.sqrt(m),v=Math.sqrt(h),b=i*Math.tan((e5e-Math.acos((m+h-g)/(2*y*v)))/2),x=b/v,E=b/y;Math.abs(x-1)>C6&&(this._+="L"+(e+x*u)+","+(t+x*d)),this._+="A"+i+","+i+",0,0,"+ +(d*f>u*p)+","+(this._x1=e+E*s)+","+(this._y1=t+E*l)}},arc:function(e,t,r,n,i,a){e=+e,t=+t,r=+r,a=!!a;var o=r*Math.cos(n),s=r*Math.sin(n),l=e+o,u=t+s,d=1^a,h=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>C6||Math.abs(this._y1-u)>C6)&&(this._+="L"+l+","+u),r&&(h<0&&(h=h%t5e+t5e),h>_Dr?this._+="A"+r+","+r+",0,1,"+d+","+(e-o)+","+(t-s)+"A"+r+","+r+",0,1,"+d+","+(this._x1=l)+","+(this._y1=u):h>C6&&(this._+="A"+r+","+r+",0,"+ +(h>=e5e)+","+d+","+(this._x1=e+r*Math.cos(i))+","+(this._y1=t+r*Math.sin(i))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};n5e=w6t});var T6t=H(()=>{E6t()});function i5e(e){return function(){return e}}var k6t=H(()=>{});function C6t(e){return e[0]}function S6t(e){return e[1]}var A6t=H(()=>{});var U6t,I6t=H(()=>{U6t=Array.prototype.slice});function PDr(e){return e.source}function ODr(e){return e.target}function BDr(e){var t=PDr,r=ODr,n=C6t,i=S6t,a=null;function o(){var s,l=U6t.call(arguments),u=t.apply(this,l),d=r.apply(this,l);if(a||(a=s=n5e()),e(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=d,l)),+i.apply(this,l)),s)return a=null,s+""||null}return o.source=function(s){return arguments.length?(t=s,o):t},o.target=function(s){return arguments.length?(r=s,o):r},o.x=function(s){return arguments.length?(n=typeof s=="function"?s:i5e(+s),o):n},o.y=function(s){return arguments.length?(i=typeof s=="function"?s:i5e(+s),o):i},o.context=function(s){return arguments.length?(a=s??null,o):a},o}function FDr(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function a5e(){return BDr(FDr)}var R6t=H(()=>{T6t();I6t();k6t();A6t()});var M6t=H(()=>{R6t()});function zDr(e){return[e.source.x1,e.y0]}function GDr(e){return[e.target.x0,e.y1]}function o5e(){return a5e().source(zDr).target(GDr)}var L6t=H(()=>{M6t()});var D6t=H(()=>{x6t();Qwe();L6t()});var _6t={};gr(_6t,{diagram:()=>aNr});var s5e,_$,O$,B$,P$,WDr,VDr,HDr,qDr,YDr,jDr,XDr,$Dr,KDr,N6t,ZDr,QDr,JDr,eNr,tNr,rNr,nNr,iNr,aNr,P6t=H(()=>{Wr();Gr();xr();_n();D6t();s5e=(function(){var e=k(function(s,l,u,d){for(u=u||{},d=s.length;d--;u[s[d]]=l);return u},"o"),t=[1,9],r=[1,10],n=[1,5,10,12],i={trace:k(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:k(function(l,u,d,h,f,p,m){var g=p.length-1;switch(f){case 7:let y=h.findOrCreateNode(p[g-4].trim().replaceAll('""','"')),v=h.findOrCreateNode(p[g-2].trim().replaceAll('""','"')),b=parseFloat(p[g].trim());h.addLink(y,v,b);break;case 8:case 9:case 11:this.$=p[g];break;case 10:this.$=p[g-1];break}},"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:r},{1:[2,6],7:11,10:[1,12]},e(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(n,[2,8]),e(n,[2,9]),{19:[1,16]},e(n,[2,11]),{1:[2,1]},{1:[2,5]},e(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:r},{15:18,16:7,17:8,18:t,20:r},{18:[1,19]},e(r,[2,3]),{12:[1,20]},e(n,[2,10]),{15:21,16:7,17:8,18:t,20:r},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:k(function(l,u){if(u.recoverable)this.trace(l);else{var d=new Error(l);throw d.hash=u,d}},"parseError"),parse:k(function(l){var u=this,d=[0],h=[],f=[null],p=[],m=this.table,g="",y=0,v=0,b=0,x=2,E=1,w=p.slice.call(arguments,1),T=Object.create(this.lexer),C={yy:{}};for(var S in this.yy)Object.prototype.hasOwnProperty.call(this.yy,S)&&(C.yy[S]=this.yy[S]);T.setInput(l,C.yy),C.yy.lexer=T,C.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var R=T.yylloc;p.push(R);var U=T.options&&T.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(Z){d.length=d.length-2*Z,f.length=f.length-Z,p.length=p.length-Z}k(L,"popStack");function I(){var Z;return Z=h.pop()||T.lex()||E,typeof Z!="number"&&(Z instanceof Array&&(h=Z,Z=h.pop()),Z=u.symbols_[Z]||Z),Z}k(I,"lex");for(var A,P,D,M,O,_,B={},F,G,z,V;;){if(D=d[d.length-1],this.defaultActions[D]?M=this.defaultActions[D]:((A===null||typeof A>"u")&&(A=I()),M=m[D]&&m[D][A]),typeof M>"u"||!M.length||!M[0]){var $="";V=[];for(F in m[D])this.terminals_[F]&&F>x&&V.push("'"+this.terminals_[F]+"'");T.showPosition?$="Parse error on line "+(y+1)+`: -`+T.showPosition()+` -Expecting `+V.join(", ")+", got '"+(this.terminals_[A]||A)+"'":$="Parse error on line "+(y+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError($,{text:T.match,token:this.terminals_[A]||A,line:T.yylineno,loc:R,expected:V})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+A);switch(M[0]){case 1:d.push(A),f.push(T.yytext),p.push(T.yylloc),d.push(M[1]),A=null,P?(A=P,P=null):(v=T.yyleng,g=T.yytext,y=T.yylineno,R=T.yylloc,b>0&&b--);break;case 2:if(G=this.productions_[M[1]][1],B.$=f[f.length-G],B._$={first_line:p[p.length-(G||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(G||1)].first_column,last_column:p[p.length-1].last_column},U&&(B._$.range=[p[p.length-(G||1)].range[0],p[p.length-1].range[1]]),_=this.performAction.apply(B,[g,v,y,C.yy,M[1],f,p].concat(w)),typeof _<"u")return _;G&&(d=d.slice(0,-1*G*2),f=f.slice(0,-1*G),p=p.slice(0,-1*G)),d.push(this.productions_[M[1]][0]),f.push(B.$),p.push(B._$),z=m[d[d.length-2]][d[d.length-1]],d.push(z);break;case 3:return!0}}return!0},"parse")},a=(function(){var s={EOF:1,parseError:k(function(u,d){if(this.yy.parser)this.yy.parser.parseError(u,d);else throw new Error(u)},"parseError"),setInput:k(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:k(function(l){var u=l.length,d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===h.length?this.yylloc.first_column:0)+h[h.length-d.length].length-d[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(l){this.unput(this.match.slice(l))},"less"),pastInput:k(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` -`+u+"^"},"showPosition"),test_match:k(function(l,u){var d,h,f;if(this.options.backtrack_lexer&&(f={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&&(f.yylloc.range=this.yylloc.range.slice(0))),h=l[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,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(l[0].length),this.matched+=l[0],d=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,d,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=d,h=p,this.options.backtrack_lexer){if(l=this.test_match(d,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[h]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var u=this.next();return u||this.lex()},"lex"),begin:k(function(u){this.conditionStack.push(u)},"begin"),popState:k(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:k(function(u){this.begin(u)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(u,d,h,f){var p=f;switch(h){case 0:return this.pushState("csv"),4;break;case 1:return this.pushState("csv"),4;break;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;break;case 6:return 20;case 7:return this.popState("escaped_text"),18;break;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return s})();i.lexer=a;function o(){this.yy={}}return k(o,"Parser"),o.prototype=i,i.Parser=o,new o})();s5e.parser=s5e;_$=s5e,O$=[],B$=[],P$=new Map,WDr=k(()=>{O$=[],B$=[],P$=new Map,$r()},"clear"),VDr=class{constructor(e,t,r=0){this.source=e,this.target=t,this.value=r}static{k(this,"SankeyLink")}},HDr=k((e,t,r)=>{O$.push(new VDr(e,t,r))},"addLink"),qDr=class{constructor(e){this.ID=e}static{k(this,"SankeyNode")}},YDr=k(e=>{e=Lt.sanitizeText(e,je());let t=P$.get(e);return t===void 0&&(t=new qDr(e),P$.set(e,t),B$.push(t)),t},"findOrCreateNode"),jDr=k(()=>B$,"getNodes"),XDr=k(()=>O$,"getLinks"),$Dr=k(()=>({nodes:B$.map(e=>({id:e.ID})),links:O$.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),"getGraph"),KDr={nodesMap:P$,getConfig:k(()=>je().sankey,"getConfig"),getNodes:jDr,getLinks:XDr,getGraph:$Dr,addLink:HDr,findOrCreateNode:YDr,getAccTitle:pn,setAccTitle:sn,getAccDescription:gn,setAccDescription:mn,getDiagramTitle:yn,setDiagramTitle:Sn,clear:WDr},N6t=class l5e{static{k(this,"Uid")}static{this.count=0}static next(t){return new l5e(t+ ++l5e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},ZDr={left:$we,right:Kwe,center:Zwe,justify:vD},QDr=k(e=>{let t=0,r=0;for(let n of e){let i=n.value??0;i>t&&(t=i,r=n.layer??0)}return r},"findCentralNodeLayer"),JDr=k(function(e,t,r,n){let{securityLevel:i,sankey:a}=je(),o=vz.sankey,s;i==="sandbox"&&(s=xt("#i"+t));let l=i==="sandbox"?xt(s.nodes()[0].contentDocument.body):xt("body"),u=i==="sandbox"?l.select(`[id="${t}"]`):xt(`[id="${t}"]`),d=a?.width??o.width,h=a?.height??o.width,f=a?.useMaxWidth??o.useMaxWidth,p=a?.nodeAlignment??o.nodeAlignment,m=a?.prefix??o.prefix,g=a?.suffix??o.suffix,y=a?.showValues??o.showValues,v=a?.nodeWidth??o.nodeWidth??10,b=a?.nodePadding??o.nodePadding??12,x=a?.labelStyle??o.labelStyle??"legacy",E=a?.nodeColors??{},w=n.db.getGraph(),T=ZDr[p];N$().nodeId(_=>_.id).nodeWidth(v).nodePadding(b+(y?15:0)).nodeAlign(T).extent([[0,0],[d,h]])(w);let S=QDr(w.nodes),R=kh(nce),U=k(_=>E[_]??R(_),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(w.nodes).join("g").attr("class","node").attr("id",_=>(_.uid=N6t.next("node-")).id).attr("transform",function(_){return"translate("+_.x0+","+_.y0+")"}).attr("x",_=>_.x0).attr("y",_=>_.y0).append("rect").attr("height",_=>_.y1-_.y0).attr("width",_=>_.x1-_.x0).attr("fill",_=>U(_.id));let L=k(({id:_,value:B})=>y?`${_} -${m}${Math.round(B*100)/100}${g}`:_,"getText"),I=k(_=>x==="outlined"?(_.layer??0)A.selectAll(_?`.${_}`:"text").data(w.nodes).join("text").attr("class",_??null).attr("x",B=>I(B).x).attr("y",B=>(B.y1+B.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",B=>I(B).anchor).text(L),"appendLabel");x==="outlined"?(P("sankey-label-bg"),P("sankey-label-fg")):P();let D=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(w.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),M=a?.linkColor??"gradient";if(M==="gradient"){let _=D.append("linearGradient").attr("id",B=>(B.uid=N6t.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",B=>B.source.x1).attr("x2",B=>B.target.x0);_.append("stop").attr("offset","0%").attr("stop-color",B=>U(B.source.id)),_.append("stop").attr("offset","100%").attr("stop-color",B=>U(B.target.id))}let O;switch(M){case"gradient":O=k(_=>_.uid,"coloring");break;case"source":O=k(_=>U(_.source.id),"coloring");break;case"target":O=k(_=>U(_.target.id),"coloring");break;default:O=M}D.append("path").attr("d",o5e()).attr("stroke",O).attr("stroke-width",_=>Math.max(1,_.width)),qm(void 0,u,0,f)},"draw"),eNr={draw:JDr},tNr=k(e=>e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),rNr=k(e=>`.label { - font-family: ${e.fontFamily}; - } - - .node-labels { - font-family: ${e.fontFamily}; - } - - /* Outlined label style - background stroke for better readability */ - .sankey-label-bg { - stroke: ${e.mainBkg||e.background||"#fff"}; - stroke-width: 4px; - stroke-linejoin: round; - paint-order: stroke; - } - - /* Foreground label text */ - .sankey-label-fg { - fill: ${e.textColor}; - } - - /* Node styling */ - .node rect { - shape-rendering: crispEdges; - } - - /* Link styling */ - .link { - fill: none; - stroke-opacity: 0.5; - mix-blend-mode: multiply; - } -`,"getStyles"),nNr=rNr,iNr=_$.parse.bind(_$);_$.parse=e=>iNr(tNr(e));aNr={styles:nNr,parser:_$,db:KDr,renderer:eNr}});var F6t={};gr(F6t,{diagram:()=>mNr});var oNr,O6t,sNr,lNr,cNr,B6t,uNr,dNr,hNr,fNr,pNr,mNr,z6t=H(()=>{_u();cs();Vn();Wr();Gr();xr();yc();oNr=Xr.packet,O6t=class{constructor(){this.packet=[],this.setAccTitle=sn,this.getAccTitle=pn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getAccDescription=gn,this.setAccDescription=mn}static{k(this,"PacketDB")}getConfig(){let e=Kn({...oNr,...Kt().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){$r(),this.packet=[]}},sNr=1e4,lNr=k((e,t)=>{ra(e,t);let r=-1,n=[],i=1,{bitsPerRow:a}=t.getConfig();for(let{start:o,end:s,bits:l,label:u}of e.blocks){if(o!==void 0&&s!==void 0&&s{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];let n=t*r-1,i=t*r;return[{start:e.start,end:n,label:e.label,bits:n-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),B6t={parser:{yy:void 0},parse:k(async e=>{let t=await Lo("packet",e),r=B6t.parser?.yy;if(!(r instanceof O6t))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ye.debug(t),lNr(t,r)},"parse")},uNr=k((e,t,r,n)=>{let i=n.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),h=i.getDiagramTitle(),f=o+s,p=f*(d.length+1)-(h?0:o),m=l*u+2,g=Mi(t);g.attr("viewBox",`0 0 ${m} ${p}`),zn(g,p,m,a.useMaxWidth);for(let[y,v]of d.entries())dNr(g,v,y,a);g.append("text").text(h).attr("x",m/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),dNr=k((e,t,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{let u=e.append("g"),d=r*(n+a)+a;for(let h of t){let f=h.start%s*o+1,p=(h.end-h.start+1)*o-i;if(u.append("rect").attr("x",f).attr("y",d).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",d+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(h.label),!l)continue;let m=h.end===h.start,g=d-2;u.append("text").attr("x",f+(m?p/2:0)).attr("y",g).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",m?"middle":"start").text(h.start),m||u.append("text").attr("x",f+p).attr("y",g).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(h.end)}},"drawWord"),hNr={draw:uNr},fNr={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},pNr=k(({packet:e}={})=>{let t=Kn(fNr,e);return` - .packetByte { - font-size: ${t.byteFontSize}; - } - .packetByte.start { - fill: ${t.startByteColor}; - } - .packetByte.end { - fill: ${t.endByteColor}; - } - .packetLabel { - fill: ${t.labelColor}; - font-size: ${t.labelFontSize}; - } - .packetTitle { - fill: ${t.titleColor}; - font-size: ${t.titleFontSize}; - } - .packetBlock { - stroke: ${t.blockStrokeColor}; - stroke-width: ${t.blockStrokeWidth}; - fill: ${t.blockFillColor}; - } - `},"styles"),mNr={parser:B6t,get db(){return new O6t},renderer:hNr,styles:pNr}});var j6t={};gr(j6t,{diagram:()=>_Nr});function V6t(e,t,r,n,i,a,o){let s=t.length,l=Math.min(o.width,o.height)/2;r.forEach((u,d)=>{if(u.entries.length!==s)return;let h=u.entries.map((f,p)=>{let m=2*Math.PI*p/s-Math.PI/2,g=H6t(f,n,i,l),y=g*Math.cos(m),v=g*Math.sin(m);return{x:y,y:v}});a==="circle"?e.append("path").attr("d",q6t(h,o.curveTension)).attr("class",`radarCurve-${d}`):a==="polygon"&&e.append("polygon").attr("points",h.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${d}`)})}function H6t(e,t,r,n){let i=Math.min(Math.max(e,t),r);return n*(i-t)/(r-t)}function q6t(e,t){let r=e.length,n=`M${e[0].x},${e[0].y}`;for(let i=0;i{let u=e.append("g").attr("transform",`translate(${i}, ${a+l*o})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}var IA,F$,G6t,Jg,gNr,yNr,W6t,vNr,bNr,xNr,wNr,ENr,TNr,kNr,bD,CNr,SNr,ANr,UNr,INr,RNr,MNr,LNr,DNr,NNr,_Nr,X6t=H(()=>{_u();cs();Vn();Wr();Gr();xr();yc();IA={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},F$=32,G6t={axes:[],curves:[],options:IA},Jg=structuredClone(G6t),gNr=Xr.radar,yNr=k(()=>Kn({...gNr,...Kt().radar}),"getConfig"),W6t=k(()=>Jg.axes,"getAxes"),vNr=k(()=>Jg.curves,"getCurves"),bNr=k(()=>Jg.options,"getOptions"),xNr=k(e=>{Jg.axes=e.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),wNr=k(e=>{Jg.curves=e.map(t=>({name:t.name,label:t.label??t.name,entries:ENr(t.entries)}))},"setCurves"),ENr=k(e=>{if(e[0].axis==null)return e.map(r=>r.value);let t=W6t();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(r=>{let n=e.find(i=>i.axis?.$refText===r.name);if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),TNr=k(e=>{let t=e.reduce((r,n)=>(r[n.name]=n,r),{});Jg.options={showLegend:t.showLegend?.value??IA.showLegend,ticks:t.ticks?.value??IA.ticks,max:t.max?.value??IA.max,min:t.min?.value??IA.min,graticule:t.graticule?.value??IA.graticule},Jg.options.ticks>F$&&(ye.warn(`Radar diagram ticks (${Jg.options.ticks}) exceeds maximum allowed (${F$}). Using ${F$} instead.`),Jg.options.ticks=F$)},"setOptions"),kNr=k(()=>{$r(),Jg=structuredClone(G6t)},"clear"),bD={getAxes:W6t,getCurves:vNr,getOptions:bNr,setAxes:xNr,setCurves:wNr,setOptions:TNr,getConfig:yNr,clear:kNr,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn},CNr=k(e=>{ra(e,bD);let{axes:t,curves:r,options:n}=e;bD.setAxes(t),bD.setCurves(r),bD.setOptions(n)},"populate"),SNr={parse:k(async e=>{let t=await Lo("radar",e);ye.debug(t),CNr(t)},"parse")},ANr=k((e,t,r,n)=>{let i=n.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),d=Mi(t),h=UNr(d,l),f=s.max??Math.max(...o.map(g=>Math.max(...g.entries))),p=s.min,m=Math.min(l.width,l.height)/2;INr(h,a,m,s.ticks,s.graticule),RNr(h,a,m,l),V6t(h,a,o,p,f,s.graticule,l),Y6t(h,o,s.showLegend,l),h.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),UNr=k((e,t)=>{let r=t.width+t.marginLeft+t.marginRight,n=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return zn(e,n,r,t.useMaxWidth??!0),e.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),e.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),INr=k((e,t,r,n,i)=>{if(i==="circle")for(let a=0;a{let h=2*d*Math.PI/a-Math.PI/2,f=s*Math.cos(h),p=s*Math.sin(h);return`${f},${p}`}).join(" ");e.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),RNr=k((e,t,r,n)=>{let i=t.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",h=u>.01?"hanging":u<-.01?"auto":"central",f=4;e.append("text").text(o).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",d).attr("dominant-baseline",h).attr("class","radarAxisLabel")}},"drawAxes");k(V6t,"drawCurves");k(H6t,"relativeRadius");k(q6t,"closedRoundCurve");k(Y6t,"drawLegend");MNr={draw:ANr},LNr=k((e,t)=>{let r="";for(let n=0;n{let t=Bc(),r=Kt(),n=Kn(t,r.themeVariables),i=Kn(n.radar,e);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),NNr=k(({radar:e}={})=>{let{themeVariables:t,radarOptions:r}=DNr(e);return` - .radarTitle { - font-size: ${t.fontSize}; - color: ${t.titleColor}; - dominant-baseline: hanging; - text-anchor: middle; - } - .radarAxisLine { - stroke: ${r.axisColor}; - stroke-width: ${r.axisStrokeWidth}; - } - .radarAxisLabel { - font-size: ${r.axisLabelFontSize}px; - color: ${r.axisColor}; - } - .radarGraticule { - fill: ${r.graticuleColor}; - fill-opacity: ${r.graticuleOpacity}; - stroke: ${r.graticuleColor}; - stroke-width: ${r.graticuleStrokeWidth}; - } - .radarLegendText { - text-anchor: start; - font-size: ${r.legendFontSize}px; - dominant-baseline: hanging; - } - ${LNr(t,r)} - `},"styles"),_Nr={parser:SNr,db:bD,renderer:MNr,styles:NNr}});var hEt={};gr(hEt,{diagram:()=>c_r});function eEt(e){switch(ye.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return ye.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 tEt(e){return ye.debug("typeStr2Type",e),e==="=="?"thick":"normal"}function rEt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function nEt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function iEt(e){return e.includes("==")?"thick":"normal"}function aEt(e){return e.includes(".-")?"dotted":"solid"}function h5e(e,t){if(e===0||!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(e===1)return{px:0,py:t};let r=t%e,n=Math.floor(t/e);return{px:r,py:n}}function G$(e,t,r=0,n=0,i=8){ye.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",r),e?.size?.width||(e.size={width:r,height:n,x:0,y:0});let a=0,o=0;if(e.children?.length>0){for(let m of e.children)G$(m,t,0,0,i);let s=a_r(e);a=s.width,o=s.height,ye.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",a,o);for(let m of e.children)m.size&&(ye.debug(`abc95 Setting size of children of ${e.id} id=${m.id} ${a} ${o} ${JSON.stringify(m.size)}`),m.size.width=a*(m.widthInColumns??1)+i*((m.widthInColumns??1)-1),m.size.height=o,m.size.x=0,m.size.y=0,ye.debug(`abc95 updating size of ${e.id} children child:${m.id} maxWidth:${a} maxHeight:${o}`));for(let m of e.children)G$(m,t,a,o,i);let l=e.columns??-1,u=0;for(let m of e.children)u+=m.widthInColumns??1;let d=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(m>0){let g=(f-m*i-i)/m;ye.debug("abc95 (growing to fit) width",e.id,f,e.size?.width,g);for(let y of e.children)y.size&&(y.size.width=g)}}e.size={width:f,height:p,x:0,y:0}}ye.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function g5e(e,t,r=8){ye.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let n=e.columns??-1;if(ye.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){let i=e?.children[0]?.size?.width??0,a=e.children.length*i+(e.children.length-1)*r;ye.debug("widthOfChildren 88",a,"posX");let o=new Map;{let h=0;for(let f of e.children){if(!f.size)continue;let{py:p}=h5e(n,h),m=o.get(p)??0;f.size.height>m&&o.set(p,f.size.height);let g=f?.widthInColumns??1;n>0&&(g=Math.min(g,n-h%n)),h+=g}}let s=new Map;{let h=0,f=[...o.keys()].sort((p,m)=>p-m);for(let p of f)s.set(p,h),h+=(o.get(p)??0)+r}let l=0;ye.debug("abc91 block?.size?.x",e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let h of e.children){let f=e;if(!h.size)continue;let{width:p,height:m}=h.size,{px:g,py:y}=h5e(n,l);if(y!=d&&(d=y,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,ye.debug("New row in layout for block",e.id," and child ",h.id,d)),ye.debug(`abc89 layout blocks (child) id: ${h.id} Pos: ${l} (px, py) ${g},${y} (${f?.size?.x},${f?.size?.y}) parent: ${f.id} width: ${p}${r}`),f.size){let b=p/2;h.size.x=u+r+b,ye.debug(`abc91 layout blocks (calc) px, pyid:${h.id} startingPos=X${u} new startingPosX${h.size.x} ${b} padding=${r} width=${p} halfWidth=${b} => x:${h.size.x} y:${h.size.y} ${h.widthInColumns} (width * (child?.w || 1)) / 2 ${p*(h?.widthInColumns??1)/2}`),u=h.size.x+b;let x=s.get(y)??0,E=o.get(y)??m;h.size.y=f.size.y-f.size.height/2+x+E/2+r,ye.debug(`abc88 layout blocks (calc) px, pyid:${h.id}startingPosX${u}${r}${b}=>x:${h.size.x}y:${h.size.y}${h.widthInColumns}(width * (child?.w || 1)) / 2${p*(h?.widthInColumns??1)/2}`)}h.children&&g5e(h,t,r);let v=h?.widthInColumns??1;n>0&&(v=Math.min(v,n-l%n)),l+=v,ye.debug("abc88 columnsPos",h,l)}}ye.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function y5e(e,{minX:t,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:a,y:o,width:s,height:l}=e.size;a-s/2n&&(n=a+s/2),o+l/2>i&&(i=o+l/2)}if(e.children)for(let a of e.children)({minX:t,minY:r,maxX:n,maxY:i}=y5e(a,{minX:t,minY:r,maxX:n,maxY:i}));return{minX:t,minY:r,maxX:n,maxY:i}}function oEt(e){let t=e.getBlock("root");if(!t)return;let r=je()?.block?.padding??8;G$(t,e,0,0,r),g5e(t,e,r),ye.debug("getBlocks",JSON.stringify(t,null,2));let{minX:n,minY:i,maxX:a,maxY:o}=y5e(t),s=o-i,l=a-n;return{x:n,y:i,width:l,height:s}}function v5e(e,t,r=!1){let n=e,i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i=i+" flowchart-label";let a=(n?.classes??[]).flatMap(m=>t.getClasses().get(m)?.styles??[]),o=0,s="rect",l;switch(n.type){case"round":o=5,s="rect";break;case"composite":o=0,s="composite",l=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":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"rect_left_inv_arrow":s="rect_left_inv_arrow";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"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}let u=lW(n?.styles??[]),d=n.label,h=n.size??{width:0,height:0,x:0,y:0},f=t.getDiagramId();return{labelStyle:u.labelStyle,shape:s,label:d,labelText:d,rx:o,ry:o,class:i,cssClasses:i,cssStyles:n?.styles??[],cssCompiledStyles:a,style:u.style,id:n.id,domId:f?`${f}-${n.id}`:n.id,isGroup:!1,directions:n.directions,width:h.width||void 0,height:h.height||void 0,wrappingWidth:h.width||Number.POSITIVE_INFINITY,x:h.x,y:h.y,positioned:r,intersect:void 0,padding:l??Kt()?.block?.padding??0,widthInColumns:n.widthInColumns??1}}async function sEt(e,t,r){let n=v5e(t,r,!1);if(t.type==="group")return;let i=Kt(),a=await sg(e,n,{config:i}),o=a.node()?.getBBox()??{width:0,height:0},s=r.getBlock(n.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},r.setBlock(s),a.remove()}async function lEt(e,t,r){let n=v5e(t,r,!0);if(r.getBlock(n.id).type!=="space"){let a=Kt();await sg(e,n,{config:a}),t.intersect=n?.intersect,lg(n)}}async function W$(e,t,r,n){for(let i of t)await n(e,i,r),i.children&&await W$(e,i.children,r,n)}async function cEt(e,t,r){await W$(e,t,r,sEt)}async function uEt(e,t,r){await W$(e,t,r,lEt)}async function dEt(e,t,r,n,i){let a=new qi({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let o of r)o.size&&a.setNode(o.id,{width:o.size.width,height:o.size.height,intersect:o.intersect});for(let o of t)if(o.start&&o.end){let s=n.getBlock(o.start),l=n.getBlock(o.end);if(s?.size&&l?.size){let u=s.size,d=l.size,h=[{x:u.x,y:u.y},{x:u.x+(d.x-u.x)/2,y:u.y+(d.y-u.y)/2},{x:d.x,y:d.y}],f=i?`${i}-${o.id}`:o.id,p=o.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",m=o.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",g=`${p} ${m} flowchart-link LS-a1 LE-b1`;S2(e,{...o,id:f,arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:h,classes:g},{},"block",a.node(o.start),a.node(o.end),i),o.label&&(await cg(e,{...o,label:o.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:h,classes:g}),eC({...o,x:h[1].x,y:h[1].y},{originalPath:h}))}}}var u5e,PNr,B0,f5e,d5e,$6t,K6t,ONr,Q6t,z$,p5e,BNr,FNr,zNr,GNr,J6t,m5e,xD,WNr,Z6t,VNr,HNr,qNr,YNr,jNr,XNr,$Nr,KNr,ZNr,QNr,JNr,e_r,t_r,r_r,c5e,n_r,i_r,a_r,o_r,s_r,l_r,c_r,fEt=H(()=>{Dg();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();aW();Ts();_n();Dh();u5e=(function(){var e=k(function(x,E,w,T){for(w=w||{},T=x.length;T--;w[x[T]]=E);return w},"o"),t=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],o=[1,16],s=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],m=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],y={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:k(function(E,w,T,C,S,R,U){var L=R.length-1;switch(S){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",R[L-1]),C.setHierarchy(R[L-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",R[L]),typeof R[L].length=="number"?this.$=R[L]:this.$=[R[L]];break;case 13:C.getLogger().debug("Rule: statement #2: ",R[L-1]),this.$=[R[L-1]].concat(R[L]);break;case 14:C.getLogger().debug("Rule: link: ",R[L],E),this.$={edgeTypeStr:R[L],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",R[L-3],R[L-1],R[L]),this.$={edgeTypeStr:R[L],label:R[L-1]};break;case 18:let I=parseInt(R[L]),A=C.generateId();this.$={id:A,type:"space",label:"",width:I,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",R[L-2],R[L-1],R[L]," typestr: ",R[L-1].edgeTypeStr);let P=C.edgeStrToEdgeData(R[L-1].edgeTypeStr),D=C.edgeStrToEdgeStartData(R[L-1].edgeTypeStr),M=C.edgeStrToThickness(R[L-1].edgeTypeStr),O=C.edgeStrToPattern(R[L-1].edgeTypeStr);this.$=[{id:R[L-2].id,label:R[L-2].label,type:R[L-2].type,directions:R[L-2].directions},{id:R[L-2].id+"-"+R[L].id,start:R[L-2].id,end:R[L].id,label:R[L-1].label,type:"edge",thickness:M,pattern:O,directions:R[L].directions,arrowTypeEnd:P,arrowTypeStart:D},{id:R[L].id,label:R[L].label,type:C.typeStr2Type(R[L].typeStr),directions:R[L].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",R[L-1],R[L]),this.$={id:R[L-1].id,label:R[L-1].label,type:C.typeStr2Type(R[L-1].typeStr),directions:R[L-1].directions,widthInColumns:parseInt(R[L],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",R[L]),this.$={id:R[L].id,label:R[L].label,type:C.typeStr2Type(R[L].typeStr),directions:R[L].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",R[L]),this.$={type:"column-setting",columns:R[L]==="auto"?-1:parseInt(R[L])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",R[L-2],R[L-1]);let _=C.generateId();this.$={...R[L-2],type:"composite",children:R[L-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",R[L-2],R[L-1],R[L]);let B=C.generateId();this.$={id:B,type:"composite",label:"",children:R[L-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",R[L]),this.$={id:R[L]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",R[L-1],R[L]),this.$={id:R[L-1],label:R[L].label,typeStr:R[L].typeStr,directions:R[L].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",R[L]),this.$=[R[L]];break;case 32:C.getLogger().debug("Rule: dirList: ",R[L-1],R[L]),this.$=[R[L-1]].concat(R[L]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",R[L-2],R[L-1],R[L]),this.$={typeStr:R[L-2]+R[L],label:R[L-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",R[L-3],R[L-2]," #3:",R[L-1],R[L]),this.$={typeStr:R[L-3]+R[L],label:R[L-2],directions:R[L-1]};break;case 35:case 36:this.$={type:"classDef",id:R[L-1].trim(),css:R[L].trim()};break;case 37:this.$={type:"applyClass",id:R[L-1].trim(),styleClass:R[L].trim()};break;case 38:this.$={type:"applyStyles",id:R[L-1].trim(),stylesStr:R[L].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:s,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:r,28:n,29:i,31:a,39:o,43:s,46:l}),e(d,[2,16],{14:22,15:h,16:f}),e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,22]),e(p,[2,25],{27:[1,25]}),e(d,[2,26]),{19:26,26:12,31:a},{10:t,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:s,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(m,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},e(p,[2,24]),{10:t,11:37,13:4,14:22,15:h,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:s,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(m,[2,30]),{18:[1,43]},{18:[1,44]},e(p,[2,23]),{18:[1,45]},{30:[1,46]},e(d,[2,28]),e(d,[2,35]),e(d,[2,36]),e(d,[2,37]),e(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},e(d,[2,27]),e(m,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},e(m,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:k(function(E,w){if(w.recoverable)this.trace(E);else{var T=new Error(E);throw T.hash=w,T}},"parseError"),parse:k(function(E){var w=this,T=[0],C=[],S=[null],R=[],U=this.table,L="",I=0,A=0,P=0,D=2,M=1,O=R.slice.call(arguments,1),_=Object.create(this.lexer),B={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(B.yy[F]=this.yy[F]);_.setInput(E,B.yy),B.yy.lexer=_,B.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var G=_.yylloc;R.push(G);var z=_.options&&_.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(Qe){T.length=T.length-2*Qe,S.length=S.length-Qe,R.length=R.length-Qe}k(V,"popStack");function $(){var Qe;return Qe=C.pop()||_.lex()||M,typeof Qe!="number"&&(Qe instanceof Array&&(C=Qe,Qe=C.pop()),Qe=w.symbols_[Qe]||Qe),Qe}k($,"lex");for(var Z,re,Q,ge,ie,pe,ue={},fe,Me,Ce,Ye;;){if(Q=T[T.length-1],this.defaultActions[Q]?ge=this.defaultActions[Q]:((Z===null||typeof Z>"u")&&(Z=$()),ge=U[Q]&&U[Q][Z]),typeof ge>"u"||!ge.length||!ge[0]){var Ze="";Ye=[];for(fe in U[Q])this.terminals_[fe]&&fe>D&&Ye.push("'"+this.terminals_[fe]+"'");_.showPosition?Ze="Parse error on line "+(I+1)+`: -`+_.showPosition()+` -Expecting `+Ye.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":Ze="Parse error on line "+(I+1)+": Unexpected "+(Z==M?"end of input":"'"+(this.terminals_[Z]||Z)+"'"),this.parseError(Ze,{text:_.match,token:this.terminals_[Z]||Z,line:_.yylineno,loc:G,expected:Ye})}if(ge[0]instanceof Array&&ge.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Z);switch(ge[0]){case 1:T.push(Z),S.push(_.yytext),R.push(_.yylloc),T.push(ge[1]),Z=null,re?(Z=re,re=null):(A=_.yyleng,L=_.yytext,I=_.yylineno,G=_.yylloc,P>0&&P--);break;case 2:if(Me=this.productions_[ge[1]][1],ue.$=S[S.length-Me],ue._$={first_line:R[R.length-(Me||1)].first_line,last_line:R[R.length-1].last_line,first_column:R[R.length-(Me||1)].first_column,last_column:R[R.length-1].last_column},z&&(ue._$.range=[R[R.length-(Me||1)].range[0],R[R.length-1].range[1]]),pe=this.performAction.apply(ue,[L,A,I,B.yy,ge[1],S,R].concat(O)),typeof pe<"u")return pe;Me&&(T=T.slice(0,-1*Me*2),S=S.slice(0,-1*Me),R=R.slice(0,-1*Me)),T.push(this.productions_[ge[1]][0]),S.push(ue.$),R.push(ue._$),Ce=U[T[T.length-2]][T[T.length-1]],T.push(Ce);break;case 3:return!0}}return!0},"parse")},v=(function(){var x={EOF:1,parseError:k(function(w,T){if(this.yy.parser)this.yy.parser.parseError(w,T);else throw new Error(w)},"parseError"),setInput:k(function(E,w){return this.yy=w||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:k(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var w=E.match(/(?:\r\n?|\n).*/g);return w?(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:k(function(E){var w=E.length,T=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1&&(this.yylineno-=T.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===C.length?this.yylloc.first_column:0)+C[C.length-T.length].length-T[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(E){this.unput(this.match.slice(E))},"less"),pastInput:k(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:k(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:k(function(){var E=this.pastInput(),w=new Array(E.length+1).join("-");return E+this.upcomingInput()+` -`+w+"^"},"showPosition"),test_match:k(function(E,w){var T,C,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),C=E[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],T=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var R in S)this[R]=S[R];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,w,T,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),R=0;Rw[0].length)){if(w=T,C=R,this.options.backtrack_lexer){if(E=this.test_match(T,S[R]),E!==!1)return E;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(E=this.test_match(w,S[C]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var w=this.next();return w||this.lex()},"lex"),begin:k(function(w){this.conditionStack.push(w)},"begin"),popState:k(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:k(function(w){this.begin(w)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(w,T,C,S){var R=S;switch(C){case 0:return w.getLogger().debug("Found block-beta"),10;break;case 1:return w.getLogger().debug("Found id-block"),29;break;case 2:return w.getLogger().debug("Found block"),10;break;case 3:w.getLogger().debug(".",T.yytext);break;case 4:w.getLogger().debug("_",T.yytext);break;case 5:return 5;case 6:return T.yytext=-1,28;break;case 7:return T.yytext=T.yytext.replace(/columns\s+/,""),w.getLogger().debug("COLUMNS (LEX)",T.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:w.getLogger().debug("LEX: POPPING STR:",T.yytext),this.popState();break;case 13:return w.getLogger().debug("LEX: STR end:",T.yytext),"STR";break;case 14:return T.yytext=T.yytext.replace(/space\:/,""),w.getLogger().debug("SPACE NUM (LEX)",T.yytext),21;break;case 15:return T.yytext="1",w.getLogger().debug("COLUMNS (LEX)",T.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),w.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),w.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),w.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),w.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),w.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),w.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),w.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),w.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),w.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),w.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),w.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),w.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),w.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return w.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return w.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return w.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return w.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return w.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return w.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return w.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return w.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),w.getLogger().debug("LEX ARR START"),37;break;case 74:return w.getLogger().debug("Lex: NODE_ID",T.yytext),31;break;case 75:return w.getLogger().debug("Lex: EOF",T.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:w.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:w.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return w.getLogger().debug("LEX: NODE_DESCR:",T.yytext),"NODE_DESCR";break;case 83:w.getLogger().debug("LEX POPPING"),this.popState();break;case 84:w.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (right): dir:",T.yytext),"DIR";break;case 86:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (left):",T.yytext),"DIR";break;case 87:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (x):",T.yytext),"DIR";break;case 88:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (y):",T.yytext),"DIR";break;case 89:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (up):",T.yytext),"DIR";break;case 90:return T.yytext=T.yytext.replace(/^,\s*/,""),w.getLogger().debug("Lex (down):",T.yytext),"DIR";break;case 91:return T.yytext="]>",w.getLogger().debug("Lex (ARROW_DIR end):",T.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return w.getLogger().debug("Lex: LINK","#"+T.yytext+"#"),15;break;case 93:return w.getLogger().debug("Lex: LINK",T.yytext),15;break;case 94:return w.getLogger().debug("Lex: LINK",T.yytext),15;break;case 95:return w.getLogger().debug("Lex: LINK",T.yytext),15;break;case 96:return w.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;break;case 97:return w.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;break;case 98:return w.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return w.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),w.getLogger().debug("Lex: LINK","#"+T.yytext+"#"),15;break;case 102:return this.popState(),w.getLogger().debug("Lex: LINK",T.yytext),15;break;case 103:return this.popState(),w.getLogger().debug("Lex: LINK",T.yytext),15;break;case 104:return w.getLogger().debug("Lex: COLON",T.yytext),T.yytext=T.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\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:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return x})();y.lexer=v;function b(){this.yy={}}return k(b,"Parser"),b.prototype=y,y.Parser=b,new b})();u5e.parser=u5e;PNr=u5e,B0=new Map,f5e=[],d5e=new Map,$6t="color",K6t="fill",ONr="bgFill",Q6t=",",z$=new Map,p5e="",BNr=k(e=>Lt.sanitizeText(e,je()),"sanitizeText"),FNr=k(function(e,t=""){let r=z$.get(e);r||(r={id:e,styles:[],textStyles:[]},z$.set(e,r)),t?.split(Q6t).forEach(n=>{let i=n.replace(/([^;]*);/,"$1").trim();if(RegExp($6t).exec(n)){let o=i.replace(K6t,ONr).replace($6t,K6t);r.textStyles.push(o)}r.styles.push(i)})},"addStyleClass"),zNr=k(function(e,t=""){let r=B0.get(e);t!=null&&(r.styles=t.split(Q6t))},"addStyle2Node"),GNr=k(function(e,t){e.split(",").forEach(function(r){let n=B0.get(r);if(n===void 0){let i=r.trim();n={id:i,type:"na",children:[]},B0.set(i,n)}n.classes||(n.classes=[]),n.classes.push(t)})},"setCssClass"),J6t=k((e,t)=>{let r=e.flat(),n=[],a=r.find(o=>o?.type==="column-setting")?.columns??-1;for(let o of r){if(typeof a=="number"&&a>0&&o.type!=="column-setting"&&typeof o.widthInColumns=="number"&&o.widthInColumns>a&&ye.warn(`Block ${o.id} width ${o.widthInColumns} exceeds configured column width ${a}`),o.label&&(o.label=BNr(o.label)),o.type==="classDef"){FNr(o.id,o.css);continue}if(o.type==="applyClass"){GNr(o.id,o?.styleClass??"");continue}if(o.type==="applyStyles"){o?.stylesStr&&zNr(o.id,o?.stylesStr);continue}if(o.type==="column-setting")t.columns=o.columns??-1;else if(o.type==="edge"){let s=(d5e.get(o.id)??0)+1;d5e.set(o.id,s),o.id=s+"-"+o.id,f5e.push(o)}else{o.label||(o.type==="composite"?o.label="":o.label=o.id);let s=B0.get(o.id);if(s===void 0?B0.set(o.id,o):(o.type!=="na"&&(s.type=o.type),o.label!==o.id&&(s.label=o.label)),o.children&&J6t(o.children,o),o.type==="space"){let l=o.width??1;for(let u=0;u{ye.debug("Clear called"),$r(),xD={id:"root",type:"composite",children:[],columns:-1},B0=new Map([["root",xD]]),m5e=[],z$=new Map,f5e=[],d5e=new Map,p5e=""},"clear");k(eEt,"typeStr2Type");k(tEt,"edgeTypeStr2Type");k(rEt,"edgeStrToEdgeData");k(nEt,"edgeStrToEdgeStartData");k(iEt,"edgeStrToThickness");k(aEt,"edgeStrToPattern");Z6t=0,VNr=k(()=>(Z6t++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Z6t),"generateId"),HNr=k(e=>{xD.children=e,J6t(e,xD),m5e=xD.children},"setHierarchy"),qNr=k(e=>{let t=B0.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),YNr=k(()=>[...B0.values()],"getBlocksFlat"),jNr=k(()=>m5e||[],"getBlocks"),XNr=k(()=>f5e,"getEdges"),$Nr=k(e=>B0.get(e),"getBlock"),KNr=k(e=>{B0.set(e.id,e)},"setBlock"),ZNr=k(e=>{p5e=e},"setDiagramId"),QNr=k(()=>p5e,"getDiagramId"),JNr=k(()=>ye,"getLogger"),e_r=k(function(){return z$},"getClasses"),t_r={getConfig:k(()=>Kt().block,"getConfig"),typeStr2Type:eEt,edgeTypeStr2Type:tEt,edgeStrToEdgeData:rEt,edgeStrToEdgeStartData:nEt,edgeStrToThickness:iEt,edgeStrToPattern:aEt,getLogger:JNr,getBlocksFlat:YNr,getBlocks:jNr,getEdges:XNr,setHierarchy:HNr,getBlock:$Nr,setBlock:KNr,getColumns:qNr,getClasses:e_r,clear:WNr,generateId:VNr,setDiagramId:ZNr,getDiagramId:QNr},r_r=t_r,c5e=k((e,t)=>{let r=z5,n=r(e,"r"),i=r(e,"g"),a=r(e,"b");return ls(n,i,a,t)},"fade"),n_r=k(e=>`.label { - font-family: ${e.fontFamily}; - color: ${e.nodeTextColor||e.textColor}; - } - .cluster-label text { - fill: ${e.titleColor}; - } - .cluster-label span { - color: ${e.titleColor}; - } - - - - .label text,span { - fill: ${e.nodeTextColor||e.textColor}; - color: ${e.nodeTextColor||e.textColor}; - } - - .node rect, - .node circle, - .node ellipse, - .node polygon, - .node path { - fill: ${e.mainBkg}; - stroke: ${e.nodeBorder}; - stroke-width: 1px; - } - .flowchart-label text { - text-anchor: middle; - } - // .flowchart-label .text-outer-tspan { - // text-anchor: middle; - // } - // .flowchart-label .text-inner-tspan { - // text-anchor: start; - // } - - .node .label { - text-align: center; - } - .node.clickable { - cursor: pointer; - } - - .arrowheadPath { - fill: ${e.arrowheadColor}; - } - - .edgePaths .path { - stroke: ${e.lineColor}; - stroke-width: 2.0px; - } - - .flowchart-link { - stroke: ${e.lineColor}; - fill: none; - } - - .edgeLabel { - background-color: ${e.edgeLabelBackground}; - /* - * This is for backward compatibility with existing code that didn't - * add a \`

    \` around edge labels. - * - * TODO: We should probably remove this in a future release. - */ - p { - margin: 0; - padding: 0; - display: inline; - } - rect { - opacity: 0.5; - background-color: ${e.edgeLabelBackground}; - fill: ${e.edgeLabelBackground}; - } - text-align: center; - } - - /* For html labels only */ - .labelBkg { - background-color: ${e.edgeLabelBackground}; - } - - .node .cluster { - // fill: ${c5e(e.mainBkg,.5)}; - fill: ${c5e(e.clusterBkg,.5)}; - stroke: ${c5e(e.clusterBorder,.2)}; - box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; - stroke-width: 1px; - } - - .cluster text { - fill: ${e.titleColor}; - } - - .cluster span { - color: ${e.titleColor}; - } - /* .cluster div { - color: ${e.titleColor}; - } */ - - div.mermaidTooltip { - position: absolute; - text-align: center; - max-width: 200px; - padding: 2px; - font-family: ${e.fontFamily}; - font-size: 12px; - background: ${e.tertiaryColor}; - border: 1px solid ${e.border2}; - border-radius: 2px; - pointer-events: none; - z-index: 100; - } - - .flowchartTitleText { - text-anchor: middle; - font-size: 18px; - fill: ${e.textColor}; - } - ${Lg()} -`,"getStyles"),i_r=n_r;k(h5e,"calculateBlockPosition");a_r=k(e=>{let t=0,r=0;for(let n of e.children){let{width:i,height:a,x:o,y:s}=n.size??{width:0,height:0,x:0,y:0};if(ye.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",o,"y:",s,n.type),n.type==="space")continue;let l=i/(n.widthInColumns??1);l>t&&(t=l),a>r&&(r=a)}return{width:t,height:r}},"getMaxChildSize");k(G$,"setBlockSizes");k(g5e,"layoutBlocks");k(y5e,"findBounds");k(oEt,"layout");k(v5e,"getNodeFromBlock");k(sEt,"calculateBlockSize");k(lEt,"insertBlockPositioned");k(W$,"performOperations");k(cEt,"calculateBlockSizes");k(uEt,"insertBlocks");k(dEt,"insertEdges");o_r=k(function(e,t){return t.db.getClasses()},"getClasses"),s_r=k(async function(e,t,r,n){let{securityLevel:i,block:a}=Kt(),o=n.db;o.setDiagramId(t);let s;i==="sandbox"&&(s=xt("#i"+t));let l=i==="sandbox"?xt(s.nodes()[0].contentDocument.body):xt("body"),u=i==="sandbox"?l.select(`[id="${t}"]`):xt(`[id="${t}"]`);tC(u,["point","circle","cross"],n.type,t);let h=o.getBlocks(),f=o.getBlocksFlat(),p=o.getEdges(),m=u.insert("g").attr("class","block");await cEt(m,h,o);let g=oEt(o);await uEt(m,h,o),await dEt(m,p,f,o,t);let y=m.node()?.getBBox(),v=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:g;if(v){let b=Math.max(1,Math.round(.125*(v.width/v.height))),x=v.height+b+10,E=v.width+10,{useMaxWidth:w}=a;zn(u,x,E,!!w),ye.debug("Here Bounds",g,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),l_r={draw:s_r,getClasses:o_r},c_r={parser:PNr,db:r_r,renderer:l_r,styles:i_r}});var CEt={};gr(CEt,{diagram:()=>L_r});function xEt(e){return e.some(t=>vEt.test(t))}function wEt(e){for(let t of e){let r=bEt.exec(t);if(r?.index&&r.index>0)return r.index}return 4}function EEt(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{let i=parseInt(n,10),a=t.get(i);return a?`line ${a}`:r})}function TEt(e){let t=e.split(` -`),r=new Map,n=-1;for(let[l,u]of t.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:e,lineMap:r};let i=[];for(let l=n+1;l0){let i=e.substring(n).toLowerCase(),a=t?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}function x5e(e,t){return e.includes(":")?e:e in wD.icons||!t?`${wD.prefix}:${e}`:`${t}:${e}`}function E5e(e,t){if(e.icon!=="none"){if(e.icon)return x5e(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType==="file"){let r=kEt(e.name,t);if(r==="none")return;if(r)return x5e(r,t.defaultIconPack)}return`${wD.prefix}:${e.nodeType==="directory"?"folder":"file"}`}}}var vEt,bEt,u_r,pEt,mEt,gEt,d_r,e1,h_r,f_r,p_r,m_r,g_r,y_r,v_r,b5e,b_r,x_r,wD,w5e,w_r,E_r,T_r,k_r,yEt,C_r,S_r,A_r,U_r,I_r,R_r,M_r,L_r,SEt=H(()=>{Nq();_u();cs();us();Vn();Wr();Gr();xr();yc();vEt=/[─━│┃└┗├┣]/,bEt=/[└┗├┣]/,u_r=/[─━]/,pEt=/^[\s│┃]+$/,mEt=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,gEt=/^\s*%%/,d_r=" ";k(xEt,"isBoxDrawingFormat");k(wEt,"inferSegmentWidth");k(EEt,"remapErrorLines");k(TEt,"preprocessBoxDrawing");e1=new mS(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),h_r=k(()=>{e1.reset(),$r()},"clear"),f_r=k(()=>e1.records.stack[0],"getRoot"),p_r=k(()=>e1.records.cnt,"getCount"),m_r=Xr.treeView,g_r=k(()=>Kn(m_r,Kt().treeView),"getConfig"),y_r=k((e,t,r,n,i,a)=>{for(;e<=e1.records.stack[e1.records.stack.length-1].level;)e1.records.stack.pop();let o={id:e1.records.cnt++,level:e,name:t,nodeType:r,icon:i,cssClass:n,description:a,children:[]};e1.records.stack[e1.records.stack.length-1].children.push(o),e1.records.stack.push(o)},"addNode"),v_r={clear:h_r,addNode:y_r,getRoot:f_r,getCount:p_r,getConfig:g_r,getAccTitle:pn,getAccDescription:gn,getDiagramTitle:yn,setAccDescription:mn,setAccTitle:sn,setDiagramTitle:Sn},b5e=v_r,b_r=k(e=>{ra(e,b5e);for(let t of e.nodes){let r=typeof t.indent=="number"?t.indent:0,n=t.name,i=n.endsWith("/");i&&(n=n.slice(0,-1));let a=i?"directory":"file",o=t.classAnnotation||void 0,s=t.iconAnnotation,l=s!==void 0?s||"none":void 0,u=t.descAnnotation||void 0,d=u?rn(u,Kt()):void 0;b5e.addNode(r,n,a,o,l,d)}},"populate"),x_r={parse:k(async e=>{let{text:t,lineMap:r}=TEt(e);try{let n=await Lo("treeView",t);ye.debug(n),b_r(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=EEt(n.message,r)),n}},"parse")},wD={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};k(kEt,"detectIcon");k(x5e,"qualifyIcon");k(E5e,"getNodeIcon");Vk([{name:wD.prefix,icons:wD}]);w5e=14,w_r=4,E_r=16,T_r=k(async(e,t)=>{let r=[],n=k(a=>{let o=E5e(a,t);o&&r.push({icon:o,node:a}),a.children.forEach(n)},"collect");n(e);let i=await Promise.all(r.map(async({icon:a,node:o})=>({id:o.id,svg:await Ah(a,{height:w5e,width:w5e})})));return new Map(i.map(({id:a,svg:o})=>[a,o]))},"resolveNodeIcons"),k_r=k((e,t,r,n,i,a)=>{let o=n.append("g"),s="treeView-node-label";r.nodeType==="directory"&&(s+=" treeView-node-dir"),r.cssClass&&(s+=` ${r.cssClass}`);let l=w5e+w_r,u=E5e(r,i),d=u!==void 0;u&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(r.id)??"");let h=o.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",s),{height:f,width:p}=h.node().getBBox(),m=f+i.paddingY*2,g=e+i.paddingX+(d?l:0);h.attr("x",g),h.attr("y",t+m/2);let y=g+p,v=p+i.paddingX*2+(d?l:0);return r.BBox={x:e,y:t,width:v,height:m},r.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",e).attr("y",t+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:o,labelRightEdge:y,centerY:t+m/2}},"positionLabel"),yEt=k((e,t,r,n,i,a)=>e.append("line").attr("x1",t).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),C_r=k((e,t,r,n)=>{let i=0,a=0,o=[],s=k((d,h,f,p)=>{let m=p*(f.rowIndent+f.paddingX),g=k_r(m,i,h,d,f,n);o.push(g);let{height:y,width:v}=h.BBox;yEt(d,m-f.rowIndent,i+y/2,m,i+y/2,f.lineThickness),a=Math.max(a,m+v),i+=y},"drawNode"),l=k((d,h=0)=>{s(e,d,r,h),d.children.forEach(g=>{l(g,h+1)});let{x:f,y:p,height:m}=d.BBox;if(d.children.length){let{y:g,height:y}=d.children[d.children.length-1].BBox;yEt(e,f+r.paddingX,p+m,f+r.paddingX,g+y/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(t);let u=o.filter(d=>d.node.description);if(u.length>0){let h=Math.max(...o.map(f=>f.labelRightEdge))+E_r;for(let f of u){let m=f.nodeGroup.append("text").text(f.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",f.centerY).node().getBBox();a=Math.max(a,h+m.width+r.paddingX)}}for(let d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){let h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){let f=a-d.node.BBox.x+8;h.attr("width",f),a=Math.max(a,d.node.BBox.x+f+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),S_r=k(async(e,t,r,n)=>{ye.debug(`Rendering treeView diagram -`+e);let i=n.db,a=i.getRoot(),o=i.getConfig(),s=Mi(t),l=s.append("g");l.attr("class","tree-view");let u=await T_r(a,o),{totalHeight:d,totalWidth:h}=C_r(l,a,o,u);s.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),zn(s,d,h,o.useMaxWidth)},"draw"),A_r={draw:S_r},U_r=A_r,I_r={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},R_r=k(({treeView:e})=>{let{labelFontSize:t,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=Kn(I_r,e);return` - .treeView-node-label { - font-size: ${t}; - fill: ${r}; - white-space: pre; - } - .treeView-node-dir { - font-weight: bold; - } - .treeView-node-line { - stroke: ${n}; - } - .treeView-node-icon { - color: ${i}; - } - .treeView-node-description { - font-size: ${t}; - fill: ${a}; - font-style: italic; - white-space: pre; - } - .treeView-highlight-bg { - fill: ${o}; - stroke: ${s}; - stroke-width: 1; - } - `},"styles"),M_r=R_r,L_r={db:b5e,renderer:U_r,parser:x_r,styles:M_r}});var k5e=Bn((ED,T5e)=>{(function(t,r){typeof ED=="object"&&typeof T5e=="object"?T5e.exports=r():typeof define=="function"&&define.amd?define([],r):typeof ED=="object"?ED.layoutBase=r():t.layoutBase=r()})(ED,function(){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.i=function(n){return n},r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=28)})([(function(e,t,r){"use strict";function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(8),a=r(9);function o(l,u,d){n.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=l,this.target=u}o.prototype=Object.create(n.prototype);for(var s in n)o[s]=n[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(l){if(this.source===l)return this.target;if(this.target===l)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(l,u){for(var d=this.getOtherEnd(l),h=u.getGraphManager().getRoot();;){if(d.getOwner()==u)return d;if(d.getOwner()==h)break;d=d.getOwner().getParent()}return null},o.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),l),this.isOverlapingSourceAndTarget||(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[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,r){"use strict";function n(i){this.vGraphObject=i}e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(10),a=r(13),o=r(0),s=r(16),l=r(5);function u(h,f,p,m){p==null&&m==null&&(m=f),n.call(this,m),h.graphManager!=null&&(h=h.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=m,this.edges=[],this.graphManager=h,p!=null&&f!=null?this.rect=new a(f.x,f.y,p.width,p.height):this.rect=new a}u.prototype=Object.create(n.prototype);for(var d in n)u[d]=n[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(h){this.rect.width=h},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(h){this.rect.height=h},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(h,f){this.rect.x=h.x,this.rect.y=h.y,this.rect.width=f.width,this.rect.height=f.height},u.prototype.setCenter=function(h,f){this.rect.x=h-this.rect.width/2,this.rect.y=f-this.rect.height/2},u.prototype.setLocation=function(h,f){this.rect.x=h,this.rect.y=f},u.prototype.moveBy=function(h,f){this.rect.x+=h,this.rect.y+=f},u.prototype.getEdgeListToNode=function(h){var f=[],p,m=this;return m.edges.forEach(function(g){if(g.target==h){if(g.source!=m)throw"Incorrect edge source!";f.push(g)}}),f},u.prototype.getEdgesBetween=function(h){var f=[],p,m=this;return m.edges.forEach(function(g){if(!(g.source==m||g.target==m))throw"Incorrect edge source and/or target";(g.target==h||g.source==h)&&f.push(g)}),f},u.prototype.getNeighborsList=function(){var h=new Set,f=this;return f.edges.forEach(function(p){if(p.source==f)h.add(p.target);else{if(p.target!=f)throw"Incorrect incidency!";h.add(p.source)}}),h},u.prototype.withChildren=function(){var h=new Set,f,p;if(h.add(this),this.child!=null)for(var m=this.child.getNodes(),g=0;gf?(this.rect.x-=(this.labelWidth-f)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(f+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(p+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>p?(this.rect.y-=(this.labelHeight-p)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(p+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(h){var f=this.rect.x;f>o.WORLD_BOUNDARY?f=o.WORLD_BOUNDARY:f<-o.WORLD_BOUNDARY&&(f=-o.WORLD_BOUNDARY);var p=this.rect.y;p>o.WORLD_BOUNDARY?p=o.WORLD_BOUNDARY:p<-o.WORLD_BOUNDARY&&(p=-o.WORLD_BOUNDARY);var m=new l(f,p),g=h.inverseTransformPoint(m);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,r){"use strict";var n=r(0);function i(){}for(var a in n)i[a]=n[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=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,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,r){"use strict";function n(i,a){i==null&&a==null?(this.x=0,this.y=0):(this.x=i,this.y=a)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(i){this.x=i},n.prototype.setY=function(i){this.y=i},n.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},e.exports=n}),(function(e,t,r){"use strict";var n=r(2),i=r(10),a=r(0),o=r(7),s=r(3),l=r(1),u=r(13),d=r(12),h=r(11);function f(m,g,y){n.call(this,y),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=m,g!=null&&g instanceof o?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}f.prototype=Object.create(n.prototype);for(var p in n)f[p]=n[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(m,g,y){if(g==null&&y==null){var v=m;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var b=m;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=y.owner?null:(b.source=g,b.target=y,b.isInterGraph=!1,this.getEdges().push(b),g.edges.push(b),y!=g&&y.edges.push(b),b)}},f.prototype.remove=function(m){var g=m;if(m instanceof s){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=g.edges.slice(),v,b=y.length,x=0;x-1&&T>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(w,1),v.target!=v.source&&v.target.edges.splice(T,1);var E=v.source.owner.getEdges().indexOf(v);if(E==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(E,1)}},f.prototype.updateLeftTop=function(){for(var m=i.MAX_VALUE,g=i.MAX_VALUE,y,v,b,x=this.getNodes(),E=x.length,w=0;wy&&(m=y),g>v&&(g=v)}return m==i.MAX_VALUE?null:(x[0].getParent().paddingLeft!=null?b=x[0].getParent().paddingLeft:b=this.margin,this.left=g-b,this.top=m-b,new d(this.left,this.top))},f.prototype.updateBounds=function(m){for(var g=i.MAX_VALUE,y=-i.MAX_VALUE,v=i.MAX_VALUE,b=-i.MAX_VALUE,x,E,w,T,C,S=this.nodes,R=S.length,U=0;Ux&&(g=x),yw&&(v=w),bx&&(g=x),yw&&(v=w),b=this.nodes.length){var R=0;y.forEach(function(U){U.owner==m&&R++}),R==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,r){"use strict";var n,i=r(1);function a(o){n=r(6),this.layout=o,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var o=this.layout.newGraph(),s=this.layout.newNode(null),l=this.add(o,s);return this.setRootGraph(l),this.rootGraph},a.prototype.add=function(o,s,l,u,d){if(l==null&&u==null&&d==null){if(o==null)throw"Graph is null!";if(s==null)throw"Parent node is null!";if(this.graphs.indexOf(o)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(o),o.parent!=null)throw"Already has a parent!";if(s.child!=null)throw"Already has a child!";return o.parent=s,s.child=o,o}else{d=l,u=s,l=o;var h=u.getOwner(),f=d.getOwner();if(!(h!=null&&h.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(f!=null&&f.getGraphManager()==this))throw"Target not in this graph mgr!";if(h==f)return l.isInterGraph=!1,h.add(l,u,d);if(l.isInterGraph=!0,l.source=u,l.target=d,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},a.prototype.remove=function(o){if(o instanceof n){var s=o;if(s.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(s==this.rootGraph||s.parent!=null&&s.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(s.getEdges());for(var u,d=l.length,h=0;h=o.getRight()?s[0]+=Math.min(o.getX()-a.getX(),a.getRight()-o.getRight()):o.getX()<=a.getX()&&o.getRight()>=a.getRight()&&(s[0]+=Math.min(a.getX()-o.getX(),o.getRight()-a.getRight())),a.getY()<=o.getY()&&a.getBottom()>=o.getBottom()?s[1]+=Math.min(o.getY()-a.getY(),a.getBottom()-o.getBottom()):o.getY()<=a.getY()&&o.getBottom()>=a.getBottom()&&(s[1]+=Math.min(a.getY()-o.getY(),o.getBottom()-a.getBottom()));var d=Math.abs((o.getCenterY()-a.getCenterY())/(o.getCenterX()-a.getCenterX()));o.getCenterY()===a.getCenterY()&&o.getCenterX()===a.getCenterX()&&(d=1);var h=d*s[0],f=s[1]/d;s[0]h)return s[0]=l,s[1]=p,s[2]=d,s[3]=S,!1;if(ud)return s[0]=f,s[1]=u,s[2]=T,s[3]=h,!1;if(ld?(s[0]=g,s[1]=y,I=!0):(s[0]=m,s[1]=p,I=!0):P===M&&(l>d?(s[0]=f,s[1]=p,I=!0):(s[0]=v,s[1]=y,I=!0)),-D===M?d>l?(s[2]=C,s[3]=S,A=!0):(s[2]=T,s[3]=w,A=!0):D===M&&(d>l?(s[2]=E,s[3]=w,A=!0):(s[2]=R,s[3]=S,A=!0)),I&&A)return!1;if(l>d?u>h?(O=this.getCardinalDirection(P,M,4),_=this.getCardinalDirection(D,M,2)):(O=this.getCardinalDirection(-P,M,3),_=this.getCardinalDirection(-D,M,1)):u>h?(O=this.getCardinalDirection(-P,M,1),_=this.getCardinalDirection(-D,M,3)):(O=this.getCardinalDirection(P,M,2),_=this.getCardinalDirection(D,M,4)),!I)switch(O){case 1:F=p,B=l+-x/M,s[0]=B,s[1]=F;break;case 2:B=v,F=u+b*M,s[0]=B,s[1]=F;break;case 3:F=y,B=l+x/M,s[0]=B,s[1]=F;break;case 4:B=g,F=u+-b*M,s[0]=B,s[1]=F;break}if(!A)switch(_){case 1:z=w,G=d+-L/M,s[2]=G,s[3]=z;break;case 2:G=R,z=h+U*M,s[2]=G,s[3]=z;break;case 3:z=S,G=d+L/M,s[2]=G,s[3]=z;break;case 4:G=C,z=h+-U*M,s[2]=G,s[3]=z;break}}return!1},i.getCardinalDirection=function(a,o,s){return a>o?s:1+s%4},i.getIntersection=function(a,o,s,l){if(l==null)return this.getIntersection2(a,o,s);var u=a.x,d=a.y,h=o.x,f=o.y,p=s.x,m=s.y,g=l.x,y=l.y,v=void 0,b=void 0,x=void 0,E=void 0,w=void 0,T=void 0,C=void 0,S=void 0,R=void 0;return x=f-d,w=u-h,C=h*d-u*f,E=y-m,T=p-g,S=g*m-p*y,R=x*T-E*w,R===0?null:(v=(w*S-T*C)/R,b=(E*C-x*S)/R,new n(v,b))},i.angleOfVector=function(a,o,s,l){var u=void 0;return a!==s?(u=Math.atan((l-o)/(s-a)),s=0){var y=(-p+Math.sqrt(p*p-4*f*m))/(2*f),v=(-p-Math.sqrt(p*p-4*f*m))/(2*f),b=null;return y>=0&&y<=1?[y]:v>=0&&v<=1?[v]:b}else 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,r){"use strict";function n(){}n.sign=function(i){return i>0?1:i<0?-1:0},n.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},n.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},e.exports=n}),(function(e,t,r){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,e.exports=n}),(function(e,t,r){"use strict";var n=(function(){function u(d,h){for(var f=0;f"u"?"undefined":n(a);return a==null||o!="object"&&o!="function"},e.exports=i}),(function(e,t,r){"use strict";function n(p){if(Array.isArray(p)){for(var m=0,g=Array(p.length);m0&&m;){for(x.push(w[0]);x.length>0&&m;){var T=x[0];x.splice(0,1),b.add(T);for(var C=T.getEdges(),v=0;v-1&&w.splice(L,1)}b=new Set,E=new Map}}return p},f.prototype.createDummyNodesForBendpoints=function(p){for(var m=[],g=p.source,y=this.graphManager.calcLowestCommonAncestor(p.source,p.target),v=0;v0){for(var y=this.edgeToDummyNodes.get(g),v=0;v=0&&m.splice(S,1);var R=E.getNeighborsList();R.forEach(function(I){if(g.indexOf(I)<0){var A=y.get(I),P=A-1;P==1&&T.push(I),y.set(I,P)}})}g=g.concat(T),(m.length==1||m.length==2)&&(v=!0,b=m[0])}return b},f.prototype.setGraphManager=function(p){this.graphManager=p},e.exports=f}),(function(e,t,r){"use strict";function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},e.exports=n}),(function(e,t,r){"use strict";var n=r(5);function i(a,o){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(a){this.lworldOrgX=a},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(a){this.lworldExtX=a},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(a){this.lworldExtY=a},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},i.prototype.transformX=function(a){var o=0,s=this.lworldExtX;return s!=0&&(o=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/s),o},i.prototype.transformY=function(a){var o=0,s=this.lworldExtY;return s!=0&&(o=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/s),o},i.prototype.inverseTransformX=function(a){var o=0,s=this.ldeviceExtX;return s!=0&&(o=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/s),o},i.prototype.inverseTransformY=function(a){var o=0,s=this.ldeviceExtY;return s!=0&&(o=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/s),o},i.prototype.inverseTransformPoint=function(a){var o=new n(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return o},e.exports=i}),(function(e,t,r){"use strict";function n(h){if(Array.isArray(h)){for(var f=0,p=Array(h.length);fa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(h-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(h>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(h-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var h=this.getAllEdges(),f,p=0;p0&&arguments[0]!==void 0?arguments[0]:!0,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p,m,g,y,v=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&h&&this.updateGrid(),b=new Set,p=0;px||b>x)&&(h.gravitationForceX=-this.gravityConstant*g,h.gravitationForceY=-this.gravityConstant*y)):(x=f.getEstimatedSize()*this.compoundGravityRangeFactor,(v>x||b>x)&&(h.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,h.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},u.prototype.isConverged=function(){var h,f=!1;return this.totalIterations>this.maxIterations/3&&(f=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),h=this.totalDisplacement=v.length||x>=v[0].length)){for(var E=0;Eu}}]),s})();e.exports=o}),(function(e,t,r){"use strict";function n(){}n.svd=function(i){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=i.length,this.n=i[0].length;var a=Math.min(this.m,this.n);this.s=(function(Ot){for(var Et=[];Ot-- >0;)Et.push(0);return Et})(Math.min(this.m+1,this.n)),this.U=(function(Ot){var Et=function Ee(gt){if(gt.length==0)return 0;for(var Ut=[],ct=0;ct0;)Et.push(0);return Et})(this.n),s=(function(Ot){for(var Et=[];Ot-- >0;)Et.push(0);return Et})(this.m),l=!0,u=!0,d=Math.min(this.m-1,this.n),h=Math.max(0,Math.min(this.n-2,this.m)),f=0;f=0;M--)if(this.s[M]!==0){for(var O=M+1;O=0;$--){if((function(Ot,Et){return Ot&&Et})($0;){var Ce=void 0,Ye=void 0;for(Ce=A-2;Ce>=-1&&Ce!==-1;Ce--)if(Math.abs(o[Ce])<=Me+fe*(Math.abs(this.s[Ce])+Math.abs(this.s[Ce+1]))){o[Ce]=0;break}if(Ce===A-2)Ye=4;else{var Ze=void 0;for(Ze=A-1;Ze>=Ce&&Ze!==Ce;Ze--){var Qe=(Ze!==A?Math.abs(o[Ze]):0)+(Ze!==Ce+1?Math.abs(o[Ze-1]):0);if(Math.abs(this.s[Ze])<=Me+fe*Qe){this.s[Ze]=0;break}}Ze===Ce?Ye=3:Ze===A-1?Ye=1:(Ye=2,Ce=Ze)}switch(Ce++,Ye){case 1:{var ve=o[A-2];o[A-2]=0;for(var Fe=A-2;Fe>=Ce;Fe--){var Le=n.hypot(this.s[Fe],ve),Be=this.s[Fe]/Le,ae=ve/Le;if(this.s[Fe]=Le,Fe!==Ce&&(ve=-ae*o[Fe-1],o[Fe-1]=Be*o[Fe-1]),u)for(var he=0;he=this.s[Ce+1]);){var vt=this.s[Ce];if(this.s[Ce]=this.s[Ce+1],this.s[Ce+1]=vt,u&&CeMath.abs(a)?(o=a/i,o=Math.abs(i)*Math.sqrt(1+o*o)):a!=0?(o=i/a,o=Math.abs(a)*Math.sqrt(1+o*o)):o=0,o},e.exports=n}),(function(e,t,r){"use strict";var n=(function(){function o(s,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,o),this.sequence1=s,this.sequence2=l,this.match_score=u,this.mismatch_penalty=d,this.gap_penalty=h,this.iMax=s.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var f=0;f=0;s--){var l=this.listeners[s];l.event===a&&l.callback===o&&this.listeners.splice(s,1)}},i.emit=function(a,o){for(var s=0;s{(function(t,r){typeof TD=="object"&&typeof C5e=="object"?C5e.exports=r(k5e()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof TD=="object"?TD.coseBase=r(k5e()):t.coseBase=r(t.layoutBase)})(TD,function(e){return(()=>{"use strict";var t={45:((a,o,s)=>{var l={};l.layoutBase=s(551),l.CoSEConstants=s(806),l.CoSEEdge=s(767),l.CoSEGraph=s(880),l.CoSEGraphManager=s(578),l.CoSELayout=s(765),l.CoSENode=s(991),l.ConstraintHandler=s(902),a.exports=l}),806:((a,o,s)=>{var l=s(551).FDLayoutConstants;function u(){}for(var d in l)u[d]=l[d];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,a.exports=u}),767:((a,o,s)=>{var l=s(551).FDLayoutEdge;function u(h,f,p){l.call(this,h,f,p)}u.prototype=Object.create(l.prototype);for(var d in l)u[d]=l[d];a.exports=u}),880:((a,o,s)=>{var l=s(551).LGraph;function u(h,f,p){l.call(this,h,f,p)}u.prototype=Object.create(l.prototype);for(var d in l)u[d]=l[d];a.exports=u}),578:((a,o,s)=>{var l=s(551).LGraphManager;function u(h){l.call(this,h)}u.prototype=Object.create(l.prototype);for(var d in l)u[d]=l[d];a.exports=u}),765:((a,o,s)=>{var l=s(551).FDLayout,u=s(578),d=s(880),h=s(991),f=s(767),p=s(806),m=s(902),g=s(551).FDLayoutConstants,y=s(551).LayoutConstants,v=s(551).Point,b=s(551).PointD,x=s(551).DimensionD,E=s(551).Layout,w=s(551).Integer,T=s(551).IGeometry,C=s(551).LGraph,S=s(551).Transform,R=s(551).LinkedList;function U(){l.call(this),this.toBeTiled={},this.constraints={}}U.prototype=Object.create(l.prototype);for(var L in l)U[L]=l[L];U.prototype.newGraphManager=function(){var I=new u(this);return this.graphManager=I,I},U.prototype.newGraph=function(I){return new d(null,this.graphManager,I)},U.prototype.newNode=function(I){return new h(this.graphManager,I)},U.prototype.newEdge=function(I){return new f(null,null,I)},U.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.isSubLayout||(p.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=p.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=p.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},U.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},U.prototype.layout=function(){var I=y.DEFAULT_CREATE_BENDS_AS_NEEDED;return I&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},U.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){if(p.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),P=this.nodesWithGravity.filter(function(O){return A.has(O)});this.graphManager.setAllNodesToApplyGravitation(P)}}else{var I=this.getFlatForest();if(I.length>0)this.positionNodesRadially(I);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),P=this.nodesWithGravity.filter(function(D){return A.has(D)});this.graphManager.setAllNodesToApplyGravitation(P),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(m.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),p.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},U.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(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 I=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(M){return I.has(M)});this.graphManager.setAllNodesToApplyGravitation(A),this.graphManager.updateBounds(),this.updateGrid(),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.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()),p.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var P=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(P,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},U.prototype.getPositionsData=function(){for(var I=this.graphManager.getAllNodes(),A={},P=0;P0&&this.updateDisplacements();for(var P=0;P0&&(D.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var _=new Map,B=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Q){I.fixedNodesOnHorizontal.add(Q),I.fixedNodesOnVertical.add(Q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,P=0;P=2*Q.length/3;pe--)ge=Math.floor(Math.random()*(pe+1)),ie=Q[pe],Q[pe]=Q[ge],Q[ge]=ie;return Q},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(Q){if(Q.left){var ge=_.has(Q.left)?_.get(Q.left):Q.left,ie=_.has(Q.right)?_.get(Q.right):Q.right;I.nodesInRelativeHorizontal.includes(ge)||(I.nodesInRelativeHorizontal.push(ge),I.nodeToRelativeConstraintMapHorizontal.set(ge,[]),I.dummyToNodeForVerticalAlignment.has(ge)?I.nodeToTempPositionMapHorizontal.set(ge,I.idToNodeMap.get(I.dummyToNodeForVerticalAlignment.get(ge)[0]).getCenterX()):I.nodeToTempPositionMapHorizontal.set(ge,I.idToNodeMap.get(ge).getCenterX())),I.nodesInRelativeHorizontal.includes(ie)||(I.nodesInRelativeHorizontal.push(ie),I.nodeToRelativeConstraintMapHorizontal.set(ie,[]),I.dummyToNodeForVerticalAlignment.has(ie)?I.nodeToTempPositionMapHorizontal.set(ie,I.idToNodeMap.get(I.dummyToNodeForVerticalAlignment.get(ie)[0]).getCenterX()):I.nodeToTempPositionMapHorizontal.set(ie,I.idToNodeMap.get(ie).getCenterX())),I.nodeToRelativeConstraintMapHorizontal.get(ge).push({right:ie,gap:Q.gap}),I.nodeToRelativeConstraintMapHorizontal.get(ie).push({left:ge,gap:Q.gap})}else{var pe=B.has(Q.top)?B.get(Q.top):Q.top,ue=B.has(Q.bottom)?B.get(Q.bottom):Q.bottom;I.nodesInRelativeVertical.includes(pe)||(I.nodesInRelativeVertical.push(pe),I.nodeToRelativeConstraintMapVertical.set(pe,[]),I.dummyToNodeForHorizontalAlignment.has(pe)?I.nodeToTempPositionMapVertical.set(pe,I.idToNodeMap.get(I.dummyToNodeForHorizontalAlignment.get(pe)[0]).getCenterY()):I.nodeToTempPositionMapVertical.set(pe,I.idToNodeMap.get(pe).getCenterY())),I.nodesInRelativeVertical.includes(ue)||(I.nodesInRelativeVertical.push(ue),I.nodeToRelativeConstraintMapVertical.set(ue,[]),I.dummyToNodeForHorizontalAlignment.has(ue)?I.nodeToTempPositionMapVertical.set(ue,I.idToNodeMap.get(I.dummyToNodeForHorizontalAlignment.get(ue)[0]).getCenterY()):I.nodeToTempPositionMapVertical.set(ue,I.idToNodeMap.get(ue).getCenterY())),I.nodeToRelativeConstraintMapVertical.get(pe).push({bottom:ue,gap:Q.gap}),I.nodeToRelativeConstraintMapVertical.get(ue).push({top:pe,gap:Q.gap})}});else{var z=new Map,V=new Map;this.constraints.relativePlacementConstraint.forEach(function(Q){if(Q.left){var ge=_.has(Q.left)?_.get(Q.left):Q.left,ie=_.has(Q.right)?_.get(Q.right):Q.right;z.has(ge)?z.get(ge).push(ie):z.set(ge,[ie]),z.has(ie)?z.get(ie).push(ge):z.set(ie,[ge])}else{var pe=B.has(Q.top)?B.get(Q.top):Q.top,ue=B.has(Q.bottom)?B.get(Q.bottom):Q.bottom;V.has(pe)?V.get(pe).push(ue):V.set(pe,[ue]),V.has(ue)?V.get(ue).push(pe):V.set(ue,[pe])}});var $=function(ge,ie){var pe=[],ue=[],fe=new R,Me=new Set,Ce=0;return ge.forEach(function(Ye,Ze){if(!Me.has(Ze)){pe[Ce]=[],ue[Ce]=!1;var Qe=Ze;for(fe.push(Qe),Me.add(Qe),pe[Ce].push(Qe);fe.length!=0;){Qe=fe.shift(),ie.has(Qe)&&(ue[Ce]=!0);var ve=ge.get(Qe);ve.forEach(function(Fe){Me.has(Fe)||(fe.push(Fe),Me.add(Fe),pe[Ce].push(Fe))})}Ce++}}),{components:pe,isFixed:ue}},Z=$(z,I.fixedNodesOnHorizontal);this.componentsOnHorizontal=Z.components,this.fixedComponentsOnHorizontal=Z.isFixed;var re=$(V,I.fixedNodesOnVertical);this.componentsOnVertical=re.components,this.fixedComponentsOnVertical=re.isFixed}}},U.prototype.updateDisplacements=function(){var I=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(re){var Q=I.idToNodeMap.get(re.nodeId);Q.displacementX=0,Q.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var A=this.constraints.alignmentConstraint.vertical,P=0;P1){var B;for(B=0;B<_.length;B++){var F=_[B];F.getBendpoints().push(new b),this.createDummyNodesForBendpoints(F)}}_.forEach(function(G){A.add(G)})}}}if(A.size==I.length)break}},U.prototype.positionNodesRadially=function(I){for(var A=new v(0,0),P=Math.ceil(Math.sqrt(I.length)),D=0,M=0,O=0,_=new b(0,0),B=0;BD&&(D=Math.floor(_.y)),O=Math.floor(_.x+p.DEFAULT_COMPONENT_SEPERATION)}this.transform(new b(y.WORLD_CENTER_X-_.x/2,y.WORLD_CENTER_Y-_.y/2))},U.radialLayout=function(I,A,P){var D=Math.max(this.maxDiagonalInTree(I),p.DEFAULT_RADIAL_SEPARATION);U.branchRadialLayout(A,null,0,359,0,D);var M=C.calculateBounds(I),O=new S;O.setDeviceOrgX(M.getMinX()),O.setDeviceOrgY(M.getMinY()),O.setWorldOrgX(P.x),O.setWorldOrgY(P.y);for(var _=0;_1;){var pe=ie[0];ie.splice(0,1);var ue=$.indexOf(pe);ue>=0&&$.splice(ue,1),Q--,Z--}A!=null?ge=($.indexOf(ie[0])+1)%Q:ge=0;for(var fe=Math.abs(D-P)/Z,Me=ge;re!=Z;Me=++Me%Q){var Ce=$[Me].getOtherEnd(I);if(Ce!=A){var Ye=(P+re*fe)%360,Ze=(Ye+fe)%360;U.branchRadialLayout(Ce,I,Ye,Ze,M+O,O),re++}}},U.maxDiagonalInTree=function(I){for(var A=w.MIN_VALUE,P=0;PA&&(A=M)}return A},U.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},U.prototype.groupZeroDegreeMembers=function(){var I=this,A={};this.memberGroups={},this.idToDummyNode={};for(var P=[],D=this.graphManager.getAllNodes(),M=0;M"u"&&(A[B]=[]),A[B]=A[B].concat(O)}Object.keys(A).forEach(function(F){if(A[F].length>1){var G="DummyCompound_"+F;I.memberGroups[G]=A[F];var z=A[F][0].getParent(),V=new h(I.graphManager);V.id=G,V.paddingLeft=z.paddingLeft||0,V.paddingRight=z.paddingRight||0,V.paddingBottom=z.paddingBottom||0,V.paddingTop=z.paddingTop||0,I.idToDummyNode[G]=V;var $=I.getGraphManager().add(I.newGraph(),V),Z=z.getChild();Z.add(V);for(var re=0;reM?(D.rect.x-=(D.labelWidth-M)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-M)/2):D.labelPosHorizontal=="right"&&D.setWidth(M+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(O+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>O?(D.rect.y-=(D.labelHeight-O)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-O)/2):D.labelPosVertical=="bottom"&&D.setHeight(O+D.labelHeight))}})},U.prototype.repopulateCompounds=function(){for(var I=this.compoundOrder.length-1;I>=0;I--){var A=this.compoundOrder[I],P=A.id,D=A.paddingLeft,M=A.paddingTop,O=A.labelMarginLeft,_=A.labelMarginTop;this.adjustLocations(this.tiledMemberPack[P],A.rect.x,A.rect.y,D,M,O,_)}},U.prototype.repopulateZeroDegreeMembers=function(){var I=this,A=this.tiledZeroDegreePack;Object.keys(A).forEach(function(P){var D=I.idToDummyNode[P],M=D.paddingLeft,O=D.paddingTop,_=D.labelMarginLeft,B=D.labelMarginTop;I.adjustLocations(A[P],D.rect.x,D.rect.y,M,O,_,B)})},U.prototype.getToBeTiled=function(I){var A=I.id;if(this.toBeTiled[A]!=null)return this.toBeTiled[A];var P=I.getChild();if(P==null)return this.toBeTiled[A]=!1,!1;for(var D=P.getNodes(),M=0;M0)return this.toBeTiled[A]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[A]=!1,!1}return this.toBeTiled[A]=!0,!0},U.prototype.getNodeDegree=function(I){for(var A=I.id,P=I.getEdges(),D=0,M=0;Mz&&(z=$.rect.height)}P+=z+I.verticalPadding}},U.prototype.tileCompoundMembers=function(I,A){var P=this;this.tiledMemberPack=[],Object.keys(I).forEach(function(D){var M=A[D];if(P.tiledMemberPack[D]=P.tileNodes(I[D],M.paddingLeft+M.paddingRight),M.rect.width=P.tiledMemberPack[D].width,M.rect.height=P.tiledMemberPack[D].height,M.setCenter(P.tiledMemberPack[D].centerX,P.tiledMemberPack[D].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,p.NODE_DIMENSIONS_INCLUDE_LABELS){var O=M.rect.width,_=M.rect.height;M.labelWidth&&(M.labelPosHorizontal=="left"?(M.rect.x-=M.labelWidth,M.setWidth(O+M.labelWidth),M.labelMarginLeft=M.labelWidth):M.labelPosHorizontal=="center"&&M.labelWidth>O?(M.rect.x-=(M.labelWidth-O)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-O)/2):M.labelPosHorizontal=="right"&&M.setWidth(O+M.labelWidth)),M.labelHeight&&(M.labelPosVertical=="top"?(M.rect.y-=M.labelHeight,M.setHeight(_+M.labelHeight),M.labelMarginTop=M.labelHeight):M.labelPosVertical=="center"&&M.labelHeight>_?(M.rect.y-=(M.labelHeight-_)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-_)/2):M.labelPosVertical=="bottom"&&M.setHeight(_+M.labelHeight))}})},U.prototype.tileNodes=function(I,A){var P=this.tileNodesByFavoringDim(I,A,!0),D=this.tileNodesByFavoringDim(I,A,!1),M=this.getOrgRatio(P),O=this.getOrgRatio(D),_;return OB&&(B=re.getWidth())});var F=O/M,G=_/M,z=Math.pow(P-D,2)+4*(F+D)*(G+P)*M,V=(D-P+Math.sqrt(z))/(2*(F+D)),$;A?($=Math.ceil(V),$==V&&$++):$=Math.floor(V);var Z=$*(F+D)-D;return B>Z&&(Z=B),Z+=D*2,Z},U.prototype.tileNodesByFavoringDim=function(I,A,P){var D=p.TILING_PADDING_VERTICAL,M=p.TILING_PADDING_HORIZONTAL,O=p.TILING_COMPARE_BY,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:A,verticalPadding:D,horizontalPadding:M,centerX:0,centerY:0};O&&(_.idealRowWidth=this.calcIdealRowWidth(I,P));var B=function(Q){return Q.rect.width*Q.rect.height},F=function(Q,ge){return B(ge)-B(Q)};I.sort(function(re,Q){var ge=F;return _.idealRowWidth?(ge=O,ge(re.id,Q.id)):ge(re,Q)});for(var G=0,z=0,V=0;V0&&(_+=I.horizontalPadding),I.rowWidth[P]=_,I.width<_&&(I.width=_);var B=A.rect.height;P>0&&(B+=I.verticalPadding);var F=0;B>I.rowHeight[P]&&(F=I.rowHeight[P],I.rowHeight[P]=B,F=I.rowHeight[P]-F),I.height+=F,I.rows[P].push(A)},U.prototype.getShortestRowIndex=function(I){for(var A=-1,P=Number.MAX_VALUE,D=0;DP&&(A=D,P=I.rowWidth[D]);return A},U.prototype.canAddHorizontal=function(I,A,P){if(I.idealRowWidth){var D=I.rows.length-1,M=I.rowWidth[D];return M+A+I.horizontalPadding<=I.idealRowWidth}var O=this.getShortestRowIndex(I);if(O<0)return!0;var _=I.rowWidth[O];if(_+I.horizontalPadding+A<=I.width)return!0;var B=0;I.rowHeight[O]0&&(B=P+I.verticalPadding-I.rowHeight[O]);var F;I.width-_>=A+I.horizontalPadding?F=(I.height+B)/(_+A+I.horizontalPadding):F=(I.height+B)/I.width,B=P+I.verticalPadding;var G;return I.widthO&&A!=P){D.splice(-1,1),I.rows[P].push(M),I.rowWidth[A]=I.rowWidth[A]-O,I.rowWidth[P]=I.rowWidth[P]+O,I.width=I.rowWidth[instance.getLongestRowIndex(I)];for(var _=Number.MIN_VALUE,B=0;B_&&(_=D[B].height);A>0&&(_+=I.verticalPadding);var F=I.rowHeight[A]+I.rowHeight[P];I.rowHeight[A]=_,I.rowHeight[P]0)for(var Z=M;Z<=O;Z++)$[0]+=this.grid[Z][_-1].length+this.grid[Z][_].length-1;if(O0)for(var Z=_;Z<=B;Z++)$[3]+=this.grid[M-1][Z].length+this.grid[M][Z].length-1;for(var re=w.MAX_VALUE,Q,ge,ie=0;ie<$.length;ie++)$[ie]{var l=s(551).FDLayoutNode,u=s(551).IMath;function d(f,p,m,g){l.call(this,f,p,m,g)}d.prototype=Object.create(l.prototype);for(var h in l)d[h]=l[h];d.prototype.calculateDisplacement=function(){var f=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=f.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=f.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=f.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=f.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementX=f.coolingFactor*f.maxNodeDisplacement*u.sign(this.displacementX)),Math.abs(this.displacementY)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementY=f.coolingFactor*f.maxNodeDisplacement*u.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},d.prototype.propogateDisplacementToChildren=function(f,p){for(var m=this.getChild().getNodes(),g,y=0;y{function l(m){if(Array.isArray(m)){for(var g=0,y=Array(m.length);g0){var bt=0;we.forEach(function(vt){se=="horizontal"?(Ae.set(vt,v.has(vt)?b[v.get(vt)]:K.get(vt)),bt+=Ae.get(vt)):(Ae.set(vt,v.has(vt)?x[v.get(vt)]:K.get(vt)),bt+=Ae.get(vt))}),bt=bt/we.length,Ke.forEach(function(vt){J.has(vt)||Ae.set(vt,bt)})}else{var Ve=0;Ke.forEach(function(vt){se=="horizontal"?Ve+=v.has(vt)?b[v.get(vt)]:K.get(vt):Ve+=v.has(vt)?x[v.get(vt)]:K.get(vt)}),Ve=Ve/Ke.length,Ke.forEach(function(vt){Ae.set(vt,Ve)})}});for(var De=function(){var we=Ge.shift(),bt=j.get(we);bt.forEach(function(Ve){if(Ae.get(Ve.id)vt&&(vt=Ut),ctPt&&(Pt=ct)}}catch(on){It=!0,Ot=on}finally{try{!Xt&&Et.return&&Et.return()}finally{if(It)throw Ot}}var Ne=(bt+vt)/2-(Ve+Pt)/2,at=!0,ft=!1,Ct=void 0;try{for(var Er=Ke[Symbol.iterator](),Wt;!(at=(Wt=Er.next()).done);at=!0){var Sr=Wt.value;Ae.set(Sr,Ae.get(Sr)+Ne)}}catch(on){ft=!0,Ct=on}finally{try{!at&&Er.return&&Er.return()}finally{if(ft)throw Ct}}})}return Ae},L=function(j){var se=0,J=0,K=0,ee=0;if(j.forEach(function(Ie){Ie.left?b[v.get(Ie.left)]-b[v.get(Ie.right)]>=0?se++:J++:x[v.get(Ie.top)]-x[v.get(Ie.bottom)]>=0?K++:ee++}),se>J&&K>ee)for(var Se=0;SeJ)for(var Te=0;Teee)for(var Ae=0;Ae1)g.fixedNodeConstraint.forEach(function(q,j){D[j]=[q.position.x,q.position.y],M[j]=[b[v.get(q.nodeId)],x[v.get(q.nodeId)]]}),O=!0;else if(g.alignmentConstraint)(function(){var q=0;if(g.alignmentConstraint.vertical){for(var j=g.alignmentConstraint.vertical,se=function(Ae){var Ie=new Set;j[Ae].forEach(function(He){Ie.add(He)});var Ge=new Set([].concat(l(Ie)).filter(function(He){return B.has(He)})),De=void 0;Ge.size>0?De=b[v.get(Ge.values().next().value)]:De=R(Ie).x,j[Ae].forEach(function(He){D[q]=[De,x[v.get(He)]],M[q]=[b[v.get(He)],x[v.get(He)]],q++})},J=0;J0?De=b[v.get(Ge.values().next().value)]:De=R(Ie).y,K[Ae].forEach(function(He){D[q]=[b[v.get(He)],De],M[q]=[b[v.get(He)],x[v.get(He)]],q++})},Se=0;SeV&&(V=z[Z].length,$=Z);if(V0){var Be={x:0,y:0};g.fixedNodeConstraint.forEach(function(q,j){var se={x:b[v.get(q.nodeId)],y:x[v.get(q.nodeId)]},J=q.position,K=S(J,se);Be.x+=K.x,Be.y+=K.y}),Be.x/=g.fixedNodeConstraint.length,Be.y/=g.fixedNodeConstraint.length,b.forEach(function(q,j){b[j]+=Be.x}),x.forEach(function(q,j){x[j]+=Be.y}),g.fixedNodeConstraint.forEach(function(q){b[v.get(q.nodeId)]=q.position.x,x[v.get(q.nodeId)]=q.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical)for(var ae=g.alignmentConstraint.vertical,he=function(j){var se=new Set;ae[j].forEach(function(ee){se.add(ee)});var J=new Set([].concat(l(se)).filter(function(ee){return B.has(ee)})),K=void 0;J.size>0?K=b[v.get(J.values().next().value)]:K=R(se).x,se.forEach(function(ee){B.has(ee)||(b[v.get(ee)]=K)})},de=0;de0?K=x[v.get(J.values().next().value)]:K=R(se).y,se.forEach(function(ee){B.has(ee)||(x[v.get(ee)]=K)})},le=0;le{a.exports=e})},r={};function n(a){var o=r[a];if(o!==void 0)return o.exports;var s=r[a]={exports:{}};return t[a](s,s.exports,n),s.exports}var i=n(45);return i})()})});var AEt=Bn((kD,A5e)=>{(function(t,r){typeof kD=="object"&&typeof A5e=="object"?A5e.exports=r(S5e()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof kD=="object"?kD.cytoscapeFcose=r(S5e()):t.cytoscapeFcose=r(t.coseBase)})(kD,function(e){return(()=>{"use strict";var t={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(o){for(var s=arguments.length,l=Array(s>1?s-1:0),u=1;u{var l=(function(){function h(f,p){var m=[],g=!0,y=!1,v=void 0;try{for(var b=f[Symbol.iterator](),x;!(g=(x=b.next()).done)&&(m.push(x.value),!(p&&m.length===p));g=!0);}catch(E){y=!0,v=E}finally{try{!g&&b.return&&b.return()}finally{if(y)throw v}}return m}return function(f,p){if(Array.isArray(f))return f;if(Symbol.iterator in Object(f))return h(f,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),u=s(140).layoutBase.LinkedList,d={};d.getTopMostNodes=function(h){for(var f={},p=0;p0&&O.merge(G)});for(var _=0;_1){x=v[0],E=x.connectedEdges().length,v.forEach(function(M){M.connectedEdges().length0&&m.set("dummy"+(m.size+1),C),S},d.relocateComponent=function(h,f,p){if(!p.fixedNodeConstraint){var m=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;if(p.quality=="draft"){var b=!0,x=!1,E=void 0;try{for(var w=f.nodeIndexes[Symbol.iterator](),T;!(b=(T=w.next()).done);b=!0){var C=T.value,S=l(C,2),R=S[0],U=S[1],L=p.cy.getElementById(R);if(L){var I=L.boundingBox(),A=f.xCoords[U]-I.w/2,P=f.xCoords[U]+I.w/2,D=f.yCoords[U]-I.h/2,M=f.yCoords[U]+I.h/2;Ag&&(g=P),Dv&&(v=M)}}}catch(G){x=!0,E=G}finally{try{!b&&w.return&&w.return()}finally{if(x)throw E}}var O=h.x-(g+m)/2,_=h.y-(v+y)/2;f.xCoords=f.xCoords.map(function(G){return G+O}),f.yCoords=f.yCoords.map(function(G){return G+_})}else{Object.keys(f).forEach(function(G){var z=f[G],V=z.getRect().x,$=z.getRect().x+z.getRect().width,Z=z.getRect().y,re=z.getRect().y+z.getRect().height;Vg&&(g=$),Zv&&(v=re)});var B=h.x-(g+m)/2,F=h.y-(v+y)/2;Object.keys(f).forEach(function(G){var z=f[G];z.setCenter(z.getCenterX()+B,z.getCenterY()+F)})}}},d.calcBoundingBox=function(h,f,p,m){for(var g=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,x=void 0,E=void 0,w=void 0,T=void 0,C=h.descendants().not(":parent"),S=C.length,R=0;Rx&&(g=x),yw&&(v=w),b{var l=s(548),u=s(140).CoSELayout,d=s(140).CoSENode,h=s(140).layoutBase.PointD,f=s(140).layoutBase.DimensionD,p=s(140).layoutBase.LayoutConstants,m=s(140).layoutBase.FDLayoutConstants,g=s(140).CoSEConstants,y=function(b,x){var E=b.cy,w=b.eles,T=w.nodes(),C=w.edges(),S=void 0,R=void 0,U=void 0,L={};b.randomize&&(S=x.nodeIndexes,R=x.xCoords,U=x.yCoords);var I=function(G){return typeof G=="function"},A=function(G,z){return I(G)?G(z):G},P=l.calcParentsWithoutChildren(E,w),D=function F(G,z,V,$){for(var Z=z.length,re=0;re0){var fe=void 0;fe=V.getGraphManager().add(V.newGraph(),ie),F(fe,ge,V,$)}}},M=function(G,z,V){for(var $=0,Z=0,re=0;re0?g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=$/Z:I(b.idealEdgeLength)?g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=50:g.DEFAULT_EDGE_LENGTH=m.DEFAULT_EDGE_LENGTH=b.idealEdgeLength,g.MIN_REPULSION_DIST=m.MIN_REPULSION_DIST=m.DEFAULT_EDGE_LENGTH/10,g.DEFAULT_RADIAL_SEPARATION=m.DEFAULT_EDGE_LENGTH)},O=function(G,z){z.fixedNodeConstraint&&(G.constraints.fixedNodeConstraint=z.fixedNodeConstraint),z.alignmentConstraint&&(G.constraints.alignmentConstraint=z.alignmentConstraint),z.relativePlacementConstraint&&(G.constraints.relativePlacementConstraint=z.relativePlacementConstraint)};b.nestingFactor!=null&&(g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=b.nestingFactor),b.gravity!=null&&(g.DEFAULT_GRAVITY_STRENGTH=m.DEFAULT_GRAVITY_STRENGTH=b.gravity),b.numIter!=null&&(g.MAX_ITERATIONS=m.MAX_ITERATIONS=b.numIter),b.gravityRange!=null&&(g.DEFAULT_GRAVITY_RANGE_FACTOR=m.DEFAULT_GRAVITY_RANGE_FACTOR=b.gravityRange),b.gravityCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.DEFAULT_COMPOUND_GRAVITY_STRENGTH=b.gravityCompound),b.gravityRangeCompound!=null&&(g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=b.gravityRangeCompound),b.initialEnergyOnIncremental!=null&&(g.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.DEFAULT_COOLING_FACTOR_INCREMENTAL=b.initialEnergyOnIncremental),b.tilingCompareBy!=null&&(g.TILING_COMPARE_BY=b.tilingCompareBy),b.quality=="proof"?p.QUALITY=2:p.QUALITY=0,g.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=p.NODE_DIMENSIONS_INCLUDE_LABELS=b.nodeDimensionsIncludeLabels,g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!b.randomize,g.ANIMATE=m.ANIMATE=p.ANIMATE=b.animate,g.TILE=b.tile,g.TILING_PADDING_VERTICAL=typeof b.tilingPaddingVertical=="function"?b.tilingPaddingVertical.call():b.tilingPaddingVertical,g.TILING_PADDING_HORIZONTAL=typeof b.tilingPaddingHorizontal=="function"?b.tilingPaddingHorizontal.call():b.tilingPaddingHorizontal,g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=!0,g.PURE_INCREMENTAL=!b.randomize,p.DEFAULT_UNIFORM_LEAF_NODE_SIZES=b.uniformNodeDimensions,b.step=="transformed"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!1),b.step=="enforced"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!1),b.step=="cose"&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!0),b.step=="all"&&(b.randomize?g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!0),b.fixedNodeConstraint||b.alignmentConstraint||b.relativePlacementConstraint?g.TREE_REDUCTION_ON_INCREMENTAL=!1:g.TREE_REDUCTION_ON_INCREMENTAL=!0;var _=new u,B=_.newGraphManager();return D(B.addRoot(),l.getTopMostNodes(T),_,b),M(_,B,C),O(_,b),_.runLayout(),L};a.exports={coseLayout:y}}),212:((a,o,s)=>{var l=(function(){function b(x,E){for(var w=0;w0)if(M){var B=h.getTopMostNodes(w.eles.nodes());if(I=h.connectComponents(T,w.eles,B),I.forEach(function(Qe){var ve=Qe.boundingBox();A.push({x:ve.x1+ve.w/2,y:ve.y1+ve.h/2})}),w.randomize&&I.forEach(function(Qe){w.eles=Qe,S.push(p(w))}),w.quality=="default"||w.quality=="proof"){var F=T.collection();if(w.tile){var G=new Map,z=[],V=[],$=0,Z={nodeIndexes:G,xCoords:z,yCoords:V},re=[];if(I.forEach(function(Qe,ve){Qe.edges().length==0&&(Qe.nodes().forEach(function(Fe,Le){F.merge(Qe.nodes()[Le]),Fe.isParent()||(Z.nodeIndexes.set(Qe.nodes()[Le].id(),$++),Z.xCoords.push(Qe.nodes()[0].position().x),Z.yCoords.push(Qe.nodes()[0].position().y))}),re.push(ve))}),F.length>1){var Q=F.boundingBox();A.push({x:Q.x1+Q.w/2,y:Q.y1+Q.h/2}),I.push(F),S.push(Z);for(var ge=re.length-1;ge>=0;ge--)I.splice(re[ge],1),S.splice(re[ge],1),A.splice(re[ge],1)}}I.forEach(function(Qe,ve){w.eles=Qe,L.push(g(w,S[ve])),h.relocateComponent(A[ve],L[ve],w)})}else I.forEach(function(Qe,ve){h.relocateComponent(A[ve],S[ve],w)});var ie=new Set;if(I.length>1){var pe=[],ue=C.filter(function(Qe){return Qe.css("display")=="none"});I.forEach(function(Qe,ve){var Fe=void 0;if(w.quality=="draft"&&(Fe=S[ve].nodeIndexes),Qe.nodes().not(ue).length>0){var Le={};Le.edges=[],Le.nodes=[];var Be=void 0;Qe.nodes().not(ue).forEach(function(ae){if(w.quality=="draft")if(!ae.isParent())Be=Fe.get(ae.id()),Le.nodes.push({x:S[ve].xCoords[Be]-ae.boundingbox().w/2,y:S[ve].yCoords[Be]-ae.boundingbox().h/2,width:ae.boundingbox().w,height:ae.boundingbox().h});else{var he=h.calcBoundingBox(ae,S[ve].xCoords,S[ve].yCoords,Fe);Le.nodes.push({x:he.topLeftX,y:he.topLeftY,width:he.width,height:he.height})}else L[ve][ae.id()]&&Le.nodes.push({x:L[ve][ae.id()].getLeft(),y:L[ve][ae.id()].getTop(),width:L[ve][ae.id()].getWidth(),height:L[ve][ae.id()].getHeight()})}),Qe.edges().forEach(function(ae){var he=ae.source(),de=ae.target();if(he.css("display")!="none"&&de.css("display")!="none")if(w.quality=="draft"){var me=Fe.get(he.id()),ke=Fe.get(de.id()),le=[],W=[];if(he.isParent()){var X=h.calcBoundingBox(he,S[ve].xCoords,S[ve].yCoords,Fe);le.push(X.topLeftX+X.width/2),le.push(X.topLeftY+X.height/2)}else le.push(S[ve].xCoords[me]),le.push(S[ve].yCoords[me]);if(de.isParent()){var q=h.calcBoundingBox(de,S[ve].xCoords,S[ve].yCoords,Fe);W.push(q.topLeftX+q.width/2),W.push(q.topLeftY+q.height/2)}else W.push(S[ve].xCoords[ke]),W.push(S[ve].yCoords[ke]);Le.edges.push({startX:le[0],startY:le[1],endX:W[0],endY:W[1]})}else L[ve][he.id()]&&L[ve][de.id()]&&Le.edges.push({startX:L[ve][he.id()].getCenterX(),startY:L[ve][he.id()].getCenterY(),endX:L[ve][de.id()].getCenterX(),endY:L[ve][de.id()].getCenterY()})}),Le.nodes.length>0&&(pe.push(Le),ie.add(ve))}});var fe=D.packComponents(pe,w.randomize).shifts;if(w.quality=="draft")S.forEach(function(Qe,ve){var Fe=Qe.xCoords.map(function(Be){return Be+fe[ve].dx}),Le=Qe.yCoords.map(function(Be){return Be+fe[ve].dy});Qe.xCoords=Fe,Qe.yCoords=Le});else{var Me=0;ie.forEach(function(Qe){Object.keys(L[Qe]).forEach(function(ve){var Fe=L[Qe][ve];Fe.setCenter(Fe.getCenterX()+fe[Me].dx,Fe.getCenterY()+fe[Me].dy)}),Me++})}}}else{var O=w.eles.boundingBox();if(A.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),w.randomize){var _=p(w);S.push(_)}w.quality=="default"||w.quality=="proof"?(L.push(g(w,S[0])),h.relocateComponent(A[0],L[0],w)):h.relocateComponent(A[0],S[0],w)}var Ce=function(ve,Fe){if(w.quality=="default"||w.quality=="proof"){typeof ve=="number"&&(ve=Fe);var Le=void 0,Be=void 0,ae=ve.data("id");return L.forEach(function(de){ae in de&&(Le={x:de[ae].getRect().getCenterX(),y:de[ae].getRect().getCenterY()},Be=de[ae])}),w.nodeDimensionsIncludeLabels&&(Be.labelWidth&&(Be.labelPosHorizontal=="left"?Le.x+=Be.labelWidth/2:Be.labelPosHorizontal=="right"&&(Le.x-=Be.labelWidth/2)),Be.labelHeight&&(Be.labelPosVertical=="top"?Le.y+=Be.labelHeight/2:Be.labelPosVertical=="bottom"&&(Le.y-=Be.labelHeight/2))),Le==null&&(Le={x:ve.position("x"),y:ve.position("y")}),{x:Le.x,y:Le.y}}else{var he=void 0;return S.forEach(function(de){var me=de.nodeIndexes.get(ve.id());me!=null&&(he={x:de.xCoords[me],y:de.yCoords[me]})}),he==null&&(he={x:ve.position("x"),y:ve.position("y")}),{x:he.x,y:he.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var Ye=h.calcParentsWithoutChildren(T,C),Ze=C.filter(function(Qe){return Qe.css("display")=="none"});w.eles=C.not(Ze),C.nodes().not(":parent").not(Ze).layoutPositions(E,w,Ce),Ye.length>0&&Ye.forEach(function(Qe){Qe.position(Ce(Qe))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),b})();a.exports=v}),657:((a,o,s)=>{var l=s(548),u=s(140).layoutBase.Matrix,d=s(140).layoutBase.SVD,h=function(p){var m=p.cy,g=p.eles,y=g.nodes(),v=g.nodes(":parent"),b=new Map,x=new Map,E=new Map,w=[],T=[],C=[],S=[],R=[],U=[],L=[],I=[],A=void 0,P=void 0,D=1e8,M=1e-9,O=p.piTol,_=p.samplingType,B=p.nodeSeparation,F=void 0,G=function(){for(var se=0,J=0,K=!1;J=Se;){Ae=ee[Se++];for(var Ke=w[Ae],we=0;weDe&&(De=R[Ve],He=Ve)}return He},V=function(se){var J=void 0;if(se){J=Math.floor(Math.random()*P),A=J;for(var ee=0;ee=1)break;De=Ge}for(var Ke=0;Ke=1)break;De=Ge}for(var bt=0;bt0&&(J.isParent()?w[se].push(E.get(J.id())):w[se].push(J.id()))})});var Ye=function(se){var J=x.get(se),K=void 0;b.get(se).forEach(function(ee){m.getElementById(ee).isParent()?K=E.get(ee):K=ee,w[J].push(K),w[x.get(K)].push(se)})},Ze=!0,Qe=!1,ve=void 0;try{for(var Fe=b.keys()[Symbol.iterator](),Le;!(Ze=(Le=Fe.next()).done);Ze=!0){var Be=Le.value;Ye(Be)}}catch(j){Qe=!0,ve=j}finally{try{!Ze&&Fe.return&&Fe.return()}finally{if(Qe)throw ve}}P=x.size;var ae=void 0;if(P>2){F=P{var l=s(212),u=function(h){h&&h("layout","fcose",l)};typeof cytoscape<"u"&&u(cytoscape),a.exports=u}),140:(a=>{a.exports=e})},r={};function n(a){var o=r[a];if(o!==void 0)return o.exports;var s=r[a]={exports:{}};return t[a](s,s.exports,n),s.exports}var i=n(579);return i})()})});var HEt={};gr(HEt,{diagram:()=>Z_r});function I5e(e,t){if(e===0)return t();let r=Math.random,n=e>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=r}}function PEt(e,t,r){e.forEach(n=>{t.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}function OEt(e,t,r){e.forEach(n=>{t.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}function BEt(e,t){t.nodes().map(r=>{let n=MA(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,e.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function FEt(e,t){e.forEach(r=>{t.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}function zEt(e,t){e.forEach(r=>{let{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:o,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:d,title:h}=r,f=R5e(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:h,source:n,sourceDir:l,sourceArrow:a,sourceGroup:o,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:s,targetGroup:d,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};t.add({group:"edges",data:p,classes:f})})}function GEt(e,t,r,n=[]){let i=k((f,p)=>{let m=new Map;for(let[g,y]of f.entries()){let v=`${g}`,b=0,x=[...y.entries()];if(x.length===1){m.set(v,x[0][1]);continue}for(let E=0;E{let p=new Map,m=new Map;return f.forEach(([g,y],v)=>{let b=e.getNode(v)?.in??"default",x=p.get(y)??new Map;p.has(y)||p.set(y,x);let E=m.get(g)??new Map;m.has(g)||m.set(g,E);for(let w of[x,E]){let T=w.get(b)??[];w.has(b)||w.set(b,T),T.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(g=>g.length>1),vert:[...i(m,"vertical").values()].filter(g=>g.length>1)}}),[o,s]=a.reduce(([f,p],{horiz:m,vert:g})=>[[...f,...m],[...p,...g]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));let u=k(f=>f.filter(p=>!p.some(m=>l.has(m))),"dropOverlapping"),d=u(o),h=u(s);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?d.push([...f.members]):h.push([...f.members]))}),{horizontal:d,vertical:h}}function WEt(e,t,r=[]){let n=[],i=t.getConfigField("iconSize"),a=t.getConfigField("idealEdgeLengthMultiplier"),o=a*i,s=new Set;r.forEach(d=>{for(let h=0;h`${d[0]},${d[1]}`,"posToStr"),u=k(d=>d.split(",").map(h=>parseInt(h)),"strToPos");return e.forEach(d=>{let h=new Map([...d.entries()].map(([g,y])=>[l(y),g])),f=[l([0,0])],p={},m={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){let g=f.shift();if(g){p[g]=1;let y=h.get(g);if(y){let v=u(g);Object.entries(m).forEach(([b,x])=>{let E=l([v[0]+x[0],v[1]+x[1]]),w=h.get(E);if(w&&!p[E]){if(f.push(E),s.has(`${y}|${w}`))return;n.push({[UEt[b]]:w,[UEt[D_r(b)]]:y,gap:a*i})}})}}}}),n}function VEt(e,t,r,n,i,{spatialMaps:a,groupAlignments:o}){return new Promise(s=>{let l=xt("body").append("div").attr("id","cy").attr("style","display:none"),u=zf({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":`${i.getConfigField("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:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),FEt(r,u),PEt(e,u,i),OEt(t,u,i),zEt(n,u);let d=i.getLayoutHints(),h=GEt(i,a,o,d),f=WEt(a,i,d),p=i.getConfigField("iconSize"),m=i.getConfigField("idealEdgeLengthMultiplier")*p,g=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),b=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){let[E,w]=x.connectedNodes(),{parent:T}=MA(E),{parent:C}=MA(w);return T===C?m:g},edgeElasticity(x){let[E,w]=x.connectedNodes(),{parent:T}=MA(E),{parent:C}=MA(w);return T===C?y:.001},alignmentConstraint:h,relativePlacementConstraint:f});b.one("layoutstop",()=>{function x(E,w,T,C){let S,R,{x:U,y:L}=E,{x:I,y:A}=w;R=(C-L+(U-T)*(L-A)/(U-I))/Math.sqrt(1+Math.pow((L-A)/(U-I),2)),S=Math.sqrt(Math.pow(C-L,2)+Math.pow(T-U,2)-Math.pow(R,2));let P=Math.sqrt(Math.pow(I-U,2)+Math.pow(A-L,2));S=S/P;let D=(I-U)*(C-L)-(A-L)*(T-U);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}let M=(I-U)*(T-U)+(A-L)*(C-L);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}return R=Math.abs(R)*D,S=S*M,{distances:R,weights:S}}k(x,"getSegmentWeights"),u.startBatch();for(let E of Object.values(u.edges()))if(E.data?.()){let{x:w,y:T}=E.source().position(),{x:C,y:S}=E.target().position();if(w!==C&&T!==S){let R=E.sourceEndpoint(),U=E.targetEndpoint(),{sourceDir:L}=LEt(E),[I,A]=Qx(L)?[R.x,U.y]:[U.x,R.y],{weights:P,distances:D}=x(R,U,I,A);E.style("segment-distances",D),E.style("segment-weights",P)}}u.endBatch(),I5e(v,()=>b.run())});try{I5e(v,()=>b.run())}catch(x){throw x instanceof RangeError&&x.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):x}u.ready(x=>{ye.info("Ready",x),s(u)})})}var _Et,UEt,IEt,V$,D_r,REt,ju,Qx,R5e,N_r,__r,U5e,P_r,O_r,B_r,F_r,z_r,MEt,LEt,MA,G_r,DEt,W_r,NEt,V_r,H_r,RA,CD,q_r,Y_r,j_r,X_r,$_r,K_r,Z_r,qEt=H(()=>{_u();cs();ds();us();Vn();Wr();Gr();xr();yc();Gme();_Et=Ue(AEt(),1);_n();UEt={L:"left",R:"right",T:"top",B:"bottom"},IEt={L:k(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:k(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:k(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:k(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},V$={L:k((e,t)=>e-t+2,"L"),R:k((e,t)=>e-2,"R"),T:k((e,t)=>e-t+2,"T"),B:k((e,t)=>e-2,"B")},D_r=k(function(e){return ju(e)?e==="L"?"R":"L":e==="T"?"B":"T"},"getOppositeArchitectureDirection"),REt=k(function(e){let t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection"),ju=k(function(e){let t=e;return t==="L"||t==="R"},"isArchitectureDirectionX"),Qx=k(function(e){let t=e;return t==="T"||t==="B"},"isArchitectureDirectionY"),R5e=k(function(e,t){let r=ju(e)&&Qx(t),n=Qx(e)&&ju(t);return r||n},"isArchitectureDirectionXY"),N_r=k(function(e){let t=e[0],r=e[1],n=ju(t)&&Qx(r),i=Qx(t)&&ju(r);return n||i},"isArchitecturePairXY"),__r=k(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),U5e=k(function(e,t){let r=`${e}${t}`;return __r(r)?r:void 0},"getArchitectureDirectionPair"),P_r=k(function([e,t],r){let n=r[0],i=r[1];return ju(n)?Qx(i)?[e+(n==="L"?-1:1),t+(i==="T"?1:-1)]:[e+(n==="L"?-1:1),t]:ju(i)?[e+(i==="L"?1:-1),t+(n==="T"?1:-1)]:[e,t+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),O_r=k(function(e){return e==="LT"||e==="TL"?[1,1]:e==="BL"||e==="LB"?[1,-1]:e==="BR"||e==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),B_r=k(function(e,t){return R5e(e,t)?"bend":ju(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),F_r=k(function(e){return e.type==="service"},"isArchitectureService"),z_r=k(function(e){return e.type==="junction"},"isArchitectureJunction"),MEt=k((e,t)=>{let[r,n]=[e,t].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),LEt=k(e=>e.data(),"edgeData"),MA=k(e=>e.data(),"nodeData"),G_r=Xr.architecture,DEt=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=sn,this.getAccTitle=pn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getAccDescription=gn,this.setAccDescription=mn,this.clear()}static{k(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",$r()}addService({id:e,icon:t,in:r,title:n,iconText:i}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(r)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:t,iconText:i,title:n,edges:[],in:r})}getServices(){return[...this.nodes.values()].filter(F_r)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(z_r)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:r,title:n}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(r)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:t,title:n,in:r})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:l}){if(!REt(r))throw new Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!REt(n))throw new Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!this.nodes.has(e)&&!this.groups.has(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(!this.nodes.has(t)&&!this.groups.has(t))throw new Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let u=this.nodes.get(e).in,d=this.nodes.get(t).in;if(o&&u&&d&&u==d)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&&u&&d&&u==d)throw new Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let h={lhsId:e,lhsDir:r,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:n,rhsInto:a,rhsGroup:s,title:l};this.edges.push(h);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(r=>{if(this.registeredIds.get(r)!=="node")throw new Error(`align ${e.direction} references [${r}], which is not a service or junction`);if(t.has(r))throw new Error(`align ${e.direction} lists [${r}] more than once`);t.add(r)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[o,s]of this.nodes.entries()){let l=new Map;for(let u of s.edges){let d=this.getNode(u.lhsId)?.in,h=this.getNode(u.rhsId)?.in;if(d&&h&&d!==h){let f=B_r(u.lhsDir,u.rhsDir);f!=="bend"&&e.set(MEt(d,h),f)}if(u.lhsId===o){let f=U5e(u.lhsDir,u.rhsDir);f&&l.set(f,u.rhsId)}else{let f=U5e(u.rhsDir,u.lhsDir);f&&l.set(f,u.lhsId)}}t.set(o,l)}let r=new Set,n=new Set(t.keys()),i=k(o=>{let s=new Map([[o,[0,0]]]),l=[o];for(;l.length>0;){let u=l.shift();if(u){r.add(u),n.delete(u);let d=t.get(u);if(!d)throw new Error(`BFS error: adjacency list for id ${u} not found. Please report this as a bug.`);let h=s.get(u);if(!h)throw new Error(`BFS error: position for id ${u} not found in spatial map. Please report this as a bug.`);let[f,p]=h;d.forEach((m,g)=>{r.has(m)||(s.set(m,P_r([f,p],g)),l.push(m))})}}return s},"BFS"),a=[];for(;n.size>0;){let o=n.values().next().value;a.push(i(o))}this.dataStructures={adjList:t,spatialMaps:a,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return Kn({...G_r,...Kt().architecture})}getConfigField(e){return this.getConfig()[e]}},W_r=k((e,t)=>{ra(e,t),e.groups.map(r=>t.addGroup(r)),e.services.map(r=>t.addService({...r,type:"service"})),e.junctions.map(r=>t.addJunction({...r,type:"junction"})),e.edges.map(r=>t.addEdge(r)),e.alignments?.map(r=>t.addLayoutHint({direction:r.direction,members:[...r.members]}))},"populateDb"),NEt={parser:{yy:void 0},parse:k(async e=>{let t=await Lo("architecture",e);ye.debug(t);let r=NEt.parser?.yy;if(!(r instanceof DEt))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");W_r(t,r)},"parse")},V_r=k(e=>` - .edge { - stroke-width: ${e.archEdgeWidth}; - stroke: ${e.archEdgeColor}; - fill: none; - } - - .arrow { - fill: ${e.archEdgeArrowColor}; - } - - .node-bkg { - fill: none; - stroke: ${e.archGroupBorderColor}; - stroke-width: ${e.archGroupBorderWidth}; - stroke-dasharray: 8; - } - .node-icon-text { - display: flex; - align-items: center; - } - - .node-icon-text > div { - color: #fff; - margin: 1px; - height: fit-content; - text-align: center; - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - } -`,"getStyles"),H_r=V_r;k(I5e,"withSeededRandom");RA=k(e=>`${e}`,"wrapIcon"),CD={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:RA('')},server:{body:RA('')},disk:{body:RA('')},internet:{body:RA('')},cloud:{body:RA('')},unknown:Dce,blank:{body:RA("")}}},q_r=k(async function(e,t,r,n){let i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),o=a/2,s=a/6,l=s/2;await Promise.all(t.edges().map(async u=>{let{source:d,sourceDir:h,sourceArrow:f,sourceGroup:p,target:m,targetDir:g,targetArrow:y,targetGroup:v,label:b}=LEt(u),{x,y:E}=u[0].sourceEndpoint(),{x:w,y:T}=u[0].midpoint(),{x:C,y:S}=u[0].targetEndpoint(),R=i+4;if(p&&(ju(h)?x+=h==="L"?-R:R:E+=h==="T"?-R:R+18),v&&(ju(g)?C+=g==="L"?-R:R:S+=g==="T"?-R:R+18),!p&&r.getNode(d)?.type==="junction"&&(ju(h)?x+=h==="L"?o:-o:E+=h==="T"?o:-o),!v&&r.getNode(m)?.type==="junction"&&(ju(g)?C+=g==="L"?o:-o:S+=g==="T"?o:-o),u[0]._private.rscratch){let U=e.insert("g");if(U.insert("path").attr("d",`M ${x},${E} L ${w},${T} L${C},${S} `).attr("class","edge").attr("id",`${n}-${tg(d,m,{prefix:"L"})}`),f){let L=ju(h)?V$[h](x,s):x-l,I=Qx(h)?V$[h](E,s):E-l;U.insert("polygon").attr("points",IEt[h](s)).attr("transform",`translate(${L},${I})`).attr("class","arrow")}if(y){let L=ju(g)?V$[g](C,s):C-l,I=Qx(g)?V$[g](S,s):S-l;U.insert("polygon").attr("points",IEt[g](s)).attr("transform",`translate(${L},${I})`).attr("class","arrow")}if(b){let L=R5e(h,g)?"XY":ju(h)?"X":"Y",I=0;L==="X"?I=Math.abs(x-C):L==="Y"?I=Math.abs(E-S)/1.5:I=Math.abs(x-C)/2;let A=U.append("g");if(await Ll(A,b,{useHtmlLabels:!1,width:I,classes:"architecture-service-label"},je()),A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),L==="X")A.attr("transform","translate("+w+", "+T+")");else if(L==="Y")A.attr("transform","translate("+w+", "+T+") rotate(-90)");else if(L==="XY"){let P=U5e(h,g);if(P&&N_r(P)){let D=A.node().getBoundingClientRect(),[M,O]=O_r(P);A.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*M*O*45})`);let _=A.node().getBoundingClientRect();A.attr("transform",` - translate(${w}, ${T-D.height/2}) - translate(${M*_.width/2}, ${O*_.height/2}) - rotate(${-1*M*O*45}, 0, ${D.height/2}) - `)}}}}}))},"drawEdges"),Y_r=k(async function(e,t,r,n){let a=r.getConfigField("padding")*.75,o=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(t.nodes().map(async u=>{let d=MA(u);if(d.type==="group"){let{h,w:f,x1:p,y1:m}=u.boundingBox(),g=e.append("rect");g.attr("id",`${n}-group-${d.id}`).attr("x",p+l).attr("y",m+l).attr("width",f).attr("height",h).attr("class","node-bkg");let y=e.append("g"),v=p,b=m;if(d.icon){let x=y.append("g");x.html(`${await Ah(d.icon,{height:a,width:a,fallbackPrefix:CD.prefix})}`),x.attr("transform","translate("+(v+l+1)+", "+(b+l+1)+")"),v+=a,b+=o/2-1-2}if(d.label){let x=y.append("g");await Ll(x,d.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},je()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(v+l+4)+", "+(b+l+2)+")")}r.setElementForId(d.id,g)}}))},"drawGroups"),j_r=k(async function(e,t,r,n){let i=je();for(let a of r){let o=t.append("g"),s=e.getConfigField("iconSize");if(a.title){let h=o.append("g");await Ll(h,a.title,{useHtmlLabels:!1,width:s*1.5,classes:"architecture-service-label"},i),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),h.attr("transform","translate("+s/2+", "+s+")")}let l=o.append("g");if(a.icon)l.html(`${await Ah(a.icon,{height:s,width:s,fallbackPrefix:CD.prefix})}`);else if(a.iconText){l.html(`${await Ah("blank",{height:s,width:s,fallbackPrefix:CD.prefix})}`);let p=l.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(rn(a.iconText,i)),m=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/m)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`);o.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");let{width:u,height:d}=o.node().getBBox();a.width=u,a.height=d,e.setElementForId(a.id,o)}return 0},"drawServices"),X_r=k(function(e,t,r,n){r.forEach(i=>{let a=t.append("g"),o=e.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",o).attr("height",o),a.attr("class","architecture-junction");let{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,e.setElementForId(i.id,a)})},"drawJunctions");Vk([{name:CD.prefix,icons:CD}]);zf.use(_Et.default);k(PEt,"addServices");k(OEt,"addJunctions");k(BEt,"positionNodes");k(FEt,"addGroups");k(zEt,"addEdges");k(GEt,"getAlignments");k(WEt,"getRelativeConstraints");k(VEt,"layoutArchitecture");$_r=k(async(e,t,r,n)=>{let i=n.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),d=Mi(t),h=d.append("g");h.attr("class","architecture-edges");let f=d.append("g");f.attr("class","architecture-services");let p=d.append("g");p.attr("class","architecture-groups"),await j_r(i,f,a,t),X_r(i,f,o,t);let m=await VEt(a,o,s,l,i,u);await q_r(h,m,i,t),await Y_r(p,m,i,t),BEt(i,m),qm(void 0,d,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),K_r={draw:$_r},Z_r={parser:NEt,get db(){return new DEt},renderer:K_r,styles:H_r}});var bTt={};gr(bTt,{diagram:()=>fPr});function $Et(){N5e={}}function KEt(){let e=nPr,{ast:t}=N5e,r=_5e();if(!t)throw new Error("No data for EventModel");return t.frames.forEach((n,i)=>{let a=nTt(n,t.dataEntities,r);e=q$(e,{$kind:YEt,index:i,frame:n,textProps:a});let o;cTt(n)?(ye.debug("source frame",n.sourceFrames),o=t.frames.filter(s=>n.sourceFrames.some(l=>l.$refText===s.name)),o.forEach(s=>{e=q$(e,{$kind:M5e,index:i,frame:n,sourceFrame:s})})):e=q$(e,{$kind:M5e,index:i,frame:n})}),e={...e,sortedSwimlanesArray:P5e(e.swimlanes)},e}function ZEt(e){N5e.ast=e}function _5e(){return Pi}function QEt(e){let t=e.split(".");if(t.length===2)return t[0]}function JEt(e){let t=e.split(".");return t.length===2?t[1]:e}function eTt(e,t){if(!(!t||t.length===0))return Object.values(e).find(r=>r.namespace===t)}function H$(e,t,r){return Math.max(t,...Object.keys(e).filter(n=>{let i=Number.parseInt(n);return i>t&&iNumber.parseInt(n)))+1}function tTt(e,t){let r=QEt(e.entityIdentifier),n=eTt(t,r);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Pi.labelUiAutomation}:r?{index:H$(t,0,100),label:Pi.labelUiAutomationPrefix+r}:{index:0,label:Pi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Pi.labelCommandReadModel}:r?{index:H$(t,100,200),label:Pi.labelCommandReadModelPrefix+r}:{index:100,label:Pi.labelCommandReadModel};default:return n?{index:n.index,label:n.namespace||Pi.labelEvents}:r?{index:H$(t,200,300),label:Pi.labelEventsPrefix+r}:{index:200,label:Pi.labelEvents}}}function rTt(e){let{themeVariables:t}=Kt();switch(e.modelEntityType){case"ui":return{fill:t.emUiFill??"white",stroke:t.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:t.emProcessorFill??"#edb3f6",stroke:t.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:t.emReadModelFill??"#d3f1a2",stroke:t.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:t.emCommandFill??"#bcd6fe",stroke:t.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:t.emEventFill??"#ffb778",stroke:t.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}function nTt(e,t,r){let n=Kt(),i=rn(JEt(e.entityIdentifier)??"",n),a,o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "},l=`${v4(i,r.textMaxWidth,o)}`;if(e.dataInlineValue&&(a=e.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=rn(a,n),a=v4(a,r.textMaxWidth,o),a=a.replaceAll(" "," ")),e.dataReference){let m=t.find(g=>g.name===e.dataReference?.$refText);m&&(a=m.dataBlockValue,a=a.substring(a.indexOf(`{ -`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=rn(a,n),a=v4(a,r.textMaxWidth,o),a=a.replaceAll(" "," "),a+="
    ")}let u=a!==void 0;u&&(l+=`

    ${a}`);let d={fontSize:o.fontSize,fontWeight:o.fontWeight,fontFamily:o.fontFamily},h=YI(l,d),f=u?h.width/3:h.width,p={content:l,width:f,height:h.height};return ye.debug(`[${e.name}] ${e.entityIdentifier} text`,p),p}function iTt(e,t){let r=t,n=rTt(r.frame),i={width:r.textProps.width+2*Pi.boxTextPadding,height:r.textProps.height+2*Pi.boxTextPadding};return[{$kind:jEt,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}function aTt(e,t,r){return t===void 0?Pi.contentStartX:t.index===e.index&&e.r?e.r+Pi.boxPadding:r===void 0?Pi.contentStartX:r.r-Pi.boxOverlap+Pi.boxPadding}function oTt(e,t){let r=[...e.map(n=>n.r),t];return Math.max(...r)}function P5e(e){return Object.values(e).sort((t,r)=>t.index-r.index)}function sTt(e,t){let r=t,n=tTt(r.frame,e.swimlanes),i;n.index in e.swimlanes?i=e.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*Pi.swimlaneMinHeight+Pi.swimlaneGap,height:Pi.swimlaneMinHeight,maxHeight:Pi.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,s={width:Math.max(Pi.boxMinWidth,Math.min(Pi.boxMaxWidth,r.dimension.width))+2*Pi.boxPadding,height:Math.max(Pi.boxMinHeight,Math.min(Pi.boxMaxHeight,r.dimension.height))+2*Pi.boxPadding},l=aTt(i,o,a),u=l+s.width+Pi.boxPadding,d=oTt(Object.values(e.swimlanes),u);i.r=l+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(Pi.swimlaneMinHeight,i.maxHeight)+2*Pi.swimlanePadding;let h={x:l,y:Pi.swimlanePadding+i.y,r:u,dimension:s,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...e,boxes:[...e.boxes,h],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:d},p=P5e(f.swimlanes);p.length>0&&(p[0].y=0);for(let m=1;m0}function L5e(e,t){if(t!=null)return e.find(r=>r.frame.name===t.name)}function uTt(e,t,r){if(!(r<0))for(let n=r;n>=0;n--){let i=e[n];if(i.swimlane.index!==t)return i}}function dTt(e,t){let r=t;if(AX(r.frame)||lTt(r.index,r.frame))return[];let n=L5e(e.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=L5e(e.boxes,r.sourceFrame):i=uTt(e.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:XEt,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}function hTt(e,t){let r=t,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...e,relations:[...e.relations,n]}}function fTt(e,t){let r=iPr[t.$kind];if(r==null)return[];let n=r(e,t);return ye.debug("decided events",n),n}function pTt(e,t){let r=t.reduce((n,i)=>{let a=aPr[i.$kind];return a==null?n:a(n,i)},e);return ye.debug("evolve events",{state:e,newState:r,events:t}),r}function q$(e,t){let r=fTt(e,t);return pTt(e,r)}function mTt(e,t){return r=>{let n=r.swimlane.y+t.swimlanePadding,i=e.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+t.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*t.boxPadding).attr("height",r.dimension.height-2*t.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}function gTt(e,t){return e>t}function yTt(e,t,r,n){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=gTt(a,o),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3,d,h;ye.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(d=a,h=o+i.targetBox.dimension.height):(d=a+i.sourceBox.dimension.height,h=o);let f=n.emRelationStroke??i.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${d} L${u} ${h}`)}}function vTt(e,t,r,n){return i=>{let a=e.append("g").attr("class","em-swimlane"),o=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",s=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",t+r.swimlanePadding).attr("height",i.height).attr("fill",o).attr("stroke",s),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}var YEt,jEt,M5e,XEt,Q_r,J_r,ePr,tPr,rPr,N5e,Pi,nPr,iPr,aPr,D5e,oPr,sPr,lPr,cPr,uPr,dPr,hPr,fPr,xTt=H(()=>{_u();Vn();Wr();Gr();xr();yc();yc();_n();YEt="position frame",jEt="frame positioned",M5e="position relation",XEt="relation positioned",Q_r=k(function(e){ye.debug("options str",e)},"setOptions"),J_r=k(function(){return{}},"getOptions"),ePr=k(function(){$Et(),$r()},"clear");k($Et,"reset");tPr=Xr.eventmodeling,rPr=k(()=>Kn({...tPr,...Kt().eventmodeling}),"getConfig"),N5e={};k(KEt,"getState");k(ZEt,"setAst");Pi={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};k(_5e,"getDiagramProps");nPr={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};k(QEt,"extractNamespace");k(JEt,"extractName");k(eTt,"findSwimlaneByNamespace");k(H$,"findNextAvailableIndex");k(tTt,"calculateSwimlaneProps");k(rTt,"calculateEntityVisualProps");k(nTt,"calculateTextProps");k(iTt,"decidePositionFrame");k(aTt,"calculateX");k(oTt,"calculateMaxRight");k(P5e,"sortedSwimlanesArray");k(sTt,"evolveFramePositioned");k(lTt,"isFirstFrame");k(cTt,"hasSourceFrame");k(L5e,"findBoxByFrame");k(uTt,"findBoxByLineIndex");k(dTt,"decidePositionRelation");k(hTt,"evolveRelationPositioned");iPr={[YEt]:iTt,[M5e]:dTt},aPr={[jEt]:sTt,[XEt]:hTt};k(fTt,"decide");k(pTt,"evolve");k(q$,"dispatch");D5e={getConfig:rPr,setOptions:Q_r,getOptions:J_r,clear:ePr,setAccTitle:sn,getAccTitle:pn,getAccDescription:gn,setAccDescription:mn,setDiagramTitle:Sn,getDiagramTitle:yn,setAst:ZEt,getDiagramProps:_5e,getState:KEt},oPr={parse:k(async e=>{let t=await Lo("eventmodeling",e);ye.debug(t),D5e.setAst(t),ra(t,D5e)},"parse")},sPr=je(),lPr=sPr?.eventmodeling;k(mTt,"renderD3Box");k(gTt,"dirUpwards");k(yTt,"renderD3Relation");k(vTt,"renderD3Swimlane");cPr=k(function(e,t,r,n){if(ye.debug("in eventmodeling renderer",e+` -`,"id:",t,r),!lPr)throw new Error("EventModeling config not found");let i=n.db,{themeVariables:a,eventmodeling:o}=je(),s=xt(`[id="${t}"]`),l=i.getDiagramProps(),u=i.getState(),d=`em-arrowhead-${t}`,h=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(vTt(s,u.maxR,l,a)),u.boxes.forEach(mTt(s,l)),u.relations.forEach(yTt(s,l,d,a)),s.append("defs").append("marker").attr("id",d).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",h),G9(void 0,s,o?.padding??30,o?.useMaxWidth)},"draw"),uPr={draw:cPr},dPr=k(e=>"","getStyles"),hPr=dPr,fPr={parser:oPr,db:D5e,renderer:uPr,styles:hPr}});var UTt={};gr(UTt,{diagram:()=>IPr});var B5e,pPr,mPr,gPr,LA,yPr,vPr,bPr,STt,wTt,ETt,TTt,xPr,kTt,wPr,EPr,TPr,O5e,kPr,CPr,ATt,Y$,CTt,DA,SPr,APr,UPr,IPr,ITt=H(()=>{cs();Vn();Wr();Gr();xr();mr();B5e=(function(){var e=k(function(v,b,x,E){for(x=x||{},E=v.length;E--;x[v[E]]=b);return x},"o"),t=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],o=[1,20],s=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],h=[1,23],f=[1,24],p=[1,6,7,11,13,14],m={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:k(function(b,x,E,w,T,C,S){var R=C.length-1;switch(T){case 6:case 7:return w;case 15:w.addNode(C[R-1].length,C[R].trim());break;case 16:w.addNode(0,C[R].trim());break}},"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:r,7:[1,10],9:9,12:11,13:n,14:i},e(a,[2,3]),{1:[2,2]},e(a,[2,4]),e(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:o,7:s,10:17,11:l},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:o,7:s,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},e(d,[2,14],{7:h,11:f}),e(p,[2,8]),e(p,[2,9]),e(p,[2,10]),e(u,[2,15]),e(d,[2,13],{7:h,11:f}),e(p,[2,11]),e(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:k(function(b,x){if(x.recoverable)this.trace(b);else{var E=new Error(b);throw E.hash=x,E}},"parseError"),parse:k(function(b){var x=this,E=[0],w=[],T=[null],C=[],S=this.table,R="",U=0,L=0,I=0,A=2,P=1,D=C.slice.call(arguments,1),M=Object.create(this.lexer),O={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(O.yy[_]=this.yy[_]);M.setInput(b,O.yy),O.yy.lexer=M,O.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var B=M.yylloc;C.push(B);var F=M.options&&M.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(Ye){E.length=E.length-2*Ye,T.length=T.length-Ye,C.length=C.length-Ye}k(G,"popStack");function z(){var Ye;return Ye=w.pop()||M.lex()||P,typeof Ye!="number"&&(Ye instanceof Array&&(w=Ye,Ye=w.pop()),Ye=x.symbols_[Ye]||Ye),Ye}k(z,"lex");for(var V,$,Z,re,Q,ge,ie={},pe,ue,fe,Me;;){if(Z=E[E.length-1],this.defaultActions[Z]?re=this.defaultActions[Z]:((V===null||typeof V>"u")&&(V=z()),re=S[Z]&&S[Z][V]),typeof re>"u"||!re.length||!re[0]){var Ce="";Me=[];for(pe in S[Z])this.terminals_[pe]&&pe>A&&Me.push("'"+this.terminals_[pe]+"'");M.showPosition?Ce="Parse error on line "+(U+1)+`: -`+M.showPosition()+` -Expecting `+Me.join(", ")+", got '"+(this.terminals_[V]||V)+"'":Ce="Parse error on line "+(U+1)+": Unexpected "+(V==P?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(Ce,{text:M.match,token:this.terminals_[V]||V,line:M.yylineno,loc:B,expected:Me})}if(re[0]instanceof Array&&re.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+V);switch(re[0]){case 1:E.push(V),T.push(M.yytext),C.push(M.yylloc),E.push(re[1]),V=null,$?(V=$,$=null):(L=M.yyleng,R=M.yytext,U=M.yylineno,B=M.yylloc,I>0&&I--);break;case 2:if(ue=this.productions_[re[1]][1],ie.$=T[T.length-ue],ie._$={first_line:C[C.length-(ue||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(ue||1)].first_column,last_column:C[C.length-1].last_column},F&&(ie._$.range=[C[C.length-(ue||1)].range[0],C[C.length-1].range[1]]),ge=this.performAction.apply(ie,[R,L,U,O.yy,re[1],T,C].concat(D)),typeof ge<"u")return ge;ue&&(E=E.slice(0,-1*ue*2),T=T.slice(0,-1*ue),C=C.slice(0,-1*ue)),E.push(this.productions_[re[1]][0]),T.push(ie.$),C.push(ie._$),fe=S[E[E.length-2]][E[E.length-1]],E.push(fe);break;case 3:return!0}}return!0},"parse")},g=(function(){var v={EOF:1,parseError:k(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:k(function(b,x){return this.yy=x||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var x=b.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:k(function(b){var x=b.length,E=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var w=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===w.length?this.yylloc.first_column:0)+w[w.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(b){this.unput(this.match.slice(b))},"less"),pastInput:k(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var b=this.pastInput(),x=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+x+"^"},"showPosition"),test_match:k(function(b,x){var E,w,T;if(this.options.backtrack_lexer&&(T={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&&(T.yylloc.range=this.yylloc.range.slice(0))),w=b[0].match(/(?:\r\n?|\n).*/g),w&&(this.yylineno+=w.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,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(b[0].length),this.matched+=b[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var C in T)this[C]=T[C];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,x,E,w;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),C=0;Cx[0].length)){if(x=E,w=C,this.options.backtrack_lexer){if(b=this.test_match(E,T[C]),b!==!1)return b;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(b=this.test_match(x,T[w]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var x=this.next();return x||this.lex()},"lex"),begin:k(function(x){this.conditionStack.push(x)},"begin"),popState:k(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:k(function(x){this.begin(x)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(x,E,w,T){var C=T;switch(w){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();m.lexer=g;function y(){this.yy={}}return k(y,"Parser"),y.prototype=m,m.Parser=y,new y})();B5e.parser=B5e;pPr=B5e,mPr=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{k(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,$r()}getRoot(){return this.root}addNode(e,t){let r=Lt.sanitizeText(t,je());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],Sn(r);return}this.baseLevel??=e;let n=e-this.baseLevel+1;for(n<=0&&(n=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=n;)this.stack.pop();let i=this.stack[this.stack.length-1].node,a={text:r,children:[]};i.children.push(a),this.stack.push({level:n,node:a})}getAccTitle(){return pn()}setAccTitle(e){sn(e)}getAccDescription(){return gn()}setAccDescription(e){mn(e)}getDiagramTitle(){return yn()}setDiagramTitle(e){Sn(e)}},gPr=14,LA=250,yPr=30,vPr=60,bPr=5,STt=82*Math.PI/180,wTt=Math.cos(STt),ETt=Math.sin(STt),TTt=k((e,t,r)=>{let n=e.node().getBBox(),i=n.width+t*2,a=n.height+t*2;zn(e,a,i,r),e.attr("viewBox",`${n.x-t} ${n.y-t} ${i} ${a}`)},"applyPaddedViewBox"),xPr=k((e,t,r,n)=>{let a=n.db.getRoot();if(!a)return;let o=je(),{look:s,handDrawnSeed:l,themeVariables:u}=o,d=kd(o.fontSize)[0]??gPr,h=s==="handDrawn",f=a.children??[],p=o.ishikawa?.diagramPadding??20,m=o.ishikawa?.useMaxWidth??!1,g=Mi(t),y=g.append("g").attr("class","ishikawa"),v=h?yt.svg(g.node()):void 0,b=v?{roughSvg:v,seed:l??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,x=`ishikawa-arrow-${t}`;h||y.append("defs").append("marker").attr("id",x).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let E=0,w=LA,T=h?void 0:DA(y,E,w,E,w,"ishikawa-spine");if(wPr(y,E,w,a.text,d,b),!f.length){h&&DA(y,E,w,E,w,"ishikawa-spine",b),TTt(g,p,m);return}E-=20;let C=f.filter((M,O)=>O%2===0),S=f.filter((M,O)=>O%2===1),R=kTt(C),U=kTt(S),L=R.total+U.total,I=LA,A=LA;if(L>0){let M=LA*2,O=LA*.3;I=Math.max(O,M*(R.total/L)),A=Math.max(O,M*(U.total/L))}let P=d*2;I=Math.max(I,R.max*P),A=Math.max(A,U.max*P),w=Math.max(I,LA),T&&T.attr("y1",w).attr("y2",w),y.select(".ishikawa-head-group").attr("transform",`translate(0,${w})`);let D=Math.ceil(f.length/2);for(let M=0;MMath.min(_,B.getBBox().x),1/0)}if(h)DA(y,E,w,0,w,"ishikawa-spine",b);else{T.attr("x1",E);let M=`url(#${x})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",M)}TTt(g,p,m)},"draw"),kTt=k(e=>{let t=k(r=>r.children.reduce((n,i)=>n+1+t(i),0),"countDescendants");return e.reduce((r,n)=>{let i=t(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),wPr=k((e,t,r,n,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${t},${r})`),l=Y$(s,ATt(n,o),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),d=Math.max(60,u.width+6),h=Math.max(40,u.height*2+40),f=`M 0 ${-h/2} L 0 ${h/2} Q ${d*2.4} 0 0 ${-h/2} Z`;if(a){let p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>p,":first-child").attr("class","ishikawa-head")}else s.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(d-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),EPr=k((e,t)=>{let r=[],n=[],i=k((a,o,s)=>{let l=t===-1?[...a].reverse():a;for(let u of l){let d=r.length,h=u.children??[];r.push({depth:s,text:ATt(u.text,15),parentIndex:o,childCount:h.length}),s%2===0?(n.push(d),h.length&&i(h,d,s+1)):(h.length&&i(h,d,s+1),n.push(d))}},"walk");return i(e,-1,2),{entries:r,yOrder:n}},"flattenTree"),TPr=k((e,t,r,n,i,a,o)=>{let s=e.append("g").attr("class","ishikawa-label-group"),u=Y$(s,t,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(o){let d=o.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>d,":first-child").attr("class","ishikawa-label-box")}else s.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),O5e=k((e,t,r,n,i,a)=>{let o=Math.sqrt(n*n+i*i);if(o===0)return;let s=n/o,l=i/o,u=6,d=-l*u,h=s*u,f=t,p=r,m=`M ${f} ${p} L ${f-s*u*2+d} ${p-l*u*2+h} L ${f-s*u*2-d} ${p-l*u*2-h} Z`,g=a.roughSvg.path(m,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});e.append(()=>g)},"drawArrowMarker"),kPr=k((e,t,r,n,i,a,o,s)=>{let l=t.children??[],u=a*(l.length?1:.2),d=-wTt*u,h=ETt*u*i,f=r+d,p=n+h;if(DA(e,r,n,f,p,"ishikawa-branch",s),s&&O5e(e,r,n,r-f,n-p,s),TPr(e,t.text,f,p,i,o,s),!l.length)return;let{entries:m,yOrder:g}=EPr(l,i),y=m.length,v=new Array(y);for(let[T,C]of g.entries())v[C]=n+h*((T+1)/(y+1));let b=new Map;b.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});let x=-wTt,E=ETt*i,w=i<0?"ishikawa-label up":"ishikawa-label down";for(let[T,C]of m.entries()){let S=v[T],R=b.get(C.parentIndex),U=e.append("g").attr("class","ishikawa-sub-group"),L=0,I=0,A=0;if(C.depth%2===0){let P=R.y1-R.y0;L=CTt(R.x0,R.x1,P?(S-R.y0)/P:.5),I=S,A=L-(C.childCount>0?vPr+C.childCount*bPr:yPr),DA(U,L,S,A,S,"ishikawa-sub-branch",s),s&&O5e(U,L,S,1,0,s),Y$(U,C.text,A,S,"ishikawa-label align","end",o)}else{let P=R.childrenDrawn++;L=CTt(R.x0,R.x1,(R.childCount-P)/(R.childCount+1)),I=R.y0,A=L+x*((S-I)/E),DA(U,L,I,A,S,"ishikawa-sub-branch",s),s&&O5e(U,L,I,L-A,I-S,s),Y$(U,C.text,A,S,w,"end",o)}C.childCount>0&&b.set(T,{x0:L,y0:I,x1:A,y1:S,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),CPr=k(e=>e.split(/|\n/),"splitLines"),ATt=k((e,t)=>{if(e.length<=t)return e;let r=[];for(let n of e.split(/\s+/)){let i=r.length-1;i>=0&&r[i].length+1+n.length<=t?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),Y$=k((e,t,r,n,i,a,o)=>{let s=CPr(t),l=o*1.05,u=e.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(s.length-1)*l/2);for(let[d,h]of s.entries())u.append("tspan").attr("x",r).attr("dy",d===0?0:l).text(h);return u},"drawMultilineText"),CTt=k((e,t,r)=>e+(t-e)*r,"lerp"),DA=k((e,t,r,n,i,a,o)=>{if(o){let s=o.roughSvg.line(t,r,n,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr("class",a);return}return e.append("line").attr("class",a).attr("x1",t).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),SPr={draw:xPr},APr=k(e=>` -.ishikawa .ishikawa-spine, -.ishikawa .ishikawa-branch, -.ishikawa .ishikawa-sub-branch { - stroke: ${e.lineColor}; - stroke-width: 2; - fill: none; -} - -.ishikawa .ishikawa-sub-branch { - stroke-width: 1; -} - -.ishikawa .ishikawa-arrow { - fill: ${e.lineColor}; -} - -.ishikawa .ishikawa-head { - fill: ${e.mainBkg}; - stroke: ${e.lineColor}; - stroke-width: 2; -} - -.ishikawa .ishikawa-label-box { - fill: ${e.mainBkg}; - stroke: ${e.lineColor}; - stroke-width: 2; -} - -.ishikawa text { - font-family: ${e.fontFamily}; - font-size: ${e.fontSize}; - fill: ${e.textColor}; -} - -.ishikawa .ishikawa-head-label { - font-weight: 600; - text-anchor: middle; - dominant-baseline: middle; - font-size: 14px; -} - -.ishikawa .ishikawa-label { - text-anchor: end; -} - -.ishikawa .ishikawa-label.cause { - text-anchor: middle; - dominant-baseline: middle; -} - -.ishikawa .ishikawa-label.align { - text-anchor: end; - dominant-baseline: middle; -} - -.ishikawa .ishikawa-label.up { - dominant-baseline: baseline; -} - -.ishikawa .ishikawa-label.down { - dominant-baseline: hanging; -} -`,"getStyles"),UPr=APr,IPr={parser:pPr,get db(){return new mPr},renderer:SPr,styles:UPr}});function j$(e,t){let r=MPr(e),n=r.filter(s=>RPr(s,e)),i=0,a=0,o=[];if(n.length>1){let s=DTt(n);for(let u=0;ud.angle-u.angle);let l=n[n.length-1];for(let u=0;um.radius*2&&(x=m.radius*2),(f==null||f.width>x)&&(f={circle:m,width:x,p1:d,p2:l,large:x>m.radius,sweep:!0})}f!=null&&(o.push(f),i+=G5e(f.circle.radius,f.width),l=d)}}else{let s=e[0];for(let u=1;uMath.abs(s.radius-e[u].radius)){l=!0;break}l?i=a=0:(i=s.radius*s.radius*Math.PI,o.push({circle:s,p1:{x:s.x,y:s.y+s.radius},p2:{x:s.x-1e-10,y:s.y+s.radius},width:s.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=n,t.intersectionPoints=r),i+a}function RPr(e,t){return t.every(r=>$d(e,r)=e+t)return 0;if(r<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let n=e-(r*r-t*t+e*e)/(2*r),i=t-(r*r-e*e+t*t)/(2*r);return G5e(e,n)+G5e(t,i)}function LTt(e,t){let r=$d(e,t),n=e.radius,i=t.radius;if(r>=n+i||r<=Math.abs(n-i))return[];let a=(n*n-i*i+r*r)/(2*r),o=Math.sqrt(n*n-a*a),s=e.x+a*(t.x-e.x)/r,l=e.y+a*(t.y-e.y)/r,u=-(t.y-e.y)*(o/r),d=-(t.x-e.x)*(o/r);return[{x:s+u,y:l-d},{x:s-u,y:l+d}]}function DTt(e){let t={x:0,y:0};for(let r of e)t.x+=r.x,t.y+=r.y;return t.x/=e.length,t.y/=e.length,t}function LPr(e,t,r,n){n=n||{};let i=n.maxIterations||100,a=n.tolerance||1e-10,o=e(t),s=e(r),l=r-t;if(o*s>0)throw"Initial bisect points must have opposite signs";if(o===0)return t;if(s===0)return r;for(let u=0;u=0&&(t=d),Math.abs(l)W5e(t))}function NA(e,t){let r=0;for(let n=0;nw.fx-T.fx,v=t.slice(),b=t.slice(),x=t.slice(),E=t.slice();for(let w=0;w{let R=S.slice();return R.fx=S.fx,R.id=S.id,R});C.sort((S,R)=>S.id-R.id),r.history.push({x:m[0].slice(),fx:m[0].fx,simplex:C})}f=0;for(let C=0;C=m[p-1].fx){let C=!1;if(b.fx>T.fx?(gv(x,1+d,v,-d,T),x.fx=e(x),x.fx=1)break;for(let S=1;Ss+a*i*l||u>=y)g=i;else{if(Math.abs(h)<=-o*l)return i;h*(g-m)>=0&&(g=m),m=i,y=u}return 0}for(let m=0;m<10;++m){if(gv(n.x,1,r.x,i,t),u=n.fx=e(n.x,n.fxprime),h=NA(n.fxprime,t),u>s+a*i*l||m&&u>=d)return p(f,i,d);if(Math.abs(h)<=-o*l)return i;if(h>=0)return p(i,f,u);d=u,f=i,i*=2}return i}function NPr(e,t,r){let n={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,l=1,u;r=r||{},u=r.maxIterations||t.length*20,n.fx=e(n.x,n.fxprime),o=n.fxprime.slice(),H5e(o,n.fxprime,-1);for(let d=0;d{let h={};for(let f=0;fj5e(e,t,n)-r,0,e+t)}function _Pr(e,t={}){let r=t.distinct,n=e.map(s=>Object.assign({},s));function i(s){return s.join(";")}if(r){let s=new Map;for(let l of n)for(let u=0;us===l?0:sa.sets.length===2).forEach(a=>{let o=r[a.sets[0]],s=r[a.sets[1]],l=Math.sqrt(t[o].size/Math.PI),u=Math.sqrt(t[s].size/Math.PI),d=q5e(l,u,a.size);n[o][s]=n[s][o]=d;let h=0;a.size+1e-10>=Math.min(t[o].size,t[s].size)?h=1:a.size<=1e-10&&(h=-1),i[o][s]=i[s][o]=h}),{distances:n,constraints:i}}function OPr(e,t,r,n){for(let a=0;a0&&m<=h||f<0&&m>=h||(i+=2*g*g,t[2*a]+=4*g*(o-u),t[2*a+1]+=4*g*(s-d),t[2*l]+=4*g*(u-o),t[2*l+1]+=4*g*(d-s))}}return i}function BPr(e,t={}){let r=zPr(e,t),n=t.lossFunction||_A;if(e.length>=8){let i=FPr(e,t),a=n(i,e),o=n(r,e);a+1e-8f.map(p=>p/s));let l=(f,p)=>OPr(f,p,a,o),u=null;for(let f=0;fh.sets.length===2);for(let h of e){let f=h.weight!=null?h.weight:1,p=h.sets[0],m=h.sets[1];h.size+PTt>=Math.min(n[p].size,n[m].size)&&(f=0),i[p].push({set:m,size:h.size,weight:f}),i[m].push({set:p,size:h.size,weight:f})}let a=[];Object.keys(i).forEach(h=>{let f=0;for(let p=0;pe[o]));let a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function OTt(e,t){let r=0;for(let n of t){if(n.sets.length===1)continue;let i;if(n.sets.length===2){let s=e[n.sets[0]],l=e[n.sets[1]];i=j5e(s.radius,l.radius,$d(s,l))}else i=j$(n.sets.map(s=>e[s]));let a=n.weight!=null?n.weight:1,o=Math.log((i+1)/(n.size+1));r+=a*o*o}return r}function GPr(e,t,r){if(r==null?e.sort((i,a)=>a.radius-i.radius):e.sort(r),e.length>0){let i=e[0].x,a=e[0].y;for(let o of e)o.x-=i,o.y-=a}if(e.length===2&&$d(e[0],e[1])1){let i=Math.atan2(e[1].x,e[1].y)-t,a=Math.cos(i),o=Math.sin(i);for(let s of e){let l=s.x,u=s.y;s.x=a*l-o*u,s.y=o*l+a*u}}if(e.length>2){let i=Math.atan2(e[2].x,e[2].y)-t;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){let a=e[1].y/(1e-10+e[1].x);for(let o of e){var n=(o.x+a*o.y)/(1+a*a);o.x=2*n-o.x,o.y=2*n*a-o.y}}}}function WPr(e){e.forEach(i=>{i.parent=i});function t(i){return i.parent!==i&&(i.parent=t(i.parent)),i.parent}function r(i,a){let o=t(i),s=t(a);o.parent=s}for(let i=0;i{delete i.parent}),Array.from(n.values())}function Y5e(e){let t=r=>{let n=e.reduce((a,o)=>Math.max(a,o[r]+o.radius),Number.NEGATIVE_INFINITY),i=e.reduce((a,o)=>Math.min(a,o[r]-o.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:t("x"),yRange:t("y")}}function BTt(e,t,r){t==null&&(t=Math.PI/2);let n=GTt(e).map(u=>Object.assign({},u)),i=WPr(n);for(let u of i){GPr(u,t,r);let d=Y5e(u);u.size=(d.xRange.max-d.xRange.min)*(d.yRange.max-d.yRange.min),u.bounds=d}i.sort((u,d)=>d.size-u.size),n=i[0];let a=n.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(u,d,h){if(!u)return;let f=u.bounds,p,m;if(d)p=a.xRange.max-f.xRange.min+o;else{p=a.xRange.max-f.xRange.max;let g=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;g<0&&(p+=g)}if(h)m=a.yRange.max-f.yRange.min+o;else{m=a.yRange.max-f.yRange.max;let g=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;g<0&&(m+=g)}for(let g of u)g.x+=p,g.y+=m,n.push(g)}let l=1;for(;l({radius:d*p.radius,x:n+h+(p.x-o.min)*d,y:n+f+(p.y-s.min)*d,setid:p.setid})))}function zTt(e){let t={};for(let r of e)t[r.setid]=r;return t}function GTt(e){return Object.keys(e).map(r=>Object.assign(e[r],{setid:r}))}function WTt(e={}){let t=!1,r=600,n=350,i=15,a=1e3,o=Math.PI/2,s=!0,l=null,u=!0,d=!0,h=null,f=null,p=!1,m=null,g=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,y={},v=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],b=0,x=function(C){if(C in y)return y[C];var S=y[C]=v[b];return b+=1,b>=v.length&&(b=0),S},E=_Tt,w=_A;function T(C){let S=C.datum(),R=new Set;S.forEach(Q=>{Q.size==0&&Q.sets.length==1&&R.add(Q.sets[0])}),S=S.filter(Q=>!Q.sets.some(ge=>R.has(ge)));let U={},L={};if(S.length>0){let Q=E(S,{lossFunction:w,distinct:p});s&&(Q=BTt(Q,o,f)),U=FTt(Q,r,n,i,l),L=HTt(U,S,g)}let I={};S.forEach(Q=>{Q.label&&(I[Q.sets]=Q.label)});function A(Q){if(Q.sets in I)return I[Q.sets];if(Q.sets.length==1)return""+Q.sets[0]}C.selectAll("svg").data([U]).enter().append("svg");let P=C.select("svg");t?P.attr("viewBox",`0 0 ${r} ${n}`):P.attr("width",r).attr("height",n);let D={},M=!1;P.selectAll(".venn-area path").each(function(Q){let ge=this.getAttribute("d");Q.sets.length==1&&ge&&!p&&(M=!0,D[Q.sets[0]]=qPr(ge))});function O(Q){return ge=>{let ie=Q.sets.map(pe=>{let ue=D[pe],fe=U[pe];return ue||(ue={x:r/2,y:n/2,radius:1}),fe||(fe={x:r/2,y:n/2,radius:1}),{x:ue.x*(1-ge)+fe.x*ge,y:ue.y*(1-ge)+fe.y*ge,radius:ue.radius*(1-ge)+fe.radius*ge}});return MTt(ie,m)}}let _=P.selectAll(".venn-area").data(S,Q=>Q.sets),B=_.enter().append("g").attr("class",Q=>`venn-area venn-${Q.sets.length==1?"circle":"intersection"}${Q.colour||Q.color?" venn-coloured":""}`).attr("data-venn-sets",Q=>Q.sets.join("_")),F=B.append("path"),G=B.append("text").attr("class","label").text(Q=>A(Q)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);d&&(F.style("fill-opacity","0").filter(Q=>Q.sets.length==1).style("fill",Q=>Q.colour?Q.colour:Q.color?Q.color:x(Q.sets)).style("fill-opacity",".25"),G.style("fill",Q=>Q.colour||Q.color?"#FFF":e.textFill?e.textFill:Q.sets.length==1?x(Q.sets):"#444"));function z(Q){return typeof Q.transition=="function"?Q.transition("venn").duration(a):Q}let V=C;M&&typeof V.transition=="function"?(V=z(C),V.selectAll("path").attrTween("d",O)):V.selectAll("path").attr("d",Q=>MTt(Q.sets.map(ge=>U[ge])),m);let $=V.selectAll("text").filter(Q=>Q.sets in L).text(Q=>A(Q)).attr("x",Q=>Math.floor(L[Q.sets].x)).attr("y",Q=>Math.floor(L[Q.sets].y));u&&(M?"on"in $?$.on("end",F5e(U,A)):$.each("end",F5e(U,A)):$.each(F5e(U,A)));let Z=z(_.exit()).remove();typeof _.transition=="function"&&Z.selectAll("path").attrTween("d",O);let re=Z.selectAll("text").attr("x",r/2).attr("y",n/2);return h!==null&&(G.style("font-size","0px"),$.style("font-size",h),re.style("font-size","0px")),{circles:U,textCentres:L,nodes:_,enter:B,update:V,exit:Z}}return T.wrap=function(C){return arguments.length?(u=C,T):u},T.useViewBox=function(){return t=!0,T},T.width=function(C){return arguments.length?(r=C,T):r},T.height=function(C){return arguments.length?(n=C,T):n},T.padding=function(C){return arguments.length?(i=C,T):i},T.distinct=function(C){return arguments.length?(p=C,T):p},T.colours=function(C){return arguments.length?(x=C,T):x},T.colors=function(C){return arguments.length?(x=C,T):x},T.fontSize=function(C){return arguments.length?(h=C,T):h},T.round=function(C){return arguments.length?(m=C,T):m},T.duration=function(C){return arguments.length?(a=C,T):a},T.layoutFunction=function(C){return arguments.length?(E=C,T):E},T.normalize=function(C){return arguments.length?(s=C,T):s},T.scaleToFit=function(C){return arguments.length?(l=C,T):l},T.styled=function(C){return arguments.length?(d=C,T):d},T.orientation=function(C){return arguments.length?(o=C,T):o},T.orientationOrder=function(C){return arguments.length?(f=C,T):f},T.lossFunction=function(C){return arguments.length?(w=C==="default"?_A:C==="logRatio"?OTt:C,T):w},T}function F5e(e,t){return function(r){let n=this,i=e[r.sets[0]].radius||50,a=t(r)||"",o=a.split(/\s+/).reverse(),l=(a.length+o.length)/3,u=o.pop(),d=[u],h=0,f=1.1;n.textContent=null;let p=[];function m(x){let E=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return E.textContent=x,p.push(E),n.append(E),E}let g=m(u);for(;u=o.pop(),!!u;){d.push(u);let x=d.join(" ");g.textContent=x,x.length>l&&g.getComputedTextLength()>i&&(d.pop(),g.textContent=d.join(" "),d=[u],g=m(u),h++)}let y=.35-h*f/2,v=n.getAttribute("x"),b=n.getAttribute("y");p.forEach((x,E)=>{x.setAttribute("x",v),x.setAttribute("y",b),x.setAttribute("dy",`${y+E*f}em`)})}}function z5e(e,t,r){let n=t[0].radius-$d(t[0],e);for(let i=1;i=a&&(i=n[d],a=h)}let o=NTt(d=>-1*z5e({x:d[0],y:d[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:r?0:o[0],y:o[1]},l=!0;for(let d of e)if($d(s,d)>d.radius){l=!1;break}for(let d of t)if($d(s,d)d.p1))}function VPr(e){let t={},r=Object.keys(e);for(let n of r)t[n]=[];for(let n=0;n0&&console.log("WARNING: area "+o+" not represented on screen")}return n}function HPr(e,t,r){let n=[];return n.push(` -M`,e,t),n.push(` -m`,-r,0),n.push(` -a`,r,r,0,1,0,r*2,0),n.push(` -a`,r,r,0,1,0,-r*2,0),n.join(" ")}function qPr(e){let t=e.split(" ");return{x:Number.parseFloat(t[1]),y:Number.parseFloat(t[2]),radius:-Number.parseFloat(t[4])}}function qTt(e){if(e.length===0)return[];let t={};return j$(e,t),t.arcs}function YTt(e,t){if(e.length===0)return"M 0 0";let r=Math.pow(10,t||0),n=t!=null?a=>Math.round(a*r)/r:a=>a;if(e.length==1){let a=e[0].circle;return HPr(n(a.x),n(a.y),n(a.radius))}let i=[` -M`,n(e[0].p2.x),n(e[0].p2.y)];for(let a of e){let o=n(a.circle.radius);i.push(` -A`,o,o,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function MTt(e,t){return YTt(qTt(e),t)}function jTt(e,t={}){let{lossFunction:r,layoutFunction:n=_Tt,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:o,width:s=600,height:l=350,padding:u=15,scaleToFit:d=!1,symmetricalTextCentre:h=!1,distinct:f,round:p=2}=t,m=n(e,{lossFunction:r==="default"||!r?_A:r==="logRatio"?OTt:r,distinct:f});i&&(m=BTt(m,a,o));let g=FTt(m,s,l,u,d),y=HTt(g,e,h),v=new Map(Object.keys(g).map(E=>[E,{set:E,x:g[E].x,y:g[E].y,radius:g[E].radius}])),b=e.map(E=>{let w=E.sets.map(S=>v.get(S)),T=qTt(w),C=YTt(T,p);return{circles:w,arcs:T,path:C,area:E,has:new Set(E.sets)}});function x(E){let w="";for(let T of b)T.has.size>E.length&&E.every(C=>T.has.has(C))&&(w+=" "+T.path);return w}return b.map(({circles:E,arcs:w,path:T,area:C})=>({data:C,text:y[C.sets],circles:E,arcs:w,path:T,distinctPath:T+x(C.sets)}))}var PTt,XTt=H(()=>{PTt=1e-10});var JTt={};gr(JTt,{diagram:()=>hOr});function $Tt(){return Kn(aOr,Kt().venn)}function KTt(e){let t=new Map;for(let r of e){let n=r.targets.join("|"),i=t.get(n);i?Object.assign(i,r.styles):t.set(n,{...r.styles})}return t}function Jx(e){return e.join("|")}function ZTt(e,t,r,n,i,a){let o=e?.useDebugLayout??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(let d of n){let h=Jx(d.sets),f=u.get(h);f?f.push(d):u.set(h,[d])}for(let[d,h]of u.entries()){let f=t.get(d);if(!f?.text)continue;let p=f.text.x,m=f.text.y,g=Math.min(...f.circles.map(P=>P.radius)),y=Math.min(...f.circles.map(P=>P.radius-Math.hypot(p-P.x,m-P.y))),v=Number.isFinite(y)?Math.max(0,y):0;v===0&&Number.isFinite(g)&&(v=g*.6);let b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",p).attr("cy",m).attr("r",v).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);let x=Math.max(80*i,v*2*.95),E=Math.max(60*i,v*2*.95),C=(f.data.label&&f.data.label.length>0?Math.min(32*i,v*.25):0)+(h.length<=2?30*i:0),S=p-x/2,R=m-E/2+C,U=Math.max(1,Math.ceil(Math.sqrt(h.length))),L=Math.max(1,Math.ceil(h.length/U)),I=x/U,A=E/L;for(let[P,D]of h.entries()){let M=P%U,O=Math.floor(P/U),_=S+I*(M+.5),B=R+A*(O+.5);o&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",S+I*M).attr("y",R+A*O).attr("width",I).attr("height",A).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);let F=I*.9,G=A*.9,z=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",F).attr("height",G).attr("x",_-F/2).attr("y",B-G/2).attr("overflow","visible"),V=a.get(D.id)?.color,$=z.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(D.label??D.id);V&&$.style("color",V)}}}function QTt(e){let t=new Set(e.map(i=>[...i.sets].sort().join("|"))),r=new Map(e.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(let i of e){if(i.sets.length<3)continue;let a=[...i.sets].sort();for(let o=0;o0?[...e,...n]:e}var X5e,jPr,$5e,K5e,Z5e,Q5e,J5e,e4e,XPr,$Pr,SD,KPr,ZPr,QPr,JPr,X$,eOr,tOr,rOr,nOr,iOr,aOr,oOr,sOr,lOr,cOr,uOr,dOr,hOr,ekt=H(()=>{cs();Vn();Wr();Gr();xr();_n();Ts();XTt();mr();X5e=(function(){var e=k(function(b,x,E,w){for(E=E||{},w=b.length;w--;E[b[w]]=x);return E},"o"),t=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],o=[1,31],s=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],d=[1,56],h=[1,58],f=[1,59],p=[1,60],m=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],g={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:k(function(x,E,w,T,C,S,R){var U=S.length-1;switch(C){case 1:return S[U-1];case 2:case 3:case 4:this.$=[];break;case 5:S[U-1].push(S[U]),this.$=S[U-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=S[U];break;case 8:T.setDiagramTitle(S[U].substr(6)),this.$=S[U].substr(6);break;case 9:T.addSubsetData([S[U]],void 0,void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 10:T.addSubsetData([S[U-1]],S[U],void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 11:T.addSubsetData([S[U-2]],void 0,parseFloat(S[U])),T.setIndentMode&&T.setIndentMode(!0);break;case 12:T.addSubsetData([S[U-3]],S[U-2],parseFloat(S[U])),T.setIndentMode&&T.setIndentMode(!0);break;case 13:if(S[U].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(S[U]),T.addSubsetData(S[U],void 0,void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 14:if(S[U-1].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(S[U-1]),T.addSubsetData(S[U-1],S[U],void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 15:if(S[U-2].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(S[U-2]),T.addSubsetData(S[U-2],void 0,parseFloat(S[U])),T.setIndentMode&&T.setIndentMode(!0);break;case 16:if(S[U-3].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(S[U-3]),T.addSubsetData(S[U-3],S[U-2],parseFloat(S[U])),T.setIndentMode&&T.setIndentMode(!0);break;case 17:case 18:case 19:T.addTextData(S[U-1],S[U],void 0);break;case 20:case 21:T.addTextData(S[U-2],S[U-1],S[U]);break;case 23:T.addStyleData(S[U-1],S[U]);break;case 24:case 25:case 26:var L=T.getCurrentSets();if(!L)throw new Error("text requires set");T.addTextData(L,S[U],void 0);break;case 27:case 28:var L=T.getCurrentSets();if(!L)throw new Error("text requires set");T.addTextData(L,S[U-1],S[U]);break;case 29:case 41:this.$=[S[U]];break;case 30:case 42:this.$=[...S[U-2],S[U]];break;case 31:this.$=[S[U-2],S[U]];break;case 33:this.$=S[U].join(" ");break;case 34:this.$=[S[U]];break;case 35:S[U-1].push(S[U]),this.$=S[U-1];break;case 43:case 44:this.$=S[U];break}},"anonymous"),table:[e(t,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},e(r,[2,4],{6:5}),e(t,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},e(r,[2,5]),e(r,[2,6]),e(r,[2,7]),e(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},e(r,[2,9],{14:[1,27],15:[1,28]}),e(a,[2,43]),e(a,[2,44]),e(r,[2,13],{14:[1,29],15:[1,30],27:o}),e(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},e(r,[2,22]),e(r,[2,24],{14:[1,35]}),e(r,[2,25],{14:[1,36]}),e(r,[2,26]),{20:s,25:37,26:38,27:o},e(r,[2,10],{15:[1,40]}),{16:[1,41]},e(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},e(r,[2,17],{14:[1,45]}),e(r,[2,18],{14:[1,46]}),e(r,[2,19]),e(r,[2,27]),e(r,[2,28]),e(r,[2,23],{27:[1,47]}),e(l,[2,29]),{15:[1,48]},{16:[1,49]},e(r,[2,11]),{16:[1,50]},e(r,[2,15]),e(a,[2,42]),e(r,[2,20]),e(r,[2,21]),{20:s,26:51},{16:u,20:d,21:[1,53],28:52,29:54,30:55,31:h,32:f,33:p},e(r,[2,12]),e(r,[2,16]),e(l,[2,30]),e(l,[2,31]),e(l,[2,32]),e(l,[2,33],{30:61,16:u,20:d,31:h,32:f,33:p}),e(m,[2,34]),e(m,[2,36]),e(m,[2,37]),e(m,[2,38]),e(m,[2,39]),e(m,[2,40]),e(m,[2,35])],defaultActions:{6:[2,1]},parseError:k(function(x,E){if(E.recoverable)this.trace(x);else{var w=new Error(x);throw w.hash=E,w}},"parseError"),parse:k(function(x){var E=this,w=[0],T=[],C=[null],S=[],R=this.table,U="",L=0,I=0,A=0,P=2,D=1,M=S.slice.call(arguments,1),O=Object.create(this.lexer),_={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(_.yy[B]=this.yy[B]);O.setInput(x,_.yy),_.yy.lexer=O,_.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;S.push(F);var G=O.options&&O.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(Ze){w.length=w.length-2*Ze,C.length=C.length-Ze,S.length=S.length-Ze}k(z,"popStack");function V(){var Ze;return Ze=T.pop()||O.lex()||D,typeof Ze!="number"&&(Ze instanceof Array&&(T=Ze,Ze=T.pop()),Ze=E.symbols_[Ze]||Ze),Ze}k(V,"lex");for(var $,Z,re,Q,ge,ie,pe={},ue,fe,Me,Ce;;){if(re=w[w.length-1],this.defaultActions[re]?Q=this.defaultActions[re]:(($===null||typeof $>"u")&&($=V()),Q=R[re]&&R[re][$]),typeof Q>"u"||!Q.length||!Q[0]){var Ye="";Ce=[];for(ue in R[re])this.terminals_[ue]&&ue>P&&Ce.push("'"+this.terminals_[ue]+"'");O.showPosition?Ye="Parse error on line "+(L+1)+`: -`+O.showPosition()+` -Expecting `+Ce.join(", ")+", got '"+(this.terminals_[$]||$)+"'":Ye="Parse error on line "+(L+1)+": Unexpected "+($==D?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(Ye,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:F,expected:Ce})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+re+", token: "+$);switch(Q[0]){case 1:w.push($),C.push(O.yytext),S.push(O.yylloc),w.push(Q[1]),$=null,Z?($=Z,Z=null):(I=O.yyleng,U=O.yytext,L=O.yylineno,F=O.yylloc,A>0&&A--);break;case 2:if(fe=this.productions_[Q[1]][1],pe.$=C[C.length-fe],pe._$={first_line:S[S.length-(fe||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(fe||1)].first_column,last_column:S[S.length-1].last_column},G&&(pe._$.range=[S[S.length-(fe||1)].range[0],S[S.length-1].range[1]]),ie=this.performAction.apply(pe,[U,I,L,_.yy,Q[1],C,S].concat(M)),typeof ie<"u")return ie;fe&&(w=w.slice(0,-1*fe*2),C=C.slice(0,-1*fe),S=S.slice(0,-1*fe)),w.push(this.productions_[Q[1]][0]),C.push(pe.$),S.push(pe._$),Me=R[w[w.length-2]][w[w.length-1]],w.push(Me);break;case 3:return!0}}return!0},"parse")},y=(function(){var b={EOF:1,parseError:k(function(E,w){if(this.yy.parser)this.yy.parser.parseError(E,w);else throw new Error(E)},"parseError"),setInput:k(function(x,E){return this.yy=E||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:k(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var E=x.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:k(function(x){var E=x.length,w=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var T=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),w.length-1&&(this.yylineno-=w.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===T.length?this.yylloc.first_column:0)+T[T.length-w.length].length-w[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(x){this.unput(this.match.slice(x))},"less"),pastInput:k(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var x=this.pastInput(),E=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+E+"^"},"showPosition"),test_match:k(function(x,E){var w,T,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),T=x[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],w=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var S in C)this[S]=C[S];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,E,w,T;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),S=0;SE[0].length)){if(E=w,T=S,this.options.backtrack_lexer){if(x=this.test_match(w,C[S]),x!==!1)return x;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(x=this.test_match(E,C[T]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var E=this.next();return E||this.lex()},"lex"),begin:k(function(E){this.conditionStack.push(E)},"begin"),popState:k(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:k(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:k(function(E){this.begin(E)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:k(function(E,w,T,C){var S=C;switch(T){case 0:break;case 1:break;case 2:break;case 3:if(E.getIndentMode&&E.getIndentMode())return E.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:E.setIndentMode&&E.setIndentMode(!1),this.begin("INITIAL"),this.unput(w.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(E.consumeIndentText)E.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return w.yytext=w.yytext.slice(2,-2),14;break;case 17:return w.yytext=w.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return b})();g.lexer=y;function v(){this.yy={}}return k(v,"Parser"),v.prototype=g,g.Parser=v,new v})();X5e.parser=X5e;jPr=X5e,$5e=[],K5e=[],Z5e=[],Q5e=new Set,e4e=!1,XPr=k((e,t,r)=>{let n=X$(e).sort(),i=r??10/Math.pow(e.length,2);J5e=n,n.length===1&&Q5e.add(n[0]),$5e.push({sets:n,size:i,label:t?SD(t):void 0})},"addSubsetData"),$Pr=k(()=>$5e,"getSubsetData"),SD=k(e=>{let t=e.trim();return t.length>=2&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t},"normalizeText"),KPr=k(e=>e&&SD(e),"normalizeStyleValue"),ZPr=k((e,t,r)=>{let n=SD(t);K5e.push({sets:X$(e).sort(),id:n,label:r?SD(r):void 0})},"addTextData"),QPr=k((e,t)=>{let r=X$(e).sort(),n={};for(let[i,a]of t)n[i]=KPr(a)??a;Z5e.push({targets:r,styles:n})},"addStyleData"),JPr=k(()=>Z5e,"getStyleData"),X$=k(e=>e.map(t=>SD(t)),"normalizeIdentifierList"),eOr=k(e=>{let r=X$(e).filter(n=>!Q5e.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),tOr=k(()=>K5e,"getTextData"),rOr=k(()=>J5e,"getCurrentSets"),nOr=k(()=>e4e,"getIndentMode"),iOr=k(e=>{e4e=e},"setIndentMode"),aOr=Xr.venn;k($Tt,"getConfig");oOr=k(()=>{$r(),$5e.length=0,K5e.length=0,Z5e.length=0,Q5e.clear(),J5e=void 0,e4e=!1},"customClear"),sOr={getConfig:$Tt,clear:oOr,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn,addSubsetData:XPr,getSubsetData:$Pr,addTextData:ZPr,addStyleData:QPr,validateUnionIdentifiers:eOr,getTextData:tOr,getStyleData:JPr,getCurrentSets:rOr,getIndentMode:nOr,setIndentMode:iOr},lOr=k(e=>` - .venn-title { - font-size: 32px; - fill: ${e.vennTitleTextColor}; - font-family: ${e.fontFamily}; - } - - .venn-circle text { - font-size: 48px; - font-family: ${e.fontFamily}; - } - - .venn-intersection text { - font-size: 48px; - fill: ${e.vennSetTextColor}; - font-family: ${e.fontFamily}; - } - - .venn-text-node { - font-family: ${e.fontFamily}; - color: ${e.vennSetTextColor}; - } -`,"getStyles"),cOr=lOr;k(KTt,"buildStyleByKey");uOr=k((e,t,r,n)=>{let i=n.db,a=i.getConfig?.(),{themeVariables:o,look:s,handDrawnSeed:l}=Kt(),u=s==="handDrawn",d=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),h=i.getDiagramTitle?.(),f=i.getSubsetData(),p=i.getTextData(),m=KTt(i.getStyleData()),g=QTt(f),y=a?.width??800,v=a?.height??450,x=y/1600,E=h?48*x:0,w=o.primaryTextColor??o.textColor,T=Mi(t);T.attr("viewBox",`0 0 ${y} ${v}`),h&&T.append("text").text(h).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",o.vennTitleTextColor||o.titleColor);let C=xt(document.createElement("div")),S=WTt().width(y).height(v-E);C.datum(g).call(S);let R=u?yt.svg(C.select("svg").node()):void 0,U=jTt(g,{width:y,height:v-E,padding:a?.padding??15}),L=new Map;for(let D of U){let M=Jx([...D.data.sets].sort());L.set(M,D)}p.length>0&&ZTt(a,L,C,p,x,m);let I=Gi(o.background||"#f4f4f4");C.selectAll(".venn-circle").each(function(D,M){let O=xt(this),B=Jx([...D.sets].sort()),F=m.get(B),G=F?.fill||d[M%d.length]||o.primaryColor;O.classed(`venn-set-${M%8}`,!0);let z=F?.["fill-opacity"]??.1,V=F?.stroke||G,$=F?.["stroke-width"]||`${5*x}`;if(u&&R){let re=L.get(B);if(re&&re.circles.length>0){let Q=re.circles[0],ge=R.circle(Q.x,Q.y,Q.radius*2,{roughness:.7,seed:l,fill:AF(G,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+M*60,stroke:V,strokeWidth:parseFloat(String($))});O.select("path").remove(),O.node()?.insertBefore(ge,O.select("text").node())}}else O.select("path").style("fill",G).style("fill-opacity",z).style("stroke",V).style("stroke-width",$).style("stroke-opacity",.95);let Z=F?.color||(I?st(G,30):lt(G,30));O.select("text").style("font-size",`${48*x}px`).style("fill",Z)}),u&&R?C.selectAll(".venn-intersection").each(function(D){let M=xt(this),_=Jx([...D.sets].sort()),B=m.get(_),F=B?.fill;if(F){let G=M.select("path"),z=G.attr("d");if(z){let V=R.path(z,{roughness:.7,seed:l,fill:AF(F,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),$=G.node();$?.parentNode?.insertBefore(V,$),G.remove()}}else M.select("path").style("fill-opacity",0);M.select("text").style("font-size",`${48*x}px`).style("fill",B?.color??o.vennSetTextColor??w)}):(C.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",D=>{let O=Jx([...D.sets].sort());return m.get(O)?.color??o.vennSetTextColor??w}),C.selectAll(".venn-intersection path").style("fill-opacity",D=>{let O=Jx([...D.sets].sort());return m.get(O)?.fill?1:0}).style("fill",D=>{let O=Jx([...D.sets].sort());return m.get(O)?.fill??"transparent"}));let A=T.append("g").attr("transform",`translate(0, ${E})`),P=C.select("svg").node();if(P&&"childNodes"in P)for(let D of[...P.childNodes])A.node()?.appendChild(D);zn(T,v,y,a?.useMaxWidth??!0)},"draw");k(Jx,"stableSetsKey");k(ZTt,"renderTextNodes");k(QTt,"ensurePairwiseSubsets");dOr={draw:uOr},hOr={parser:jPr,db:sOr,renderer:dOr,styles:cOr}});var ikt={};gr(ikt,{diagram:()=>EOr});function rkt(e){if(!e.length)return[];let t=[],r=[];return e.forEach(n=>{let i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n?.classSelector,n?.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)t.push(i);else{let a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),t}var tkt,fOr,pOr,nkt,mOr,PA,AD,gOr,yOr,vOr,bOr,xOr,wOr,EOr,akt=H(()=>{_u();cs();Fd();Us();Vn();Wr();Gr();xr();yc();_n();tkt=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=sn,this.getAccTitle=pn,this.setDiagramTitle=Sn,this.getDiagramTitle=yn,this.getAccDescription=gn,this.setAccDescription=mn}static{k(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let e=Xr,t=Kt();return Kn({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){let r=this.classes.get(e)??{id:e,styles:[],textStyles:[]},n=t.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");n&&n.forEach(i=>{_I(i)&&(r?.textStyles?r.textStyles.push(i):r.textStyles=[i]),r?.styles?r.styles.push(i):r.styles=[i]}),this.classes.set(e,r)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){$r(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};k(rkt,"buildHierarchy");fOr=k((e,t)=>{ra(e,t);let r=[];for(let a of e.TreemapRows??[])a.$type==="ClassDefStatement"&&t.addClass(a.className??"",a.styleText??"");for(let a of e.TreemapRows??[]){let o=a.item;if(!o)continue;let s=a.indent?parseInt(a.indent):0,l=pOr(o),u=o.classSelector?t.getStylesForClass(o.classSelector):[],d=u.length>0?u:void 0,h={level:s,name:l,type:o.$type,value:o.value,classSelector:o.classSelector,cssCompiledStyles:d};r.push(h)}let n=rkt(r),i=k((a,o)=>{for(let s of a)t.addNode(s,o),s.children&&s.children.length>0&&i(s.children,o+1)},"addNodesRecursively");i(n,0)},"populate"),pOr=k(e=>e.name?String(e.name):"","getItemName"),nkt={parser:{yy:void 0},parse:k(async e=>{try{let r=await Lo("treemap",e);ye.debug("Treemap AST:",r);let n=nkt.parser?.yy;if(!(n instanceof tkt))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");fOr(r,n)}catch(t){throw ye.error("Error parsing treemap:",t),t}},"parse")},mOr=10,PA=10,AD=25,gOr=k((e,t,r,n)=>{let i=n.db,a=i.getConfig(),o=a.padding??mOr,s=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Kt();if(!l)return;let d=s?30:0,h=Mi(t),f=a.nodeWidth?a.nodeWidth*PA:960,p=a.nodeHeight?a.nodeHeight*PA:500,m=f,g=p+d;h.attr("viewBox",`0 0 ${m} ${g}`),zn(h,g,m,a.useMaxWidth);let y;try{let z=a.valueFormat||",";if(z==="$0,0")y=k(V=>"$"+$m(",")(V),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){let V=/\.\d+/.exec(z),$=V?V[0]:"";y=k(Z=>"$"+$m(","+$)(Z),"valueFormat")}else if(z.startsWith("$")){let V=z.substring(1);y=k($=>"$"+$m(V||"")($),"valueFormat")}else y=$m(z)}catch(z){ye.error("Error creating format function:",z),y=$m(",")}let v=kh().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),b=kh().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),x=kh().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);s&&h.append("text").attr("x",m/2).attr("y",d/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(s);let E=h.append("g").attr("transform",`translate(0, ${d})`).attr("class","treemapContainer"),w=Mk(l).sum(z=>z.value??0).sort((z,V)=>(V.value??0)-(z.value??0)),C=Mle().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?AD+PA:0).paddingInner(o).paddingLeft(z=>z.children&&z.children.length>0?PA:0).paddingRight(z=>z.children&&z.children.length>0?PA:0).paddingBottom(z=>z.children&&z.children.length>0?PA:0).round(!0)(w),S=C.descendants().filter(z=>z.children&&z.children.length>0),R=E.selectAll(".treemapSection").data(S).enter().append("g").attr("class","treemapSection").attr("transform",z=>`translate(${z.x0},${z.y0})`);R.append("rect").attr("width",z=>z.x1-z.x0).attr("height",AD).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",z=>z.depth===0?"display: none;":""),R.append("clipPath").attr("id",(z,V)=>`clip-section-${t}-${V}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-12)).attr("height",AD),R.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class",(z,V)=>`treemapSection section${V}`).attr("fill",z=>v(z.data.name)).attr("fill-opacity",.6).attr("stroke",z=>b(z.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",z=>{if(z.depth===0)return"display: none;";let V=or({cssCompiledStyles:z.data.cssCompiledStyles});return V.nodeStyles+";"+V.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",AD/2).attr("dominant-baseline","middle").text(z=>z.depth===0?"":z.data.name).attr("font-weight","bold").attr("clip-path",(z,V)=>`url(#clip-section-${t}-${V})`).attr("style",z=>{if(z.depth===0)return"display: none;";let V="dominant-baseline: middle; font-size: 12px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",$=or({cssCompiledStyles:z.data.cssCompiledStyles});return V+$.labelStyles.replace("color:","fill:")}).each(function(z){if(z.depth===0)return;let V=xt(this),$=z.data.name;V.text($);let Z=z.x1-z.x0,re=6,Q;a.showValues!==!1&&z.value?Q=Z-10-30-10-re:Q=Z-re-6;let ie=Math.max(15,Q),pe=V.node();if(pe.getComputedTextLength()>ie){let Me=$;for(;Me.length>0;){if(Me=$.substring(0,Me.length-1),Me.length===0){V.text("..."),pe.getComputedTextLength()>ie&&V.text("");break}if(V.text(Me+"..."),pe.getComputedTextLength()<=ie)break}}}),a.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",AD/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(z=>z.value?y(z.value):"").attr("font-style","italic").attr("style",z=>{if(z.depth===0)return"display: none;";let V="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",$=or({cssCompiledStyles:z.data.cssCompiledStyles});return V+$.labelStyles.replace("color:","fill:")});let U=C.leaves(),L=U.length>20,I=L?16:38,A=L?14:28,P=L?4:8,D=L?4:6,M=L?2:4,O=L?8:10,_=L?1:2,B=E.selectAll(".treemapLeafGroup").data(U).enter().append("g").attr("class",(z,V)=>`treemapNode treemapLeafGroup leaf${V}${z.data.classSelector?` ${z.data.classSelector}`:""}x`).attr("transform",z=>`translate(${z.x0},${z.y0})`);B.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class","treemapLeaf").attr("fill",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("style",z=>or({cssCompiledStyles:z.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",z=>z.parent?v(z.parent.data.name):v(z.data.name)).attr("stroke-width",3),B.append("clipPath").attr("id",(z,V)=>`clip-${t}-${V}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-4)).attr("height",z=>Math.max(0,z.y1-z.y0-4)),B.append("text").attr("class","treemapLabel").attr("x",z=>(z.x1-z.x0)/2).attr("y",z=>(z.y1-z.y0)/2).attr("style",z=>{let V=`text-anchor: middle; dominant-baseline: middle; font-size: ${I}px;fill:`+x(z.data.name)+";",$=or({cssCompiledStyles:z.data.cssCompiledStyles});return V+$.labelStyles.replace("color:","fill:")}).attr("clip-path",(z,V)=>`url(#clip-${t}-${V})`).text(z=>z.data.name).each(function(z){let V=xt(this),$=z.x1-z.x0,Z=z.y1-z.y0,re=V.node(),Q=$-2*M,ge=Z-2*M;if(QQ&&ie>P;)ie--,V.style("font-size",`${ie}px`);let ue=Math.max(D,Math.min(A,Math.round(ie*pe))),fe=ie+_+ue;for(;fe>ge&&ie>P&&(ie--,ue=Math.max(D,Math.min(A,Math.round(ie*pe))),!(uege;V.style("font-size",`${ie}px`),L?(ieQ||ie(V.x1-V.x0)/2).attr("y",function(V){return(V.y1-V.y0)/2}).attr("style",V=>{let $=`text-anchor: middle; dominant-baseline: hanging; font-size: ${A}px;fill:`+x(V.data.name)+";",Z=or({cssCompiledStyles:V.data.cssCompiledStyles});return $+Z.labelStyles.replace("color:","fill:")}).attr("clip-path",(V,$)=>`url(#clip-${t}-${$})`).text(V=>V.value?y(V.value):"").each(function(V){let $=xt(this),Z=this.parentNode;if(!Z){$.style("display","none");return}let re=xt(Z).select(".treemapLabel");if(re.empty()||re.style("display")==="none"){$.style("display","none");return}let Q=parseFloat(re.style("font-size")),ie=Math.max(D,Math.min(A,Math.round(Q*.6)));$.style("font-size",`${ie}px`);let ue=(V.y1-V.y0)/2+Q/2+_;$.attr("y",ue);let fe=V.x1-V.x0,Ye=V.y1-V.y0-4,Ze=fe-2*M;$.node().getComputedTextLength()>Ze||ue+ie>Ye||ie{let t=Bc(),r=Kt(),n=Kn(t,r.themeVariables),i=Kn(bOr,e),a=i.titleColor??n.titleColor,o=i.labelColor??n.textColor,s=i.valueColor??n.textColor;return` - .treemapNode.section { - stroke: ${i.sectionStrokeColor}; - stroke-width: ${i.sectionStrokeWidth}; - fill: ${i.sectionFillColor}; - } - .treemapNode.leaf { - stroke: ${i.leafStrokeColor}; - stroke-width: ${i.leafStrokeWidth}; - fill: ${i.leafFillColor}; - } - .treemapLabel { - fill: ${o}; - font-size: ${i.labelFontSize}; - } - .treemapValue { - fill: ${s}; - font-size: ${i.valueFontSize}; - } - .treemapTitle { - fill: ${a}; - font-size: ${i.titleFontSize}; - } - `},"getStyles"),wOr=xOr,EOr={parser:nkt,get db(){return new tkt},renderer:vOr,styles:wOr}});var Ckt={};gr(Ckt,{diagram:()=>DOr});function lkt(){return je()["wardley-beta"]}function ckt(e,t,r,n,i,a,o,s,l){$c.addNode({id:e,label:t,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:l})}function ukt(e,t,r=!1,n,i){$c.addLink({source:e,target:t,dashed:r,label:n,flow:i})}function dkt(e,t,r){$c.addTrend({nodeId:e,targetX:t,targetY:r})}function hkt(e,t,r){$c.addAnnotation({number:e,coordinates:t,text:r})}function fkt(e,t,r){$c.addNote({text:e,x:t,y:r})}function pkt(e,t,r){$c.addAccelerator({name:e,x:t,y:r})}function mkt(e,t,r){$c.addDeaccelerator({name:e,x:t,y:r})}function gkt(e,t){$c.setAnnotationsBox(e,t)}function ykt(e,t){$c.setSize(e,t)}function vkt(e){$c.startPipeline(e)}function bkt(e,t){$c.addPipelineComponent(e,t)}function xkt(e){$c.setAxes(e)}function wkt(e){return $c.getNode(e)}function Ekt(e){return $c.resolveNodeId(e)}function Tkt(){return $c.build()}function kkt(){$c.clear(),$r()}var $$,S6,okt,TOr,kOr,skt,COr,$c,SOr,AOr,UOr,IOr,ROr,MOr,LOr,DOr,Skt=H(()=>{_u();cs();Vn();Wr();Gr();xr();yc();$$=k((e,t)=>{let r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),S6=k((e,t,r)=>({x:$$(t,`${r} evolution`),y:$$(e,`${r} visibility`)}),"toCoordinates"),okt=k(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),TOr=k(e=>{if(!e?.startsWith("+"))return{};let r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),kOr=k((e,t)=>{if(ra(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let r=e.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=e.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);t.updateAxes({stages:r,stageBoundaries:n})}if(e.anchors.forEach(r=>{let n=S6(r.visibility,r.evolution,`Anchor "${r.name}"`);t.addNode(r.name,r.name,n.x,n.y,"anchor")}),e.components.forEach(r=>{let n=S6(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,o=r.decorator?.strategy;t.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,o)}),e.notes.forEach(r=>{let n=S6(r.visibility,r.evolution,`Note "${r.text}"`);t.addNote(r.text,n.x,n.y)}),e.pipelines.forEach(r=>{let n=t.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);let i=n.y;t.startPipeline(r.parent),r.components.forEach(a=>{let o=`${r.parent}_${a.name}`,s=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=$$(a.evolution,`Pipeline component "${a.name}" evolution`);t.addNode(o,a.name,u,i,"pipeline-component",s,l),t.addPipelineComponent(r.parent,o)})}),e.links.forEach(r=>{let n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-.")),i=okt(r.fromPort)??okt(r.toPort),{flow:a,label:o}=TOr(r.arrow);!i&&a&&(i=a);let s=r.linkLabel,l=o??s;t.addLink(t.resolveNodeId(r.from),t.resolveNodeId(r.to),n,l,i)}),e.evolves.forEach(r=>{let n=t.getNode(r.component);if(n?.y!==void 0){let i=$$(r.target,`Evolve target for "${r.component}"`);t.addTrend(r.component,i,n.y)}}),e.annotations.length>0){let r=e.annotations[0],n=S6(r.x,r.y,"Annotations box");t.setAnnotationsBox(n.x,n.y)}e.annotation.forEach(r=>{let n=S6(r.x,r.y,`Annotation ${r.number}`);t.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),e.accelerators.forEach(r=>{let n=S6(r.x,r.y,`Accelerator "${r.name}"`);t.addAccelerator(r.name,n.x,n.y)}),e.deaccelerators.forEach(r=>{let n=S6(r.x,r.y,`Deaccelerator "${r.name}"`);t.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),skt={parser:{yy:void 0},parse:k(async e=>{let t=await Lo("wardley",e);ye.debug(t);let r=skt.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");kOr(t,r)},"parse")},COr=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{k(this,"WardleyBuilder")}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let r=this.pipelines.get(e);r&&r.componentIds.push(t);let n=this.nodes.get(t);n&&(n.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,r]of this.nodes)if(r.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!="number"||typeof t.y!="number")throw new Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},$c=new COr;k(lkt,"getConfig");k(ckt,"addNode");k(ukt,"addLink");k(dkt,"addTrend");k(hkt,"addAnnotation");k(fkt,"addNote");k(pkt,"addAccelerator");k(mkt,"addDeaccelerator");k(gkt,"setAnnotationsBox");k(ykt,"setSize");k(vkt,"startPipeline");k(bkt,"addPipelineComponent");k(xkt,"updateAxes");k(wkt,"getNode");k(Ekt,"resolveNodeId");k(Tkt,"getWardleyData");k(kkt,"clear");SOr={getConfig:lkt,addNode:ckt,addLink:ukt,addTrend:dkt,addAnnotation:hkt,addNote:fkt,addAccelerator:pkt,addDeaccelerator:mkt,setAnnotationsBox:gkt,setSize:ykt,startPipeline:vkt,addPipelineComponent:bkt,updateAxes:xkt,getNode:wkt,resolveNodeId:Ekt,getWardleyData:Tkt,clear:kkt,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn},AOr=["Genesis","Custom Built","Product","Commodity"],UOr=k(()=>{let{themeVariables:e}=je();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),IOr=k(()=>{let e=je()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),ROr=k((e,t,r,n)=>{ye.debug(`Rendering Wardley map -`+e);let i=IOr(),a=UOr(),o=i.nodeRadius*1.6,s=n.db,l=s.getWardleyData(),u=s.getDiagramTitle(),d=l.size?.width??i.width,h=l.size?.height??i.height,f=Mi(t);f.selectAll("*").remove(),zn(f,h,d,i.useMaxWidth),f.attr("viewBox",`0 0 ${d} ${h}`);let p=f.append("g").attr("class","wardley-map"),m=f.append("defs");m.append("marker").attr("id",`arrow-${t}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),m.append("marker").attr("id",`link-arrow-end-${t}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),m.append("marker").attr("id",`link-arrow-start-${t}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",d).attr("height",h).attr("fill",a.backgroundColor);let g=d-i.padding*2,y=h-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",d/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);let v=k(_=>i.padding+_/100*g,"projectX"),b=k(_=>h-i.padding-_/100*y,"projectY"),x=p.append("g").attr("class","wardley-axes");x.append("line").attr("x1",i.padding).attr("x2",d-i.padding).attr("y1",h-i.padding).attr("y2",h-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),x.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",h-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);let E=l.axes.xLabel??"Evolution",w=l.axes.yLabel??"Visibility";x.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+g/2).attr("y",h-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(E),x.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(w);let T=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:AOr;if(T.length>0){let _=p.append("g").attr("class","wardley-stages"),B=l.axes.stageBoundaries,F=[];if(B&&B.length===T.length){let G=0;B.forEach(z=>{F.push({start:G,end:z}),G=z})}else{let G=1/T.length;T.forEach((z,V)=>{F.push({start:V*G,end:(V+1)*G})})}T.forEach((G,z)=>{let V=F[z],$=i.padding+V.start*g,Z=i.padding+V.end*g,re=($+Z)/2;z>0&&_.append("line").attr("x1",$).attr("x2",$).attr("y1",i.padding).attr("y2",h-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),_.append("text").attr("class","wardley-stage-label").attr("x",re).attr("y",h-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(G)})}if(i.showGrid){let _=p.append("g").attr("class","wardley-grid");for(let B=1;B<4;B++){let F=B/4,G=i.padding+g*F;_.append("line").attr("x1",G).attr("x2",G).attr("y1",i.padding).attr("y2",h-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),_.append("line").attr("x1",i.padding).attr("x2",d-i.padding).attr("y1",h-i.padding-y*F).attr("y2",h-i.padding-y*F).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}let C=new Map;if(l.nodes.forEach(_=>{C.set(_.id,{x:v(_.x),y:b(_.y),node:_})}),l.pipelines.length>0){let _=p.append("g").attr("class","wardley-pipelines"),B=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(F=>{if(F.componentIds.length===0)return;let G=F.componentIds.map(Z=>({id:Z,pos:C.get(Z),node:l.nodes.find(re=>re.id===Z)})).filter(Z=>Z.pos&&Z.node).sort((Z,re)=>Z.node.x-re.node.x);for(let Z=0;Z{let re=C.get(Z);re&&(z=Math.min(z,re.x),V=Math.max(V,re.x),$=re.y)}),z!==1/0&&V!==-1/0){let re=i.nodeRadius*4,Q=$-re/2,ge=C.get(F.nodeId);if(ge){let ie=(z+V)/2;ge.x=ie,ge.y=Q-o/6}_.append("rect").attr("class","wardley-pipeline-box").attr("x",z-15).attr("y",Q).attr("width",V-z+30).attr("height",re).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let S=p.append("g").attr("class","wardley-links"),R=new Map;l.pipelines.forEach(_=>{R.set(_.nodeId,new Set(_.componentIds))});let U=l.links.filter(_=>!(!C.has(_.source)||!C.has(_.target)||R.get(_.target)?.has(_.source)));S.selectAll("line").data(U).enter().append("line").attr("class",_=>`wardley-link${_.dashed?" wardley-link--dashed":""}`).attr("x1",_=>{let B=C.get(_.source),F=C.get(_.target),z=l.nodes.find(re=>re.id===_.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,V=F.x-B.x,$=F.y-B.y,Z=Math.sqrt(V*V+$*$);return B.x+V/Z*z}).attr("y1",_=>{let B=C.get(_.source),F=C.get(_.target),z=l.nodes.find(re=>re.id===_.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,V=F.x-B.x,$=F.y-B.y,Z=Math.sqrt(V*V+$*$);return B.y+$/Z*z}).attr("x2",_=>{let B=C.get(_.source),F=C.get(_.target),z=l.nodes.find(re=>re.id===_.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,V=B.x-F.x,$=B.y-F.y,Z=Math.sqrt(V*V+$*$);return F.x+V/Z*z}).attr("y2",_=>{let B=C.get(_.source),F=C.get(_.target),z=l.nodes.find(re=>re.id===_.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,V=B.x-F.x,$=B.y-F.y,Z=Math.sqrt(V*V+$*$);return F.y+$/Z*z}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",_=>_.dashed?"6 6":null).attr("marker-end",_=>_.flow==="forward"||_.flow==="bidirectional"?`url(#link-arrow-end-${t})`:null).attr("marker-start",_=>_.flow==="backward"||_.flow==="bidirectional"?`url(#link-arrow-start-${t})`:null),S.selectAll("text").data(U.filter(_=>_.label)).enter().append("text").attr("class","wardley-link-label").attr("x",_=>{let B=C.get(_.source),F=C.get(_.target),G=(B.x+F.x)/2,z=F.y-B.y,V=F.x-B.x,$=Math.sqrt(V*V+z*z),Z=8,re=z/$;return G+re*Z}).attr("y",_=>{let B=C.get(_.source),F=C.get(_.target),G=(B.y+F.y)/2,z=F.x-B.x,V=F.y-B.y,$=Math.sqrt(z*z+V*V),Z=8,re=-z/$;return G+re*Z}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",_=>{let B=C.get(_.source),F=C.get(_.target),G=(B.x+F.x)/2,z=(B.y+F.y)/2,V=F.x-B.x,$=F.y-B.y,Z=Math.sqrt(V*V+$*$),re=8,Q=$/Z,ge=-V/Z,ie=G+Q*re,pe=z+ge*re,ue=Math.atan2($,V)*180/Math.PI;return(ue>90||ue<-90)&&(ue+=180),`rotate(${ue} ${ie} ${pe})`}).text(_=>_.label);let L=p.append("g").attr("class","wardley-trends"),I=l.trends.map(_=>{let B=C.get(_.nodeId);if(!B)return null;let F=v(_.targetX),G=b(_.targetY),z=F-B.x,V=G-B.y,$=Math.sqrt(z*z+V*V),Z=i.nodeRadius+2,re=$>Z?F-z/$*Z:F,Q=$>Z?G-V/$*Z:G;return{origin:B,targetX:F,targetY:G,adjustedX2:re,adjustedY2:Q}}).filter(_=>_!==null);L.selectAll("line").data(I).enter().append("line").attr("class","wardley-trend").attr("x1",_=>_.origin.x).attr("y1",_=>_.origin.y).attr("x2",_=>_.adjustedX2).attr("y2",_=>_.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${t})`);let P=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",_=>["wardley-node",_.className?`wardley-node--${_.className}`:""].filter(Boolean).join(" "));P.filter(_=>_.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),P.filter(_=>_.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),P.filter(_=>_.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let D=P.filter(_=>_.sourceStrategy==="market");D.append("circle").attr("class","wardley-market-overlay").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),P.filter(_=>!_.isPipelineParent&&_.sourceStrategy!=="market"&&_.className!=="anchor").append("circle").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);let M=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(D.append("line").attr("class","wardley-market-line").attr("x1",_=>C.get(_.id).x).attr("y1",_=>C.get(_.id).y-O).attr("x2",_=>C.get(_.id).x-O*Math.cos(Math.PI/6)).attr("y2",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",_=>C.get(_.id).x-O*Math.cos(Math.PI/6)).attr("y1",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("x2",_=>C.get(_.id).x+O*Math.cos(Math.PI/6)).attr("y2",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",_=>C.get(_.id).x+O*Math.cos(Math.PI/6)).attr("y1",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("x2",_=>C.get(_.id).x).attr("y2",_=>C.get(_.id).y-O).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("circle").attr("class","wardley-market-dot").attr("cx",_=>C.get(_.id).x).attr("cy",_=>C.get(_.id).y-O).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",_=>C.get(_.id).x-O*Math.cos(Math.PI/6)).attr("cy",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",_=>C.get(_.id).x+O*Math.cos(Math.PI/6)).attr("cy",_=>C.get(_.id).y+O*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),P.filter(_=>_.isPipelineParent===!0).append("rect").attr("x",_=>C.get(_.id).x-o/2).attr("y",_=>C.get(_.id).y-o/2).attr("width",o).attr("height",o).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),P.filter(_=>_.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",_=>{let B=C.get(_.id),F=_.isPipelineParent?o/2+15:i.nodeRadius+15;return _.sourceStrategy&&(F+=i.nodeRadius+10),B.x+F}).attr("y1",_=>{let B=C.get(_.id),F=_.isPipelineParent?o:i.nodeRadius*2;return B.y-F/2}).attr("x2",_=>{let B=C.get(_.id),F=_.isPipelineParent?o/2+15:i.nodeRadius+15;return _.sourceStrategy&&(F+=i.nodeRadius+10),B.x+F}).attr("y2",_=>{let B=C.get(_.id),F=_.isPipelineParent?o:i.nodeRadius*2;return B.y+F/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),P.append("text").attr("x",_=>{let B=C.get(_.id);if(_.className==="anchor")return _.labelOffsetX!==void 0?B.x+_.labelOffsetX:B.x;let F=i.nodeLabelOffset;_.sourceStrategy&&_.labelOffsetX===void 0&&(F+=10);let G=_.labelOffsetX??F;return B.x+G}).attr("y",_=>{let B=C.get(_.id);if(_.className==="anchor")return _.labelOffsetY!==void 0?B.y+_.labelOffsetY:B.y-3;let F=-i.nodeLabelOffset;_.sourceStrategy&&_.labelOffsetY===void 0&&(F-=10);let G=_.labelOffsetY??F;return B.y+G}).attr("class","wardley-node-label").attr("fill",_=>_.className==="evolved"?a.evolutionStroke:_.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",_=>_.className==="anchor"?"bold":"normal").attr("text-anchor",_=>_.className==="anchor"?"middle":"start").attr("dominant-baseline",_=>_.className==="anchor"?"middle":"auto").text(_=>_.label),l.annotations.length>0){let _=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(B=>{let F=B.coordinates.map(G=>({x:v(G.x),y:b(G.y)}));if(F.length>1)for(let G=0;G{let z=_.append("g").attr("class","wardley-annotation");z.append("circle").attr("cx",G.x).attr("cy",G.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),z.append("text").attr("x",G.x).attr("y",G.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.number)})}),l.annotationsBox){let B=v(l.annotationsBox.x),F=b(l.annotationsBox.y),G=10,z=16,V=11,$=_.append("g").attr("class","wardley-annotations-box"),Z=[...l.annotations].filter(Q=>Q.text).sort((Q,ge)=>Q.number-ge.number),re=[];if(Z.forEach((Q,ge)=>{let ie=$.append("text").attr("x",B+G).attr("y",F+G+(ge+1)*z).attr("font-size",V).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Q.number}. ${Q.text}`);re.push(ie)}),re.length>0){let Q=0,ge=0;re.forEach(Ye=>{let Ze=Ye.node(),Qe=Ze.getComputedTextLength();Q=Math.max(Q,Qe);let ve=Ze.getBBox();ge=Math.max(ge,ve.height)});let ie=Q+G*2+105,pe=Z.length*z+G*2+ge/2,ue=i.padding,fe=d-i.padding-ie,Me=i.padding,Ce=h-i.padding-pe;B=Math.max(ue,Math.min(B,fe)),F=Math.max(Me,Math.min(F,Ce)),re.forEach((Ye,Ze)=>{Ye.attr("x",B+G).attr("y",F+G+(Ze+1)*z)}),$.insert("rect","text").attr("x",B).attr("y",F).attr("width",ie).attr("height",pe).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){let _=p.append("g").attr("class","wardley-notes");l.notes.forEach(B=>{let F=v(B.x),G=b(B.y);_.append("text").attr("x",F).attr("y",G).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.text)})}if(l.accelerators.length>0){let _=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(B=>{let F=v(B.x),G=b(B.y),z=60,V=30,$=20,Z=` - M ${F} ${G-V/2} - L ${F+z-$} ${G-V/2} - L ${F+z-$} ${G-V/2-8} - L ${F+z} ${G} - L ${F+z-$} ${G+V/2+8} - L ${F+z-$} ${G+V/2} - L ${F} ${G+V/2} - Z - `;_.append("path").attr("d",Z).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),_.append("text").attr("x",F+z/2).attr("y",G+V/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.name)})}if(l.deaccelerators.length>0){let _=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(B=>{let F=v(B.x),G=b(B.y),z=60,V=30,$=20,Z=` - M ${F+z} ${G-V/2} - L ${F+$} ${G-V/2} - L ${F+$} ${G-V/2-8} - L ${F} ${G} - L ${F+$} ${G+V/2+8} - L ${F+$} ${G+V/2} - L ${F+z} ${G+V/2} - Z - `;_.append("path").attr("d",Z).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),_.append("text").attr("x",F+z/2).attr("y",G+V/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(B.name)})}},"draw"),MOr={draw:ROr},LOr=k(({wardley:e}={})=>{let t=Bc(),r=Kt(),n=Kn(t,r.themeVariables),i=Kn(n.wardley,e);return` - .wardley-background { - fill: ${i.backgroundColor}; - } - .wardley-axes line, .wardley-axes path { - stroke: ${i.axisColor}; - } - .wardley-axis-label { - fill: ${i.axisTextColor}; - } - .wardley-stage-label { - fill: ${i.axisTextColor}; - } - .wardley-grid line { - stroke: ${i.gridColor}; - } - .wardley-node circle { - fill: ${i.componentFill}; - stroke: ${i.componentStroke}; - } - .wardley-node-label { - fill: ${i.componentLabelColor}; - } - .wardley-link { - stroke: ${i.linkStroke}; - } - .wardley-link--dashed { - stroke-dasharray: 4 4; - } - .wardley-link-label { - fill: ${i.axisTextColor}; - } - .wardley-trend line { - stroke: ${i.evolutionStroke}; - } - .wardley-annotation-line { - stroke: ${i.annotationStroke}; - } - .wardley-annotation circle { - fill: ${i.annotationFill}; - stroke: ${i.annotationStroke}; - } - .wardley-annotation text { - fill: ${i.annotationTextColor}; - } - .wardley-annotations-box rect { - fill: ${i.annotationFill}; - stroke: ${i.annotationStroke}; - } - .wardley-annotations-box text { - fill: ${i.annotationTextColor}; - } - .wardley-pipeline-box { - stroke: ${i.componentStroke}; - } - .wardley-notes text { - fill: ${i.axisTextColor}; - } - `},"styles"),DOr={parser:skt,db:SOr,renderer:MOr,styles:LOr}});var _kt={};gr(_kt,{diagram:()=>$Or});function UD(e){let t=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ikt(e){let t=0;for(let r=0;r{_u();cs();Vn();Wr();Gr();xr();yc();Ukt=k(()=>({domains:new Map,transitions:[]}),"createDefaultData"),ID=Ukt(),NOr=k(()=>ID.domains,"getDomains"),_Or=k(()=>ID.transitions,"getTransitions"),POr=k(e=>{if(e)for(let t of e){let r=t.domain,n=(t.items??[]).map(i=>({label:i.label}));ID.domains.set(r,{name:r,items:n})}},"setDomains"),OOr=k(e=>{e&&(ID.transitions=e.filter(t=>t.from===t.to?(ye.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`),!1):!0).map(t=>({from:t.from,to:t.to,label:t.label||void 0})))},"setTransitions"),BOr=k(()=>Kn({...Xr.cynefin,...Kt().cynefin}),"getConfig"),FOr=k(()=>{$r(),ID=Ukt()},"clear"),K$={getDomains:NOr,getTransitions:_Or,setDomains:POr,setTransitions:OOr,getConfig:BOr,clear:FOr,setAccTitle:sn,getAccTitle:pn,setDiagramTitle:Sn,getDiagramTitle:yn,getAccDescription:gn,setAccDescription:mn},zOr=k(e=>{ra(e,K$),K$.setDomains(e.domains),K$.setTransitions(e.transitions)},"populate"),GOr={parse:k(async e=>{let t=await Lo("cynefin",e);ye.debug(t),zOr(t)},"parse")};k(UD,"seededRandom");k(Ikt,"hashString");k(Rkt,"resolveSeed");k(Mkt,"generateFoldPath");k(Lkt,"generateHorizontalBoundary");k(Dkt,"generateCliffPath");k(Nkt,"generateConfusionPath");Akt={complex:{model:"Probe \u2192 Sense \u2192 Respond",practice:"Emergent Practices"},complicated:{model:"Sense \u2192 Analyse \u2192 Respond",practice:"Good Practices"},clear:{model:"Sense \u2192 Categorise \u2192 Respond",practice:"Best Practices"},chaotic:{model:"Act \u2192 Sense \u2192 Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},WOr=k((e,t)=>{let r=e/2,n=t/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),VOr=k(()=>{let e=Bc(),t=Kt();return Kn(e,t.themeVariables).cynefin},"getCynefinDomainColors"),t4e=3,HOr=k((e,t,r,n)=>{let i=n.db,a=i.getDomains(),o=i.getTransitions(),s=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),d=i.getConfig(),h=VOr();ye.debug("Rendering Cynefin diagram");let f=d.width,p=d.height,m=d.padding,g=d.showDomainDescriptions,y=d.boundaryAmplitude,v=f+m*2,b=p+m*2,x={complex:h.complexBg,complicated:h.complicatedBg,clear:h.clearBg,chaotic:h.chaoticBg,confusion:h.confusionBg},E=Mi(t);zn(E,b,v,d.useMaxWidth??!0),E.attr("viewBox",`0 0 ${v} ${b}`),l&&E.append("title").text(l),u&&E.append("desc").text(u);let w=E.append("g").attr("transform",`translate(${m}, ${m})`),T=WOr(f,p),C=Rkt(d.seed,t),S=w.append("g").attr("class","cynefin-backgrounds"),R=["complex","complicated","chaotic","clear"];for(let _ of R){let B=T[_];S.append("rect").attr("class","cynefinDomain").attr("x",B.x).attr("y",B.y).attr("width",B.w).attr("height",B.h).attr("fill",x[_]).attr("fill-opacity",.4).attr("stroke","none")}let U=w.append("g").attr("class","cynefin-boundaries");U.append("path").attr("class","cynefinBoundary").attr("d",Mkt(f,p,C,y)).attr("fill","none"),U.append("path").attr("class","cynefinBoundary").attr("d",Lkt(f,p,C+100,y)).attr("fill","none"),U.append("path").attr("class","cynefinCliff").attr("d",Dkt(f,p)).attr("fill","none");let L=f*.15,I=p*.15;w.append("path").attr("class","cynefinConfusion").attr("d",Nkt(f/2,p/2,L,I)).attr("fill",x.confusion).attr("fill-opacity",.5);let A=w.append("g").attr("class","cynefin-labels");for(let _ of R){let B=T[_];A.append("text").attr("class","cynefinDomainLabel").attr("x",B.cx).attr("y",g?B.cy-30:B.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(_.charAt(0).toUpperCase()+_.slice(1))}if(A.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",g?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),g){let _=w.append("g").attr("class","cynefin-subtitles");for(let B of R){let F=T[B],G=Akt[B];_.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(G.model),_.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(G.practice)}_.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Akt.confusion.practice)}let P=w.append("g").attr("class","cynefin-items"),D=26,M=10,O=["complex","complicated","chaotic","clear","confusion"];for(let _ of O){let B=a.get(_);if(!B||B.items.length===0)continue;let F=T[_],G=_==="confusion",z=B.items,V=0;G&&B.items.length>t4e&&(V=B.items.length-t4e,z=B.items.slice(0,t4e));let $;if(G){let Z=g?22:14;$=F.cy+Z}else $=F.cy+(g?25:15);if([...z].forEach((Z,re)=>{let Q=$+re*(D+4),ge=P.append("g"),ie=ge.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Z.label),pe=Z.label.length*7,ue=ie.node();if(ue&&typeof ue.getBBox=="function"){let Ce=ue.getBBox();Ce.width>0&&(pe=Ce.width)}let fe=pe+M*2,Me=F.cx-fe/2;ge.attr("transform",`translate(${Me}, ${Q})`),ge.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",fe).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[_]).attr("fill-opacity",.95),ie.attr("x",fe/2).attr("y",D/2)}),V>0){let Z=$+z.length*(D+4),re=`+${V} more`,Q=P.append("g"),ge=Q.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(re),ie=re.length*7,pe=ge.node();if(pe&&typeof pe.getBBox=="function"){let Me=pe.getBBox();Me.width>0&&(ie=Me.width)}let ue=ie+M*2,fe=F.cx-ue/2;Q.attr("transform",`translate(${fe}, ${Z})`),Q.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ue).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[_]).attr("fill-opacity",.6),ge.attr("x",ue/2).attr("y",D/2)}}if(o.length>0){let _=E.select("defs").empty()?E.append("defs"):E.select("defs"),B=`cynefin-arrow-${t}`;_.append("marker").attr("id",B).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let F=w.append("g").attr("class","cynefin-arrows");o.forEach(G=>{let z=T[G.from],V=T[G.to];if(!z||!V)return;if(G.from===G.to){ye.warn(`Cynefin renderer: skipping self-loop on domain "${G.from}"`);return}let $=z.cx,Z=z.cy,re=V.cx,Q=V.cy,ge=($+re)/2,ie=(Z+Q)/2,pe=re-$,ue=Q-Z,fe=Math.sqrt(pe*pe+ue*ue),Me=fe*.15,Ce=-ue/fe,Ye=pe/fe,Ze=ge+Ce*Me,Qe=ie+Ye*Me;F.append("path").attr("class","cynefinArrowLine").attr("d",`M${$},${Z} Q${Ze},${Qe} ${re},${Q}`).attr("fill","none").attr("marker-end",`url(#${B})`),G.label&&F.append("text").attr("class","cynefinArrowLabel").attr("x",Ze).attr("y",Qe-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(G.label)})}s&&w.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-m/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(s)},"draw"),qOr={draw:HOr},YOr=k(()=>{let e=Bc(),t=Kt();return Kn(e,t.themeVariables).cynefin},"getCynefinTheme"),jOr=k(()=>{let e=YOr();return` - .cynefinDomain { - stroke: none; - } - .cynefinDomainLabel { - font-size: ${e.domainFontSize}px; - font-weight: bold; - fill: ${e.labelColor}; - } - .cynefinSubtitle { - font-size: ${e.itemFontSize-1}px; - fill: ${e.textColor}; - font-style: italic; - } - .cynefinItem { - fill-opacity: 0.95; - stroke: ${e.boundaryColor}; - stroke-width: 1; - } - .cynefinItemText { - font-size: ${e.itemFontSize}px; - fill: ${e.textColor}; - } - .cynefinItemOverflow { - fill-opacity: 0.6; - stroke: ${e.boundaryColor}; - stroke-width: 1; - stroke-dasharray: 3 2; - } - .cynefinBoundary { - stroke: ${e.boundaryColor}; - stroke-width: ${e.boundaryWidth}; - stroke-dasharray: 6 3; - } - .cynefinCliff { - stroke: ${e.cliffColor}; - stroke-width: ${e.cliffWidth}; - } - .cynefinConfusion { - stroke: ${e.boundaryColor}; - stroke-width: 1.5; - stroke-dasharray: 4 2; - } - .cynefinArrowLine { - stroke: ${e.arrowColor}; - stroke-width: ${e.arrowWidth}; - fill: none; - } - .cynefinArrowHead { - fill: ${e.arrowColor}; - stroke: none; - } - .cynefinArrowLabel { - font-size: ${e.itemFontSize-1}px; - fill: ${e.textColor}; - } - .cynefinTitle { - font-size: ${e.domainFontSize+2}px; - font-weight: bold; - fill: ${e.labelColor}; - } - `},"styles"),XOr=jOr,$Or={parser:GOr,db:K$,renderer:qOr,styles:XOr}});var r4e,n4e,i4e,a4e,Z$,ew,OA,KOr,Bkt,Fkt,ZOr,QOr,JOr,eBr,tBr,rBr,nBr,iBr,aBr,ia,xc,oBr,sBr,lBr,zkt,cBr,uBr,fa,Gkt,A6,dBr,hBr,o4e,tw,Jf,fBr,Okt,pBr,rw,RD=H(()=>{cs();Wr();Gr();xr();r4e="",n4e="",i4e="",a4e=[],Z$=new Map,ew=k(e=>rn(e,je()),"sanitizeText"),OA=k(e=>{switch(e.type){case"terminal":return{...e,value:ew(e.value)};case"nonterminal":return{...e,name:ew(e.name)};case"sequence":return{...e,elements:e.elements.map(OA)};case"choice":return{...e,alternatives:e.alternatives.map(OA)};case"optional":return{...e,element:OA(e.element)};case"repetition":return{...e,element:OA(e.element),separator:e.separator?OA(e.separator):void 0};case"special":return{...e,text:ew(e.text)}}},"sanitizeAstNode"),KOr=k(()=>{r4e="",n4e="",i4e="",a4e.length=0,Z$.clear(),$r(),ye.debug("[Railroad] Database cleared")},"clear"),Bkt=k(e=>{r4e=ew(e),ye.debug("[Railroad] Title set:",e)},"setTitle"),Fkt=k(()=>r4e,"getTitle"),ZOr=k(e=>{let t={...e,name:ew(e.name),definition:OA(e.definition),comment:e.comment?ew(e.comment):void 0};ye.debug("[Railroad] Adding rule:",t.name),Z$.has(t.name)&&ye.warn(`[Railroad] Rule '${t.name}' is already defined. Overwriting.`),a4e.push(t),Z$.set(t.name,t)},"addRule"),QOr=k(()=>a4e,"getRules"),JOr=k(e=>Z$.get(e),"getRule"),eBr=k(e=>{n4e=ew(e).replace(/^\s+/g,""),ye.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),tBr=k(()=>n4e,"getAccTitle"),rBr=k(e=>{i4e=ew(e).replace(/\n\s+/g,` -`),ye.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),nBr=k(()=>i4e,"getAccDescription"),iBr=Bkt,aBr=Fkt,ia={clear:KOr,setTitle:Bkt,getTitle:Fkt,addRule:ZOr,getRules:QOr,getRule:JOr,setAccTitle:eBr,getAccTitle:tBr,setAccDescription:rBr,getAccDescription:nBr,setDiagramTitle:iBr,getDiagramTitle:aBr},xc={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},oBr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,sBr=/^[\w "',.-]+$/,lBr=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),zkt=k(e=>e?Object.keys(e).every(t=>t==="railroad"||lBr.has(t)):!1,"isRailroadStyleOptions"),cBr=k(e=>e?"railroad"in e&&e.railroad?e.railroad:zkt(e)?e:{}:{},"extractRailroadOverrides"),uBr=k(e=>{if(!e||zkt(e))return{};let{railroad:t,svgId:r,theme:n,look:i,...a}=e;return a},"extractThemeOverrides"),fa=k((e,t)=>{if(typeof e!="string")return t;let r=e.trim();return oBr.test(r)?r:t},"sanitizeColorValue"),Gkt=k((e,t)=>{if(typeof e!="string")return t;let r=e.trim();return sBr.test(r)?r:t},"sanitizeFontFamilyValue"),A6=k((e,t)=>{let r=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(r)&&r>=0?r:t},"sanitizeNumberValue"),dBr=k(e=>{let t=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(t)&&t>0?t:void 0},"parseThemeFontSize"),hBr=k(e=>{let t=Gkt(e.fontFamily,xc.fontFamily),r=dBr(e.fontSize)??xc.fontSize;return{...xc,fontFamily:t,fontSize:r,terminalFill:fa(e.secondBkg??e.secondaryColor,xc.terminalFill),terminalStroke:fa(e.secondaryBorderColor??e.lineColor,xc.terminalStroke),terminalTextColor:fa(e.secondaryTextColor??e.textColor,xc.terminalTextColor),nonTerminalFill:fa(e.mainBkg??e.background,xc.nonTerminalFill),nonTerminalStroke:fa(e.primaryBorderColor??e.lineColor,xc.nonTerminalStroke),nonTerminalTextColor:fa(e.primaryTextColor??e.textColor,xc.nonTerminalTextColor),lineColor:fa(e.lineColor,xc.lineColor),markerFill:fa(e.lineColor,xc.markerFill),commentFill:fa(e.labelBackground??e.tertiaryColor,xc.commentFill),commentStroke:fa(e.tertiaryBorderColor??e.lineColor,xc.commentStroke),commentTextColor:fa(e.tertiaryTextColor??e.textColor,xc.commentTextColor),specialFill:fa(e.tertiaryColor??e.secondaryColor,xc.specialFill),specialStroke:fa(e.tertiaryBorderColor??e.secondaryBorderColor,xc.specialStroke),ruleNameColor:fa(e.titleColor??e.textColor,xc.ruleNameColor)}},"buildThemeDefaults"),o4e=k(e=>{let t=Kt(),r={...Bc(),...t.themeVariables??{},...uBr(e)},n=hBr(r),i={...t.railroad??{},...cBr(e)};return{compactMode:i.compactMode??n.compactMode,padding:A6(i.padding,n.padding),verticalSeparation:A6(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:A6(i.horizontalSeparation,n.horizontalSeparation),arcRadius:A6(i.arcRadius,n.arcRadius),fontSize:A6(i.fontSize,n.fontSize),fontFamily:Gkt(i.fontFamily,n.fontFamily),terminalFill:fa(i.terminalFill,n.terminalFill),terminalStroke:fa(i.terminalStroke,n.terminalStroke),terminalTextColor:fa(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:fa(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:fa(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:fa(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:fa(i.lineColor,n.lineColor),strokeWidth:A6(i.strokeWidth,n.strokeWidth),markerFill:fa(i.markerFill,n.markerFill),commentFill:fa(i.commentFill,n.commentFill),commentStroke:fa(i.commentStroke,n.commentStroke),commentTextColor:fa(i.commentTextColor,n.commentTextColor),specialFill:fa(i.specialFill,n.specialFill),specialStroke:fa(i.specialStroke,n.specialStroke),ruleNameColor:fa(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:A6(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),tw=k(e=>{let{fontFamily:t,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:s,nonTerminalTextColor:l,lineColor:u,strokeWidth:d,markerFill:h,commentFill:f,commentStroke:p,commentTextColor:m,specialFill:g,specialStroke:y,ruleNameColor:v}=o4e(e);return` - .railroad-diagram { - font-family: ${t}; - font-size: ${r}px; - } - - .railroad-terminal rect { - fill: ${n}; - stroke: ${i}; - stroke-width: ${d}px; - } - - .railroad-terminal text { - fill: ${a}; - font-family: ${t}; - font-size: ${r}px; - text-anchor: middle; - dominant-baseline: middle; - } - - .railroad-nonterminal rect { - fill: ${o}; - stroke: ${s}; - stroke-width: ${d}px; - } - - .railroad-nonterminal text { - fill: ${l}; - font-family: ${t}; - font-size: ${r}px; - text-anchor: middle; - dominant-baseline: middle; - } - - .railroad-line { - stroke: ${u}; - stroke-width: ${d}px; - fill: none; - } - - .railroad-start circle, - .railroad-end circle { - fill: ${h}; - } - - .railroad-comment ellipse { - fill: ${f}; - stroke: ${p}; - stroke-width: ${d}px; - } - - .railroad-comment text { - fill: ${m}; - font-style: italic; - font-family: ${t}; - font-size: ${r}px; - text-anchor: middle; - dominant-baseline: middle; - } - - .railroad-special rect { - fill: ${g}; - stroke: ${y}; - stroke-width: ${d}px; - stroke-dasharray: 5,3; - } - - .railroad-special text { - fill: ${l}; - font-family: ${t}; - font-size: ${r}px; - text-anchor: middle; - dominant-baseline: middle; - } - - .railroad-rule-name { - font-weight: bold; - fill: ${v}; - font-family: ${t}; - font-size: ${r}px; - } - - .railroad-group { - /* Grouping container, no specific styles */ - } -`},"getStyles"),Jf=class{constructor(){this.d=""}static{k(this,"PathBuilder")}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,r,n,i,a,o){return this.d+=`A ${e} ${t} ${r} ${n?1:0} ${i?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},fBr=class{constructor(e,t=o4e()){this.textCache=new Map,this.svg=e,this.config=t}static{k(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);let t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),r=t.node().getBBox(),n={width:r.width,height:r.height};return t.remove(),this.textCache.set(e,n),n}renderTerminal(e,t){let r=this.measureText(t),n=r.width+this.config.padding*2,i=r.height+this.config.padding*2,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",n).attr("height",i).attr("rx",10).attr("ry",10),a.append("text").attr("x",n/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:n,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){let r=this.measureText(t),n=r.width+this.config.padding*2,i=r.height+this.config.padding*2,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",n).attr("height",i),a.append("text").attr("x",n/2).attr("y",i/2).text(t),{element:a.node(),dimensions:{width:n,height:i,up:i/2,down:i/2}}}renderSequence(e,t){let r=t.map(l=>this.renderExpression(e,l)),n=0,i=0,a=0;for(let l of r)n+=l.dimensions.width,i=Math.max(i,l.dimensions.up),a=Math.max(a,l.dimensions.down);n+=(r.length-1)*this.config.horizontalSeparation;let o=e.append("g").attr("class","railroad-sequence"),s=0;for(let l=0;lthis.renderExpression(e,h)),n=0,i=0;for(let h of r)n=Math.max(n,h.dimensions.width),i+=h.dimensions.height;i+=(r.length-1)*this.config.verticalSeparation;let a=this.config.arcRadius,o=a*4,s=n+o,l=e.append("g").attr("class","railroad-choice"),u=0,d=i/2;for(let h of r){let f=u,p=f+h.dimensions.up,m=a*2+(n-h.dimensions.width)/2;l.node().appendChild(h.element).setAttribute("transform",`translate(${m}, ${f})`);let y=new Jf,v=p>d;p===d?y.moveTo(0,d).lineTo(m,p):y.moveTo(0,d).arcTo(a,a,0,!1,v,a,d+(v?a:-a)).lineTo(a,p-(v?a:-a)).arcTo(a,a,0,!1,!v,a*2,p).lineTo(m,p),l.append("path").attr("class","railroad-line").attr("d",y.build());let b=new Jf,x=m+h.dimensions.width,E=s-a*2;p===d?b.moveTo(x,p).lineTo(s,d):b.moveTo(x,p).lineTo(E,p).arcTo(a,a,0,!1,!v,s-a,p+(v?-a:a)).lineTo(s-a,d+(v?a:-a)).arcTo(a,a,0,!1,v,s,d),l.append("path").attr("class","railroad-line").attr("d",b.build()),u+=h.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:s,height:i,up:d,down:i-d}}}renderOptional(e,t){let r=this.renderExpression(e,t),n=this.config.arcRadius,i=n*2,a=r.dimensions.width+n*4,o=r.dimensions.height+i,s=e.append("g").attr("class","railroad-optional"),l=n*2,u=i;s.node().appendChild(r.element).setAttribute("transform",`translate(${l}, ${u})`);let h=u+r.dimensions.up,f=new Jf().moveTo(0,h).lineTo(n*2,h);s.append("path").attr("class","railroad-line").attr("d",f.build());let p=new Jf().moveTo(l+r.dimensions.width,h).lineTo(a,h);s.append("path").attr("class","railroad-line").attr("d",p.build());let m=new Jf().moveTo(0,h).arcTo(n,n,0,!1,!1,n,h-n).lineTo(n,n).arcTo(n,n,0,!1,!0,n*2,0).lineTo(a-n*2,0).arcTo(n,n,0,!1,!0,a-n,n).lineTo(a-n,h-n).arcTo(n,n,0,!1,!1,a,h);return s.append("path").attr("class","railroad-line").attr("d",m.build()),{element:s.node(),dimensions:{width:a,height:o,up:h,down:o-h}}}renderRepetition(e,t,r){let n=this.renderExpression(e,t),i=this.config.arcRadius,a=i*2,o=n.dimensions.width+i*4,s=r===0,l=n.dimensions.height+a+(s?a:0),u=e.append("g").attr("class","railroad-repetition"),d=i*2,h=s?a:0;u.node().appendChild(n.element).setAttribute("transform",`translate(${d}, ${h})`);let p=h+n.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new Jf().moveTo(0,p).lineTo(i*2,p).build()),u.append("path").attr("class","railroad-line").attr("d",new Jf().moveTo(d+n.dimensions.width,p).lineTo(o,p).build());let m=h+n.dimensions.height+i,g=new Jf().moveTo(d+n.dimensions.width,p).arcTo(i,i,0,!1,!0,d+n.dimensions.width+i,p+i).lineTo(d+n.dimensions.width+i,m).arcTo(i,i,0,!1,!0,d+n.dimensions.width,m+i).lineTo(i*2,m+i).arcTo(i,i,0,!1,!0,i,m).lineTo(i,p+i).arcTo(i,i,0,!1,!0,i*2,p);if(u.append("path").attr("class","railroad-line").attr("d",g.build()),s){let y=new Jf().moveTo(0,p).arcTo(i,i,0,!1,!1,i,p-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,p-i).arcTo(i,i,0,!1,!1,o,p);u.append("path").attr("class","railroad-line").attr("d",y.build())}return{element:u.node(),dimensions:{width:o,height:l,up:p,down:l-p}}}renderSpecial(e,t){let r=this.measureText("? "+t+" ?"),n=r.width+this.config.padding*2,i=r.height+this.config.padding*2,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",n).attr("height",i),a.append("text").attr("x",n/2).attr("y",i/2).text("? "+t+" ?"),{element:a.node(),dimensions:{width:n,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error(`Unknown node type: ${t.type}`)}}renderRule(e,t){let r=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`),n=e.name+" =",i=this.measureText(n).width+20,a=i+20,o=r.append("g"),s=this.renderExpression(o,e.definition),l=Math.max(20,s.dimensions.up),u=l-s.dimensions.up;return o.attr("transform",`translate(${a}, ${u})`),r.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",l).text(n),r.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",l).attr("r",this.config.markerRadius),r.append("g").attr("class","railroad-end").append("circle").attr("cx",a+s.dimensions.width+10).attr("cy",l).attr("r",this.config.markerRadius),r.append("path").attr("class","railroad-line").attr("d",new Jf().moveTo(i+this.config.markerRadius,l).lineTo(a,l).build()),r.append("path").attr("class","railroad-line").attr("d",new Jf().moveTo(a+s.dimensions.width,l).lineTo(a+s.dimensions.width+10-this.config.markerRadius,l).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:a+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,r=0;for(let n of e){let i=this.renderRule(n,t);t+=i.height+this.config.verticalSeparation,r=Math.max(r,i.width)}return{width:r+this.config.padding*2,height:t+this.config.padding}}},Okt=k((e,t,r)=>{zn(e,t.height,t.width,r),e.attr("viewBox",`0 0 ${t.width} ${t.height}`)},"configureRailroadSvgSize"),pBr=k((e,t,r)=>{ye.debug(`[Railroad] Rendering diagram -`+e);try{let n=Mi(t);n.attr("class","railroad-diagram");let a=Kt().railroad?.useMaxWidth??!0,o=ia.getRules();if(ye.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){ye.warn("[Railroad] No rules to render"),Okt(n,{height:100,width:200},a);return}let l=new fBr(n,o4e()).renderDiagram(o);Okt(n,l,a),ye.debug("[Railroad] Render complete")}catch(n){throw ye.error("[Railroad] Render error:",n),n}},"draw"),rw={draw:pBr}});var Vkt={};gr(Vkt,{default:()=>bBr,diagram:()=>Wkt});var mBr,BA,gBr,yBr,vBr,Wkt,bBr,Hkt=H(()=>{RD();_u();cs();Wr();Gr();xr();yc();mBr=lA().Railroad.parser.LangiumParser,BA=k(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{let t=e.elements.map(BA);return t.length===1?t[0]:{type:"sequence",elements:t}}case"RailroadChoiceExpr":{let t=e.alternatives.map(BA);return t.length===1?t[0]:{type:"choice",alternatives:t}}case"RailroadOptionalExpr":return{type:"optional",element:BA(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:BA(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:BA(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),gBr=k(e=>({name:e.name,definition:BA(e.definition)}),"transformRule"),yBr=k(e=>{ra(e,ia),e.title&&ia.setTitle(e.title),e.rules.map(t=>ia.addRule(gBr(t)))},"populateDb"),vBr={parse:k(e=>{ia.clear(),ye.debug("[Railroad Parser] Starting Langium parse");let t=mBr.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new ov(t);let r=t.value;ye.debug("[Railroad Parser] Parsed rules:",r.rules.length),yBr(r),ye.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ia}},Wkt={parser:vBr,db:ia,renderer:rw,styles:tw},bBr=Wkt});var Ykt={};gr(Ykt,{diagram:()=>ABr});var xBr,Q$,wBr,qkt,EBr,TBr,kBr,CBr,SBr,ABr,jkt=H(()=>{RD();_u();cs();Wr();Gr();xr();yc();xBr=cA().RailroadEbnf.parser.LangiumParser,Q$=k(e=>{let t=e.alternatives.map(wBr);return t.length===1?t[0]:{type:"choice",alternatives:t}},"transformChoice"),wBr=k(e=>{let t=e.elements.map(TBr);return t.length===1?t[0]:{type:"sequence",elements:t}},"transformSequence"),qkt=k(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return Q$(e.element);case"EbnfOptional":return{type:"optional",element:Q$(e.element)};case"EbnfRepetition":return{type:"repetition",element:Q$(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),EBr=k((e,t)=>{switch(t.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},qkt(t.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${t.$type}`)}},"transformPostfix"),TBr=k(e=>e.postfixes.reduce((t,r)=>EBr(t,r),qkt(e.base)),"transformTerm"),kBr=k(e=>({name:e.name,definition:Q$(e.definition)}),"transformRule"),CBr=k(e=>{ra(e,ia),e.title&&ia.setTitle(e.title),e.rules.map(t=>ia.addRule(kBr(t)))},"populateDb"),SBr={parse:k(e=>{ia.clear(),ye.debug("[EBNF Parser] Starting Langium parse");let t=xBr.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new ov(t);let r=t.value;ye.debug("[EBNF Parser] Parsed rules:",r.rules.length),CBr(r),ye.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ia}},ABr={parser:SBr,db:ia,renderer:rw,styles:tw}});var Xkt={};gr(Xkt,{diagram:()=>PBr});var UBr,s4e,IBr,RBr,MBr,LBr,DBr,NBr,_Br,PBr,$kt=H(()=>{RD();_u();cs();Wr();Gr();xr();yc();UBr=uA().RailroadAbnf.parser.LangiumParser,s4e=k(e=>{let t=e.alternatives.map(IBr);return t.length===1?t[0]:{type:"choice",alternatives:t}},"transformAlternation"),IBr=k(e=>{let t=e.elements.map(MBr);return t.length===1?t[0]:{type:"sequence",elements:t}},"transformConcatenation"),RBr=k(e=>{if(e.includes("*")){let[r,n]=e.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}let t=parseInt(e,10);return{min:t,max:t}},"parseRepeat"),MBr=k(e=>{let t=LBr(e.primary);if(!e.repeat)return t;let{min:r,max:n}=RBr(e.repeat);return r===0&&n===1?{type:"optional",element:t}:{type:"repetition",element:t,min:r,max:n}},"transformElement"),LBr=k(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return s4e(e.element);case"AbnfOptionalGroup":return{type:"optional",element:s4e(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),DBr=k(e=>({name:e.name,definition:s4e(e.definition)}),"transformRule"),NBr=k(e=>{ra(e,ia),e.title&&ia.setTitle(e.title),e.rules.map(t=>ia.addRule(DBr(t)))},"populateDb"),_Br={parse:k(e=>{ia.clear(),ye.debug("[ABNF Parser] Starting Langium parse");let t=UBr.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new ov(t);let r=t.value;ye.debug("[ABNF Parser] Parsed rules:",r.rules.length),NBr(r),ye.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ia}},PBr={parser:_Br,db:ia,renderer:rw,styles:tw}});var Qkt={};gr(Qkt,{diagram:()=>qBr});var OBr,Zkt,BBr,FBr,Kkt,zBr,GBr,WBr,VBr,HBr,qBr,Jkt=H(()=>{RD();_u();cs();Wr();Gr();xr();yc();OBr=dA().RailroadPeg.parser.LangiumParser,Zkt=k(e=>{let t=e.alternatives.map(BBr);return t.length===1?t[0]:{type:"choice",alternatives:t}},"transformOrderedChoice"),BBr=k(e=>{let t=e.elements.map(FBr);return t.length===1?t[0]:{type:"sequence",elements:t}},"transformSequence"),FBr=k(e=>{let t=zBr(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${Kkt(t)}`:`!${Kkt(t)}`}:t},"transformPrefix"),Kkt=k(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),zBr=k(e=>{let t=GBr(e.primary);if(!e.operator)return t;switch(e.operator){case"?":return{type:"optional",element:t};case"*":return{type:"repetition",element:t,min:0,max:1/0};case"+":return{type:"repetition",element:t,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),GBr=k(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return Zkt(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),WBr=k(e=>({name:e.name,definition:Zkt(e.definition)}),"transformRule"),VBr=k(e=>{ra(e,ia),e.title&&ia.setTitle(e.title),e.rules.map(t=>ia.addRule(WBr(t)))},"populateDb"),HBr={parse:k(e=>{ia.clear(),ye.debug("[PEG Parser] Starting Langium parse");let t=OBr.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new ov(t);let r=t.value;ye.debug("[PEG Parser] Parsed rules:",r.rules.length),VBr(r),ye.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ia}},qBr={parser:HBr,db:ia,renderer:rw,styles:tw}});function VCt(e,t){e.attr("role",RGr),t!==""&&e.attr("aria-roledescription",t)}function HCt(e,t,r,n){if(e.insert!==void 0){if(r){let i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(t){let i=`chart-title-${n}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}function YCt(e){let t=e.match(yse);if(!t)return{text:e,metadata:{}};let r=t[1],n=r?t[2].split(` -`).map(o=>o.startsWith(r)?o.slice(r.length):o).join(` -`):t[2],i=$2(n,{schema:X2})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}function d4e(e){let t=DGr(e),r=NGr(t),n=_Gr(r.text),i=Kn(r.config,n.directive);return e=LGr(n.text),{code:e,title:r.title,config:i}}function jCt(e){let t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}function h4e(e){let t=d4e(e);return O9(),pBe(t.config??{}),t}async function XCt(e,t){eK();try{let{code:r,config:n}=h4e(e);return{diagramType:(await KCt(r)).type,config:n}}catch(r){if(t?.suppressErrors)return!1;throw r}}function u4e(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}function $Ct(e={}){let t=co({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),dBe(t),t?.theme&&t.theme in Gm?t.themeVariables=Gm[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Gm.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?uBe(t):mse();m9(r.logLevel),eK()}function ZCt(e,t,r,n){VCt(t,e),HCt(t,r,n,t.attr("id"))}var iCt,YBr,jBr,XBr,$Br,aCt,KBr,ZBr,QBr,JBr,oCt,eFr,tFr,rFr,nFr,sCt,iFr,aFr,oFr,sFr,lCt,lFr,cFr,uFr,dFr,cCt,hFr,fFr,pFr,mFr,uCt,gFr,yFr,vFr,bFr,dCt,xFr,wFr,EFr,hCt,TFr,kFr,CFr,fCt,SFr,AFr,UFr,IFr,pCt,RFr,MFr,LFr,DFr,mCt,NFr,_Fr,PFr,OFr,gCt,BFr,FFr,zFr,GFr,yCt,WFr,VFr,HFr,qFr,vCt,YFr,jFr,XFr,$Fr,bCt,KFr,ZFr,QFr,JFr,xCt,ezr,tzr,rzr,nzr,wCt,izr,azr,ozr,szr,lzr,ECt,czr,uzr,dzr,TCt,hzr,fzr,pzr,mzr,kCt,gzr,yzr,vzr,bzr,CCt,xzr,wzr,Ezr,Tzr,SCt,kzr,Czr,Szr,Azr,ACt,Uzr,Izr,Rzr,Mzr,UCt,Lzr,Dzr,Nzr,ICt,_zr,Pzr,Ozr,RCt,Bzr,Fzr,zzr,Gzr,MCt,Wzr,Vzr,Hzr,qzr,LCt,Yzr,jzr,Xzr,$zr,DCt,Kzr,Zzr,Qzr,Jzr,NCt,eGr,tGr,rGr,_Ct,nGr,iGr,aGr,oGr,PCt,sGr,lGr,cGr,OCt,uGr,dGr,hGr,fGr,BCt,pGr,mGr,gGr,FCt,yGr,vGr,bGr,zCt,xGr,wGr,EGr,GCt,TGr,kGr,CGr,WCt,SGr,AGr,UGr,eCt,eK,IGr,RGr,c4e,tCt,MGr,LGr,DGr,NGr,_Gr,PGr,OGr,BGr,FGr,zGr,GGr,WGr,VGr,HGr,qGr,YGr,jGr,XGr,$Gr,KGr,rCt,ZGr,QGr,JGr,eWr,tWr,nCt,rWr,nWr,KCt,U6,iWr,QCt,aWr,JCt,oWr,sWr,eSt,lWr,J$,l4e,tSt,cWr,rSt,uWr,yv,tK,nSt=H(()=>{cs();NV();O4();_d();Gc();Wc();nl();Vo();Us();ds();us();Vn();Wr();Gr();xr();fue();_n();kut();lk();aW();iCt="c4",YBr=k(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),jBr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Wut(),Gut));return{id:iCt,diagram:e}},"loader"),XBr={id:iCt,detector:YBr,loader:jBr},$Br=XBr,aCt="flowchart",KBr=k((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),ZBr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Lq(),Mq));return{id:aCt,diagram:e}},"loader"),QBr={id:aCt,detector:KBr,loader:ZBr},JBr=QBr,oCt="flowchart-v2",eFr=k((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),tFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Lq(),Mq));return{id:oCt,diagram:e}},"loader"),rFr={id:oCt,detector:eFr,loader:tFr},nFr=rFr,sCt="swimlane",iFr=k(e=>/^\s*swimlane-beta\b/.test(e),"detector"),aFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(jut(),Yut));return{id:sCt,diagram:e}},"loader"),oFr={id:sCt,detector:iFr,loader:aFr},sFr=oFr,lCt="er",lFr=k(e=>/^\s*erDiagram/.test(e),"detector"),cFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Zut(),Kut));return{id:lCt,diagram:e}},"loader"),uFr={id:lCt,detector:lFr,loader:cFr},dFr=uFr,cCt="gitGraph",hFr=k(e=>/^\s*gitGraph/.test(e),"detector"),fFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(s5t(),o5t));return{id:cCt,diagram:e}},"loader"),pFr={id:cCt,detector:hFr,loader:fFr},mFr=pFr,uCt="gantt",gFr=k(e=>/^\s*gantt/.test(e),"detector"),yFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(R5t(),I5t));return{id:uCt,diagram:e}},"loader"),vFr={id:uCt,detector:gFr,loader:yFr},bFr=vFr,dCt="info",xFr=k(e=>/^\s*info/.test(e),"detector"),wFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(L5t(),M5t));return{id:dCt,diagram:e}},"loader"),EFr={id:dCt,detector:xFr,loader:wFr},hCt="pie",TFr=k(e=>/^\s*pie/.test(e),"detector"),kFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(P5t(),_5t));return{id:hCt,diagram:e}},"loader"),CFr={id:hCt,detector:TFr,loader:kFr},fCt="quadrantChart",SFr=k(e=>/^\s*quadrantChart/.test(e),"detector"),AFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(J5t(),Q5t));return{id:fCt,diagram:e}},"loader"),UFr={id:fCt,detector:SFr,loader:AFr},IFr=UFr,pCt="xychart",RFr=k(e=>/^\s*xychart(-beta)?/.test(e),"detector"),MFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(w4t(),x4t));return{id:pCt,diagram:e}},"loader"),LFr={id:pCt,detector:RFr,loader:MFr},DFr=LFr,mCt="requirement",NFr=k(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),_Fr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(k4t(),T4t));return{id:mCt,diagram:e}},"loader"),PFr={id:mCt,detector:NFr,loader:_Fr},OFr=PFr,gCt="sequence",BFr=k(e=>/^\s*sequenceDiagram/.test(e),"detector"),FFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(F4t(),B4t));return{id:gCt,diagram:e}},"loader"),zFr={id:gCt,detector:BFr,loader:FFr},GFr=zFr,yCt="class",WFr=k((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),VFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(H4t(),V4t));return{id:yCt,diagram:e}},"loader"),HFr={id:yCt,detector:WFr,loader:VFr},qFr=HFr,vCt="classDiagram",YFr=k((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),jFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Y4t(),q4t));return{id:vCt,diagram:e}},"loader"),XFr={id:vCt,detector:YFr,loader:jFr},$Fr=XFr,bCt="state",KFr=k((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),ZFr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(v3t(),y3t));return{id:bCt,diagram:e}},"loader"),QFr={id:bCt,detector:KFr,loader:ZFr},JFr=QFr,xCt="stateDiagram",ezr=k((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),tzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(x3t(),b3t));return{id:xCt,diagram:e}},"loader"),rzr={id:xCt,detector:ezr,loader:tzr},nzr=rzr,wCt="journey",izr=k(e=>/^\s*journey/.test(e),"detector"),azr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(R3t(),I3t));return{id:wCt,diagram:e}},"loader"),ozr={id:wCt,detector:izr,loader:azr},szr=ozr,lzr=k((e,t,r)=>{ye.debug(`rendering svg for syntax error -`);let n=Mi(t),i=n.append("g");n.attr("viewBox","0 0 2412 512"),zn(n,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 ${r}`)},"draw"),ECt={draw:lzr},czr=ECt,uzr={db:{},renderer:ECt,parser:{parse:k(()=>{},"parse")}},dzr=uzr,TCt="flowchart-elk",hzr=k((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),fzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Lq(),Mq));return{id:TCt,diagram:e}},"loader"),pzr={id:TCt,detector:hzr,loader:fzr},mzr=pzr,kCt="timeline",gzr=k(e=>/^\s*timeline/.test(e),"detector"),yzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(t6t(),e6t));return{id:kCt,diagram:e}},"loader"),vzr={id:kCt,detector:gzr,loader:yzr},bzr=vzr,CCt="mindmap",xzr=k(e=>/^\s*mindmap/.test(e),"detector"),wzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(l6t(),s6t));return{id:CCt,diagram:e}},"loader"),Ezr={id:CCt,detector:xzr,loader:wzr},Tzr=Ezr,SCt="kanban",kzr=k(e=>/^\s*kanban/.test(e),"detector"),Czr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(d6t(),u6t));return{id:SCt,diagram:e}},"loader"),Szr={id:SCt,detector:kzr,loader:Czr},Azr=Szr,ACt="sankey",Uzr=k(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Izr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(P6t(),_6t));return{id:ACt,diagram:e}},"loader"),Rzr={id:ACt,detector:Uzr,loader:Izr},Mzr=Rzr,UCt="packet",Lzr=k(e=>/^\s*packet(-beta)?/.test(e),"detector"),Dzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(z6t(),F6t));return{id:UCt,diagram:e}},"loader"),Nzr={id:UCt,detector:Lzr,loader:Dzr},ICt="radar",_zr=k(e=>/^\s*radar-beta/.test(e),"detector"),Pzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(X6t(),j6t));return{id:ICt,diagram:e}},"loader"),Ozr={id:ICt,detector:_zr,loader:Pzr},RCt="block",Bzr=k(e=>/^\s*block(-beta)?/.test(e),"detector"),Fzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(fEt(),hEt));return{id:RCt,diagram:e}},"loader"),zzr={id:RCt,detector:Bzr,loader:Fzr},Gzr=zzr,MCt="treeView",Wzr=k(e=>/^\s*treeView-beta/.test(e),"detector"),Vzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(SEt(),CEt));return{id:MCt,diagram:e}},"loader"),Hzr={id:MCt,detector:Wzr,loader:Vzr},qzr=Hzr,LCt="architecture",Yzr=k(e=>/^\s*architecture/.test(e),"detector"),jzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(qEt(),HEt));return{id:LCt,diagram:e}},"loader"),Xzr={id:LCt,detector:Yzr,loader:jzr},$zr=Xzr,DCt="eventmodeling",Kzr=k(e=>/^\s*eventmodeling/.test(e),"detector"),Zzr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(xTt(),bTt));return{id:DCt,diagram:e}},"loader"),Qzr={id:DCt,detector:Kzr,loader:Zzr},Jzr=Qzr,NCt="ishikawa",eGr=k(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),tGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(ITt(),UTt));return{id:NCt,diagram:e}},"loader"),rGr={id:NCt,detector:eGr,loader:tGr},_Ct="venn",nGr=k(e=>/^\s*venn-beta/.test(e),"detector"),iGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(ekt(),JTt));return{id:_Ct,diagram:e}},"loader"),aGr={id:_Ct,detector:nGr,loader:iGr},oGr=aGr,PCt="treemap",sGr=k(e=>/^\s*treemap/.test(e),"detector"),lGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(akt(),ikt));return{id:PCt,diagram:e}},"loader"),cGr={id:PCt,detector:sGr,loader:lGr},OCt="wardley",uGr=k(e=>/^\s*wardley-beta/i.test(e),"detector"),dGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Skt(),Ckt));return{id:OCt,diagram:e}},"loader"),hGr={id:OCt,detector:uGr,loader:dGr},fGr=hGr,BCt="cynefin",pGr=k(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),mGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Pkt(),_kt));return{id:BCt,diagram:e}},"loader"),gGr={id:BCt,detector:pGr,loader:mGr},FCt="railroad",yGr=k(e=>/^\s*railroad-beta/i.test(e),"detector"),vGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Hkt(),Vkt));return{id:FCt,diagram:e}},"loader"),bGr={id:FCt,detector:yGr,loader:vGr},zCt="railroadEbnf",xGr=k(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),wGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(jkt(),Ykt));return{id:zCt,diagram:e}},"loader"),EGr={id:zCt,detector:xGr,loader:wGr},GCt="railroadAbnf",TGr=k(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),kGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>($kt(),Xkt));return{id:GCt,diagram:e}},"loader"),CGr={id:GCt,detector:TGr,loader:kGr},WCt="railroadPeg",SGr=k(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),AGr=k(async()=>{let{diagram:e}=await Promise.resolve().then(()=>(Jkt(),Qkt));return{id:WCt,diagram:e}},"loader"),UGr={id:WCt,detector:SGr,loader:AGr},eCt=!1,eK=k(()=>{eCt||(eCt=!0,W9("error",dzr,e=>e.toLowerCase().trim()==="error"),W9("---",{db:{clear:k(()=>{},"clear")},styles:{},renderer:{draw:k(()=>{},"draw")},parser:{parse:k(()=>{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:k(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),mz(mzr,Tzr,$zr),mz($Br,Azr,$Fr,qFr,dFr,bFr,EFr,CFr,OFr,GFr,sFr,nFr,JBr,bzr,mFr,nzr,JFr,szr,IFr,Mzr,Nzr,DFr,Gzr,Jzr,qzr,Ozr,rGr,cGr,bGr,EGr,CGr,UGr,oGr,fGr,gGr))},"addDiagrams"),IGr=k(async()=>{ye.debug("Loading registered diagrams");let t=(await Promise.allSettled(Object.entries(l2).map(async([r,{detector:n,loader:i}])=>{if(i)try{xz(r)}catch{try{let{diagram:a,id:o}=await i();W9(o,a,n)}catch(a){throw ye.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete l2[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){ye.error(`Failed to load ${t.length} external diagrams`);for(let r of t)ye.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),RGr="graphics-document document";k(VCt,"setA11yDiagramInfo");k(HCt,"addSVGa11yTitleDescription");c4e=class qCt{constructor(t,r,n,i,a){this.type=t,this.text=r,this.db=n,this.parser=i,this.renderer=a}static{k(this,"Diagram")}static async fromText(t,r={}){let n=Kt(),i=B9(t,n);t=vYe(t)+` -`;try{xz(i)}catch{let u=yBe(i);if(!u)throw new vse(`Diagram ${i} not found.`);let{id:d,diagram:h}=await u();W9(d,h)}let{db:a,parser:o,renderer:s,init:l}=xz(i);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(n),r.title&&a.setDiagramTitle?.(r.title),await o.parse(t),new qCt(i,t,a,o,s)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},tCt=[],MGr=k(()=>{tCt.forEach(e=>{e()}),tCt=[]},"attachFunctions"),LGr=k(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");k(YCt,"extractFrontMatter");DGr=k(e=>e.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),NGr=k(e=>{let{text:t,metadata:r}=YCt(e),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:t}},"processFrontmatter"),_Gr=k(e=>{let t=Nr.detectInit(e)??{},r=Nr.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:hYe(e),directive:t}},"processDirectives");k(d4e,"preprocessDiagram");k(jCt,"toBase64");PGr=5e4,OGr="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",BGr="sandbox",FGr="loose",zGr="http://www.w3.org/2000/svg",GGr="http://www.w3.org/1999/xlink",WGr="http://www.w3.org/1999/xhtml",VGr="100%",HGr="100%",qGr="border:0;margin:0;",YGr="margin:0",jGr="allow-top-navigation-by-user-activation allow-popups",XGr='The "iframe" tag is not supported by your browser.',$Gr=["foreignobject"],KGr=["dominant-baseline"];k(h4e,"processAndSetConfigs");k(XCt,"parse");rCt=k((e,t,r=[])=>{let n=pse(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${n}`},"cssImportantStyles"),ZGr=k((e,t=new Map)=>{let r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){let s=As(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{iW(l.styles)||s.forEach(u=>{r.insertRule(rCt(l.id,u,l.styles),r.cssRules.length)}),iW(l.textStyles)||r.insertRule(rCt(l.id,"tspan",(l?.textStyles||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){let i=new CSSStyleSheet;i.replaceSync(e.themeCSS),n=gz(i)+` -`}else n+=`${e.themeCSS} -`;return n+gz(r)},"createCssStyles"),QGr=k((e,t)=>Eq(yut(`${e}{${t}}`),Eut([k(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===CM)return;n.props=n.props.map(s=>s===e&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(s.startsWith(`${e} `)||s.startsWith(`${e}>`))&&!s.startsWith(`${e} ||`)?s:`${e} ${s}`)}else n.type.startsWith("@")&&([...[eut,rut,fq,iut,"@container","@starting-style"],CM].includes(n.type)||(ye.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=lS))},"addNamespace"),xut])),"compileCSS"),JGr=k((e,t,r,n)=>{let i=ZGr(e,r),a=wBe(t,i,{...e.themeVariables,theme:e.theme,look:e.look},n);return QGr(n,a)},"createUserStyles"),eWr=k((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=h0(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),tWr=k((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":HGr,n=jCt(`${e}`);return``},"putIntoIFrame"),nCt=k((e,t,r,n,i)=>{let a=e.append("div");a.attr("id",r),n&&a.attr("style",n);let o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",zGr);return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");k(u4e,"sandboxedIframe");rWr=k((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),nWr=k(async function(e,t,r){eK();let n=h4e(t);t=n.code;let i=Kt();ye.debug(i),t.length>(i?.maxTextSize??PGr)&&(t=OGr);let a=`#${e}`,o="i"+e,s="#"+o,l="d"+e,u="#"+l,d=k(()=>{let P=xt(f?s:u).node();P&&"remove"in P&&P.remove()},"removeTempElements"),h=xt(document.body),f=i.securityLevel===BGr,p=i.securityLevel===FGr,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){let A=u4e(xt(r),o);h=xt(A.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=xt(r);nCt(h,e,l,`font-family: ${m}`,GGr)}else{if(rWr(document,e,l,o),f){let A=u4e(xt(document.body),o);h=xt(A.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=xt("body");nCt(h,e,l)}let g,y;try{g=await c4e.fromText(t,{title:n.title})}catch(A){if(i.suppressErrorRendering)throw d(),A;g=await c4e.fromText("error"),y=A}let v=h.select(u).node(),b=g.type,x=v.firstChild,E=x.firstChild,w=g.renderer.getClasses?.(t,g),T=JGr(i,b,w,a),C=document.createElement("style");C.innerHTML=T,x.insertBefore(C,E);try{await g.renderer.draw(t,e,"11.17.2",g)}catch(A){throw i.suppressErrorRendering?d():czr.draw(t,e,"11.17.2"),A}let S=h.select(`${u} svg`),R=g.db.getAccTitle?.(),U=g.db.getAccDescription?.();ZCt(b,S,R,U);let I=k(()=>{h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",WGr);let A=h.select(u).node().innerHTML;if(ye.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),A=eWr(A,f,Th(i.arrowMarkerAbsolute)),f){let P=h.select(u+" svg").node();A=tWr(A,P)}else p||(A=xd.sanitize(A,{ADD_TAGS:$Gr,ADD_ATTR:KGr,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return MGr(),A},"serializeSvg")();if(y)throw y;return d(),{diagramType:b,svg:I,bindFunctions:g.db.bindFunctions}},"render");k($Ct,"initialize");KCt=k((e,t={})=>{let{code:r}=d4e(e);return c4e.fromText(r,t)},"getDiagramFromText");k(ZCt,"addA11yInfo");U6=Object.freeze({render:nWr,parse:XCt,getDiagramFromText:KCt,initialize:$Ct,getConfig:Kt,setConfig:gse,getSiteConfig:mse,updateSiteConfig:hBe,reset:k(()=>{O9()},"reset"),globalReset:k(()=>{O9(Y5)},"globalReset"),defaultConfig:Y5});m9(Kt().logLevel);O9(Kt());iWr=k((e,t,r)=>{ye.warn(e),cW(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),QCt=k(async function(e={querySelector:".mermaid"}){try{await aWr(e)}catch(t){if(cW(t)&&ye.error(t.str),yv.parseError&&yv.parseError(t),!e.suppressErrors)throw ye.error("Use the suppressErrors option to suppress these errors"),t}},"run"),aWr=k(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=U6.getConfig();ye.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");ye.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(ye.debug("Start On Load: "+n?.startOnLoad),U6.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Nr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),o,s=[];for(let l of Array.from(i)){if(ye.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");let u=`mermaid-${a.next()}`;o=l.innerHTML,o=gW(Nr.entityDecode(o)).trim().replace(//gi,"
    ");let d=Nr.detectInit(o);d&&ye.debug("Detected early reinit: ",d);try{let{svg:h,bindFunctions:f}=await rSt(u,o,l);l.innerHTML=h,e&&await e(u),f&&f(l)}catch(h){iWr(h,s,yv.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),JCt=k(function(e){U6.initialize(e)},"initialize"),oWr=k(async function(e,t,r){ye.warn("mermaid.init is deprecated. Please use run instead."),e&&JCt(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await QCt(n)},"init"),sWr=k(async(e,{lazyLoad:t=!0}={})=>{eK(),mz(...e),t===!1&&await IGr()},"registerExternalDiagrams"),eSt=k(function(){if(yv.startOnLoad){let{startOnLoad:e}=U6.getConfig();e&&yv.run().catch(t=>ye.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",eSt,!1);lWr=k(function(e){yv.parseError=e},"setParseErrorHandler"),J$=[],l4e=!1,tSt=k(async()=>{if(!l4e){for(l4e=!0;J$.length>0;){let e=J$.shift();if(e)try{await e()}catch(t){ye.error("Error executing queue",t)}}l4e=!1}},"executeQueue"),cWr=k(async(e,t)=>new Promise((r,n)=>{let i=k(()=>new Promise((a,o)=>{U6.parse(e,t).then(s=>{a(s),r(s)},s=>{ye.error("Error parsing",s),yv.parseError?.(s),o(s),n(s)})}),"performCall");J$.push(i),tSt().catch(n)}),"parse"),rSt=k((e,t,r)=>new Promise((n,i)=>{let a=k(()=>new Promise((o,s)=>{U6.render(e,t,r).then(l=>{o(l),n(l)},l=>{ye.error("Error parsing",l),yv.parseError?.(l),s(l),i(l)})}),"performCall");J$.push(a),tSt().catch(i)}),"render"),uWr=k(()=>Object.keys(l2).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),yv={startOnLoad:!0,mermaidAPI:U6,parse:cWr,render:rSt,init:oWr,run:QCt,registerExternalDiagrams:sWr,registerLayoutLoaders:jme,initialize:JCt,parseError:void 0,contentLoaded:eSt,setParseErrorHandler:lWr,detectType:B9,registerIconPacks:Vk,getRegisteredDiagramsMetadata:uWr},tK=yv;});var Mn,dWr,Kc,Zc,iSt,f4e,FA,I6=H(()=>{Mn=e=>e.replace(/\s*!important\s*$/i,"").trim(),dWr=(e,t)=>{let r=t;for(;r{let t=[],r=0;for(;r=e.length)break;let n=r;for(;r=e.length||e[r]!==":")break;let i=e.substring(n,r).trim().toLowerCase();r+=1;let a=r,o=0,s=null;for(;r{let t=Mn(e);if(!t)return!1;if(typeof CSS<"u"&&typeof CSS.supports=="function")return CSS.supports("color",t);if(typeof document<"u"){let r=document.createElement("div");return r.style.color="",r.style.color=t,r.style.color!==""}return!1},iSt=(e,t)=>{let r=e.getAttribute("style");return r&&Kc(r).find(n=>n.property===t)?.value||""},f4e=(...e)=>{for(let t of e){let r=Mn(t||"");if(Zc(r))return r}},FA=(e,t)=>{let r=e.querySelector("text, foreignObject, div, span, p")||e,n=f4e(r.getAttribute?.("fill"),iSt(r,"fill"),r.style?.fill);if(n)return n;let i=f4e(r.getAttribute?.("color"),iSt(r,"color"),r.style?.color);if(i)return i;let a=f4e(t);if(a)return a}});var m4e,rK,nK,oSt,sSt,lSt,p4e,hWr,aSt,fWr,g4e,cSt,uSt=H(()=>{Kb();c9();I6();m4e=(e,t,r)=>{switch(t){case si.FILL:case si.STROKE:Zc(r)&&(e[t]=r);break;case si.STROKE_WIDTH:case si.STROKE_DASHARRAY:e[t]=r;break}},rK=(e,t,r)=>{t===Sl.COLOR&&Zc(r)&&(e[Sl.COLOR]=r)},nK=(e,t,r)=>{e&&Kc(e).forEach(({property:n,value:i})=>{m4e(t,n,i),rK(r,n,i)})},oSt=(e,t)=>{e&&Kc(e).forEach(({property:r,value:n})=>{if(r==="fill"&&Zc(n)){t[Sl.COLOR]=n;return}rK(t,r,n)})},sSt=(e,t)=>{if(!e)return;[[si.FILL,e.getAttribute("fill")],[si.STROKE,e.getAttribute("stroke")],[si.STROKE_WIDTH,e.getAttribute("stroke-width")],[si.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([n,i])=>{let a=Mn(i||"");a&&m4e(t,n,a)})},lSt=(e,t)=>{if(!e)return;let r=e.getAttribute("fill")||e.getAttribute("color"),n=Mn(r||"");Zc(n)&&(t[Sl.COLOR]=n)},p4e=(e,t,r,n)=>{if(!(t instanceof Map))return;let i=t.get(e);i&&(i.styles?.forEach(a=>{Kc(a).forEach(({property:o,value:s})=>{m4e(r,o,s),rK(n,o,s)})}),i.textStyles?.forEach(a=>{Kc(a).forEach(({property:o,value:s})=>{rK(n,o,s)})}))},hWr=(e,t,r)=>{let n=e.nodes.map(f=>f.startsWith("flowchart-")?f.split("-")[1]:f),i=t.querySelector(`[id='${e.id}']`);if(!i)throw new Error("SubGraph element not found");let a=g4e(i,t),o=i.getBBox(),s={width:o.width,height:o.height},l={},u={},d=i.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||i.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||i.querySelector("rect, path, polygon, ellipse");nK(i.getAttribute("style"),l,u),nK(d?.getAttribute("style"),l,u),sSt(d,l);let h=i.querySelector(".cluster-label text, .cluster-label tspan")||i.querySelector("text");return oSt(h?.getAttribute("style"),u),lSt(h,u),p4e(e.id,r,l,u),e.classes?.forEach(f=>{p4e(f,r,l,u)}),{id:e.id,nodeIds:n,text:Zs(e.title),labelType:"text",...a,...s,containerStyle:l,labelStyle:u}},aSt=(e,t,r)=>{let n=t.querySelector(`[id*="${e.domId}"]`);if(!n)return;let i;n.parentElement?.tagName.toLowerCase()==="a"&&(i=n.parentElement.getAttribute("xlink:href"));let a=g4e(i?n.parentElement:n,t),o=n.getBBox(),s={width:o.width,height:o.height},l={},u={};e.classes&&r instanceof Map&&(Array.isArray(e.classes)?e.classes:[e.classes]).forEach(f=>{p4e(f,r,l,u)}),e.styles?.forEach(f=>{nK(f,l,u)});let d=n.querySelector(".label-container");return nK(d?.getAttribute("style"),l,u),sSt(d,l),Array.from(n.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(f=>{oSt(f.getAttribute("style"),u),lSt(f,u)}),{id:e.id,labelType:e.labelType,text:Zs(e.text||""),type:e.type,link:i||void 0,...a,...s,containerStyle:l,labelStyle:u}},fWr=(e,t,r)=>{let n=r.querySelector(`[id*="${e.id}"]`);if(!n)throw new Error("Edge element not found");let i=g4e(n,r),a=xF(n,i);return e.length=void 0,{...e,...a,text:Zs(e.text)}},g4e=(e,t)=>{if(!e)throw new Error("Element not found");let r=e.parentElement?.parentElement,n=e.childNodes[0],i={x:0,y:0};if(n){let{transformX:l,transformY:u}=r0(n),d=n.getBBox();i={x:Number(n.getAttribute("x"))||l+d.x||0,y:Number(n.getAttribute("y"))||u+d.y||0}}let{transformX:a,transformY:o}=r0(e),s={x:a+i.x,y:o+i.y};for(;r&&r.id!==t.id;){if(r.classList.value==="root"&&r.hasAttribute("transform")){let{transformX:l,transformY:u}=r0(r);s.x+=l,s.y+=u}r=r.parentElement}return s},cSt=(e,t)=>{let r=e.getVertices(),n=e.getEdges(),i=e.getSubGraphs(),a=e.getClasses(),o={},s=a instanceof Map?a:{};r instanceof Map?r.forEach((h,f)=>{o[f]=aSt(h,t,s)}):typeof r=="object"&&r!==null&&Object.entries(r).forEach(([h,f])=>{o[h]=aSt(f,t,s)});let l=new Map,u=(Array.isArray(n)?n:[]).map(h=>{if(!t.querySelector(`[id*="${h.id}"]`))return null;let f=`${h.start}-${h.end}`,p=l.get(f)||0;return l.set(f,p+1),fWr(h,p,t)}).filter(h=>h!==null&&h.reflectionPoints.length>1);return{type:"flowchart",subGraphs:(Array.isArray(i)?i:[]).map(h=>hWr(h,t,s)),vertices:o,edges:u}}});var dSt,MD,zA,y4e,F0,R6,iK=H(()=>{Kb();D5();I6();dSt=(e,t)=>{let r={};t?.label&&(r.label={text:Zs(t.label),fontSize:16});let n=e.tagName;if(n==="line")r.startX=Number(e.getAttribute("x1")),r.startY=Number(e.getAttribute("y1")),r.endX=Number(e.getAttribute("x2")),r.endY=Number(e.getAttribute("y2"));else if(n==="path"){let o=e.getAttribute("d");if(!o)throw new Error('Path element does not contain a "d" attribute');let s=o.split(/(?=[LC])/),l=s[0].substring(1).split(",").map(h=>parseFloat(h)),u=[];s.forEach(h=>{let f=h.substring(1).trim().split(" ").map(p=>{let[m,g]=p.split(",");return[parseFloat(m)-l[0],parseFloat(g)-l[1]]});u.push(...f)});let d=u[u.length-1];r.startX=l[0],r.startY=l[1],r.endX=d[0],r.endY=d[1],r.points=u}t?.label&&(r.startY=r.startY-10,r.endY=r.endY-10);let i=e.getAttribute("stroke"),a=(i&&i!=="none"?i:"")||getComputedStyle(e).stroke||"";return r.strokeColor=a?Mn(a):null,r.strokeWidth=Number(e.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=t?.strokeStyle||"solid",r.startArrowhead=t?.startArrowhead||null,r.endArrowhead=t?.endArrowhead||null,r},MD=(e,t,r,n,i)=>{let a={};return a.type="arrow",a.startX=e,a.startY=t,a.endX=r,a.endY=n,Object.assign(a,{...i}),a},zA=(e,t,r,n)=>({type:"text",x:e,y:t,text:r,width:n?.width||20,height:n?.height||20,fontSize:n?.fontSize||20,id:n?.id,color:n?.color,groupId:n?.groupId,metadata:n?.metadata}),y4e=(e,t,r)=>{let n={},i=Number(e.getAttribute("x")),a=Number(e.getAttribute("y"));n.type="text",n.text=Zs(t),r?.id&&(n.id=r.id),r?.groupId&&(n.groupId=r.groupId);let o=e.getBBox();n.width=o.width,n.height=o.height,n.x=i-o.width/2,n.y=a;let s=parseInt(getComputedStyle(e).fontSize);return n.fontSize=s,n.color=FA(e),n},F0=(e,t,r={})=>{let n={};n.type=t;let{label:i,subtype:a,id:o,groupId:s}=r;n.id=o,s&&(n.groupId=s),i&&(n.label={text:Zs(i.text),fontSize:16,textAlign:i?.textAlign,verticalAlign:i?.verticalAlign});let l=e.getBBox();switch(n.x=l.x,n.y=l.y,n.width=l.width,n.height=l.height,n.subtype=a,a){case"highlight":let u=e.getAttribute("fill");u&&(n.bgColor=Mn(u));break;case"note":n.strokeStyle="dashed";break}return n},R6=(e,t,r,n,i,a)=>{let o={};o.startX=t,o.startY=r,o.endX=n,a?.groupId&&(o.groupId=a.groupId),a?.id&&(o.id=a.id),o.endY=i;let s=e.getAttribute("stroke");return o.strokeColor=s?Mn(s):null,o.strokeWidth=Number(e.getAttribute("stroke-width")),o.type="line",o}});var hSt,t1,pWr,mWr,fSt,pSt,gWr,yWr,vWr,bWr,xWr,wWr,mSt,gSt=H(()=>{D5();O5();iK();I6();hSt={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},t1={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},pWr=e=>{let t;switch(e){case t1.SOLID:case t1.SOLID_CROSS:case t1.SOLID_OPEN:case t1.SOLID_POINT:t="solid";break;case t1.DOTTED:case t1.DOTTED_CROSS:case t1.DOTTED_OPEN:case t1.DOTTED_POINT:t="dotted";break;default:t="solid";break}return t},mWr=(e,t)=>{if(!!e.nextElementSibling?.classList.contains("sequenceNumber")){let n=e.nextElementSibling?.textContent;if(!n)throw new Error("sequence number not present");let i=30,a=i/2,s={type:"rectangle",x:t.startX-10,y:t.startY-a,label:{text:n,fontSize:14},bgColor:"#e9ecef",height:i,subtype:"sequence"};Object.assign(t,{sequenceNumber:s})}},fSt=(e,t,r)=>{if(!e)throw"root node not found";let n=Al(),i=Array.from(e.children),a=[];return i.forEach((o,s)=>{let l=`${r?.id}-${s}`,u;switch(o.tagName){case"line":let d=Number(o.getAttribute("x1")),h=Number(o.getAttribute("y1")),f=Number(o.getAttribute("x2")),p=Number(o.getAttribute("y2"));u=R6(o,d,h,f,p,{groupId:n,id:l});break;case"text":u=y4e(o,t,{groupId:n,id:l});break;case"circle":u=F0(o,"ellipse",{label:o.textContent?{text:o.textContent}:void 0,groupId:n,id:l});default:u=F0(o,ZNe[o.tagName],{label:o.textContent?{text:o.textContent}:void 0,groupId:n,id:l})}a.push(u)}),a},pSt=(e,t)=>{let r=t.getAttribute("fill"),n=t.getAttribute("stroke"),i=t.getAttribute("stroke-width"),a=t.getAttribute("stroke-dasharray");r&&r!=="none"&&(e.bgColor=Mn(r)),n&&n!=="none"&&(e.strokeColor=Mn(n)),i&&(e.strokeWidth=Number(i)),a&&a.trim()&&(e.strokeStyle="dashed")},gWr=(e,t)=>{let r=Array.from(t.querySelectorAll(".actor-top")),n=Array.from(t.querySelectorAll(".actor-bottom")),i=[],a=[],o={},s=e instanceof Map?Array.from(e.values()):Object.values(e),l=Array.from(t.querySelectorAll(".actor-line")),u=(d,h)=>{let f=d.name,p=l.find(g=>g.getAttribute("name")===f);if(p)return p;let m=d.type==="participant"?h.parentElement?.previousElementSibling:h.previousElementSibling;return m?m.tagName==="line"?m:m.querySelector("line"):null};return s.forEach(d=>{let h=r.find(m=>m.getAttribute("name")===d.name),f=n.find(m=>m.getAttribute("name")===d.name);if(!h||!f)throw"root not found";let p=d.description;if(d.type==="participant"){let m=F0(h,"rectangle",{id:`${d.name}-top`,label:{text:p},subtype:"actor"});if(pSt(m,h),!m)throw"Top Node element not found!";i.push([m]);let g=F0(f,"rectangle",{id:`${d.name}-bottom`,label:{text:p},subtype:"actor"});o[d.name]={topId:`${d.name}-top`,bottomId:`${d.name}-bottom`,bindType:"rectangle"},pSt(g,f),i.push([g]);let y=u(d,h);if(y?.tagName!=="line")throw"Line not found";let v=Number(y.getAttribute("x1"));if(!m.height)throw"Top node element height is null";let b=m.y+m.height,x=g.y,E=Number(y.getAttribute("x2")),w=R6(y,v,b,E,x);a.push(w)}else if(d.type==="actor"){let m=fSt(h,p,{id:`${d.name}-top`});i.push(m);let g=fSt(f,p,{id:`${d.name}-bottom`});i.push(g);let y=u(d,h);if(y?.tagName!=="line")throw"Line not found";let v=Number(y.getAttribute("x1")),b=Number(y.getAttribute("y1")),x=Number(y.getAttribute("x2")),E=g.find(C=>C.type==="ellipse");if(E){let C=E.y,S=R6(y,v,b,x,C);a.push(S)}let w=m.find(C=>C.type==="ellipse"),T=g.find(C=>C.type==="ellipse");w?.id&&T?.id&&(o[d.name]={topId:w.id,bottomId:T.id,bindType:"ellipse"})}}),{nodes:i,lines:a,actorMap:o}},yWr=(e,t,r)=>{let n=[],i=Array.from(t.querySelectorAll('[class*="messageLine"]')),a=Object.keys(hSt),o=e.filter(s=>a.includes(s.type.toString()));return i.forEach((s,l)=>{let u=o[l],d=hSt[u.type],h=dSt(s,{label:u?.message,strokeStyle:pWr(u.type),endArrowhead:d==="SOLID_OPEN"||d==="DOTTED_OPEN"?null:"arrow"}),f=r[u.from],p=r[u.to];f?.topId&&p?.topId&&(h.start={type:f.bindType||"rectangle",id:f.topId},h.end={type:p.bindType||"rectangle",id:p.topId}),mWr(s,h),n.push(h)}),n},vWr=(e,t)=>{let r=Array.from(t.querySelectorAll(".note")).map(a=>a.parentElement),n=e.filter(a=>a.type===t1.NOTE),i=[];return r.forEach((a,o)=>{if(!a)return;let s=a.firstChild,l=n[o].message,u=F0(s,"rectangle",{label:{text:l},subtype:"note"}),d=s.getAttribute("fill"),h=s.getAttribute("stroke"),f=s.getAttribute("stroke-width"),p=s.getAttribute("stroke-dasharray");d&&d!=="none"&&(u.bgColor=Mn(d)),h&&h!=="none"&&(u.strokeColor=Mn(h)),f&&(u.strokeWidth=Number(f)),p&&p.trim()&&(u.strokeStyle="dashed"),i.push(u)}),i},bWr=e=>{let t=Array.from(e.querySelectorAll("[class*=activation]")),r=[];return t.forEach(n=>{let i=F0(n,"rectangle",{label:{text:""},subtype:"activation"});(()=>{let o=n.getAttribute("fill"),s=n.getAttribute("stroke"),l=n.getAttribute("stroke-width"),u=n.getAttribute("stroke-dasharray");o&&o!=="none"&&(i.bgColor=Mn(o)),s&&s!=="none"&&(i.strokeColor=Mn(s)),l&&(i.strokeWidth=Number(l)),u&&u.trim()&&(i.strokeStyle="dashed")})(),r.push(i)}),r},xWr=(e,t)=>{let r=Array.from(t.querySelectorAll(".loopLine")),n=[],i=[],a=[];r.forEach(d=>{let h=Number(d.getAttribute("x1")),f=Number(d.getAttribute("y1")),p=Number(d.getAttribute("x2")),m=Number(d.getAttribute("y2")),g=R6(d,h,f,p,m);g.strokeStyle="dotted",g.strokeColor="#adb5bd",g.strokeWidth=2,n.push(g)});let o=Array.from(t.querySelectorAll(".loopText")),s=e.filter(d=>d.type===t1.CRITICAL_START).map(d=>d.message);o.forEach(d=>{let h=d.textContent||"",f=y4e(d,h),p=h.match(/\[(.*?)\]/)?.[1]||"";s.includes(p)&&(f.x+=16),i.push(f)});let l=Array.from(t?.querySelectorAll(".labelBox")),u=Array.from(t?.querySelectorAll(".labelText"));return l.forEach((d,h)=>{let f=u[h]?.textContent||"",p=F0(d,"rectangle",{label:{text:f}});p.strokeColor="#adb5bd",p.bgColor="#e9ecef",p.width=void 0,a.push(p)}),{lines:n,texts:i,nodes:a}},wWr=e=>{let t=Array.from(e.querySelectorAll(".rect")).filter(n=>n.parentElement?.tagName!=="g"),r=[];return t.forEach(n=>{let i=F0(n,"rectangle",{label:{text:""},subtype:"highlight"});r.push(i)}),r},mSt=(e,t)=>{let r=e.db,n=[],a=r.getBoxes().map(y=>({...y,fill:Mn(y.fill||"")})),o=wWr(t),s=r.getActors(),{nodes:l,lines:u,actorMap:d}=gWr(s,t),h=r.getMessages(),f=yWr(h,t,d),p=vWr(h,t),m=bWr(t),g=xWr(h,t);return n.push(o),n.push(...l),n.push(p),n.push(m),{type:"sequence",lines:u,arrows:f,nodes:n,loops:g,groups:a}}});var EWr,aK,ySt,vSt,TWr,bSt,v4e,xSt,TSt,kSt,wSt,kWr,CWr,SWr,AWr,CSt,SSt,UWr,IWr,RWr,MWr,ESt,LWr,DWr,NWr,_Wr,ASt,USt=H(()=>{O5();Kb();iK();I6();EWr=e=>{let t={};return e&&e.forEach(r=>{Kc(r).forEach(({property:n,value:i})=>{n&&i&&(t[n]=Mn(i))})}),t},aK={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},ySt={LINE:0,DOTTED_LINE:1},vSt=16,TWr=e=>{let t;switch(e){case ySt.LINE:t="solid";break;case ySt.DOTTED_LINE:t="dotted";break;default:t="solid"}return t},bSt=e=>{let t;switch(e){case aK.AGGREGATION:t="diamond_outline";break;case aK.COMPOSITION:t="diamond";break;case aK.EXTENSION:t="triangle_outline";break;case"none":t=null;break;case aK.DEPENDENCY:default:t="arrow";break}return t},v4e=(e,t)=>{let r=0,n=0,i=e;for(;i&&i!==t;){let{transformX:a,transformY:o}=r0(i);r+=a,n+=o,i=i.parentElement}return{tx:r,ty:n}},xSt=new Set(["triangle_outline","diamond","diamond_outline"]),TSt=(e,t=.5)=>{if(e.length<=2)return[...e];let r=[e[0]];for(let n=1;n=-t&&f<=1+t||r.push(a)}return r.push(e[e.length-1]),r},kSt=e=>{let t=f9(bF(e).map(n=>[n.x,n.y])).map(([n,i])=>({x:n,y:i})),r=p9(e);return r&&t.length>=2&&(t[0]={x:r.startX,y:r.startY},t[t.length-1]={x:r.endX,y:r.endY}),TSt(t)},wSt=(e,t,r)=>{let n=e.x-t.x,i=e.y-t.y,a=Math.hypot(n,i);return a?{x:e.x+n/a*r,y:e.y+i/a*r}:e},kWr=(e,t)=>{let r=f9(t.map(a=>[a.x,a.y])).map(([a,o])=>({x:a,y:o}));if(r.length<2)throw new Error("Arrow route must contain at least two points");let n=r[0],i=r[r.length-1];e.startX=n.x,e.startY=n.y,e.endX=i.x,e.endY=i.y,e.points=r.map(a=>[a.x-n.x,a.y-n.y])},CWr=e=>{let t=e.points?.map(([a,o])=>({x:e.startX+a,y:e.startY+o})).filter(a=>Number.isFinite(a.x)&&Number.isFinite(a.y));if(!t||t.length<2)return e;let r=[...t],n=!!e.startArrowhead&&xSt.has(e.startArrowhead),i=!!e.endArrowhead&&xSt.has(e.endArrowhead);if(!n&&!i)return e;if(n&&(r[0]=wSt(r[0],r[1],vSt)),i){let a=r.length-1;r[a]=wSt(r[a],r[a-1],vSt)}return kWr(e,r),e},SWr=(e,t)=>{let r=Mn(e.getAttribute("stroke")||getComputedStyle(e).stroke||""),n=parseFloat(e.getAttribute("stroke-width")||getComputedStyle(e).strokeWidth||"1");Zc(r)&&r!=="none"&&(t.strokeColor=r),Number.isFinite(n)&&n>0&&(t.strokeWidth=n)},AWr=e=>{let t=[];return e.forEach(r=>{kSt(r).forEach(n=>{let i=t[t.length-1];i&&i.x===n.x&&i.y===n.y||t.push(n)})}),TSt(t)},CSt=(e,t,r)=>{if(e.length<2)throw new Error(`Class diagram edge ${t?.id||""} is missing usable path points`);let n=e[0],i=e[e.length-1],a=MD(n.x,n.y,i.x,i.y,{id:t?.getAttribute("data-id")||t?.id||void 0,...r,points:e.map(o=>[o.x-n.x,o.y-n.y])});return t&&SWr(t,a),CWr(a)},SSt=(e,t)=>CSt(AWr(e),e[0],t),UWr=(e,t)=>{let r=kSt(e);return CSt([r[0],r[r.length-1]],e,t)},IWr=(e,t)=>SSt([e],t),RWr=(e,t)=>[`${e}-cyclic-special-1`,`${e}-cyclic-special-mid`,`${e}-cyclic-special-2`].map(n=>t.querySelector(`path[id="${n}"][data-edge="true"]`)).filter(n=>n!==null),MWr=e=>e.points?.map(([t,r])=>({x:e.startX+t,y:e.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[],ESt=(e,t)=>{let r=MWr(e);if(r.length<2)return null;let n=t==="start",i=n?r[0]:r[r.length-1],a=n?r[1]:r[r.length-2],o=a.x===i.x?n?-1:1:Math.sign(a.x-i.x),s=a.y===i.y?1:Math.sign(a.y-i.y);return{x:i.x+o*20,y:i.y+(s>=0?12:-28)}},LWr=(e,t)=>{let r=e;for(;r&&r!==t;){if(r.classList.contains("annotation-group")||r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},DWr=(e,t,r)=>{let n=[],i=[],a=[];return Object.values(e).forEach(o=>{let{domId:s,id:l}=o,u=Al(),d=EWr(o.styles||o.cssStyles),h;try{h=r?r(l):void 0}catch{h=void 0}let f=O=>{let _=new RegExp(`^classId-${O}(?:-|$)`);return Array.from(t.querySelectorAll("[id]")).filter(F=>_.test(F.id))[0]},p=h&&t.querySelector(`#${h}`)||t.querySelector(`#${s}`)||t.querySelector(`[data-id='${l}']`)||f(l);if(!p)throw Error(`DOM Node with id ${s} not found`);let m=p.querySelector("rect")||p,g=m.getBBox(),{tx:y,ty:v}=v4e(m,t),b={type:"rectangle",id:l,groupId:u,x:g.x+y,y:g.y+v,width:g.width,height:g.height,metadata:{classId:l}},x=m.getAttribute("fill"),E=m.getAttribute("stroke"),w=m.getAttribute("stroke-width"),T=m.getAttribute("stroke-dasharray"),C=getComputedStyle(m),S=Mn(x||d.fill||(x?C.fill:"")),R=Mn(E||d.stroke||(E?C.stroke:"")),U=w||d["stroke-width"]||(w?C.strokeWidth:""),L=T||d["stroke-dasharray"]||(T?C.strokeDasharray==="none"?"":C.strokeDasharray:""),I=O=>{if(!O||!Zc(O))return!1;let _=O.toLowerCase();return!(_==="none"||_==="transparent"||_==="rgba(0, 0, 0, 0)"||_==="black"||_==="#000"||_==="#000000"||_==="rgb(0, 0, 0)"||_==="rgba(0, 0, 0, 1)")};I(S)?b.bgColor=S:b.bgColor=void 0,I(R)?b.strokeColor=R:b.strokeColor=void 0,U?b.strokeWidth=Number(U):b.strokeWidth=void 0,L&&L.trim().length>0?b.strokeStyle="dashed":b.strokeStyle=void 0,n.push(b),[...Array.from(p.querySelectorAll("line")),...Array.from(p.querySelectorAll("g.divider path"))].forEach(O=>{let{tx:_,ty:B}=v4e(O,t),F,G,z,V;if(O.tagName.toLowerCase()==="line")F=Number(O.getAttribute("x1"))+_,G=Number(O.getAttribute("y1"))+B,z=Number(O.getAttribute("x2"))+_,V=Number(O.getAttribute("y2"))+B;else{let Z=O.getBBox();F=Z.x+_,z=Z.x+Z.width+_;let re=Z.y+Z.height/2+B;G=re,V=re}if(F===z&&G===V)return;let $=R6(O,F,G,z,V,{groupId:u,id:Al()});b.strokeColor?$.strokeColor=b.strokeColor:$.strokeColor=void 0,b.strokeWidth!==void 0?$.strokeWidth=b.strokeWidth:$.strokeWidth=void 0,b.strokeStyle?$.strokeStyle=b.strokeStyle:$.strokeStyle=void 0,$.metadata={classId:l},i.push($)});let P=Array.from(p.querySelectorAll("text, foreignObject")),D=[];P.forEach(O=>{let _=O.tagName.toLowerCase()==="foreignobject",B=_?[]:Array.from(O.querySelectorAll("tspan")),F=B.length?B.map(Z=>Z.textContent?.trim()).filter(Boolean).join(` -`):O.textContent?.trim()||"";if(!F)return;let G=O.getBBox(),{ty:z}=v4e(O,t),V=parseFloat(getComputedStyle(O).fontSize||"");if(_&&(!Number.isFinite(V)||!V)){let Z=O.querySelector("div, span, p");Z&&(V=parseFloat(getComputedStyle(Z).fontSize||""))}(!Number.isFinite(V)||V<=0)&&(V=Math.max(12,G.height*.6)),V=V*.9;let $=FA(O,d.color);D.push({section:LWr(O,p),text:Zs(F),x:G.x,y:G.y+z,width:b&&b.width?Math.max(b.width-8,G.width):G.width,height:G.height,fontSize:V,color:$})});let M=D.filter(O=>O.section==="header").sort((O,_)=>O.y-_.y||O.x-_.x);if(!b.label){let O=M.length===0&&D.length===1?D:M;O.length>0&&(b.label={text:O.map(_=>_.text).join(` -`),fontSize:Math.max(...O.map(_=>_.fontSize)),color:O.find(_=>_.color)?.color,verticalAlign:"top"})}D.filter(O=>M.length>0?O.section!=="header":!(b.label&&D.length===1)).forEach(O=>{let _=zA((b?.x||0)+4,O.y,O.text,{width:O.width,height:O.height,fontSize:O.fontSize,color:O.color,id:Al(),groupId:u,metadata:{classId:l}});a.push(_)})}),{nodes:n,lines:i,text:a}},NWr=(e,t,r,n)=>{let i=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(e.length===0)return{arrows:[],text:[]};let a=[],o=[],s=0;return e.forEach(l=>{let{id1:u,id2:d,relation:h}=l,f=t.find(U=>U.id===u),p=t.find(U=>U.id===d);if(!f)throw new Error(`parseRelations: Cannot find node with id ${u}`);if(!p)throw new Error(`parseRelations: Cannot find node with id ${d}`);let m=TWr(h.lineType),g=bSt(h.type1),y=bSt(h.type2),v;if(u===d){let U=RWr(u,r);if(!U.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${u} -> ${d}`);v=SSt(U,{strokeStyle:m,startArrowhead:g,endArrowhead:y,label:l.title?{text:l.title}:void 0,start:{type:"rectangle",id:f.id},end:{type:"rectangle",id:p.id}})}else{let U=i[s];if(!U)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${u} -> ${d}`);s+=1,v=UWr(U,{strokeStyle:m,startArrowhead:g,endArrowhead:y,label:l.title?{text:l.title}:void 0,start:{type:"rectangle",id:f.id},end:{type:"rectangle",id:p.id}})}a.push(v);let{relationTitle1:b,relationTitle2:x}=l,E=u===d,w=20,T=15,C=15,S,R;if(b&&b!=="none"){if(E){let L=ESt(v,"start");L&&(S=L.x,R=L.y)}else switch(n){case"TB":S=v.startX-w,v.endXv.startX&&(S+=C),R=v.startY-T;break;case"LR":S=v.startX+w,R=v.startY+T,v.endY>v.startY&&(R+=C);break;case"RL":S=v.startX-w,R=v.startY-T,v.startY>v.endY&&(R-=C);break;default:S=v.startX-w,R=v.startY+T}S??=v.startX-w,R??=v.startY+T;let U=zA(S,R,b,{fontSize:16});o.push(U)}if(x&&x!=="none"){if(E){let L=ESt(v,"end");L&&(S=L.x,R=L.y)}else switch(n){case"TB":S=v.endX+w,v.endXv.startX&&(S-=C),R=v.endY+T;break;case"LR":S=v.endX-w,R=v.endY-T,v.endY>v.startY&&(R-=C);break;case"RL":S=v.endX+w,R=v.endY+T,v.startY>v.endY&&(R+=C);break;default:S=v.endX+w,R=v.endY-T}S??=v.endX+w,R??=v.endY+T;let U=zA(S,R,x,{fontSize:16});o.push(U)}}),{arrows:a,text:o}},_Wr=(e,t,r)=>{let n=[],i=[];return e.forEach((a,o)=>{let{id:s,text:l,class:u}=a,d=t.querySelector(`#${s}`);if(!d)throw new Error(`Node with id ${s} not found!`);let{transformX:h,transformY:f}=r0(d),p=d.firstChild,m=F0(p,"rectangle",{id:s,subtype:"note",label:{text:l}});if(Object.assign(m,{x:m.x+h,y:m.y+f}),n.push(m),u){let g=r.find(T=>T.id===u);if(!g)throw new Error(`class node with id ${u} not found!`);let y=t.querySelector(`path[id="edgeNote${o+1}"][data-edge="true"]`);if(y){i.push(IWr(y,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:g.id,type:"rectangle"}}));return}let v=m.x+(m.width||0)/2,b=m.y+(m.height||0),x=v,E=g.y,w=MD(v,b,x,E,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:g.id,type:"rectangle"}});i.push(w)}}),{notes:n,connectors:i}},ASt=(e,t)=>{let r=e.db,n=r.getDirection?.()||"TB",i=[],a=[],o=[],s=[],l=r.getNamespaces?.()||[],u=r.getClasses?.()||{},d=u instanceof Map?Object.fromEntries(u):u;if(d&&Object.keys(d).length){let v=typeof r.lookUpDomId=="function"?r.lookUpDomId.bind(r):void 0,b=DWr(d,t,v);i.push(b.nodes),a.push(...b.lines),o.push(...b.text),s.push(...b.nodes)}let h=r.getRelations?.()||[],{arrows:f,text:p}=NWr(h,s,t,n),m=r.getNotes?.()||[],{notes:g,connectors:y}=_Wr(m,t,s);return i.push(g),f.push(...y),o.push(...p),{type:"class",nodes:i,lines:a,arrows:f,text:o,namespaces:l}}});var ISt,PWr,OWr,b4e,BWr,FWr,zWr,GWr,RSt,WWr,VWr,HWr,qWr,YWr,MSt,LSt=H(()=>{O5();iK();Kb();I6();ISt=18,PWr=e=>{let t={};return e&&e.forEach(r=>{Kc(r).forEach(({property:n,value:i})=>{n&&i&&(t[n]=Mn(i))})}),t},OWr=e=>{if(e==null||e==="")return;let t=typeof e=="number"?e:parseFloat(Mn(e));if(!(!Number.isFinite(t)||t<=0))return t},b4e=(e,t)=>{let r=0,n=0,i=e;for(;i&&i!==t;){let{transformX:a,transformY:o}=r0(i);r+=a,n+=o,i=i.parentElement}return{tx:r,ty:n}},BWr=e=>{let t=Array.from(e.querySelectorAll("tspan")),r=t.length?t.map(n=>n.textContent?.trim()).filter(Boolean).join(` -`):e.textContent?.trim()||"";return Zs(r)},FWr=e=>{let t=e.querySelector("text, foreignObject, div, span, p")||e,r=parseFloat(getComputedStyle(t).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,e.getBBox().height*.75)),r},zWr=(e,t,r)=>{let n=BWr(e);if(!n)return null;let i=e.getBBox(),{tx:a,ty:o}=b4e(e,t);return{className:e.getAttribute("class")||"",text:n,x:i.x+a,y:i.y+o,width:i.width,height:i.height,fontSize:FWr(e),color:FA(e,r)}},GWr=(e,t,r,n,i,a,o)=>{let{tx:s,ty:l}=b4e(e,t),u=0,d=0,h=0,f=0;if(e.tagName.toLowerCase()==="line")u=Number(e.getAttribute("x1"))+s,d=Number(e.getAttribute("y1"))+l,h=Number(e.getAttribute("x2"))+s,f=Number(e.getAttribute("y2"))+l;else{let m=p9(e);if(!m)return null;u=m.startX+s,d=m.startY+l,h=m.endX+s,f=m.endY+l}let p={type:"line",id:Al(),groupId:r,startX:u,startY:d,endX:h,endY:f,metadata:{entityId:n}};return i&&Zc(i)&&i!=="none"&&(p.strokeColor=i),a!==void 0&&(p.strokeWidth=a),o&&(p.strokeStyle=o),p},RSt=e=>{switch(e?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},WWr=e=>{switch(e){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},VWr=(e,t)=>{let r=t.querySelector(`path[id="${e.id}"][data-edge="true"]`);return r?[r]:e.start!==e.end?[]:[`${e.start}-cyclic-special-1`,`${e.start}-cyclic-special-mid`,`${e.start}-cyclic-special-2`].map(i=>t.querySelector(`path[id="${i}"][data-edge="true"]`)).filter(i=>i!==null)},HWr=e=>{let t=[];return e.forEach(r=>{bF(r).forEach(n=>{let i=t[t.length-1];i&&i.x===n.x&&i.y===n.y||t.push(n)})}),t},qWr=(e,t)=>{let r=t.querySelector(`[id="${e.id}"]`);if(!r)throw new Error(`ER entity ${e.id} not found in rendered SVG`);let n=e.attributes.length?Al():void 0,i=r.getBBox(),{tx:a,ty:o}=b4e(r,t),s=PWr([...e.cssStyles||[],...e.cssCompiledStyles||[]]),l=Mn(s.fill||""),u=Mn(s.stroke||""),d=OWr(s["stroke-width"]),h=Mn(s["stroke-dasharray"]||""),f=Array.from(r.querySelectorAll("g.label")).map(x=>zWr(x,t,s.color)).filter(x=>x!==null),p=f.find(x=>x.className.includes("name"))||f[0],m=f.filter(x=>x!==p),g=p?.text||Zs(e.alias||e.label||""),y={type:"rectangle",id:e.id,groupId:n,x:i.x+a,y:i.y+o,width:i.width,height:i.height,label:{text:g,fontSize:e.attributes.length?ISt:p?.fontSize||16,color:p?.color,textAlign:"center",verticalAlign:e.attributes.length?"top":"middle"},metadata:{entityId:e.id,entityLabel:e.label,entityAlias:e.alias}};Zc(l)&&l!=="none"&&(y.bgColor=l),Zc(u)&&u!=="none"&&(y.strokeColor=u),d&&Number.isFinite(d)&&d>0&&(y.strokeWidth=d),h&&h!=="none"&&(y.strokeStyle="dashed");let v=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(x=>GWr(x,t,n,e.id,y.strokeColor,y.strokeWidth,y.strokeStyle)).filter(x=>x!==null),b=m.map(x=>zA(x.x,x.y,x.text,{id:Al(),groupId:n,width:x.width,height:x.height,fontSize:ISt,color:x.color,metadata:{entityId:e.id}}));return{container:y,lines:v,text:b}},YWr=(e,t)=>{let r=VWr(e,t);if(!r.length)throw new Error(`ER relationship ${e.id} not found in rendered SVG`);let n=HWr(r);if(n.length<2)throw new Error(`ER relationship ${e.id} is missing usable path points`);let i=n[0],a=n[n.length-1],o=r[0],s=Mn(o.getAttribute("stroke")||getComputedStyle(o).stroke||""),l=Number(o.getAttribute("stroke-width")||getComputedStyle(o).strokeWidth||1),u=MD(i.x,i.y,a.x,a.y,{id:e.id,label:e.label?{text:Zs(e.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:WWr(e.pattern),startArrowhead:RSt(e.arrowTypeStart),endArrowhead:RSt(e.arrowTypeEnd),start:{type:"rectangle",id:e.start},end:{type:"rectangle",id:e.end},points:n.map(d=>[d.x-i.x,d.y-i.y])});return Zc(s)&&s!=="none"&&(u.strokeColor=s),Number.isFinite(l)&&l>0&&(u.strokeWidth=l),u},MSt=(e,t)=>{let r=e.getData(),n=r.nodes,i=r.edges,a=[],o=[],s=[];n.forEach(u=>{let d=qWr(u,t);a.push(d.container),o.push(...d.lines),s.push(...d.text)});let l=i.map(u=>YWr(u,t));return{type:"erd",nodes:[a],lines:o,arrows:l,text:s}}});var M6,NSt,_St,jWr,XWr,$Wr,KWr,ZWr,w4e,QWr,JWr,eVr,DSt,x4e,tVr,rVr,nVr,iVr,aVr,oVr,sVr,lVr,cVr,PSt,OSt=H(()=>{c9();Kb();I6();M6=e=>{let t=Mn(e||"");return!t||t==="none"||t==="transparent"||t==="rgba(0, 0, 0, 0)"||t==="rgba(0,0,0,0)"?!1:Zc(t)},NSt=(e,t,r)=>{switch(t){case si.FILL:case si.STROKE:M6(r)&&(e[t]=Mn(r));break;case si.STROKE_WIDTH:case si.STROKE_DASHARRAY:Mn(r)&&(e[t]=Mn(r));break}},_St=(e,t,r)=>{t===Sl.COLOR&&M6(r)&&(e[Sl.COLOR]=Mn(r))},jWr=(e,t,r)=>{e&&Kc(e).forEach(({property:n,value:i})=>{NSt(t,n,i),_St(r,n,i)})},XWr=(e,t)=>{e&&Kc(e).forEach(({property:r,value:n})=>{if(r===si.FILL&&M6(n)){t[Sl.COLOR]=Mn(n);return}_St(t,r,n)})},$Wr=e=>{let t=new Set;return e.filter(Boolean).forEach(r=>{Kc(r||"").forEach(({property:n})=>{t.add(n)})}),t},KWr=(e,t,r)=>{if(!e)return;[[si.FILL,e.getAttribute("fill")],[si.STROKE,e.getAttribute("stroke")],[si.STROKE_WIDTH,e.getAttribute("stroke-width")],[si.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([i,a])=>{if(!r.has(i)||t[i])return;let o=Mn(a||"");o&&NSt(t,i,o)})},ZWr=(e,t,r)=>{if(!e)return;let n=[e,...Array.from(e.querySelectorAll("text, foreignObject, div, span, p"))];for(let i of n){if(t[Sl.COLOR]||(r.has(Sl.COLOR)||r.has(si.FILL))&&(XWr(i.getAttribute("style"),t),t[Sl.COLOR]))break;let a=Mn(i.getAttribute("fill")||i.getAttribute("color")||"");(r.has(Sl.COLOR)||r.has(si.FILL))&&M6(a)&&(t[Sl.COLOR]=a)}},w4e=(e,t)=>{let r=0,n=0,i=e;for(;i&&i!==t;){let{transformX:a,transformY:o}=r0(i);r+=a,n+=o,i=i.parentElement}return{tx:r,ty:n}},QWr=(e,t)=>{let r=e.getBBox(),{tx:n,ty:i}=w4e(e,t);return{x:r.x+n,y:r.y+i,width:r.width,height:r.height}},JWr=(e,t)=>{let r=e.querySelector("line.divider");if(!r)return;let{tx:n,ty:i}=w4e(r,t);return{startX:Number(r.getAttribute("x1"))+n,startY:Number(r.getAttribute("y1"))+i,endX:Number(r.getAttribute("x2"))+n,endY:Number(r.getAttribute("y2"))+i}},eVr=e=>{let t=e.getBBox();return Math.abs(t.width*t.height)},DSt=(e,t)=>{let r=e.getAttribute("style");if(!r)return;let n=Kc(r).find(i=>i.property===t);if(n)return Mn(n.value)},x4e=(e,t)=>{let r=e.map(i=>({element:i,area:eVr(i)})).filter(({area:i})=>Number.isFinite(i)&&i>0);return r.length===0?null:r.sort((i,a)=>t==="largest"?a.area-i.area:i.area-a.area)[0].element},tVr=(e,t)=>{if(!e||!t.has(si.FILL)&&!t.has(si.STROKE))return;let r=Mn(e.getAttribute("fill")||DSt(e,si.FILL)||""),n=Mn(e.getAttribute("stroke")||DSt(e,si.STROKE)||"");if(M6(r))return r;if(M6(n))return n},rVr=(e,t)=>{let r=Array.from(e.querySelectorAll("circle, ellipse, path")),n=x4e(r,"smallest");return tVr(n,t)},nVr=e=>{if(e.length<2)return e;let t=e.slice(1),r=t.filter(n=>n.trim().length>0).reduce((n,i)=>{let a=i.match(/^\s*/)?.[0].length??0;return Math.min(n,a)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?e.map(n=>n.trimEnd()):[e[0].trimEnd(),...t.map(n=>n.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]},iVr=e=>{let t=Array.isArray(e.label)?e.label.map(n=>Zs(n)):Zs(e.label||"").split(` -`);return nVr(t).join(` -`)},aVr=e=>e.description?(Array.isArray(e.description)?e.description:[e.description]).map(r=>Zs(r)).filter(r=>r.length>0):[],oVr=e=>{let t=new Set,r=i=>(i&&t.add(i),i),n=i=>{let a=i.find(o=>!t.has(o));return r(a||null)};return i=>{let a=[`[id='${i.domId}']`,`[id='${i.id}']`,`[data-id='${i.id}']`];for(let o of a){let s=e.querySelector(o);if(s)return r(s)}switch(i.shape){case"divider":return n(Array.from(e.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return n(Array.from(e.querySelectorAll("g.node.default")).filter(o=>o.querySelector("circle.state-start")));case"stateEnd":return n(Array.from(e.querySelectorAll("g.node.default")).filter(o=>!o.querySelector("circle.state-start")));default:return null}}},sVr=(e,t)=>{switch(t){case"roundedWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"divider":return e.querySelector("rect.divider")||e.querySelector("rect")||e;case"rectWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"stateStart":return x4e(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;case"stateEnd":return x4e(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;default:return e.querySelector("rect, path, circle, ellipse, polygon")||e}},lVr=(e,t,r)=>{let n=r(e);if(!n)throw new Error(`State node element not found for "${e.id}"`);let i=sVr(n,e.shape),a={},o={},s=[e.labelStyle,...e.cssCompiledStyles||[],...e.cssStyles||[]],l=$Wr(s);s.filter(Boolean).forEach(d=>{jWr(d,a,o)}),KWr(i,a,l),ZWr(n,o,l);let u=QWr(i,t);return{id:e.id,shape:e.shape,text:iVr(e),description:aVr(e),x:u.x,y:u.y,width:u.width,height:u.height,parentId:e.parentId,position:e.position,containerStyle:a,labelStyle:o,dividerLine:e.shape==="rectWithTitle"?JWr(n,t):void 0,endInnerColor:e.shape==="stateEnd"?rVr(n,l):void 0,isRenderable:e.shape!=="noteGroup"}},cVr=(e,t)=>{let r=t.querySelector(`[id='${e.id}']`);if(!r)return null;let{tx:n,ty:i}=w4e(r,t),a=xF(r,{x:n,y:i},"MCL");if(a.reflectionPoints.length<2)return null;let o={},s=(u,d)=>{switch(u){case si.STROKE:M6(d)&&(o.strokeColor=Mn(d));break;case si.STROKE_WIDTH:{let h=parseFloat(Mn(d));Number.isFinite(h)&&h>0&&(o.strokeWidth=h);break}case si.STROKE_DASHARRAY:Mn(d)&&(o.strokeStyle="dashed");break}};[e.style].filter(Boolean).forEach(u=>{Kc(u||"").forEach(({property:d,value:h})=>{s(d,h)})});let l=e.arrowhead==="none"||e.classes?.includes("note-edge");return{id:e.id,start:e.start,end:e.end,text:Zs(e.label||""),...a,strokeColor:o.strokeColor,strokeWidth:o.strokeWidth,strokeStyle:l?"dashed":o.strokeStyle,isNoteEdge:l}},PSt=(e,t)=>{let{nodes:r,edges:n}=e.getData(),i=oVr(t);return{type:"state",nodes:r.map(a=>lVr(a,t,i)),edges:n.map(a=>cVr(a,t)).filter(a=>a!==null)}}});var BSt,FSt,zSt=H(()=>{BSt=Promise.resolve(),FSt=e=>{let t=BSt.then(e,e);return BSt=t.then(()=>{},()=>{}),t}});var GSt,uVr,dVr,WSt,VSt,HSt=H(()=>{nSt();D5();Kb();uSt();gSt();USt();LSt();OSt();zSt();GSt=null,uVr=0,dVr=e=>JSON.stringify(e),WSt=e=>{let t=e.querySelector("svg");if(!t)throw new Error("SVG element not found");let r=t.getBoundingClientRect(),n=r.width,i=r.height;t.setAttribute("width",`${n}`),t.setAttribute("height",`${i}`);let a="image/svg+xml",o=unescape(encodeURIComponent(t.outerHTML)),l=`data:image/svg+xml;base64,${btoa(o)}`;return{type:"graphImage",mimeType:a,dataURL:l,width:n,height:i}},VSt=async(e,t=l9)=>FSt(async()=>{let r=t.themeVariables?.fontSize??l9.themeVariables.fontSize,n={...l9,...t,fontSize:r,themeVariables:{...l9.themeVariables,...t.themeVariables,fontSize:r}},i=dVr(n);i!==GSt&&(tK.initialize(n),GSt=i);let a=await tK.mermaidAPI.getDiagramFromText(x_e(e)),o=`mermaid-to-excalidraw-${uVr++}`,s=document.createElement("div");s.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");let l=`${o}-container`;s.id=l,document.getElementById(l)?.remove(),document.body.appendChild(s);try{let{svg:u}=await tK.render(o,e,s);s.innerHTML=u;let d;try{switch(a.type){case"flowchart-v2":case"graph":{d=cSt(a.db,s);break}case"sequence":{d=mSt(a,s);break}case"class":case"classDiagram":{d=ASt(a,s);break}case"er":{d=MSt(a.db,s);break}case"state":case"stateDiagram":{d=PSt(a.db,s);break}default:d=WSt(s)}}catch(h){console.error("Error processing Mermaid diagram:",h),d=WSt(s)}return d}finally{s.remove()}})});var E4e={};gr(E4e,{parseMermaidToExcalidraw:()=>hVr});var hVr,T4e=H(()=>{D5();E_e();HSt();hVr=async(e,t)=>{let r=t||{},n=parseInt(r.themeVariables?.fontSize??"")||20,i=await VSt(e,{...r,themeVariables:{...r.themeVariables}});return w_e(i,{fontSize:n})}});var qSt=Bn(()=>{(()=>{"use strict";Path2D.prototype.roundRect??=e,globalThis.CanvasRenderingContext2D&&(globalThis.CanvasRenderingContext2D.prototype.roundRect??=e),globalThis.OffscreenCanvasRenderingContext2D&&(globalThis.OffscreenCanvasRenderingContext2D.prototype.roundRect??=e);function e(n,i,a,o,s){if(![n,i,a,o].every(E=>Number.isFinite(E)))return;s=y(s);let l,u,d,h;if(s.length===4)l=b(s[0]),u=b(s[1]),d=b(s[2]),h=b(s[3]);else if(s.length===3)l=b(s[0]),u=b(s[1]),h=b(s[1]),d=b(s[2]);else if(s.length===2)l=b(s[0]),d=b(s[0]),u=b(s[1]),h=b(s[1]);else if(s.length===1)l=b(s[0]),u=b(s[0]),d=b(s[0]),h=b(s[0]);else throw new RangeError(`${t(this)} ${s.length} is not a valid size for radii sequence.`);let f=[l,u,d,h],p=f.find(({x:E,y:w})=>E<0||w<0),m=p?.x<0?p.x:p?.y;if(f.some(({x:E,y:w})=>!Number.isFinite(E)||!Number.isFinite(w)))return;if(p)throw new RangeError(`${t(this)} Radius value ${p} is negative.`);x(f),a<0&&o<0?(this.moveTo(n-l.x,i),this.ellipse(n+a+u.x,i-u.y,u.x,u.y,0,-Math.PI*1.5,-Math.PI),this.ellipse(n+a+d.x,i+o+d.y,d.x,d.y,0,-Math.PI,-Math.PI/2),this.ellipse(n-h.x,i+o+h.y,h.x,h.y,0,-Math.PI/2,0),this.ellipse(n-l.x,i-l.y,l.x,l.y,0,0,-Math.PI/2)):a<0?(this.moveTo(n-l.x,i),this.ellipse(n+a+u.x,i+u.y,u.x,u.y,0,-Math.PI/2,-Math.PI,1),this.ellipse(n+a+d.x,i+o-d.y,d.x,d.y,0,-Math.PI,-Math.PI*1.5,1),this.ellipse(n-h.x,i+o-h.y,h.x,h.y,0,Math.PI/2,0,1),this.ellipse(n-l.x,i+l.y,l.x,l.y,0,0,-Math.PI/2,1)):o<0?(this.moveTo(n+l.x,i),this.ellipse(n+a-u.x,i-u.y,u.x,u.y,0,Math.PI/2,0,1),this.ellipse(n+a-d.x,i+o+d.y,d.x,d.y,0,0,-Math.PI/2,1),this.ellipse(n+h.x,i+o+h.y,h.x,h.y,0,-Math.PI/2,-Math.PI,1),this.ellipse(n+l.x,i-l.y,l.x,l.y,0,-Math.PI,-Math.PI*1.5,1)):(this.moveTo(n+l.x,i),this.ellipse(n+a-u.x,i+u.y,u.x,u.y,0,-Math.PI/2,0),this.ellipse(n+a-d.x,i+o-d.y,d.x,d.y,0,0,Math.PI/2),this.ellipse(n+h.x,i+o-h.y,h.x,h.y,0,Math.PI/2,Math.PI),this.ellipse(n+l.x,i+l.y,l.x,l.y,0,Math.PI,Math.PI*1.5)),this.closePath(),this.moveTo(n,i);function g(E){let{x:w,y:T,z:C,w:S}=E;return{x:w,y:T,z:C,w:S}}function y(E){let w=typeof E;return w==="undefined"||E===null?[0]:w==="function"?[NaN]:w==="object"?typeof E[Symbol.iterator]=="function"?[...E].map(T=>{let C=typeof T;return C==="undefined"||T===null?0:C==="function"?NaN:C==="object"?g(T):v(T)}):[g(E)]:[v(E)]}function v(E){return+E}function b(E){let w=v(E);return Number.isFinite(w)?{x:w,y:w}:Object(E)===E?{x:v(E.x??0),y:v(E.y??0)}:{x:NaN,y:NaN}}function x(E){let[w,T,C,S]=E,R=[Math.abs(a)/(w.x+T.x),Math.abs(o)/(T.y+C.y),Math.abs(a)/(C.x+S.x),Math.abs(o)/(w.y+S.y)],U=Math.min(...R);if(U<=1)for(let L of E)L.x*=U,L.y*=U}}function t(n){return`Failed to execute 'roundRect' on '${r(n)}':`}function r(n){return Object(n)===n&&n instanceof Path2D?"Path2D":n instanceof globalThis?.CanvasRenderingContext2D?"CanvasRenderingContext2D":n instanceof globalThis?.OffscreenCanvasRenderingContext2D?"OffscreenCanvasRenderingContext2D":n?.constructor.name||n}})()});function J9t(){let e=new Map;return{get length(){return e.size},key:t=>[...e.keys()][t]??null,getItem:t=>e.has(String(t))?e.get(String(t)):null,setItem:(t,r)=>{e.set(String(t),String(r))},removeItem:t=>{e.delete(String(t))},clear:()=>e.clear()}}for(let e of["localStorage","sessionStorage"])try{window[e].length}catch{Object.defineProperty(window,e,{value:J9t(),configurable:!0})}window.EXCALIDRAW_EXPORT_SOURCE="https://excalidraw.com";var eIt=window.fetch.bind(window);window.fetch=(e,t)=>{let r=typeof e=="string"?e:e instanceof URL?e.href:e?.url,n=typeof r=="string"?/^data:([^;,]*)(;base64)?,(.*)$/s.exec(r):null;if(!n)return eIt(e,t);let[,i,a,o]=n,s=a?Uint8Array.from(atob(o),l=>l.charCodeAt(0)):new TextEncoder().encode(decodeURIComponent(o));return Promise.resolve(new Response(s,{headers:{"Content-Type":i||"text/plain"}}))};var gZ=new Map,tIt=URL.createObjectURL.bind(URL),rIt=URL.revokeObjectURL.bind(URL);URL.createObjectURL=e=>{let t=tIt(e);return e instanceof Blob&&gZ.set(t,e),t};URL.revokeObjectURL=e=>{gZ.delete(e),rIt(e)};var yN=Object.getOwnPropertyDescriptor(HTMLImageElement.prototype,"src");Object.defineProperty(HTMLImageElement.prototype,"src",{...yN,set(e){let t=typeof e=="string"?gZ.get(e):void 0;if(!t){yN.set.call(this,e);return}let r=new FileReader;r.onload=()=>yN.set.call(this,r.result),r.onerror=()=>yN.set.call(this,e),r.readAsDataURL(t)}});var Uv=Ue(dt(),1),q9t=Ue(Oke(),1);Iee();z_();Aie();Rie();LE();var UK=Ue(dt(),1),IK=Ue(dt(),1);var kl={},OHt=0;function bs(e,t){let r=`atom${++OHt}`,n={toString(){return(kl.env?kl.env.MODE:void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=BHt,n.write=FHt),t&&(n.write=t),n}function BHt(e){return e(this)}function FHt(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}var pMe=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Lie=e=>"init"in e,Mie=e=>!!e.write,SB=new WeakMap,Die=e=>{var t;return Nie(e)&&!((t=SB.get(e))!=null&&t[1])},zHt=(e,t)=>{let r=SB.get(e);if(r)r[1]=!0,r[0].forEach(n=>n(t));else if((kl.env?kl.env.MODE:void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},GHt=e=>{if(SB.has(e))return;let t=[new Set,!1];SB.set(e,t);let r=()=>{t[1]=!0};e.then(r,r),e.onCancel=n=>{t[0].add(n)}},Nie=e=>typeof e?.then=="function",mMe=e=>"v"in e||"e"in e,CB=e=>{if("e"in e)throw e.e;if((kl.env?kl.env.MODE:void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},vMe=(e,t,r)=>{r.p.has(e)||(r.p.add(e),t.then(()=>{r.p.delete(e)},()=>{r.p.delete(e)}))},gMe=(e,t,r,n,i)=>{var a;if((kl.env?kl.env.MODE:void 0)!=="production"&&n===t)throw new Error("[Bug] atom cannot depend on itself");r.d.set(n,i.n),Die(r.v)&&vMe(t,r.v,i),(a=i.m)==null||a.t.add(t),e&&WHt(e,n,t)},GU=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),VU=(e,t,r)=>{e[t].add(r)},yMe=(e,t,r)=>{e.D.has(t)||(e.D.set(t,new Set),VU(e,"M",()=>{var n;(n=r.m)==null||n.l.forEach(i=>VU(e,"M",i))}))},WHt=(e,t,r)=>{let n=e.D.get(t);n&&n.add(r)},VHt=(e,t)=>e.D.get(t),E5=e=>{let t,r=!1,n=i=>{try{i()}catch(a){r||(t=a,r=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(n),e.H.clear(),e.M.forEach(n),e.M.clear(),e.L.forEach(n),e.L.clear();if(r)throw t},bMe=(...[e,t,r,n])=>{let i=(v,b,x)=>{let E="v"in b,w=b.v,T=Die(b.v)?b.v:null;if(Nie(x)){GHt(x);for(let C of b.d.keys())vMe(v,x,e(C));b.v=x}else b.v=x;delete b.e,delete b.x,(!E||!Object.is(w,b.v))&&(++b.n,T&&zHt(T,x))},a=(v,b)=>{var x;let E=e(b);if(mMe(E)&&(E.m&&!E.x||Array.from(E.d).every(([U,L])=>a(v,U).n===L)))return E;E.d.clear();let w=!0,T=U=>{if(pMe(b,U)){let I=e(U);if(!mMe(I))if(Lie(U))i(U,I,U.init);else throw new Error("no atom init");return CB(I)}let L=a(v,U);try{return CB(L)}finally{if(w)gMe(v,b,E,U,L);else{let I=GU();gMe(I,b,E,U,L),h(I,b,E),E5(I)}}},C,S,R={get signal(){return C||(C=new AbortController),C.signal},get setSelf(){return(kl.env?kl.env.MODE:void 0)!=="production"&&!Mie(b)&&console.warn("setSelf function cannot be used with read-only atom"),!S&&Mie(b)&&(S=(...U)=>{if((kl.env?kl.env.MODE:void 0)!=="production"&&w&&console.warn("setSelf function cannot be called in sync"),!w)return d(b,...U)}),S}};try{let U=t(b,T,R);if(i(b,E,U),Nie(U)){(x=U.onCancel)==null||x.call(U,()=>C?.abort());let L=()=>{if(E.m){let I=GU();h(I,b,E),E5(I)}};U.then(L,L)}return E}catch(U){return delete E.v,E.e=U,delete E.x,++E.n,E}finally{w=!1}},o=v=>CB(a(void 0,v)),s=(v,b,x)=>{var E,w;let T=new Map;for(let C of((E=x.m)==null?void 0:E.t)||[]){let S=e(C);S.m&&T.set(C,S)}for(let C of x.p)T.set(C,e(C));return(w=VHt(v,b))==null||w.forEach(C=>{T.set(C,e(C))}),T},l=(v,b,x)=>{let E=[],w=new Set,T=new Set,C=[[b,x]];for(;C.length>0;){let[S,R]=C[C.length-1];if(T.has(S)){C.pop();continue}if(w.has(S)){E.push([S,R,R.n]),T.add(S),R.x=!0,C.pop();continue}w.add(S);for(let[U,L]of s(v,S,R))S!==U&&!w.has(U)&&C.push([U,L])}VU(v,"H",()=>{let S=new Set([b]);for(let R=E.length-1;R>=0;--R){let[U,L,I]=E[R],A=!1;for(let P of L.d.keys())if(P!==U&&S.has(P)){A=!0;break}A&&(a(v,U),h(v,U,L),I!==L.n&&(yMe(v,U,L),S.add(U))),delete L.x}})},u=(v,b,...x)=>{let E=!0,w=C=>CB(a(v,C)),T=(C,...S)=>{let R=e(C);try{if(pMe(b,C)){if(!Lie(C))throw new Error("atom not writable");let U=R.n,L=S[0];i(C,R,L),h(v,C,R),U!==R.n&&(yMe(v,C,R),l(v,C,R));return}else return u(v,C,...S)}finally{E||E5(v)}};try{return r(b,w,T,...x)}finally{E=!1}},d=(v,...b)=>{let x=GU();try{return u(x,v,...b)}finally{E5(x)}},h=(v,b,x)=>{if(x.m&&!Die(x.v)){for(let E of x.d.keys())x.m.d.has(E)||(f(v,E,e(E)).t.add(b),x.m.d.add(E));for(let E of x.m.d||[])if(!x.d.has(E)){x.m.d.delete(E);let w=p(v,E,e(E));w?.t.delete(b)}}},f=(v,b,x)=>{if(!x.m){a(v,b);for(let E of x.d.keys())f(v,E,e(E)).t.add(b);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},Mie(b)){let E=x.m,w,T=(C,S)=>{let R=!0;w=(...U)=>{try{return u(C,b,...U)}finally{R||E5(C)}};try{return S()}finally{R=!1}};VU(v,"L",()=>{let C=T(v,()=>n(b,(...S)=>w(...S)));C&&(E.u=S=>T(S,C))})}}return x.m},p=(v,b,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(E=>{var w;return(w=e(E).m)==null?void 0:w.d.has(b)})){let E=x.m.u;E&&VU(v,"L",()=>E(v)),delete x.m;for(let w of x.d.keys()){let T=p(v,w,e(w));T?.t.delete(b)}return}return x.m};return{get:o,set:d,sub:(v,b)=>{let x=GU(),E=e(v),T=f(x,v,E).l;return T.add(b),E5(x),()=>{T.delete(b);let C=GU();p(C,v,E),E5(C)}},unstable_derive:v=>bMe(...v(e,t,r,n))}},HHt=e=>{let t=new WeakMap,r=new Set,n,i=0,a=e.unstable_derive((l,u,d,h)=>(n=l,[f=>{let p=t.get(f);if(!p){let m=l(f);p=new Proxy(m,{set(g,y,v){return y==="m"&&r.add(f),Reflect.set(g,y,v)},deleteProperty(g,y){return y==="m"&&r.delete(f),Reflect.deleteProperty(g,y)}}),t.set(f,p)}return p},u,(f,p,m,...g)=>i?m(f,...g):d(f,p,m,...g),h])),o=a.set;return Object.assign(a,{dev4_get_internal_weak_map:()=>({get:l=>{let u=n(l);if(u.n!==0)return u}}),dev4_get_mounted_atoms:()=>r,dev4_restore_atoms:l=>{o({read:()=>null,write:(d,h)=>{++i;try{for(let[f,p]of l)Lie(f)&&h(f,p)}finally{--i}}})}})},PT=()=>{let e=new WeakMap,r=bMe(n=>{if((kl.env?kl.env.MODE:void 0)!=="production"&&!n)throw new Error("Atom is undefined or null");let i=e.get(n);return i||(i={d:new Map,p:new Set,n:0},e.set(n,i)),i},(n,...i)=>n.read(...i),(n,...i)=>n.write(...i),(n,...i)=>{var a;return(a=n.onMount)==null?void 0:a.call(n,...i)});return(kl.env?kl.env.MODE:void 0)!=="production"?HHt(r):r},WU,xMe=()=>(WU||(WU=PT(),(kl.env?kl.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=WU),globalThis.__JOTAI_DEFAULT_STORE__!==WU&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),WU);var Lc=Ue(dt(),1);var AB={},qHt=(0,Lc.createContext)(void 0),OT=e=>{let t=(0,Lc.useContext)(qHt);return e?.store||t||xMe()};var Pie=e=>typeof e?.then=="function",EMe=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},YHt=Lc.default.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(EMe(e),e)}),_ie=new WeakMap,wMe=e=>{let t=_ie.get(e);return t||(t=new Promise((r,n)=>{let i=e,a=l=>u=>{i===l&&r(u)},o=l=>u=>{i===l&&n(u)},s=l=>{"onCancel"in l&&typeof l.onCancel=="function"&&l.onCancel(u=>{if((AB.env?AB.env.MODE:void 0)!=="production"&&u===l)throw new Error("[Bug] p is not updated even after cancelation");Pie(u)?(_ie.set(u,t),i=u,u.then(a(u),o(u)),s(u)):r(u)})};e.then(a(e),o(e)),s(e)}),_ie.set(e,t)),t};function Oie(e,t){let r=OT(t),[[n,i,a],o]=(0,Lc.useReducer)(u=>{let d=r.get(e);return Object.is(u[0],d)&&u[1]===r&&u[2]===e?u:[d,r,e]},void 0,()=>[r.get(e),r,e]),s=n;(i!==r||a!==e)&&(o(),s=r.get(e));let l=t?.delay;if((0,Lc.useEffect)(()=>{let u=r.sub(e,()=>{if(typeof l=="number"){let d=r.get(e);Pie(d)&&EMe(wMe(d)),setTimeout(o,l);return}o()});return o(),u},[r,e,l]),(0,Lc.useDebugValue)(s),Pie(s)){let u=wMe(s);return YHt(u)}return s}function UB(e,t){let r=OT(t);return(0,Lc.useCallback)((...i)=>{if((AB.env?AB.env.MODE:void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...i)},[r,e])}function Bie(e,t){return[Oie(e,t),UB(e,t)]}var SMe=Ue(it(),1),H1=Ue(dt(),1);var kMe=Ue(dt(),1);var TMe=new WeakMap;function CMe(e,t){let r=OT(t),n=jHt(r);for(let[i,a]of e)(!n.has(i)||t?.dangerouslyForceHydrate)&&(n.add(i),r.set(i,a))}var jHt=e=>{let t=TMe.get(e);return t||(t=new WeakSet,TMe.set(e,t)),t};function BT(){return BT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let s=(0,H1.useContext)(e);if(!s)throw new Error("Missing Provider from createIsolation");return OT(BT({store:s},o))};return{Provider:t,useStore:r,useAtom:(o,s)=>{let l=r();return Bie(o,BT({store:l},s))},useAtomValue:(o,s)=>{let l=r();return Oie(o,BT({store:l},s))},useSetAtom:(o,s)=>{let l=r();return UB(o,BT({store:l},s))}}}var{read:nJr,write:iJr}=bs(null);var aJr=(0,H1.createContext)({scope:void 0,baseStore:void 0});var MK=Ue(dt(),1),l7t=Ue(dt(),1),hK=Ue(it(),1);Rr();var qA=Ue(it(),1),u7t=Ue(it(),1),Ps=Ue(dt(),1),iw=Ue(sd(),1);D8();Rr();rP();var H0=Ue(dt(),1);Rr();var ip=Ue(it(),1),d7t=Ue(it(),1),dN=Ue(it(),1),v7t=Ue(it(),1),cp=Ue(dt(),1);Rr();var b7t=Ue(dt(),1);Rr();var x7t=Ue(it(),1),YA=Ue(it(),1);Rr();var fK=Ue(it(),1),E7t=Ue(it(),1),hw=Ue(dt(),1);Rr();var LK=Ue(dt(),1),C7t=Ue(it(),1),bv=Ue(it(),1);Rr();var NK=Ue(dt(),1),jA=Ue(it(),1);Rr();var _K=Ue(dt(),1),XA=Ue(it(),1),S7t=Ue(it(),1),Xh=Ue(it(),1);var ao=Ue(dt(),1);function Sm(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}var UMe=Ue(dt(),1);function AMe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fie(...e){return t=>{let r=!1,n=e.map(i=>{let a=AMe(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i{let{scope:f,children:p,...m}=h,g=f?.[e]?.[l]||s,y=q1.useMemo(()=>m,Object.values(m));return(0,IMe.jsx)(g.Provider,{value:y,children:p})};u.displayName=a+"Provider";function d(h,f){let p=f?.[e]?.[l]||s,m=q1.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}let i=()=>{let a=r.map(o=>q1.createContext(o));return function(s){let l=s?.[e]||a;return q1.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,XHt(i,...t)]}function XHt(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){let o=n.reduce((s,{useScope:l,scopeName:u})=>{let h=l(a)[`__scope${u}`];return{...s,...h}},{});return q1.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var wo=Ue(dt(),1);var RMe=Ue(dt(),1),MMe=Ue(sd(),1);var Ks=Ue(dt(),1);var FT=Ue(it(),1),HU=Ks.forwardRef((e,t)=>{let{children:r,...n}=e,i=Ks.Children.toArray(r),a=i.find(KHt);if(a){let o=a.props.children,s=i.map(l=>l===a?Ks.Children.count(o)>1?Ks.Children.only(null):Ks.isValidElement(o)?o.props.children:null:l);return(0,FT.jsx)(zie,{...n,ref:t,children:Ks.isValidElement(o)?Ks.cloneElement(o,void 0,s):null})}return(0,FT.jsx)(zie,{...n,ref:t,children:r})});HU.displayName="Slot";var zie=Ks.forwardRef((e,t)=>{let{children:r,...n}=e;if(Ks.isValidElement(r)){let i=QHt(r),a=ZHt(n,r.props);return r.type!==Ks.Fragment&&(a.ref=t?Fie(t,i):i),Ks.cloneElement(r,a)}return Ks.Children.count(r)>1?Ks.Children.only(null):null});zie.displayName="SlotClone";var $Ht=({children:e})=>(0,FT.jsx)(FT.Fragment,{children:e});function KHt(e){return Ks.isValidElement(e)&&e.type===$Ht}function ZHt(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{a(...s),i(...s)}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function QHt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var LMe=Ue(it(),1),JHt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],bu=JHt.reduce((e,t)=>{let r=RMe.forwardRef((n,i)=>{let{asChild:a,...o}=n,s=a?HU:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,LMe.jsx)(s,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function DMe(e,t){e&&MMe.flushSync(()=>e.dispatchEvent(t))}var zT=Ue(dt(),1);function yh(e){let t=zT.useRef(e);return zT.useEffect(()=>{t.current=e}),zT.useMemo(()=>(...r)=>t.current?.(...r),[])}var NMe=Ue(dt(),1);function _Me(e,t=globalThis?.document){let r=yh(e);NMe.useEffect(()=>{let n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Wie=Ue(it(),1),eqt="DismissableLayer",Gie="dismissableLayer.update",tqt="dismissableLayer.pointerDownOutside",rqt="dismissableLayer.focusOutside",PMe,BMe=wo.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vie=wo.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=wo.useContext(BMe),[d,h]=wo.useState(null),f=d?.ownerDocument??globalThis?.document,[,p]=wo.useState({}),m=gh(t,C=>h(C)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=b>=v,w=aqt(C=>{let S=C.target,R=[...u.branches].some(U=>U.contains(S));!E||R||(i?.(C),o?.(C),C.defaultPrevented||s?.())},f),T=oqt(C=>{let S=C.target;[...u.branches].some(U=>U.contains(S))||(a?.(C),o?.(C),C.defaultPrevented||s?.())},f);return _Me(C=>{b===u.layers.size-1&&(n?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},f),wo.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(PMe=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),OMe(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=PMe)}},[d,f,r,u]),wo.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),OMe())},[d,u]),wo.useEffect(()=>{let C=()=>p({});return document.addEventListener(Gie,C),()=>document.removeEventListener(Gie,C)},[]),(0,Wie.jsx)(bu.div,{...l,ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Sm(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Sm(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Sm(e.onPointerDownCapture,w.onPointerDownCapture)})});Vie.displayName=eqt;var nqt="DismissableLayerBranch",iqt=wo.forwardRef((e,t)=>{let r=wo.useContext(BMe),n=wo.useRef(null),i=gh(t,n);return wo.useEffect(()=>{let a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,Wie.jsx)(bu.div,{...e,ref:i})});iqt.displayName=nqt;function aqt(e,t=globalThis?.document){let r=yh(e),n=wo.useRef(!1),i=wo.useRef(()=>{});return wo.useEffect(()=>{let a=s=>{if(s.target&&!n.current){let u=function(){FMe(tqt,r,d,{discrete:!0})};var l=u;let d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function oqt(e,t=globalThis?.document){let r=yh(e),n=wo.useRef(!1);return wo.useEffect(()=>{let i=a=>{a.target&&!n.current&&FMe(rqt,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function OMe(){let e=new CustomEvent(Gie);document.dispatchEvent(e)}function FMe(e,t,r,{discrete:n}){let i=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?DMe(i,a):i.dispatchEvent(a)}var GMe=Ue(dt(),1),Hie=0;function WMe(){GMe.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zMe()),document.body.insertAdjacentElement("beforeend",e[1]??zMe()),Hie++,()=>{Hie===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hie--}},[])}function zMe(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ef=Ue(dt(),1);var jMe=Ue(it(),1),qie="focusScope.autoFocusOnMount",Yie="focusScope.autoFocusOnUnmount",VMe={bubbles:!1,cancelable:!0},sqt="FocusScope",jie=Ef.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=Ef.useState(null),u=yh(i),d=yh(a),h=Ef.useRef(null),f=gh(t,g=>l(g)),p=Ef.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Ef.useEffect(()=>{if(n){let b=function(T){if(p.paused||!s)return;let C=T.target;s.contains(C)?h.current=C:zb(h.current,{select:!0})},x=function(T){if(p.paused||!s)return;let C=T.relatedTarget;C!==null&&(s.contains(C)||zb(h.current,{select:!0}))},E=function(T){if(document.activeElement===document.body)for(let S of T)S.removedNodes.length>0&&zb(s)};var g=b,y=x,v=E;document.addEventListener("focusin",b),document.addEventListener("focusout",x);let w=new MutationObserver(E);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),w.disconnect()}}},[n,s,p.paused]),Ef.useEffect(()=>{if(s){qMe.add(p);let g=document.activeElement;if(!s.contains(g)){let v=new CustomEvent(qie,VMe);s.addEventListener(qie,u),s.dispatchEvent(v),v.defaultPrevented||(lqt(fqt(XMe(s)),{select:!0}),document.activeElement===g&&zb(s))}return()=>{s.removeEventListener(qie,u),setTimeout(()=>{let v=new CustomEvent(Yie,VMe);s.addEventListener(Yie,d),s.dispatchEvent(v),v.defaultPrevented||zb(g??document.body,{select:!0}),s.removeEventListener(Yie,d),qMe.remove(p)},0)}}},[s,u,d,p]);let m=Ef.useCallback(g=>{if(!r&&!n||p.paused)return;let y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){let b=g.currentTarget,[x,E]=cqt(b);x&&E?!g.shiftKey&&v===E?(g.preventDefault(),r&&zb(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),r&&zb(E,{select:!0})):v===b&&g.preventDefault()}},[r,n,p.paused]);return(0,jMe.jsx)(bu.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});jie.displayName=sqt;function lqt(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(zb(n,{select:t}),document.activeElement!==r)return}function cqt(e){let t=XMe(e),r=HMe(t,e),n=HMe(t.reverse(),e);return[r,n]}function XMe(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function HMe(e,t){for(let r of e)if(!uqt(r,{upTo:t}))return r}function uqt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dqt(e){return e instanceof HTMLInputElement&&"select"in e}function zb(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&dqt(e)&&t&&e.select()}}var qMe=hqt();function hqt(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=YMe(e,t),e.unshift(t)},remove(t){e=YMe(e,t),e[0]?.resume()}}}function YMe(e,t){let r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function fqt(e){return e.filter(t=>t.tagName!=="A")}var MB=Ue(dt(),1);var $Me=Ue(dt(),1),Tf=globalThis?.document?$Me.useLayoutEffect:()=>{};var pqt=MB.useId||(()=>{}),mqt=0;function KMe(e){let[t,r]=MB.useState(pqt());return Tf(()=>{e||r(n=>n??String(mqt++))},[e]),e||(t?`radix-${t}`:"")}var vh=Ue(dt(),1);var JMe=["top","right","bottom","left"];var Am=Math.min,jp=Math.max,YU=Math.round,jU=Math.floor,Um=e=>({x:e,y:e}),gqt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xie(e,t,r){return jp(e,Am(t,r))}function Im(e,t){return typeof e=="function"?e(t):e}function Y1(e){return e.split("-")[0]}function T5(e){return e.split("-")[1]}function DB(e){return e==="x"?"y":"x"}function NB(e){return e==="y"?"height":"width"}function Xp(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function _B(e){return DB(Xp(e))}function eLe(e,t,r){r===void 0&&(r=!1);let n=T5(e),i=_B(e),a=NB(i),o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=qU(o)),[o,qU(o)]}function tLe(e){let t=qU(e);return[LB(e),t,LB(t)]}function LB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var ZMe=["left","right"],QMe=["right","left"],yqt=["top","bottom"],vqt=["bottom","top"];function bqt(e,t,r){switch(e){case"top":case"bottom":return r?t?QMe:ZMe:t?ZMe:QMe;case"left":case"right":return t?yqt:vqt;default:return[]}}function rLe(e,t,r,n){let i=T5(e),a=bqt(Y1(e),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(LB)))),a}function qU(e){let t=Y1(e);return gqt[t]+e.slice(t.length)}function xqt(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function $ie(e){return typeof e!="number"?xqt(e):{top:e,right:e,bottom:e,left:e}}function k5(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function nLe(e,t,r){let{reference:n,floating:i}=e,a=Xp(t),o=_B(t),s=NB(o),l=Y1(t),u=a==="y",d=n.x+n.width/2-i.width/2,h=n.y+n.height/2-i.height/2,f=n[s]/2-i[s]/2,p;switch(l){case"top":p={x:d,y:n.y-i.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-i.width,y:h};break;default:p={x:n.x,y:n.y}}let m=T5(t);return m&&(p[o]+=f*(m==="end"?1:-1)*(r&&u?-1:1)),p}async function oLe(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=Im(t,e),m=$ie(p),y=s[f?h==="floating"?"reference":"floating":h],v=k5(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(y)))==null||r?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:l})),b=h==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(x))&&await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1},w=k5(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-w.top+m.top)/E.y,bottom:(w.bottom-v.bottom+m.bottom)/E.y,left:(v.left-w.left+m.left)/E.x,right:(w.right-v.right+m.right)/E.x}}var wqt=50,sLe=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=o.detectOverflow?o:{...o,detectOverflow:oLe},l=await(o.isRTL==null?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=nLe(u,n,l),f=n,p=0,m={};for(let g=0;g({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=Im(e,t)||{};if(u==null)return{};let h=$ie(d),f={x:r,y:n},p=_B(i),m=NB(p),g=await o.getDimensions(u),y=p==="y",v=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",E=a.reference[m]+a.reference[p]-f[p]-a.floating[m],w=f[p]-a.reference[p],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u)),C=T?T[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(T)))&&(C=s.floating[x]||a.floating[m]);let S=E/2-w/2,R=C/2-g[m]/2-1,U=Am(h[v],R),L=Am(h[b],R),I=C-g[m]-L,A=C/2-g[m]/2+S,P=Xie(U,A,I),D=!l.arrow&&T5(i)!=null&&A!==P&&a.reference[m]/2-(AP<=0)){var L,I;let P=(((L=a.flip)==null?void 0:L.index)||0)+1,D=C[P];if(D&&(!(h==="alignment"?b!==Xp(D):!1)||U.every(_=>Xp(_.placement)===b?_.overflows[0]>0:!0)))return{data:{index:P,overflows:U},reset:{placement:D}};let M=(I=U.filter(O=>O.overflows[0]<=0).sort((O,_)=>O.overflows[1]-_.overflows[1])[0])==null?void 0:I.placement;if(!M)switch(p){case"bestFit":{var A;let O=(A=U.filter(_=>{if(T){let B=Xp(_.placement);return B===b||B==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(B=>B>0).reduce((B,F)=>B+F,0)]).sort((_,B)=>_[1]-B[1])[0])==null?void 0:A[0];O&&(M=O);break}case"initialPlacement":M=s;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function iLe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aLe(e){return JMe.some(t=>e[t]>=0)}var uLe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:i="referenceHidden",...a}=Im(e,t);switch(i){case"referenceHidden":{let o=await n.detectOverflow(t,{...a,elementContext:"reference"}),s=iLe(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:aLe(s)}}}case"escaped":{let o=await n.detectOverflow(t,{...a,altBoundary:!0}),s=iLe(o,r.floating);return{data:{escapedOffsets:s,escaped:aLe(s)}}}default:return{}}}}};var dLe=new Set(["left","top"]);async function Eqt(e,t){let{placement:r,platform:n,elements:i}=e,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Y1(r),s=T5(r),l=Xp(r)==="y",u=dLe.has(o)?-1:1,d=a&&l?-1:1,h=Im(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*d,y:f*u}:{x:f*u,y:p*d}}var hLe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:a,placement:o,middlewareData:s}=t,l=await Eqt(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},fLe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:E}=b;return{x,y:E}}},...u}=Im(e,t),d={x:r,y:n},h=await a.detectOverflow(t,u),f=Xp(i),p=DB(f),m=d[p],g=d[f],y=(b,x)=>Xie(x+h[b==="y"?"top":"left"],x,x-h[b==="y"?"bottom":"right"]);o&&(m=y(p,m)),s&&(g=y(f,g));let v=l.fn({...t,[p]:m,[f]:g});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:o,[f]:s}}}}}},pLe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,n;let{x:i,y:a,placement:o,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=Im(e,t),f={x:i,y:a},p=Xp(o),m=DB(p),g=f[m],y=f[p],v=Im(u,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(r=v.mainAxis)!=null?r:0,crossAxis:(n=v.crossAxis)!=null?n:0};if(d){let w=m==="y"?"height":"width",T=s.reference[m]-s.floating[w]+b.mainAxis,C=s.reference[m]+s.reference[w]-b.mainAxis;gC&&(g=C)}if(h){var x,E;let w=m==="y"?"width":"height",T=dLe.has(Y1(o)),C=s.reference[p]-s.floating[w]+(T&&((x=l.offset)==null?void 0:x[p])||0)+(T?0:b.crossAxis),S=s.reference[p]+s.reference[w]+(T?0:((E=l.offset)==null?void 0:E[p])||0)-(T?b.crossAxis:0);yS&&(y=S)}return{[m]:g,[p]:y}}}},mLe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:r,rects:n,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Im(e,t),l=await i.detectOverflow(t,s),u=Y1(r),d=T5(r),h=Xp(r)==="y",{width:f,height:p}=n.floating,m,g;u==="top"||u==="bottom"?(m=u,g=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=u,m=d==="end"?"top":"bottom");let y=p-l.top-l.bottom,v=f-l.left-l.right,b=Am(p-l[m],y),x=Am(f-l[g],v),E=t.middlewareData.shift,w=!E,T=b,C=x;E!=null&&E.enabled.x&&(C=v),E!=null&&E.enabled.y&&(T=y),w&&!d&&(h?C=f-2*jp(l.left,l.right):T=p-2*jp(l.top,l.bottom)),await o({...t,availableWidth:C,availableHeight:T});let S=await i.getDimensions(a.floating);return f!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function PB(){return typeof window<"u"}function A5(e){return yLe(e)?(e.nodeName||"").toLowerCase():"#document"}function xu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rm(e){var t;return(t=(yLe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yLe(e){return PB()?e instanceof Node||e instanceof xu(e).Node:!1}function $p(e){return PB()?e instanceof Element||e instanceof xu(e).Element:!1}function j1(e){return PB()?e instanceof HTMLElement||e instanceof xu(e).HTMLElement:!1}function gLe(e){return!PB()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xu(e).ShadowRoot}function XU(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=Kp(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function vLe(e){return/^(table|td|th)$/.test(A5(e))}function $U(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Tqt=/transform|translate|scale|rotate|perspective|filter/,kqt=/paint|layout|strict|content/,C5=e=>!!e&&e!=="none",Kie;function OB(e){let t=$p(e)?Kp(e):e;return C5(t.transform)||C5(t.translate)||C5(t.scale)||C5(t.rotate)||C5(t.perspective)||!BB()&&(C5(t.backdropFilter)||C5(t.filter))||Tqt.test(t.willChange||"")||kqt.test(t.contain||"")}function bLe(e){let t=Gb(e);for(;j1(t)&&!GT(t);){if(OB(t))return t;if($U(t))return null;t=Gb(t)}return null}function BB(){return Kie==null&&(Kie=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kie}function GT(e){return/^(html|body|#document)$/.test(A5(e))}function Kp(e){return xu(e).getComputedStyle(e)}function KU(e){return $p(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gb(e){if(A5(e)==="html")return e;let t=e.assignedSlot||e.parentNode||gLe(e)&&e.host||Rm(e);return gLe(t)?t.host:t}function xLe(e){let t=Gb(e);return GT(t)?(e.ownerDocument||e).body:j1(t)&&XU(t)?t:xLe(t)}function S5(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=xLe(e),a=i===((n=e.ownerDocument)==null?void 0:n.body),o=xu(i);if(a){let s=FB(o);return t.concat(o,o.visualViewport||[],XU(i)?i:[],s&&r?S5(s):[])}else return t.concat(i,S5(i,[],r))}function FB(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function TLe(e){let t=Kp(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=j1(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=YU(r)!==a||YU(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function Qie(e){return $p(e)?e:e.contextElement}function WT(e){let t=Qie(e);if(!j1(t))return Um(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:a}=TLe(t),o=(a?YU(r.width):r.width)/n,s=(a?YU(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Cqt=Um(0);function kLe(e){let t=xu(e);return!BB()||!t.visualViewport?Cqt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sqt(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===xu(e)}function U5(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),a=Qie(e),o=Um(1);t&&(n?$p(n)&&(o=WT(n)):o=WT(e));let s=Sqt(a,r,n)?kLe(a):Um(0),l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,h=i.height/o.y;if(a&&n){let f=xu(a),p=$p(n)?xu(n):n,m=f,g=FB(m);for(;g&&p!==m;){let y=WT(g),v=g.getBoundingClientRect(),b=Kp(g),x=v.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,E=v.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=x,u+=E,m=xu(g),g=FB(m)}}return k5({width:d,height:h,x:l,y:u})}function zB(e,t){let r=KU(e).scrollLeft;return t?t.left+r:U5(Rm(e)).left+r}function CLe(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-zB(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function Aqt(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,a=i==="fixed",o=Rm(n),s=t?$U(t.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=Um(1),d=Um(0),h=j1(n);if((h||!a)&&((A5(n)!=="body"||XU(o))&&(l=KU(n)),h)){let p=U5(n);u=WT(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}let f=o&&!h&&!a?CLe(o,l):Um(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x+f.x,y:r.y*u.y-l.scrollTop*u.y+d.y+f.y}}function Uqt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Iqt(e){let t=KU(e),r=e.ownerDocument.body,n=jp(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=jp(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),a=-t.scrollLeft+zB(e),o=-t.scrollTop;return Kp(r).direction==="rtl"&&(a+=jp(e.clientWidth,r.clientWidth)-n),{width:n,height:i,x:a,y:o}}var Rqt=25;function Mqt(e,t,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=xu(e),a=Rm(e),o=i.visualViewport,s=a.clientWidth,l=a.clientHeight,u=0,d=0;if(o){let f=!BB()||t==="fixed";n?f||(u=-o.offsetLeft,d=-o.offsetTop):(s=o.width,l=o.height,f&&(u=o.offsetLeft,d=o.offsetTop))}if(zB(a)<=0){let f=a.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(a.clientWidth-p.clientWidth-g),v=getComputedStyle(a).scrollbarGutter==="stable both-edges"?y/2:y;v<=Rqt&&(s-=v)}return{width:s,height:l,x:u,y:d}}function Lqt(e,t){let r=U5(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=WT(e),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function wLe(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=Mqt(e,r,t);else if(t==="document")n=Iqt(Rm(e));else if($p(t))n=Lqt(t,r);else{let i=kLe(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return k5(n)}function Dqt(e,t){let r=t.get(e);if(r)return r;let n=S5(e,[],!1).filter(s=>$p(s)&&A5(s)!=="body"),i=null,a=Kp(e).position==="fixed",o=a?Gb(e):e;for(;$p(o)&&!GT(o);){let s=Kp(o),l=OB(o),u=i?i.position:a?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?n=n.filter(h=>h!==o):i=s,o=Gb(o)}return t.set(e,n),n}function Nqt(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?$U(t)?[]:Dqt(t,this._c):[].concat(r),n],s=wLe(t,o[0],i),l=s.top,u=s.right,d=s.bottom,h=s.left;for(let f=1;f{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(S,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,T)}n.observe(e)}let l=xu(e),u=()=>s(r);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),o()}}function Jie(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Qie(e),d=i||a?[...u?S5(u):[],...t?S5(t):[]]:[];d.forEach(v=>{i&&v.addEventListener("scroll",r),a&&v.addEventListener("resize",r)});let h=u&&s?Fqt(u,r,a):null,f=-1,p=null;o&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),u&&!l&&p.observe(u),t&&p.observe(t));let m,g=l?U5(e):null;l&&y();function y(){let v=U5(e);g&&!ULe(g,v)&&r(),g=v,m=requestAnimationFrame(y)}return r(),()=>{var v;d.forEach(b=>{i&&b.removeEventListener("scroll",r),a&&b.removeEventListener("resize",r)}),h?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var ILe=hLe;var RLe=fLe,MLe=cLe,LLe=mLe,DLe=uLe,eae=lLe;var NLe=pLe,tae=(e,t,r)=>{let n=new Map,i=r??{},a={...ALe,...i.platform,_c:n};return sLe(e,t,{...i,platform:a})};var xs=Ue(dt(),1),PLe=Ue(dt(),1),OLe=Ue(sd(),1),zqt=typeof document<"u",Gqt=function(){},GB=zqt?PLe.useLayoutEffect:Gqt;function WB(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!WB(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!(a==="_owner"&&e.$$typeof)&&!WB(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function BLe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _Le(e,t){let r=BLe(e);return Math.round(t*r)/r}function rae(e){let t=xs.useRef(e);return GB(()=>{t.current=e}),t}function FLe(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,h]=xs.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=xs.useState(n);WB(f,n)||p(n);let[m,g]=xs.useState(null),[y,v]=xs.useState(null),b=xs.useCallback(_=>{_!==T.current&&(T.current=_,g(_))},[]),x=xs.useCallback(_=>{_!==C.current&&(C.current=_,v(_))},[]),E=a||m,w=o||y,T=xs.useRef(null),C=xs.useRef(null),S=xs.useRef(d),R=l!=null,U=rae(l),L=rae(i),I=rae(u),A=xs.useCallback(()=>{if(!T.current||!C.current)return;let _={placement:t,strategy:r,middleware:f};L.current&&(_.platform=L.current),tae(T.current,C.current,_).then(B=>{let F={...B,isPositioned:I.current!==!1};P.current&&!WB(S.current,F)&&(S.current=F,OLe.flushSync(()=>{h(F)}))})},[f,t,r,L,I]);GB(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[u]);let P=xs.useRef(!1);GB(()=>(P.current=!0,()=>{P.current=!1}),[]),GB(()=>{if(E&&(T.current=E),w&&(C.current=w),E&&w){if(U.current)return U.current(E,w,A);A()}},[E,w,A,U,R]);let D=xs.useMemo(()=>({reference:T,floating:C,setReference:b,setFloating:x}),[b,x]),M=xs.useMemo(()=>({reference:E,floating:w}),[E,w]),O=xs.useMemo(()=>{let _={position:r,left:0,top:0};if(!M.floating)return _;let B=_Le(M.floating,d.x),F=_Le(M.floating,d.y);return s?{..._,transform:"translate("+B+"px, "+F+"px)",...BLe(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:F}},[r,s,M.floating,d.x,d.y]);return xs.useMemo(()=>({...d,update:A,refs:D,elements:M,floatingStyles:O}),[d,A,D,M,O])}var Wqt=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?eae({element:n.current,padding:i}).fn(r):{}:n?eae({element:n,padding:i}).fn(r):{}}}},zLe=(e,t)=>{let r=ILe(e);return{name:r.name,fn:r.fn,options:[e,t]}},GLe=(e,t)=>{let r=RLe(e);return{name:r.name,fn:r.fn,options:[e,t]}},WLe=(e,t)=>({fn:NLe(e).fn,options:[e,t]}),VLe=(e,t)=>{let r=MLe(e);return{name:r.name,fn:r.fn,options:[e,t]}},HLe=(e,t)=>{let r=LLe(e);return{name:r.name,fn:r.fn,options:[e,t]}};var qLe=(e,t)=>{let r=DLe(e);return{name:r.name,fn:r.fn,options:[e,t]}};var YLe=(e,t)=>{let r=Wqt(e);return{name:r.name,fn:r.fn,options:[e,t]}};var jLe=Ue(dt(),1);var nae=Ue(it(),1),Vqt="Arrow",XLe=jLe.forwardRef((e,t)=>{let{children:r,width:n=10,height:i=5,...a}=e;return(0,nae.jsx)(bu.svg,{...a,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,nae.jsx)("polygon",{points:"0,0 30,0 15,10"})})});XLe.displayName=Vqt;var $Le=XLe;var KLe=Ue(dt(),1);function ZLe(e){let[t,r]=KLe.useState(void 0);return Tf(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;let a=i[0],o,s;if("borderBoxSize"in a){let l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=e.offsetWidth,s=e.offsetHeight;r({width:o,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Wb=Ue(it(),1);var iae="Popper",[QLe,aae]=RB(iae),[qqt,JLe]=QLe(iae),eDe=e=>{let{__scopePopper:t,children:r}=e,[n,i]=vh.useState(null);return(0,Wb.jsx)(qqt,{scope:t,anchor:n,onAnchorChange:i,children:r})};eDe.displayName=iae;var tDe="PopperAnchor",rDe=vh.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...i}=e,a=JLe(tDe,r),o=vh.useRef(null),s=gh(t,o);return vh.useEffect(()=>{a.onAnchorChange(n?.current||o.current)}),n?null:(0,Wb.jsx)(bu.div,{...i,ref:s})});rDe.displayName=tDe;var oae="PopperContent",[Yqt,jqt]=QLe(oae),nDe=vh.forwardRef((e,t)=>{let{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,y=JLe(oae,r),[v,b]=vh.useState(null),x=gh(t,Q=>b(Q)),[E,w]=vh.useState(null),T=ZLe(E),C=T?.width??0,S=T?.height??0,R=n+(a!=="center"?"-"+a:""),U=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},L=Array.isArray(u)?u:[u],I=L.length>0,A={padding:U,boundary:L.filter($qt),altBoundary:I},{refs:P,floatingStyles:D,placement:M,isPositioned:O,middlewareData:_}=FLe({strategy:"fixed",placement:R,whileElementsMounted:(...Q)=>Jie(...Q,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[zLe({mainAxis:i+S,alignmentAxis:o}),l&&GLe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?WLe():void 0,...A}),l&&VLe({...A}),HLe({...A,apply:({elements:Q,rects:ge,availableWidth:ie,availableHeight:pe})=>{let{width:ue,height:fe}=ge.reference,Me=Q.floating.style;Me.setProperty("--radix-popper-available-width",`${ie}px`),Me.setProperty("--radix-popper-available-height",`${pe}px`),Me.setProperty("--radix-popper-anchor-width",`${ue}px`),Me.setProperty("--radix-popper-anchor-height",`${fe}px`)}}),E&&YLe({element:E,padding:s}),Kqt({arrowWidth:C,arrowHeight:S}),f&&qLe({strategy:"referenceHidden",...A})]}),[B,F]=oDe(M),G=yh(m);Tf(()=>{O&&G?.()},[O,G]);let z=_.arrow?.x,V=_.arrow?.y,$=_.arrow?.centerOffset!==0,[Z,re]=vh.useState();return Tf(()=>{v&&re(window.getComputedStyle(v).zIndex)},[v]),(0,Wb.jsx)("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:O?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Wb.jsx)(Yqt,{scope:r,placedSide:B,onArrowChange:w,arrowX:z,arrowY:V,shouldHideArrow:$,children:(0,Wb.jsx)(bu.div,{"data-side":B,"data-align":F,...g,ref:x,style:{...g.style,animation:O?void 0:"none"}})})})});nDe.displayName=oae;var iDe="PopperArrow",Xqt={top:"bottom",right:"left",bottom:"top",left:"right"},aDe=vh.forwardRef(function(t,r){let{__scopePopper:n,...i}=t,a=jqt(iDe,n),o=Xqt[a.placedSide];return(0,Wb.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,Wb.jsx)($Le,{...i,ref:r,style:{...i.style,display:"block"}})})});aDe.displayName=iDe;function $qt(e){return e!==null}var Kqt=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,d]=oDe(r),h={start:"0%",center:"50%",end:"100%"}[d],f=(i.arrow?.x??0)+s/2,p=(i.arrow?.y??0)+l/2,m="",g="";return u==="bottom"?(m=o?h:`${f}px`,g=`${-l}px`):u==="top"?(m=o?h:`${f}px`,g=`${n.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=o?h:`${p}px`):u==="left"&&(m=`${n.floating.width+l}px`,g=o?h:`${p}px`),{data:{x:m,y:g}}}});function oDe(e){let[t,r="center"]=e.split("-");return[t,r]}var sDe=eDe,sae=rDe,lDe=nDe,cDe=aDe;var VB=Ue(dt(),1),uDe=Ue(sd(),1);var dDe=Ue(it(),1),Qqt="Portal",lae=VB.forwardRef((e,t)=>{let{container:r,...n}=e,[i,a]=VB.useState(!1);Tf(()=>a(!0),[]);let o=r||i&&globalThis?.document?.body;return o?uDe.default.createPortal((0,dDe.jsx)(bu.div,{...n,ref:t}),o):null});lae.displayName=Qqt;var gd=Ue(dt(),1);var hDe=Ue(dt(),1);function Jqt(e,t){return hDe.useReducer((r,n)=>t[r][n]??r,e)}var qB=e=>{let{present:t,children:r}=e,n=eYt(t),i=typeof r=="function"?r({present:n.isPresent}):gd.Children.only(r),a=gh(n.ref,tYt(i));return typeof r=="function"||n.isPresent?gd.cloneElement(i,{ref:a}):null};qB.displayName="Presence";function eYt(e){let[t,r]=gd.useState(),n=gd.useRef({}),i=gd.useRef(e),a=gd.useRef("none"),o=e?"mounted":"unmounted",[s,l]=Jqt(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return gd.useEffect(()=>{let u=HB(n.current);a.current=s==="mounted"?u:"none"},[s]),Tf(()=>{let u=n.current,d=i.current;if(d!==e){let f=a.current,p=HB(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tf(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,h=p=>{let g=HB(n.current).includes(p.animationName);if(p.target===t&&g&&(l("ANIMATION_END"),!i.current)){let y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(a.current=HB(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:gd.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function HB(e){return e?.animationName||"none"}function tYt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vb=Ue(dt(),1);function fDe({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,i]=rYt({defaultProp:t,onChange:r}),a=e!==void 0,o=a?e:n,s=yh(r),l=Vb.useCallback(u=>{if(a){let h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[a,e,i,s]);return[o,l]}function rYt({defaultProp:e,onChange:t}){let r=Vb.useState(e),[n]=r,i=Vb.useRef(n),a=yh(t);return Vb.useEffect(()=>{i.current!==n&&(a(n),i.current=n)},[n,i,a]),r}var nYt=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},VT=new WeakMap,YB=new WeakMap,jB={},cae=0,pDe=function(e){return e&&(e.host||pDe(e.parentNode))},iYt=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=pDe(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},aYt=function(e,t,r,n){var i=iYt(t,Array.isArray(e)?e:[e]);jB[r]||(jB[r]=new WeakMap);var a=jB[r],o=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),m=p!==null&&p!=="false",g=(VT.get(f)||0)+1,y=(a.get(f)||0)+1;VT.set(f,g),a.set(f,y),o.push(f),g===1&&m&&YB.set(f,!0),y===1&&f.setAttribute(r,"true"),m||f.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return d(t),s.clear(),cae++,function(){o.forEach(function(h){var f=VT.get(h)-1,p=a.get(h)-1;VT.set(h,f),a.set(h,p),f||(YB.has(h)||h.removeAttribute(n),YB.delete(h)),p||h.removeAttribute(r)}),cae--,cae||(VT=new WeakMap,VT=new WeakMap,YB=new WeakMap,jB={})}},mDe=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||nYt(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),aYt(n,i,r,"aria-hidden")):function(){return null}};var yd=function(){return yd=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return hYt;var t=fYt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}};var pYt=QU(),HT="data-scroll-locked",mYt=function(e,t,r,n){var i=e.left,a=e.top,o=e.right,s=e.gap;return r===void 0&&(r="margin"),` - .`.concat(uae,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(s,"px ").concat(n,`; - } - body[`).concat(HT,`] { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(a,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(I5,` { - right: `).concat(s,"px ").concat(n,`; - } - - .`).concat(R5,` { - margin-right: `).concat(s,"px ").concat(n,`; - } - - .`).concat(I5," .").concat(I5,` { - right: 0 `).concat(n,`; - } - - .`).concat(R5," .").concat(R5,` { - margin-right: 0 `).concat(n,`; - } - - body[`).concat(HT,`] { - `).concat(dae,": ").concat(s,`px; - } -`)},CDe=function(){var e=parseInt(document.body.getAttribute(HT)||"0",10);return isFinite(e)?e:0},gYt=function(){qT.useEffect(function(){return document.body.setAttribute(HT,(CDe()+1).toString()),function(){var e=CDe()-1;e<=0?document.body.removeAttribute(HT):document.body.setAttribute(HT,e.toString())}},[])},xae=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;gYt();var a=qT.useMemo(function(){return bae(i)},[i]);return qT.createElement(pYt,{styles:mYt(a,!t,i,r?"":"!important")})};var wae=!1;if(typeof window<"u")try{JU=Object.defineProperty({},"passive",{get:function(){return wae=!0,!0}}),window.addEventListener("test",JU,JU),window.removeEventListener("test",JU,JU)}catch{wae=!1}var JU,M5=wae?{passive:!1}:!1;var yYt=function(e){return e.tagName==="TEXTAREA"},SDe=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!yYt(e)&&r[t]==="visible")},vYt=function(e){return SDe(e,"overflowY")},bYt=function(e){return SDe(e,"overflowX")},Eae=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=ADe(e,n);if(i){var a=UDe(e,n),o=a[1],s=a[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},xYt=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},wYt=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ADe=function(e,t){return e==="v"?vYt(t):bYt(t)},UDe=function(e,t){return e==="v"?xYt(t):wYt(t)},EYt=function(e,t){return e==="h"&&t==="rtl"?-1:1},IDe=function(e,t,r,n,i){var a=EYt(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,l=t.contains(s),u=!1,d=o>0,h=0,f=0;do{if(!s)break;var p=UDe(e,s),m=p[0],g=p[1],y=p[2],v=g-y-a*m;(m||v)&&ADe(e,s)&&(h+=v,f+=m);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&Math.abs(h)<1||!i&&o>h)||!d&&(i&&Math.abs(f)<1||!i&&-o>f))&&(u=!0),u};var QB=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},RDe=function(e){return[e.deltaX,e.deltaY]},MDe=function(e){return e&&"current"in e?e.current:e},TYt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kYt=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},CYt=0,YT=[];function LDe(e){var t=Wa.useRef([]),r=Wa.useRef([0,0]),n=Wa.useRef(),i=Wa.useState(CYt++)[0],a=Wa.useState(QU)[0],o=Wa.useRef(e);Wa.useEffect(function(){o.current=e},[e]),Wa.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=gDe([e.lockRef.current],(e.shards||[]).map(MDe),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=Wa.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var v=QB(g),b=r.current,x="deltaX"in g?g.deltaX:b[0]-v[0],E="deltaY"in g?g.deltaY:b[1]-v[1],w,T=g.target,C=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in g&&C==="h"&&T.type==="range")return!1;var S=window.getSelection(),R=S&&S.anchorNode,U=R?R===T||R.contains(T):!1;if(U)return!1;var L=Eae(C,T);if(!L)return!0;if(L?w=C:(w=C==="v"?"h":"v",L=Eae(C,T)),!L)return!1;if(!n.current&&"changedTouches"in g&&(x||E)&&(n.current=w),!w)return!0;var I=n.current||w;return IDe(I,y,g,I==="h"?x:E,!0)},[]),l=Wa.useCallback(function(g){var y=g;if(!(!YT.length||YT[YT.length-1]!==a)){var v="deltaY"in y?RDe(y):QB(y),b=t.current.filter(function(w){return w.name===y.type&&(w.target===y.target||y.target===w.shadowParent)&&TYt(w.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(MDe).filter(Boolean).filter(function(w){return w.contains(y.target)}),E=x.length>0?s(y,x[0]):!o.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),u=Wa.useCallback(function(g,y,v,b){var x={name:g,delta:y,target:v,should:b,shadowParent:SYt(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),d=Wa.useCallback(function(g){r.current=QB(g),n.current=void 0},[]),h=Wa.useCallback(function(g){u(g.type,RDe(g),g.target,s(g,e.lockRef.current))},[]),f=Wa.useCallback(function(g){u(g.type,QB(g),g.target,s(g,e.lockRef.current))},[]);Wa.useEffect(function(){return YT.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,M5),document.addEventListener("touchmove",l,M5),document.addEventListener("touchstart",d,M5),function(){YT=YT.filter(function(g){return g!==a}),document.removeEventListener("wheel",l,M5),document.removeEventListener("touchmove",l,M5),document.removeEventListener("touchstart",d,M5)}},[]);var p=e.removeScrollBar,m=e.inert;return Wa.createElement(Wa.Fragment,null,m?Wa.createElement(a,{styles:kYt(i)}):null,p?Wa.createElement(xae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function SYt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var DDe=pae(ZB,LDe);var NDe=JB.forwardRef(function(e,t){return JB.createElement(ZU,yd({},e,{ref:t,sideCar:DDe}))});NDe.classNames=ZU.classNames;var Tae=NDe;var ws=Ue(it(),1),kae="Popover",[_De,Otn]=RB(kae,[aae]),e9=aae(),[AYt,Hb]=_De(kae),PDe=e=>{let{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=e9(t),l=ao.useRef(null),[u,d]=ao.useState(!1),[h=!1,f]=fDe({prop:n,defaultProp:i,onChange:a});return(0,ws.jsx)(sDe,{...s,children:(0,ws.jsx)(AYt,{scope:t,contentId:KMe(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:ao.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:ao.useCallback(()=>d(!0),[]),onCustomAnchorRemove:ao.useCallback(()=>d(!1),[]),modal:o,children:r})})};PDe.displayName=kae;var ODe="PopoverAnchor",UYt=ao.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,i=Hb(ODe,r),a=e9(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return ao.useEffect(()=>(o(),()=>s()),[o,s]),(0,ws.jsx)(sae,{...a,...n,ref:t})});UYt.displayName=ODe;var BDe="PopoverTrigger",FDe=ao.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,i=Hb(BDe,r),a=e9(r),o=gh(t,i.triggerRef),s=(0,ws.jsx)(bu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qDe(i.open),...n,ref:o,onClick:Sm(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,ws.jsx)(sae,{asChild:!0,...a,children:s})});FDe.displayName=BDe;var Cae="PopoverPortal",[IYt,RYt]=_De(Cae,{forceMount:void 0}),zDe=e=>{let{__scopePopover:t,forceMount:r,children:n,container:i}=e,a=Hb(Cae,t);return(0,ws.jsx)(IYt,{scope:t,forceMount:r,children:(0,ws.jsx)(qB,{present:r||a.open,children:(0,ws.jsx)(lae,{asChild:!0,container:i,children:n})})})};zDe.displayName=Cae;var jT="PopoverContent",GDe=ao.forwardRef((e,t)=>{let r=RYt(jT,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,a=Hb(jT,e.__scopePopover);return(0,ws.jsx)(qB,{present:n||a.open,children:a.modal?(0,ws.jsx)(MYt,{...i,ref:t}):(0,ws.jsx)(LYt,{...i,ref:t})})});GDe.displayName=jT;var MYt=ao.forwardRef((e,t)=>{let r=Hb(jT,e.__scopePopover),n=ao.useRef(null),i=gh(t,n),a=ao.useRef(!1);return ao.useEffect(()=>{let o=n.current;if(o)return mDe(o)},[]),(0,ws.jsx)(Tae,{as:HU,allowPinchZoom:!0,children:(0,ws.jsx)(WDe,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sm(e.onCloseAutoFocus,o=>{o.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Sm(e.onPointerDownOutside,o=>{let s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,u=s.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Sm(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),LYt=ao.forwardRef((e,t)=>{let r=Hb(jT,e.__scopePopover),n=ao.useRef(!1),i=ao.useRef(!1);return(0,ws.jsx)(WDe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));let o=a.target;r.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),WDe=ao.forwardRef((e,t)=>{let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,f=Hb(jT,r),p=e9(r);return WMe(),(0,ws.jsx)(jie,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,ws.jsx)(Vie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:(0,ws.jsx)(lDe,{"data-state":qDe(f.open),role:"dialog",id:f.contentId,...p,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),VDe="PopoverClose",DYt=ao.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,i=Hb(VDe,r);return(0,ws.jsx)(bu.button,{type:"button",...n,ref:t,onClick:Sm(e.onClick,()=>i.onOpenChange(!1))})});DYt.displayName=VDe;var NYt="PopoverArrow",HDe=ao.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,i=e9(r);return(0,ws.jsx)(cDe,{...i,...n,ref:t})});HDe.displayName=NYt;function qDe(e){return e?"open":"closed"}var qb=PDe;var Yb=FDe,YDe=zDe,XT=GDe;var eF=HDe;Rr();var A7t=Ue(dt(),1),q0=Ue(dt(),1),PK=Ue(dt(),1),U7t=Ue(sd(),1),v3e=Ue(dt(),1),YD=Ue(dt(),1),M7t=Ue(dt(),1),L7t=Ue(dt(),1),D7t=Ue(it(),1);Rr();var o1=Ue(it(),1),N7t=Ue(dt(),1);Rr();var _7t=Ue(dt(),1);Rr();var P7t=Ue(it(),1),$A=Ue(it(),1),nu=Ue(it(),1),Y6=Ue(dt(),1);Rr();var B7t=Ue(it(),1),fw=Ue(it(),1),ap=Ue(it(),1),a7=Ue(dt(),1);var pl=Ue(dt(),1);Rr();var F7t=Ue(dt(),1),zK=Ue(it(),1);Rr();var G7t=Ue(dt(),1),H4e=Ue(it(),1),GK=Ue(it(),1),WK=Ue(dt(),1),VK=Ue(dt(),1),cw=Ue(it(),1),EK=Ue(it(),1),xv=Ue(it(),1);var X7t=Ue(dt(),1),mK=Ue(it(),1),ow=Ue(it(),1),jD=Ue(dt(),1),O6=Ue(it(),1),Ir=Ue(it(),1),Z7t=Ue(dt(),1),Q7t=Ue(it(),1),Z6=Ue(it(),1),e8t=Ue(it(),1),t8t=Ue(dt(),1),XD=Ue(it(),1),HA=Ue(it(),1);Rr();var $D=Ue(it(),1),Zd=Ue(it(),1),C3e=Ue(it(),1),B6=Ue(it(),1),o8t=Ue(dt(),1);Rr();var j4e=Ue(it(),1);Rr();var Jc=Ue(it(),1),Q6=Ue(it(),1),A3e=Ue(it(),1),up=Ue(dt(),1);Rr();var i1=Ue(it(),1),h8t=Ue(it(),1),op=Ue(dt(),1);Rr();var XK=Ue(dt(),1),$K=Ue(dt(),1),p8t=Ue(sd(),1);Rr();var m8t=Ue(dt(),1),KD=Ue(it(),1),ql=Ue(dt(),1),g8t=Ue(dt(),1),KK=Ue(dt(),1),tu=Ue(dt(),1),I3e=Ue(dt(),1);Rr();var R3e=Ue(it(),1),x8t=Ue(it(),1);Rr();var ZK=Ue(it(),1),KA=Ue(dt(),1),QD=Ue(dt(),1),J4e=Ue(sd(),1);Rr();var N6=Ue(it(),1),r7=Ue(it(),1),$h=Ue(dt(),1);ob();var _r=Ue(it(),1);Rr();var T8t=Ue(it(),1),C8t=Ue(it(),1);Rr();var QK=Ue(dt(),1),FD=Ue(it(),1),e3e=Ue(it(),1),I8t=Ue(it(),1),JD=Ue(dt(),1),JK=Ue(it(),1);Rr();var _s=Ue(it(),1),s7=Ue(dt(),1);Rr();var gw=Ue(dt(),1),z6=Ue(it(),1),eZ=Ue(dt(),1),G6=Ue(it(),1),R8t=Ue(dt(),1),M8t=Ue(zE(),1),Xa=Ue(it(),1),rp=Ue(it(),1),aw=Ue(it(),1),u1=Ue(dt(),1);Rr();Rr();var L8t=Ue(it(),1),W6=Ue(it(),1);Rr();var D8t=Ue($De(),1),N8t=Ue(dt(),1);Rr();var tZ=Ue(dt(),1);var t9=Ue(dt());var ZDe={},KDe=e=>{let t,r=new Set,n=(d,h)=>{let f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){let p=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(m=>m(t,p))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(ZDe.env?ZDe.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,i,l);return l},QDe=e=>e?KDe(e):KDe;var cNe=Ue(dt(),1),uNe=Ue(oNe(),1),rF={},{useDebugValue:QYt}=cNe.default,{useSyncExternalStoreWithSelector:JYt}=uNe.default,sNe=!1,ejt=e=>e;function tjt(e,t=ejt,r){(rF.env?rF.env.MODE:void 0)!=="production"&&r&&!sNe&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),sNe=!0);let n=JYt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return QYt(n),n}var lNe=e=>{(rF.env?rF.env.MODE:void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t=typeof e=="function"?QDe(e):e,r=(n,i)=>tjt(t,n,i);return Object.assign(r,t),r},dNe=e=>e?lNe(e):lNe;var hNe,fNe,pNe=typeof window<"u"&&((hNe=window.document)!=null&&hNe.createElement||((fNe=window.navigator)==null?void 0:fNe.product)==="ReactNative")?t9.default.useLayoutEffect:t9.default.useEffect;function Zp(){let e=dNe(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{let r=e(i=>i.set),n=e(i=>i.version);return pNe(()=>{r(i=>({version:i.version+1}))},[]),pNe(()=>(r(({current:i})=>({current:[...i,t]})),()=>r(({current:i})=>({current:i.filter(a=>a!==t)}))),[t,n]),null},Out:()=>{let t=e(r=>r.current);return t9.default.createElement(t9.default.Fragment,null,t)}}}var Fr=Ue(it(),1),z8t=Ue(dt(),1),rZ=Ue(it(),1),Ea=Ue(it(),1),H8t=Ue(it(),1),Y8t=Ue(it(),1),iZ=Ue(dt(),1),D3e=Ue(it(),1),$8t=Ue(it(),1);Rr();var pw=Ue(dt(),1),K8t=Ue(sd(),1),Z8t=Ue(it(),1),Q8t=Ue(dt(),1),vv=Ue(it(),1);Rr();var J8t=Ue(dt(),1),aZ=Ue(dt(),1),ZA=Ue(it(),1),Kd=Ue(dt(),1);Rr();var eN=Ue(it(),1);Rr();var t3e=Ue(it(),1),oZ=Ue(dt(),1);Rr();var _6=Ue(it(),1),l7=Ue(dt(),1),ii=Ue(it(),1);Rr();var tUt=Ue(it(),1),i3e=Ue(it(),1);Rr();var tN=Ue(it(),1),$6=Ue(it(),1);Rr();var nN=Ue(it(),1);Rr();var lUt=Ue(it(),1),Zi=Ue(it(),1);ob();var yw=Ue(dt(),1),uw=Ue(it(),1),uUt=Ue(dt(),1),Nt=Ue(it(),1),P6=Ue(dt(),1);Rr();var Hl=Ue(it(),1),hUt=Ue(dt(),1);ob();var fUt=Ue(it(),1),ml=Ue(it(),1);Rr();var pUt=Ue(it(),1),Xu=Ue(it(),1),Os=Ue(dt(),1),gUt=Ue(dt(),1);Rr();var vUt=Ue(dt(),1),V6=Ue(it(),1);Rr();Rr();var H6=Ue(it(),1);function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;tm,Object.values(m));return(0,Qp.createElement)(g.Provider,{value:y},p)}function d(h,f){let p=f?.[e][l]||s,m=(0,Qp.useContext)(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}let i=()=>{let a=r.map(o=>(0,Qp.createContext)(o));return function(s){let l=s?.[e]||a;return(0,Qp.useMemo)(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,rjt(i,...t)]}function rjt(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){let o=n.reduce((s,{useScope:l,scopeName:u})=>{let h=l(a)[`__scope${u}`];return{...s,...h}},{});return(0,Qp.useMemo)(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Aa=Ue(dt());function L5(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}var e0=Ue(dt());var Jp=Ue(dt());function gNe(e,t=[]){let r=[];function n(a,o){let s=(0,Jp.createContext)(o),l=r.length;r=[...r,o];function u(h){let{scope:f,children:p,...m}=h,g=f?.[e][l]||s,y=(0,Jp.useMemo)(()=>m,Object.values(m));return(0,Jp.createElement)(g.Provider,{value:y},p)}function d(h,f){let p=f?.[e][l]||s,m=(0,Jp.useContext)(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}let i=()=>{let a=r.map(o=>(0,Jp.createContext)(o));return function(s){let l=s?.[e]||a;return(0,Jp.useMemo)(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,njt(i,...t)]}function njt(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){let o=n.reduce((s,{useScope:l,scopeName:u})=>{let h=l(a)[`__scope${u}`];return{...s,...h}},{});return(0,Jp.useMemo)(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var yNe=Ue(dt());function ijt(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Aae(...e){return t=>e.forEach(r=>ijt(r,t))}function Uae(...e){return(0,yNe.useCallback)(Aae(...e),e)}var Eo=Ue(dt());var iF=(0,Eo.forwardRef)((e,t)=>{let{children:r,...n}=e,i=Eo.Children.toArray(r),a=i.find(ojt);if(a){let o=a.props.children,s=i.map(l=>l===a?Eo.Children.count(o)>1?Eo.Children.only(null):(0,Eo.isValidElement)(o)?o.props.children:null:l);return(0,Eo.createElement)(Iae,Sa({},n,{ref:t}),(0,Eo.isValidElement)(o)?(0,Eo.cloneElement)(o,void 0,s):null)}return(0,Eo.createElement)(Iae,Sa({},n,{ref:t}),r)});iF.displayName="Slot";var Iae=(0,Eo.forwardRef)((e,t)=>{let{children:r,...n}=e;return(0,Eo.isValidElement)(r)?(0,Eo.cloneElement)(r,{...sjt(n,r.props),ref:Aae(t,r.ref)}):Eo.Children.count(r)>1?Eo.Children.only(null):null});Iae.displayName="SlotClone";var ajt=({children:e})=>(0,Eo.createElement)(Eo.Fragment,null,e);function ojt(e){return(0,Eo.isValidElement)(e)&&e.type===ajt}function sjt(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{a(...s),i(...s)}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function vNe(e){let t=e+"CollectionProvider",[r,n]=gNe(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{let{scope:m,children:g}=p,y=e0.default.useRef(null),v=e0.default.useRef(new Map).current;return e0.default.createElement(i,{scope:m,itemMap:v,collectionRef:y},g)},s=e+"CollectionSlot",l=e0.default.forwardRef((p,m)=>{let{scope:g,children:y}=p,v=a(s,g),b=Uae(m,v.collectionRef);return e0.default.createElement(iF,{ref:b},y)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=e0.default.forwardRef((p,m)=>{let{scope:g,children:y,...v}=p,b=e0.default.useRef(null),x=Uae(m,b),E=a(u,g);return e0.default.useEffect(()=>(E.itemMap.set(b,{ref:b,...v}),()=>{E.itemMap.delete(b)})),e0.default.createElement(iF,{[d]:"",ref:x},y)});function f(p){let m=a(e+"CollectionConsumer",p);return e0.default.useCallback(()=>{let y=m.collectionRef.current;if(!y)return[];let v=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((E,w)=>v.indexOf(E.ref.current)-v.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},f,n]}var bNe=Ue(dt());function ljt(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Rae(...e){return t=>e.forEach(r=>ljt(r,t))}function xNe(...e){return(0,bNe.useCallback)(Rae(...e),e)}var t0=Ue(dt());function wNe(e,t=[]){let r=[];function n(a,o){let s=(0,t0.createContext)(o),l=r.length;r=[...r,o];function u(h){let{scope:f,children:p,...m}=h,g=f?.[e][l]||s,y=(0,t0.useMemo)(()=>m,Object.values(m));return(0,t0.createElement)(g.Provider,{value:y},p)}function d(h,f){let p=f?.[e][l]||s,m=(0,t0.useContext)(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}let i=()=>{let a=r.map(o=>(0,t0.createContext)(o));return function(s){let l=s?.[e]||a;return(0,t0.useMemo)(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,cjt(i,...t)]}function cjt(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){let o=n.reduce((s,{useScope:l,scopeName:u})=>{let h=l(a)[`__scope${u}`];return{...s,...h}},{});return(0,t0.useMemo)(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var aF=Ue(dt());var ENe=Ue(dt()),TNe=globalThis?.document?ENe.useLayoutEffect:()=>{};var ujt=aF.useId||(()=>{}),djt=0;function kNe(e){let[t,r]=aF.useState(ujt());return TNe(()=>{e||r(n=>n??String(djt++))},[e]),e||(t?`radix-${t}`:"")}var ZT=Ue(dt()),mjt=Ue(sd());var To=Ue(dt());var Lae=(0,To.forwardRef)((e,t)=>{let{children:r,...n}=e,i=To.Children.toArray(r),a=i.find(fjt);if(a){let o=a.props.children,s=i.map(l=>l===a?To.Children.count(o)>1?To.Children.only(null):(0,To.isValidElement)(o)?o.props.children:null:l);return(0,To.createElement)(Mae,Sa({},n,{ref:t}),(0,To.isValidElement)(o)?(0,To.cloneElement)(o,void 0,s):null)}return(0,To.createElement)(Mae,Sa({},n,{ref:t}),r)});Lae.displayName="Slot";var Mae=(0,To.forwardRef)((e,t)=>{let{children:r,...n}=e;return(0,To.isValidElement)(r)?(0,To.cloneElement)(r,{...pjt(n,r.props),ref:Rae(t,r.ref)}):To.Children.count(r)>1?To.Children.only(null):null});Mae.displayName="SlotClone";var hjt=({children:e})=>(0,To.createElement)(To.Fragment,null,e);function fjt(e){return(0,To.isValidElement)(e)&&e.type===hjt}function pjt(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{a(...s),i(...s)}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}var gjt=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Dae=gjt.reduce((e,t)=>{let r=(0,ZT.forwardRef)((n,i)=>{let{asChild:a,...o}=n,s=a?Lae:t;return(0,ZT.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,ZT.createElement)(s,Sa({},o,{ref:i}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var QT=Ue(dt());function r9(e){let t=(0,QT.useRef)(e);return(0,QT.useEffect)(()=>{t.current=e}),(0,QT.useMemo)(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}var jb=Ue(dt());function CNe({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,i]=yjt({defaultProp:t,onChange:r}),a=e!==void 0,o=a?e:n,s=r9(r),l=(0,jb.useCallback)(u=>{if(a){let h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[a,e,i,s]);return[o,l]}function yjt({defaultProp:e,onChange:t}){let r=(0,jb.useState)(e),[n]=r,i=(0,jb.useRef)(n),a=r9(t);return(0,jb.useEffect)(()=>{i.current!==n&&(a(n),i.current=n)},[n,i,a]),r}var n9=Ue(dt()),vjt=(0,n9.createContext)(void 0);function oF(e){let t=(0,n9.useContext)(vjt);return e||t||"ltr"}var Nae="rovingFocusGroup.onEntryFocus",bjt={bubbles:!1,cancelable:!0},Pae="RovingFocusGroup",[_ae,SNe,xjt]=vNe(Pae),[wjt,Oae]=wNe(Pae,[xjt]),[Ejt,Tjt]=wjt(Pae),kjt=(0,Aa.forwardRef)((e,t)=>(0,Aa.createElement)(_ae.Provider,{scope:e.__scopeRovingFocusGroup},(0,Aa.createElement)(_ae.Slot,{scope:e.__scopeRovingFocusGroup},(0,Aa.createElement)(Cjt,Sa({},e,{ref:t}))))),Cjt=(0,Aa.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=(0,Aa.useRef)(null),f=xNe(t,h),p=oF(a),[m=null,g]=CNe({prop:o,defaultProp:s,onChange:l}),[y,v]=(0,Aa.useState)(!1),b=r9(u),x=SNe(r),E=(0,Aa.useRef)(!1),[w,T]=(0,Aa.useState)(0);return(0,Aa.useEffect)(()=>{let C=h.current;if(C)return C.addEventListener(Nae,b),()=>C.removeEventListener(Nae,b)},[b]),(0,Aa.createElement)(Ejt,{scope:r,orientation:n,dir:p,loop:i,currentTabStopId:m,onItemFocus:(0,Aa.useCallback)(C=>g(C),[g]),onItemShiftTab:(0,Aa.useCallback)(()=>v(!0),[]),onFocusableItemAdd:(0,Aa.useCallback)(()=>T(C=>C+1),[]),onFocusableItemRemove:(0,Aa.useCallback)(()=>T(C=>C-1),[])},(0,Aa.createElement)(Dae.div,Sa({tabIndex:y||w===0?-1:0,"data-orientation":n},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:L5(e.onMouseDown,()=>{E.current=!0}),onFocus:L5(e.onFocus,C=>{let S=!E.current;if(C.target===C.currentTarget&&S&&!y){let R=new CustomEvent(Nae,bjt);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){let U=x().filter(D=>D.focusable),L=U.find(D=>D.active),I=U.find(D=>D.id===m),P=[L,I,...U].filter(Boolean).map(D=>D.ref.current);ANe(P)}}E.current=!1}),onBlur:L5(e.onBlur,()=>v(!1))})))}),Sjt="RovingFocusGroupItem",Ajt=(0,Aa.forwardRef)((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:a,...o}=e,s=kNe(),l=a||s,u=Tjt(Sjt,r),d=u.currentTabStopId===l,h=SNe(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return(0,Aa.useEffect)(()=>{if(n)return f(),()=>p()},[n,f,p]),(0,Aa.createElement)(_ae.ItemSlot,{scope:r,id:l,focusable:n,active:i},(0,Aa.createElement)(Dae.span,Sa({tabIndex:d?0:-1,"data-orientation":u.orientation},o,{ref:t,onMouseDown:L5(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:L5(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:L5(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;let g=Rjt(m,u.orientation,u.dir);if(g!==void 0){m.preventDefault();let v=h().filter(b=>b.focusable).map(b=>b.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();let b=v.indexOf(m.currentTarget);v=u.loop?Mjt(v,b+1):v.slice(b+1)}setTimeout(()=>ANe(v))}})})))}),Ujt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ijt(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Rjt(e,t,r){let n=Ijt(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ujt[n]}function ANe(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Mjt(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var UNe=kjt,INe=Ajt;var Nc=Ue(dt()),DNe=Ue(sd());var RNe=Ue(dt());function Ljt(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bae(...e){return t=>e.forEach(r=>Ljt(r,t))}function MNe(...e){return(0,RNe.useCallback)(Bae(...e),e)}var LNe=Ue(dt()),i9=globalThis?.document?LNe.useLayoutEffect:()=>{};function Djt(e,t){return(0,Nc.useReducer)((r,n)=>{let i=t[r][n];return i??r},e)}var Fae=e=>{let{present:t,children:r}=e,n=Njt(t),i=typeof r=="function"?r({present:n.isPresent}):Nc.Children.only(r),a=MNe(n.ref,i.ref);return typeof r=="function"||n.isPresent?(0,Nc.cloneElement)(i,{ref:a}):null};Fae.displayName="Presence";function Njt(e){let[t,r]=(0,Nc.useState)(),n=(0,Nc.useRef)({}),i=(0,Nc.useRef)(e),a=(0,Nc.useRef)("none"),o=e?"mounted":"unmounted",[s,l]=Djt(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,Nc.useEffect)(()=>{let u=sF(n.current);a.current=s==="mounted"?u:"none"},[s]),i9(()=>{let u=n.current,d=i.current;if(d!==e){let f=a.current,p=sF(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),i9(()=>{if(t){let u=h=>{let p=sF(n.current).includes(h.animationName);h.target===t&&p&&(0,DNe.flushSync)(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(a.current=sF(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:(0,Nc.useCallback)(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function sF(e){return e?.animationName||"none"}var JT=Ue(dt()),Bjt=Ue(sd());var ko=Ue(dt());var Gae=(0,ko.forwardRef)((e,t)=>{let{children:r,...n}=e,i=ko.Children.toArray(r),a=i.find(Pjt);if(a){let o=a.props.children,s=i.map(l=>l===a?ko.Children.count(o)>1?ko.Children.only(null):(0,ko.isValidElement)(o)?o.props.children:null:l);return(0,ko.createElement)(zae,Sa({},n,{ref:t}),(0,ko.isValidElement)(o)?(0,ko.cloneElement)(o,void 0,s):null)}return(0,ko.createElement)(zae,Sa({},n,{ref:t}),r)});Gae.displayName="Slot";var zae=(0,ko.forwardRef)((e,t)=>{let{children:r,...n}=e;return(0,ko.isValidElement)(r)?(0,ko.cloneElement)(r,{...Ojt(n,r.props),ref:Bae(t,r.ref)}):ko.Children.count(r)>1?ko.Children.only(null):null});zae.displayName="SlotClone";var _jt=({children:e})=>(0,ko.createElement)(ko.Fragment,null,e);function Pjt(e){return(0,ko.isValidElement)(e)&&e.type===_jt}function Ojt(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{a(...s),i(...s)}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}var Fjt=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],a9=Fjt.reduce((e,t)=>{let r=(0,JT.forwardRef)((n,i)=>{let{asChild:a,...o}=n,s=a?Gae:t;return(0,JT.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,JT.createElement)(s,Sa({},o,{ref:i}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Xb=Ue(dt());var ek=Ue(dt());function Wae(e){let t=(0,ek.useRef)(e);return(0,ek.useEffect)(()=>{t.current=e}),(0,ek.useMemo)(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function NNe({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,i]=zjt({defaultProp:t,onChange:r}),a=e!==void 0,o=a?e:n,s=Wae(r),l=(0,Xb.useCallback)(u=>{if(a){let h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[a,e,i,s]);return[o,l]}function zjt({defaultProp:e,onChange:t}){let r=(0,Xb.useState)(e),[n]=r,i=(0,Xb.useRef)(n),a=Wae(t);return(0,Xb.useEffect)(()=>{i.current!==n&&(a(n),i.current=n)},[n,i,a]),r}var lF=Ue(dt());var Gjt=lF.useId||(()=>{}),Wjt=0;function _Ne(e){let[t,r]=lF.useState(Gjt());return i9(()=>{e||r(n=>n??String(Wjt++))},[e]),e||(t?`radix-${t}`:"")}var PNe="Tabs",[Vjt,inn]=mNe(PNe,[Oae]),ONe=Oae(),[Hjt,Vae]=Vjt(PNe),qjt=(0,Cl.forwardRef)((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:s,activationMode:l="automatic",...u}=e,d=oF(s),[h,f]=NNe({prop:n,onChange:i,defaultProp:a});return(0,Cl.createElement)(Hjt,{scope:r,baseId:_Ne(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:l},(0,Cl.createElement)(a9.div,Sa({dir:d,"data-orientation":o},u,{ref:t})))}),Yjt="TabsList",jjt=(0,Cl.forwardRef)((e,t)=>{let{__scopeTabs:r,loop:n=!0,...i}=e,a=Vae(Yjt,r),o=ONe(r);return(0,Cl.createElement)(UNe,Sa({asChild:!0},o,{orientation:a.orientation,dir:a.dir,loop:n}),(0,Cl.createElement)(a9.div,Sa({role:"tablist","aria-orientation":a.orientation},i,{ref:t})))}),Xjt="TabsTrigger",$jt=(0,Cl.forwardRef)((e,t)=>{let{__scopeTabs:r,value:n,disabled:i=!1,...a}=e,o=Vae(Xjt,r),s=ONe(r),l=BNe(o.baseId,n),u=FNe(o.baseId,n),d=n===o.value;return(0,Cl.createElement)(INe,Sa({asChild:!0},s,{focusable:!i,active:d}),(0,Cl.createElement)(a9.button,Sa({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},a,{ref:t,onMouseDown:nF(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:nF(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:nF(e.onFocus,()=>{let h=o.activationMode!=="manual";!d&&!i&&h&&o.onValueChange(n)})})))}),Kjt="TabsContent",Zjt=(0,Cl.forwardRef)((e,t)=>{let{__scopeTabs:r,value:n,forceMount:i,children:a,...o}=e,s=Vae(Kjt,r),l=BNe(s.baseId,n),u=FNe(s.baseId,n),d=n===s.value,h=(0,Cl.useRef)(d);return(0,Cl.useEffect)(()=>{let f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),(0,Cl.createElement)(Fae,{present:i||d},({present:f})=>(0,Cl.createElement)(a9.div,Sa({"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0},o,{ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0}}),f&&a))});function BNe(e,t){return`${e}-trigger-${t}`}function FNe(e,t){return`${e}-content-${t}`}var cF=qjt,uF=jjt,dF=$jt,hF=Zjt;var wUt=Ue(it(),1);var a3e=Ue(it(),1);var kUt=Ue(it(),1);var SUt=Ue(it(),1),o3e=Ue(it(),1),UUt=Ue(dt(),1);Rr();var Ev=Ue(it(),1),Ka=Ue(it(),1),sZ=Ue(dt(),1),qUt=Ue(it(),1),wv=Ue(it(),1),Tv=Ue(it(),1),tp=Ue(it(),1);Rr();var wc=Ue(dt(),1),YUt=Ue(VNe(),1);Rr();var es=Ue(it(),1),$u=Ue(it(),1),XUt=Ue(dt(),1);Rr();var iN=Ue(it(),1),X0=Ue(dt(),1),JUt=Ue(it(),1);Rr();var a1=Ue(it(),1),aN=Ue(dt(),1),t9t=Ue(it(),1),dw=Ue(it(),1),oN=Ue(it(),1),eu=Ue(it(),1);var s3e=Ue(dt(),1),a9t=Ue(it(),1),V0=Ue(dt(),1);var s9t=Ue(it(),1);var l3e=Ue(it(),1);var c9t=Ue(it(),1),$a=Ue(it(),1),j0=Ue(dt(),1),u9t=Ue(zE(),1),l1=Ue(dt(),1);Rr();var e7=Ue(it(),1),d9t=Ue(it(),1),h9t=Ue(it(),1),f9t=Ue(it(),1),p9t=Ue(dt(),1),m9t=Ue(it(),1),g9t=Ue(it(),1),y9t=Ue(it(),1),v9t=Ue(it(),1),b9t=Ue(dt(),1),x9t=Ue(it(),1),w9t=Ue(it(),1);Rr();var fr=Ue(it(),1),mw=Ue(dt(),1),np=Ue(it(),1),dr=Ue(it(),1),c7=Ue(dt(),1),lN=Ue(it(),1),E9t=Ue(zE(),1),Qc=Ue(it(),1),u7=Ue(dt(),1),F3e=Ue(sd(),1),k9t=Ue(dt(),1);ob();var R9t=Ue(it(),1),K6=Ue(dt(),1),M9t=Ue(it(),1),lZ=Ue(dt(),1),f3e=Ue(it(),1),L9t=Ue(it(),1);Rr();var cN=Ue(it(),1),q6=Ue(it(),1);function mXt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var gXt={};mXt(gXt,"LaserPointer",()=>s9);function Fo([e,t,r],[n,i,a]){return[e+n,t+i,r+a]}function o9([e,t,r],[n,i,a]){return[e-n,t-i,r-a]}function Es([e,t,r],n){return[e*n,t*n,r*n]}function tk([e,t,r]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),r]}function _c([e,t,r],n){return[Math.cos(n)*e-Math.sin(n)*t,Math.sin(n)*e+Math.cos(n)*t,r]}function yXt(e,t,r){return Fo(e,Es(o9(t,e),r))}function HNe(e,t,r){return Math.atan2(r[1]-e[1],r[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function qNe(e){return Math.atan2(Math.sin(e),Math.cos(e))}function YNe([e,t]){return Math.sqrt(e**2+t**2)}function rk([e,t],[r,n]){return Math.sqrt((r-e)**2+(n-t)**2)}function vXt(e){if(e.length<2)return 0;let t=0;for(let r=1;r<=e.length-1;r++)t+=rk(e[r-1],e[r]);return t+=rk(e[e.length-2],e[e.length-1]),t}var bXt=(e,t,r)=>Math.max(t,Math.min(r,e));function xXt(e,t,r){let n=rk(t,r);if(n===0)return rk(e,t);let i=bXt(((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n**2,0,1),a=[t[0]+i*(r[0]-t[0]),t[1]+i*(r[1]-t[1]),e[2]];return rk(a,e)}function fF(e,t){if(t===0||e.length<=2)return e;let r=e[0],n=e[e.length-1],[i,a]=e.reduce(([o,s],l,u)=>{let d=xXt(l,r,n);return d>o?[d,u]:[o,s]},[0,-1]);if(i>=t){let o=e[a];return[...fF([r,...e.slice(1,a),o],t).slice(0,-1),o,...fF([o,...e.slice(a,-1),n],t).slice(1)]}else return[r,n]}var s9=class e{static{this.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1}}static{this.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50}}constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},e.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){let r=this.originalPoints[this.originalPoints.length-1];if(!(r&&r[0]===t[0]&&r[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=yXt(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),vXt(this.tailPoints)>e.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,r,n,i,a){return(t??this.options.size)*this.options.sizeMapping({pressure:r,runningLength:a,currentIndex:n,totalLength:i})}getStrokeOutline(t){if(this.isFresh)return[];let r=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(r=fF(r,this.options.simplify));let n=r.length;if(n===0)return[];if(n===1){let C=r[0],S=this.getSize(t,C[2],0,n,0);if(S<.5)return[];let R=[];for(let U=0;U<=Math.PI*2;U+=Math.PI/16)R.push(Fo(C,Es(_c([1,0,0],U),S)));return R.push(Fo(C,Es([1,0,0],this.getSize(t,C[2],0,n,0)))),R}if(n===2){let C=r[0],S=r[1],R=this.getSize(t,C[2],0,n,0),U=this.getSize(t,S[2],0,n,0);if(R<.5||U<.5)return[];let L=[],I=HNe(C,[C[0],C[1]-100,C[2]],S);for(let A=I;A<=Math.PI+I;A+=Math.PI/16)L.push(Fo(C,Es(_c([1,0,0],A),R)));for(let A=Math.PI+I;A<=Math.PI*2+I;A+=Math.PI/16)L.push(Fo(S,Es(_c([1,0,0],A),U)));return L.push(L[0]),L}let i=[],a=[],o=0,s=0,l=0,u=0;for(let C=1;C=0;ue-=pe/4)a.push(Fo(R,_c(Es(M,A),ue)));a.push(Q,z)}else{i.push(F,re);for(let ue=0;ue<=pe;ue+=pe/4)a.push(Fo(R,_c(Es(M,-A),-ue)));for(let ue=pe;ue>=0;ue-=pe/4)i.push(Fo(R,_c(Es(M,-A),-ue)));i.push(re,V)}}else i.push(re),a.push(Q);s=o}if(l>=n-2)if(this.options.keepHead){let C=r[n-1],S=[];for(let R=0;R<=Math.PI*2;R+=Math.PI/16)S.push(Fo(C,Es(_c([1,0,0],R),this.options.size)));return S.push(Fo(C,Es([1,0,0],this.options.size))),S}else return[];let d=r[l],h=r[l+1],f=r[n-2],p=r[n-1],m=tk(o9(h,d)),g=tk(o9(f,p)),y=_c(m,-Math.PI/2),v=_c(g,Math.PI/2),b=this.getSize(t,d[2],0,n,0),x=[],E=this.options.keepHead?this.options.size:this.getSize(t,f[2],n-2,n,u),w=[];if(b>1){for(let C=0;C<=Math.PI;C+=Math.PI/16)x.unshift(Fo(d,_c(Es(y,b),-C)));x.unshift(Fo(d,Es(y,-b)))}else x.push(d);for(let C=0;C<=Math.PI*3;C+=Math.PI/16)w.push(Fo(p,_c(Es(v,-E),-C)));let T=[...x,...i,...w.reverse(),...a.reverse()];return x.length>0&&T.push(x[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?fF(T,this.options.simplify):T}};var cZ=Ue(dt(),1),N9t=Ue(it(),1),Xn=Ue(it(),1);Rr();var m3e=Ue(it(),1),lp=Ue(it(),1),ma=Ue(it(),1),$0=Ue(it(),1),G0=Ue(it(),1);Rr();var hZ=Ue(it(),1),G9t=Ue(zE(),1),uN=Ue(it(),1),C$r=Ue(dt(),1),xK=Ue(it(),1),i7t=IB(),{useAtom:No,useSetAtom:RK,useAtomValue:a7t,useStore:Jqn}=i7t,fVr=i7t.Provider,W0=PT(),pVr=Fke({"./locales/ar-SA.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/az-AZ.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/bg-BG.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/bn-BD.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ca-ES.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/cs-CZ.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/da-DK.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/de-DE.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/el-GR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/en.json":()=>Promise.resolve().then(()=>(XNe(),jNe)),"./locales/es-ES.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/eu-ES.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/fa-IR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/fi-FI.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/fr-FR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/gl-ES.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/he-IL.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/hi-IN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/hu-HU.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/id-ID.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/it-IT.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ja-JP.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/kaa.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/kab-KAB.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/kk-KZ.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/km-KH.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ko-KR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ku-TR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/lt-LT.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/lv-LV.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/mr-IN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/my-MM.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/nb-NO.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/nl-NL.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/nn-NO.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/oc-FR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/pa-IN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/percentages.json":()=>Promise.resolve().then(()=>(KNe(),$Ne)),"./locales/pl-PL.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/pt-BR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/pt-PT.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ro-RO.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ru-RU.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/si-LK.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/sk-SK.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/sl-SI.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/sv-SE.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/ta-IN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/th-TH.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/tr-TR.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/uk-UA.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/vi-VN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/zh-CN.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/zh-HK.json":()=>Promise.resolve().then(()=>(jr(),Yr)),"./locales/zh-TW.json":()=>Promise.resolve().then(()=>(jr(),Yr))}),mVr=85,n7={code:"en",label:"English"},g3e=[n7,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>kB[e.code]>=mVr).sort((e,t)=>e.label>t.label?1:-1)],wK="__test__";en.DEV&&g3e.unshift({code:wK,label:"test language"},{code:`${wK}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var VA=n7,dK={},o7t=async e=>{if(VA=e,document.documentElement.dir=VA.rtl?"rtl":"ltr",document.documentElement.lang=VA.code,e.code.startsWith(wK))dK={};else try{dK=await pVr(`./locales/${VA.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),dK=zU}W0.set(s7t,e.code)},qD=()=>VA,YSt=(e,t)=>{for(let r=0;r{if(VA.code.startsWith(wK))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),i=YSt(dK,n)||YSt(zU,n)||r;if(i===void 0){let a=`Can't find translation for ${e}`;if(en.PROD)return console.warn(a),"";throw new Error(a)}if(t)for(let a in t)i=i.replace(`{{${a}}}`,String(t[a]));return i},s7t=bs(n7.code),au=()=>{let e=a7t(s7t);return{t:ce,langCode:e}},gVr=({size:e="1em",circleWidth:t=8,synchronized:r=!1,className:n=""})=>{let i=-(l7t.default.useRef(Date.now()).current%1600);return(0,hK.jsx)("div",{className:`Spinner ${n}`,children:(0,hK.jsx)("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":r?`${i}ms`:0},children:(0,hK.jsx)("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},kv=gVr,c7t=({delay:e,theme:t})=>{let[r,n]=(0,MK.useState)(!!e);return(0,MK.useEffect)(()=>{if(!e)return;let i=setTimeout(()=>{n(!1)},e);return()=>clearTimeout(i)},[e]),r?null:(0,qA.jsxs)("div",{className:St("LoadingMessage",{"LoadingMessage--dark":t===Gn.DARK}),children:[(0,qA.jsx)("div",{children:(0,qA.jsx)(kv,{})}),(0,qA.jsx)("div",{className:"LoadingMessage-text",children:ce("labels.loadingScene")})]})},yVr=e=>{let[t,r]=(0,IK.useState)(!0);return(0,IK.useEffect)(()=>{let n=async()=>{await o7t(i),r(!1)},i=g3e.find(a=>a.code===e.langCode)||n7;n()},[e.langCode]),t?(0,u7t.jsx)(c7t,{theme:e.theme}):e.children},Qn=H0.default.forwardRef(({size:e="medium",visible:t=!0,className:r="",...n},i)=>{let{id:a}=h1(),o=H0.default.useRef(null);H0.default.useImperativeHandle(i,()=>o.current);let s=`ToolIcon_size_${e}`,[l,u]=(0,H0.useState)(!1),d=(0,H0.useRef)(!0),h=async p=>{let m="onClick"in n&&n.onClick?.(p);if(yT(m))try{u(!0),await m}catch(g){if(g instanceof EU)console.warn(g);else throw g}finally{d.current&&u(!1)}};(0,H0.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=(0,H0.useRef)(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let p=n.type==="icon"?"button":n.type;return(0,ip.jsxs)("button",{className:St("ToolIcon_type_button",s,r,t&&!n.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!n.hidden,"ToolIcon--selected":n.selected,"ToolIcon--plain":n.type==="icon"}),style:n.style,"data-testid":n["data-testid"],hidden:n.hidden,title:n.title,"aria-label":n["aria-label"],type:p,onClick:h,ref:o,disabled:l||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&(0,ip.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&(0,ip.jsx)("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&(0,ip.jsx)(kv,{})]}),n.showAriaLabel&&(0,ip.jsxs)("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&(0,ip.jsx)(kv,{})]}),n.children]})}return(0,ip.jsxs)("label",{className:St("ToolIcon",r),title:n.title,onPointerDown:p=>{f.current=p.pointerType||null,n.onPointerDown?.({pointerType:p.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{f.current=null})},children:[(0,ip.jsx)("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${a}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:f.current})},checked:n.checked,ref:o}),(0,ip.jsxs)("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&(0,ip.jsx)("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});Qn.displayName="ToolButton";var vVr=(e,t,r)=>{let n=new Set(Un(e.filter(d=>qr(d)),t).map(d=>d.id)),i={},a=r.scene.getNonDeletedElementsMap(),o=new Set;for(let d of n){let h=Yp(e,d);for(let f of h)if(!o.has(f.id)){if(ga(f)){let p=$s(f,a);p&&(i[p.id]=!0)}else i[f.id]=!0;o.add(f.id)}}let s=!0,l=e.map(d=>{if(t.selectedElementIds[d.id]){let h=ga(d)?$s(d,a):null;return d.frameId&&n.has(d.frameId)?(s=!1,i[d.id]=!0,d):h?.frameId&&n.has(h?.frameId)?d:(d.boundElements&&d.boundElements.forEach(f=>{let p=r.scene.getNonDeletedElementsMap().get(f.id);p&&ar(p)&&(kt(p,{startBinding:d.id===p.startBinding?.elementId?null:p.startBinding,endBinding:d.id===p.endBinding?.elementId?null:p.endBinding}),kt(p,{points:p.points}))}),Tn(d,{isDeleted:!0}))}return d.frameId&&n.has(d.frameId)?(s=!1,ga(d)||(i[d.id]=!0),Tn(d,{frameId:null})):ga(d)&&t.selectedElementIds[d.containerId]?Tn(d,{isDeleted:!0}):d}),u=t.editingGroupId;if(s&&t.editingGroupId){let d=ya(l,t.editingGroupId).filter(h=>!h.isDeleted);if(d.length>1)d[0]&&(i[d[0].id]=!0);else{u=null,d[0]&&(i[d[0].id]=!0);let h=d[0];if(h){let f=h.groupIds.findIndex(m=>m===t.editingGroupId),p=h.groupIds[f+1];if(p){let m=ya(l,p).filter(g=>!g.isDeleted);m.length>1&&(u=p,m.forEach(g=>{i[g.id]=!0}))}}}}return{elements:l,appState:{...t,...Rc({selectedElementIds:i,editingGroupId:u},l,t,null)}}},jSt=(e,t)=>{if(e.editingGroupId){let r=ya(zi(t),e.editingGroupId);if(r.length)return{...e,selectedElementIds:{[r[0].id]:!0}}}return e},h7t=jt({name:"deleteSelectedElements",label:"labels.delete",icon:Db,trackEvent:{category:"element",action:"delete"},perform:(e,t,r,n)=>{if(t.editingLinearElement){let{elementId:o,selectedPointsIndices:s,startBindingElement:l,endBindingElement:u}=t.editingLinearElement,d=n.scene.getNonDeletedElementsMap(),h=rr.getElement(o,d);if(!h||s==null)return!1;if(h.points.length<2){let p=e.map(g=>g.id===h.id?Tn(g,{isDeleted:!0}):g),m=jSt(t,p);return{elements:p,appState:{...m,editingLinearElement:null},captureUpdate:pt.IMMEDIATELY}}let f={startBindingElement:s?.includes(0)?null:l,endBindingElement:s?.includes(h.points.length-1)?null:u};return rr.deletePoints(h,s),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...f,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:pt.IMMEDIATELY}}let{elements:i,appState:a}=vVr(e,t,n);return Dre(i,i.filter(o=>o.isDeleted)),a=jSt(a,i),{elements:i,appState:{...a,activeTool:Bo(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:ss(zi(e),t)?pt.IMMEDIATELY:pt.EVENTUALLY}},keyTest:(e,t,r)=>(e.key===qe.BACKSPACE||e.key===qe.DELETE)&&!e[qe.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:r})=>(0,d7t.jsx)(Qn,{type:"button",icon:Db,title:ce("labels.delete"),"aria-label":ce("labels.delete"),onClick:()=>r(null),visible:ss(zi(e),t)})}),G4e=(e,t)=>e.frameId===t||e.id===t,f7t=(e,t,r)=>{let n=[],i=[],a=null,o=-1,s=Hr(r||Un(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++o{let t=0;return e.reduce((r,n,i)=>(i>0&&e[i-1]!==n-1&&(t=++t),(r[t]||(r[t]=[])).push(n),r),[])},XSt=(e,t,r)=>{if("containerId"in e&&e.containerId){let n=vm.getScene(e).getElement(e.containerId);if(n)return r==="left"?Math.min(t.indexOf(n),t.indexOf(e)):Math.max(t.indexOf(n),t.indexOf(e))}else{let n=e.boundElements?.find(i=>i.type!=="arrow")?.id;if(n){let i=vm.getScene(e).getElement(n);if(i)return r==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}}},xVr=(e,t)=>{let r=-1,n=-1;return e.forEach((i,a)=>{G4e(i,t)&&(r===-1&&(r=a),n=a)}),r===-1?[]:e.slice(r,n+1)},wVr=(e,t,r,n,i)=>{let a=t[r],o=h=>h.isDeleted?!1:i?h.frameId===i:e.editingGroupId?h.groupIds.includes(e.editingGroupId):!0,s=n==="left"?Ib(t,h=>o(h),Math.max(0,r-1)):Cte(t,h=>o(h),r+1),l=t[s];if(!l)return-1;if(e.editingGroupId){if(a?.groupIds.join("")===l?.groupIds.join(""))return XSt(l,t,n)??s;if(!l?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(l.frameId||qr(l))){let h=xVr(t,l.frameId||l.id);return n==="left"?t.indexOf(h[0]):t.indexOf(h[h.length-1])}if(!l.groupIds.length)return XSt(l,t,n)??s;let u=e.editingGroupId?l.groupIds[l.groupIds.indexOf(e.editingGroupId)-1]:l.groupIds[l.groupIds.length-1],d=ya(t,u);return d.length?n==="left"?t.indexOf(d[0]):t.indexOf(d[d.length-1]):s},p7t=(e,t)=>t.reduce((r,n)=>{let i=e[n];return r.set(i.id,i),r},new Map),m7t=(e,t,r)=>{let n=f7t(e,t),i=p7t(e,n),a=bVr(n);r==="right"&&(a=a.reverse());let o=new Set(n.filter(s=>qr(e[s])).map(s=>e[s].id));return a.forEach((s,l)=>{let u=s[0],d=s[s.length-1],h=r==="left"?u:d,f=s.some(b=>{let x=e[b];return x.frameId&&o.has(x.frameId)})?null:e[h]?.frameId,p=wVr(t,e,h,r,f);if(p===-1||h===p)return;let m=r==="left"?e.slice(0,p):e.slice(0,u),g=e.slice(u,d+1),y=r==="left"?e.slice(p,u):e.slice(d+1,p+1),v=r==="left"?e.slice(d+1):e.slice(p+1);e=r==="left"?[...m,...g,...y,...v]:[...m,...y,...g,...v]}),Op(e,i),e},g7t=(e,t,r,n,i)=>{let a=f7t(e,t,i),o=p7t(e,a),s=[],l,u;if(r==="left"){if(n)l=Cte(e,m=>G4e(m,n));else if(t.editingGroupId){let m=ya(e,t.editingGroupId);if(!m.length)return e;l=e.indexOf(m[0])}else l=0;u=a[a.length-1]}else{if(n)u=Ib(e,m=>G4e(m,n));else if(t.editingGroupId){let m=ya(e,t.editingGroupId);if(!m.length)return e;u=e.indexOf(m[m.length-1])}else u=e.length-1;l=a[0]}l===-1&&(l=0);for(let m=l;mm7t(e,t,"left"),TVr=(e,t)=>m7t(e,t,"right"),kVr=(e,t)=>y7t(e,t,"left",g7t),CVr=(e,t)=>y7t(e,t,"right",g7t),SVr=jt({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Xte,trackEvent:{category:"element"},perform:(e,t)=>({elements:EVr(e,t),appState:t,captureUpdate:pt.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[qe.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ti.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,dN.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${ce("labels.sendBackward")} \u2014 ${Tt("CtrlOrCmd+[")}`,children:Xte})}),AVr=jt({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:jte,trackEvent:{category:"element"},perform:(e,t)=>({elements:TVr(e,t),appState:t,captureUpdate:pt.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[qe.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ti.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,dN.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${ce("labels.bringForward")} \u2014 ${Tt("CtrlOrCmd+]")}`,children:jte})}),UVr=jt({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Kte,trackEvent:{category:"element"},perform:(e,t)=>({elements:kVr(e,t),appState:t,captureUpdate:pt.IMMEDIATELY}),keyTest:e=>Bp?e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.BRACKET_LEFT:e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.code===ti.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>(0,dN.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${ce("labels.sendToBack")} \u2014 ${Bp?Tt("CtrlOrCmd+Alt+["):Tt("CtrlOrCmd+Shift+[")}`,children:Kte})}),IVr=jt({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:$te,trackEvent:{category:"element"},perform:(e,t)=>({elements:CVr(e,t),appState:t,captureUpdate:pt.IMMEDIATELY}),keyTest:e=>Bp?e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.BRACKET_RIGHT:e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.code===ti.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>(0,dN.jsx)("button",{type:"button",className:"zIndexButton",onClick:r=>e(null),title:`${ce("labels.bringToFront")} \u2014 ${Bp?Tt("CtrlOrCmd+Alt+]"):Tt("CtrlOrCmd+Shift+]")}`,children:$te})}),RVr=jt({name:"selectAll",label:"labels.selectAll",icon:N9e,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,r,n)=>{if(t.editingLinearElement)return!1;let i=e.filter(a=>!a.isDeleted&&!(er(a)&&a.containerId)&&!a.locked).reduce((a,o)=>(a[o.id]=!0,a),{});return{appState:{...t,...Rc({editingGroupId:null,selectedElementIds:i},zi(e),t,n),selectedLinearElement:Object.keys(i).length===1&&dn(e[0])?new rr(e[0]):null},captureUpdate:pt.IMMEDIATELY}},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.A}),MVr=e=>{let t=e.slice(),r=new Set,n=a=>{let o=a[0]?.groupIds?.join(""),s=[a[0]],l=[];for(let u of a.slice(1))u.groupIds?.join("")===o?s.push(u):l.push(u);return l.length?[...s,...n(l)]:s},i=new Map;return t.forEach((a,o)=>{if(!i.has(a.id))if(a.groupIds?.length){let s=a.groupIds[a.groupIds.length-1],l=t.slice(o).filter(u=>{let d=u?.groupIds?.some(h=>h===s);return d&&i.set(u.id,!0),d});for(let u of n(l))r.add(u)}else r.add(a)}),r.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...r]},LVr=e=>{let t=iUe(e),r=e.slice(),n=new Set;return r.forEach((i,a)=>{i&&(i.boundElements?.length?(n.add(i),r[a]=null,i.boundElements.forEach(o=>{let s=t.get(o.id);s&&o.type==="text"&&(n.add(s[0]),r[s[1]]=null)})):i.type==="text"&&i.containerId&&t.get(i.containerId)?.[0].boundElements?.find(o=>o.id===i.id)||(n.add(i),r[a]=null))}),n.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...n]},DVr=e=>LVr(MVr(e)),NVr=jt({name:"duplicateSelection",label:"labels.duplicateSelection",icon:xO,trackEvent:{category:"element"},perform:(e,t,r,n)=>{if(t.editingLinearElement)try{let a=rr.duplicateSelectedPoints(t,n.scene.getNonDeletedElementsMap());return{elements:e,appState:a,captureUpdate:pt.IMMEDIATELY}}catch{return!1}let i=_Vr(e,t);if(n.props.onDuplicate&&i.elements){let a=n.props.onDuplicate(i.elements,e);a&&(i.elements=a)}return{...i,captureUpdate:pt.IMMEDIATELY}},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.D,PanelComponent:({elements:e,appState:t,updateData:r})=>(0,v7t.jsx)(Qn,{type:"button",icon:xO,title:`${ce("labels.duplicateSelection")} \u2014 ${Tt("CtrlOrCmd+D")}`,"aria-label":ce("labels.duplicateSelection"),onClick:()=>r(null),visible:ss(zi(e),t)})}),_Vr=(e,t)=>{let r=new Map,n=[],i=[],a=new Map,o=new Map,s=Hr(e),l=g=>{let y=Rte(g).reduce((v,b)=>{if(d.has(b.id))return v;d.set(b.id,!0);let x=Zre(t.editingGroupId,r,b,{x:b.x+oU/2,y:b.y+oU/2});return d.set(x.id,!0),o.set(x.id,x),a.set(b.id,x.id),i.push(b),n.push(x),v.push(x),v},[]);return Array.isArray(g)?y:y[0]||null};e=DVr(e);let u=Hr(Un(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),d=new Map,h=e.slice(),f=(g,y)=>{is(g!==-1,"targetIndex === -1 "),!(!Array.isArray(y)&&!y)&&h.splice(g+1,0,...Rte(y))},p=new Set(e.filter(g=>u.has(g.id)&&qr(g)).map(g=>g.id));for(let g of e){if(d.has(g.id)||!u.has(g.id))continue;let y=Bre(t,g);if(y){let v=ya(e,y).flatMap(x=>qr(x)?[...Yp(e,x.id),x]:[x]),b=Ib(h,x=>x.groupIds?.includes(y));f(b,l(v));continue}if(!(g.frameId&&p.has(g.frameId))){if(qr(g)){let v=g.id,b=Yp(e,v),x=Ib(h,E=>E.frameId===v||E.id===v);f(x,l([...b,g]));continue}if(md(g)){let v=hn(g,s),b=Ib(h,x=>x.id===g.id||"containerId"in x&&x.containerId===g.id);v?f(b,l([g,v])):f(b,l(g));continue}if(ga(g)){let v=$s(g,s),b=Ib(h,x=>x.id===g.id||x.id===v?.id);v?f(b,l([v,g])):f(b,l(g));continue}f(Ib(h,v=>v.id===g.id),l(g))}}Hre(h,i,a),Lre(h,i,a),xne(h,i,a);let m=pB(n);return{elements:h,appState:{...t,...Rc({editingGroupId:t.editingGroupId,selectedElementIds:m.reduce((g,y)=>(ga(y)||(g[y.id]=!0),g),{})},zi(h),t,null)}}},PVr=new Set(["command_palette","export"]),pa=(e,t,r,n)=>{try{if(typeof window>"u"||en.VITE_WORKER_ID||en.VITE_APP_ENABLE_TRACKING!=="true"||!PVr.has(e)||en.DEV)return;en.PROD||console.info("trackEvent",{category:e,action:t,label:r,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:r,value:n})}catch(i){console.error("error during analytics",i)}},w7t=(0,b7t.forwardRef)((e,t)=>{let{title:r,className:n,testId:i,active:a,standalone:o,icon:s,onClick:l}=e;return(0,x7t.jsx)("button",{type:"button",ref:t,title:r,"data-testid":i,className:St(n,{standalone:o,active:a}),onClick:l,children:s},r)}),c1=e=>(0,YA.jsx)("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?(0,YA.jsx)(w7t,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:r=>e.onClick(t.value,r)},t.text):(0,YA.jsxs)("label",{className:St({active:e.value===t.value}),title:t.text,children:[(0,YA.jsx)("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),OVr=({onChange:e,type:t,activeColor:r,topPicks:n})=>{let i;return t==="elementStroke"&&(i=lte),t==="elementBackground"&&(i=cte),t==="canvasBackground"&&(i=ute),n&&(i=n),i?(0,fK.jsx)("div",{className:"color-picker__top-picks",children:i.map(a=>(0,fK.jsx)("button",{className:St("color-picker__button",{active:a===r,"is-transparent":a==="transparent"||!a}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:(0,fK.jsx)("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)},T7t=()=>(0,E7t.jsx)("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),DK=({palette:e,color:t})=>{for(let[r,n]of Object.entries(e))if(Array.isArray(n)){let i=n.indexOf(t);if(i>-1)return{colorName:r,shade:i}}else if(n===t)return{colorName:r,shade:null};return null},W4e=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),k7t=({color:e,palette:t})=>!Object.values(t).flat().includes(e),BVr=(e,t,r)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(o=>{if(o.isDeleted)return!1;let s=o[n[t]];return k7t({color:s,palette:r})}),a=new Map;return i.forEach(o=>{let s=o[n[t]];a.has(s)?a.set(s,a.get(s)+1):a.set(s,1)}),[...a.entries()].sort((o,s)=>s[1]-o[1]).map(o=>o[0]).slice(0,f8e)},i7=bs(null),$St=(e,t,r)=>(e*299+t*587+r*114)/1e3>=160?"black":"white",FVr=(e,t)=>{if(t){let a=new Option().style;if(a.color=e,a.color){let o=a.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),s=parseInt(o[0]),l=parseInt(o[1]),u=parseInt(o[2]);return $St(s,l,u)}}if(e==="transparent")return"black";let r=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return $St(r,n,i)},zVr=({color:e,keyLabel:t,isCustomColor:r=!1,isShade:n=!1})=>(0,C7t.jsxs)("div",{className:"color-picker__button__hotkey-label",style:{color:FVr(e,r)},children:[n&&"\u21E7",t]}),y3e=zVr,GVr=({hex:e,onChange:t,palette:r})=>{let n=DK({color:e||"transparent",palette:r}),[i,a]=No(i7),o=(0,LK.useRef)(null);if((0,LK.useEffect)(()=>{o.current&&i==="shades"&&o.current.focus()},[n,i]),n){let{colorName:s,shade:l}=n,u=r[s];if(Array.isArray(u))return(0,bv.jsx)("div",{className:"color-picker-content--default shades",children:u.map((d,h)=>(0,bv.jsxs)("button",{ref:h===l&&i==="shades"?o:void 0,tabIndex:-1,type:"button",className:St("color-picker__button color-picker__button--large",{active:h===l}),"aria-label":"Shade",title:`${s} - ${h+1}`,style:d?{"--swatch-color":d}:void 0,onClick:()=>{t(d),a("shades")},children:[(0,bv.jsx)("div",{className:"color-picker__button-outline"}),(0,bv.jsx)(y3e,{color:d,keyLabel:h+1,isShade:!0})]},h))})}return(0,bv.jsxs)("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[(0,bv.jsx)("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),(0,bv.jsx)("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:ce("colorPicker.noShades")})]})},WVr=({palette:e,color:t,onChange:r,label:n,activeShade:i})=>{let a=DK({color:t||"transparent",palette:e}),[o,s]=No(i7),l=(0,NK.useRef)(null);return(0,NK.useEffect)(()=>{l.current&&o==="baseColors"&&l.current.focus()},[a?.colorName,o]),(0,jA.jsx)("div",{className:"color-picker-content--default",children:Object.entries(e).map(([u,d],h)=>{let f=(Array.isArray(d)?d[i]:d)||"transparent",p=W4e[h],m=ce(`colors.${u.replace(/\d+/,"")}`,null,"");return(0,jA.jsxs)("button",{ref:a?.colorName===u?l:void 0,tabIndex:-1,type:"button",className:St("color-picker__button color-picker__button--large",{active:a?.colorName===u,"is-transparent":f==="transparent"||!f}),onClick:()=>{r(f),s("baseColors")},title:`${m}${f.startsWith("#")?` ${f}`:""} \u2014 ${p}`,"aria-label":`${m} \u2014 ${p}`,style:f?{"--swatch-color":f}:void 0,"data-testid":`color-${u}`,children:[(0,jA.jsx)("div",{className:"color-picker__button-outline"}),(0,jA.jsx)(y3e,{color:f,keyLabel:p})]},u)})})},VVr=WVr,HVr=({colors:e,color:t,onChange:r,label:n})=>{let[i,a]=No(i7),o=(0,_K.useRef)(null);return(0,_K.useEffect)(()=>{o.current&&o.current.focus()},[t,i]),(0,XA.jsx)("div",{className:"color-picker-content--default",children:e.map((s,l)=>(0,XA.jsxs)("button",{ref:t===s?o:void 0,tabIndex:-1,type:"button",className:St("color-picker__button color-picker__button--large",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{r(s),a("custom")},title:s,"aria-label":n,style:{"--swatch-color":s},children:[(0,XA.jsx)("div",{className:"color-picker__button-outline"}),(0,XA.jsx)(y3e,{color:s,keyLabel:l+1,isCustomColor:!0})]},l))})},k4e=(e,t,r)=>{let n=Math.ceil(r/n5);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?r-1:i}case"ArrowRight":return(t+1)%r;case"ArrowDown":{let i=t+n5;return i>=r?t%n5:i}case"ArrowUp":{let i=t-n5,a=i<0?n5*n+i:i;return a>=r?void 0:a}}},qVr=({e,colorObj:t,onChange:r,palette:n,customColors:i,setActiveColorPickerSection:a,activeShade:o})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return r(n[t.colorName][s]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return r(i[Number(e.key)-1]),a("custom"),!0;if(W4e.includes(e.key)){let s=W4e.indexOf(e.key),l=Object.keys(n)[s],u=n[l],d=Array.isArray(u)?u[o]:u;return r(d),a("baseColors"),!0}return!1},YVr=({event:e,activeColorPickerSection:t,palette:r,color:n,onChange:i,customColors:a,setActiveColorPickerSection:o,updateData:s,activeShade:l,onEyeDropperToggle:u,onEscape:d})=>{if(e[qe.CTRL_OR_CMD])return!1;if(e.key===qe.ESCAPE)return d(e),!0;if(e.key===qe.ALT)return u(!0),!0;if(e.key===qe.I)return u(),!0;let h=DK({color:n,palette:r});if(e.key===qe.TAB){let f={custom:!!a.length,baseColors:!0,shades:h?.shade!=null,hex:!0},p=Object.entries(f).reduce((b,[x,E])=>(E&&b.push(x),b),[]),m=p.indexOf(t),g=e.shiftKey?-1:1,y=m+g>p.length-1?0:m+g<0?p.length-1:m+g,v=p[y];return v&&o(v),v==="custom"?i(a[0]):v==="baseColors"&&(Object.entries(r).find(([b,x])=>Array.isArray(x)?x.includes(n):x===n?b:null)||i(In.black)),e.preventDefault(),e.stopPropagation(),!0}if(qVr({e,colorObj:h,onChange:i,palette:r,customColors:a,setActiveColorPickerSection:o,activeShade:l}))return!0;if(t==="shades"&&h){let{shade:f}=h,p=k4e(e.key,f,n5);if(p!==void 0)return i(r[h.colorName][p]),!0}if(t==="baseColors"&&h){let{colorName:f}=h,p=Object.keys(r),m=p.indexOf(f),g=k4e(e.key,m,p.length);if(g!==void 0){let y=p[g],v=r[y];return i(Array.isArray(v)?v[l]:v),!0}}if(t==="custom"){let f=a.indexOf(n),p=k4e(e.key,f,a.length);if(p!==void 0){let m=a[p];return i(m),!0}}return!1},jVr=({children:e})=>(0,S7t.jsx)("div",{className:"color-picker__heading",children:e}),pK=jVr,XVr=({color:e,onChange:t,label:r,type:n,elements:i,palette:a,updateData:o,children:s,onEyeDropperToggle:l,onEscape:u})=>{let[d]=hw.default.useState(()=>n==="canvasBackground"?[]:BVr(i,n,a)),[h,f]=No(i7),p=DK({color:e,palette:a});(0,hw.useEffect)(()=>{if(!h){let v=k7t({color:e,palette:a}),b=v&&!d.includes(e);f(b?"hex":v?"custom":p?.shade!=null?"shades":"baseColors")}},[h,e,a,f,p,d]);let[m,g]=(0,hw.useState)(p?.shade??(n==="elementBackground"?KE:$E));(0,hw.useEffect)(()=>{p?.shade!=null&&g(p.shade);let v=b=>{b.key===qe.ALT&&l(!1)};return document.addEventListener("keyup",v,{capture:!0}),()=>{document.removeEventListener("keyup",v,{capture:!0})}},[p,l]);let y=hw.default.useRef(null);return(0,Xh.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":ce("labels.colorPicker"),children:(0,Xh.jsxs)("div",{ref:y,onKeyDown:v=>{YVr({event:v,activeColorPickerSection:h,palette:a,color:e,onChange:t,onEyeDropperToggle:l,customColors:d,setActiveColorPickerSection:f,updateData:o,activeShade:m,onEscape:u})&&(v.preventDefault(),v.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!d.length&&(0,Xh.jsxs)("div",{children:[(0,Xh.jsx)(pK,{children:ce("colorPicker.mostUsedCustomColors")}),(0,Xh.jsx)(HVr,{colors:d,color:e,label:ce("colorPicker.mostUsedCustomColors"),onChange:t})]}),(0,Xh.jsxs)("div",{children:[(0,Xh.jsx)(pK,{children:ce("colorPicker.colors")}),(0,Xh.jsx)(VVr,{color:e,label:r,palette:a,onChange:t,activeShade:m})]}),(0,Xh.jsxs)("div",{children:[(0,Xh.jsx)(pK,{children:ce("colorPicker.shades")}),(0,Xh.jsx)(GVr,{hex:e,onChange:t,palette:a})]}),s]})})},I7t=v3e.default.createContext(null),Ec=()=>v3e.default.useContext(I7t),R7t=e=>{let[t,r]=(0,YD.useState)(null),n=gl(),{theme:i}=Ec(),{container:a}=h1();return(0,YD.useLayoutEffect)(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.editor.isMobile),t.classList.toggle("theme--dark",i===Gn.DARK))},[t,i,n.editor.isMobile,e?.className]),(0,YD.useLayoutEffect)(()=>{let o=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!o)return;let s=document.createElement("div");return o.appendChild(s),r(s),()=>{o.removeChild(s)}},[a,e?.parentSelector]),t};function b3e(e,t,r){(0,M7t.useEffect)(()=>{function n(i){let a=i;if(!e.current)return;let o=r?.(a,e.current);if(o!==!0){if(o===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}}return document.addEventListener("pointerdown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("pointerdown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}var OK=e=>{let t=(0,L7t.useRef)(e);return Object.assign(t.current,e),t.current},BK=bs(null),$Vr=({onCancel:e,onChange:t,onSelect:r,colorPickerType:n})=>{let i=R7t({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Ec(),o=uZ(),s=d1(),l=Un(o,a),u=OK({app:s,onCancel:e,onChange:t,onSelect:r,selectedElements:l}),{container:d}=h1();(0,PK.useEffect)(()=>{let f=h.current;if(!f||!s.canvas||!i)return;let p=!1,m=s.canvas.getContext("2d"),g=({clientX:T,clientY:C})=>{let S=m.getImageData((T-a.offsetLeft)*window.devicePixelRatio,(C-a.offsetTop)*window.devicePixelRatio,1,1).data;return y8e(S[0],S[1],S[2])},y=({clientX:T,clientY:C,altKey:S})=>{f.style.top=`${C+20}px`,f.style.left=`${T+20}px`;let R=g({clientX:T,clientY:C});p&&u.onChange(n,R,u.selectedElements,{altKey:S}),f.style.background=R},v=()=>{u.onCancel()},b=(T,C)=>{u.onSelect(T,C)},x=T=>{p=!0,T.stopImmediatePropagation()},E=T=>{p=!1,d?.focus(),T.stopImmediatePropagation(),T.preventDefault(),b(g(T),T)},w=T=>{T.key===qe.ESCAPE&&(T.preventDefault(),T.stopImmediatePropagation(),v())};return i.tabIndex=-1,i.focus(),y({clientX:u.app.lastViewportPosition.x,clientY:u.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",w),i.addEventListener("pointerdown",x),i.addEventListener("pointerup",E),window.addEventListener("pointermove",y,{passive:!0}),window.addEventListener("blur",v),()=>{p=!1,i.removeEventListener("keydown",w),i.removeEventListener("pointerdown",x),i.removeEventListener("pointerup",E),window.removeEventListener("pointermove",y),window.removeEventListener("blur",v)}},[u,s.canvas,i,n,d,a.offsetLeft,a.offsetTop]);let h=(0,PK.useRef)(null);return b3e(h,()=>{e()},f=>!!f.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?(0,U7t.createPortal)((0,D7t.jsx)("div",{ref:h,className:"excalidraw-eye-dropper-preview"}),i):null},KVr=({color:e,onChange:t,label:r,colorPickerType:n})=>{let i=gl(),[a,o]=(0,q0.useState)(e),[s,l]=No(i7);(0,q0.useEffect)(()=>{o(e)},[e]);let u=(0,q0.useCallback)(m=>{let g=m.toLowerCase(),y=ZVr(g);y&&t(y),o(g)},[t]),d=(0,q0.useRef)(null),h=(0,q0.useRef)(null);(0,q0.useEffect)(()=>{d.current&&d.current.focus()},[s]);let[f,p]=No(BK);return(0,q0.useEffect)(()=>()=>{p(null)},[p]),(0,o1.jsxs)("div",{className:"color-picker__input-label",children:[(0,o1.jsx)("div",{className:"color-picker__input-hash",children:"#"}),(0,o1.jsx)("input",{ref:s==="hex"?d:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":r,onChange:m=>{u(m.target.value)},value:(a||"").replace(/^#/,""),onBlur:()=>{o(e)},tabIndex:-1,onFocus:()=>l("hex"),onKeyDown:m=>{m.key!==qe.TAB&&(m.key===qe.ESCAPE&&h.current?.focus(),m.stopPropagation())}}),!i.editor.isMobile&&(0,o1.jsxs)(o1.Fragment,{children:[(0,o1.jsx)("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),(0,o1.jsx)("div",{ref:h,className:St("excalidraw-eye-dropper-trigger",{selected:f}),onClick:()=>p(m=>m?null:{keepOpenOnAlt:!1,onSelect:g=>t(g),colorPickerType:n}),title:`${ce("labels.eyeDropper")} \u2014 ${qe.I.toLocaleUpperCase()} or ${Tt("Alt")} `,children:C9e})]})]})},Y0=_7t.default.forwardRef(({children:e,padding:t,className:r,style:n},i)=>(0,P7t.jsx)("div",{className:St("Island",r),style:{"--padding":t,...n},ref:i,children:e})),O7t=N7t.default.forwardRef(({className:e,container:t,children:r,style:n,onClose:i,onKeyDown:a,onFocusOutside:o,onPointerLeave:s,onPointerDownOutside:l},u)=>{let d=gl();return(0,$A.jsx)(YDe,{container:t,children:(0,$A.jsxs)(XT,{ref:u,className:St("focus-visible-none",e),"data-prevent-outside-click":!0,side:d.editor.isMobile&&!d.viewport.isLandscape?"bottom":"right",align:d.editor.isMobile&&!d.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:s,onKeyDown:a,onFocusOutside:o,onPointerDownOutside:l,onCloseAutoFocus:h=>{h.stopPropagation(),h.preventDefault(),t&&!Z8e(document.activeElement)&&t.focus(),i()},children:[(0,$A.jsx)(Y0,{padding:3,style:n,children:r}),(0,$A.jsx)(eF,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),KSt=e=>{let t=new Option().style;return t.color=e,!!t.color},ZVr=e=>df(e)?e:KSt(`#${e}`)?`#${e}`:KSt(e)?e:null,QVr=({type:e,color:t,onChange:r,label:n,elements:i,palette:a=In,updateData:o})=>{let{container:s}=h1(),[,l]=No(i7),[u,d]=No(BK),h=(0,nu.jsxs)("div",{children:[(0,nu.jsx)(pK,{children:ce("colorPicker.hexCode")}),(0,nu.jsx)(KVr,{color:t,label:n,onChange:m=>{r(m)},colorPickerType:e})]}),f=(0,A7t.useRef)(null),p=()=>{f.current?.querySelector(".color-picker-content")?.focus()};return(0,nu.jsx)(O7t,{container:s,style:{maxWidth:"13rem"},onFocusOutside:m=>{p(),m.preventDefault()},onPointerDownOutside:m=>{u&&m.preventDefault()},onClose:()=>{o({openPopup:null}),l(null)},children:a?(0,nu.jsx)(XVr,{palette:a,color:t,onChange:m=>{r(m)},onEyeDropperToggle:m=>{d(g=>m?(g=g||{keepOpenOnAlt:!0,onSelect:r,colorPickerType:e},g.keepOpenOnAlt=!0,g):m===!1||g?null:{keepOpenOnAlt:!1,onSelect:r,colorPickerType:e})},onEscape:m=>{u?d(null):o({openPopup:null})},label:n,type:e,elements:i,updateData:o,children:h}):h})},JVr=({label:e,color:t,type:r})=>(0,nu.jsx)(Yb,{type:"button",className:St("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:ce(r==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:(0,nu.jsx)("div",{className:"color-picker__button-outline"})}),x3e=({type:e,color:t,onChange:r,label:n,elements:i,palette:a=In,topPicks:o,updateData:s,appState:l})=>(0,nu.jsx)("div",{children:(0,nu.jsxs)("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[(0,nu.jsx)(OVr,{activeColor:t,onChange:r,type:e,topPicks:o}),(0,nu.jsx)(T7t,{}),(0,nu.jsxs)(qb,{open:l.openPopup===e,onOpenChange:u=>{s({openPopup:u?e:null})},children:[(0,nu.jsx)(JVr,{color:t,label:n,type:e}),l.openPopup===e&&(0,nu.jsx)(QVr,{type:e,color:t,onChange:r,label:n,elements:i,palette:a,updateData:s})]})]})}),FK=({icon:e})=>(0,B7t.jsx)("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),eHr=({label:e,open:t,openTrigger:r,children:n,className:i})=>(0,fw.jsxs)(fw.Fragment,{children:[(0,fw.jsxs)("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:r,children:[e,(0,fw.jsx)(FK,{icon:t?$9e:gre})]}),t&&(0,fw.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),V4e=eHr,tHr=bs(!1);function rHr({options:e,value:t,label:r,onChange:n,onClose:i,numberOfOptionsToAlwaysShow:a=e.length}){let o=gl(),s=p=>{let m=e.find(g=>g.keyBinding===p.key.toLowerCase());if(!(p.metaKey||p.altKey||p.ctrlKey)&&m)n(m.value),p.preventDefault();else if(p.key===qe.TAB){let g=e.findIndex(v=>v.value===t),y=p.shiftKey?(e.length+g-1)%e.length:(g+1)%e.length;n(e[y].value)}else if(xT(p.key)){let g=qD().rtl,y=e.findIndex(v=>v.value===t);if(y!==-1){let v=e.length,b=y;switch(p.key){case(g?qe.ARROW_LEFT:qe.ARROW_RIGHT):b=(y+1)%v;break;case(g?qe.ARROW_RIGHT:qe.ARROW_LEFT):b=(v+y-1)%v;break;case qe.ARROW_DOWN:{b=(y+(a??1))%v;break}case qe.ARROW_UP:{b=(v+y-(a??1))%v;break}}n(e[b].value)}p.preventDefault()}else(p.key===qe.ESCAPE||p.key===qe.ENTER)&&(p.preventDefault(),i());p.nativeEvent.stopImmediatePropagation(),p.stopPropagation()},[l,u]=No(tHr),d=Y6.default.useMemo(()=>e.slice(0,a),[e,a]),h=Y6.default.useMemo(()=>e.slice(a),[e,a]);(0,Y6.useEffect)(()=>{d.some(p=>p.value===t)||u(!0)},[t,d,u]);let f=p=>(0,ap.jsx)("div",{className:"picker-content",children:p.map((m,g)=>(0,ap.jsxs)("button",{type:"button",className:St("picker-option",{active:t===m.value}),onClick:y=>{n(m.value)},title:`${m.text} ${m.keyBinding&&`\u2014 ${m.keyBinding.toUpperCase()}`}`,"aria-label":m.text||"none","aria-keyshortcuts":m.keyBinding||void 0,ref:y=>{t===m.value&&setTimeout(()=>{y?.focus()},0)},children:[m.icon,m.keyBinding&&(0,ap.jsx)("span",{className:"picker-keybinding",children:m.keyBinding})]},m.text))});return(0,ap.jsx)(XT,{side:o.editor.isMobile&&!o.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:s,children:(0,ap.jsxs)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,children:[f(d),h.length>0&&(0,ap.jsx)(V4e,{label:ce("labels.more_options"),open:l,openTrigger:()=>{u(p=>!p)},className:"picker-collapsible",children:f(h)})]})})}function ZSt({value:e,label:t,options:r,onChange:n,group:i="",numberOfOptionsToAlwaysShow:a}){let[o,s]=Y6.default.useState(!1),l=Y6.default.useRef(null);return(0,ap.jsx)("div",{children:(0,ap.jsxs)(qb,{open:o,onOpenChange:u=>s(u),children:[(0,ap.jsx)(Yb,{name:i,type:"button","aria-label":t,onClick:()=>s(!o),ref:l,className:o?"active":"",children:r.find(u=>u.value===e)?.icon}),o&&(0,ap.jsx)(rHr,{options:r,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}var z7t=F7t.default.forwardRef(({className:e,placeholder:t,onChange:r},n)=>(0,zK.jsxs)("div",{className:St("QuickSearch__wrapper",e),children:[Nb,(0,zK.jsx)("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>r(i.target.value.trim().toLowerCase())})]})),W7t=({className:e,placeholder:t,children:r})=>{let n=!G7t.Children.count(r);return(0,H4e.jsx)("div",{className:St("ScrollableList__wrapper",e),role:"menu",children:n?(0,H4e.jsx)("div",{className:"empty",children:t}):r})},V7t=({children:e,className:t="",style:r,title:n})=>(0,GK.jsxs)("div",{className:`dropdown-menu-group ${t}`,style:r,children:[n&&(0,GK.jsx)("p",{className:"dropdown-menu-group-title",children:n}),e]}),q4e=V7t;V7t.displayName="DropdownMenuGroup";var H7t=VK.default.createContext({}),q7t=(e="",t=!1,r=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} - ${t?"dropdown-menu-item--selected":""} ${r?"dropdown-menu-item--hovered":""}`.trim(),Y7t=(e,t)=>{let r=(0,VK.useContext)(H7t);return pU(e,n=>{let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t?.(i),i.defaultPrevented||r.onSelect?.(i)})},nHr=({textStyle:e,icon:t,shortcut:r,children:n})=>{let i=gl();return(0,cw.jsxs)(cw.Fragment,{children:[t&&(0,cw.jsx)("div",{className:"dropdown-menu-item__icon",children:t}),(0,cw.jsx)("div",{style:e,className:"dropdown-menu-item__text",children:n}),r&&!i.editor.isMobile&&(0,cw.jsx)("div",{className:"dropdown-menu-item__shortcut",children:r})]})},j7t=nHr,w3e=({icon:e,value:t,order:r,children:n,shortcut:i,className:a,hovered:o,selected:s,textStyle:l,onSelect:u,onClick:d,...h})=>{let f=Y7t(d,u),p=(0,WK.useRef)(null);return(0,WK.useEffect)(()=>{o&&(r===0?p.current?.scrollIntoView({block:"end"}):p.current?.scrollIntoView({block:"nearest"}))},[o,r]),(0,EK.jsx)("button",{...h,ref:p,value:t,onClick:f,className:q7t(a,s,o),title:h.title??h["aria-label"],children:(0,EK.jsx)(j7t,{textStyle:l,icon:e,shortcut:i,children:n})})};w3e.displayName="DropdownMenuItem";var BD={GREEN:"green",RED:"red",BLUE:"blue"},E3e=({type:e=BD.BLUE,children:t})=>{let{theme:r}=mN(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:r===Gn.LIGHT?"1.5px solid white":"none"};switch(e){case BD.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case BD.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case BD.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return(0,EK.jsx)("div",{className:"DropDownMenuItemBadge",style:n,children:t})};E3e.displayName="DropdownMenuItemBadge";w3e.Badge=E3e;var dp=w3e,iHr=({event:e,inputRef:t,hoveredFont:r,filteredFonts:n,onClose:i,onSelect:a,onHover:o})=>{if(!e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===qe.F)return t.current?.focus(),!0;if(e.key===qe.ESCAPE)return i(),!0;if(e.key===qe.ENTER)return r?.value&&a(r.value),!0;if(e.key===qe.ARROW_DOWN)return r?.next?o(r.next.value):n[0]?.value&&o(n[0].value),!0;if(e.key===qe.ARROW_UP)return r?.prev?o(r.prev.value):n[n.length-1]?.value&&o(n[n.length-1].value),!0},aHr=pl.default.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:r,onHover:n,onLeave:i,onOpen:a,onClose:o})=>{let{container:s}=h1(),{fonts:l}=d1(),{showDeprecatedFonts:u}=pN(),[d,h]=(0,pl.useState)(""),f=(0,pl.useRef)(null),p=(0,pl.useMemo)(()=>Array.from(Em.registered.entries()).filter(([S,{metadata:R}])=>!R.serverSide&&!R.fallback).map(([S,{metadata:R,fontFaces:U}])=>{let L={value:S,icon:R.icon??K8,text:U[0]?.fontFace?.family??"Unknown"};return R.deprecated&&Object.assign(L,{deprecated:R.deprecated,badge:{type:BD.RED,placeholder:ce("fontList.badge.old")}}),L}).sort((S,R)=>S.text.toLowerCase()>R.text.toLowerCase()?1:-1),[]),m=(0,pl.useMemo)(()=>new Set(l.getSceneFamilies()),[e]),g=(0,pl.useMemo)(()=>p.filter(S=>m.has(S.value)),[p,m]),y=(0,pl.useMemo)(()=>p.filter(S=>!m.has(S.value)&&(u||!S.deprecated)),[p,m,u]),v=(0,pl.useMemo)(()=>aUe([...g,...y].filter(S=>S.text?.toLowerCase().includes(d))),[g,y,d]),b=(0,pl.useMemo)(()=>{let S;return t?S=v.find(R=>R.value===t):e&&(S=v.find(R=>R.value===e)),!S&&d&&(v[0]?.value?n(v[0].value):i()),S},[t,e,d,v,n,i]),x=(0,pl.useCallback)(S=>{iHr({event:S,inputRef:f,hoveredFont:b,filteredFonts:v,onSelect:r,onHover:n,onClose:o})&&(S.preventDefault(),S.stopPropagation())},[b,v,r,n,o]);(0,pl.useEffect)(()=>(a(),()=>{o()}),[]);let E=(0,pl.useMemo)(()=>v.filter(S=>m.has(S.value)),[v,m]),w=(0,pl.useMemo)(()=>v.filter(S=>!m.has(S.value)),[v,m]),T=(S,R)=>(0,xv.jsxs)(dp,{icon:S.icon,value:S.value,order:R,textStyle:{fontFamily:u5({fontFamily:S.value})},hovered:S.value===b?.value,selected:S.value===e,tabIndex:S.value===e?0:-1,onClick:U=>{r(Number(U.currentTarget.value))},onMouseMove:()=>{b?.value!==S.value&&n(S.value)},children:[S.text,S.badge&&(0,xv.jsx)(E3e,{type:S.badge.type,children:S.badge.placeholder})]},S.value),C=[];return E.length&&C.push((0,xv.jsx)(q4e,{title:ce("fontList.sceneFonts"),children:E.map(T)},"group_1")),w.length&&C.push((0,xv.jsx)(q4e,{title:ce("fontList.availableFonts"),children:w.map((S,R)=>T(S,R+E.length))},"group_2")),(0,xv.jsxs)(O7t,{className:"properties-content",container:s,style:{width:"15rem"},onClose:o,onPointerLeave:i,onKeyDown:x,children:[(0,xv.jsx)(z7t,{ref:f,placeholder:ce("quickSearch.placeholder"),onChange:d5(h,20)}),(0,xv.jsx)(W7t,{className:"dropdown-menu fonts manual-hover",placeholder:ce("fontList.empty"),children:C.length?C:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),oHr=({selectedFontFamily:e})=>{let t=(0,X7t.useMemo)(()=>!!(e&&!lHr(e)),[e]);return(0,mK.jsx)(Yb,{asChild:!0,children:(0,mK.jsx)("div",{children:(0,mK.jsx)(w7t,{standalone:!0,icon:Bte,title:ce("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},$7t=[{value:Fa.Excalifont,icon:aT,text:ce("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:Fa.Nunito,icon:K8,text:ce("labels.normal"),testId:"font-family-normal"},{value:Fa["Comic Shanns"],icon:KP,text:ce("labels.code"),testId:"font-family-code"}],sHr=new Set($7t.map(e=>e.value)),lHr=e=>e?sHr.has(e):!1,cHr=a7.default.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:r,onSelect:n,onHover:i,onLeave:a,onPopupChange:o})=>{let s=(0,a7.useMemo)(()=>$7t,[]),l=(0,a7.useCallback)(u=>{u&&n(u)},[n]);return(0,ow.jsxs)("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[(0,ow.jsx)(c1,{type:"button",options:s,value:t,onClick:l}),(0,ow.jsx)(T7t,{}),(0,ow.jsxs)(qb,{open:e,onOpenChange:o,children:[(0,ow.jsx)(oHr,{selectedFontFamily:t}),e&&(0,ow.jsx)(aHr,{selectedFontFamily:t,hoveredFontFamily:r,onSelect:l,onHover:i,onLeave:a,onOpen:()=>o(!0),onClose:()=>o(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),uHr=({updateData:e,appState:t,elements:r,testId:n})=>{let i=jD.default.useRef(null),a=jD.default.useRef(null),o=Zu(r,t,s=>s.opacity,!0,t.currentItemOpacity);return(0,jD.useEffect)(()=>{if(i.current&&a.current){let s=i.current,l=a.current,u=s.offsetWidth,d=15,h=o/100*(u-d)+d/2;l.style.left=`${h}px`,s.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${o}%, var(--button-bg) ${o}%, var(--button-bg) 100%)`}},[o]),(0,O6.jsxs)("label",{className:"control-label",children:[ce("labels.opacity"),(0,O6.jsxs)("div",{className:"range-wrapper",children:[(0,O6.jsx)("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:s=>{e(+s.target.value)},value:o,className:"range-input","data-testid":n}),(0,O6.jsx)("div",{className:"value-bubble",ref:a,children:o!==0?o:null}),(0,O6.jsx)("div",{className:"zero-label",children:"0"})]})]})},K7t=.1,Ku=(e,t,r,n=!1)=>{let i=Hr(Un(e,t,{includeBoundTextElement:n}));return e.map(a=>i.get(a.id)||a.id===t.editingTextElement?.id?r(a):a)},Zu=function(e,t,r,n,i){let a=t.editingTextElement,o=zi(e),s=null;return a&&(s=r(a)),s||(ss(o,t)?s=GRe(n===!0?o:o.filter(l=>n(l)),t,r)??(typeof i=="function"?i(!0):i):s=typeof i=="function"?i(!1):i),s},dHr=(e,t)=>ga(t)||!t.autoResize?t:kt(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),T3e=(e,t,r,n,i)=>{let a=new Set,o=Ku(e,t,l=>{if(er(l)){let u=n(l);a.add(u);let d=Tn(l,{fontSize:u});return Mc(d,r.scene.getContainerElement(l),r.scene.getNonDeletedElementsMap()),d=dHr(l,d),d}return l},!0),s=Hr(o);return Un(e,t,{includeBoundTextElement:!0}).forEach(l=>{er(l)&&gu(l,s)}),{elements:o,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:i??t.currentItemFontSize},captureUpdate:pt.IMMEDIATELY}},vYn=jt({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,r)=>({...r.currentItemStrokeColor&&{elements:Ku(e,t,n=>_O(n.type)?Tn(n,{strokeColor:r.currentItemStrokeColor}):n,!0)},appState:{...t,...r},captureUpdate:r.currentItemStrokeColor?pt.IMMEDIATELY:pt.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:r,appProps:n})=>(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsx)("h3",{"aria-hidden":"true",children:ce("labels.stroke")}),(0,Ir.jsx)(x3e,{topPicks:lte,palette:m8e,type:"elementStroke",label:ce("labels.stroke"),color:Zu(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>r({currentItemStrokeColor:i}),elements:e,appState:t,updateData:r})]})}),bYn=jt({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,r)=>({...r.currentItemBackgroundColor&&{elements:Ku(e,t,n=>Tn(n,{backgroundColor:r.currentItemBackgroundColor}))},appState:{...t,...r},captureUpdate:r.currentItemBackgroundColor?pt.IMMEDIATELY:pt.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:r,appProps:n})=>(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsx)("h3",{"aria-hidden":"true",children:ce("labels.background")}),(0,Ir.jsx)(x3e,{topPicks:cte,palette:g8e,type:"elementBackground",label:ce("labels.background"),color:Zu(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>r({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:r})]})}),xYn=jt({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,r,n)=>(pa("element","changeFillStyle",`${r} (${n.device.editor.isMobile?"mobile":"desktop"})`),{elements:Ku(e,t,i=>Tn(i,{fillStyle:r})),appState:{...t,currentItemFillStyle:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>{let n=Un(e,t),i=n.length>0&&n.every(a=>a.fillStyle==="zigzag");return(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.fill")}),(0,Ir.jsx)(c1,{type:"button",options:[{value:"hachure",text:`${ce(i?"labels.zigzag":"labels.hachure")} (${Tt("Alt-Click")})`,icon:i?FUe:zUe,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:ce("labels.crossHatch"),icon:GUe,testId:"fill-cross-hatch"},{value:"solid",text:ce("labels.solid"),icon:WUe,testId:"fill-solid"}],value:Zu(e,t,a=>a.fillStyle,a=>a.hasOwnProperty("fillStyle"),a=>a?null:t.currentItemFillStyle),onClick:(a,o)=>{let s=o.altKey&&a==="hachure"&&n.every(l=>l.fillStyle==="hachure")?"zigzag":a;r(s)}})]})}}),wYn=jt({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>Tn(n,{strokeWidth:r})),appState:{...t,currentItemStrokeWidth:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.strokeWidth")}),(0,Ir.jsx)(c1,{group:"stroke-width",options:[{value:hO.thin,text:ce("labels.thin"),icon:ore,testId:"strokeWidth-thin"},{value:hO.bold,text:ce("labels.bold"),icon:VUe,testId:"strokeWidth-bold"},{value:hO.extraBold,text:ce("labels.extraBold"),icon:HUe,testId:"strokeWidth-extraBold"}],value:Zu(e,t,n=>n.strokeWidth,n=>n.hasOwnProperty("strokeWidth"),n=>n?null:t.currentItemStrokeWidth),onChange:n=>r(n)})]})}),EYn=jt({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>Tn(n,{seed:Vp(),roughness:r})),appState:{...t,currentItemRoughness:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.sloppiness")}),(0,Ir.jsx)(c1,{group:"sloppiness",options:[{value:0,text:ce("labels.architect"),icon:jUe},{value:1,text:ce("labels.artist"),icon:XUe},{value:2,text:ce("labels.cartoonist"),icon:$Ue}],value:Zu(e,t,n=>n.roughness,n=>n.hasOwnProperty("roughness"),n=>n?null:t.currentItemRoughness),onChange:n=>r(n)})]})}),TYn=jt({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>Tn(n,{strokeStyle:r})),appState:{...t,currentItemStrokeStyle:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.strokeStyle")}),(0,Ir.jsx)(c1,{group:"strokeStyle",options:[{value:"solid",text:ce("labels.strokeStyle_solid"),icon:ore},{value:"dashed",text:ce("labels.strokeStyle_dashed"),icon:qUe},{value:"dotted",text:ce("labels.strokeStyle_dotted"),icon:YUe}],value:Zu(e,t,n=>n.strokeStyle,n=>n.hasOwnProperty("strokeStyle"),n=>n?null:t.currentItemStrokeStyle),onChange:n=>r(n)})]})}),kYn=jt({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>Tn(n,{opacity:r}),!0),appState:{...t,currentItemOpacity:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>(0,Ir.jsx)(uHr,{updateData:r,elements:e,appState:t,testId:"opacity"})}),CYn=jt({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,r,n)=>T3e(e,t,n,()=>r,r),PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.fontSize")}),(0,Ir.jsx)(c1,{group:"font-size",options:[{value:16,text:ce("labels.small"),icon:u9e,testId:"fontSize-small"},{value:20,text:ce("labels.medium"),icon:d9e,testId:"fontSize-medium"},{value:28,text:ce("labels.large"),icon:h9e,testId:"fontSize-large"},{value:36,text:ce("labels.veryLarge"),icon:f9e,testId:"fontSize-veryLarge"}],value:Zu(e,t,i=>{if(er(i))return i.fontSize;let a=hn(i,n.scene.getNonDeletedElementsMap());return a?a.fontSize:null},i=>er(i)||hn(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||bm),onChange:i=>r(i)})]})}),QSt=jt({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:xU,trackEvent:!1,perform:(e,t,r,n)=>T3e(e,t,n,i=>Math.round(1/(1+K7t)*i.fontSize)),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&(e.key===qe.CHEVRON_LEFT||e.key===qe.COMMA)}),JSt=jt({name:"increaseFontSize",label:"labels.increaseFontSize",icon:xU,trackEvent:!1,perform:(e,t,r,n)=>T3e(e,t,n,i=>Math.round(i.fontSize*(1+K7t))),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&(e.key===qe.CHEVRON_RIGHT||e.key===qe.PERIOD)}),SYn=jt({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,r,n)=>{let{cachedElements:i,resetAll:a,resetContainers:o,...s}=r;if(a)return{elements:Ku(e,t,m=>{let g=i?.get(m.id);return g?Tn(m,{...g}):m},!0),appState:{...t,...s},captureUpdate:pt.NEVER};let{currentItemFontFamily:l,currentHoveredFontFamily:u}=r,d=pt.EVENTUALLY,h,f=!1;if(l)h=l,d=pt.IMMEDIATELY;else if(u){h=u,d=pt.EVENTUALLY;let m=Un(e,t,{includeBoundTextElement:!0}).filter(g=>er(g));if(m.length>200)f=!0;else{let g=0,y=0;for(;g5e3&&(f=!0)}}let p={appState:{...t,...s},captureUpdate:d};if(h&&!f){let m=new Map,g=new Set,y=!1,v=Array.from(Em.loadedFontsCache.values()),b=Object.entries(Fa).find(([w,T])=>T===h)?.[0];u&&b&&v.some(w=>w.startsWith(b))&&(y=!0),Object.assign(p,{elements:Ku(e,t,w=>{if(er(w)&&(w.fontFamily!==h||l)){let T=Tn(w,{fontFamily:h,lineHeight:_b(h)}),C=i?.get(w.containerId||"")||{},S=n.scene.getContainerElement(w);return o&&S&&C&&kt(S,{...C},!1),y||(g=new Set([...g,...Array.from(T.originalText)])),m.set(T,S),T}return w},!0)});let x=`10px ${u5({fontFamily:h})}`,E=Array.from(g.values()).join();if(y||window.document.fonts.check(x,E))for(let[w,T]of m)Mc(w,T,n.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(x,E).then(w=>{for(let[T,C]of m){let S=n.scene.getElement(T.id),R=C?n.scene.getElement(C.id):null;S&&Mc(S,R,n.scene.getNonDeletedElementsMap(),!1)}n.fonts.onLoaded(w)})}return p},PanelComponent:({elements:e,appState:t,app:r,updateData:n})=>{let i=(0,cp.useRef)(new Map),a=(0,cp.useRef)(null),[o,s]=(0,cp.useState)({}),l=(0,cp.useRef)(!0),u=(0,cp.useMemo)(()=>{let d=(h,f)=>Zu(h,t,p=>{if(er(p))return p.fontFamily;let m=hn(p,f);return m?m.fontFamily:null},p=>er(p)||hn(p,f)!==null,p=>p?null:t.currentItemFontFamily||G1);return o.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?d(Array.from(i.current?.values()??[]),i.current):!o.openPopup&&t.openPopup!=="fontFamily"?d(e,r.scene.getNonDeletedElementsMap()):a.current},[o.openPopup,t,e,r.scene]);return(0,cp.useEffect)(()=>{a.current=u},[u]),(0,cp.useEffect)(()=>{Object.keys(o).length&&(n(o),s({}))},[o]),(0,cp.useEffect)(()=>(l.current=!1,()=>{l.current=!0}),[]),(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.fontFamily")}),(0,Ir.jsx)(cHr,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:u,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:d=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:d}),i.current.clear()},onHover:d=>{s({currentHoveredFontFamily:d,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:d=>{if(d){i.current.clear();let{editingTextElement:h}=t;if(h?.type==="text"){let f=r.scene.getElement(h.id);i.current.set(h.id,Tn(f||h,{},!0))}else{let f=Un(e,t,{includeBoundTextElement:!0});for(let p of f)i.current.set(p.id,Tn(p,{},!0))}s({openPopup:"fontFamily"})}else{let h={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};l.current?n({...o,...h}):s(h),i.current.clear()}}})]})}}),AYn=jt({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,r,n)=>({elements:Ku(e,t,i=>{if(er(i)){let a=Tn(i,{textAlign:r});return Mc(a,n.scene.getContainerElement(i),n.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t,currentItemTextAlign:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>{let i=n.scene.getNonDeletedElementsMap();return(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.textAlign")}),(0,Ir.jsx)(c1,{group:"text-align",options:[{value:"left",text:ce("labels.left"),icon:p9e,testId:"align-left"},{value:"center",text:ce("labels.center"),icon:m9e,testId:"align-horizontal-center"},{value:"right",text:ce("labels.right"),icon:g9e,testId:"align-right"}],value:Zu(e,t,a=>{if(er(a))return a.textAlign;let o=hn(a,i);return o?o.textAlign:null},a=>er(a)||hn(a,i)!==null,a=>a?null:t.currentItemTextAlign),onChange:a=>r(a)})]})}}),UYn=jt({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,r,n)=>({elements:Ku(e,t,i=>{if(er(i)){let a=Tn(i,{verticalAlign:r});return Mc(a,n.scene.getContainerElement(i),n.scene.getNonDeletedElementsMap()),a}return i},!0),appState:{...t},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Ir.jsx)("fieldset",{children:(0,Ir.jsx)(c1,{group:"text-align",options:[{value:hd.TOP,text:ce("labels.alignTop"),icon:(0,Ir.jsx)(y9e,{theme:t.theme}),testId:"align-top"},{value:hd.MIDDLE,text:ce("labels.centerVertically"),icon:(0,Ir.jsx)(b9e,{theme:t.theme}),testId:"align-middle"},{value:hd.BOTTOM,text:ce("labels.alignBottom"),icon:(0,Ir.jsx)(v9e,{theme:t.theme}),testId:"align-bottom"}],value:Zu(e,t,i=>{if(er(i)&&i.containerId)return i.verticalAlign;let a=hn(i,n.scene.getNonDeletedElementsMap());return a?a.verticalAlign:null},i=>er(i)||hn(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:hd.MIDDLE),onChange:i=>r(i)})})}),IYn=jt({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>ar(n)?n:Tn(n,{roundness:r==="round"?{type:h5(n.type)?as.ADAPTIVE_RADIUS:as.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:r},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>{let n=Une(zi(e),t).some(i=>i.roundness?.type===as.LEGACY);return(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.edges")}),(0,Ir.jsx)(c1,{group:"edges",options:[{value:"sharp",text:ce("labels.sharp"),icon:KUe},{value:"round",text:ce("labels.round"),icon:ZUe}],value:Zu(e,t,i=>n?null:i.roundness?"round":"sharp",i=>!An(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>r(i)})]})}}),eAt=e=>[{value:null,text:ce("labels.arrowhead_none"),keyBinding:"q",icon:QUe},{value:"arrow",text:ce("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,Ir.jsx)(JUe,{flip:e})},{value:"triangle",text:ce("labels.arrowhead_triangle"),icon:(0,Ir.jsx)(n9e,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:ce("labels.arrowhead_triangle_outline"),icon:(0,Ir.jsx)(i9e,{flip:e}),keyBinding:"r"},{value:"circle",text:ce("labels.arrowhead_circle"),keyBinding:"a",icon:(0,Ir.jsx)(e9e,{flip:e})},{value:"circle_outline",text:ce("labels.arrowhead_circle_outline"),keyBinding:"s",icon:(0,Ir.jsx)(t9e,{flip:e})},{value:"diamond",text:ce("labels.arrowhead_diamond"),icon:(0,Ir.jsx)(a9e,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:ce("labels.arrowhead_diamond_outline"),icon:(0,Ir.jsx)(o9e,{flip:e}),keyBinding:"f"},{value:"bar",text:ce("labels.arrowhead_bar"),keyBinding:"z",icon:(0,Ir.jsx)(r9e,{flip:e})},{value:"crowfoot_one",text:ce("labels.arrowhead_crowfoot_one"),icon:(0,Ir.jsx)(l9e,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:ce("labels.arrowhead_crowfoot_many"),icon:(0,Ir.jsx)(s9e,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:ce("labels.arrowhead_crowfoot_one_or_many"),icon:(0,Ir.jsx)(c9e,{flip:e}),keyBinding:"v"}],RYn=jt({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,r)=>({elements:Ku(e,t,n=>{if(dn(n)){let{position:i,type:a}=r;if(i==="start")return Tn(n,{startArrowhead:a});if(i==="end")return Tn(n,{endArrowhead:a})}return n}),appState:{...t,[r.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:r.type},captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r})=>{let n=qD().rtl;return(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.arrowheads")}),(0,Ir.jsxs)("div",{className:"iconSelectList buttonList",children:[(0,Ir.jsx)(ZSt,{label:"arrowhead_start",options:eAt(!n),value:Zu(e,t,i=>dn(i)&&TU(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>r({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),(0,Ir.jsx)(ZSt,{label:"arrowhead_end",group:"arrowheads",options:eAt(!!n),value:Zu(e,t,i=>dn(i)&&TU(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>r({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}}),MYn=jt({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,r,n)=>{let i=Ku(e,t,s=>{if(!An(s))return s;let l=Tn(s,{roundness:r===Xs.round?{type:as.PROPORTIONAL_RADIUS}:null,elbowed:r===Xs.elbow,points:r===Xs.elbow||s.elbowed?[s.points[0],s.points[s.points.length-1]]:s.points});if(ar(l)){let u=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let d=rr.getPointAtIndexGlobalCoordinates(l,0,u),h=rr.getPointAtIndexGlobalCoordinates(l,-1,u),f=!l.startBinding&&vf(hf(d),e,u,t.zoom,!1,!0),p=!l.endBinding&&vf(hf(h),e,u,t.zoom,!1,!0),m=f||l.startBinding&&u.get(l.startBinding.elementId),g=p||l.endBinding&&u.get(l.endBinding.elementId),y=f?lT(l,f,"start"):d,v=p?lT(l,p,"end"):h;f&&Np(l,f,"start",u),p&&Np(l,p,"end",u),kt(l,{points:[y,v].map(b=>ne(b[0]-l.x,b[1]-l.y)),...m&&l.startBinding?{startBinding:{...l.startBinding,...SU(l,m,"start",u)}}:{},...g&&l.endBinding?{endBinding:{...l.endBinding,...SU(l,g,"end",u)}}:{}}),rr.updateEditorMidPointsCache(l,u,n.state)}return l}),a={...t,currentItemArrowType:r},o=t.selectedLinearElement?.elementId;if(o){let s=i.find(l=>l.id===o);s&&(a.selectedLinearElement=new rr(s))}return{elements:i,appState:a,captureUpdate:pt.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:r})=>(0,Ir.jsxs)("fieldset",{children:[(0,Ir.jsx)("legend",{children:ce("labels.arrowtypes")}),(0,Ir.jsx)(c1,{group:"arrowtypes",options:[{value:Xs.sharp,text:ce("labels.arrowtype_sharp"),icon:Y9e,testId:"sharp-arrow"},{value:Xs.round,text:ce("labels.arrowtype_round"),icon:X9e,testId:"round-arrow"},{value:Xs.elbow,text:ce("labels.arrowtype_elbowed"),icon:j9e,testId:"elbow-arrow"}],value:Zu(e,t,n=>An(n)?n.elbowed?Xs.elbow:n.roundness?Xs.round:Xs.sharp:null,n=>An(n),n=>n?null:t.currentItemArrowType),onChange:n=>r(n)})]})}),D6=({viewportX:e,viewportY:t,nextZoom:r},n)=>{let i=e-n.offsetLeft,a=t-n.offsetTop,o=n.zoom.value,s=n.scrollX+(i-i/o),l=n.scrollY+(a-a/o),u=-(i-i/r),d=-(a-a/r);return{scrollX:s+u,scrollY:l+d,zoom:{value:r}}},GD=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},J7t=(e,t,r="bottom")=>{let n=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=5,s=t.left+t.width/2-n.width/2;s<0?s=o:s+n.width>=i&&(s=i-n.width-o);let l;r==="bottom"?(l=t.top+t.height+o,l+n.height>=a&&(l=t.top-n.height-o)):(l=t.top-n.height-o,l<0&&(l=t.top+t.height+o)),Object.assign(e.style,{top:`${l}px`,left:`${s}px`})},hHr=(e,t,r,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=r;let i=e.getBoundingClientRect();J7t(t,i)},j6=({children:e,label:t,long:r=!1,style:n,disabled:i})=>((0,Z7t.useEffect)(()=>()=>GD().classList.remove("excalidraw-tooltip--visible"),[]),i?null:(0,Q7t.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>hHr(a.currentTarget,GD(),t,r),onPointerLeave:()=>GD().classList.remove("excalidraw-tooltip--visible"),style:n,children:e})),LYn=jt({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,r,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,r)=>({appState:{...t,...r},captureUpdate:r.viewBackgroundColor?pt.IMMEDIATELY:pt.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:r,appProps:n})=>(0,Z6.jsx)(x3e,{palette:null,topPicks:ute,label:ce("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>r({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:r})}),WD=jt({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:Db,trackEvent:{category:"canvas"},predicate:(e,t,r,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,r,n)=>(n.imageCache.clear(),{elements:e.map(i=>Tn(i,{isDeleted:!0})),appState:{...Fp(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:pt.IMMEDIATELY})}),tAt=jt({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Fte,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>({appState:{...t,...D6({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tm(t.zoom.value+sU)},t),userToFollow:null},captureUpdate:pt.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,Z6.jsx)(Qn,{type:"button",className:"zoom-in-button zoom-button",icon:Fte,title:`${ce("buttons.zoomIn")} \u2014 ${Tt("CtrlOrCmd++")}`,"aria-label":ce("buttons.zoomIn"),disabled:t.zoom.value>=cO,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ti.EQUAL||e.code===ti.NUM_ADD)&&(e[qe.CTRL_OR_CMD]||e.shiftKey)}),rAt=jt({name:"zoomOut",label:"buttons.zoomOut",icon:zte,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>({appState:{...t,...D6({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tm(t.zoom.value-sU)},t),userToFollow:null},captureUpdate:pt.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,Z6.jsx)(Qn,{type:"button",className:"zoom-out-button zoom-button",icon:zte,title:`${ce("buttons.zoomOut")} \u2014 ${Tt("CtrlOrCmd+-")}`,"aria-label":ce("buttons.zoomOut"),disabled:t.zoom.value<=lO,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ti.MINUS||e.code===ti.NUM_SUBTRACT)&&(e[qe.CTRL_OR_CMD]||e.shiftKey)}),nAt=jt({name:"resetZoom",label:"buttons.resetZoom",icon:EUe,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>({appState:{...t,...D6({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tm(1)},t),userToFollow:null},captureUpdate:pt.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>(0,Z6.jsx)(j6,{label:ce("buttons.resetZoom"),style:{height:"100%"},children:(0,Z6.jsxs)(Qn,{type:"button",className:"reset-zoom-button zoom-button",title:ce("buttons.resetZoom"),"aria-label":ce("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===ti.ZERO||e.code===ti.NUM_ZERO)&&(e[qe.CTRL_OR_CMD]||e.shiftKey)}),fHr=(e,t,r=1)=>{let[n,i,a,o]=e,s=a-n,l=t.width/s,u=o-i,d=t.height/u,h=Math.min(l,d)*Nn(r,.1,1);return Math.min(h,1)},pHr=({bounds:e,appState:t,canvasOffsets:r,fitToViewport:n=!1,viewportZoomFactor:i=1,minZoom:a=-1/0,maxZoom:o=1/0})=>{i=Nn(i,lO,cO);let[s,l,u,d]=e,h=(s+u)/2,f=(l+d)/2,p=r?.left??0,m=r?.top??0,g=r?.right??0,y=r?.bottom??0,v=t.width-p-g,b=t.height-m-y,x;if(n){let T=u-s,C=d-l;x=Math.min(v/T,b/C)*i}else x=fHr(e,{width:v,height:b},i);let E=Tm(Nn(q8e(x,sU,"floor"),a,o)),w=Nre({scenePoint:{x:h,y:f},viewportDimensions:{width:t.width,height:t.height},offsets:r,zoom:{value:E}});return{appState:{...t,scrollX:w.scrollX,scrollY:w.scrollY,zoom:{value:E}},captureUpdate:pt.EVENTUALLY}},HK=({canvasOffsets:e,targetElements:t,appState:r,fitToViewport:n,viewportZoomFactor:i,minZoom:a,maxZoom:o})=>{let s=mi(zi(t));return pHr({canvasOffsets:e,bounds:s,appState:r,fitToViewport:n,viewportZoomFactor:i,minZoom:a,maxZoom:o})},DYn=jt({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:IO,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);return HK({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===ti.TWO&&e.shiftKey&&!e.altKey&&!e[qe.CTRL_OR_CMD]}),NYn=jt({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:IO,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);return HK({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===ti.THREE&&e.shiftKey&&!e.altKey&&!e[qe.CTRL_OR_CMD]}),_Yn=jt({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:IO,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,r,n)=>HK({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===ti.ONE&&e.shiftKey&&!e.altKey&&!e[qe.CTRL_OR_CMD]}),TK=jt({name:"toggleTheme",label:(e,t)=>t.theme===Gn.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===Gn.LIGHT?wO:EO,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,r)=>({appState:{...t,theme:r||(t.theme===Gn.LIGHT?Gn.DARK:Gn.LIGHT)},captureUpdate:pt.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===ti.D,predicate:(e,t,r,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),PYn=jt({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let r;return zp(t)?r=Bo(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):r=Bo(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:pt.IMMEDIATELY}},keyTest:e=>e.key===qe.E}),mHr=jt({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:lre,viewMode:!1,perform:(e,t,r,n)=>{let i;return c5(t)?i=Bo(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=Bo(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),Fi(n.interactiveCanvas,Ii.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:pt.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[qe.CTRL_OR_CMD]&&e.key===qe.H}),z0=jt({name:"finalize",label:"",trackEvent:!1,perform:(e,t,r,n)=>{let{interactiveCanvas:i,focusContainer:a,scene:o}=n,s=o.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:f,startBindingElement:p,endBindingElement:m}=t.editingLinearElement,g=rr.getElement(f,s);if(g)return Lp(g)&&kU(g,p,m,s,o),{elements:g.points.length<2||w5(g)?e.filter(y=>y.id!==g.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:pt.IMMEDIATELY}}let l=e,u=t.pendingImageElementId&&o.getElement(t.pendingImageElementId);u&&kt(u,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();let d=t.multiElement?t.multiElement:t.newElement?.type==="freedraw"?t.newElement:null;if(d){if(d.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:p,lastCommittedPoint:m}=d;(!m||p[p.length-1]!==m)&&kt(d,{points:d.points.slice(0,-1)})}w5(d)&&(l=l.filter(p=>p.id!==d.id));let f=mm(d.points,t.zoom.value);if((d.type==="line"||d.type==="freedraw")&&f){let p=d.points,m=p[0];kt(d,{points:p.map((g,y)=>y===p.length-1?ne(m[0],m[1]):g)})}if(Lp(d)&&!f&&d.points.length>1){let[p,m]=rr.getPointAtIndexGlobalCoordinates(d,-1,Hr(e));WO(d,t,{x:p,y:m},s,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!d)&&wf(i);let h;return t.activeTool.type==="eraser"?h=Bo(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):h=Bo(t,{type:"selection"}),{elements:l,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&d?t.activeTool:h,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:d&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[d.id]:!0}:t.selectedElementIds,selectedLinearElement:d&&dn(d)?new rr(d):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:pt.IMMEDIATELY}},keyTest:(e,t)=>e.key===qe.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===qe.ESCAPE||e.key===qe.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:r})=>(0,e8t.jsx)(Qn,{type:"button",icon:LUe,title:ce("buttons.done"),"aria-label":ce("buttons.done"),onClick:t,visible:e.multiElement!=null,size:r?.size||"medium",style:{pointerEvents:"all"}})}),gHr=e=>{let{id:t}=h1(),[r,n]=(0,t8t.useState)(e.value),i=o=>{e.ignoreFocus||nUe(o.target);let s=o.target.value;s!==e.value&&e.onChange(s)},a=o=>{if(o.key===qe.ENTER){if(o.preventDefault(),o.nativeEvent.isComposing||o.keyCode===229)return;o.currentTarget.blur()}};return(0,XD.jsxs)("div",{className:"ProjectName",children:[(0,XD.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),(0,XD.jsx)("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:a,id:`${t}-filename`,value:r,onChange:o=>n(o.target.value)})]})},yHr=e=>{let t=e.title||(e.value===Gn.DARK?ce("buttons.lightMode"):ce("buttons.darkMode"));return(0,HA.jsx)(Qn,{type:"icon",icon:e.value===Gn.LIGHT?iAt.MOON:iAt.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Gn.DARK?Gn.LIGHT:Gn.DARK),"data-testid":"toggle-dark-mode"})},iAt={SUN:(0,HA.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,HA.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:(0,HA.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,HA.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},qK=(e,{selectedElementIds:t},r)=>{e=zi(e);let n=r&&ss(e,{selectedElementIds:t}),i=null,a=n?Un(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&qr(a[0])?(i=a[0],a=fB(e,i)):a.length>1&&(a=Un(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:wm(a)}},YK=async(e,t,r,n,{exportBackground:i,exportPadding:a=s5,viewBackgroundColor:o,name:s=r.name||vte,fileHandle:l=null,exportingFrame:u=null})=>{if(t.length===0)throw new Error(ce("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let h=nB(t,{exportBackground:i,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:o,exportPadding:a,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&e==="svg"},n,{exportingFrame:u});if(e==="svg")return MU(h.then(f=>new Blob([f.outerHTML],{type:Mr.svg})),{description:"Export to SVG",name:s,extension:r.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[o5.svg],fileHandle:l});if(e==="clipboard-svg"){let f=await h.then(p=>p.outerHTML);try{await RT(f)}catch{throw new Error(ce("errors.copyToSystemClipboardFailed"))}return}}let d=une(t,r,n,{exportBackground:i,viewBackgroundColor:o,exportPadding:a,exportingFrame:u});if(e==="png"){let h=_T(d);return r.exportEmbedScene&&(h=h.then(f=>Promise.resolve().then(()=>(Aee(),See)).then(({encodePngMetadata:p})=>p({blob:f,metadata:UT(t,r,n,"local")})))),MU(h,{description:"Export to PNG",name:s,extension:r.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[o5.png],fileHandle:l})}else if(e==="clipboard")try{let h=_T(d);await LRe(h)}catch(h){throw console.warn(h),h.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(ce("canvasError.canvasTooBig")):dT&&h.name==="TypeError"?new Error(`${ce("alerts.couldNotCopyToClipboard")} - -${ce("hints.firefox_clipboard_write")}`):new Error(ce("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},vHr=async(e,t,r,n)=>{let{exportBackground:i,viewBackgroundColor:a,fileHandle:o}=t,s=zne(o);if(!o||!JRe(s))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:l,exportingFrame:u}=qK(e,t,!1);return await YK(s,l,t,r,{exportBackground:i,viewBackgroundColor:a,name:n,fileHandle:o,exportingFrame:u}),{fileHandle:o}},k3e=({children:e,checked:t,onChange:r,className:n})=>(0,$D.jsxs)("div",{className:St("Checkbox",n,{"is-checked":t}),onClick:i=>{r(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,$D.jsx)("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:AUe}),(0,$D.jsx)("div",{className:"Checkbox-label",children:e})]}),bHr=jt({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,r)=>({appState:{...t,name:r},captureUpdate:pt.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:r,data:n,app:i})=>(0,Zd.jsx)(gHr,{label:ce("labels.fileTitle"),value:i.getName(),onChange:a=>t(a),ignoreFocus:n?.ignoreFocus??!1})}),xHr=jt({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,r)=>({appState:{...t,exportScale:r},captureUpdate:pt.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:r})=>{let n=zi(e),i=ss(n,t)?Un(n,t):n;return(0,Zd.jsx)(Zd.Fragment,{children:dO.map(a=>{let[o,s]=wRe(i,s5,a),l=`${ce("imageExportDialog.label.scale")} ${a}x (${o}x${s})`;return(0,Zd.jsx)(Qn,{size:"small",type:"radio",icon:`${a}x`,name:"export-canvas-scale",title:l,"aria-label":l,id:"export-canvas-scale",checked:a===t.exportScale,onChange:()=>r(a)},a)})})}}),wHr=jt({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,r)=>({appState:{...t,exportBackground:r},captureUpdate:pt.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,Zd.jsx)(k3e,{checked:e.exportBackground,onChange:r=>t(r),children:ce("imageExportDialog.label.withBackground")})}),r8t=jt({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,r)=>({appState:{...t,exportEmbedScene:r},captureUpdate:pt.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,Zd.jsxs)(k3e,{checked:e.exportEmbedScene,onChange:r=>t(r),children:[ce("imageExportDialog.label.embedScene"),(0,Zd.jsx)(j6,{label:ce("imageExportDialog.tooltip.embedScene"),long:!0,children:(0,Zd.jsx)("div",{className:"excalidraw-tooltip-icon",children:DUe})})]})}),aAt=jt({name:"saveToActiveFile",label:"buttons.save",icon:bU,trackEvent:{category:"export"},predicate:(e,t,r,n)=>!!n.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,r,n)=>{let i=!!t.fileHandle;try{let{fileHandle:a}=wB(t.fileHandle)?await vHr(e,t,n.files,n.getName()):await Jre(e,t,n.files,n.getName());return{captureUpdate:pt.EVENTUALLY,appState:{...t,fileHandle:a,toast:i?{message:a?.name?ce("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):ce("toast.fileSaved")}:null}}}catch(a){return a?.name!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:pt.EVENTUALLY}}},keyTest:e=>e.key===qe.S&&e[qe.CTRL_OR_CMD]&&!e.shiftKey}),n8t=jt({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:bU,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,r,n)=>{try{let{fileHandle:i}=await Jre(e,{...t,fileHandle:null},n.files,n.getName());return{captureUpdate:pt.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:ce("toast.fileSaved")}}}}catch(i){return i?.name!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:pt.EVENTUALLY}}},keyTest:e=>e.key===qe.S&&e.shiftKey&&e[qe.CTRL_OR_CMD],PanelComponent:({updateData:e})=>(0,Zd.jsx)(Qn,{type:"button",icon:IUe,title:ce("buttons.saveAs"),"aria-label":ce("buttons.saveAs"),showAriaLabel:gl().editor.isMobile,hidden:!M1,onClick:()=>e(null),"data-testid":"save-as-button"})}),Y4e=jt({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,r,n)=>!!n.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,r,n)=>{try{let{elements:i,appState:a,files:o}=await hRe(t,e);return{elements:i,appState:a,files:o,captureUpdate:pt.IMMEDIATELY}}catch(i){return i?.name==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:n.files,captureUpdate:pt.EVENTUALLY}}},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.O}),EHr=jt({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,r)=>({appState:{...t,exportWithDarkMode:r},captureUpdate:pt.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,Zd.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,Zd.jsx)(yHr,{value:e.exportWithDarkMode?Gn.DARK:Gn.LIGHT,onChange:r=>{t(r===Gn.DARK)},title:ce("imageExportDialog.label.darkMode")})})}),i8t="{}",THr=jt({name:"copyStyles",label:"labels.copyStyles",icon:mre,trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=[],a=e.find(o=>t.selectedElementIds[o.id]);if(i.push(a),a&&md(a)){let o=hn(a,n.scene.getNonDeletedElementsMap());i.push(o)}return a&&(i8t=JSON.stringify(i)),{appState:{...t,toast:{message:ce("toast.copyStyles")}},captureUpdate:pt.EVENTUALLY}},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.C}),kHr=jt({name:"pasteStyles",label:"labels.pasteStyles",icon:mre,trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=JSON.parse(i8t),a=i[0],o=i[1];if(!Dte(a))return{elements:e,captureUpdate:pt.EVENTUALLY};let s=Un(e,t,{includeBoundTextElement:!0}),l=s.map(u=>u.id);return{elements:e.map(u=>{if(l.includes(u.id)){let d=a;if(er(u)&&u.containerId&&(d=o),!d)return u;let h=Tn(u,{backgroundColor:d?.backgroundColor,strokeWidth:d?.strokeWidth,strokeColor:d?.strokeColor,strokeStyle:d?.strokeStyle,fillStyle:d?.fillStyle,opacity:d?.opacity,roughness:d?.roughness,roundness:d.roundness?uUe(d.roundness.type,u)?d.roundness:dUe(u):null});if(er(h)){let f=d.fontSize||bm,p=d.fontFamily||G1;h=Tn(h,{fontSize:f,fontFamily:p,textAlign:d.textAlign||hT,lineHeight:d.lineHeight||_b(p)});let m=null;h.containerId&&(m=s.find(g=>er(h)&&g.id===h.containerId)||null),Mc(h,m,n.scene.getNonDeletedElementsMap())}return h.type==="arrow"&&An(d)&&(h=Tn(h,{startArrowhead:d.startArrowhead,endArrowhead:d.endArrowhead})),qr(u)&&(h=Tn(h,{roundness:null,backgroundColor:"transparent"})),h}return u}),captureUpdate:pt.IMMEDIATELY}},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.V}),BYn=jt({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:pt.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>(0,C3e.jsx)(Qn,{type:"button",icon:Gte,"aria-label":ce("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})}),FYn=jt({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:pt.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:r})=>(0,C3e.jsx)(Qn,{visible:bB(t,zi(e)),type:"button",icon:RUe,"aria-label":ce("buttons.edit"),onClick:r,selected:t.openMenu==="shape"})}),S3e=jt({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:kUe,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,r,{focusContainer:n})=>(t.openDialog?.name==="help"&&n(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"}},captureUpdate:pt.EVENTUALLY}),keyTest:e=>e.key===qe.QUESTION_MARK}),CHr=e=>{if(e.length>=2){let t=e[0].groupIds;for(let r of t)if(e.reduce((n,i)=>n&&kT(i,r),!0))return!0}return!1},oAt=(e,t,r)=>{let n=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return n.length>=2&&!CHr(n)&&!Ane(n)},SHr=jt({name:"group",label:"labels.group",icon:e=>(0,B6.jsx)(ire,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=dB(n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:pt.EVENTUALLY};let a=Ob(t);if(a.length===1){let g=a[0],y=new Set(ya(e,g).map(b=>b.id)),v=new Set(i.map(b=>b.id));if(new Set([...Array.from(y),...Array.from(v)]).size===y.size)return{appState:t,elements:e,captureUpdate:pt.EVENTUALLY}}let o=[...e];new Set(i.map(g=>g.frameId)).size>1&&ORe(i).forEach((g,y)=>{_U(g,n.scene.getNonDeletedElementsMap())});let s=fh(),l=Hr(i);o=o.map(g=>l.get(g.id)?Tn(g,{groupIds:OIe(g.groupIds,s,t.editingGroupId)}):g);let u=ya(o,s),d=u[u.length-1],h=o.lastIndexOf(d),f=o.slice(h+1),p=o.slice(0,h).filter(g=>!kT(g,s)),m=Op([...p,...u,...f],Hr(u));return{appState:{...t,...Pre(s,{...t,selectedGroupIds:{}},zi(o))},elements:m,captureUpdate:pt.IMMEDIATELY}},predicate:(e,t,r,n)=>oAt(e,t,n),keyTest:e=>!e.shiftKey&&e[qe.CTRL_OR_CMD]&&e.key===qe.G,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,B6.jsx)(Qn,{hidden:!oAt(e,t,n),type:"button",icon:(0,B6.jsx)(ire,{theme:t.theme}),onClick:()=>r(null),title:`${ce("labels.group")} \u2014 ${Tt("CtrlOrCmd+G")}`,"aria-label":ce("labels.group"),visible:ss(zi(e),t)})}),AHr=jt({name:"ungroup",label:"labels.ungroup",icon:e=>(0,B6.jsx)(are,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=Ob(t),a=Hr(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:pt.EVENTUALLY};let o=[...e],s=[];o=o.map(h=>{ga(h)&&s.push(h.id);let f=BIe(h.groupIds,t.selectedGroupIds);return f.length===h.groupIds.length?h:Tn(h,{groupIds:f})});let l=Rc(t,zi(o),t,null),u=n.scene.getSelectedElements(t),d=new Set(u.filter(h=>h.frameId).map(h=>h.frameId));return uB(e).filter(h=>d.has(h.id)).forEach(h=>{h&&(o=Cne(o,NU(o,h,t,a),h,n))}),l.selectedElementIds=Object.entries(l.selectedElementIds).reduce((h,[f,p])=>(p&&!s.includes(f)&&(h[f]=!0),h),{}),{appState:{...t,...l},elements:o,captureUpdate:pt.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[qe.CTRL_OR_CMD]&&e.key===qe.G.toUpperCase(),predicate:(e,t)=>Ob(t).length>0,PanelComponent:({elements:e,appState:t,updateData:r})=>(0,B6.jsx)(Qn,{type:"button",hidden:Ob(t).length===0,icon:(0,B6.jsx)(are,{theme:t.theme}),onClick:()=>r(null),title:`${ce("labels.ungroup")} \u2014 ${Tt("CtrlOrCmd+Shift+G")}`,"aria-label":ce("labels.ungroup"),visible:ss(zi(e),t)})}),a8t=(e,t,r,n,i,a,o)=>{e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+i-a),e.quadraticCurveTo(t+n,r+i,t+n-a,r+i),e.lineTo(t+a,r+i),e.quadraticCurveTo(t,r+i,t,r+i-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath(),e.fill(),o&&(e.strokeStyle=o),e.stroke()};function UHr(e){let t=0;if(e.length===0)return t;for(let r=0;r`hsl(${Math.abs(UHr(t?.id||e))%37*10}, 100%, 83%)`,IHr=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},RHr=({context:e,renderConfig:t,appState:r,normalizedWidth:n,normalizedHeight:i})=>{for(let[a,o]of t.remotePointerViewportCoords){let{x:s,y:l}=o,u=r.collaborators.get(a);s-=r.offsetLeft,l-=r.offsetTop;let d=11,h=14,f=s<0||s>n-d||l<0||l>i-h;s=Math.max(s,0),s=Math.min(s,n-d),l=Math.max(l,0),l=Math.min(l,i-h);let p=jK(a,u);e.save(),e.strokeStyle=p,e.fillStyle=p;let m=t.remotePointerUserStates.get(a),g=f||m==="idle"||m==="away";g&&(e.globalAlpha=.3),t.remotePointerButton.get(a)==="down"&&(e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=p,e.stroke(),e.closePath());let y=r.theme===Gn.DARK?"#2f6330":A8e,v=u?.isSpeaking;v&&(e.fillStyle=y,e.strokeStyle=y,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=aU,e.strokeStyle=aU,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=p,e.strokeStyle=p,e.lineWidth=2,e.lineJoin="round",e.beginPath(),g?(e.moveTo(s-1,l-1),e.lineTo(s-1,l+15),e.lineTo(s+5,l+10),e.lineTo(s+12,l+9),e.closePath(),e.fill()):(e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.fill(),e.stroke());let b=t.remotePointerUsernames.get(a)||"";if(!f&&b){e.font="600 12px sans-serif";let x=(v?s+0:s)+d/2,E=(v?l+0:l)+h+2,w=5,T=3,C=e.measureText(b),S=C.actualBoundingBoxDescent+C.actualBoundingBoxAscent,R=Math.max(S,12),U=x-1,L=E-1,I=C.width+2+w*2+2,A=R+2+T*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(U,L,I,A,8),e.fillStyle=p,e.fill(),e.strokeStyle=aU,e.stroke(),v&&(e.beginPath(),e.roundRect(U-2,L-2,I+4,A+4,8),e.strokeStyle=y,e.stroke())):a8t(e,U,L,I,A,8,aU),e.fillStyle=S8e,e.fillText(b,x+w+1,E+T+C.actualBoundingBoxAscent+Math.floor((R-S)/2)+2),v){e.fillStyle=y;let P=8,D=8,M=5;e.fillRect(U+I+D,L+(A/2-P/2),2,P),e.fillRect(U+I+D+M,L+(A/2-P*2/2),2,P*2),e.fillRect(U+I+D+M*2,L+(A/2-P/2),2,P)}}e.restore(),e.closePath()}},sAt=({color:e,onClick:t,name:r,src:n,className:i})=>{let a=IHr(r),[o,s]=(0,o8t.useState)(!1),l=!o&&n,u=l?void 0:{background:e};return(0,j4e.jsx)("div",{className:St("Avatar",i),style:u,onClick:t,children:l?(0,j4e.jsx)("img",{className:"Avatar-img",src:n,alt:a,referrerPolicy:"no-referrer",onError:()=>s(!0)}):a})},WYn=jt({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,r)=>!r.socketId||t.userToFollow?.socketId===r.socketId||r.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:pt.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:r.socketId,username:r.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:pt.EVENTUALLY},PanelComponent:({updateData:e,data:t,appState:r})=>{let{socketId:n,collaborator:i,withName:a,isBeingFollowed:o}=t,s=jK(n,i),l=St({"is-followed":o,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),u=i.isInCall?i.isSpeaking?(0,Jc.jsxs)("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:ce("userList.hint.isSpeaking"),children:[(0,Jc.jsx)("div",{}),(0,Jc.jsx)("div",{}),(0,Jc.jsx)("div",{})]}):i.isMuted?(0,Jc.jsx)("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:ce("userList.hint.micMuted"),children:D9e}):(0,Jc.jsx)("div",{title:ce("userList.hint.inCall"),children:L9e}):null;return a?(0,Jc.jsxs)("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${l}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[(0,Jc.jsx)(sAt,{color:s,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:l}),(0,Jc.jsx)("div",{className:"UserList__collaborator-name",children:i.username}),(0,Jc.jsxs)("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[o&&(0,Jc.jsx)("div",{className:"UserList__collaborator-status-icon-is-followed",title:ce("userList.hint.followStatus"),children:UO}),u]})]}):(0,Jc.jsxs)("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${l}`,children:[(0,Jc.jsx)(sAt,{color:s,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:l}),u&&(0,Jc.jsx)("div",{className:"UserList__collaborator-status-icon",children:u})]})}}),MHr=jt({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let a of yte)if(i.some(o=>o.type===a))return{captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:ce(`errors.libraryElementTypeError.${a}`)}};return n.library.getLatestLibrary().then(a=>n.library.setLibrary([{id:fh(),status:"unpublished",elements:i.map(Bb),created:Date.now()},...a])).then(()=>({captureUpdate:pt.EVENTUALLY,appState:{...t,toast:{message:ce("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"}),LHr=(e,t,r,n)=>{let i=AU(e,t),a=xf(e);return i.flatMap(o=>{let s=DHr(o,a,r);return o.map(l=>{let u=kt(l,{x:l.x+s.x,y:l.y+s.y});return gu(l,n.getNonDeletedElementsMap(),{simultaneouslyUpdated:o}),u})})},DHr=(e,t,{axis:r,position:n})=>{let i=xf(e),[a,o]=r==="x"?["minX","maxX"]:["minY","maxY"],s={x:0,y:0};return n==="start"?{...s,[r]:t[a]-i[a]}:n==="end"?{...s,[r]:t[o]-i[o]}:{...s,[r]:(t[a]+t[o])/2-(i[a]+i[o])/2}},Kh=(e,t)=>{let r=t.scene.getSelectedElements(e);return r.length>1&&!r.some(n=>qr(n))},o7=(e,t,r,n)=>{let i=r.scene.getSelectedElements(t),a=Hr(e),o=LHr(i,a,n,r.scene),s=Hr(o);return x5(e.map(l=>s.get(l.id)||l),t,r)},VYn=jt({name:"alignTop",label:"labels.alignTop",icon:Zte,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"start",axis:"y"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.key===qe.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:Zte,onClick:()=>r(null),title:`${ce("labels.alignTop")} \u2014 ${Tt("CtrlOrCmd+Shift+Up")}`,"aria-label":ce("labels.alignTop"),visible:ss(zi(e),t)})}),HYn=jt({name:"alignBottom",label:"labels.alignBottom",icon:Qte,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"end",axis:"y"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.key===qe.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:Qte,onClick:()=>r(null),title:`${ce("labels.alignBottom")} \u2014 ${Tt("CtrlOrCmd+Shift+Down")}`,"aria-label":ce("labels.alignBottom"),visible:ss(zi(e),t)})}),qYn=jt({name:"alignLeft",label:"labels.alignLeft",icon:Jte,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"start",axis:"x"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.key===qe.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:Jte,onClick:()=>r(null),title:`${ce("labels.alignLeft")} \u2014 ${Tt("CtrlOrCmd+Shift+Left")}`,"aria-label":ce("labels.alignLeft"),visible:ss(zi(e),t)})}),YYn=jt({name:"alignRight",label:"labels.alignRight",icon:ere,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"end",axis:"x"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.shiftKey&&e.key===qe.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:ere,onClick:()=>r(null),title:`${ce("labels.alignRight")} \u2014 ${Tt("CtrlOrCmd+Shift+Right")}`,"aria-label":ce("labels.alignRight"),visible:ss(zi(e),t)})}),jYn=jt({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:tre,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"center",axis:"y"}),captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:tre,onClick:()=>r(null),title:ce("labels.centerVertically"),"aria-label":ce("labels.centerVertically"),visible:ss(zi(e),t)})}),XYn=jt({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:rre,trackEvent:{category:"element"},predicate:(e,t,r,n)=>Kh(t,n),perform:(e,t,r,n)=>({appState:t,elements:o7(e,t,n,{position:"center",axis:"x"}),captureUpdate:pt.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,Q6.jsx)(Qn,{hidden:!Kh(t,n),type:"button",icon:rre,onClick:()=>r(null),title:ce("labels.centerHorizontally"),"aria-label":ce("labels.centerHorizontally"),visible:ss(zi(e),t)})}),NHr=(e,t,r)=>{let[n,i,a,o]=r.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],s=xf(e),l=AU(e,t).map(f=>[f,xf(f)]).sort((f,p)=>f[1][i]-p[1][i]),u=0;for(let f of l)u+=f[1][o];let d=(s[o]-u)/(l.length-1);if(d<0){let f=l.findIndex(y=>y[1][n]===s[n]),p=l.findIndex(y=>y[1][a]===s[a]),m=(l[p][1][i]-l[f][1][i])/(l.length-1),g=l[f][1][i];return l.flatMap(([y,v],b)=>{let x={x:0,y:0};return b!==f&&b!==p&&(g+=m,x[r.axis]=g-v[i]),y.map(E=>Tn(E,{x:E.x+x.x,y:E.y+x.y}))})}let h=s[n];return l.flatMap(([f,p])=>{let m={x:0,y:0};return m[r.axis]=h-p[n],h+=d,h+=p[o],f.map(g=>Tn(g,{x:g.x+m.x,y:g.y+m.y}))})},s8t=(e,t)=>{let r=t.scene.getSelectedElements(e);return r.length>1&&!r.some(n=>qr(n))},l8t=(e,t,r,n)=>{let i=r.scene.getSelectedElements(t),a=NHr(i,r.scene.getNonDeletedElementsMap(),n),o=Hr(a);return x5(e.map(s=>o.get(s.id)||s),t,r)},$Yn=jt({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,r,n)=>({appState:t,elements:l8t(e,t,n,{space:"between",axis:"x"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.H,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,A3e.jsx)(Qn,{hidden:!s8t(t,n),type:"button",icon:OUe,onClick:()=>r(null),title:`${ce("labels.distributeHorizontally")} \u2014 ${Tt("Alt+H")}`,"aria-label":ce("labels.distributeHorizontally"),visible:ss(zi(e),t)})}),KYn=jt({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,r,n)=>({appState:t,elements:l8t(e,t,n,{space:"between",axis:"y"}),captureUpdate:pt.IMMEDIATELY}),keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.V,PanelComponent:({elements:e,appState:t,updateData:r,app:n})=>(0,A3e.jsx)(Qn,{hidden:!s8t(t,n),type:"button",icon:BUe,onClick:()=>r(null),title:`${ce("labels.distributeVertically")} \u2014 ${Tt("Alt+V")}`,"aria-label":ce("labels.distributeVertically"),visible:ss(zi(e),t)})}),_Hr=jt({name:"flipHorizontal",label:"labels.flipHorizontal",icon:O9e,trackEvent:{category:"element"},perform:(e,t,r,n)=>({elements:x5(c8t(e,n.scene.getNonDeletedElementsMap(),t,"horizontal",n),t,n),appState:t,captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ti.H}),PHr=jt({name:"flipVertical",label:"labels.flipVertical",icon:P9e,trackEvent:{category:"element"},perform:(e,t,r,n)=>({elements:x5(c8t(e,n.scene.getNonDeletedElementsMap(),t,"vertical",n),t,n),appState:t,captureUpdate:pt.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ti.V&&!e[qe.CTRL_OR_CMD]}),c8t=(e,t,r,n,i)=>{let a=Un(zi(e),r,{includeBoundTextElement:!0,includeElementsInFrames:!0}),o=OHr(a,t,r,n,i),s=Hr(o);return e.map(l=>s.get(l.id)||l)},OHr=(e,t,r,n,i)=>{if(e.every(p=>An(p)&&(p.startBinding||p.endBinding)))return e.map(p=>{let m=p;return Tn(m,{startArrowhead:m.endArrowhead,endArrowhead:m.startArrowhead})});let{midX:a,midY:o}=xf(e);One(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(p=>[p.id,Bb(p)])),{flipByX:n==="horizontal",flipByY:n==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),CU(e.filter(dn),t,i.scene.getNonDeletedElements(),i.scene,Tb(r),[],r.zoom);let{elbowArrows:s,otherElements:l}=e.reduce((p,m)=>ar(m)?{...p,elbowArrows:p.elbowArrows.concat(m)}:{...p,otherElements:p.otherElements.concat(m)},{elbowArrows:[],otherElements:[]}),{midX:u,midY:d}=xf(e),[h,f]=[a-u,o-d];return l.forEach(p=>kt(p,{x:p.x+h,y:p.y+f})),s.forEach(p=>kt(p,{x:p.x+h,y:p.y+f})),e},gK=jt({name:"copy",label:"labels.copy",icon:xO,trackEvent:{category:"element"},perform:async(e,t,r,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await IRe(i,n.files,r)}catch(a){return{captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:pt.EVENTUALLY}},keyTest:void 0}),lAt=jt({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,r,n)=>{let i;try{i=await MRe()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),dT?{captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:ce("hints.firefox_clipboard_write")}}:{captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:ce("errors.asyncPasteFailedOnRead")}})}try{n.pasteFromClipboard(URe({types:i}))}catch(a){return console.error(a),{captureUpdate:pt.EVENTUALLY,appState:{...t,errorMessage:ce("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:pt.EVENTUALLY}},keyTest:void 0}),cAt=jt({name:"cut",label:"labels.cut",icon:w9e,trackEvent:{category:"element"},perform:(e,t,r,n)=>(gK.perform(e,t,r,n),h7t.perform(e,t,null,n)),keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.X}),uAt=jt({name:"copyAsSvg",label:"labels.copyAsSvg",icon:B9e,trackEvent:{category:"element"},perform:async(e,t,r,n)=>{if(!n.canvas)return{captureUpdate:pt.EVENTUALLY};let{exportedElements:i,exportingFrame:a}=qK(e,t,!0);try{await YK("clipboard-svg",i,t,n.files,{...t,exportingFrame:a,name:n.getName()});let o=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:ce("toast.copyToClipboardAsSvg",{exportSelection:o.length?ce("toast.selection"):ce("toast.canvas"),exportColorScheme:t.exportWithDarkMode?ce("buttons.darkMode"):ce("buttons.lightMode")})}},captureUpdate:pt.EVENTUALLY}}catch(o){return console.error(o),{appState:{errorMessage:o.message},captureUpdate:pt.EVENTUALLY}}},predicate:e=>sB&&e.length>0,keywords:["svg","clipboard","copy"]}),dAt=jt({name:"copyAsPng",label:"labels.copyAsPng",icon:F9e,trackEvent:{category:"element"},perform:async(e,t,r,n)=>{if(!n.canvas)return{captureUpdate:pt.EVENTUALLY};let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:o}=qK(e,t,!0);try{return await YK("clipboard",a,t,n.files,{...t,exportingFrame:o,name:n.getName()}),{appState:{...t,toast:{message:ce("toast.copyToClipboardAsPng",{exportSelection:i.length?ce("toast.selection"):ce("toast.canvas"),exportColorScheme:t.exportWithDarkMode?ce("buttons.darkMode"):ce("buttons.lightMode")})}},captureUpdate:pt.EVENTUALLY}}catch(s){return console.error(s),{appState:{...t,errorMessage:s.message},captureUpdate:pt.EVENTUALLY}}},predicate:e=>lB&&e.length>0,keyTest:e=>e.code===ti.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),hAt=jt({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{RT(QIe(i))}catch{throw new Error(ce("errors.copyToSystemClipboardFailed"))}return{captureUpdate:pt.EVENTUALLY}},predicate:(e,t,r,n)=>sB&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(er),keywords:["text","clipboard","copy"]}),fAt=jt({name:"gridMode",icon:H9e,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:pt.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,r)=>r.gridModeEnabled===void 0,keyTest:e=>e[qe.CTRL_OR_CMD]&&e.code===ti.QUOTE}),X4e=jt({name:"zenMode",label:"buttons.zenMode",icon:G9e,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:pt.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,r)=>typeof r.zenModeEnabled>"u",keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.Z}),BHr=jt({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:z9e,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:pt.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,r)=>typeof r.objectsSnapModeEnabled>"u",keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.S}),$4e=jt({name:"stats",label:"stats.fullTitle",icon:_9e,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:pt.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.SLASH}),FHr=jt({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,r,n)=>n.scene.getSelectedElements(t).some(i=>md(i)),perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t),a=n.scene.getNonDeletedElementsMap();return i.forEach(o=>{let s=hn(o,a);if(s){let{width:l,height:u}=Jl(s.originalText,Bi(s),s.lineHeight),d=YIe(o.id);Vre(o.id);let{x:h,y:f}=IU(o,s,a);kt(s,{containerId:null,width:l,height:u,text:s.originalText,x:h,y:f}),kt(o,{boundElements:o.boundElements?.filter(p=>p.id!==s.id),height:d||o.height})}}),{elements:e,appState:t,captureUpdate:pt.IMMEDIATELY}}}),zHr=jt({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);if(i.length===2){let a=er(i[0])||er(i[1]),o;if(Mb(i[0])?o=i[0]:Mb(i[1])&&(o=i[1]),a&&o&&hn(o,n.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t),a,o;er(i[0])&&Mb(i[1])?(a=i[0],o=i[1]):(a=i[1],o=i[0]),kt(a,{containerId:o.id,verticalAlign:hd.MIDDLE,textAlign:iT.CENTER,autoResize:!0}),kt(o,{boundElements:(o.boundElements||[]).concat({type:"text",id:a.id})});let s=o.height;return Mc(a,o,n.scene.getNonDeletedElementsMap()),UU(o.id,s),{elements:GHr(e,o,a),appState:{...t,selectedElementIds:{[o.id]:!0}},captureUpdate:pt.IMMEDIATELY}}}),GHr=(e,t,r)=>{let n=e.slice(),i=n.findIndex(o=>o.id===r.id);n.splice(i,1);let a=n.findIndex(o=>o.id===t.id);return n.splice(a+1,0,r),Op(n,Hr([t,r])),n},WHr=(e,t,r)=>{let n=e.slice(),i=n.findIndex(o=>o.id===t.id);n.splice(i,1);let a=n.findIndex(o=>o.id===r.id);return n.splice(a,0,t),Op(n,Hr([t,r])),n},VHr=jt({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t),a=i.every(o=>er(o));return i.length>0&&a},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t),a=e.slice(),o={};for(let s of i)if(er(s)){let l=Hp({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...s.boundElements||[],{id:s.id,type:"text"}],angle:s.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:h5("rectangle")?as.ADAPTIVE_RADIUS:as.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:s.x-ns,y:s.y-ns,width:kb(s.width,"rectangle"),height:kb(s.height,"rectangle"),groupIds:s.groupIds,frameId:s.frameId});if(s.boundElements?.length){let u=s.boundElements.filter(d=>d.type==="arrow").map(d=>d.id);a.filter(d=>u.includes(d.id)).forEach(d=>{let h=d.startBinding,f=d.endBinding;h?.elementId===s.id&&(h={...h,elementId:l.id}),f?.elementId===s.id&&(f={...f,elementId:l.id}),(h||f)&&kt(d,{startBinding:h,endBinding:f},!1)})}kt(s,{containerId:l.id,verticalAlign:hd.MIDDLE,boundElements:null,textAlign:iT.CENTER,autoResize:!0},!1),Mc(s,l,n.scene.getNonDeletedElementsMap()),a=WHr([...a,l],l,s),o[l.id]=!0}return{elements:a,appState:{...t,selectedElementIds:o},captureUpdate:pt.IMMEDIATELY}}}),U3e=380,HHr=42,K4e=5,u8t=85,qHr=500,Z4e=!1,oK=new Map,YHr=({element:e,elementsMap:t,setAppState:r,onLinkOpen:n,setToast:i,updateEmbedValidationStatus:a})=>{let o=mN(),s=pN(),l=gl(),u=e.link||"",[d,h]=(0,up.useState)(u),f=(0,up.useRef)(null),p=o.showHyperlinkPopup==="editor",m=(0,up.useCallback)(()=>{if(!f.current)return;let x=fd(f.current.value)||null;if(!e.link&&x&&pa("hyperlink","create"),vu(e)){if(o.activeEmbeddable?.element===e&&r({activeEmbeddable:null}),!x){kt(e,{link:null}),a(e,!1);return}if(!RU(x,s.validateEmbeddable))x&&i({message:ce("toast.unableToEmbed"),closable:!0}),e.link&&oK.set(e.id,e.link),kt(e,{link:x}),a(e,!1);else{let{width:E,height:w}=e,T=v5(x);T?.error instanceof URIError&&i({message:ce("toast.unrecognizedLinkFormat"),closable:!0});let C=T?T.intrinsicSize.w/T.intrinsicSize.h:1,S=oK.get(e.id)!==e.link;kt(e,{...S?{width:T?.type==="video"?E>w?E:w*C:E,height:T?.type==="video"&&E>w?E/C:w}:{},link:x}),a(e,!0),oK.has(e.id)&&oK.delete(e.id)}}else kt(e,{link:x})},[e,i,s.validateEmbeddable,o.activeEmbeddable,r,a]);(0,up.useLayoutEffect)(()=>()=>{m()},[m]),(0,up.useEffect)(()=>{p&&f?.current&&!(l.viewport.isMobile||l.isTouchScreen)&&f.current.select()},[p,l.viewport.isMobile,l.isTouchScreen]),(0,up.useEffect)(()=>{let x=null,E=w=>{p||(x&&clearTimeout(x),$Hr(e,t,o,ne(w.clientX,w.clientY))&&(x=window.setTimeout(()=>{r({showHyperlinkPopup:!1})},qHr)))};return window.addEventListener("pointermove",E,!1),()=>{window.removeEventListener("pointermove",E,!1),x&&clearTimeout(x)}},[o,e,p,r,t]);let g=(0,up.useCallback)(()=>{pa("hyperlink","delete"),kt(e,{link:null}),r({showHyperlinkPopup:!1})},[r,e]),y=()=>{pa("hyperlink","edit","popup-ui"),r({showHyperlinkPopup:"editor"})},{x:v,y:b}=d8t(e,o,t);return o.contextMenu||o.selectedElementsAreBeingDragged||o.resizingElement||o.isRotating||o.openMenu||o.viewModeEnabled?null:(0,i1.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${b}px`,left:`${v}px`,width:U3e,padding:K4e},children:[p?(0,i1.jsx)("input",{className:St("excalidraw-hyperlinkContainer-input"),placeholder:ce("labels.link.hint"),ref:f,value:d,onChange:x=>h(x.target.value),autoFocus:!0,onKeyDown:x=>{x.stopPropagation(),x[qe.CTRL_OR_CMD]&&x.key===qe.K&&x.preventDefault(),(x.key===qe.ENTER||x.key===qe.ESCAPE)&&(m(),r({showHyperlinkPopup:"info"}))}}):e.link?(0,i1.jsx)("a",{href:fd(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:qre(e.link)?"_self":"_blank",onClick:x=>{if(e.link&&n){let E=Ate("excalidraw-link",x.nativeEvent);n({...e,link:fd(e.link)},E),E.defaultPrevented&&x.preventDefault()}},rel:"noopener noreferrer",children:e.link}):(0,i1.jsx)("div",{className:"excalidraw-hyperlinkContainer-link",children:ce("labels.link.empty")}),(0,i1.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!p&&(0,i1.jsx)(Qn,{type:"button",title:ce("buttons.edit"),"aria-label":ce("buttons.edit"),label:ce("buttons.edit"),onClick:y,className:"excalidraw-hyperlinkContainer--edit",icon:aT}),(0,i1.jsx)(Qn,{type:"button",title:ce("labels.linkToElement"),"aria-label":ce("labels.linkToElement"),label:ce("labels.linkToElement"),onClick:()=>{r({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:vre}),u&&!vu(e)&&(0,i1.jsx)(Qn,{type:"button",title:ce("buttons.remove"),"aria-label":ce("buttons.remove"),label:ce("buttons.remove"),onClick:g,className:"excalidraw-hyperlinkContainer--remove",icon:Db})]})]})},d8t=(e,t,r)=>{let[n,i]=un(e,r),{x:a,y:o}=mf({sceneX:n+e.width/2,sceneY:i},t),s=a-t.offsetLeft-U3e/2,l=o-t.offsetTop-u8t;return{x:s,y:l}},pAt=(e,t)=>{let r=Un(e,t);return vu(r[0])?"labels.link.editEmbed":r[0]?.link?"labels.link.edit":"labels.link.create"},VD=null,jHr=(e,t,r)=>{VD&&clearTimeout(VD),VD=window.setTimeout(()=>XHr(e,t,r),D8e)},XHr=(e,t,r)=>{if(!e.link)return;let n=GD();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=IT(e.link)?ce("labels.link.goToElement"):e.link;let[i,a,o,s]=un(e,r),[l,u,d,h]=JO([i,a,o,s],e.angle,t),f=mf({sceneX:l,sceneY:u},t);J7t(n,{left:f.x,top:f.y,width:d,height:h},"top"),pa("hyperlink","tooltip","link-icon"),Z4e=!0},mAt=()=>{VD&&clearTimeout(VD),Z4e&&(Z4e=!1,GD().classList.remove("excalidraw-tooltip--visible"))},$Hr=(e,t,r,[n,i])=>{let{x:a,y:o}=ca({clientX:n,clientY:i},r),s=15/r.zoom.value;if(RO(a,o,e,t))return!1;let[l,u,d]=un(e,t);if(a>=l&&a<=d&&o>=u-u8t&&o<=u)return!1;let{x:h,y:f}=d8t(e,r,t);return!(n>=h-s&&n<=h+U3e+K4e*2+s&&i>=f-s&&i<=f+s+K4e*2+HHr)},f8t=jt({name:"hyperlink",label:(e,t)=>pAt(e,t),icon:kO,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:pt.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.K,predicate:(e,t)=>Un(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:r})=>{let n=Un(e,t);return(0,h8t.jsx)(Qn,{type:"button",icon:kO,"aria-label":ce(pAt(e,t)),title:`${vu(e[0])?ce("labels.link.labelEmbed"):ce("labels.link.label")} - ${Tt("CtrlOrCmd+K")}`,onClick:()=>r(null),selected:n.length===1&&!!n[0].link})}}),C4e=e=>e.every(t=>!t.locked),KHr=jt({name:"toggleElementLock",label:(e,t,r)=>{let n=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return n.length===1&&!qr(n[0])?n[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":C4e(n)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let r=Un(t,e);return C4e(r)?bO:vU},trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);return i.length>0&&!i.some(a=>a.locked&&a.frameId)},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let a=C4e(i),o=Hr(i);return{elements:e.map(s=>o.has(s.id)?Tn(s,{locked:a}):s),appState:{...t,selectedLinearElement:a?null:t.selectedLinearElement},captureUpdate:pt.IMMEDIATELY}},keyTest:(e,t,r,n)=>e.key.toLocaleLowerCase()===qe.L&&e[qe.CTRL_OR_CMD]&&e.shiftKey&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),ZHr=jt({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:vU,predicate:(e,t)=>Un(e,t).length===0&&e.some(r=>r.locked),perform:(e,t)=>{let r=e.filter(n=>n.locked);return{elements:e.map(n=>n.locked?Tn(n,{locked:!1}):n),appState:{...t,selectedElementIds:Object.fromEntries(r.map(n=>[n.id,!0]))},captureUpdate:pt.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),QHr=()=>{let[e,t]=(0,$K.useState)(null),r=(0,$K.useCallback)(n=>t(n),[]);return[e,r]},JHr=e=>{let{closeOnClickOutside:t=!0}=e,r=R7t({className:"excalidraw-modal-container"}),n=(0,m8t.useRef)(document.body.classList.contains("excalidraw-animations-disabled"));if(!r)return null;let i=a=>{a.key===qe.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return(0,p8t.createPortal)((0,KD.jsxs)("div",{className:St("Modal",e.className,{"animations-disabled":n.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[(0,KD.jsx)("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),(0,KD.jsx)("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),r)},y8t=bs(new Map),gAt=async e=>await bne({elements:e,appState:{exportBackground:!1,viewBackgroundColor:In.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),eqr=(e,t,r)=>{let[n,i]=(0,KK.useState)();return(0,KK.useEffect)(()=>{if(t)if(e){let a=r.get(e);a?i(a):(async()=>{let o=await gAt(t);o.querySelector(".style-fonts")?.remove(),o&&(r.set(e,o),i(o))})()}else(async()=>{let a=await gAt(t);i(a)})()},[e,t,r,i]),n},v8t=()=>{let[e]=No(y8t);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(r=>e.delete(r))},svgCache:e}},tqr=class{constructor(){Oe(this,"jobs",[]),Oe(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(Qw(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let r=tUe();return this.jobs.push({jobFactory:e,promise:r,args:t}),this.tick(),r}};var rqr=new qp,ZD=bs({status:"loaded",isInitialized:!1,libraryItems:[]}),LD=e=>wm(e),nqr=(e,t)=>!e.find(r=>r.elements.length!==t.elements.length?!1:r.elements.every((n,i)=>n.id===t.elements[i].id&&n.versionNonce===t.elements[i].versionNonce)),iqr=(e,t)=>{let r=[];for(let n of t)nqr(e,n)&&r.push(n);return[...r,...e]},aqr=(e,t)=>{let r=Hr(t),n={deletedItems:new Map,addedItems:new Map};for(let a of e)r.has(a.id)||n.deletedItems.set(a.id,a);let i=Hr(e);for(let a of t)i.has(a.id)||n.addedItems.set(a.id,a);return n},oqr=class{constructor(e){Oe(this,"currLibraryItems",[]),Oe(this,"prevLibraryItems",LD(this.currLibraryItems)),Oe(this,"app"),Oe(this,"updateQueue",[]),Oe(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),Oe(this,"notifyListeners",()=>{if(this.updateQueue.length>0)W0.set(ZD,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{W0.set(ZD,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=LD(this.currLibraryItems);let r=LD(this.currLibraryItems);this.app.props.onLibraryChange?.(r),rqr.trigger(aqr(t,r),r)}catch(t){console.error(t)}}}),Oe(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],W0.set(y8t,new Map)}),Oe(this,"resetLibrary",()=>this.setLibrary([])),Oe(this,"getLatestLibrary",()=>new Promise(async t=>{try{let r=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(LD(r))}catch{return t(this.currLibraryItems)}})),Oe(this,"updateLibrary",async({libraryItems:t,prompt:r=!1,merge:n=!1,openLibraryMenu:i=!1,defaultStatus:a="unpublished"})=>(i&&this.app.setState({openSidebar:{name:bf.name,tab:cU}}),this.setLibrary(()=>new Promise(async(o,s)=>{try{let l=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),u;l instanceof Blob?u=await tMe(l,a):u=oB(l,a),!r||window.confirm(ce("alerts.confirmAddLibrary",{numShapes:u.length}))?(r&&this.app.focusContainer(),o(n?iqr(this.currLibraryItems,u):u)):s(new EU)}catch(l){s(l)}})))),Oe(this,"setLibrary",t=>{let r=new Promise(async(n,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=LD(await t),n(this.currLibraryItems)}catch(a){i(a)}}).catch(n=>{if(n.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw n}).finally(()=>{this.updateQueue=this.updateQueue.filter(n=>n!==r),this.notifyListeners()});return this.updateQueue.push(r),this.notifyListeners(),r}),this.app=e}},sqr=oqr,b8t=e=>{let t=Math.ceil(Math.sqrt(e.length)),r=[],n=f=>e.slice(f*t,f*t+t).reduce((p,m)=>{let{height:g}=xf(m.elements);return Math.max(p,g)},0),i=f=>{let p=0,m=0,g=0;for(let y of e){if(p%t===0&&(m=0),m===f){let{width:v}=xf(y.elements);g=Math.max(g,v)}p++,m++}return g},a=0,o=0,s=0,l=0,u=0,d=0,h=0;for(let f of e){u&&u%t===0&&(o+=s+50,a=0,d=0,h++),d===0&&(s=n(h)),l=i(d);let{minX:p,minY:m,width:g,height:y}=xf(f.elements),v=(l-g)/2,b=(s-y)/2;r.push(...f.elements.map(x=>({...x,x:x.x+a+v-p,y:x.y+o+b-m}))),a+=l+50,u++,d++}return r};var sK=class Q4e{constructor(t){Oe(this,"adapter"),this.adapter=t}static async getLibraryItems(t,r,n=!0){let i=()=>new Promise(async(a,o)=>{try{let s=await t.load({source:r});a(oB(s?.libraryItems||[],"published"))}catch(s){o(s)}});return n?Q4e.queue.push(i):i()}getLibraryItems(t){return Q4e.getLibraryItems(this.adapter,t,!1)}};Oe(sK,"queue",new tqr),Oe(sK,"run",async(e,t)=>{let r=new sK(e);return sK.queue.push(()=>t(r))});var lqr=(0,I3e.forwardRef)(({children:e,gap:t,align:r,justifyContent:n,className:i,style:a},o)=>(0,R3e.jsx)("div",{className:St("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:r,justifyContent:n,...a},ref:o,children:e})),cqr=(0,I3e.forwardRef)(({children:e,gap:t,align:r,justifyContent:n,className:i,style:a},o)=>(0,R3e.jsx)("div",{className:St("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:r,justifyContent:n,...a},ref:o,children:e})),sp={Row:lqr,Col:cqr},uqr=({theme:e,id:t,libraryReturnUrl:r})=>{let n=r||window.location.origin+window.location.pathname;return(0,x8t.jsx)("a",{className:"library-menu-browse-button",href:`${en.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${n}&useHash=true&token=${t}&theme=${e}&version=${lU.excalidrawLibrary}`,target:"_excalidraw_libraries",children:ce("labels.libraries")})},dqr=uqr,w8t=({libraryReturnUrl:e,theme:t,id:r,style:n,children:i,className:a})=>(0,ZK.jsxs)("div",{className:St("library-menu-control-buttons",a),style:n,children:[(0,ZK.jsx)(dqr,{id:r,libraryReturnUrl:e,theme:t}),i]}),hqr=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,fqr=/{{([\w-]+)}}/,pqr=/<([\w-]+)>/,mqr=/<\/([\w-]+)>/,gqr=(e,t)=>{let r=[{name:"",children:[]}];return e.split(hqr).filter(Boolean).forEach(n=>{let i=n.match(pqr),a=n.match(mqr),o=n.match(fqr);if(i!==null){let s=i[1];t.hasOwnProperty(s)?r.push({name:s,children:[]}):console.warn(`Trans: missed to pass in prop ${s} for interpolating ${e}`)}else if(a!==null)if(a[1]===r[r.length-1].name){let s=r.pop(),l=QD.default.createElement(QD.default.Fragment,{},...s.children),u=t[s.name];typeof u=="function"&&r[r.length-1].children.push(u(l))}else console.warn(`Trans: unexpected end tag ${n} for interpolating ${e}`);else if(o!==null){let s=o[1];t.hasOwnProperty(s)?r[r.length-1].children.push(t[s]):console.warn(`Trans: key ${s} not in props for interpolating ${e}`)}else r[r.length-1].children.push(n)}),r.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),r[0].children},yqr=({i18nKey:e,children:t,...r})=>{let{t:n}=au();return QD.default.createElement(QD.default.Fragment,{},...gqr(n(e),r))},s1=yqr,vqr=({label:e,onClick:t,className:r,children:n,actionType:i,type:a="button",isLoading:o,...s})=>{let l=i?`Dialog__action-button--${i}`:"";return(0,N6.jsxs)("button",{className:St("Dialog__action-button",l,r),type:a,"aria-label":e,onClick:t,...s,children:[n&&(0,N6.jsx)("div",{style:o?{visibility:"hidden"}:{},children:n}),(0,N6.jsx)("div",{style:o?{visibility:"hidden"}:{},children:e}),o&&(0,N6.jsx)("div",{style:{position:"absolute",inset:0},children:(0,N6.jsx)(kv,{})})]})},t7=vqr,bqr=e=>{let{onConfirm:t,onCancel:r,children:n,confirmText:i=ce("buttons.confirm"),cancelText:a=ce("buttons.cancel"),className:o="",...s}=e,l=Bs(),u=RK(M3e),{container:d}=h1();return(0,r7.jsxs)(K0,{onCloseRequest:r,size:"small",...s,className:`confirm-dialog ${o}`,children:[n,(0,r7.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,r7.jsx)(t7,{label:a,onClick:()=>{l({openMenu:null}),u(!1),(0,J4e.flushSync)(()=>{r()}),d?.focus()}}),(0,r7.jsx)(t7,{label:i,onClick:()=>{l({openMenu:null}),u(!1),(0,J4e.flushSync)(()=>{t()}),d?.focus()},actionType:"danger"})]})]})},E8t=bqr,F6=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};Oe(F6,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(r){return console.warn(`localStorage.setItem error: ${r.message}`),!1}}),Oe(F6,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var xqr=async e=>{let t=Math.round(8),r=Math.max(Math.round(128/64),2),n=J8e(e,6),i=document.createElement("canvas");i.width=n[0].length*128+(n[0].length+1)*(t*2)-t*2,i.height=n.length*128+(n.length+1)*(t*2)-t*2;let a=i.getContext("2d");a.fillStyle=Ba.white,a.fillRect(0,0,i.width,i.height);for(let[o,s]of e.entries()){let l=await cB({elements:s.elements,files:null,maxWidthOrHeight:128}),{width:u,height:d}=l,h=Math.floor(o/6)*(128+t*2),f=o%6*(128+t*2);a.drawImage(l,f+(128-u)/2+t,h+(128-d)/2+t),a.lineWidth=r,a.strokeStyle=Ba.gray[4],a.strokeRect(f+t/2,h+t/2,128+t,128+t)}return await EB(new File([await _T(i)],"preview",{type:Mr.png}),{outputType:Mr.jpg,maxWidthOrHeight:5e3})},wqr=({libItem:e,appState:t,index:r,onChange:n,onRemove:i})=>{let a=(0,$h.useRef)(null),o=(0,$h.useRef)(null);return(0,$h.useEffect)(()=>{let s=a.current;s&&(async()=>{let l=await bne({elements:e.elements,appState:{...t,viewBackgroundColor:Ba.white,exportBackground:!0},files:null,skipInliningFonts:!0});s.innerHTML=l.outerHTML})()},[e.elements,t]),(0,_r.jsxs)("div",{className:"single-library-item",children:[e.status==="published"&&(0,_r.jsx)("span",{className:"single-library-item-status",children:ce("labels.statusPublished")}),(0,_r.jsx)("div",{ref:a,className:"single-library-item__svg"}),(0,_r.jsx)(Qn,{"aria-label":ce("buttons.remove"),type:"button",icon:p5,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:ce("buttons.remove")}),(0,_r.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,_r.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,_r.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,_r.jsx)("span",{style:{fontWeight:500,color:Ba.gray[6]},children:ce("publishDialog.itemName")}),(0,_r.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,_r.jsx)("input",{type:"text",ref:o,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:s=>{n(s.target.value,r)}})]}),(0,_r.jsx)("span",{className:"error",children:e.error})]})]})},Eqr=({onClose:e,libraryItems:t,appState:r,onSuccess:n,onError:i,updateItemsInStorage:a,onRemove:o})=>{let[s,l]=(0,$h.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[u,d]=(0,$h.useState)(!1);(0,$h.useEffect)(()=>{let x=F6.get(fT.PUBLISH_LIBRARY);x&&l(x)},[]);let[h,f]=(0,$h.useState)(t.slice());(0,$h.useEffect)(()=>{f(t.slice())},[t]);let p=x=>{l({...s,[x.target.name]:x.target.value})},m=async x=>{x.preventDefault(),d(!0);let E=[],w=!1;if(h.forEach(L=>{let I="";L.name||(I=ce("publishDialog.errors.required"),w=!0),E.push({...L,error:I})}),w){f(E),d(!1);return}let T=await xqr(h),C={type:uh.excalidrawLibrary,version:lU.excalidrawLibrary,source:sO,libraryItems:h},S=JSON.stringify(C,null,2),R=new Blob([S],{type:"application/json"}),U=new FormData;U.append("excalidrawLib",R),U.append("previewImage",T),U.append("previewImageType",T.type),U.append("title",s.name),U.append("authorName",s.authorName),U.append("githubHandle",s.githubHandle),U.append("name",s.name),U.append("description",s.description),U.append("twitterHandle",s.twitterHandle),U.append("website",s.website),fetch(`${en.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:U}).then(L=>L.ok?L.json().then(({url:I})=>{F6.delete(fT.PUBLISH_LIBRARY),n({url:I,authorName:s.authorName,items:h})}):L.json().catch(()=>{throw new Error(L.statusText||"something went wrong")}).then(I=>{throw new Error(I.message||L.statusText||"something went wrong")}),L=>{console.error(L),i(L),d(!1)}).catch(L=>{console.error(L),i(L),d(!1)})},g=()=>{let x=[];return h.forEach((E,w)=>{x.push((0,_r.jsx)("div",{className:"single-library-item-wrapper",children:(0,_r.jsx)(wqr,{libItem:E,appState:r,index:w,onChange:(T,C)=>{let S=h.slice();S[C].name=T,f(S)},onRemove:o})},w))}),(0,_r.jsx)("div",{className:"selected-library-items",children:x})},y=(0,$h.useCallback)(()=>{a(h),F6.set(fT.PUBLISH_LIBRARY,s),e()},[h,e,a,s]),v=!!t.length,b=t.some(x=>x.status==="published");return(0,_r.jsx)(K0,{onCloseRequest:y,title:ce("publishDialog.title"),className:"publish-library",children:v?(0,_r.jsxs)("form",{onSubmit:m,children:[(0,_r.jsx)("div",{className:"publish-library-note",children:(0,_r.jsx)(s1,{i18nKey:"publishDialog.noteDescription",link:x=>(0,_r.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:x})})}),(0,_r.jsx)("span",{className:"publish-library-note",children:(0,_r.jsx)(s1,{i18nKey:"publishDialog.noteGuidelines",link:x=>(0,_r.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:x})})}),(0,_r.jsx)("div",{className:"publish-library-note",children:ce("publishDialog.noteItems")}),b&&(0,_r.jsx)("span",{className:"publish-library-note publish-library-warning",children:ce("publishDialog.republishWarning")}),g(),(0,_r.jsxs)("div",{className:"publish-library__fields",children:[(0,_r.jsxs)("label",{children:[(0,_r.jsxs)("div",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.libraryName")}),(0,_r.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,_r.jsx)("input",{type:"text",name:"name",required:!0,value:s.name,onChange:p,placeholder:ce("publishDialog.placeholder.libraryName")})]}),(0,_r.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,_r.jsxs)("div",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.libraryDesc")}),(0,_r.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,_r.jsx)("textarea",{name:"description",rows:4,required:!0,value:s.description,onChange:p,placeholder:ce("publishDialog.placeholder.libraryDesc")})]}),(0,_r.jsxs)("label",{children:[(0,_r.jsxs)("div",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.authorName")}),(0,_r.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,_r.jsx)("input",{type:"text",name:"authorName",required:!0,value:s.authorName,onChange:p,placeholder:ce("publishDialog.placeholder.authorName")})]}),(0,_r.jsxs)("label",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.githubUsername")}),(0,_r.jsx)("input",{type:"text",name:"githubHandle",value:s.githubHandle,onChange:p,placeholder:ce("publishDialog.placeholder.githubHandle")})]}),(0,_r.jsxs)("label",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.twitterUsername")}),(0,_r.jsx)("input",{type:"text",name:"twitterHandle",value:s.twitterHandle,onChange:p,placeholder:ce("publishDialog.placeholder.twitterHandle")})]}),(0,_r.jsxs)("label",{children:[(0,_r.jsx)("span",{children:ce("publishDialog.website")}),(0,_r.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:ce("publishDialog.errors.website"),value:s.website,onChange:p,placeholder:ce("publishDialog.placeholder.website")})]}),(0,_r.jsx)("span",{className:"publish-library-note",children:(0,_r.jsx)(s1,{i18nKey:"publishDialog.noteLicense",link:x=>(0,_r.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:x})})})]}),(0,_r.jsxs)("div",{className:"publish-library__buttons",children:[(0,_r.jsx)(t7,{label:ce("buttons.cancel"),onClick:y,"data-testid":"cancel-clear-canvas-button"}),(0,_r.jsx)(t7,{type:"submit",label:ce("buttons.submit"),actionType:"primary",isLoading:u})]})]}):(0,_r.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:ce("publishDialog.atleastOneLibItem")})})},Tqr=Eqr,k8t=({className:e="",children:t,onToggle:r,title:n,...i})=>{let a=gl(),o=St(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.editor.isMobile}).trim();return(0,T8t.jsx)("button",{"data-prevent-outside-click":!0,className:o,onClick:r,type:"button","data-testid":"dropdown-menu-button",title:n,...i,children:t})},kqr=k8t;k8t.displayName="DropdownMenuTrigger";var S8t=()=>(0,C8t.jsx)("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),Cqr=S8t;S8t.displayName="DropdownMenuSeparator";var A8t=({children:e,onClickOutside:t,className:r="",onSelect:n,style:i})=>{let a=gl(),o=(0,QK.useRef)(null),s=OK({onClickOutside:t});b3e(o,()=>{s.onClickOutside?.()}),(0,QK.useEffect)(()=>{let u=h=>{h.key===qe.ESCAPE&&(h.stopImmediatePropagation(),s.onClickOutside?.())},d={capture:!0};return document.addEventListener("keydown",u,d),()=>{document.removeEventListener("keydown",u,d)}},[s]);let l=St(`dropdown-menu ${r}`,{"dropdown-menu--mobile":a.editor.isMobile}).trim();return(0,FD.jsx)(H7t.Provider,{value:{onSelect:n},children:(0,FD.jsx)("div",{ref:o,className:l,style:i,"data-testid":"dropdown-menu",children:a.editor.isMobile?(0,FD.jsx)(sp.Col,{className:"dropdown-menu-container",children:e}):(0,FD.jsx)(Y0,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};A8t.displayName="DropdownMenuContent";var Sqr=A8t,U8t=({icon:e,shortcut:t,href:r,children:n,onSelect:i,className:a="",selected:o,rel:s="noreferrer",...l})=>{let u=Y7t(l.onClick,i);return(0,e3e.jsx)("a",{...l,href:r,target:"_blank",rel:"noreferrer",className:q7t(a,o),title:l.title??l["aria-label"],onClick:u,children:(0,e3e.jsx)(j7t,{icon:e,shortcut:t,children:n})})},yK=U8t;U8t.displayName="DropdownMenuItemLink";var Aqr=({children:e,className:t="",selected:r,...n})=>(0,I8t.jsx)("div",{...n,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${r?"dropdown-menu-item--selected":""}`.trim(),children:e}),Uqr=Aqr,Iqr=e=>JD.default.Children.toArray(e).find(r=>JD.default.isValidElement(r)&&typeof r.type!="string"&&r?.type.displayName&&r.type.displayName==="DropdownMenuTrigger")||null,Rqr=e=>JD.default.Children.toArray(e).find(r=>JD.default.isValidElement(r)&&typeof r.type!="string"&&r?.type.displayName&&r.type.displayName==="DropdownMenuContent")||null,Sv=({children:e,open:t})=>{let r=Iqr(e),n=Rqr(e);return(0,JK.jsxs)(JK.Fragment,{children:[r,t&&n]})};Sv.Trigger=kqr;Sv.Content=Sqr;Sv.Item=dp;Sv.ItemLink=yK;Sv.ItemCustom=Uqr;Sv.Group=q4e;Sv.Separator=Cqr;var wa=Sv;Sv.displayName="DropdownMenu";var Mqr=(e,t)=>e.filter(r=>t.includes(r.id)),Lqr=({setAppState:e,selectedItems:t,library:r,onRemoveFromLibrary:n,resetLibrary:i,onSelectItems:a,appState:o,className:s})=>{let[l]=No(ZD),[u,d]=No(M3e),h=()=>{let U=t.length?ce("alerts.removeItemsFromsLibrary",{count:t.length}):ce("alerts.resetLibrary"),L=t.length?ce("confirmDialog.removeItemsFromLib"):ce("confirmDialog.resetLibrary");return(0,_s.jsx)(E8t,{onConfirm:()=>{t.length?n():i(),p(!1)},onCancel:()=>{p(!1)},title:L,children:(0,_s.jsx)("p",{children:U})})},[f,p]=(0,KA.useState)(!1),m=!!t.length,g=m?l.libraryItems.filter(U=>t.includes(U.id)):l.libraryItems,y=ce(m?"buttons.remove":"buttons.resetLibrary"),[v,b]=(0,KA.useState)(!1),[x,E]=(0,KA.useState)(null),w=(0,KA.useCallback)(()=>(0,_s.jsxs)(K0,{onCloseRequest:()=>E(null),title:ce("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[(0,_s.jsx)("p",{children:(0,_s.jsx)(s1,{i18nKey:"publishSuccessDialog.content",authorName:x.authorName,link:U=>(0,_s.jsx)("a",{href:x?.url,target:"_blank",rel:"noopener noreferrer",children:U})})}),(0,_s.jsx)(Qn,{type:"button",title:ce("buttons.close"),"aria-label":ce("buttons.close"),label:ce("buttons.close"),onClick:()=>E(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[E,x]),T=(U,L)=>{b(!1),E({url:U.url,authorName:U.authorName});let I=L.slice();I.forEach(A=>{t.includes(A.id)&&(A.status="published")}),r.setLibrary(I)},C=async()=>{try{await r.updateLibrary({libraryItems:QO({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(U){if(U?.name==="AbortError"){console.warn(U);return}e({errorMessage:ce("errors.importLibraryError")})}},S=async()=>{let U=m?g:await r.getLatestLibrary();pRe(U).catch(kte).catch(L=>{e({errorMessage:L.message})})},R=()=>(0,_s.jsxs)(wa,{open:u,children:[(0,_s.jsx)(wa.Trigger,{onToggle:()=>d(!u),children:gUe}),(0,_s.jsxs)(wa.Content,{onClickOutside:()=>d(!1),onSelect:()=>d(!1),className:"library-menu",children:[!m&&(0,_s.jsx)(wa.Item,{onSelect:C,icon:CO,"data-testid":"lib-dropdown--load",children:ce("buttons.load")}),!!g.length&&(0,_s.jsx)(wa.Item,{onSelect:S,icon:bU,"data-testid":"lib-dropdown--export",children:ce("buttons.export")}),!!g.length&&(0,_s.jsx)(wa.Item,{onSelect:()=>p(!0),icon:Db,children:y}),m&&(0,_s.jsx)(wa.Item,{icon:x9e,onSelect:()=>b(!0),"data-testid":"lib-dropdown--remove",children:ce("buttons.publishLibrary")})]})]});return(0,_s.jsxs)("div",{className:St("library-menu-dropdown-container",s),children:[R(),t.length>0&&(0,_s.jsx)("div",{className:"library-actions-counter",children:t.length}),f&&h(),v&&(0,_s.jsx)(Tqr,{onClose:()=>b(!1),libraryItems:Mqr(l.libraryItems,t),appState:o,onSuccess:U=>T(U,l.libraryItems),onError:U=>window.alert(U),updateItemsInStorage:()=>r.setLibrary(l.libraryItems),onRemove:U=>a(t.filter(L=>L!==U))}),x&&w()]})},yAt=({selectedItems:e,onSelectItems:t,className:r})=>{let{library:n}=d1(),{clearLibraryCache:i,deleteItemsFromLibraryCache:a}=v8t(),o=Ec(),s=Bs(),[l]=No(ZD),u=async d=>{let h=d.filter(f=>!e.includes(f.id));n.setLibrary(h).catch(()=>{s({errorMessage:ce("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return(0,_s.jsx)(Lqr,{appState:o,setAppState:s,selectedItems:e,onSelectItems:t,library:n,onRemoveFromLibrary:()=>u(l.libraryItems),resetLibrary:()=>{n.resetLibrary(),i()},className:r})},Dqr=(0,gw.memo)(({id:e,elements:t,isPending:r,onClick:n,selected:i,onToggle:a,onDrag:o,svgCache:s})=>{let l=(0,gw.useRef)(null),u=eqr(e,t,s);(0,gw.useEffect)(()=>{let m=l.current;if(m)return u&&(m.innerHTML=u.outerHTML),()=>{m.innerHTML=""}},[u]);let[d,h]=(0,gw.useState)(!1),f=gl().editor.isMobile,p=r&&(0,z6.jsx)("div",{className:"library-unit__adder",children:mUe});return(0,z6.jsxs)("div",{className:St("library-unit",{"library-unit__active":t,"library-unit--hover":t&&d,"library-unit--selected":i,"library-unit--skeleton":!u}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,z6.jsx)("div",{className:St("library-unit__dragger",{"library-unit__pulse":!!r}),ref:l,draggable:!!t,onClick:t||r?m=>{e&&m.shiftKey?a(e,m):n(e)}:void 0,onDragStart:m=>{if(!e){m.preventDefault();return}h(!1),o(e,m)}}),p,e&&t&&(d||f||i)&&(0,z6.jsx)(k3e,{checked:i,onChange:(m,g)=>a(e,g),className:"library-unit__checkbox"})]})}),Nqr=()=>(0,z6.jsx)("div",{className:"library-unit library-unit--skeleton"});function _qr(){return[!1,(0,eZ.useCallback)(e=>e(),[])]}var Pqr=eZ.default.useTransition||_qr,vAt=({children:e})=>(0,G6.jsx)("div",{className:"library-menu-items-container__grid",children:e}),S4e=(0,s7.memo)(({items:e,onItemSelectToggle:t,onItemDrag:r,isItemSelected:n,onClick:i,svgCache:a,itemsRenderedPerBatch:o})=>{let[,s]=Pqr(),[l,u]=(0,s7.useState)(0);return(0,s7.useEffect)(()=>{l{u(l+o)})},[l,e.length,s,o]),(0,G6.jsx)(G6.Fragment,{children:e.map((d,h)=>h{let[t,r]=No(Oqr);return(0,R8t.useEffect)(()=>{let{current:n}=e;if(!n)return;let i=(0,M8t.default)(()=>{let{scrollTop:a}=n;r(a)},200);return n.addEventListener("scroll",i),()=>{i.cancel(),n.removeEventListener("scroll",i)}},[e,r]),t},Fqr=17,zqr=64;function Gqr({isLoading:e,libraryItems:t,onAddToLibrary:r,onInsertLibraryItems:n,pendingElements:i,theme:a,id:o,libraryReturnUrl:s,onSelectItems:l,selectedItems:u}){let d=(0,tu.useRef)(null),h=Bqr(d);(0,tu.useEffect)(()=>{h>0&&d.current?.scrollTo(0,h)},[]);let{svgCache:f}=v8t(),p=(0,tu.useMemo)(()=>t.filter(U=>U.status!=="published"),[t]),m=(0,tu.useMemo)(()=>t.filter(U=>U.status==="published"),[t]),g=!t.length&&!i.length,y=!i.length&&!p.length&&!m.length,[v,b]=(0,tu.useState)(null),x=(0,tu.useCallback)((U,L)=>{let I=!u.includes(U),A=[...p,...m];if(I){if(L.shiftKey&&v){let P=A.findIndex(_=>_.id===v),D=A.findIndex(_=>_.id===U);if(P===-1||D===-1){l([...u,U]);return}let M=Hr(u),O=A.reduce((_,B,F)=>((F>=P&&F<=D||M.has(B.id))&&_.push(B.id),_),[]);l(O)}else l([...u,U]);b(U)}else b(null),l(u.filter(P=>P!==U))},[v,l,m,u,p]),E=(0,tu.useCallback)(U=>{let L;return u.includes(U)?L=t.filter(I=>u.includes(I.id)):L=t.filter(I=>I.id===U),L.map(I=>({...I,elements:Qre(I.elements,{randomizeSeed:!0})}))},[t,u]),w=(0,tu.useCallback)((U,L)=>{L.dataTransfer.setData(Mr.excalidrawlib,ene(E(U)))},[E]),T=(0,tu.useCallback)(U=>U?u.includes(U):!1,[u]),C=(0,tu.useCallback)(()=>{r(i)},[i,r]),S=(0,tu.useCallback)(U=>{U&&n(E(U))},[E,n]),R=f.size>=t.length?zqr:Fqr;return(0,Xa.jsxs)("div",{className:"library-menu-items-container",style:i.length||p.length||m.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!y&&(0,Xa.jsx)(yAt,{selectedItems:u,onSelectItems:l,className:"library-menu-dropdown-container--in-heading"}),(0,Xa.jsxs)(sp.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:m.length>0?1:"0 1 auto",marginBottom:0},ref:d,children:[(0,Xa.jsxs)(Xa.Fragment,{children:[!y&&(0,Xa.jsx)("div",{className:"library-menu-items-container__header",children:ce("labels.personalLib")}),e&&(0,Xa.jsx)("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:(0,Xa.jsx)(kv,{})}),!i.length&&!p.length?(0,Xa.jsxs)("div",{className:"library-menu-items__no-items",children:[(0,Xa.jsx)("div",{className:"library-menu-items__no-items__label",children:ce("library.noItems")}),(0,Xa.jsx)("div",{className:"library-menu-items__no-items__hint",children:m.length>0?ce("library.hint_emptyPrivateLibrary"):ce("library.hint_emptyLibrary")})]}):(0,Xa.jsxs)(vAt,{children:[i.length>0&&(0,Xa.jsx)(S4e,{itemsRenderedPerBatch:R,items:[{id:null,elements:i}],onItemSelectToggle:x,onItemDrag:w,onClick:C,isItemSelected:T,svgCache:f}),(0,Xa.jsx)(S4e,{itemsRenderedPerBatch:R,items:p,onItemSelectToggle:x,onItemDrag:w,onClick:S,isItemSelected:T,svgCache:f})]})]}),(0,Xa.jsxs)(Xa.Fragment,{children:[(m.length>0||i.length>0||p.length>0)&&(0,Xa.jsx)("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:ce("labels.excalidrawLib")}),m.length>0?(0,Xa.jsx)(vAt,{children:(0,Xa.jsx)(S4e,{itemsRenderedPerBatch:R,items:m,onItemSelectToggle:x,onItemDrag:w,onClick:S,isItemSelected:T,svgCache:f})}):p.length>0?(0,Xa.jsx)("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:ce("library.noItems")}):null]}),g&&(0,Xa.jsx)(w8t,{style:{padding:"16px 0",width:"100%"},id:o,libraryReturnUrl:s,theme:a,children:(0,Xa.jsx)(yAt,{selectedItems:u,onSelectItems:l})})]})]})}var M3e=bs(!1),bAt=({children:e})=>(0,rp.jsx)("div",{className:"layer-ui__library",children:e}),Wqr=(0,ql.memo)(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:r,setAppState:n,libraryReturnUrl:i,library:a,id:o,theme:s,selectedItems:l,onSelectItems:u})=>{let[d]=No(ZD),h=(0,ql.useCallback)(m=>{(async(g,y)=>{pa("element","addToLibrary","ui");for(let b of yte)if(g.some(x=>x.type===b))return n({errorMessage:ce(`errors.libraryElementTypeError.${b}`)});let v=[{status:"unpublished",elements:g,id:fh(),created:Date.now()},...y];r(),a.setLibrary(v).catch(()=>{n({errorMessage:ce("alerts.errorAddingToLibrary")})})})(m,d.libraryItems)},[r,a,n,d.libraryItems]),f=(0,ql.useMemo)(()=>d.libraryItems,[d]);if(d.status==="loading"&&!d.isInitialized)return(0,rp.jsx)(bAt,{children:(0,rp.jsx)("div",{className:"layer-ui__library-message",children:(0,rp.jsxs)("div",{children:[(0,rp.jsx)(kv,{size:"2em"}),(0,rp.jsx)("span",{children:ce("labels.libraryLoadingMessage")})]})})});let p=d.libraryItems.length>0||t.length>0;return(0,rp.jsxs)(bAt,{children:[(0,rp.jsx)(Gqr,{isLoading:d.status==="loading",libraryItems:f,onAddToLibrary:h,onInsertLibraryItems:e,pendingElements:t,id:o,libraryReturnUrl:i,theme:s,onSelectItems:u,selectedItems:l}),p&&(0,rp.jsx)(w8t,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:o,libraryReturnUrl:i,theme:s})]})}),A4e=(e,t)=>({elements:e,pending:Un(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),Vqr=(e,t)=>{let r=uZ(),[n,i]=(0,ql.useState)(()=>A4e(r,e.selectedElementIds)),a=(0,ql.useRef)(new Map);return(0,ql.useEffect)(()=>{for(let o of n.pending)a.current.set(o.id,o.version)},[n.pending]),(0,ql.useEffect)(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(o=>{if(!El(o.selectedElementIds,e.selectedElementIds))return a.current.clear(),A4e(r,e.selectedElementIds);let s=t.scene.getNonDeletedElementsMap();for(let l of Object.keys(e.selectedElementIds)){let u=s.get(l)?.version;if(u&&u!==a.current.get(l))return A4e(r,e.selectedElementIds)}return o})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,r]),n.pending},Hqr=(0,ql.memo)(()=>{let e=d1(),{onInsertElements:t}=e,r=pN(),n=Ec(),i=Bs(),[a,o]=(0,ql.useState)([]),s=(0,ql.useMemo)(()=>e.library,[e.library]),l=Vqr(n,e),u=(0,ql.useCallback)(h=>{t(b8t(h))},[t]),d=(0,ql.useCallback)(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return(0,rp.jsx)(Wqr,{pendingElements:l,onInsertLibraryItems:u,onAddToLibrary:d,setAppState:i,libraryReturnUrl:r.libraryReturnUrl,library:s,id:e.id,theme:n.theme,selectedItems:a,onSelectItems:o})});function qqr(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;default:return 800}}var K0=e=>{let[t,r]=QHr(),[n]=(0,XK.useState)(document.activeElement),{id:i}=h1(),a=gl().viewport.isMobile;(0,XK.useEffect)(()=>{if(!t)return;let u=pO(t);setTimeout(()=>{u.length>0&&e.autofocus!==!1&&(u[1]||u[0]).focus()});let d=h=>{if(h.key===qe.TAB){let f=pO(t),{activeElement:p}=document,m=f.findIndex(g=>g===p);m===0&&h.shiftKey?(f[f.length-1].focus(),h.preventDefault()):m===f.length-1&&!h.shiftKey&&(f[0].focus(),h.preventDefault())}};return t.addEventListener("keydown",d),()=>t.removeEventListener("keydown",d)},[t,e.autofocus]);let o=Bs(),s=RK(M3e),l=()=>{o({openMenu:null}),s(!1),n.focus(),e.onCloseRequest()};return(0,aw.jsx)(JHr,{className:St("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:qqr(e.size),onCloseRequest:l,closeOnClickOutside:e.closeOnClickOutside,children:(0,aw.jsxs)(Y0,{ref:r,children:[e.title&&(0,aw.jsx)("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:(0,aw.jsx)("span",{className:"Dialog__titleContent",children:e.title})}),a&&(0,aw.jsx)("button",{className:"Dialog__close",onClick:l,title:ce("buttons.close"),"aria-label":ce("buttons.close"),type:"button",children:p5}),(0,aw.jsx)("div",{className:"Dialog__content",children:e.children})]})})},X6=({type:e="button",onSelect:t,selected:r,children:n,className:i="",...a})=>(0,L8t.jsx)("button",{onClick:pU(a.onClick,o=>{t()}),type:e,className:St("excalidraw-button",i,{selected:r}),...a,children:n}),L3e=(0,u1.forwardRef)(({onChange:e,label:t,fullWidth:r,placeholder:n,readonly:i,selectOnRender:a,onKeyDown:o,isRedacted:s=!1,icon:l,className:u,...d},h)=>{let f=(0,u1.useRef)(null);(0,u1.useImperativeHandle)(h,()=>f.current),(0,u1.useLayoutEffect)(()=>{a&&(f.current?.focus(),f.current?.select())},[a]);let[p,m]=(0,u1.useState)(!1);return(0,W6.jsxs)("div",{className:St("ExcTextField",u,{"ExcTextField--fullWidth":r,"ExcTextField--hasIcon":!!l}),onClick:()=>{f.current?.focus()},children:[l,t&&(0,W6.jsx)("div",{className:"ExcTextField__label",children:t}),(0,W6.jsxs)("div",{className:St("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[(0,W6.jsx)("input",{className:St({"is-redacted":"value"in d&&d.value&&s&&!p}),readOnly:i,value:"value"in d?d.value:void 0,defaultValue:"defaultValue"in d?d.defaultValue:void 0,placeholder:n,ref:f,onChange:g=>e?.(g.target.value),onKeyDown:o}),s&&(0,W6.jsx)(X6,{onSelect:()=>m(!p),style:{border:0,userSelect:"none"},children:p?U9e:UO})]})]})}),Yqr={toggleTheme:[Tt("Shift+Alt+D")],saveScene:[Tt("CtrlOrCmd+S")],loadScene:[Tt("CtrlOrCmd+O")],clearCanvas:[Tt("CtrlOrCmd+Delete")],imageExport:[Tt("CtrlOrCmd+Shift+E")],commandPalette:[Tt("CtrlOrCmd+/"),Tt("CtrlOrCmd+Shift+P")],cut:[Tt("CtrlOrCmd+X")],copy:[Tt("CtrlOrCmd+C")],paste:[Tt("CtrlOrCmd+V")],copyStyles:[Tt("CtrlOrCmd+Alt+C")],pasteStyles:[Tt("CtrlOrCmd+Alt+V")],selectAll:[Tt("CtrlOrCmd+A")],deleteSelectedElements:[Tt("Delete")],duplicateSelection:[Tt("CtrlOrCmd+D"),Tt(`Alt+${ce("helpDialog.drag")}`)],sendBackward:[Tt("CtrlOrCmd+[")],bringForward:[Tt("CtrlOrCmd+]")],sendToBack:[Bp?Tt("CtrlOrCmd+Alt+["):Tt("CtrlOrCmd+Shift+[")],bringToFront:[Bp?Tt("CtrlOrCmd+Alt+]"):Tt("CtrlOrCmd+Shift+]")],copyAsPng:[Tt("Shift+Alt+C")],group:[Tt("CtrlOrCmd+G")],ungroup:[Tt("CtrlOrCmd+Shift+G")],gridMode:[Tt("CtrlOrCmd+'")],zenMode:[Tt("Alt+Z")],objectsSnapMode:[Tt("Alt+S")],stats:[Tt("Alt+/")],addToLibrary:[],flipHorizontal:[Tt("Shift+H")],flipVertical:[Tt("Shift+V")],viewMode:[Tt("Alt+R")],hyperlink:[Tt("CtrlOrCmd+K")],toggleElementLock:[Tt("CtrlOrCmd+Shift+L")],resetZoom:[Tt("CtrlOrCmd+0")],zoomOut:[Tt("CtrlOrCmd+-")],zoomIn:[Tt("CtrlOrCmd++")],zoomToFitSelection:[Tt("Shift+3")],zoomToFit:[Tt("Shift+1")],zoomToFitSelectionInViewport:[Tt("Shift+2")],toggleEraserTool:[Tt("E")],toggleHandTool:[Tt("H")],setFrameAsActiveTool:[Tt("F")],saveFileToDisk:[Tt("CtrlOrCmd+S")],saveToActiveFile:[Tt("CtrlOrCmd+S")],toggleShortcuts:[Tt("?")],searchMenu:[Tt("CtrlOrCmd+F")],wrapSelectionInFrame:[]},iu=(e,t=0)=>{let r=Yqr[e];return r&&r.length>0?r[t]||r[0]:""},jqr="\\u0300-\\u036f",Xqr="\\ufe20-\\ufe2f",$qr="\\u20d0-\\u20ff",Kqr=jqr+Xqr+$qr,Zqr=`[${Kqr}]`,Qqr=RegExp(Zqr,"g"),Jqr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eYr={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"E",\u00E6:"e",\u00DE:"T",\u00FE:"t",\u00DF:"s",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"I",\u0133:"i",\u0152:"E",\u0153:"e",\u0149:"n",\u017F:"s"},xAt=e=>e.replace(Jqr,t=>eYr[t]||t).replace(Qqr,""),_8t=tZ.default.createContext(null),Qu=()=>tZ.default.useContext(_8t),tYr=IB(),rYr=()=>tZ.default.useMemo(()=>({MainMenuTunnel:Zp(),WelcomeScreenMenuHintTunnel:Zp(),WelcomeScreenToolbarHintTunnel:Zp(),WelcomeScreenHelpHintTunnel:Zp(),WelcomeScreenCenterTunnel:Zp(),FooterCenterTunnel:Zp(),DefaultSidebarTriggerTunnel:Zp(),DefaultSidebarTabTriggersTunnel:Zp(),OverwriteConfirmDialogTunnel:Zp(),TTDDialogTriggerTunnel:Zp(),tunnelsJotai:tYr}),[]),P8t=(e,t)=>{let r=t[0]?.type||null;for(let n of t)if(n.type!==r){r=null;break}return _O(e.activeTool.type)&&e.activeTool.type!=="image"&&r!=="image"&&r!=="frame"&&r!=="magicframe"||t.some(n=>_O(n.type))},O8t=(e,t)=>g5(e.activeTool.type)||t.some(r=>g5(r.type)),B8t=({appState:e,elementsMap:t,renderAction:r,app:n})=>{let i=Une(t,e),a=!1;i.length===2&&(md(i[0])||md(i[1]))&&(a=!0);let o=!!(e.editingTextElement||e.newElement),s=gl(),l=document.documentElement.getAttribute("dir")==="rtl",u=g5(e.activeTool.type)&&!df(e.currentItemBackgroundColor)||i.some(m=>g5(m.type)&&!df(m.backgroundColor)),d=i.length===1||a,h=!e.editingLinearElement&&i.length===1&&dn(i[0])&&!ar(i[0]),f=!e.croppingElementId&&i.length===1&&hi(i[0]),p=!a&&Kh(e,n);return(0,Fr.jsxs)("div",{className:"panelColumn",children:[(0,Fr.jsx)("div",{children:P8t(e,i)&&r("changeStrokeColor")}),O8t(e,i)&&(0,Fr.jsx)("div",{children:r("changeBackgroundColor")}),u&&r("changeFillStyle"),(kre(e.activeTool.type)||i.some(m=>kre(m.type)))&&r("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(m=>m.type==="freedraw"))&&r("changeStrokeShape"),(Cre(e.activeTool.type)||i.some(m=>Cre(m.type)))&&(0,Fr.jsxs)(Fr.Fragment,{children:[r("changeStrokeStyle"),r("changeSloppiness")]}),(PO(e.activeTool.type)||i.some(m=>PO(m.type)))&&(0,Fr.jsx)(Fr.Fragment,{children:r("changeRoundness")}),(Sre(e.activeTool.type)||i.some(m=>Sre(m.type)))&&(0,Fr.jsx)(Fr.Fragment,{children:r("changeArrowType")}),(e.activeTool.type==="text"||i.some(er))&&(0,Fr.jsxs)(Fr.Fragment,{children:[r("changeFontFamily"),r("changeFontSize"),(e.activeTool.type==="text"||KIe(i,t))&&r("changeTextAlign")]}),$Ie(i,t)&&r("changeVerticalAlign"),(TU(e.activeTool.type)||i.some(m=>TU(m.type)))&&(0,Fr.jsx)(Fr.Fragment,{children:r("changeArrowhead")}),r("changeOpacity"),(0,Fr.jsxs)("fieldset",{children:[(0,Fr.jsx)("legend",{children:ce("labels.layers")}),(0,Fr.jsxs)("div",{className:"buttonList",children:[r("sendToBack"),r("sendBackward"),r("bringForward"),r("bringToFront")]})]}),p&&!a&&(0,Fr.jsxs)("fieldset",{children:[(0,Fr.jsx)("legend",{children:ce("labels.align")}),(0,Fr.jsxs)("div",{className:"buttonList",children:[l?(0,Fr.jsxs)(Fr.Fragment,{children:[r("alignRight"),r("alignHorizontallyCentered"),r("alignLeft")]}):(0,Fr.jsxs)(Fr.Fragment,{children:[r("alignLeft"),r("alignHorizontallyCentered"),r("alignRight")]}),i.length>2&&r("distributeHorizontally"),(0,Fr.jsx)("div",{style:{flexBasis:"100%",height:0}}),(0,Fr.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[r("alignTop"),r("alignVerticallyCentered"),r("alignBottom"),i.length>2&&r("distributeVertically")]})]})]}),!o&&i.length>0&&(0,Fr.jsxs)("fieldset",{children:[(0,Fr.jsx)("legend",{children:ce("labels.actions")}),(0,Fr.jsxs)("div",{className:"buttonList",children:[!s.editor.isMobile&&r("duplicateSelection"),!s.editor.isMobile&&r("deleteSelectedElements"),r("group"),r("ungroup"),d&&r("hyperlink"),f&&r("cropEditor"),h&&r("toggleLinearEditor")]})]})]})},F8t=({activeTool:e,appState:t,app:r,UIOptions:n})=>{let[i,a]=(0,N8t.useState)(!1),o=e.type==="frame",s=e.type==="laser",l=e.type==="embeddable",{TTDDialogTriggerTunnel:u}=Qu();return(0,Fr.jsxs)(Fr.Fragment,{children:[DO.map(({value:d,icon:h,key:f,numericKey:p,fillable:m},g)=>{if(n.tools?.[d]===!1)return null;let y=ce(`toolBar.${d}`),v=f&&mT(typeof f=="string"?f:f[0]),b=v?`${v} ${ce("helpDialog.or")} ${p}`:`${p}`;return(0,Fr.jsx)(Qn,{className:St("Shape",{fillable:m}),type:"radio",icon:h,checked:e.type===d,name:"editor-current-shape",title:`${mT(y)} \u2014 ${b}`,keyBindingLabel:p||v,"aria-label":mT(y),"aria-keyshortcuts":b,"data-testid":`toolbar-${d}`,onPointerDown:({pointerType:x})=>{!t.penDetected&&x==="pen"&&r.togglePenMode(!0)},onChange:({pointerType:x})=>{t.activeTool.type!==d&&pa("toolbar",d,"ui"),d==="image"?r.setActiveTool({type:d,insertOnCanvasDirectly:x!=="mouse"}):r.setActiveTool({type:d})}},d)}),(0,Fr.jsx)("div",{className:"App-toolbar__divider"}),(0,Fr.jsxs)(wa,{open:i,children:[(0,Fr.jsx)(wa.Trigger,{className:St("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":o||l||s&&!r.props.isCollaborating}),onToggle:()=>a(!i),title:ce("toolBar.extraTools"),children:S9e}),(0,Fr.jsxs)(wa.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[(0,Fr.jsx)(wa.Item,{onSelect:()=>r.setActiveTool({type:"frame"}),icon:ure,shortcut:qe.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:o,children:ce("toolBar.frame")}),(0,Fr.jsx)(wa.Item,{onSelect:()=>r.setActiveTool({type:"embeddable"}),icon:TUe,"data-testid":"toolbar-embeddable",selected:l,children:ce("toolBar.embeddable")}),(0,Fr.jsx)(wa.Item,{onSelect:()=>r.setActiveTool({type:"laser"}),icon:hre,"data-testid":"toolbar-laser",selected:s,shortcut:qe.K.toLocaleUpperCase(),children:ce("toolBar.laser")}),(0,Fr.jsx)("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),r.props.aiEnabled!==!1&&(0,Fr.jsx)(u.Out,{}),(0,Fr.jsx)(wa.Item,{onSelect:()=>r.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:dre,"data-testid":"toolbar-embeddable",children:ce("toolBar.mermaidToExcalidraw")}),r.props.aiEnabled!==!1&&r.plugins.diagramToCode&&(0,Fr.jsx)(Fr.Fragment,{children:(0,Fr.jsxs)(wa.Item,{onSelect:()=>r.onMagicframeToolSelect(),icon:fre,"data-testid":"toolbar-magicframe",children:[ce("toolBar.magicframe"),(0,Fr.jsx)(wa.Item.Badge,{children:"AI"})]})})]})]})]})},nYr=({renderAction:e,zoom:t})=>(0,Fr.jsx)(sp.Col,{gap:1,className:a5.ZOOM_ACTIONS,children:(0,Fr.jsxs)(sp.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),iYr=({renderAction:e,className:t})=>(0,Fr.jsxs)("div",{className:`undo-redo-buttons ${t}`,children:[(0,Fr.jsx)("div",{className:"undo-button-container",children:(0,Fr.jsx)(j6,{label:ce("buttons.undo"),children:e("undo")})}),(0,Fr.jsx)("div",{className:"redo-button-container",children:(0,Fr.jsxs)(j6,{label:ce("buttons.redo"),children:[" ",e("redo")]})})]}),aYr=({actionManager:e,showExitZenModeBtn:t})=>(0,Fr.jsx)("button",{type:"button",className:St("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(X4e),children:ce("buttons.exitZenMode")}),oYr=({renderAction:e,className:t})=>(0,Fr.jsx)("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),wAt=e=>{let t=(0,z8t.useRef)({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...r)=>t.current.userFn(...r)),t.current.stableFn},nZ=bs(null),sYr=()=>{let[e,t]=No(nZ),r=Qd();return e&&e==="clearCanvas"?(0,rZ.jsx)(E8t,{onConfirm:()=>{r.executeAction(WD),t(null)},onCancel:()=>t(null),title:ce("clearCanvasDialog.title"),children:(0,rZ.jsxs)("p",{className:"clear-canvas__content",children:[" ",ce("alerts.clearReset")]})}):null},G8t={};PJ(G8t,{toggleTheme:()=>lYr});var lYr={...TK,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(TK,"commandPalette")}},W8t=jt({name:"copyElementLink",label:"labels.copyElementLink",icon:AO,trackEvent:{category:"element"},perform:async(e,t,r,n)=>{let i=Un(e,t);try{if(window.location){let a=sne(i,t);return a?(await RT(n.props.generateLinkForSelection?n.props.generateLinkForSelection(a.id,a.type):one(a.id,a.type)),{appState:{toast:{message:ce("toast.elementLinkCopied"),closable:!0}},captureUpdate:pt.EVENTUALLY}):{appState:t,elements:e,app:n,captureUpdate:pt.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:n,captureUpdate:pt.EVENTUALLY}},predicate:(e,t)=>DU(Un(e,t))}),cYr=jt({name:"linkToElement",label:"labels.linkToElement",icon:vre,perform:(e,t,r,n)=>{let i=Un(e,t);return i.length!==1||!DU(i)?{elements:e,appState:t,app:n,captureUpdate:pt.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:Un(e,t)[0].id}},captureUpdate:pt.IMMEDIATELY}},predicate:(e,t,r,n)=>{let i=Un(e,t);return t.openDialog?.name!=="elementLinkSelector"&&i.length===1&&DU(i)},trackEvent:!1}),uYr=bs(null),Jo={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},dYr=e=>{switch(e){case Jo.app:return 1;case Jo.export:return 2;case Jo.editor:return 3;case Jo.tools:return 4;case Jo.elements:return 5;case Jo.links:return 6;default:return 10}},vK=({shortcut:e,className:t,children:r})=>{let n=e.replace("++","+$").split("+");return(0,Ea.jsxs)("div",{className:St("shortcut",t),children:[n.map((i,a)=>(0,Ea.jsx)("div",{className:"shortcut-wrapper",children:(0,Ea.jsx)("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),(0,Ea.jsx)("div",{className:"shortcut-desc",children:r})]})},V8t=e=>!e.altKey&&e[qe.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===qe.P||e.key===qe.SLASH),pjn=Object.assign(e=>{let t=Ec(),r=Bs();return(0,op.useEffect)(()=>{let n=i=>{V8t(i)&&(i.preventDefault(),i.stopPropagation(),r(a=>{let o=a.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return o&&pa("command_palette","open","shortcut"),{openDialog:o}}))};return window.addEventListener("keydown",n,{capture:!0}),()=>window.removeEventListener("keydown",n,{capture:!0})},[r]),t.openDialog?.name!=="commandPalette"?null:(0,Ea.jsx)(hYr,{...e})},{defaultItems:G8t});function hYr({customCommandPaletteItems:e}){let t=d1(),r=Ec(),n=Bs(),i=pN(),a=Qd(),[o,s]=No(uYr),[l,u]=(0,op.useState)(null),d=(0,op.useRef)(null),h=OK({uiAppState:r,customCommandPaletteItems:e,appProps:i});(0,op.useEffect)(()=>{let{uiAppState:T,customCommandPaletteItems:C,appProps:S}=h,R=A=>{let P="";return A.label&&(typeof A.label=="function"?P=ce(A.label(t.scene.getNonDeletedElements(),T,t)):P=ce(A.label)),P},U=A=>typeof A.icon=="function"?A.icon(T,t.scene.getNonDeletedElements()):A.icon,L=[],I=(A,P,D)=>{let M={label:R(A),icon:U(A),category:P,shortcut:iu(A.name),keywords:A.keywords,predicate:A.predicate,viewMode:A.viewMode,perform:()=>{a.executeAction(A,"commandPalette")}};return D?D(M,A):M};if(T&&t.scene&&a){let A=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,f8t,W8t,cYr].map(B=>I(B,Jo.elements,(F,G)=>({...F,predicate:G.predicate?G.predicate:(z,V,$,Z)=>Un(z,V).length>0}))),P=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool].map(B=>I(B,Jo.tools)),D=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(B=>I(B,Jo.editor)),M=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(B=>I(B,Jo.export));L=[...A,...D,{label:R(WD),icon:U(WD),shortcut:iu(WD.name),category:Jo.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{W0.set(nZ,"clearCanvas")}},{label:ce("buttons.exportImage"),category:Jo.export,icon:Hte,shortcut:iu("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{n({openDialog:{name:"imageExport"}})}},...M];let O=[{label:ce("toolBar.library"),category:Jo.app,icon:vO,viewMode:!1,perform:()=>{T.openSidebar?n({openSidebar:null}):n({openSidebar:{name:bf.name,tab:bf.defaultTab}})}},{label:ce("search.title"),category:Jo.app,icon:Nb,viewMode:!0,perform:()=>{a.executeAction(q8t)}},{label:ce("labels.changeStroke"),keywords:["color","outline"],category:Jo.elements,icon:SO,viewMode:!1,predicate:(B,F)=>{let G=Un(B,F);return G.length>0&&P8t(F,G)},perform:()=>{n(B=>({openMenu:B.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:ce("labels.changeBackground"),keywords:["color","fill"],icon:SO,category:Jo.elements,viewMode:!1,predicate:(B,F)=>{let G=Un(B,F);return G.length>0&&O8t(F,G)},perform:()=>{n(B=>({openMenu:B.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:ce("labels.canvasBackground"),keywords:["color"],icon:SO,category:Jo.editor,viewMode:!1,perform:()=>{n(B=>({openMenu:B.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...DO.reduce((B,F)=>{let{value:G,icon:z,key:V,numericKey:$}=F;if(S.UIOptions.tools?.[G]===!1)return B;let Z=V&&mT(typeof V=="string"?V:V[0])||$,re={label:ce(`toolBar.${G}`),category:Jo.tools,shortcut:Z,icon:z,keywords:["toolbar"],viewMode:!1,perform:({event:Q})=>{G==="image"?t.setActiveTool({type:G,insertOnCanvasDirectly:Q.type==="keydown"}):t.setActiveTool({type:G})}};return B.push(re),B},[]),...P,{label:ce("toolBar.lock"),category:Jo.tools,icon:T.activeTool.locked?bO:vU,shortcut:qe.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${ce("labels.textToDiagram")}...`,category:Jo.tools,icon:R9e,viewMode:!1,predicate:S.aiEnabled,perform:()=>{n(B=>({...B,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${ce("toolBar.mermaidToExcalidraw")}...`,category:Jo.tools,icon:dre,viewMode:!1,predicate:S.aiEnabled,perform:()=>{n(B=>({...B,openDialog:{name:"ttd",tab:"mermaid"}}))}}],_=[...L,...O,...C||[]].map(B=>({...B,icon:B.icon||pre,order:B.order??dYr(B.category),haystack:`${xAt(B.label.toLocaleLowerCase())} ${B.keywords?.join(" ")||""}`}));u(_),s(_.find(B=>B.label===o?.label)??null)}},[h,t,a,u,o?.label,s,n]);let[f,p]=(0,op.useState)(""),[m,g]=(0,op.useState)(null),[y,v]=(0,op.useState)({}),b=T=>{n({openDialog:null},T),p("")},x=(T,C)=>{r.openDialog?.name==="commandPalette"&&(C.stopPropagation(),C.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),b(()=>{T.perform({actionManager:a,event:C}),s(T),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},E=wAt(T=>T.viewMode===!1&&r.viewModeEnabled?!1:typeof T.predicate=="function"?T.predicate(t.scene.getNonDeletedElements(),r,i,t):T.predicate===void 0||T.predicate),w=wAt(T=>{let C=Ab(T.target)||V8t(T)||T.key===qe.ESCAPE;if(C&&T.key!==qe.ARROW_UP&&T.key!==qe.ARROW_DOWN&&T.key!==qe.ENTER)return;let S=Object.values(y).flat(),R=o&&!f&&E(o);if(T.key===qe.ARROW_UP){T.preventDefault();let U=S.findIndex(A=>A.label===m?.label);if(R){if(U===0){g(o);return}if(m===o){let A=S[S.length-1];A&&g(A);return}}let L;U===-1?L=S.length-1:L=U===0?S.length-1:(U-1)%S.length;let I=S[L];I&&g(I);return}if(T.key===qe.ARROW_DOWN){T.preventDefault();let U=S.findIndex(A=>A.label===m?.label);if(R){if(!m||U===S.length-1){g(o);return}if(m===o){let A=S[0];A&&g(A);return}}let L=(U+1)%S.length,I=S[L];I&&g(I);return}if(T.key===qe.ENTER&&m&&setTimeout(()=>{x(m,T)}),!C){if(T.stopPropagation(),/^[a-zA-Z0-9]$/.test(T.key)){d?.current?.focus();return}T.preventDefault()}});return(0,op.useEffect)(()=>(window.addEventListener("keydown",w,{capture:!0}),()=>window.removeEventListener("keydown",w,{capture:!0})),[w]),(0,op.useEffect)(()=>{if(!l)return;let T=U=>{let L={};for(let I of U)L[I.category]?L[I.category].push(I):L[I.category]=[I];return L},C=l.filter(E).sort((U,L)=>U.order-L.order),S=!f&&o&&E(o);if(!f){v(T(S?C.filter(U=>U.label!==o?.label):C)),g(S?o:C[0]||null);return}let R=xAt(f.toLocaleLowerCase().replace(/[<>_| -]/g,""));C=D8t.default.filter(R,C,{extract:U=>U.haystack}).sort((U,L)=>L.score-U.score).map(U=>U.original),v(T(C)),g(C[0]??null)},[f,l,E,o]),(0,Ea.jsxs)(K0,{onCloseRequest:()=>b(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[(0,Ea.jsx)(L3e,{value:f,placeholder:ce("commandPalette.search.placeholder"),onChange:T=>{p(T)},selectOnRender:!0,ref:d}),!t.device.viewport.isMobile&&(0,Ea.jsxs)("div",{className:"shortcuts-wrapper",children:[(0,Ea.jsx)(vK,{shortcut:"\u2191\u2193",children:ce("commandPalette.shortcuts.select")}),(0,Ea.jsx)(vK,{shortcut:"\u21B5",children:ce("commandPalette.shortcuts.confirm")}),(0,Ea.jsx)(vK,{shortcut:Tt("Esc"),children:ce("commandPalette.shortcuts.close")})]}),(0,Ea.jsxs)("div",{className:"commands",children:[o&&!f&&(0,Ea.jsxs)("div",{className:"command-category",children:[(0,Ea.jsxs)("div",{className:"command-category-title",children:[ce("commandPalette.recents"),(0,Ea.jsx)("div",{className:"icon",style:{marginLeft:"6px"},children:M9e})]}),(0,Ea.jsx)(EAt,{command:o,isSelected:o.label===m?.label,onClick:T=>x(o,T),disabled:!E(o),onMouseMove:()=>g(o),showShortcut:!t.device.viewport.isMobile,appState:r})]}),Object.keys(y).length>0?Object.keys(y).map((T,C)=>(0,Ea.jsxs)("div",{className:"command-category",children:[(0,Ea.jsx)("div",{className:"command-category-title",children:T}),y[T].map(S=>(0,Ea.jsx)(EAt,{command:S,isSelected:S.label===m?.label,onClick:R=>x(S,R),onMouseMove:()=>g(S),showShortcut:!t.device.viewport.isMobile,appState:r},S.label))]},T)):l?(0,Ea.jsxs)("div",{className:"no-match",children:[(0,Ea.jsx)("div",{className:"icon",children:Nb})," ",ce("commandPalette.search.noMatch")]}):null]})]})}var EAt=({command:e,isSelected:t,disabled:r,onMouseMove:n,onClick:i,showShortcut:a,appState:o})=>{let s=()=>{};return(0,Ea.jsxs)("div",{className:St("command-item",{"item-selected":t,"item-disabled":r}),ref:l=>{t&&!r&&l?.scrollIntoView?.({block:"nearest"})},onClick:r?s:i,onMouseMove:r?s:n,title:r?ce("commandPalette.itemNotAvailable"):"",children:[(0,Ea.jsxs)("div",{className:"name",children:[e.icon&&(0,Ea.jsx)(FK,{icon:typeof e.icon=="function"?e.icon(o):e.icon}),e.label]}),a&&e.shortcut&&(0,Ea.jsx)(vK,{shortcut:e.shortcut})]})},fYr=jt({name:"toggleLinearEditor",category:Jo.elements,label:(e,t,r)=>r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0]?.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit",keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&dn(i[0])&&!ar(i[0]))},perform(e,t,r,n){let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],a=t.editingLinearElement?.elementId===i.id?null:new rr(i);return{appState:{...t,editingLinearElement:a},captureUpdate:pt.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:r})=>{let n=r.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=ce(n.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return(0,H8t.jsx)(Qn,{type:"button",icon:q9e,title:i,"aria-label":i,onClick:()=>t(null)})}}),q8t=jt({name:"searchMenu",icon:Nb,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,r,n){if(t.openSidebar?.name===bf.name&&t.openSidebar.tab===l5){let i=n.excalidrawContainerValue.container?.querySelector(`.${a5.SEARCH_MENU_INPUT_WRAPPER} input`);return i?.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:pt.EVENTUALLY}:(i?.focus(),i?.select(),!1)}return{appState:{...t,openSidebar:{name:bf.name,tab:l5},openDialog:null},captureUpdate:pt.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,r)=>r.gridModeEnabled===void 0,keyTest:e=>e[qe.CTRL_OR_CMD]&&e.key===qe.F}),pYr=jt({name:"cropEditor",label:"helpDialog.cropStart",icon:yre,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,r,n){let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:pt.IMMEDIATELY}},predicate:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&hi(i[0]))},PanelComponent:({appState:e,updateData:t,app:r})=>{let n=ce("helpDialog.cropStart");return(0,Y8t.jsx)(Qn,{type:"button",icon:yre,title:n,"aria-label":n,onClick:()=>t(null)})}}),kK=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},TAt=class zD{constructor(){Oe(this,"onHistoryChangedEmitter",new qp),Oe(this,"undoStack",[]),Oe(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,r){let n=mYr.create(r,t);n.isEmpty()||(this.undoStack.push(n.inverse()),n.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new kK(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,r,n){return this.perform(t,r,n,()=>zD.pop(this.undoStack),i=>zD.push(this.redoStack,i,t))}redo(t,r,n){return this.perform(t,r,n,()=>zD.pop(this.redoStack),i=>zD.push(this.undoStack,i,t))}perform(t,r,n,i,a){try{let o=i();if(o===null)return;let s=t,l=r,u=!1;for(;o;){try{[s,l,u]=o.applyTo(s,l,n)}finally{a(o)}if(u)break;o=i()}return[s,l]}finally{this.onHistoryChangedEmitter.trigger(new kK(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let r=t.pop();return r!==void 0?r:null}static push(t,r,n){let i=r.inverse().applyLatestChanges(n);return t.push(i)}},mYr=class bK{constructor(t,r){this.appStateChange=t,this.elementsChange=r}static create(t,r){return new bK(t,r)}inverse(){return new bK(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,r,n){let[i,a]=this.elementsChange.applyTo(t,n.elements),[o,s]=this.appStateChange.applyTo(r,i);return[i,o,a||s]}applyLatestChanges(t){let r=this.elementsChange.applyLatestChanges(t);return bK.create(this.appStateChange,r)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},j8t=(e,t)=>{let[r,n]=(0,iZ.useState)(t);return(0,iZ.useEffect)(()=>{let i=e.on(a=>{n(a)});return()=>{i()}},[e]),r},X8t=(e,t,r)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let n=r();if(!n)return{captureUpdate:pt.EVENTUALLY};let[i,a]=n,o=Array.from(i.values());return{appState:a,elements:o,captureUpdate:pt.NEVER}}return{captureUpdate:pt.EVENTUALLY}},gYr=(e,t)=>({name:"undo",label:"buttons.undo",icon:qte,trackEvent:{category:"history"},viewMode:!1,perform:(r,n,i,a)=>X8t(a,n,()=>e.undo(Hr(r),n,t.snapshot)),keyTest:r=>r[qe.CTRL_OR_CMD]&&MO(r,qe.Z)&&!r.shiftKey,PanelComponent:({updateData:r,data:n})=>{let{isUndoStackEmpty:i}=j8t(e.onHistoryChangedEmitter,new kK(e.isUndoStackEmpty,e.isRedoStackEmpty));return(0,D3e.jsx)(Qn,{type:"button",icon:qte,"aria-label":ce("buttons.undo"),onClick:r,size:n?.size||"medium",disabled:i,"data-testid":"button-undo"})}}),yYr=(e,t)=>({name:"redo",label:"buttons.redo",icon:Yte,trackEvent:{category:"history"},viewMode:!1,perform:(r,n,i,a)=>X8t(a,n,()=>e.redo(Hr(r),n,t.snapshot)),keyTest:r=>r[qe.CTRL_OR_CMD]&&r.shiftKey&&MO(r,qe.Z)||dte&&r.ctrlKey&&!r.shiftKey&&MO(r,qe.Y),PanelComponent:({updateData:r,data:n})=>{let{isRedoStackEmpty:i}=j8t(e.onHistoryChangedEmitter,new kK(e.isUndoStackEmpty,e.isRedoStackEmpty));return(0,D3e.jsx)(Qn,{type:"button",icon:Yte,"aria-label":ce("buttons.redo"),onClick:r,size:n?.size||"medium",disabled:i,"data-testid":"button-redo"})}}),U4e=(e,t,r,n,i,a)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(r,n,a))&&pa(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(o){console.error("error while logging action:",o)}},vYr=class{constructor(e,t,r,n){Oe(this,"actions",{}),Oe(this,"updater"),Oe(this,"getAppState"),Oe(this,"getElementsIncludingDeleted"),Oe(this,"app"),Oe(this,"renderAction",(i,a)=>{let o=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in o)||o[i])){let s=this.actions[i],l=s.PanelComponent;l.displayName="PanelComponent";let u=this.getElementsIncludingDeleted(),d=this.getAppState(),h=f=>{U4e(s,"ui",d,u,this.app,f),this.updater(s.perform(this.getElementsIncludingDeleted(),this.getAppState(),f,this.app))};return(0,$8t.jsx)(l,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:h,appProps:this.app.props,app:this.app,data:a})}return null}),Oe(this,"isActionEnabled",i=>{let a=this.getElementsIncludingDeleted(),o=this.getAppState();return!i.predicate||i.predicate(a,o,this.app.props,this.app)}),this.updater=i=>{if(yT(i))i.then(a=>e(a));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=r,this.app=n}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,r=Object.values(this.actions).sort((s,l)=>(l.keyPriority||0)-(s.keyPriority||0)).filter(s=>(s.name in t?t[s.name]:!0)&&s.keyTest&&s.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(r.length!==1)return r.length>1&&console.warn("Canceling as multiple actions match this shortcut",r),!1;let n=r[0];if(this.getAppState().viewModeEnabled&&n.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),a=this.getAppState();return U4e(n,"keyboard",a,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(r[0].perform(i,a,null,this.app)),!0}executeAction(e,t="api",r=null){let n=this.getElementsIncludingDeleted(),i=this.getAppState();U4e(e,t,i,n,this.app,r),this.updater(e.perform(n,i,r,this.app))}},kAt=e=>{let t=Array.from(e.values());return{x:SAt(t,r=>r.x)/t.length,y:SAt(t,r=>r.y)/t.length}},CAt=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),SAt=(e,t)=>e.reduce((r,n)=>r+t(n),0),bYr=({children:e,left:t,top:r,onCloseRequest:n,fitInViewport:i=!1,offsetLeft:a=0,offsetTop:o=0,viewportWidth:s=window.innerWidth,viewportHeight:l=window.innerHeight})=>{let u=(0,pw.useRef)(null);(0,pw.useEffect)(()=>{let h=u.current;if(!h)return;h.contains(document.activeElement)||h.focus();let f=p=>{if(p.key===qe.TAB){let m=pO(h),{activeElement:g}=document,y=m.findIndex(v=>v===g);g===h?(p.shiftKey?m[m.length-1]?.focus():m[0].focus(),p.preventDefault(),p.stopImmediatePropagation()):y===0&&p.shiftKey?(m[m.length-1]?.focus(),p.preventDefault(),p.stopImmediatePropagation()):y===m.length-1&&!p.shiftKey&&(m[0]?.focus(),p.preventDefault(),p.stopImmediatePropagation())}};return h.addEventListener("keydown",f),()=>h.removeEventListener("keydown",f)},[]);let d=(0,pw.useRef)(null);return(0,pw.useLayoutEffect)(()=>{if(i&&u.current&&r!=null&&t!=null){let h=u.current,{width:f,height:p}=h.getBoundingClientRect();if(d.current?.top===r&&d.current?.left===t)return;d.current={top:r,left:t},f>=s?(h.style.width=`${s}px`,h.style.left="0px",h.style.overflowX="scroll"):t+f-a>s?h.style.left=`${s-f-10}px`:h.style.left=`${t}px`,p>=l?(h.style.height=`${l-20}px`,h.style.top="10px",h.style.overflowY="scroll"):r+p-o>l?h.style.top=`${l-p}px`:h.style.top=`${r}px`}},[r,t,i,s,l,a,o]),(0,pw.useEffect)(()=>{if(n){let h=f=>{u.current?.contains(f.target)||(0,K8t.unstable_batchedUpdates)(()=>n(f))};return document.addEventListener("pointerdown",h,!1),()=>document.removeEventListener("pointerdown",h,!1)}},[n]),(0,Z8t.jsx)("div",{className:"popover",ref:u,tabIndex:-1,children:e})},fl="separator",xYr=Q8t.default.memo(({actionManager:e,items:t,top:r,left:n,onClose:i})=>{let a=mN(),o=uZ(),s=t.reduce((l,u)=>(u&&(u===fl||!u.predicate||u.predicate(o,a,e.app.props,e.app))&&l.push(u),l),[]);return(0,vv.jsx)(bYr,{onCloseRequest:()=>{i()},top:r,left:n,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,vv.jsx)("ul",{className:"context-menu",onContextMenu:l=>l.preventDefault(),children:s.map((l,u)=>{if(l===fl)return!s[u-1]||s[u-1]===fl?null:(0,vv.jsx)("hr",{className:"context-menu-item-separator"},u);let d=l.name,h="";return l.label&&(typeof l.label=="function"?h=ce(l.label(o,a,e.app)):h=ce(l.label)),(0,vv.jsx)("li",{"data-testid":d,onClick:()=>{i(()=>{e.executeAction(l,"contextMenu")})},children:(0,vv.jsxs)("button",{type:"button",className:St("context-menu-item",{dangerous:d==="deleteSelectedElements",checkmark:l.checked?.(a)}),children:[(0,vv.jsx)("div",{className:"context-menu-item__label",children:h}),(0,vv.jsx)("kbd",{className:"context-menu-item__shortcut",children:d?iu(d):""})]})},u)})})})}),wYr=({children:e,onClose:t})=>{let[r,n]=(0,aZ.useState)(!!e),{container:i}=h1(),a=aZ.default.useCallback(()=>{n(!1),t&&t(),i?.focus()},[t,i]);return(0,ZA.jsx)(ZA.Fragment,{children:r&&(0,ZA.jsx)(K0,{size:"small",onCloseRequest:a,title:ce("errorDialog.title"),children:(0,ZA.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},eUt=function({onChange:e,value:t,choices:r,name:n}){return(0,eN.jsx)("div",{className:"RadioGroup",children:r.map(i=>(0,eN.jsxs)("div",{className:St("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[(0,eN.jsx)("input",{name:n,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},lK=({title:e,name:t,checked:r,onChange:n,disabled:i=!1})=>(0,t3e.jsx)("div",{className:St("Switch",{toggled:r,disabled:i}),children:(0,t3e.jsx)("input",{name:t,id:t,title:e,type:"checkbox",checked:r,disabled:i,onChange:()=>n(!r),onKeyDown:a=>{a.key===" "&&n(!r)}})}),HD=(0,oZ.forwardRef)(({children:e,icon:t,onClick:r,label:n,variant:i="filled",color:a="primary",size:o="medium",fullWidth:s,className:l,status:u},d)=>{let[h,f]=(0,oZ.useState)(!1),p=async g=>{let y=r?.(g);if(yT(y)){let v=window.setTimeout(()=>{f(!0)},50);try{await y}catch(b){if(b instanceof EU)console.warn(b);else throw b}finally{clearTimeout(v),f(!1)}}},m=h?"loading":u;return a=m==="success"?"success":a,(0,_6.jsx)("button",{className:St("ExcButton",`ExcButton--color-${a}`,`ExcButton--variant-${i}`,`ExcButton--size-${o}`,`ExcButton--status-${m}`,{"ExcButton--fullWidth":s},l),onClick:p,type:"button","aria-label":n,ref:d,disabled:m==="loading"||m==="success",children:(0,_6.jsxs)("div",{className:"ExcButton__contents",children:[m==="loading"?(0,_6.jsx)(kv,{className:"ExcButton__statusIcon"}):m==="success"&&(0,_6.jsx)("div",{className:"ExcButton__statusIcon",children:T9e}),t&&(0,_6.jsx)("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??n)]})})}),EYr=2e3,TYr=()=>{let[e,t]=(0,l7.useState)(null),r=(0,l7.useRef)(0),n=()=>{clearTimeout(r.current),t("success"),r.current=window.setTimeout(()=>{t(null)},EYr)},i=(0,l7.useCallback)(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:n}},kYr="filter"in document.createElement("canvas").getContext("2d"),CYr=()=>(0,ii.jsxs)("div",{children:[(0,ii.jsx)("h3",{children:ce("canvasError.cannotShowPreview")}),(0,ii.jsx)("p",{children:(0,ii.jsx)("span",{children:ce("canvasError.canvasTooBig")})}),(0,ii.jsxs)("em",{children:["(",ce("canvasError.canvasTooBigTip"),")"]})]}),SYr=({appStateSnapshot:e,elementsSnapshot:t,files:r,actionManager:n,onExportImage:i,name:a})=>{let o=ss(t,e),[s,l]=(0,Kd.useState)(a),[u,d]=(0,Kd.useState)(o),[h,f]=(0,Kd.useState)(e.exportBackground),[p,m]=(0,Kd.useState)(e.exportWithDarkMode),[g,y]=(0,Kd.useState)(e.exportEmbedScene),[v,b]=(0,Kd.useState)(e.exportScale),x=(0,Kd.useRef)(null),[E,w]=(0,Kd.useState)(null),{onCopy:T,copyStatus:C,resetCopyStatus:S}=TYr();(0,Kd.useEffect)(()=>{S()},[s,h,p,v,g,S]);let{exportedElements:R,exportingFrame:U}=qK(t,e,u);return(0,Kd.useEffect)(()=>{let L=x.current;if(!L)return;let I=L.offsetWidth,A=L.offsetHeight;I&&cB({elements:R,appState:{...e,name:s,exportBackground:h,exportWithDarkMode:p,exportScale:v,exportEmbedScene:g},files:r,exportPadding:s5,maxWidthOrHeight:Math.max(I,A),exportingFrame:U}).then(P=>(w(null),_T(P).then(()=>{L.replaceChildren(P)}).catch(D=>{throw D.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(ce("canvasError.canvasTooBig")):D}))).catch(P=>{console.error(P),w(P)})},[e,r,R,U,s,h,p,v,g]),(0,ii.jsxs)("div",{className:"ImageExportModal",children:[(0,ii.jsx)("h3",{children:ce("imageExportDialog.header")}),(0,ii.jsxs)("div",{className:"ImageExportModal__preview",children:[(0,ii.jsx)("div",{className:"ImageExportModal__preview__canvas",ref:x,children:E&&(0,ii.jsx)(CYr,{})}),(0,ii.jsx)("div",{className:"ImageExportModal__preview__filename",children:!M1&&(0,ii.jsx)("input",{type:"text",className:"TextInput",value:s,style:{width:"30ch"},onChange:L=>{l(L.target.value),n.executeAction(bHr,"ui",L.target.value)}})})]}),(0,ii.jsxs)("div",{className:"ImageExportModal__settings",children:[(0,ii.jsx)("h3",{children:ce("imageExportDialog.header")}),o&&(0,ii.jsx)(DD,{label:ce("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:(0,ii.jsx)(lK,{name:"exportOnlySelected",checked:u,onChange:L=>{d(L)}})}),(0,ii.jsx)(DD,{label:ce("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:(0,ii.jsx)(lK,{name:"exportBackgroundSwitch",checked:h,onChange:L=>{f(L),n.executeAction(wHr,"ui",L)}})}),kYr&&(0,ii.jsx)(DD,{label:ce("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:(0,ii.jsx)(lK,{name:"exportDarkModeSwitch",checked:p,onChange:L=>{m(L),n.executeAction(EHr,"ui",L)}})}),(0,ii.jsx)(DD,{label:ce("imageExportDialog.label.embedScene"),tooltip:ce("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:(0,ii.jsx)(lK,{name:"exportEmbedSwitch",checked:g,onChange:L=>{y(L),n.executeAction(r8t,"ui",L)}})}),(0,ii.jsx)(DD,{label:ce("imageExportDialog.label.scale"),name:"exportScale",children:(0,ii.jsx)(eUt,{name:"exportScale",value:v,onChange:L=>{b(L),n.executeAction(xHr,"ui",L)},choices:dO.map(L=>({value:L,label:`${L}\xD7`}))})}),(0,ii.jsxs)("div",{className:"ImageExportModal__settings__buttons",children:[(0,ii.jsx)(HD,{className:"ImageExportModal__settings__buttons__button",label:ce("imageExportDialog.title.exportToPng"),onClick:()=>i(oO.png,R,{exportingFrame:U}),icon:cre,children:ce("imageExportDialog.button.exportToPng")}),(0,ii.jsx)(HD,{className:"ImageExportModal__settings__buttons__button",label:ce("imageExportDialog.title.exportToSvg"),onClick:()=>i(oO.svg,R,{exportingFrame:U}),icon:cre,children:ce("imageExportDialog.button.exportToSvg")}),(lB||dT)&&(0,ii.jsx)(HD,{className:"ImageExportModal__settings__buttons__button",label:ce("imageExportDialog.title.copyPngToClipboard"),status:C,onClick:async()=>{await i(oO.clipboard,R,{exportingFrame:U}),T()},icon:AO,children:ce("imageExportDialog.button.copyPngToClipboard")})]})]})]})},DD=({label:e,children:t,tooltip:r,name:n})=>(0,ii.jsxs)("div",{className:"ImageExportModal__settings__setting",title:e,children:[(0,ii.jsxs)("label",{htmlFor:n,className:"ImageExportModal__settings__setting__label",children:[e,r&&(0,ii.jsx)(j6,{label:r,long:!0,children:E9e})]}),(0,ii.jsx)("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),AYr=({elements:e,appState:t,files:r,actionManager:n,onExportImage:i,onCloseRequest:a,name:o})=>{let[{appStateSnapshot:s,elementsSnapshot:l}]=(0,Kd.useState)(()=>({appStateSnapshot:wm(t),elementsSnapshot:wm(e)}));return(0,ii.jsx)(K0,{onCloseRequest:a,size:"wide",title:!1,children:(0,ii.jsx)(SYr,{elementsSnapshot:l,appStateSnapshot:s,files:r,actionManager:n,onExportImage:i,name:o})})},rUt=({children:e,side:t,className:r})=>(0,tUt.jsx)("div",{className:St("FixedSideContainer",`FixedSideContainer_side_${t}`,r),children:e}),QA=100,JA=100,AAt=e=>{switch(e){case qe.ARROW_UP:return"up";case qe.ARROW_DOWN:return"down";case qe.ARROW_RIGHT:return"right";case qe.ARROW_LEFT:return"left";default:return"right"}},nUt=(e,t,r,n)=>{let i=[...r.values()].reduce((a,o)=>{let s;if(ar(o)&&(s=o[e==="predecessors"?"startBinding":"endBinding"])&&o[e==="predecessors"?"endBinding":"startBinding"]?.elementId===t.id){let l=r.get(s.elementId);if(!l)return a;is(yf(l),"not an ExcalidrawBindableElement");let u=e==="predecessors"?o.points[o.points.length-1]:[0,0],d=Are(t,Up(t),[u[0]+o.x,u[1]+o.y]);a.push({relative:l,heading:d})}return a},[]);switch(n){case"up":return i.filter(a=>io(a.heading,pu)).map(a=>a.relative);case"down":return i.filter(a=>io(a.heading,js)).map(a=>a.relative);case"right":return i.filter(a=>io(a.heading,ro)).map(a=>a.relative);case"left":return i.filter(a=>io(a.heading,fu)).map(a=>a.relative)}},r3e=(e,t,r)=>nUt("successors",e,t,r),n3e=(e,t,r)=>nUt("predecessors",e,t,r),UYr=(e,t,r)=>{let n=JA+e.width;if(r==="up"||r==="down"){let s=QA+e.height,l=e.x,u=e.x+e.width;if(t.every(d=>d.x+d.widthu))return{x:0,y:s*(r==="up"?-1:1)}}else if(r==="right"||r==="left"){let s=e.y,l=e.y+e.height;if(t.every(u=>u.y+u.heightl))return{x:(JA+e.width)*(r==="left"?-1:1),y:0}}if(r==="up"||r==="down"){let s=QA+e.height,l=(t.length,s),u=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*n:t.length/2*n*-1;return r==="up"?{x:u,y:l*-1}:{x:u,y:l}}let i=QA+e.height,a=(t.length,JA+e.width),o=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return r==="left"?{x:a*-1,y:o}:{x:a,y:o}},IYr=(e,t,r,n)=>{let i=r3e(e,t,n),a=n3e(e,t,n),o=UYr(e,[...i,...a],n),s=Hp({type:e.type,x:e.x+o.x,y:e.y+o.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});is(gU(s),"not an ExcalidrawFlowchartNodeElement");let l=iUt(e,s,t,n,r);return{nextNode:s,bindingArrow:l}},RYr=(e,t,r,n,i)=>{let a=[];for(let o=0;o{let a,o;switch(n){case"up":{a=e.x+e.width/2,o=e.y-6;break}case"down":{a=e.x+e.width/2,o=e.y+e.height+6;break}case"right":{a=e.x+e.width+6,o=e.y+e.height/2;break}case"left":{a=e.x-6,o=e.y+e.height/2;break}}let s,l;switch(n){case"up":{s=t.x+t.width/2-a,l=t.y+t.height-o+6;break}case"down":{s=t.x+t.width/2-a,l=t.y-o-6;break}case"right":{s=t.x-a-6,l=t.y-o+t.height/2;break}case"left":{s=t.x+t.width-a+6,l=t.y-o+t.height/2;break}}let u=KO({type:"arrow",x:a,y:o,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[ne(0,0),ne(s,l)],elbowed:!0});Np(u,e,"start",r),Np(u,t,"end",r);let d=new Map;d.set(e.id,e),d.set(t.id,t),d.set(u.id,u),rr.movePoints(u,[{index:1,point:u.points[1]}]);let h=iB(u,hh(new Map([...r.entries(),[e.id,e],[t.id,t],[u.id,u]])),{points:u.points});return{...u,...h}},MYr=class{constructor(){Oe(this,"isExploring",!1),Oe(this,"sameLevelNodes",[]),Oe(this,"sameLevelIndex",0),Oe(this,"direction",null),Oe(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,r){if(!yf(e))return null;if(r!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&r===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let n=[...r3e(e,t,r),...n3e(e,t,r)];if(n.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=n,this.direction=r,this.visitedNodes.add(n[0].id),n[0].id;if(r===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(a=>a!==r).map(a=>[...r3e(e,t,a),...n3e(e,t,a)]).flat().filter(a=>!this.visitedNodes.has(a.id));for(let a of i)if(!this.visitedNodes.has(a.id))return this.visitedNodes.add(a.id),this.isExploring=!0,this.direction=r,a.id}return null}},LYr=class{constructor(){Oe(this,"isCreatingChart",!1),Oe(this,"numberOfNodes",0),Oe(this,"direction","right"),Oe(this,"pendingNodes",null)}createNodes(e,t,r,n){if(n!==this.direction){let{nextNode:i,bindingArrow:a}=IYr(e,t,r,n);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=n,this.pendingNodes=[i,a]}else{this.numberOfNodes+=1;let i=RYr(e,t,r,n,this.numberOfNodes);this.isCreatingChart=!0,this.direction=n,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);is(i&&Mte(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(a=>MT([a],i,t)||F1(a,i,t))&&(this.pendingNodes=this.pendingNodes.map(a=>kt(a,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},DYr=(e,t)=>{for(let[,r]of t)if(r.type==="arrow"&&(r.startBinding?.elementId===e.id||r.endBinding?.elementId===e.id))return!0;return!1},NYr=({appState:e,isMobile:t,device:r,app:n})=>{let{activeTool:i,isResizing:a,isRotating:o,lastPointerDownWith:s}=e,l=e.multiElement!==null;if(e.openSidebar?.name===bf.name&&e.openSidebar.tab===l5&&e.searchMatches?.length)return ce("hints.dismissSearch");if(e.openSidebar&&!r.editor.canFitSidebar)return null;if(zp(e))return ce("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return l?ce("hints.linearElementMulti"):i.type==="arrow"?ce("hints.arrowTool",{arrowShortcut:Tt("A")}):ce("hints.linearElement");if(i.type==="freedraw")return ce("hints.freeDraw");if(i.type==="text")return ce("hints.text");if(i.type==="embeddable")return ce("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return ce("hints.placeImage");let u=n.scene.getSelectedElements(e);if(a&&s==="mouse"&&u.length===1){let d=u[0];return dn(d)&&d.points.length===2?ce("hints.lockAngle"):hi(d)?ce("hints.resizeImage"):ce("hints.resize")}if(o&&s==="mouse")return ce("hints.rotate");if(u.length===1&&er(u[0]))return ce("hints.text_selected");if(e.editingTextElement)return ce("hints.text_editing");if(e.croppingElementId)return ce("hints.leaveCropEditor");if(u.length===1&&hi(u[0]))return ce("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!u.length&&!e.editingTextElement&&!e.editingLinearElement)return ce("hints.deepBoxSelect");if(CT(n)&&e.selectedElementsAreBeingDragged)return ce("hints.disableSnapping");if(!u.length&&!t)return ce("hints.canvasPanning");if(u.length===1){if(dn(u[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?ce("hints.lineEditor_pointSelected"):ce("hints.lineEditor_nothingSelected"):ce("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&Mb(u[0]))return gU(u[0])?DYr(u[0],n.scene.getNonDeletedElementsMap())?[ce("hints.bindTextToElement"),ce("hints.createFlowchart")]:[ce("hints.bindTextToElement"),ce("hints.createFlowchart")]:ce("hints.bindTextToElement")}}return null},aUt=({appState:e,isMobile:t,device:r,app:n})=>{let i=NYr({appState:e,isMobile:t,device:r,app:n});if(!i)return null;let a=Array.isArray(i)?i.map(o=>Tt(o).replace(/\. ?$/,"")).join(". "):Tt(i);return(0,i3e.jsx)("div",{className:"HintViewer",children:(0,i3e.jsx)("span",{children:a})})},_Yr="medium",UAt={CHECKED:bO,UNCHECKED:vU},oUt=e=>(0,tN.jsxs)("label",{className:St("ToolIcon ToolIcon__lock",`ToolIcon_size_${_Yr}`,{"is-mobile":e.isMobile}),title:`${e.title} \u2014 Q`,children:[(0,tN.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),(0,tN.jsx)("div",{className:"ToolIcon__icon",children:e.checked?UAt.CHECKED:UAt.UNCHECKED})]}),rN=({heading:e,children:t,...r})=>{let{id:n}=h1(),i=(0,$6.jsx)("h2",{className:"visually-hidden",id:`${n}-${e}-title`,children:ce(`headings.${e}`)});return(0,$6.jsx)("section",{...r,"aria-labelledby":`${n}-${e}-title`,children:typeof t=="function"?t(i):(0,$6.jsxs)($6.Fragment,{children:[i,t]})})},n1=4,sw=6,PYr="rgba(0,0,0,0.3)",OYr=(e,t,r,n)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,a,o,s]=mi(e),l=t/n.zoom.value,u=r/n.zoom.value,d=t-l,h=r-u,f={top:parseInt(hU("sat"))||0,bottom:parseInt(hU("sab"))||0,left:parseInt(hU("sal"))||0,right:parseInt(hU("sar"))||0},p=qD().rtl,m=-n.scrollX+d/2+f.left,g=-n.scrollY+h/2+f.top,y=m+l-f.right,v=g+u-f.bottom,b=Math.min(i,m),x=Math.min(a,g),E=Math.max(o,y),w=Math.max(s,v);return{horizontal:m===b&&y===E?null:{x:Math.max(f.left,n1)+(m-b)/(E-b)*t,y:r-sw-Math.max(n1,f.bottom),width:(y-m)/(E-b)*t-Math.max(n1*2,f.left+f.right),height:sw},vertical:g===x&&v===w?null:{x:p?Math.max(f.left,n1):t-sw-Math.max(f.right,n1),y:(g-x)/(w-x)*r+Math.max(f.top,n1),width:sw,height:(v-g)/(w-x)*r-Math.max(n1*2,f.top+f.bottom)}}},IAt=(e,t,r)=>{let[n,i]=[e.horizontal,e.vertical].map(a=>a!=null&&a.x<=t&&t<=a.x+a.width&&a.y<=r&&r<=a.y+a.height);return{isOverEither:n||i,isOverHorizontal:n,isOverVertical:i}},BYr="medium",sUt=e=>e.penDetected?(0,nN.jsxs)("label",{className:St("ToolIcon ToolIcon__penMode",`ToolIcon_size_${BYr}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,nN.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,nN.jsx)("div",{className:"ToolIcon__icon",children:wUe})]}):null,cUt=e=>(0,lUt.jsx)(Qn,{className:St("Shape",{fillable:!1}),type:"radio",icon:lre,name:"editor-current-shape",checked:e.checked,title:`${e.title} \u2014 H`,keyBindingLabel:e.isMobile?void 0:qe.H.toLocaleUpperCase(),"aria-label":`${e.title} \u2014 H`,"aria-keyshortcuts":qe.H,"data-testid":"toolbar-hand",onChange:()=>e.onChange?.()}),FYr=({appState:e,elements:t,actionManager:r,setAppState:n,onLockToggle:i,onHandToolToggle:a,onPenModeToggle:o,renderTopRightUI:s,renderCustomStats:l,renderSidebars:u,device:d,renderWelcomeScreen:h,UIOptions:f,app:p})=>{let{WelcomeScreenCenterTunnel:m,MainMenuTunnel:g,DefaultSidebarTriggerTunnel:y}=Qu(),v=()=>(0,Zi.jsxs)(rUt,{side:"top",className:"App-top-bar",children:[h&&(0,Zi.jsx)(m.Out,{}),(0,Zi.jsx)(rN,{heading:"shapes",children:x=>(0,Zi.jsx)(sp.Col,{gap:4,align:"center",children:(0,Zi.jsxs)(sp.Row,{gap:1,className:"App-toolbar-container",children:[(0,Zi.jsxs)(Y0,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[x,(0,Zi.jsx)(sp.Row,{gap:1,children:(0,Zi.jsx)(F8t,{appState:e,activeTool:e.activeTool,UIOptions:f,app:p})})]}),s&&s(!0,e),(0,Zi.jsxs)("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(0,Zi.jsx)(y.Out,{}),(0,Zi.jsx)(sUt,{checked:e.penMode,onChange:()=>o(null),title:ce("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),(0,Zi.jsx)(oUt,{checked:e.activeTool.locked,onChange:i,title:ce("toolBar.lock"),isMobile:!0}),(0,Zi.jsx)(cUt,{checked:c5(e),onChange:()=>a(),title:ce("toolBar.hand"),isMobile:!0})]})]})})}),(0,Zi.jsx)(aUt,{appState:e,isMobile:!0,device:d,app:p})]}),b=()=>e.viewModeEnabled||e.openDialog?.name==="elementLinkSelector"?(0,Zi.jsx)("div",{className:"App-toolbar-content",children:(0,Zi.jsx)(g.Out,{})}):(0,Zi.jsxs)("div",{className:"App-toolbar-content",children:[(0,Zi.jsx)(g.Out,{}),r.renderAction("toggleEditMenu"),r.renderAction(e.multiElement?"finalize":"duplicateSelection"),r.renderAction("deleteSelectedElements"),(0,Zi.jsxs)("div",{children:[r.renderAction("undo"),r.renderAction("redo")]})]});return(0,Zi.jsxs)(Zi.Fragment,{children:[u(),!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&v(),(0,Zi.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:sw+n1*2,marginLeft:sw+n1*2,marginRight:sw+n1*2},children:(0,Zi.jsxs)(Y0,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&bB(e,t)?(0,Zi.jsx)(rN,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,Zi.jsx)(B8t,{appState:e,elementsMap:p.scene.getNonDeletedElementsMap(),renderAction:r.renderAction,app:p})}):null,(0,Zi.jsxs)("footer",{className:"App-toolbar",children:[b(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&(0,Zi.jsx)("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{n(x=>({...TT(t,x)}))},children:ce("buttons.scrollBackToContent")})]})]})})]})},RAt=e=>{let t=(0,yw.useRef)(null),[r,n]=(0,yw.useState)(null);return(0,yw.useLayoutEffect)(()=>{if(!e.spreadsheet)return;let i=ARe(e.chartType,e.spreadsheet,0,0);n(i);let a,o=t.current;return(async()=>(a=await nB(i,{exportBackground:!1,viewBackgroundColor:Ba.white},null,{skipInliningFonts:!0}),a.querySelector(".style-fonts")?.remove(),o.replaceChildren(),o.appendChild(a),e.selected&&o.parentNode.focus()))(),()=>{o.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),(0,uw.jsx)("button",{type:"button",className:"ChartPreview",onClick:()=>{r&&e.onClick(e.chartType,r)},children:(0,uw.jsx)("div",{ref:t})})},zYr=({setAppState:e,appState:t,onClose:r})=>{let{onInsertElements:n}=d1(),i=yw.default.useCallback(()=>{r&&r()},[r]),a=(o,s)=>{n(s),pa("paste","chart",o),e({currentChartType:o,pasteDialog:{shown:!1,data:null}})};return(0,uw.jsx)(K0,{size:"small",onCloseRequest:i,title:ce("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,uw.jsxs)("div",{className:"container",children:[(0,uw.jsx)(RAt,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:a}),(0,uw.jsx)(RAt,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:a})]})})},GYr=()=>(0,Nt.jsxs)("div",{className:"HelpDialog__header",children:[(0,Nt.jsxs)("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[(0,Nt.jsx)("div",{className:"HelpDialog__link-icon",children:Wte}),ce("helpDialog.documentation")]}),(0,Nt.jsxs)("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[(0,Nt.jsx)("div",{className:"HelpDialog__link-icon",children:Wte}),ce("helpDialog.blog")]}),(0,Nt.jsxs)("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,Nt.jsx)("div",{className:"HelpDialog__link-icon",children:Vte}),ce("helpDialog.github")]}),(0,Nt.jsxs)("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[(0,Nt.jsx)("div",{className:"HelpDialog__link-icon",children:V9e}),"YouTube"]})]}),WYr=e=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)("h3",{children:e.title}),(0,Nt.jsx)("div",{className:"HelpDialog__islands-container",children:e.children})]}),I4e=e=>(0,Nt.jsxs)("div",{className:`HelpDialog__island ${e.className}`,children:[(0,Nt.jsx)("h4",{className:"HelpDialog__island-title",children:e.caption}),(0,Nt.jsx)("div",{className:"HelpDialog__island-content",children:e.children})]});function*VYr(e,t){let r=!0;for(let n of e)r||(yield t),r=!1,yield n}var HYr=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),cr=({label:e,shortcuts:t,isOr:r=!0})=>{let n=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(a=>(0,Nt.jsx)(qYr,{children:HYr(a)},a)));return(0,Nt.jsxs)("div",{className:"HelpDialog__shortcut",children:[(0,Nt.jsx)("div",{children:e}),(0,Nt.jsx)("div",{className:"HelpDialog__key-container",children:[...VYr(n,r?ce("helpDialog.or"):null)]})]})},qYr=e=>(0,Nt.jsx)("kbd",{className:"HelpDialog__key",...e}),YYr=({onClose:e})=>{let t=uUt.default.useCallback(()=>{e&&e()},[e]);return(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)(K0,{onCloseRequest:t,title:ce("helpDialog.title"),className:"HelpDialog",children:[(0,Nt.jsx)(GYr,{}),(0,Nt.jsxs)(WYr,{title:ce("helpDialog.shortcuts"),children:[(0,Nt.jsxs)(I4e,{className:"HelpDialog__island--tools",caption:ce("helpDialog.tools"),children:[(0,Nt.jsx)(cr,{label:ce("toolBar.hand"),shortcuts:[qe.H]}),(0,Nt.jsx)(cr,{label:ce("toolBar.selection"),shortcuts:[qe.V,qe[1]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.rectangle"),shortcuts:[qe.R,qe[2]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.diamond"),shortcuts:[qe.D,qe[3]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.ellipse"),shortcuts:[qe.O,qe[4]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.arrow"),shortcuts:[qe.A,qe[5]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.line"),shortcuts:[qe.L,qe[6]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.freedraw"),shortcuts:[qe.P,qe[7]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.text"),shortcuts:[qe.T,qe[8]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.image"),shortcuts:[qe[9]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.eraser"),shortcuts:[qe.E,qe[0]]}),(0,Nt.jsx)(cr,{label:ce("toolBar.frame"),shortcuts:[qe.F]}),(0,Nt.jsx)(cr,{label:ce("toolBar.laser"),shortcuts:[qe.K]}),(0,Nt.jsx)(cr,{label:ce("labels.eyeDropper"),shortcuts:[qe.I,"Shift+S","Shift+G"]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.editLineArrowPoints"),shortcuts:[Tt("CtrlOrCmd+Enter")]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.editText"),shortcuts:[Tt("Enter")]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.textNewLine"),shortcuts:[Tt("Enter"),Tt("Shift+Enter")]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.textFinish"),shortcuts:[Tt("Esc"),Tt("CtrlOrCmd+Enter")]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.curvedArrow"),shortcuts:["A",ce("helpDialog.click"),ce("helpDialog.click"),ce("helpDialog.click")],isOr:!1}),(0,Nt.jsx)(cr,{label:ce("helpDialog.curvedLine"),shortcuts:["L",ce("helpDialog.click"),ce("helpDialog.click"),ce("helpDialog.click")],isOr:!1}),(0,Nt.jsx)(cr,{label:ce("helpDialog.cropStart"),shortcuts:[ce("helpDialog.doubleClick"),Tt("Enter")],isOr:!0}),(0,Nt.jsx)(cr,{label:ce("helpDialog.cropFinish"),shortcuts:[Tt("Enter"),Tt("Escape")],isOr:!0}),(0,Nt.jsx)(cr,{label:ce("toolBar.lock"),shortcuts:[qe.Q]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.preventBinding"),shortcuts:[Tt("CtrlOrCmd")]}),(0,Nt.jsx)(cr,{label:ce("toolBar.link"),shortcuts:[Tt("CtrlOrCmd+K")]})]}),(0,Nt.jsxs)(I4e,{className:"HelpDialog__island--view",caption:ce("helpDialog.view"),children:[(0,Nt.jsx)(cr,{label:ce("buttons.zoomIn"),shortcuts:[Tt("CtrlOrCmd++")]}),(0,Nt.jsx)(cr,{label:ce("buttons.zoomOut"),shortcuts:[Tt("CtrlOrCmd+-")]}),(0,Nt.jsx)(cr,{label:ce("buttons.resetZoom"),shortcuts:[Tt("CtrlOrCmd+0")]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),(0,Nt.jsx)(cr,{label:ce("buttons.zenMode"),shortcuts:[Tt("Alt+Z")]}),(0,Nt.jsx)(cr,{label:ce("buttons.objectsSnapMode"),shortcuts:[Tt("Alt+S")]}),(0,Nt.jsx)(cr,{label:ce("labels.toggleGrid"),shortcuts:[Tt("CtrlOrCmd+'")]}),(0,Nt.jsx)(cr,{label:ce("labels.viewMode"),shortcuts:[Tt("Alt+R")]}),(0,Nt.jsx)(cr,{label:ce("labels.toggleTheme"),shortcuts:[Tt("Alt+Shift+D")]}),(0,Nt.jsx)(cr,{label:ce("stats.fullTitle"),shortcuts:[Tt("Alt+/")]}),(0,Nt.jsx)(cr,{label:ce("search.title"),shortcuts:[iu("searchMenu")]}),(0,Nt.jsx)(cr,{label:ce("commandPalette.title"),shortcuts:dT?[iu("commandPalette")]:[iu("commandPalette"),iu("commandPalette",1)]})]}),(0,Nt.jsxs)(I4e,{className:"HelpDialog__island--editor",caption:ce("helpDialog.editor"),children:[(0,Nt.jsx)(cr,{label:ce("helpDialog.createFlowchart"),shortcuts:[Tt("CtrlOrCmd+Arrow Key")],isOr:!0}),(0,Nt.jsx)(cr,{label:ce("helpDialog.navigateFlowchart"),shortcuts:[Tt("Alt+Arrow Key")],isOr:!0}),(0,Nt.jsx)(cr,{label:ce("labels.moveCanvas"),shortcuts:[Tt(`Space+${ce("helpDialog.drag")}`),Tt(`Wheel+${ce("helpDialog.drag")}`)],isOr:!0}),(0,Nt.jsx)(cr,{label:ce("buttons.clearReset"),shortcuts:[Tt("CtrlOrCmd+Delete")]}),(0,Nt.jsx)(cr,{label:ce("labels.delete"),shortcuts:[Tt("Delete")]}),(0,Nt.jsx)(cr,{label:ce("labels.cut"),shortcuts:[Tt("CtrlOrCmd+X")]}),(0,Nt.jsx)(cr,{label:ce("labels.copy"),shortcuts:[Tt("CtrlOrCmd+C")]}),(0,Nt.jsx)(cr,{label:ce("labels.paste"),shortcuts:[Tt("CtrlOrCmd+V")]}),(0,Nt.jsx)(cr,{label:ce("labels.pasteAsPlaintext"),shortcuts:[Tt("CtrlOrCmd+Shift+V")]}),(0,Nt.jsx)(cr,{label:ce("labels.selectAll"),shortcuts:[Tt("CtrlOrCmd+A")]}),(0,Nt.jsx)(cr,{label:ce("labels.multiSelect"),shortcuts:[Tt(`Shift+${ce("helpDialog.click")}`)]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.deepSelect"),shortcuts:[Tt(`CtrlOrCmd+${ce("helpDialog.click")}`)]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.deepBoxSelect"),shortcuts:[Tt(`CtrlOrCmd+${ce("helpDialog.drag")}`)]}),(lB||dT)&&(0,Nt.jsx)(cr,{label:ce("labels.copyAsPng"),shortcuts:[Tt("Shift+Alt+C")]}),(0,Nt.jsx)(cr,{label:ce("labels.copyStyles"),shortcuts:[Tt("CtrlOrCmd+Alt+C")]}),(0,Nt.jsx)(cr,{label:ce("labels.pasteStyles"),shortcuts:[Tt("CtrlOrCmd+Alt+V")]}),(0,Nt.jsx)(cr,{label:ce("labels.sendToBack"),shortcuts:[Bp?Tt("CtrlOrCmd+Alt+["):Tt("CtrlOrCmd+Shift+[")]}),(0,Nt.jsx)(cr,{label:ce("labels.bringToFront"),shortcuts:[Bp?Tt("CtrlOrCmd+Alt+]"):Tt("CtrlOrCmd+Shift+]")]}),(0,Nt.jsx)(cr,{label:ce("labels.sendBackward"),shortcuts:[Tt("CtrlOrCmd+[")]}),(0,Nt.jsx)(cr,{label:ce("labels.bringForward"),shortcuts:[Tt("CtrlOrCmd+]")]}),(0,Nt.jsx)(cr,{label:ce("labels.alignTop"),shortcuts:[Tt("CtrlOrCmd+Shift+Up")]}),(0,Nt.jsx)(cr,{label:ce("labels.alignBottom"),shortcuts:[Tt("CtrlOrCmd+Shift+Down")]}),(0,Nt.jsx)(cr,{label:ce("labels.alignLeft"),shortcuts:[Tt("CtrlOrCmd+Shift+Left")]}),(0,Nt.jsx)(cr,{label:ce("labels.alignRight"),shortcuts:[Tt("CtrlOrCmd+Shift+Right")]}),(0,Nt.jsx)(cr,{label:ce("labels.duplicateSelection"),shortcuts:[Tt("CtrlOrCmd+D"),Tt(`Alt+${ce("helpDialog.drag")}`)]}),(0,Nt.jsx)(cr,{label:ce("helpDialog.toggleElementLock"),shortcuts:[Tt("CtrlOrCmd+Shift+L")]}),(0,Nt.jsx)(cr,{label:ce("buttons.undo"),shortcuts:[Tt("CtrlOrCmd+Z")]}),(0,Nt.jsx)(cr,{label:ce("buttons.redo"),shortcuts:dte?[Tt("CtrlOrCmd+Y"),Tt("CtrlOrCmd+Shift+Z")]:[Tt("CtrlOrCmd+Shift+Z")]}),(0,Nt.jsx)(cr,{label:ce("labels.group"),shortcuts:[Tt("CtrlOrCmd+G")]}),(0,Nt.jsx)(cr,{label:ce("labels.ungroup"),shortcuts:[Tt("CtrlOrCmd+Shift+G")]}),(0,Nt.jsx)(cr,{label:ce("labels.flipHorizontal"),shortcuts:[Tt("Shift+H")]}),(0,Nt.jsx)(cr,{label:ce("labels.flipVertical"),shortcuts:[Tt("Shift+V")]}),(0,Nt.jsx)(cr,{label:ce("labels.showStroke"),shortcuts:[Tt("S")]}),(0,Nt.jsx)(cr,{label:ce("labels.showBackground"),shortcuts:[Tt("G")]}),(0,Nt.jsx)(cr,{label:ce("labels.showFonts"),shortcuts:[Tt("Shift+F")]}),(0,Nt.jsx)(cr,{label:ce("labels.decreaseFontSize"),shortcuts:[Tt("CtrlOrCmd+Shift+<")]}),(0,Nt.jsx)(cr,{label:ce("labels.increaseFontSize"),shortcuts:[Tt("CtrlOrCmd+Shift+>")]})]})]})]})})},jYr=4,XYr=8,$Yr=({shouldWrap:e,children:t,username:r})=>e?(0,Hl.jsx)(j6,{label:r||"Unknown user",children:t}):(0,Hl.jsx)(Hl.Fragment,{children:t}),R4e=({actionManager:e,collaborator:t,socketId:r,withName:n=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:a})=>{let o={socketId:r,collaborator:t,withName:n,isBeingFollowed:a},s=e.renderAction("goToCollaborator",o);return(0,Hl.jsx)($Yr,{username:t.username,shouldWrap:i,children:s},r)},KYr=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],dUt=P6.default.memo(({className:e,mobile:t,collaborators:r,userToFollow:n})=>{let i=Qd(),a=new Map;r.forEach((m,g)=>{let y=m.id||g;a.set(y,{...m,socketId:g})});let o=Array.from(a.values()).filter(m=>m.username?.trim()),[s,l]=P6.default.useState(""),u=o.filter(m=>m.username?.toLowerCase().includes(s)),d=P6.default.useRef(null);(0,P6.useLayoutEffect)(()=>{if(d.current){let m=y=>{let v=Math.max(1,Math.min(8,Math.floor(y/38)));f(v)};if(m(d.current.clientWidth),!aO)return;let g=new ResizeObserver(y=>{for(let v of y){let{width:b}=v.contentRect;m(b)}});return g.observe(d.current),()=>{g.disconnect()}}},[]);let[h,f]=P6.default.useState(jYr),p=o.slice(0,h-1).map(m=>R4e({actionManager:i,collaborator:m,socketId:m.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:m.socketId===n}));return t?(0,Hl.jsx)("div",{className:St("UserList UserList_mobile",e),children:o.map(m=>R4e({actionManager:i,collaborator:m,socketId:m.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:m.socketId===n}))}):(0,Hl.jsx)("div",{className:"UserList__wrapper",ref:d,children:(0,Hl.jsxs)("div",{className:St("UserList",e),style:{"--max-avatars":h},children:[p,o.length>h-1&&(0,Hl.jsxs)(qb,{children:[(0,Hl.jsxs)(Yb,{className:"UserList__more",children:["+",o.length-h+1]}),(0,Hl.jsx)(XT,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:(0,Hl.jsxs)(Y0,{padding:2,children:[o.length>=XYr&&(0,Hl.jsx)(z7t,{placeholder:ce("quickSearch.placeholder"),onChange:l}),(0,Hl.jsx)(W7t,{className:"dropdown-menu UserList__collaborators",placeholder:ce("userList.empty"),children:u.length>0?[(0,Hl.jsx)("div",{className:"hint",children:ce("userList.hint.text")}),u.map(m=>R4e({actionManager:i,collaborator:m,socketId:m.socketId,withName:!0,isBeingFollowed:m.socketId===n}))]:[]}),(0,Hl.jsx)(eF,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let r=t.collaborators.keys();for(let[n,i]of e.collaborators){let a=t.collaborators.get(n);if(!a||n!==r.next().value||!El(i,a,KYr))return!1}return!0}),MAt=({children:e,color:t})=>(0,fUt.jsx)("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":Ba[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":Ba[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":Ba[t][9]},children:e}),ZYr=({elements:e,appState:t,setAppState:r,files:n,actionManager:i,exportOpts:a,canvas:o,onCloseRequest:s})=>{let{onExportToBackend:l}=a;return(0,ml.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,ml.jsxs)("div",{className:"ExportDialog-cards",children:[a.saveFileToDisk&&(0,ml.jsxs)(MAt,{color:"lime",children:[(0,ml.jsx)("div",{className:"Card-icon",children:MUe}),(0,ml.jsx)("h2",{children:ce("exportDialog.disk_title")}),(0,ml.jsxs)("div",{className:"Card-details",children:[ce("exportDialog.disk_details"),!M1&&i.renderAction("changeProjectName")]}),(0,ml.jsx)(Qn,{className:"Card-button",type:"button",title:ce("exportDialog.disk_button"),"aria-label":ce("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(n8t,"ui")}})]}),l&&(0,ml.jsxs)(MAt,{color:"pink",children:[(0,ml.jsx)("div",{className:"Card-icon",children:kO}),(0,ml.jsx)("h2",{children:ce("exportDialog.link_title")}),(0,ml.jsx)("div",{className:"Card-details",children:ce("exportDialog.link_details")}),(0,ml.jsx)(Qn,{className:"Card-button",type:"button",title:ce("exportDialog.link_button"),"aria-label":ce("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{pa("export","link",`ui (${oUe()})`),await l(e,t,n),s()}catch(u){r({errorMessage:u.message})}}})]}),a.renderCustomUI&&a.renderCustomUI(e,t,n,o)]})})},QYr=({elements:e,appState:t,files:r,actionManager:n,exportOpts:i,canvas:a,setAppState:o})=>{let s=hUt.default.useCallback(()=>{o({openDialog:null})},[o]);return(0,ml.jsx)(ml.Fragment,{children:t.openDialog?.name==="jsonExport"&&(0,ml.jsx)(K0,{onCloseRequest:s,title:ce("buttons.export"),children:(0,ml.jsx)(ZYr,{elements:e,appState:t,setAppState:o,files:r,actionManager:n,onCloseRequest:s,exportOpts:i,canvas:a})})})},JYr=e=>(0,pUt.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${ce("helpDialog.title")} \u2014 ?`,"aria-label":ce("helpDialog.title"),children:TO}),mUt=({appState:e,actionManager:t,showExitZenModeBtn:r,renderWelcomeScreen:n})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:a}=Qu(),o=gl(),s=!e.viewModeEnabled&&e.multiElement&&o.isTouchScreen;return(0,Xu.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,Xu.jsx)("div",{className:St("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:(0,Xu.jsx)(sp.Col,{gap:2,children:(0,Xu.jsxs)(rN,{heading:"canvasActions",children:[(0,Xu.jsx)(nYr,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&(0,Xu.jsx)(iYr,{renderAction:t.renderAction,className:St("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),s&&(0,Xu.jsx)(oYr,{renderAction:t.renderAction,className:St("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),(0,Xu.jsx)(i.Out,{}),(0,Xu.jsx)("div",{className:St("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:(0,Xu.jsxs)("div",{style:{position:"relative"},children:[n&&(0,Xu.jsx)(a.Out,{}),(0,Xu.jsx)(JYr,{onClick:()=>t.executeAction(S3e)})]})}),(0,Xu.jsx)(aYr,{actionManager:t,showExitZenModeBtn:r})]})},ejr=mUt;mUt.displayName="Footer";var yUt=gUt.default.createContext({}),bUt=({children:e,className:t})=>{let r=gl(),n=(0,vUt.useContext)(yUt),i=!!(r.editor.canFitSidebar&&n.shouldRenderDockButton);return(0,V6.jsxs)("div",{className:St("sidebar__header",t),"data-testid":"sidebar-header",children:[e,(0,V6.jsxs)("div",{className:"sidebar__header__buttons",children:[i&&(0,V6.jsx)(j6,{label:ce("labels.sidebarLock"),children:(0,V6.jsx)(X6,{onSelect:()=>n.onDock?.(!n.docked),selected:!!n.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":ce("labels.sidebarLock"),children:yUe})}),(0,V6.jsx)(X6,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:n.onCloseRequest,"aria-label":ce("buttons.close"),children:p5})]})]})};bUt.displayName="SidebarHeader";var xUt=({name:e,tab:t,icon:r,title:n,children:i,onToggle:a,className:o,style:s})=>{let l=Bs(),u=Ec();return(0,H6.jsxs)("label",{title:n,className:"sidebar-trigger__label-element",children:[(0,H6.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:d=>{document.querySelector(".layer-ui__wrapper")?.classList.remove("animate");let h=d.target.checked;l({openSidebar:h?{name:e,tab:t}:null}),a?.(h)},checked:u.openSidebar?.name===e,"aria-label":n,"aria-keyshortcuts":"0"}),(0,H6.jsxs)("div",{className:St("sidebar-trigger",o),style:s,children:[r&&(0,H6.jsx)("div",{children:r}),i&&(0,H6.jsx)("div",{className:"sidebar-trigger__label",children:i})]})]})};xUt.displayName="SidebarTrigger";var EUt=({children:e,...t})=>(0,wUt.jsx)(uF,{className:"sidebar-triggers",...t,children:e});EUt.displayName="SidebarTabTriggers";var TUt=({children:e,tab:t,onSelect:r,...n})=>(0,a3e.jsx)(dF,{value:t,asChild:!0,onSelect:r,children:(0,a3e.jsx)("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...n,children:e})});TUt.displayName="SidebarTabTrigger";var CUt=({children:e,...t})=>{let r=Ec(),n=Bs();if(!r.openSidebar)return null;let{name:i}=r.openSidebar;return(0,kUt.jsx)(cF,{className:"sidebar-tabs-root",value:r.openSidebar.tab,onValueChange:a=>n(o=>({...o,openSidebar:{...o.openSidebar,name:i,tab:a}})),...t,children:e})};CUt.displayName="SidebarTabs";var AUt=({tab:e,children:t,...r})=>(0,SUt.jsx)(hF,{...r,value:e,"data-testid":e,children:t});AUt.displayName="SidebarTab";var N3e=bs(!1),IUt=(0,Os.forwardRef)(({name:e,children:t,onDock:r,docked:n,className:i,...a},o)=>{en.DEV&&r&&n==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let s=Bs(),l=RK(N3e);(0,Os.useLayoutEffect)(()=>(l(!!n),()=>{l(!1)}),[l,n]);let u=(0,Os.useRef)({});u.current.onCloseRequest=()=>{s({openSidebar:null})},u.current.onDock=p=>r?.(p),u.current=fU(u.current,{docked:n,shouldRenderDockButton:!!r&&n!=null});let d=(0,Os.useRef)(null);(0,Os.useImperativeHandle)(o,()=>d.current);let h=gl(),f=(0,Os.useCallback)(()=>{document.querySelector(".Dialog")||s({openSidebar:null})},[s]);return b3e(d,(0,Os.useCallback)(p=>{p.target.closest(".sidebar-trigger")||(!n||!h.editor.canFitSidebar)&&f()},[f,n,h.editor.canFitSidebar])),(0,Os.useEffect)(()=>{let p=m=>{m.key===qe.ESCAPE&&(!n||!h.editor.canFitSidebar)&&f()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[f,n,h.editor.canFitSidebar]),(0,o3e.jsx)(Y0,{...a,className:St("sidebar",{"sidebar--docked":n},i),ref:d,children:(0,o3e.jsx)(yUt.Provider,{value:u.current,children:t})})});IUt.displayName="SidebarInner";var r1=Object.assign((0,Os.forwardRef)((e,t)=>{let r=Ec(),{onStateChange:n}=e,i=(0,Os.useRef)(r.openSidebar);(0,Os.useEffect)(()=>{(!r.openSidebar&&i?.current?.name===e.name||r.openSidebar?.name===e.name&&i?.current?.name!==e.name||i.current?.name===e.name)&&r.openSidebar!==i.current&&n?.(r.openSidebar?.name!==e.name?null:r.openSidebar),i.current=r.openSidebar},[r.openSidebar,n,e.name]);let[a,o]=(0,Os.useState)(!1);return(0,Os.useLayoutEffect)(()=>(o(!0),()=>o(!1)),[]),a&&r.openSidebar?.name===e.name?(0,UUt.createElement)(IUt,{...e,ref:t,key:e.name}):null}),{Header:bUt,TabTriggers:EUt,TabTrigger:TUt,Tabs:CUt,Tab:AUt,Trigger:xUt});r1.displayName="Sidebar";var RUt={};PJ(RUt,{ChangeCanvasBackground:()=>GUt,ClearCanvas:()=>FUt,CommandPalette:()=>PUt,Export:()=>WUt,Help:()=>BUt,LiveCollaborationTrigger:()=>HUt,LoadScene:()=>DUt,SaveAsImage:()=>_Ut,SaveToActiveFile:()=>NUt,SearchMenu:()=>OUt,Socials:()=>VUt,ToggleTheme:()=>zUt});var MUt=bs({active:!1});async function tjr({title:e,description:t,actionLabel:r,color:n}){return new Promise(i=>{W0.set(MUt,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:r,color:n})})}var LUt=({value:e,shortcut:t,onChange:r,choices:n,children:i,name:a})=>{let o=gl();return(0,Ev.jsxs)(Ev.Fragment,{children:[(0,Ev.jsxs)("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[(0,Ev.jsx)("label",{className:"dropdown-menu-item__text",htmlFor:a,children:i}),(0,Ev.jsx)(eUt,{name:a,value:e,onChange:r,choices:n})]}),t&&!o.editor.isMobile&&(0,Ev.jsx)("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};LUt.displayName="DropdownMenuItemContentRadio";var rjr=LUt,DUt=()=>{let{t:e}=au(),t=Qd(),r=uZ();return t.isActionEnabled(Y4e)?(0,Ka.jsx)(dp,{icon:CO,onSelect:async()=>{(!r.length||await tjr({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:(0,Ka.jsx)(s1,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:n=>(0,Ka.jsx)("strong",{children:n}),br:()=>(0,Ka.jsx)("br",{})})}))&&t.executeAction(Y4e)},"data-testid":"load-button",shortcut:iu("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};DUt.displayName="LoadScene";var NUt=()=>{let{t:e}=au(),t=Qd();return t.isActionEnabled(aAt)?(0,Ka.jsx)(dp,{shortcut:iu("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(aAt),icon:UUe,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};NUt.displayName="SaveToActiveFile";var _Ut=()=>{let e=Bs(),{t}=au();return(0,Ka.jsx)(dp,{icon:Hte,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:iu("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};_Ut.displayName="SaveAsImage";var PUt=e=>{let t=Bs(),{t:r}=au();return(0,Ka.jsx)(dp,{icon:pre,"data-testid":"command-palette-button",onSelect:()=>{pa("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:iu("commandPalette"),"aria-label":r("commandPalette.title"),className:e?.className,children:r("commandPalette.title")})};PUt.displayName="CommandPalette";var OUt=e=>{let{t}=au(),r=Qd();return(0,Ka.jsx)(dp,{icon:Nb,"data-testid":"search-menu-button",onSelect:()=>{r.executeAction(q8t)},shortcut:iu("searchMenu"),"aria-label":t("search.title"),className:e?.className,children:t("search.title")})};OUt.displayName="SearchMenu";var BUt=()=>{let{t:e}=au(),t=Qd();return(0,Ka.jsx)(dp,{"data-testid":"help-menu-item",icon:TO,onSelect:()=>t.executeAction(S3e),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};BUt.displayName="Help";var FUt=()=>{let{t:e}=au(),t=RK(nZ);return Qd().isActionEnabled(WD)?(0,Ka.jsx)(dp,{icon:Db,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};FUt.displayName="ClearCanvas";var zUt=e=>{let{t}=au(),r=Ec(),n=Qd(),i=iu("toggleTheme");return n.isActionEnabled(TK)?e?.allowSystemTheme?(0,Ka.jsx)(rjr,{name:"theme",value:e.theme,onChange:a=>e.onSelect(a),choices:[{value:Gn.LIGHT,label:EO,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:Gn.DARK,label:wO,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:W9e,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):(0,Ka.jsx)(dp,{onSelect:a=>{if(a.preventDefault(),e?.onSelect)e.onSelect(r.theme===Gn.DARK?Gn.LIGHT:Gn.DARK);else return n.executeAction(TK)},icon:r.theme===Gn.DARK?EO:wO,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":r.theme===Gn.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:r.theme===Gn.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};zUt.displayName="ToggleTheme";var GUt=()=>{let{t:e}=au(),t=Ec(),r=Qd(),n=pN();return t.viewModeEnabled||!n.UIOptions.canvasActions.changeViewBackgroundColor?null:(0,Ka.jsxs)("div",{style:{marginTop:"0.5rem"},children:[(0,Ka.jsx)("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),(0,Ka.jsx)("div",{style:{padding:"0 0.625rem"},children:r.renderAction("changeViewBackgroundColor")})]})};GUt.displayName="ChangeCanvasBackground";var WUt=()=>{let{t:e}=au(),t=Bs();return(0,Ka.jsx)(dp,{icon:bU,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};WUt.displayName="Export";var VUt=()=>{let{t:e}=au();return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)(yK,{icon:Vte,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),(0,Ka.jsx)(yK,{icon:SUe,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),(0,Ka.jsx)(yK,{icon:CUe,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};VUt.displayName="Socials";var HUt=({onSelect:e,isCollaborating:t})=>{let{t:r}=au();return(0,Ka.jsx)(dp,{"data-testid":"collab-button",icon:nre,className:St({"active-collab":t}),onSelect:e,children:r("labels.liveCollaboration")})};HUt.displayName="LiveCollaborationTrigger";var hN=(e,t)=>{let r=bs(0),n=i=>{let{tunnelsJotai:{useAtom:a}}=Qu(),[,o]=a(r),s=(0,sZ.useRef)({preferHost:!1,counter:0});return(0,sZ.useLayoutEffect)(()=>{let l=s.current;return o(u=>{let d=u+1;return l.counter=d,d}),()=>{o(u=>{let d=u-1;return l.counter=d,d||(l.preferHost=!1),d})}},[o]),i.__fallback||(s.current.preferHost=!0),!s.current.counter&&i.__fallback&&s.current.preferHost||s.current.counter>1&&i.__fallback?null:(0,qUt.jsx)(t,{...i})};return n.displayName=e,n},njr=Object.assign(hN("MainMenu",({children:e,onSelect:t})=>{let{MainMenuTunnel:r}=Qu(),n=gl(),i=Ec(),a=Bs(),o=n.editor.isMobile?void 0:()=>a({openMenu:null});return(0,wv.jsx)(r.In,{children:(0,wv.jsxs)(wa,{open:i.openMenu==="canvas",children:[(0,wv.jsx)(wa.Trigger,{onToggle:()=>{a({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:Gte}),(0,wv.jsxs)(wa.Content,{onClickOutside:o,onSelect:pU(t,()=>{a({openMenu:null})}),children:[e,n.editor.isMobile&&i.collaborators.size>0&&(0,wv.jsxs)("fieldset",{className:"UserList-Wrapper",children:[(0,wv.jsx)("legend",{children:ce("labels.collaborators")}),(0,wv.jsx)(dUt,{mobile:!0,collaborators:i.collaborators,userToFollow:i.userToFollow?.socketId||null})]})]})]})})}),{Trigger:wa.Trigger,Item:wa.Item,ItemLink:wa.ItemLink,ItemCustom:wa.ItemCustom,Group:wa.Group,Separator:wa.Separator,DefaultItems:RUt}),gs=njr,_3e=({title:e,children:t,actionLabel:r,onClick:n})=>(0,Tv.jsxs)("div",{className:"OverwriteConfirm__Actions__Action",children:[(0,Tv.jsx)("h4",{children:e}),(0,Tv.jsx)("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),(0,Tv.jsx)(HD,{variant:"outlined",color:"muted",label:r,size:"large",fullWidth:!0,onClick:n})]}),ijr=()=>{let{t:e}=au(),t=Qd(),r=Bs();return(0,Tv.jsx)(_3e,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(r8t,"ui",!0),r({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},ajr=()=>{let{t:e}=au(),t=Qd();return(0,Tv.jsx)(_3e,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(n8t,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},LAt=Object.assign(({children:e})=>(0,Tv.jsx)("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:ijr,SaveToDisk:ajr}),M4e=Object.assign(hN("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=Qu(),[r,n]=No(MUt);if(!r.active)return null;let i=()=>{r.onClose(),n(o=>({...o,active:!1}))},a=()=>{r.onConfirm(),n(o=>({...o,active:!1}))};return(0,tp.jsx)(t.In,{children:(0,tp.jsx)(K0,{onCloseRequest:i,title:!1,size:916,children:(0,tp.jsxs)("div",{className:"OverwriteConfirm",children:[(0,tp.jsx)("h3",{children:r.title}),(0,tp.jsxs)("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${r.color}`,children:[(0,tp.jsx)("div",{className:"OverwriteConfirm__Description__icon",children:k9e}),(0,tp.jsx)("div",{children:r.description}),(0,tp.jsx)("div",{className:"OverwriteConfirm__Description__spacer"}),(0,tp.jsx)(HD,{color:r.color,size:"large",label:r.actionLabel,onClick:a})]}),(0,tp.jsx)(LAt,{children:e})]})})})}),{Actions:LAt,Action:_3e}),ojr=bs(""),jUt=bs(null),sjr=350,ljr=()=>{let e=d1(),t=Bs(),r=(0,wc.useRef)(null),[n,i]=No(ojr),a=n.trim(),[o,s]=(0,wc.useState)(!1),[l,u]=(0,wc.useState)({nonce:null,items:[]}),d=(0,wc.useRef)(null),h=(0,wc.useRef)(void 0),[f,p]=No(jUt),m=e.scene.getNonDeletedElementsMap();(0,wc.useEffect)(()=>{o||(a!==d.current||e.scene.getSceneNonce()!==h.current)&&(d.current=null,DAt(a,e,(x,E)=>{u({nonce:Vp(),items:x}),d.current=a,h.current=e.scene.getSceneNonce(),t({searchMatches:x.map(w=>({id:w.textElement.id,focus:!1,matchedLines:w.matchedLines}))})}))},[o,a,m,e,t,p,h]);let g=()=>{l.items.length>0&&p(x=>x===null?0:(x+1)%l.items.length)},y=()=>{l.items.length>0&&p(x=>x===null?0:x-1<0?l.items.length-1:x-1)};(0,wc.useEffect)(()=>{t(x=>({searchMatches:x.searchMatches.map((E,w)=>w===f?{...E,focus:!0}:{...E,focus:!1})}))},[f,t]),(0,wc.useEffect)(()=>{if(l.items.length>0&&f!==null){let x=l.items[f];if(x){let E=e.state.zoom.value,w=pd({text:x.searchQuery,x:x.textElement.x+(x.matchedLines[0]?.offsetX??0),y:x.textElement.y+(x.matchedLines[0]?.offsetY??0),width:x.matchedLines[0]?.width,height:x.matchedLines[0]?.height,fontSize:x.textElement.fontSize,fontFamily:x.textElement.fontFamily}),T=14,C=x.textElement.fontSize,S=C*E=T?R={fitToContent:!0}:R={fitToViewport:!0,maxZoom:Gp(T/C,1)}:R={fitToContent:!0},e.scrollToContent(w,{animate:!0,duration:300,...R,canvasOffsets:e.getEditorUIOffsets()})}}}},[f,l,e]),(0,wc.useEffect)(()=>()=>{p(null),d.current=null,h.current=void 0,t({searchMatches:[]}),s(!1)},[t,p]);let v=OK({goToNextItem:g,goToPreviousItem:y,searchMatches:l});(0,wc.useEffect)(()=>Ga(window,"keydown",E=>{if(E.key===qe.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){E.preventDefault(),E.stopPropagation(),t({openSidebar:null});return}E[qe.CTRL_OR_CMD]&&E.key===qe.F&&(E.preventDefault(),E.stopPropagation(),r.current?.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),r.current?.focus(),r.current?.select())),E.target instanceof HTMLElement&&E.target.closest(".layer-ui__search")&&v.searchMatches.items.length&&(E.key===qe.ENTER&&(E.stopPropagation(),v.goToNextItem()),E.key===qe.ARROW_UP?(E.stopPropagation(),v.goToPreviousItem()):E.key===qe.ARROW_DOWN&&(E.stopPropagation(),v.goToNextItem()))},{capture:!0,passive:!1}),[t,v,e]);let b=`${l.items.length} ${l.items.length===1?ce("search.singleResult"):ce("search.multipleResults")}`;return(0,es.jsxs)("div",{className:"layer-ui__search",children:[(0,es.jsx)("div",{className:"layer-ui__search-header",children:(0,es.jsx)(L3e,{className:a5.SEARCH_MENU_INPUT_WRAPPER,value:n,ref:r,placeholder:ce("search.placeholder"),icon:Nb,onChange:x=>{i(x),s(!0);let E=x.trim();DAt(E,e,(w,T)=>{u({nonce:Vp(),items:w}),p(T),d.current=E,h.current=e.scene.getSceneNonce(),t({searchMatches:w.map(C=>({id:C.textElement.id,focus:!1,matchedLines:C.matchedLines}))}),s(!1)})},selectOnRender:!0})}),(0,es.jsxs)("div",{className:"layer-ui__search-count",children:[l.items.length>0&&(0,es.jsxs)(es.Fragment,{children:[f!==null&&f>-1?(0,es.jsxs)("div",{children:[f+1," / ",b]}):(0,es.jsx)("div",{children:b}),(0,es.jsxs)("div",{className:"result-nav",children:[(0,es.jsx)(X6,{onSelect:()=>{g()},className:"result-nav-btn",children:gre}),(0,es.jsx)(X6,{onSelect:()=>{y()},className:"result-nav-btn",children:K9e})]})]}),l.items.length===0&&a&&d.current&&(0,es.jsx)("div",{style:{margin:"1rem auto"},children:ce("search.noMatch")})]}),(0,es.jsx)(hjr,{matches:l,onItemClick:p,focusIndex:f,searchQuery:a})]})},cjr=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return(0,es.jsx)("div",{tabIndex:-1,className:St("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:r=>{e.highlighted&&r?.scrollIntoView({behavior:"auto",block:"nearest"})},children:(0,es.jsx)("div",{className:"preview-text",children:t.flatMap((r,n)=>(0,es.jsx)(wc.Fragment,{children:n===2?(0,es.jsx)("b",{children:r}):r},n))})})},ujr=e=>(0,es.jsx)("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,r)=>(0,es.jsx)(cjr,{searchQuery:e.searchQuery,preview:t.preview,highlighted:r===e.focusIndex,onClick:()=>e.onItemClick(r)},t.textElement.id+t.index))}),djr=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,hjr=(0,wc.memo)(ujr,djr),fjr=(e,t,r)=>{let n=e.slice(0,t),i=n.split(/\s+/),a=n.endsWith(" "),o=i.length-2-1-(a?0:1),s=i.slice(o<=0?0:o).join(" ")+(a?" ":""),l=20;s=s.length>l?s.slice(-l):s;let u=e.slice(t+r.length),d=u.split(/\s+/),h=!u.startsWith(" "),f=h?6:5,p=(h?"":" ")+d.slice(0,f).join(" ");return{indexInSearchQuery:s.length,previewText:s+r+p,moreBefore:o>0,moreAfter:d.length>f}},pjr=(e,t)=>{let r=e.split(` -`),n=[],i=0;for(let a=0;ao.length+i){let u=l-(o.length+i);for(;u>0;)o+=" ",u--}}n.push(o),i=i+o.length}return n.join(` -`)},mjr=(e,t,r)=>{let n=pjr(e.text,e.originalText).split(` -`),i=[],a=0,o=0;for(let d of n){let h=a,f=h+d.length-1;i.push({line:d,startIndex:h,endIndex:f,lineNumber:o}),a=f+1,o++}let s=r,l=e.originalText.slice(r,r+t.length),u=[];for(let d of i){if(l==="")break;if(s>=d.startIndex&&s<=d.endIndex){let h=d.endIndex+1-s,f=d.line.slice(0,s-d.startIndex),p=l.slice(0,h);l=l.slice(h);let m=Jl(f,Bi(e),e.lineHeight);if(f===""&&(m.width=0),e.textAlign!=="left"&&d.line.length>0){let x=Jl(d.line,Bi(e),e.lineHeight),E=e.textAlign==="center"?(e.width-x.width)/2:e.width-x.width;m.width+=E}let{width:g,height:y}=Jl(p,Bi(e),e.lineHeight),v=m.width,b=d.lineNumber*m.height;u.push({offsetX:v,offsetY:b,width:g,height:y}),s+=h}}return u},gjr=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),DAt=(0,YUt.default)((e,t,r)=>{if(!e||e===""){r([],null);return}let n=t.scene.getNonDeletedElements().filter(l=>er(l));n.sort((l,u)=>l.y-u.y);let i=[],a=new RegExp(gjr(e),"gi");for(let l of n){let u=null,d=l.originalText;for(;(u=a.exec(d))!==null;){let h=fjr(d,u.index,e),f=mjr(l,e,u.index);f.length>0&&i.push({textElement:l,searchQuery:e,preview:h,index:u.index,matchedLines:f})}}let o=new Set(t.visibleElements.map(l=>l.id)),s=i.findIndex(l=>o.has(l.textElement.id))??null;r(i,s)},sjr),$Ut=hN("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=Qu();return(0,$u.jsx)(t.In,{children:(0,$u.jsx)(r1.Trigger,{...e,className:"default-sidebar-trigger",name:bf.name})})});$Ut.displayName="DefaultSidebarTrigger";var KUt=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=Qu();return(0,$u.jsx)(t.In,{children:e})};KUt.displayName="DefaultTabTriggers";var NAt=Object.assign(hN("DefaultSidebar",({children:e,className:t,onDock:r,docked:n,...i})=>{let a=Ec(),o=Bs(),{DefaultSidebarTabTriggersTunnel:s}=Qu(),l=a.openSidebar?.tab===l5;return(0,XUt.createElement)(r1,{...i,name:"default",key:"default",className:St("default-sidebar",t),docked:l||(n??a.defaultSidebarDockedPreference),onDock:l||r===!1||!r&&n!=null?void 0:pU(r,u=>{o({defaultSidebarDockedPreference:u})})},(0,$u.jsxs)(r1.Tabs,{children:[(0,$u.jsx)(r1.Header,{children:(0,$u.jsxs)(r1.TabTriggers,{children:[(0,$u.jsx)(r1.TabTrigger,{tab:l5,children:Nb}),(0,$u.jsx)(r1.TabTrigger,{tab:cU,children:vO}),(0,$u.jsx)(s.Out,{})]})}),(0,$u.jsx)(r1.Tab,{tab:cU,children:(0,$u.jsx)(Hqr,{})}),(0,$u.jsx)(r1.Tab,{tab:l5,children:(0,$u.jsx)(ljr,{})}),e]}))}),{Trigger:$Ut,TabTriggers:KUt}),yjr="small",vjr=e=>(0,iN.jsxs)("label",{className:St("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${yjr}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,iN.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),(0,iN.jsx)("div",{className:"ToolIcon__icon",children:hre})]}),bjr=({canvasRef:e,setError:t})=>{let r=e.current;if(!r)return;let n=r.parentElement;n&&(n.style.background="",t(null),r.replaceChildren())},ZUt=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:r,setError:n,data:i})=>{let a=e.current,o=a?.parentElement;if(!(!a||!o)){if(!r){bjr({canvasRef:e,setError:n});return}try{let s=await t.api,l;try{l=await s.parseMermaidToExcalidraw(r)}catch{l=await s.parseMermaidToExcalidraw(r.replace(/"/g,"'"))}let{elements:u,files:d={}}=l;n(null),i.current={elements:h3e(u,{regenerateIds:!0}),files:d};let h=await cB({elements:i.current.elements,files:i.current.files,exportPadding:s5,maxWidthOrHeight:Math.max(o.offsetWidth,o.offsetHeight)*window.devicePixelRatio});try{await _T(h)}catch(f){throw f.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(ce("canvasError.canvasTooBig")):f}o.style.background="var(--default-bg-color)",a.replaceChildren(h)}catch(s){throw o.style.background="var(--default-bg-color)",r&&n(s),s}}},P3e=e=>{F6.set(fT.MERMAID_TO_EXCALIDRAW,e)},QUt=({app:e,data:t,text:r,shouldSaveMermaidDataToStorage:n})=>{let{elements:i,files:a}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:a,position:"center",fitToContent:!0}),e.setOpenDialog(null),n&&r&&P3e(r))},e9t=({children:e})=>(0,JUt.jsx)("div",{className:"ttd-dialog-panels",children:e}),CK=({label:e,children:t,panelAction:r,panelActionDisabled:n=!1,onTextSubmitInProgess:i,renderTopRight:a,renderSubmitShortcut:o,renderBottomRight:s})=>(0,a1.jsxs)("div",{className:"ttd-dialog-panel",children:[(0,a1.jsxs)("div",{className:"ttd-dialog-panel__header",children:[(0,a1.jsx)("label",{children:e}),a?.()]}),t,(0,a1.jsxs)("div",{className:St("ttd-dialog-panel-button-container",{invisible:!r}),style:{display:"flex",alignItems:"center"},children:[(0,a1.jsxs)(X6,{className:"ttd-dialog-panel-button",onSelect:r?r.action:()=>{},disabled:n||i,children:[(0,a1.jsxs)("div",{className:St({invisible:i}),children:[r?.label,r?.icon&&(0,a1.jsx)("span",{children:r.icon})]}),i&&(0,a1.jsx)(kv,{})]}),!n&&!i&&o?.(),s?.()]})]}),r9t=({input:e,placeholder:t,onChange:r,onKeyboardSubmit:n})=>{let i=(0,aN.useRef)(null),a=(0,aN.useRef)(n);return a.current=n,(0,aN.useEffect)(()=>{if(!a.current)return;let o=i.current;if(o){let s=l=>{l[qe.CTRL_OR_CMD]&&l.key===qe.ENTER&&(l.preventDefault(),a.current?.())};return o.addEventListener("keydown",s),()=>{o.removeEventListener("keydown",s)}}},[]),(0,t9t.jsx)("textarea",{className:"ttd-dialog-input",onChange:r,value:e,placeholder:t,autoFocus:!0,ref:i})},xjr=({error:e})=>(0,dw.jsxs)("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",(0,dw.jsx)("p",{children:e})]}),n9t=({error:e,canvasRef:t,loaded:r})=>(0,dw.jsxs)("div",{className:"ttd-dialog-output-wrapper",children:[e&&(0,dw.jsx)(xjr,{error:e.message}),r?(0,dw.jsx)("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):(0,dw.jsx)(kv,{size:"2rem"})]}),i9t=()=>(0,oN.jsxs)("div",{className:"ttd-dialog-submit-shortcut",children:[(0,oN.jsx)("div",{className:"ttd-dialog-submit-shortcut__key",children:Tt("CtrlOrCmd")}),(0,oN.jsx)("div",{className:"ttd-dialog-submit-shortcut__key",children:Tt("Enter")})]}),wjr=`flowchart TD - A[Christmas] -->|Get money| B(Go shopping) - B --> C{Let me think} - C -->|One| D[Laptop] - C -->|Two| E[iPhone] - C -->|Three| F[Car]`,_At=d5(P3e,300),Ejr=({mermaidToExcalidrawLib:e})=>{let[t,r]=(0,X0.useState)(()=>F6.get(fT.MERMAID_TO_EXCALIDRAW)||wjr),n=(0,X0.useDeferredValue)(t.trim()),[i,a]=(0,X0.useState)(null),o=(0,X0.useRef)(null),s=(0,X0.useRef)({elements:[],files:null}),l=d1();(0,X0.useEffect)(()=>{ZUt({canvasRef:o,data:s,mermaidToExcalidrawLib:e,setError:a,mermaidDefinition:n}).catch(d=>{Ste()&&console.error("Failed to parse mermaid definition",d)}),_At(n)},[n,e]),(0,X0.useEffect)(()=>()=>{_At.flush()},[]);let u=()=>{QUt({app:l,data:s,text:t,shouldSaveMermaidDataToStorage:!0})};return(0,eu.jsxs)(eu.Fragment,{children:[(0,eu.jsx)("div",{className:"ttd-dialog-desc",children:(0,eu.jsx)(s1,{i18nKey:"mermaid.description",flowchartLink:d=>(0,eu.jsx)("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:d}),sequenceLink:d=>(0,eu.jsx)("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:d}),classLink:d=>(0,eu.jsx)("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:d})})}),(0,eu.jsxs)(e9t,{children:[(0,eu.jsx)(CK,{label:ce("mermaid.syntax"),children:(0,eu.jsx)(r9t,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:d=>r(d.target.value),onKeyboardSubmit:()=>{u()}})}),(0,eu.jsx)(CK,{label:ce("mermaid.preview"),panelAction:{action:()=>{u()},label:ce("mermaid.button"),icon:wU},renderSubmitShortcut:()=>(0,eu.jsx)(i9t,{}),children:(0,eu.jsx)(n9t,{canvasRef:o,loaded:e.loaded,error:i})})]})]})},Tjr=Ejr,o9t=e=>{let t=Bs(),r=(0,s3e.useRef)(null),n=(0,s3e.useRef)(0);return(0,a9t.jsx)(cF,{ref:r,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{if(!i)return;let a=r.current?.closest(".Modal__content");if(a){let o=a.offsetHeight||0;o>n.current&&(n.current=o,a.style.minHeight=`min(${n.current}px, 100%)`)}e.dialog==="ttd"&&Ute(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};o9t.displayName="TTDDialogTabs";var kjr=o9t,l9t=({children:e,...t})=>(0,s9t.jsx)(uF,{className:"ttd-dialog-triggers",...t,children:e});l9t.displayName="TTDDialogTabTriggers";var c3e=({children:e,tab:t,onSelect:r,...n})=>(0,l3e.jsx)(dF,{value:t,asChild:!0,onSelect:r,children:(0,l3e.jsx)("button",{type:"button",className:"ttd-dialog-tab-trigger",...n,children:e})});c3e.displayName="TTDDialogTabTrigger";var u3e=({tab:e,children:t,...r})=>(0,c9t.jsx)(hF,{...r,value:e,children:t});u3e.displayName="TTDDialogTab";var L4e=3,GA=1e3,Cjr=bs(null),Sjr=bs(null),Ajr=e=>{let t=Ec();return t.openDialog?.name!=="ttd"?null:(0,$a.jsx)(Ujr,{...e,tab:t.openDialog.tab})},Ujr=hN("TTDDialogBase",({tab:e,...t})=>{let r=d1(),n=Bs(),i=(0,V0.useRef)(null),[a,o]=No(Sjr),[s,l]=(0,V0.useState)(a?.prompt??""),u=s.trim(),d=T=>{l(T.target.value),o(C=>({generatedResponse:C?.generatedResponse??null,prompt:T.target.value}))},[h,f]=(0,V0.useState)(!1),[p,m]=No(Cjr),g=async()=>{if(u.length>GA||u.lengthGA&&w(new Error(`Prompt is too long (max ${GA} characters)`));return}try{f(!0),pa("ai","generate","ttd");let{generatedResponse:T,error:C,rateLimit:S,rateLimitRemaining:R}=await t.onTextSubmit(u);if(typeof T=="string"&&o(U=>({generatedResponse:T,prompt:U?.prompt??null})),rT(S)&&rT(R)&&m({rateLimit:S,rateLimitRemaining:R}),C){w(C);return}if(!T){w(new Error("Generation failed"));return}try{await ZUt({canvasRef:i,data:x,mermaidToExcalidrawLib:v,setError:w,mermaidDefinition:T}),pa("ai","mermaid parse success","ttd")}catch(U){console.info(`%cTTD mermaid render errror: ${U.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -TTD mermaid definition render errror: ${U.message}`,"color: yellow"),pa("ai","mermaid parse failed","ttd"),w(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(T){let C=T.message;(!C||C==="Failed to fetch")&&(C="Request failed"),w(new Error(C))}finally{f(!1)}},y=(0,V0.useRef)(g);y.current=g;let[v,b]=(0,V0.useState)({loaded:!1,api:Promise.resolve().then(()=>(T4e(),E4e))});(0,V0.useEffect)(()=>{(async()=>(await v.api,b(T=>({...T,loaded:!0}))))()},[v.api]);let x=(0,V0.useRef)({elements:[],files:null}),[E,w]=(0,V0.useState)(null);return(0,$a.jsx)(K0,{className:"ttd-dialog",onCloseRequest:()=>{r.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:(0,$a.jsxs)(kjr,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?(0,$a.jsx)("p",{className:"dialog-mermaid-title",children:ce("mermaid.title")}):(0,$a.jsxs)(l9t,{children:[(0,$a.jsx)(c3e,{tab:"text-to-diagram",children:(0,$a.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[ce("labels.textToDiagram"),(0,$a.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),(0,$a.jsx)(c3e,{tab:"mermaid",children:"Mermaid"})]}),(0,$a.jsx)(u3e,{className:"ttd-dialog-content",tab:"mermaid",children:(0,$a.jsx)(Tjr,{mermaidToExcalidrawLib:v})}),!("__fallback"in t)&&(0,$a.jsxs)(u3e,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[(0,$a.jsx)("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),(0,$a.jsxs)(e9t,{children:[(0,$a.jsx)(CK,{label:ce("labels.prompt"),panelAction:{action:g,label:"Generate",icon:wU},onTextSubmitInProgess:h,panelActionDisabled:u.length>GA||p?.rateLimitRemaining===0,renderTopRight:()=>p?(0,$a.jsxs)("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:p.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[p.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>(0,$a.jsx)(i9t,{}),renderBottomRight:()=>{if(typeof a?.generatedResponse=="string")return(0,$a.jsxs)("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof a?.generatedResponse=="string"&&(P3e(a.generatedResponse),n({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",(0,$a.jsx)(FK,{icon:wU})]});let T=u.length/GA;return T>.8?(0,$a.jsxs)("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:T>1?"var(--color-danger)":void 0},children:["Length: ",u.length,"/",GA]}):null},children:(0,$a.jsx)(r9t,{onChange:d,input:s,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{y.current()}})}),(0,$a.jsx)(CK,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),QUt({app:r,data:x})},label:"Insert",icon:wU},children:(0,$a.jsx)(n9t,{canvasRef:i,error:E,loaded:v.loaded})})]})]})]})})}),Ijr=.01,Cv=(e,t)=>!(t==="height"&&er(e)||t==="width"&&er(e)||t==="angle"&&qr(e)),ru=(e,t)=>{let r=e+t/2;return r-r%t},SK=(e,t,r)=>Object.keys(e).map(n=>({original:(r??t).get(n),latest:t.get(n)})).filter(n=>n.original!==void 0&&n.latest!==void 0),sN=(e,t,r,n,i,a,o,s=!0)=>{let l=n.get(r.id);if(!l)return;let[u,d]=[r.x+r.width/2,r.y+r.height/2],[h,f]=ht(ne(r.x,r.y),ne(u,d),r.angle),p=e-h,m=t-f,[g,y]=ht(ne(e,t),ne(u+p,d+m),-r.angle);kt(l,{x:g,y},s),d3e(l,n,i,a);let v=hn(r,o);if(v){let b=n.get(v.id);b&&kt(b,{x:v.x+p,y:v.y+m},s)}},O3e=(e,t)=>{let r=Ob(t).map(n=>ya(e,n).reduce((i,a)=>(i[a.id]=!0,i),{}));return e.filter(n=>!y5(n)).forEach(n=>{r.push({[n.id]:!0})}),r},d3e=(e,t,r,n,i)=>{dn(e)?CU([e],t,r,n,!0,[],i?.zoom):gu(e,t,i)},Rjr=({label:e,icon:t,dragInputCallback:r,value:n,elements:i,editable:a=!0,shouldKeepAspectRatio:o,property:s,scene:l,appState:u,sensitivity:d=1})=>{let h=d1(),f=(0,l1.useRef)(null),p=(0,l1.useRef)(null),[m,g]=(0,l1.useState)(n.toString()),y=(0,l1.useRef)(null);y.current||(y.current={originalAppState:wm(u),originalElements:i,lastUpdatedValue:m,updatePending:!1}),(0,l1.useEffect)(()=>{let x=n.toString();g(x),y.current.lastUpdatedValue=x},[n]);let v=(x,E,w)=>{if(!y.current.updatePending)return!1;y.current.updatePending=!1;let T=Number(x);if(isNaN(T)){g(n.toString());return}let C=Number(T.toFixed(2)),S=Number(n);(isNaN(S)||Math.abs(C-S)>=Ijr)&&(y.current.lastUpdatedValue=x,r({accumulatedChange:0,instantChange:0,originalElements:E,originalElementsMap:h.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:o,shouldChangeByStepSize:!1,scene:l,nextValue:C,property:s,originalAppState:w,setInputValue:R=>g(String(R))}),h.syncActionResult({captureUpdate:pt.IMMEDIATELY}))},b=(0,l1.useRef)({});return b.current.handleInputValue=v,(0,l1.useEffect)(()=>{let x=f.current,E=b.current;return()=>{let w=x?.value;w&&E.handleInputValue?.(w,y.current.originalElements,y.current.originalAppState),window.removeEventListener("pointermove",E.onPointerMove,!1),window.removeEventListener("pointerup",E.onPointerUp,!1)}},[a]),a?(0,e7.jsxs)("div",{className:St("drag-input-container",!a&&"disabled"),"data-testid":e,children:[(0,e7.jsx)("div",{className:"drag-input-label",ref:p,onPointerDown:x=>{if(f.current&&a){document.body.classList.add("excalidraw-cursor-resize");let E=Number(f.current.value);isNaN(E)&&(E=0);let w=null,T=h.scene.getNonDeletedElements().reduce((A,P)=>(A.set(P.id,Bb(P)),A),new Map),C=i.map(A=>T.get(A.id)),S=wm(u),R=0,U=0,L=A=>{if(w&&T!==null&&C!==null){let P=A.clientX-w.x;P!==0&&(U+=P,Math.abs(U)>=d&&(U=Math.sign(U)*Math.floor(Math.abs(U)/d),R+=U,r({accumulatedChange:R,instantChange:U,originalElements:C,originalElementsMap:T,shouldKeepAspectRatio:o,shouldChangeByStepSize:A.shiftKey,property:s,scene:l,originalAppState:S,setInputValue:D=>g(String(D))}),U=0))}w={x:A.clientX,y:A.clientY}},I=()=>{window.removeEventListener("pointermove",L,!1),h.syncActionResult({captureUpdate:pt.IMMEDIATELY}),w=null,R=0,U=0,C=null,T=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",I,!1)};b.current.onPointerMove=L,b.current.onPointerUp=I,window.addEventListener("pointermove",L,!1),window.addEventListener("pointerup",I,!1)}},onPointerEnter:()=>{p.current&&(p.current.style.cursor="ew-resize")},children:t?(0,e7.jsx)(FK,{icon:t}):e}),(0,e7.jsx)("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:x=>{if(a){let E=x.target;E instanceof HTMLInputElement&&x.key===qe.ENTER&&(v(E.value,i,u),h.focusContainer())}},ref:f,value:m,onChange:x=>{y.current.updatePending=!0,g(x.target.value)},onFocus:x=>{x.target.select(),y.current.originalElements=i,y.current.originalAppState=wm(u)},onBlur:x=>{m?a&&v(x.target.value,y.current.originalElements,y.current.originalAppState):g(n.toString())},disabled:!a})]}):null},Av=Rjr,PAt=10,Mjr=e=>e.type==="image",Ljr=({accumulatedChange:e,originalElements:t,originalElementsMap:r,shouldKeepAspectRatio:n,shouldChangeByStepSize:i,nextValue:a,property:o,originalAppState:s,instantChange:l,scene:u})=>{let d=u.getNonDeletedElementsMap(),h=t[0],f=d.get(h.id);if(h&&f){let p=n||Mjr(h),m=h.width/h.height;if(s.croppingElementId===h.id){let x=d.get(h.id);if(!x||!hi(x)||!x.crop)return;let E=x.crop,w={...E},T=x.scale[0]===-1,C=x.scale[1]===-1,{width:S,height:R}=gm(x),U=E.naturalWidth/S,L=E.naturalHeight/R,I=T?E.width+E.x:E.naturalWidth-E.x,A=C?E.height+E.y:E.naturalHeight-E.y,P=qs*U,D=qs*L;if(a!==void 0){if(o==="width"){let F=a*U,G=Nn(F,P,I);w={...w,width:G,x:T?E.x+E.width-G:E.x}}else if(o==="height"){let F=a*L,G=Nn(F,D,A);w={...w,height:G,y:C?E.y+E.height-G:E.y}}kt(x,{crop:w,width:w.width/(E.naturalWidth/S),height:w.height/(E.naturalHeight/R)});return}let M=o==="width"?l:0,O=o==="height"?l:0,_=Nn(E.width+M,P,I),B=Nn(E.height+O,P,A);w={...E,x:T?E.x+E.width-_:E.x,y:C?E.y+E.height-B:E.y,width:_,height:B},kt(x,{crop:w,width:w.width/(E.naturalWidth/S),height:w.height/(E.naturalHeight/R)});return}if(a!==void 0){let x=Math.max(o==="width"?a:p?a*m:h.width,ph),E=Math.max(o==="height"?a:p?a/m:h.height,ph);NT(x,E,f,h,d,r,o==="width"?"e":"s",{shouldMaintainAspectRatio:p});return}let g=o==="width"?e:0,y=o==="height"?e:0,v=Math.max(0,h.width+g);o==="width"&&(i?v=ru(v,PAt):v=Math.round(v));let b=Math.max(0,h.height+y);o==="height"&&(i?b=ru(b,PAt):b=Math.round(b)),p&&(o==="width"?b=Math.round(v/m*100)/100:v=Math.round(b*m*100)/100),b=Math.max(ph,b),v=Math.max(ph,v),NT(v,b,f,h,d,r,o==="width"?"e":"s",{shouldMaintainAspectRatio:p})}},Djr=({property:e,element:t,scene:r,appState:n})=>{let i=Gp(e==="width"?t.width:t.height,2);if(n.croppingElementId&&n.croppingElementId===t.id&&hi(t)&&t.crop){let{width:a,height:o}=gm(t);if(e==="width"){let s=a/t.crop.naturalWidth;i=Gp(t.crop.width*s,2)}if(e==="height"){let s=o/t.crop.naturalHeight;i=Gp(t.crop.height*s,2)}}return(0,d9t.jsx)(Av,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:Ljr,value:i,editable:Cv(t,e),scene:r,appState:n,property:e})},OAt=Djr,Njr=15,_jr=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:r,nextValue:n,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=i.getNonDeletedElements(),s=t[0];if(s&&!ar(s)){let l=a.get(s.id);if(!l)return;if(n!==void 0){let m=yb(n);kt(l,{angle:m}),d3e(l,a,o,i);let g=hn(l,a);g&&!An(l)&&kt(g,{angle:m});return}let u=Math.round(pT(s.angle)*100)/100,d=Math.round(e),h=(u+d)%360;r&&(h=ru(h,Njr)),h=h<0?h+360:h;let f=yb(h);kt(l,{angle:f}),d3e(l,a,o,i);let p=hn(l,a);p&&!An(l)&&kt(p,{angle:f})}},Pjr=({element:e,scene:t,appState:r,property:n})=>(0,h9t.jsx)(Av,{label:"A",icon:sre,value:Math.round(pT(e.angle)%360*100)/100,elements:[e],dragInputCallback:_jr,editable:Cv(e,"angle"),scene:t,appState:r,property:n}),Ojr=Pjr,BAt=4,Bjr=4,Fjr=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:r,nextValue:n,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=t[0];if(o){let s=a.get(o.id);if(!s||!er(s))return;let l;if(n!==void 0)l=Math.max(Math.round(n),BAt);else if(o.type==="text"){let u=Math.round(o.fontSize),d=Math.round(e);l=Math.max(u+d,BAt),r&&(l=ru(l,Bjr))}l&&(kt(s,{fontSize:l}),Mc(s,i.getContainerElement(s),i.getNonDeletedElementsMap()))}},zjr=({element:e,scene:t,appState:r,property:n})=>{let i=er(e)?e:md(e)?hn(e,t.getNonDeletedElementsMap()):null;return i?(0,f9t.jsx)(Av,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:Fjr,icon:xU,appState:r,scene:t,property:n}):null},Gjr=zjr,WA=10,Wjr=(e,t,r,n)=>{let i=n.x-e,a=n.y-t,o=n.width*r,s=n.height*r,l=e+i*r,u=t+a*r;return{width:o,height:s,x:l,y:u,...vB(n,o,s,!1),...er(n)?{fontSize:n.fontSize*r}:{}}},Vjr=(e,t,r,n,i,a,o,s)=>{let l=Wjr(e,t,n,a);kt(i,l,!1);let u=hn(a,s);if(u){let d=u.fontSize*n;gu(i,o,{newSize:{width:l.width,height:l.height}});let h=o.get(u.id);h&&er(h)&&(kt(h,{fontSize:d},!1),ST(i,o,r==="width"?"e":"s",!0))}},FAt=(e,t,r,n,i,a,o,s,l,u)=>{a==="width"?t=Math.round(e/n*100)/100:e=Math.round(t*n*100)/100;let d=t/r;for(let h=0;h{let l=o.getNonDeletedElementsMap(),u=O3e(t,n);if(a!==void 0){for(let f of u){let p=SK(f,l,r);if(p.length>1){let m=p.map(R=>R.latest),g=p.map(R=>R.original),[y,v,b,x]=mi(g),E=b-y,w=x-v,T=E/w,C=Math.max(ph,s==="width"?Math.max(0,a):E),S=Math.max(ph,s==="height"?Math.max(0,a):w);FAt(C,S,w,T,ne(y,v),s,m,g,l,r)}else{let[m]=p,g=m?.latest,y=m?.original;if(g&&y&&Cv(g,s)){let v=s==="width"?Math.max(0,a):g.width;s==="width"&&(i?v=ru(v,WA):v=Math.round(v));let b=s==="height"?Math.max(0,a):g.height;s==="height"&&(i?b=ru(b,WA):b=Math.round(b)),v=Math.max(ph,v),b=Math.max(ph,b),NT(v,b,g,y,l,r,s==="width"?"e":"s",{shouldInformMutation:!1})}}}o.triggerUpdate();return}let d=s==="width"?e:0,h=s==="height"?e:0;for(let f of u){let p=SK(f,l,r);if(p.length>1){let m=p.map(R=>R.latest),g=p.map(R=>R.original),[y,v,b,x]=mi(g),E=b-y,w=x-v,T=E/w,C=Math.max(0,E+d);s==="width"&&(i?C=ru(C,WA):C=Math.round(C));let S=Math.max(0,w+h);s==="height"&&(i?S=ru(S,WA):S=Math.round(S)),C=Math.max(ph,C),S=Math.max(ph,S),FAt(C,S,w,T,ne(y,v),s,m,g,l,r)}else{let[m]=p,g=m?.latest,y=m?.original;if(g&&y&&Cv(g,s)){let v=Math.max(0,y.width+d);s==="width"&&(i?v=ru(v,WA):v=Math.round(v));let b=Math.max(0,y.height+h);s==="height"&&(i?b=ru(b,WA):b=Math.round(b)),v=Math.max(ph,v),b=Math.max(ph,b),NT(v,b,g,y,l,r,s==="width"?"e":"s",{shouldInformMutation:!1})}}}o.triggerUpdate()},qjr=({property:e,elements:t,elementsMap:r,atomicUnits:n,scene:i,appState:a})=>{let o=(0,p9t.useMemo)(()=>n.map(u=>{let d=SK(u,r);if(d.length>1){let[f,p,m,g]=mi(d.map(y=>y.latest));return Math.round((e==="width"?m-f:g-p)*100)/100}let[h]=d;return Math.round((e==="width"?h.latest.width:h.latest.height)*100)/100}),[r,n,e]),s=new Set(o).size===1?Math.round(o[0]*100)/100:"Mixed",l=o.length>0;return(0,m9t.jsx)(Av,{label:e==="width"?"W":"H",elements:t,dragInputCallback:Hjr,value:s,editable:l,appState:a,property:e,scene:i})},zAt=qjr,Yjr=15,jjr=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:r,nextValue:n,property:i,scene:a})=>{let o=a.getNonDeletedElementsMap(),s=t.map(u=>o.get(u.id)).filter(u=>u&&!y5(u)&&Cv(u,i)),l=t.filter(u=>!y5(u)&&Cv(u,i));if(n!==void 0){let u=yb(n);for(let d of s){if(!d)continue;kt(d,{angle:u},!1);let h=hn(d,o);h&&!An(d)&&kt(h,{angle:u},!1)}a.triggerUpdate();return}for(let u=0;u{let i=e.filter(l=>!y5(l)&&Cv(l,"angle")),a=i.map(l=>Math.round(pT(l.angle)%360*100)/100),o=new Set(a).size===1?a[0]:"Mixed",s=i.some(l=>Cv(l,"angle"));return(0,g9t.jsx)(Av,{label:"A",icon:sre,value:o,elements:e,dragInputCallback:jjr,editable:s,appState:r,scene:t,property:n})},$jr=Xjr,GAt=4,Kjr=4,Zjr=(e,t)=>e.reduce((r,n)=>{if(!n||y5(n))return r;if(er(n))return r.push(n),r;if(md(n)){let i=hn(n,t);if(i)return r.push(i),r}return r},[]),Qjr=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:r,nextValue:n,scene:i})=>{let a=i.getNonDeletedElementsMap(),o=t.map(l=>a.get(l.id)),s;if(n){s=Math.max(Math.round(n),GAt);for(let l of o)kt(l,{fontSize:s},!1),Mc(l,i.getContainerElement(l),a,!1);i.triggerUpdate()}else{let l=t;for(let u=0;u{let a=Zjr(e,i);if(!a.length)return null;let o=a.map(u=>Math.round(u.fontSize*10)/10),s=new Set(o).size===1?o[0]:"Mixed",l=o.length>0;return(0,y9t.jsx)(Av,{label:"F",icon:xU,elements:a,dragInputCallback:Qjr,value:s,editable:l,scene:t,property:n,appState:r})},eXr=Jjr,WAt=10,tXr=({accumulatedChange:e,instantChange:t,originalElements:r,originalElementsMap:n,shouldChangeByStepSize:i,nextValue:a,property:o,scene:s,originalAppState:l})=>{let u=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements(),h=r[0],[f,p]=[h.x+h.width/2,h.y+h.height/2],[m,g]=ht(ne(h.x,h.y),ne(f,p),h.angle);if(l.croppingElementId===h.id){let E=u.get(h.id);if(!E||!hi(E)||!E.crop)return;let w=E.crop,T=w,C=E.scale[0]===-1,S=E.scale[1]===-1,{width:R,height:U}=gm(E);if(a!==void 0){if(o==="x"){let A=a*(w.naturalWidth/R);C?T={...w,x:Nn(w.naturalWidth-A-w.width,0,w.naturalWidth-w.width)}:T={...w,x:Nn(a*(w.naturalWidth/R),0,w.naturalWidth-w.width)}}o==="y"&&(T={...w,y:Nn(a*(w.naturalHeight/U),0,w.naturalHeight-w.height)}),kt(E,{crop:T});return}let L=(o==="x"?t:0)*(C?-1:1),I=(o==="y"?t:0)*(S?-1:1);T={...w,x:Nn(w.x+L,0,w.naturalWidth-w.width),y:Nn(w.y+I,0,w.naturalHeight-w.height)},kt(E,{crop:T});return}if(a!==void 0){sN(o==="x"?a:m,o==="y"?a:g,h,u,d,s,n);return}let y=o==="x"?e:0,v=o==="y"?e:0,b=o==="x"?Math.round(i?ru(h.x+y,WAt):m+y):m,x=o==="y"?Math.round(i?ru(h.y+v,WAt):g+v):g;sN(b,x,h,u,d,s,n)},rXr=({property:e,element:t,elementsMap:r,scene:n,appState:i})=>{let[a,o]=ht(ne(t.x,t.y),ne(t.x+t.width/2,t.y+t.height/2),t.angle),s=Gp(e==="x"?a:o,2);if(i.croppingElementId===t.id&&hi(t)&&t.crop){let l=gIe(t);l&&(s=Gp(e==="x"?l.x:l.y,2))}return(0,v9t.jsx)(Av,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:tXr,scene:n,value:s,property:e,appState:i})},VAt=rXr,nXr=10,iXr=(e,t,r,n,i,a,o,s)=>{for(let l=0;l{let[s,l,,]=mi(r),u=e-s,d=t-l;for(let h=0;h{let l=o.getNonDeletedElementsMap(),u=o.getNonDeletedElements();if(i!==void 0){for(let h of O3e(t,s)){let f=SK(h,l,r);if(f.length>1){let[p,m,,]=mi(f.map(g=>g.latest));aXr(a==="x"?i:p,a==="y"?i:m,f.map(g=>g.original),l,u,r,o)}else{let p=f[0]?.original,m=f[0]?.latest;if(p&&m&&Cv(m,a)){let[g,y]=[p.x+p.width/2,p.y+p.height/2],[v,b]=ht(ne(p.x,p.y),ne(g,y),p.angle);sN(a==="x"?i:v,a==="y"?i:b,p,l,u,o,r,!1)}}}o.triggerUpdate();return}let d=n?ru(e,nXr):e;iXr(a,a==="x"?d:0,a==="y"?d:0,t,t,l,r,o),o.triggerUpdate()},sXr=({property:e,elements:t,elementsMap:r,atomicUnits:n,scene:i,appState:a})=>{let o=(0,b9t.useMemo)(()=>n.map(l=>{let u=Object.keys(l).map(g=>r.get(g)).filter(g=>g!==void 0);if(u.length>1){let[g,y]=mi(u);return Math.round((e==="x"?g:y)*100)/100}let[d]=u,[h,f]=[d.x+d.width/2,d.y+d.height/2],[p,m]=ht(ne(d.x,d.y),ne(h,f),d.angle);return Math.round((e==="x"?p:m)*100)/100}),[n,r,e]),s=new Set(o).size===1?o[0]:"Mixed";return(0,x9t.jsx)(Av,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:oXr,value:s,property:e,scene:i,appState:a})},HAt=sXr,qAt=5,lXr=({property:e,scene:t,appState:r,setAppState:n})=>(0,w9t.jsx)(Av,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:a,shouldChangeByStepSize:o,setInputValue:s})=>{n(l=>{let u;return i?u=i:a&&(u=o?ru(l.gridStep+qAt*Math.sign(a),qAt):l.gridStep+a),u?(u=_re(u),s(u),{gridStep:u}):(s(l.gridStep),null)})},scene:t,value:r.gridStep,property:e,appState:r}),cXr=lXr,uXr=50,B3e=e=>{let t=mN(),r=e.app.scene.getSceneNonce()||1,n=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=CT(e.app);return(0,fr.jsx)(dXr,{...e,appState:t,sceneNonce:r,selectedElements:n,gridModeEnabled:i})},_a=({children:e,columns:t=1,heading:r,style:n,...i})=>(0,fr.jsx)("div",{className:St("exc-stats__row",{"exc-stats__row--heading":r}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...n},...i,children:e});_a.displayName="StatsRow";var AK=({children:e,order:t,style:r,...n})=>(0,fr.jsx)("div",{className:"exc-stats__rows",style:{order:t,...r},...n,children:e});AK.displayName="StatsRows";B3e.StatsRow=_a;B3e.StatsRows=AK;var dXr=(0,j0.memo)(({app:e,onClose:t,renderCustomStats:r,selectedElements:n,appState:i,sceneNonce:a,gridModeEnabled:o})=>{let s=e.scene,l=s.getNonDeletedElements(),u=s.getNonDeletedElementsMap(),d=Bs(),h=n.length===1?n[0]:null,f=n.length>1?n:null,p=i.croppingElementId&&hi(h),m=p?gm(h):null,[g,y]=(0,j0.useState)({width:0,height:0}),v=(0,j0.useMemo)(()=>(0,u9t.default)(E=>{let w=mi(E);y({width:Math.round(w[2])-Math.round(w[0]),height:Math.round(w[3])-Math.round(w[1])})},uXr),[]);(0,j0.useEffect)(()=>{v(l)},[a,l,v]),(0,j0.useEffect)(()=>()=>v.cancel(),[v]);let b=(0,j0.useMemo)(()=>O3e(n,i),[n,i]),x=(0,j0.useMemo)(()=>Ane(n),[n]);return(0,fr.jsx)("div",{className:"exc-stats",children:(0,fr.jsxs)(Y0,{padding:3,children:[(0,fr.jsxs)("div",{className:"title",children:[(0,fr.jsx)("h2",{children:ce("stats.title")}),(0,fr.jsx)("div",{className:"close",onClick:t,children:p5})]}),(0,fr.jsxs)(V4e,{label:(0,fr.jsx)("h3",{children:ce("stats.generalStats")}),open:!!(i.stats.panels&Kw.generalStats),openTrigger:()=>d(E=>({stats:{open:!0,panels:E.stats.panels^Kw.generalStats}})),children:[(0,fr.jsxs)(AK,{children:[(0,fr.jsx)(_a,{heading:!0,children:ce("stats.scene")}),(0,fr.jsxs)(_a,{columns:2,children:[(0,fr.jsx)("div",{children:ce("stats.shapes")}),(0,fr.jsx)("div",{children:l.length})]}),(0,fr.jsxs)(_a,{columns:2,children:[(0,fr.jsx)("div",{children:ce("stats.width")}),(0,fr.jsx)("div",{children:g.width})]}),(0,fr.jsxs)(_a,{columns:2,children:[(0,fr.jsx)("div",{children:ce("stats.height")}),(0,fr.jsx)("div",{children:g.height})]}),o&&(0,fr.jsxs)(fr.Fragment,{children:[(0,fr.jsx)(_a,{heading:!0,children:"Canvas"}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(cXr,{property:"gridStep",scene:s,appState:i,setAppState:d})})]})]}),r?.(l,i)]}),!x&&n.length>0&&(0,fr.jsx)("div",{id:"elementStats",style:{marginTop:12},children:(0,fr.jsx)(V4e,{label:(0,fr.jsx)("h3",{children:ce("stats.elementProperties")}),open:!!(i.stats.panels&Kw.elementProperties),openTrigger:()=>d(E=>({stats:{open:!0,panels:E.stats.panels^Kw.elementProperties}})),children:(0,fr.jsxs)(AK,{children:[h&&(0,fr.jsxs)(fr.Fragment,{children:[p&&(0,fr.jsx)(_a,{heading:!0,children:ce("labels.unCroppedDimension")}),i.croppingElementId&&hi(h)&&m&&(0,fr.jsxs)(_a,{columns:2,children:[(0,fr.jsx)("div",{children:ce("stats.width")}),(0,fr.jsx)("div",{children:Gp(m.width,2)})]}),i.croppingElementId&&hi(h)&&m&&(0,fr.jsxs)(_a,{columns:2,children:[(0,fr.jsx)("div",{children:ce("stats.height")}),(0,fr.jsx)("div",{children:Gp(m.height,2)})]}),(0,fr.jsx)(_a,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?ce("labels.imageCropping"):ce(`element.${h.type}`)}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(VAt,{element:h,property:"x",elementsMap:u,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(VAt,{element:h,property:"y",elementsMap:u,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(OAt,{property:"width",element:h,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(OAt,{property:"height",element:h,scene:s,appState:i})}),!ar(h)&&(0,fr.jsx)(_a,{children:(0,fr.jsx)(Ojr,{property:"angle",element:h,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(Gjr,{property:"fontSize",element:h,scene:s,appState:i})})]}),f&&(0,fr.jsxs)(fr.Fragment,{children:[zre(f)&&(0,fr.jsx)(_a,{heading:!0,children:ce("element.group")}),(0,fr.jsxs)(_a,{columns:2,style:{margin:"0.3125rem 0"},children:[(0,fr.jsx)("div",{children:ce("stats.shapes")}),(0,fr.jsx)("div",{children:n.length})]}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(HAt,{property:"x",elements:f,elementsMap:u,atomicUnits:b,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(HAt,{property:"y",elements:f,elementsMap:u,atomicUnits:b,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(zAt,{property:"width",elements:f,elementsMap:u,atomicUnits:b,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(zAt,{property:"height",elements:f,elementsMap:u,atomicUnits:b,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)($jr,{property:"angle",elements:f,scene:s,appState:i})}),(0,fr.jsx)(_a,{children:(0,fr.jsx)(eXr,{property:"fontSize",elements:f,scene:s,appState:i,elementsMap:u})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),hXr=({sourceElementId:e,onClose:t,elementsMap:r,appState:n,generateLinkForSelection:i=one})=>{let a=r.get(e)?.link??null,[o,s]=(0,mw.useState)(a),[l,u]=(0,mw.useState)(!1);(0,mw.useEffect)(()=>{let h=Un(r,n),f=a;if(h.length>0&&i){let p=sne(h,n);p&&(f=fd(i(p.id,p.type)))}s(f)},[r,n,n.selectedElementIds,a,i]);let d=(0,mw.useCallback)(()=>{if(o&&o!==r.get(e)?.link){let h=r.get(e);h&&kt(h,{link:o})}if(!o&&l&&e){let h=r.get(e);h&&kt(h,{link:null})}t?.()},[e,o,r,l,t]);return(0,mw.useEffect)(()=>{let h=f=>{n.openDialog?.name==="elementLinkSelector"&&f.key===qe.ENTER&&d(),n.openDialog?.name==="elementLinkSelector"&&f.key===qe.ESCAPE&&t?.()};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[n,t,d]),(0,np.jsxs)("div",{className:"ElementLinkDialog",children:[(0,np.jsxs)("div",{className:"ElementLinkDialog__header",children:[(0,np.jsx)("h2",{children:ce("elementLink.title")}),(0,np.jsx)("p",{children:ce("elementLink.desc")})]}),(0,np.jsxs)("div",{className:"ElementLinkDialog__input",children:[(0,np.jsx)(L3e,{value:o??"",onChange:h=>{l||u(!0),s(h)},onKeyDown:h=>{h.key===qe.ENTER&&d()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),a&&o&&(0,np.jsx)(Qn,{type:"button",title:ce("buttons.remove"),"aria-label":ce("buttons.remove"),label:ce("buttons.remove"),onClick:()=>{s(null),u(!0)},className:"ElementLinkDialog__remove",icon:Db})]}),(0,np.jsxs)("div",{className:"ElementLinkDialog__actions",children:[(0,np.jsx)(t7,{label:ce("buttons.cancel"),onClick:()=>{t?.()},style:{marginRight:10}}),(0,np.jsx)(t7,{label:ce("buttons.confirm"),onClick:d,actionType:"primary"})]})]})},fXr=hXr,pXr=({UIOptions:e})=>(0,dr.jsxs)(gs,{__fallback:!0,children:[(0,dr.jsx)(gs.DefaultItems.LoadScene,{}),(0,dr.jsx)(gs.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&(0,dr.jsx)(gs.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&(0,dr.jsx)(gs.DefaultItems.SaveAsImage,{}),(0,dr.jsx)(gs.DefaultItems.SearchMenu,{}),(0,dr.jsx)(gs.DefaultItems.Help,{}),(0,dr.jsx)(gs.DefaultItems.ClearCanvas,{}),(0,dr.jsx)(gs.Separator,{}),(0,dr.jsx)(gs.Group,{title:"Excalidraw links",children:(0,dr.jsx)(gs.DefaultItems.Socials,{})}),(0,dr.jsx)(gs.Separator,{}),(0,dr.jsx)(gs.DefaultItems.ToggleTheme,{}),(0,dr.jsx)(gs.DefaultItems.ChangeCanvasBackground,{})]}),mXr=()=>(0,dr.jsxs)(M4e,{__fallback:!0,children:[(0,dr.jsx)(M4e.Actions.SaveToDisk,{}),(0,dr.jsx)(M4e.Actions.ExportToImage,{})]}),gXr=({actionManager:e,appState:t,files:r,setAppState:n,elements:i,canvas:a,onLockToggle:o,onHandToolToggle:s,onPenModeToggle:l,showExitZenModeBtn:u,renderTopRightUI:d,renderCustomStats:h,UIOptions:f,onExportImage:p,renderWelcomeScreen:m,children:g,app:y,isCollaborating:v,generateLinkForSelection:b})=>{let x=gl(),E=rYr(),w=E.tunnelsJotai.Provider,[T,C]=No(BK),S=()=>f.canvasActions.export?(0,dr.jsx)(QYr,{elements:i,appState:t,files:r,actionManager:e,exportOpts:f.canvasActions.export,canvas:a,setAppState:n}):null,R=()=>!f.canvasActions.saveAsImage||t.openDialog?.name!=="imageExport"?null:(0,dr.jsx)(AYr,{elements:i,appState:t,files:r,actionManager:e,onExportImage:p,onCloseRequest:()=>n({openDialog:null}),name:y.getName()}),U=()=>(0,dr.jsxs)("div",{style:{position:"relative"},children:[(0,dr.jsx)(E.MainMenuTunnel.Out,{}),m&&(0,dr.jsx)(E.WelcomeScreenMenuHintTunnel.Out,{})]}),L=()=>(0,dr.jsx)(rN,{heading:"selectedShapeActions",className:St("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:(0,dr.jsx)(Y0,{className:a5.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:(0,dr.jsx)(B8t,{appState:t,elementsMap:y.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:y})})}),I=()=>{let M=bB(t,i),O=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector";return(0,dr.jsx)(rUt,{side:"top",children:(0,dr.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,dr.jsxs)(sp.Col,{gap:6,className:St("App-menu_top__left"),children:[U(),M&&L()]}),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(0,dr.jsx)(rN,{heading:"shapes",className:"shapes-section",children:_=>(0,dr.jsxs)("div",{style:{position:"relative"},children:[m&&(0,dr.jsx)(E.WelcomeScreenToolbarHintTunnel.Out,{}),(0,dr.jsx)(sp.Col,{gap:4,align:"start",children:(0,dr.jsxs)(sp.Row,{gap:1,className:St("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[(0,dr.jsxs)(Y0,{padding:1,className:St("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[(0,dr.jsx)(aUt,{appState:t,isMobile:x.editor.isMobile,device:x,app:y}),_,(0,dr.jsxs)(sp.Row,{gap:1,children:[(0,dr.jsx)(sUt,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>l(null),title:ce("toolBar.penMode"),penDetected:t.penDetected}),(0,dr.jsx)(oUt,{checked:t.activeTool.locked,onChange:o,title:ce("toolBar.lock")}),(0,dr.jsx)("div",{className:"App-toolbar__divider"}),(0,dr.jsx)(cUt,{checked:c5(t),onChange:()=>s(),title:ce("toolBar.hand"),isMobile:!0}),(0,dr.jsx)(F8t,{appState:t,activeTool:t.activeTool,UIOptions:f,app:y})]})]}),v&&(0,dr.jsx)(Y0,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:(0,dr.jsx)(vjr,{title:ce("toolBar.laser"),checked:t.activeTool.type===vs.laser,onChange:()=>y.setActiveTool({type:vs.laser}),isMobile:!0})})]})})]})}),(0,dr.jsxs)("div",{className:St("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&(0,dr.jsx)(dUt,{collaborators:t.collaborators,userToFollow:t.userToFollow?.socketId||null}),d?.(x.editor.isMobile,t),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(!P||t.openSidebar?.name!==bf.name)&&(0,dr.jsx)(E.DefaultSidebarTriggerTunnel.Out,{}),O&&(0,dr.jsx)(B3e,{app:y,onClose:()=>{e.executeAction($4e)},renderCustomStats:h})]})]})})},A=()=>(0,dr.jsx)(NAt,{__fallback:!0,onDock:M=>{pa("sidebar",`toggleDock (${M?"dock":"undock"})`,`(${x.editor.isMobile?"mobile":"desktop"})`)}}),P=a7t(N3e),D=(0,dr.jsxs)(dr.Fragment,{children:[g,(0,dr.jsx)(pXr,{UIOptions:f}),(0,dr.jsx)(NAt.Trigger,{__fallback:!0,icon:vO,title:mT(ce("toolBar.library")),onToggle:M=>{M&&pa("sidebar",`${bf.name} (open)`,`button (${x.editor.isMobile?"mobile":"desktop"})`)},tab:bf.defaultTab,children:ce("toolBar.library")}),(0,dr.jsx)(mXr,{}),t.openDialog?.name==="ttd"&&(0,dr.jsx)(Ajr,{__fallback:!0}),t.isLoading&&(0,dr.jsx)(c7t,{delay:250}),t.errorMessage&&(0,dr.jsx)(wYr,{onClose:()=>n({errorMessage:null}),children:t.errorMessage}),T&&!x.editor.isMobile&&(0,dr.jsx)($Vr,{colorPickerType:T.colorPickerType,onCancel:()=>{C(null)},onChange:(M,O,_,{altKey:B})=>{if(!(M!=="elementBackground"&&M!=="elementStroke"))if(_.length){for(let F of _)kt(F,{[B&&T.swapPreviewOnAlt?M==="elementBackground"?"strokeColor":"backgroundColor":M==="elementBackground"?"backgroundColor":"strokeColor"]:O},!1),za.delete(F);vm.getScene(_[0])?.triggerUpdate()}else n(M==="elementBackground"?{currentItemBackgroundColor:O}:{currentItemStrokeColor:O})},onSelect:(M,O)=>{C(_=>_?.keepOpenOnAlt&&O.altKey?_:null),T?.onSelect?.(M,O)}}),t.openDialog?.name==="help"&&(0,dr.jsx)(YYr,{onClose:()=>{n({openDialog:null})}}),(0,dr.jsx)(sYr,{}),t.openDialog?.name==="elementLinkSelector"&&(0,dr.jsx)(fXr,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{n({openDialog:null})},elementsMap:y.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:b}),(0,dr.jsx)(E.OverwriteConfirmDialogTunnel.Out,{}),R(),S(),t.pasteDialog.shown&&(0,dr.jsx)(zYr,{setAppState:n,appState:t,onClose:()=>n({pasteDialog:{shown:!1,data:null}})}),x.editor.isMobile&&(0,dr.jsx)(FYr,{app:y,appState:t,elements:i,actionManager:e,renderJSONExportDialog:S,renderImageExportDialog:R,setAppState:n,onLockToggle:o,onHandToolToggle:s,onPenModeToggle:l,renderTopRightUI:d,renderCustomStats:h,renderSidebars:A,device:x,renderWelcomeScreen:m,UIOptions:f}),!x.editor.isMobile&&(0,dr.jsxs)(dr.Fragment,{children:[(0,dr.jsxs)("div",{className:"layer-ui__wrapper",style:t.openSidebar&&P&&x.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[m&&(0,dr.jsx)(E.WelcomeScreenCenterTunnel.Out,{}),I(),(0,dr.jsx)(ejr,{appState:t,actionManager:e,showExitZenModeBtn:u,renderWelcomeScreen:m}),t.scrolledOutside&&(0,dr.jsx)("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{n(M=>({...TT(i,M)}))},children:ce("buttons.scrollBackToContent")})]}),A()]})]});return(0,dr.jsx)(I7t.Provider,{value:t,children:(0,dr.jsx)(w,{children:(0,dr.jsx)(_8t.Provider,{value:E,children:D})})})},YAt=e=>{let{suggestedBindings:t,startBoundElement:r,cursorButton:n,scrollX:i,scrollY:a,...o}=e;return o},yXr=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:r,appState:n,...i}=e,{canvas:a,appState:o,...s}=t;return El(YAt(n),YAt(o),{selectedElementIds:El,selectedGroupIds:El})&&El(i,s)},vXr=J8t.default.memo(gXr,yXr),bXr=5e3,xXr=({message:e,onClose:t,closable:r=!1,duration:n=bXr,style:i})=>{let a=(0,c7.useRef)(0),o=n!==1/0,s=(0,c7.useCallback)(()=>{o&&(a.current=window.setTimeout(()=>t(),n))},[t,n,o]);return(0,c7.useEffect)(()=>{if(o)return s(),()=>clearTimeout(a.current)},[s,e,n,o]),(0,lN.jsxs)("div",{className:"Toast",onMouseEnter:o?()=>clearTimeout(a?.current):void 0,onMouseLeave:o?s:void 0,style:i,children:[(0,lN.jsx)("p",{className:"Toast__message",children:e}),r&&(0,lN.jsx)(Qn,{icon:p5,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},jAt=jt({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:UO,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:pt.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,r)=>typeof r.viewModeEnabled>"u",keyTest:e=>!e[qe.CTRL_OR_CMD]&&e.altKey&&e.code===ti.R}),T9t=(e,t)=>{let r=t.scene.getSelectedElements(e);return r.length===1&&qr(r[0])},wXr=jt({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t).at(0)||null;if(qr(i)){let a=Yp(zi(e),i.id).filter(o=>!(o.type==="text"&&o.containerId));return{elements:e,appState:{...t,selectedElementIds:a.reduce((o,s)=>(o[s.id]=!0,o),{})},captureUpdate:pt.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:pt.EVENTUALLY}},predicate:(e,t,r,n)=>T9t(t,n)}),EXr=jt({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,r,n)=>{let i=n.scene.getSelectedElements(t).at(0)||null;return qr(i)?{elements:kne(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:pt.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:pt.EVENTUALLY}},predicate:(e,t,r,n)=>T9t(t,n)}),Bjn=jt({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:pt.EVENTUALLY}),checked:e=>e.frameRendering.enabled}),Fjn=jt({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:ure,viewMode:!1,perform:(e,t,r,n)=>{let i=Bo(t,{type:"frame"});return Wp(n.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Bo(t,{type:"frame"})},captureUpdate:pt.EVENTUALLY}},keyTest:e=>!e[qe.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===qe.F}),TXr=jt({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=Un(e,t);return i.length>0&&!i.some(a=>qr(a))},perform:(e,t,r,n)=>{let i=Un(e,t),[a,o,s,l]=mi(i,n.scene.getNonDeletedElementsMap()),u=16,d=XO({x:a-u,y:o-u,width:s-a+u*2,height:l-o+u*2});if(t.editingGroupId){let h=ya(i,t.editingGroupId);for(let f of h){let p=f.groupIds.indexOf(t.editingGroupId);kt(f,{groupIds:f.groupIds.slice(0,p)},!1)}}return{elements:LT([...n.scene.getElementsIncludingDeleted(),d],i,d,t),appState:{selectedElementIds:{[d.id]:!0}},captureUpdate:pt.IMMEDIATELY}}}),kXr=()=>(0,Qc.jsxs)("div",{"data-testid":"brave-measure-text-error",children:[(0,Qc.jsx)("p",{children:(0,Qc.jsx)(s1,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>(0,Qc.jsx)("span",{style:{fontWeight:600},children:e})})}),(0,Qc.jsx)("p",{children:(0,Qc.jsx)(s1,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>(0,Qc.jsx)("span",{style:{fontWeight:600},children:e})})}),(0,Qc.jsx)("p",{children:(0,Qc.jsx)(s1,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>(0,Qc.jsx)("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),(0,Qc.jsx)("p",{children:(0,Qc.jsx)(s1,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>(0,Qc.jsx)("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>(0,Qc.jsxs)("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),CXr=kXr,cK={width:100,height:0},lw=100,SXr=(e,t,r)=>{let n=pd({x:0,y:0,textAlign:iT.CENTER,verticalAlign:hd.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:n.id})}),Mc(n,e,r),[e,n]},XAt=(e,t,r,n,i)=>{let a,o;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let d=t?.width??lw,h=t?.height??lw,f;t.id&&(f=n.getElement(t.id),f||console.error(`No element for start binding with id ${t.id} found`));let p=t.x||e.x-d,m=t.y||e.y-h/2,g=f?f.type:t.type;if(g){if(g==="text"){let y="";f&&f.type==="text"?y=f.text:t.type==="text"&&(y=t.text),y||console.error(`No text found for start binding text element for ${e.id}`),a=pd({x:p,y:m,type:"text",...f,...t,text:y}),Object.assign(a,{x:t.x||e.x-a.width,y:t.y||e.y-a.height/2})}else switch(g){case"rectangle":case"ellipse":case"diamond":{a=Hp({x:p,y:m,width:d,height:h,...f,...t,type:g});break}default:Rb(e,`Unhandled element start type "${t.type}"`,!0)}Np(e,a,"start",i)}}if(r){let d=r?.height??lw,h=r?.width??lw,f;r.id&&(f=n.getElement(r.id),f||console.error(`No element for end binding with id ${r.id} found`));let p=r.x||e.x+e.width,m=r.y||e.y-d/2,g=f?f.type:r.type;if(g){if(g==="text"){let y="";f&&f.type==="text"?y=f.text:r.type==="text"&&(y=r.text),y||console.error(`No text found for end binding text element for ${e.id}`),o=pd({x:p,y:m,type:"text",...f,...r,text:y}),Object.assign(o,{y:r.y||e.y-o.height/2})}else switch(g){case"rectangle":case"ellipse":case"diamond":{o=Hp({x:p,y:m,width:h,height:d,...f,...r,type:g});break}default:Rb(e,`Unhandled element end type "${g}"`,!0)}Np(e,o,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:a,endBoundElement:o};let s=e.points.length-1,l=.5,u=wm(e.points);return e.points[s][0]>e.points[s-1][0]&&(u[0][0]=l,u[s][0]-=l),e.points[s][0]e.points[s-1][1]&&(u[0][1]=l,u[s][1]-=l),e.points[s][1]{e&&this.excalidrawElements.set(e.id,e)}),Oe(this,"getElements",()=>Cm(Array.from(this.excalidrawElements.values()))),Oe(this,"getElementsMap",()=>hh(Hr(this.getElements()))),Oe(this,"getElement",e=>this.excalidrawElements.get(e))}},h3e=(e,t)=>{if(!e)return[];let r=wm(e),n=new AXr,i=new Map,a=new Map;for(let s of r){let l,u=s.id;switch(t?.regenerateIds!==!1&&Object.assign(s,{id:fh()}),s.type){case"rectangle":case"ellipse":case"diamond":{let d=s?.label?.text&&s.width===void 0?0:s?.width||lw,h=s?.label?.text&&s.height===void 0?0:s?.height||lw;l=Hp({...s,width:d,height:h});break}case"line":{let d=s.width||cK.width,h=s.height||cK.height;l=bb({width:d,height:h,points:[ne(0,0),ne(d,h)],...s});break}case"arrow":{let d=s.width||cK.width,h=s.height||cK.height;l=KO({width:d,height:h,endArrowhead:"arrow",points:[ne(0,0),ne(d,h)],...s,type:"arrow"}),Object.assign(l,t5(l.points));break}case"text":{let d=s?.fontFamily||G1,h=s?.fontSize||bm,f=s?.lineHeight||_b(d),p=s.text??"",m=f5(p),g=Jl(m,Bi({fontFamily:d,fontSize:h}),f);l=pd({width:g.width,height:g.height,fontFamily:d,fontSize:h,...s});break}case"image":{l=Kre({width:s?.width||lw,height:s?.height||lw,...s});break}case"frame":{l=XO({x:0,y:0,...s});break}case"magicframe":{l=$O({x:0,y:0,...s});break}case"freedraw":case"iframe":case"embeddable":{l=s;break}default:l=s,Rb(s,`Unhandled element type "${s.type}"`,!0)}n.getElement(l.id)?console.error(`Duplicate id found for ${l.id}`):(n.add(l),i.set(l.id,s),u&&a.set(u,l.id))}let o=n.getElementsMap();for(let[s,l]of i){let u=n.getElement(s);switch(l.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if(l.label?.text){let[d,h]=SXr(u,l?.label,o);if(n.add(d),n.add(h),An(d)){let f=l.type==="arrow"?l?.start:void 0,p=l.type==="arrow"?l?.end:void 0;if(f&&f.id){let v=a.get(f.id);v&&Object.assign(f,{id:v})}if(p&&p.id){let v=a.get(p.id);v&&Object.assign(p,{id:v})}let{linearElement:m,startBoundElement:g,endBoundElement:y}=XAt(d,f,p,n,o);d=m,n.add(m),n.add(g),n.add(y)}}else switch(l.type){case"arrow":{let{start:d,end:h}=l;if(d&&d.id){let g=a.get(d.id);Object.assign(d,{id:g})}if(h&&h.id){let g=a.get(h.id);Object.assign(h,{id:g})}let{linearElement:f,startBoundElement:p,endBoundElement:m}=XAt(u,d,h,n,o);n.add(f),n.add(p),n.add(m);break}}break}}}for(let[s,l]of i){if(l.type!=="frame"&&l.type!=="magicframe")continue;let u=n.getElement(s);if(!u)throw new Error(`Excalidraw element with id ${s} doesn't exist`);let d=[];l.children.forEach(E=>{let w=a.get(E);if(!w)throw new Error(`Element with ${E} wasn't mapped correctly`);let T=n.getElement(w);if(!T)throw new Error(`Frame element with id ${w} doesn't exist`);Object.assign(T,{frameId:u.id}),T?.boundElements?.forEach(C=>{let S=n.getElement(C.id);if(!S)throw new Error(`Bound element with id ${C.id} doesn't exist`);Object.assign(S,{frameId:u.id}),d.push(S)}),d.push(T)});let[h,f,p,m]=mi(d),g=10;h=h-g,f=f-g,p=p+g,m=m+g;let y=u?.x||h,v=u?.y||f,b=u?.width||p-h,x=u?.height||m-f;Object.assign(u,{x:y,y:v,width:b,height:x}),Ste()&&l.children.length&&(u?.x||u?.y||u?.width||u?.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return n.getElements()},Do=e=>t=>{(0,F3e.unstable_batchedUpdates)(e,t)},D4e=e=>dU(t=>{(0,F3e.unstable_batchedUpdates)(e,t)}),z3e=(()=>{let e;try{let r=k9t.version.split(".");e=Number(r[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),UXr="#ff6b6b",IXr="#ff0000",$At=1,KAt=2,RXr=(e,t)=>{if(!t.snapLines.length)return;let r=t.theme===Gn.LIGHT||t.zenModeEnabled?UXr:IXr,n=(t.zenModeEnabled?$At*1.5:$At)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=n,e.strokeStyle=r,LXr(i,e,t)):i.type==="gap"?(e.lineWidth=n,e.strokeStyle=r,DXr(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=n,e.strokeStyle=r,MXr(i,e,t));e.restore()},MXr=(e,t,r)=>{if(!r.zenModeEnabled){let n=e.points[0],i=e.points[e.points.length-1];ep(n,i,t)}for(let n of e.points)C9t(n,r,t)},LXr=(e,t,r)=>{C9t(e.points[0],r,t),r.zenModeEnabled||ep(e.points[0],e.points[1],t)},C9t=([e,t],r,n)=>{n.save();let i=(r.zenModeEnabled?KAt*1.5:KAt)/r.zoom.value;n.beginPath(),n.moveTo(e-i,t-i),n.lineTo(e+i,t+i),n.moveTo(e+i,t-i),n.lineTo(e-i,t+i),n.stroke(),n.restore()},ep=(e,t,r)=>{r.beginPath(),r.lineTo(e[0],e[1]),r.lineTo(t[0],t[1]),r.stroke()},DXr=(e,t,r,n,i)=>{let a=8/n.zoom.value,o=a/2,s=a/4;if(r==="horizontal"){let l=[(e[0]+t[0])/2,e[1]];n.zenModeEnabled||ep(ne(e[0],e[1]-a),ne(e[0],e[1]+a),i),ep(ne(l[0]-s,l[1]-o),ne(l[0]-s,l[1]+o),i),ep(ne(l[0]+s,l[1]-o),ne(l[0]+s,l[1]+o),i),n.zenModeEnabled||(ep(ne(t[0],t[1]-a),ne(t[0],t[1]+a),i),ep(e,t,i))}else{let l=[e[0],(e[1]+t[1])/2];n.zenModeEnabled||ep(ne(e[0]-a,e[1]),ne(e[0]+a,e[1]),i),ep(ne(l[0]-o,l[1]-s),ne(l[0]+o,l[1]-s),i),ep(ne(l[0]-o,l[1]+s),ne(l[0]+o,l[1]+s),i),n.zenModeEnabled||(ep(ne(t[0]-a,t[1]),ne(t[0]+a,t[1]),i),ep(e,t,i))}},NXr=(e,t)=>{is(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:r}=t.selectedLinearElement;is(r,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),S9t(r,e,t),e.restore()},_Xr=(e,t,r)=>{let{elementId:n,hoverPointIndex:i}=t.selectedLinearElement;if(t.editingLinearElement?.selectedPointsIndices?.includes(i))return;let a=rr.getElement(n,r);if(!a)return;let o=rr.getPointAtIndexGlobalCoordinates(a,i,r);e.save(),e.translate(t.scrollX,t.scrollY),S9t(o,e,t),e.restore()},S9t=(e,t,r)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",LU(t,e[0],e[1],rr.POINT_HANDLE_SIZE/r.zoom.value,!1)},fN=(e,t,r,n,i,a,o,s,l=!1,u=0)=>{e.save(),e.translate(a,o),e.rotate(s),l&&e.fillRect(t-a,r-o,n,i),u&&e.roundRect?(e.beginPath(),e.roundRect(t-a,r-o,n,i,u),e.stroke(),e.closePath()):e.strokeRect(t-a,r-o,n,i),e.restore()},PXr=(e,t,r,n,i,a)=>{e.save(),e.translate(n,i),e.rotate(a),e.beginPath(),e.moveTo(0,r/2),e.lineTo(t/2,0),e.lineTo(0,-r/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},N4e=(e,t,r,n,i,a=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":a&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),LU(e,r[0],r[1],n/t.zoom.value,!a)},OXr=(e,t,r,n,i,a)=>{e.beginPath(),e.ellipse(n,i,t/2,r/2,a,0,Math.PI*2),e.stroke()},BXr=(e,t,r,n)=>{let[i,a,o,s]=un(t,r),l=o-i,u=s-a;e.strokeStyle="rgba(0,0,0,.05)";let d=n.value<1?n.value:1;e.lineWidth=FO/d;let h=e.lineWidth/2+zO,f=ff(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":fN(e,i-h,a-h,l+h*2,u+h*2,i+l/2,a+u/2,t.angle,void 0,f);break;case"diamond":let p=Math.hypot(l,u),m=h*p/u,g=h*p/l;PXr(e,l+m*2,u+g*2,i+l/2,a+u/2,t.angle);break;case"ellipse":OXr(e,l+h*2,u+h*2,i+l/2,a+u/2,t.angle);break}},FXr=(e,t,r,n)=>{let[i,a,o]=t,s=ET(o,o.width,o.height,n);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(a==="both"?[0,-1]:a==="start"?[0]:[-1]).forEach(l=>{let[u,d]=rr.getPointAtIndexGlobalCoordinates(i,l,r);LU(e,u,d,s)})},A9t=(e,t,r)=>{let{angle:n,x1:i,y1:a,x2:o,y2:s,selectionColors:l,cx:u,cy:d,dashed:h,activeEmbeddable:f}=r,p=o-i,m=s-a,g=(r.padding??Eb*2)/t.zoom.value,y=8/t.zoom.value,v=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(f?4:1)/t.zoom.value;let b=l.length;for(let x=0;x{let i=Array.isArray(r)?FXr:BXr;e.save(),e.translate(t.scrollX,t.scrollY),i(e,r,n,t.zoom),e.restore()},GXr=(e,t,r,n)=>{let[i,a,o,s]=un(r,n),l=o-i,u=s-a;e.strokeStyle="rgb(0,118,255)",e.lineWidth=Ca.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),fN(e,i,a,l,u,i+l/2,a+u/2,r.angle,!1,Ca.radius/t.zoom.value),e.restore()},WXr=(e,t,r)=>{let n=r.filter(s=>s.groupIds.length===0),i=r.filter(s=>s.groupIds.length>0),a=s=>{let[l,u,d,h]=mi(s);return{angle:0,x1:l,x2:d,y1:u,y2:h,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:l+(d-l)/2,cy:u+(h-u)/2,activeEmbeddable:!1}},o=s=>{let l=ya(r,s);return a(l)};Object.entries(Fre(i,t)).filter(([s,l])=>l).map(([s,l])=>s).map(s=>o(s)).concat(n.map(s=>a([s]))).forEach(s=>A9t(e,t,s))},_4e=(e,t,r,n)=>{if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=rr.getPointsGlobalCoordinates(r,n),{POINT_HANDLE_SIZE:a}=rr,o=t.editingLinearElement?a:a/2;if(i.forEach((s,l)=>{if(ar(r)&&l!==0&&l!==i.length-1)return;let u=!!t.editingLinearElement?.selectedPointsIndices?.includes(l);N4e(e,t,s,o,u)}),ar(r)){let s=r.fixedSegments?.map(l=>l.index)||[];i.slice(0,-1).forEach((l,u)=>{rr.isSegmentTooShort(r,i[u+1],i[u],u,t.zoom)||N4e(e,t,ne((l[0]+i[u+1][0])/2,(l[1]+i[u+1][1])/2),a/2,!1,!s.includes(u+1))})}else rr.getEditorMidPoints(r,n,t).filter((s,l,u)=>s!==null&&!(ar(r)&&(l===0||l===u.length-1))).forEach(s=>{(t.editingLinearElement||i.length===2)&&N4e(e,t,s,a/2,!1,!0)});e.restore()},ZAt=(e,t,r,n,i)=>{Object.keys(n).forEach(a=>{let o=n[a];if(o!==void 0){let[s,l,u,d]=o;e.save(),e.lineWidth=1/r.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),a==="rotation"?LU(e,s+u/2,l+d/2,u/2):e.roundRect?(e.beginPath(),e.roundRect(s,l,u,d,2/r.zoom.value),e.fill(),e.stroke()):fN(e,s,l,u,d,s+u/2,l+d/2,i,!0),e.restore()}})},VXr=(e,t,r,n,i)=>{let[a,o,,,s,l]=un(n,i),u=3,d=20,h=u/r.zoom.value,f=h/2,p=s-a+h,m=l-o+h,g=Math.min(d/r.zoom.value,p),y=Math.min(d/r.zoom.value,m);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=h,[[[-p,-m],[0,f],[g,f],[f,0],[f,y]],[[p-f,-m],[f,f],[-g+f,f],[0,0],[0,y]],[[-p,m],[0,-f],[g,-f],[f,0],[f,-y]],[[p-f,m],[f,-f],[-g+f,-f],[0,0],[0,-y]]].forEach(v=>{let[[b,x],[E,w],[T,C],[S,R],[U,L]]=v;e.save(),e.translate(s,l),e.rotate(n.angle),e.beginPath(),e.moveTo(b+E,x+w),e.lineTo(b+T,x+C),e.stroke(),e.beginPath(),e.moveTo(b+S,x+R),e.lineTo(b+U,x+L),e.stroke(),e.restore()}),e.restore()},HXr=(e,t,r,n)=>{t.save();let i=Eb*2/r.zoom.value,a=e.width+i*2,o=e.height+i*2,s=e.x+a/2,l=e.y+o/2,u=-(a/2+i),d=-(o/2+i);t.translate(s+r.scrollX,l+r.scrollY),t.rotate(e.angle),t.lineWidth=1/r.zoom.value,t.strokeStyle=n,t.strokeRect(u,d,a,o),t.restore()},U9t=({canvas:e,elementsMap:t,visibleElements:r,selectedElements:n,allElementsMap:i,scale:a,appState:o,renderConfig:s,device:l})=>{if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[u,d]=tB(e,a),h=rB({canvas:e,scale:a,normalizedWidth:u,normalizedHeight:d});h.save(),h.scale(o.zoom.value,o.zoom.value);let f;if(r.forEach(g=>{o.editingLinearElement?.elementId===g.id&&g&&(f=g)}),f&&_4e(h,o,f,t),o.selectionElement&&!o.isCropping)try{TIe(o.selectionElement,h,o,s.selectionColor)}catch(g){console.error(g)}if(o.editingTextElement&&er(o.editingTextElement)){let g=i.get(o.editingTextElement.id);g&&!g.autoResize&&HXr(g,h,o,s.selectionColor)}o.isBindingEnabled&&o.suggestedBindings.filter(g=>g!=null).forEach(g=>{zXr(h,o,g,t)}),o.frameToHighlight&&GXr(h,o,o.frameToHighlight,t),o.elementsToHighlight&&WXr(h,o,o.elementsToHighlight);let p=n.some(g=>qr(g));if(n.length===1&&o.editingLinearElement?.elementId===n[0].id&&_4e(h,o,n[0],t),ar(n[0])&&o.selectedLinearElement&&o.selectedLinearElement.segmentMidPointHoveredCoords?NXr(h,o):o.selectedLinearElement&&o.selectedLinearElement.hoverPointIndex>=0&&!(ar(n[0])&&o.selectedLinearElement.hoverPointIndex>0&&o.selectedLinearElement.hoverPointIndexjK(S,o.collaborators.get(S))))),T.length){let[S,R,U,L,I,A]=un(w,t,!0);x.push({angle:w.angle,x1:S,y1:R,x2:U,y2:L,selectionColors:T,dashed:!!C,cx:I,cy:A,activeEmbeddable:o.activeEmbeddable?.element===w&&o.activeEmbeddable.state==="active",padding:w.id===o.croppingElementId||hi(w)?0:void 0})}}let E=w=>{let T=ya(t,w),[C,S,R,U]=mi(T);x.push({angle:0,x1:C,x2:R,y1:S,y2:U,selectionColors:[Ba.black],dashed:!0,cx:C+(R-C)/2,cy:S+(U-S)/2,activeEmbeddable:!1})};for(let w of Ob(o))E(w);o.editingGroupId&&E(o.editingGroupId),x.forEach(w=>A9t(h,o,w))}if(h.save(),h.translate(o.scrollX,o.scrollY),n.length===1){h.fillStyle=Ba.white;let b=Mne(n[0],o.zoom,t,"mouse",DT(l));if(!o.viewModeEnabled&&g&&!er(o.editingTextElement)&&!o.croppingElementId&&ZAt(h,s,o,b,n[0].angle),o.croppingElementId&&!o.isCropping){let x=t.get(o.croppingElementId);x&&hi(x)&&VXr(h,s,o,x,t)}}else if(n.length>1&&!o.isRotating){let b=Eb*2/o.zoom.value;h.fillStyle=Ba.white;let[x,E,w,T]=mi(n),C=h.getLineDash();h.setLineDash([2/o.zoom.value]);let S=h.lineWidth;h.lineWidth=1/o.zoom.value,h.strokeStyle=v,fN(h,x-b,E-b,w-x+b*2,T-E+b*2,(x+w)/2,(E+T)/2,0),h.lineWidth=S,h.setLineDash(C);let R=yB([x,E,w,T,(x+w)/2,(E+T)/2],0,o.zoom,"mouse",p?{...DT(l),rotation:!0}:DT(l));n.some(U=>!U.locked)&&ZAt(h,s,o,R,0)}h.restore()}o.searchMatches.forEach(({id:g,focus:y,matchedLines:v})=>{let b=t.get(g);if(b&&er(b)){let[x,E,,,w,T]=un(b,t,!0);h.save(),o.theme===Gn.LIGHT?y?h.fillStyle="rgba(255, 124, 0, 0.4)":h.fillStyle="rgba(255, 226, 0, 0.4)":y?h.fillStyle="rgba(229, 82, 0, 0.4)":h.fillStyle="rgba(99, 52, 0, 0.4)",h.translate(o.scrollX,o.scrollY),h.translate(w,T),h.rotate(b.angle),v.forEach(C=>{h.fillRect(x+C.offsetX-w,E+C.offsetY-T,C.width,C.height)}),h.restore()}}),RXr(h,o),h.restore(),RHr({context:h,renderConfig:s,appState:o,normalizedWidth:u,normalizedHeight:d});let m;return s.renderScrollbars&&(m=OYr(r,u,d,o),h.save(),h.fillStyle=PYr,h.strokeStyle="rgba(255,255,255,0.8)",[m.horizontal,m.vertical].forEach(g=>{g&&a8t(h,g.x,g.y,g.width,g.height,sw/2)}),h.restore()),{scrollBars:m,atLeastOneVisibleElement:r.length>0,elementsMap:t}},I9t=dU(e=>{let t=U9t(e);e.callback?.(t)},{trailing:!0}),qXr=(e,t)=>{if(t){I9t(e);return}let r=U9t(e);return e.callback(r),r},YXr=e=>{let t=(0,u7.useRef)(!1);return(0,u7.useEffect)(()=>{if(!t.current){t.current=!0;return}let r=new Map,n=new Map,i=new Map,a=new Map,o=new Map;e.appState.collaborators.forEach((l,u)=>{if(l.selectedElementIds)for(let d of Object.keys(l.selectedElementIds))i.has(d)||i.set(d,[]),i.get(d).push(u);!l.pointer||l.pointer.renderCursor===!1||(l.username&&a.set(u,l.username),l.userState&&o.set(u,l.userState),n.set(u,mf({sceneX:l.pointer.x,sceneY:l.pointer.y},e.appState)),r.set(u,l.button))});let s=e.containerRef?.current&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";qXr({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:n,remotePointerButton:r,remoteSelectedElementIds:i,remotePointerUsernames:a,remotePointerUserStates:o,selectionColor:s,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},z3e())}),(0,R9t.jsx)("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Ii.GRAB:Ii.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:ce("labels.drawingCanvas")})},QAt=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),jXr=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:El(QAt(e.appState),QAt(t.appState)),XXr=u7.default.memo(YXr,jXr),$Xr=e=>{let t=(0,K6.useRef)(null),r=(0,K6.useRef)(!1);return(0,K6.useEffect)(()=>{let n=t.current;if(!n)return;let i=e.canvas;r.current||(r.current=!0,n.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let a=`${e.appState.width}px`,o=`${e.appState.height}px`;i.style.width!==a&&(i.style.width=a),i.style.height!==o&&(i.style.height=o);let s=e.appState.width*e.scale,l=e.appState.height*e.scale;i.width!==s&&(i.width=s),i.height!==l&&(i.height=l),cne({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},z3e())}),(0,M9t.jsx)("div",{className:"excalidraw__canvas-wrapper",ref:t})},JAt=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),KXr=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:El(JAt(e.appState),JAt(t.appState))&&El(e.renderConfig,t.renderConfig),ZXr=K6.default.memo($Xr,KXr),e7t=class{constructor(e){Oe(this,"scene"),Oe(this,"getRenderableElements",(()=>{let t=({elementsMap:n,zoom:i,offsetLeft:a,offsetTop:o,scrollX:s,scrollY:l,height:u,width:d})=>{let h=[];for(let f of n.values())BU(f,d,u,{zoom:i,offsetLeft:a,offsetTop:o,scrollX:s,scrollY:l},n)&&h.push(f);return h},r=({elements:n,editingTextElement:i,newElementId:a,pendingImageElementId:o})=>{let s=hh(new Map);for(let l of n)hi(l)&&o===l.id||a!==l.id&&(!i||i.type!=="text"||l.id!==i.id)&&s.set(l.id,l);return s};return sUe(({zoom:n,offsetLeft:i,offsetTop:a,scrollX:o,scrollY:s,height:l,width:u,editingTextElement:d,newElementId:h,pendingImageElementId:f,sceneNonce:p})=>{let m=this.scene.getNonDeletedElements(),g=r({elements:m,editingTextElement:d,newElementId:h,pendingImageElementId:f}),y=t({elementsMap:g,zoom:n,offsetLeft:i,offsetTop:a,scrollX:o,scrollY:s,height:l,width:u});return{elementsMap:g,visibleElements:y}})})()),this.scene=e}destroy(){I9t.cancel(),lne.cancel(),this.getRenderableElements.clear()}},QXr=({trails:e})=>{let t=(0,lZ.useRef)(null);return(0,lZ.useEffect)(()=>{if(t.current)for(let r of e)r.start(t.current);return()=>{for(let r of e)r.stop()}},e),(0,f3e.jsx)("div",{className:"SVGLayer",children:(0,f3e.jsx)("svg",{ref:t})})},JXr=5,e$r=(e,t,r)=>{let[n,i]=un(e,r),{x:a,y:o}=mf({sceneX:n+e.width,sceneY:i},t),s=a-t.offsetLeft+10,l=o-t.offsetTop;return{x:s,y:l}},t7t=({children:e,element:t,elementsMap:r})=>{let n=mN();if(n.contextMenu||n.newElement||n.resizingElement||n.isRotating||n.openMenu||n.viewModeEnabled)return null;let{x:i,y:a}=e$r(t,n,r);return(0,L9t.jsx)("div",{className:"excalidraw-canvas-buttons",style:{top:`${a}px`,left:`${i}px`,padding:JXr},children:e})},t$r="small",P4e=e=>(0,cN.jsxs)("label",{className:St("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${t$r}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[(0,cN.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,cN.jsx)("div",{className:"ToolIcon__icon",children:e.icon})]}),r$r=({height:e,width:t,userToFollow:r,onDisconnect:n})=>(0,q6.jsx)("div",{className:"follow-mode",style:{width:t,height:e},children:(0,q6.jsxs)("div",{className:"follow-mode__badge",children:[(0,q6.jsxs)("div",{className:"follow-mode__badge__label",children:["Following"," ",(0,q6.jsx)("span",{className:"follow-mode__badge__username",title:r.username,children:r.username})]}),(0,q6.jsx)("button",{type:"button",onClick:n,className:"follow-mode__disconnect-btn",children:p5})]})}),n$r=r$r,i$r=class{constructor(){Oe(this,"targets",new WeakMap),Oe(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let r=this.targets.get(e);if(!r)return;let n=this.onFrame(r,t);!r.stopped&&!n?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},p3e=class{constructor(e,t,r){this.animationFrameHandler=e,this.app=t,this.options=r,Oe(this,"currentTrail"),Oe(this,"pastTrails",[]),Oe(this,"container"),Oe(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(oi,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let r=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[r-1][0]===e&&this.currentTrail.originalPoints[r-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&this.container?.removeChild(this.trailElement)}startPath(e,t){this.currentTrail=new s9(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let r of this.pastTrails)e.push(this.drawTrail(r,this.app.state));if(this.currentTrail){let r=this.drawTrail(this.currentTrail,this.app.state);e.push(r)}this.pastTrails=this.pastTrails.filter(r=>r.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let r=e.getStrokeOutline(e.options.size/t.zoom.value).map(([n,i])=>{let a=mf({sceneX:n,sceneY:i},t);return[a.x,a.y]});return lUe(r,!0)}},a$r=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,Oe(this,"localTrail"),Oe(this,"collabTrails",new Map),Oe(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new p3e(e,t,{...this.getTrailOptions(),fill:()=>T8e})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),r=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(Ub(r),Ub(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let r;this.collabTrails.has(e)?r=this.collabTrails.get(e):(r=new p3e(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>t.pointer?.laserColor||jK(e,t)}),r.start(this.container),this.collabTrails.set(e,r)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!r.hasCurrentTrail&&r.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&r.hasCurrentTrail&&!r.hasLastPoint(t.pointer.x,t.pointer.y)&&r.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&r.hasCurrentTrail&&(r.addPointToPath(t.pointer.x,t.pointer.y),r.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},o$r=(e,t,r,n,i,a)=>{let{zoom:o}=n,s=180*r/Math.PI,l=e*(o.value-1)/2,u=t*(o.value-1)/2;return e>i&&o.value!==1&&(l=i*(o.value-1)/2),t>a&&o.value!==1&&(u=a*(o.value-1)/2),`translate(${l}px, ${u}px) scale(${o.value}) rotate(${s}deg)`},s$r=({id:e,onChange:t,onSubmit:r,getViewportCoords:n,element:i,canvas:a,excalidrawContainer:o,app:s,autoSelect:l=!0})=>{let u=(D,M)=>{if(!M.style.fontFamily||!M.style.fontSize)return!1;let O=M.style.fontFamily.replace(/"/g,"");return u5({fontFamily:D.fontFamily})!==O||`${D.fontSize}px`!==M.style.fontSize},d=()=>{let D=s.state,M=vm.getScene(i)?.getElement(e);if(!M)return;let{textAlign:O,verticalAlign:_}=M,B=s.scene.getNonDeletedElementsMap();if(M&&er(M)){let F=M.x,G=M.y,z=$s(M,s.scene.getNonDeletedElementsMap()),V=M.width,$=M.height,Z=M.width,re=M.height;if(z&&M.containerId){if(An(z)){let Ze=rr.getBoundTextElementPosition(z,M,B);F=Ze.x,G=Ze.y}let Ce=u(M,h),Ye;if(Ce?Ye=UU(z.id,z.height):(Ye=r5[z.id],Ye||(Ye=UU(z.id,z.height))),Z=_p(z,M),re=AT(z,M),!An(z)&&$>re){let Ze=kb($,z.type);kt(z,{height:Ze});return}else if(!An(z)&&z.height>Ye.height&&${let M=await vne(D,!0);if(!M.text)return;let O=f5(M.text);if(!O)return;let _=$s(i,s.scene.getNonDeletedElementsMap()),B=Bi({fontSize:s.state.currentItemFontSize,fontFamily:s.state.currentItemFontFamily});if(_){let F=hn(_,s.scene.getNonDeletedElementsMap()),G=Lb(`${h.value}${O}`,B,_p(_,F)),z=yO(G,B);h.style.width=`${z}px`}},h.oninput=()=>{let D=f5(h.value);if(h.value!==D){let M=h.selectionStart;h.value=D,h.selectionStart=M,h.selectionEnd=M}t(h.value)}),h.onkeydown=D=>{if(!D.shiftKey&&tAt.keyTest(D))D.preventDefault(),s.actionManager.executeAction(tAt),d();else if(!D.shiftKey&&rAt.keyTest(D))D.preventDefault(),s.actionManager.executeAction(rAt),d();else if(!D.shiftKey&&nAt.keyTest(D))D.preventDefault(),s.actionManager.executeAction(nAt),d();else if(QSt.keyTest(D))s.actionManager.executeAction(QSt);else if(JSt.keyTest(D))s.actionManager.executeAction(JSt);else if(D.key===qe.ESCAPE)D.preventDefault(),w=!0,T();else if(D.key===qe.ENTER&&D[qe.CTRL_OR_CMD]){if(D.preventDefault(),D.isComposing||D.keyCode===229)return;w=!0,T()}else if(D.key===qe.TAB||D[qe.CTRL_OR_CMD]&&(D.code===ti.BRACKET_LEFT||D.code===ti.BRACKET_RIGHT)){if(D.preventDefault(),D.isComposing)return;D.shiftKey||D.code===ti.BRACKET_LEFT?b():v(),h.dispatchEvent(new Event("input"))}};let m=4,g=" ".repeat(m),y=new RegExp(`^ {1,${m}}`),v=()=>{let{selectionStart:D,selectionEnd:M}=h,O=x(),_=h.value;O.forEach(B=>{let F=_.slice(0,B),G=_.slice(B);_=`${F}${g}${G}`}),h.value=_,h.selectionStart=D+m,h.selectionEnd=M+m*O.length},b=()=>{let{selectionStart:D,selectionEnd:M}=h,O=x(),_=[],B=h.value;O.forEach(F=>{let G=B.slice(F,F+m).match(y);if(G){let z=B.slice(0,F),V=B.slice(F+G[0].length);B=`${z}${V}`,_.push(F)}}),h.value=B,_.length&&(D>_[_.length-1]?h.selectionStart=Math.max(D-m,_[_.length-1]):h.selectionStart=D,h.selectionEnd=Math.max(h.selectionStart,M-m*_.length))},x=()=>{let{selectionStart:D,selectionEnd:M,value:O}=h,_=O.slice(0,D).match(/[^\n]*$/)[0].length;return D=D-_,O.slice(D,M).split(` -`).reduce((B,F,G,z)=>B.concat(G?B[G-1]+z[G-1].length+1:D),[]).reverse()},E=D=>{D.target instanceof HTMLCanvasElement&&(D.preventDefault(),D.stopPropagation())},w=!1,T=()=>{if(A)return;A=!0,C();let D=vm.getScene(i)?.getElement(i.id);if(!D)return;let M=$s(D,s.scene.getNonDeletedElementsMap());if(M){if(h.value.trim()){let O=ym(M);!O||O!==i.id?kt(M,{boundElements:(M.boundElements||[]).concat({type:"text",id:i.id})}):An(M)&&OU(M)}else kt(M,{boundElements:M.boundElements?.filter(O=>!er(O))});Mc(D,M,s.scene.getNonDeletedElementsMap())}r({viaKeyboard:w,nextOriginalText:h.value})},C=()=>{h.onblur=null,h.oninput=null,h.onkeydown=null,P&&P.disconnect(),window.removeEventListener("resize",d),window.removeEventListener("wheel",E,!0),window.removeEventListener("pointerdown",U),window.removeEventListener("pointerup",S),window.removeEventListener("blur",T),window.removeEventListener("beforeunload",T),L(),I(),h.remove()},S=D=>{window.removeEventListener("pointerup",S);let M=D?.target,O=M instanceof HTMLElement&&M.classList.contains("properties-trigger");setTimeout(()=>{h.onblur=T,O||h.focus()})},R=()=>{h.onblur=null,window.addEventListener("pointerup",S),window.addEventListener("blur",T)},U=D=>{let M=D?.target;if(D.button===z1.WHEEL){M instanceof HTMLTextAreaElement&&(D.preventDefault(),s.handleCanvasPanUsingWheelOrSpaceDrag(D)),R();return}let O=M instanceof HTMLElement&&M.classList.contains("properties-trigger");(D.target instanceof HTMLElement||D.target instanceof SVGElement)&&D.target.closest(`.${a5.SHAPE_ACTIONS_MENU}, .${a5.ZOOM_ACTIONS}`)&&!Ab(D.target)||O?R():D.target instanceof HTMLCanvasElement&&!xm()&&requestAnimationFrame(()=>{T()})},L=s.scene.onUpdate(()=>{d(),document.activeElement?.closest(".properties-content")||h.focus()}),I=s.onScrollChangeEmitter.on(()=>{d()}),A=!1;l&&h.select(),S();let P=null;a&&"ResizeObserver"in window?(P=new window.ResizeObserver(()=>{d()}),P.observe(a)):window.addEventListener("resize",d),h.onpointerdown=D=>D.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",U,{capture:!0})}),window.addEventListener("beforeunload",T),o?.querySelector(".excalidraw-textEditorContainer").appendChild(h)},l$r=jt({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,r,n)=>{let i=Un(e,t);return i.length===1&&er(i[0])&&!i[0].autoResize},perform:(e,t,r,n)=>{let i=Un(e,t);return{appState:t,elements:e.map(a=>{if(a.id===i[0].id&&er(a)){let o=Jl(a.originalText,Bi(a),a.lineHeight);return Tn(a,{autoResize:!0,width:o.width,height:o.height,text:a.originalText})}return a}),captureUpdate:pt.IMMEDIATELY}}}),c$r=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(r=>`\\s*${r}(-beta)?`).join("|")})\\b`).test(e.trim())},D9t=({canvas:e,rc:t,newElement:r,elementsMap:n,allElementsMap:i,scale:a,appState:o,renderConfig:s})=>{if(e){let[l,u]=tB(e,a),d=rB({canvas:e,scale:a,normalizedWidth:l,normalizedHeight:u});d.save(),d.scale(o.zoom.value,o.zoom.value),r&&r.type!=="selection"?pb(r,n,i,t,d,s,o):d.clearRect(0,0,l,u)}},u$r=dU(e=>{D9t(e)},{trailing:!0}),d$r=(e,t)=>{if(t){u$r(e);return}D9t(e)},h$r=e=>{let t=(0,cZ.useRef)(null);return(0,cZ.useEffect)(()=>{t.current&&d$r({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},z3e())}),(0,N9t.jsx)("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},f$r=h$r,_9t=Ps.default.createContext(null),P9t=Ps.default.createContext(null),O9t={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},G3e=Ps.default.createContext(O9t);G3e.displayName="DeviceContext";var W3e=Ps.default.createContext({container:null,id:null});W3e.displayName="ExcalidrawContainerContext";var V3e=Ps.default.createContext([]);V3e.displayName="ExcalidrawElementsContext";var H3e=Ps.default.createContext({...Fp(),width:0,height:0,offsetLeft:0,offsetTop:0});H3e.displayName="ExcalidrawAppStateContext";var q3e=Ps.default.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});q3e.displayName="ExcalidrawSetAppStateContext";var Y3e=Ps.default.createContext(null);Y3e.displayName="ExcalidrawActionManagerContext";var d1=()=>(0,Ps.useContext)(_9t),pN=()=>(0,Ps.useContext)(P9t),gl=()=>(0,Ps.useContext)(G3e),h1=()=>(0,Ps.useContext)(W3e),uZ=()=>(0,Ps.useContext)(V3e),mN=()=>(0,Ps.useContext)(H3e),Bs=()=>(0,Ps.useContext)(q3e),Qd=()=>(0,Ps.useContext)(Y3e),ND=!1,O4e=0,L6=!1,_D=!1,B4e=!1,F4e={horizontal:null,vertical:null},nw=0,PD=!1,z4e=new Map,uK=!1,r7t=0,n7t=!1,OD=null,Ci={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},p$r=class B9t extends Ps.default.Component{constructor(t){super(t),Oe(this,"canvas"),Oe(this,"interactiveCanvas",null),Oe(this,"rc"),Oe(this,"unmounted",!1),Oe(this,"actionManager"),Oe(this,"device",O9t),Oe(this,"excalidrawContainerRef",Ps.default.createRef()),Oe(this,"scene"),Oe(this,"fonts"),Oe(this,"renderer"),Oe(this,"visibleElements"),Oe(this,"resizeObserver"),Oe(this,"nearestScrollableContainer"),Oe(this,"library"),Oe(this,"libraryItemsFromStorage"),Oe(this,"id"),Oe(this,"store"),Oe(this,"history"),Oe(this,"excalidrawContainerValue"),Oe(this,"files",{}),Oe(this,"imageCache",new Map),Oe(this,"iFrameRefs",new Map),Oe(this,"embedsValidationStatus",new Map),Oe(this,"initializedEmbeds",new Set),Oe(this,"elementsPendingErasure",new Set),Oe(this,"flowChartCreator",new LYr),Oe(this,"flowChartNavigator",new MYr),Oe(this,"hitLinkElement"),Oe(this,"lastPointerDownEvent",null),Oe(this,"lastPointerUpEvent",null),Oe(this,"lastPointerMoveEvent",null),Oe(this,"lastPointerMoveCoords",null),Oe(this,"lastViewportPosition",{x:0,y:0}),Oe(this,"animationFrameHandler",new i$r),Oe(this,"laserTrails",new a$r(this.animationFrameHandler,this)),Oe(this,"eraserTrail",new p3e(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:d=>{let h=Math.max(0,1-(performance.now()-d.pressure)/200),f=(10-Math.min(10,d.totalLength-d.currentIndex))/10;return Math.min(Ub(f),Ub(h))},fill:()=>this.state.theme===Gn.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),Oe(this,"onChangeEmitter",new qp),Oe(this,"onPointerDownEmitter",new qp),Oe(this,"onPointerUpEmitter",new qp),Oe(this,"onUserFollowEmitter",new qp),Oe(this,"onScrollChangeEmitter",new qp),Oe(this,"missingPointerEventCleanupEmitter",new qp),Oe(this,"onRemoveEventListenersEmitter",new qp),Oe(this,"getEffectiveGridSize",()=>CT(this)?this.state.gridSize:null),Oe(this,"updateEmbedValidationStatus",(d,h)=>{this.embedsValidationStatus.set(d.id,h),za.delete(d)}),Oe(this,"updateEmbeddables",()=>{let d=new Set,h=!1;this.scene.getNonDeletedElements().filter(f=>{if(vu(f)){if(d.add(f.id),!this.embedsValidationStatus.has(f.id)){h=!0;let p=RU(f.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(f,p)}}else W1(f)&&d.add(f.id);return!1}),h&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((f,p)=>{d.has(p)||this.iFrameRefs.delete(p)})}),Oe(this,"getFrameNameDOMId",d=>`${this.id}-frame-name-${d.id}`),Oe(this,"frameNameBoundsCache",{get:d=>{let h=this.frameNameBoundsCache._cache.get(d.id);if(!h||h.zoom!==this.state.zoom.value||h.versionNonce!==d.versionNonce){let f=document.getElementById(this.getFrameNameDOMId(d));if(f){let p=f.getBoundingClientRect(),m=ca({clientX:p.x,clientY:p.y},this.state),g=ca({clientX:p.right,clientY:p.bottom},this.state);return h={x:m.x,y:m.y,width:g.x-m.x,height:g.y-m.y,angle:0,zoom:this.state.zoom.value,versionNonce:d.versionNonce},this.frameNameBoundsCache._cache.set(d.id,h),h}return null}return h},_cache:new Map}),Oe(this,"resetEditingFrame",d=>{d&&kt(d,{name:d.name?.trim()||null}),this.setState({editingFrame:null})}),Oe(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let d=this.state.theme===Gn.DARK;return this.scene.getNonDeletedFramesLikes().map(h=>{if(!BU(h,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===h.id&&this.resetEditingFrame(h),null;let{x:f,y:p}=mf({sceneX:h.x,sceneY:h.y},this.state),m=6,g,y=Sne(h);if(h.id===this.state.editingFrame){let v=y;g=(0,Xn.jsx)("input",{autoFocus:!0,value:v,onChange:b=>{kt(h,{name:b.target.value})},onFocus:b=>b.target.select(),onBlur:()=>this.resetEditingFrame(h),onKeyDown:b=>{(b.key===qe.ESCAPE||b.key===qe.ENTER)&&this.resetEditingFrame(h)},style:{background:this.state.viewBackgroundColor,filter:d?uO:"none",zIndex:2,border:"none",display:"block",padding:`${m}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${m}px, ${m}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-f-m}px`},size:v.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else g=y;return(0,Xn.jsx)("div",{id:this.getFrameNameDOMId(h),style:{position:"absolute",bottom:`${this.state.height+Ca.nameOffsetY-p+this.state.offsetTop}px`,left:`${f-this.state.offsetLeft}px`,zIndex:2,fontSize:Ca.nameFontSize,color:d?Ca.nameColorDarkTheme:Ca.nameColorLightTheme,lineHeight:Ca.nameLineHeight,width:"max-content",maxWidth:`${h.width}px`,overflow:h.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Ii.MOVE,pointerEvents:this.state.viewModeEnabled?i5.disabled:i5.enabled},onPointerDown:v=>this.handleCanvasPointerDown(v),onWheel:v=>this.handleWheel(v),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:h.id})},children:g},h.id)})}),Oe(this,"focusContainer",()=>{this.excalidrawContainerRef.current?.focus()}),Oe(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),Oe(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),Oe(this,"onInsertElements",d=>{this.addElementsFromPasteOrLibrary({elements:d,position:"center",files:null})}),Oe(this,"onExportImage",async(d,h,f)=>{pa("export",d,"ui");let p=await YK(d,h,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:f.exportingFrame}).catch(kte).catch(m=>{console.error(m),this.setState({errorMessage:m.message})});this.state.exportEmbedScene&&p&&wB(p)&&this.setState({fileHandle:p})}),Oe(this,"magicGenerations",new Map),Oe(this,"updateMagicGeneration",({frameElement:d,data:h})=>{h.status==="pending"?kt(d,{customData:{generationData:void 0}},!1):kt(d,{customData:{generationData:h}},!1),this.magicGenerations.set(d.id,h),this.triggerRender()}),Oe(this,"plugins",{}),Oe(this,"onMagicframeToolSelect",()=>{let d=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(d.length===0)this.setActiveTool({type:vs.magicframe}),pa("ai","tool-select (empty-selection)","d2c");else{let h=d.length===1&&mU(d[0])&&d[0];if(!h&&d.some(p=>qr(p)||p.frameId)){this.setActiveTool({type:vs.magicframe});return}pa("ai","tool-select (existing selection)","d2c");let f;if(h)f=h;else{let[p,m,g,y]=mi(d),v=50;f=$O({...Ca,x:p-v,y:m-v,width:g-p+v*2,height:y-m+v*2,opacity:100,locked:!1}),this.scene.insertElement(f);for(let b of d)kt(b,{frameId:f.id});this.setState({selectedElementIds:{[f.id]:!0}})}this.onMagicFrameGenerate(f,"upstream")}}),Oe(this,"openEyeDropper",({type:d})=>{W0.set(BK,{swapPreviewOnAlt:!0,colorPickerType:d==="stroke"?"elementStroke":"elementBackground",onSelect:(h,f)=>{let p=d==="background"&&f.altKey||d==="stroke"&&!f.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?p?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:h},captureUpdate:pt.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:h},captureUpdate:pt.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(m=>this.state.selectedElementIds[m.id]?Tn(m,{[p?"strokeColor":"backgroundColor"]:h}):m),captureUpdate:pt.IMMEDIATELY})},keepOpenOnAlt:!1})}),Oe(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),Oe(this,"syncActionResult",Do(d=>{if(this.unmounted||d===!1)return;d.captureUpdate===pt.NEVER?this.store.shouldUpdateSnapshot():d.captureUpdate===pt.IMMEDIATELY&&this.store.shouldCaptureIncrement();let h=!1,f=null;if(d.elements&&(this.scene.replaceAllElements(d.elements),h=!0),d.files&&(this.addMissingFiles(d.files,d.replaceFiles),this.addNewImagesToImageCache()),d.appState||f||this.state.contextMenu){let p=d?.appState?.viewModeEnabled||!1,m=d?.appState?.zenModeEnabled||!1,g=d?.appState?.theme||this.props.theme||Gn.LIGHT,y=d?.appState?.name??this.state.name,v=d?.appState?.errorMessage??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(p=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(m=this.props.zenModeEnabled),f=d.appState?.editingTextElement||null,d.elements&&f&&d.elements.forEach(b=>{f?.id===b.id&&f!==b&&xB(b)&&er(b)&&(f=b)}),f?.isDeleted&&(f=null),this.setState(b=>{let x=d.appState||{};return{...b,...x,contextMenu:null,editingTextElement:f,viewModeEnabled:p,zenModeEnabled:m,theme:g,name:y,errorMessage:v}}),h=!0}!h&&d.captureUpdate!==pt.EVENTUALLY&&this.scene.triggerUpdate()})),Oe(this,"onBlur",Do(()=>{L6=!1,this.setState({isBindingEnabled:!0})})),Oe(this,"onUnload",()=>{this.onBlur()}),Oe(this,"disableEvent",d=>{d.preventDefault()}),Oe(this,"resetHistory",()=>{this.history.clear()}),Oe(this,"resetStore",()=>{this.store.clear()}),Oe(this,"resetScene",Do(d=>{this.scene.replaceAllElements([]),this.setState(h=>({...Fp(),isLoading:d?.resetLoadingState?!1:h.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),Oe(this,"initializeScene",async()=>{"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async f=>{if(!f.files.length)return;let p=f.files[0],m=await p.getFile();this.loadFileToCanvas(new File([m],m.name||"",{type:m.type}),p)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let d=null;try{typeof this.props.initialData=="function"?d=await this.props.initialData()||null:d=await this.props.initialData||null,d?.libraryItems&&this.library.updateLibrary({libraryItems:d.libraryItems,merge:!0}).catch(f=>{console.error(f)})}catch(f){console.error(f),d={appState:{errorMessage:f.message||"Encountered an error during importing or restoring scene data"}}}let h=b5(d,null,null,{repairBindings:!0});h.appState={...h.appState,theme:this.props.theme||h.appState.theme,openSidebar:h.appState?.openSidebar||this.state.openSidebar,activeTool:h.appState.activeTool.type==="image"?{...h.appState.activeTool,type:"selection"}:h.appState.activeTool,isLoading:!1,toast:this.state.toast},d?.scrollToContent&&(h.appState={...h.appState,...TT(h.elements,{...h.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...h,captureUpdate:pt.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(f=>{this.fonts.onLoaded(f)}),IT(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),Oe(this,"isMobileBreakpoint",(d,h)=>d{if(!this.excalidrawContainerRef.current)return;let{clientWidth:d,clientHeight:h}=document.body,f=this.device.viewport,p=fU(f,{isLandscape:d>h,isMobile:this.isMobileBreakpoint(d,h)});return f!==p?(this.device={...this.device,viewport:p},!0):!1}),Oe(this,"refreshEditorBreakpoints",()=>{let d=this.excalidrawContainerRef.current;if(!d)return;let{width:h,height:f}=d.getBoundingClientRect(),p=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:O8e,m=this.device.editor,g=fU(m,{isMobile:this.isMobileBreakpoint(h,f),canFitSidebar:h>p});return m!==g?(this.device={...this.device,editor:g},!0):!1}),Oe(this,"onResize",Do(()=>{this.scene.getElementsIncludingDeleted().forEach(d=>za.delete(d)),this.refreshViewportBreakpoints(),this.updateDOMRect(),aO||this.refreshEditorBreakpoints(),this.setState({})})),Oe(this,"onFullscreenChange",()=>{!document.fullscreenElement&&this.state.activeEmbeddable?.state==="active"&&this.setState({activeEmbeddable:null})}),Oe(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:d,scrollBars:h,elementsMap:f})=>{h&&(F4e=h);let p=this.state.editingTextElement?!1:!d&&f.size>0;this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.scheduleImageRefresh()}),Oe(this,"onScroll",d5(()=>{let{offsetTop:d,offsetLeft:h}=this.getCanvasOffsets();this.setState(f=>f.offsetLeft===h&&f.offsetTop===d?null:{offsetTop:d,offsetLeft:h})},L8e)),Oe(this,"onCut",Do(d=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||Ab(d.target)||(this.actionManager.executeAction(cAt,"keyboard",d),d.preventDefault(),d.stopPropagation())})),Oe(this,"onCopy",Do(d=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||Ab(d.target)||(this.actionManager.executeAction(gK,"keyboard",d),d.preventDefault(),d.stopPropagation())})),Oe(this,"onTouchStart",d=>{if(hte&&d.preventDefault(),!ND){ND=!0,clearTimeout(O4e),O4e=window.setTimeout(B9t.resetTapTwice,R8e);return}if(ND&&d.touches.length===1){let h=d.touches[0];this.handleCanvasDoubleClick({clientX:h.clientX,clientY:h.clientY}),ND=!1,clearTimeout(O4e)}d.touches.length===2&&this.setState({selectedElementIds:fi({},this.state),activeEmbeddable:null})}),Oe(this,"onTouchEnd",d=>{this.resetContextMenuTimer(),d.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:fi(this.state.previousSelectedElementIds,this.state)}):Ci.pointers.clear()}),Oe(this,"pasteFromClipboard",Do(async d=>{let h=!!uK,f=document.activeElement,p=this.excalidrawContainerRef.current?.contains(f);if(d&&!p)return;let m=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(d&&(!(m instanceof HTMLCanvasElement)||Ab(f)))return;let{x:g,y}=ca({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),v=d?.clipboardData?.files[0],b=await vne(d,h);if(!v&&!h){if(b.mixedContent)return this.addElementsFromMixedContentPaste(b.mixedContent,{isPlainPaste:h,sceneX:g,sceneY:y});if(b.text){let x=b.text.trim();x.startsWith("")&&(v=qne(x))}}if(Fb(v)&&!b.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:ce("errors.imageToolNotSupported")});return}let x=this.createImageElement({sceneX:g,sceneY:y});this.insertImageElement(x,v),this.initializeImageDimensions(x),this.setState({selectedElementIds:fi({[x.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(b,d)===!1)return}catch(x){console.error(x)}if(b.errorMessage)this.setState({errorMessage:b.errorMessage});else if(b.spreadsheet&&!h)this.setState({pasteDialog:{data:b.spreadsheet,shown:!0}});else if(b.elements){let x=b.programmaticAPI?h3e(b.elements):b.elements;this.addElementsFromPasteOrLibrary({elements:x,files:b.files||null,position:"cursor",retainSeed:h})}else if(b.text){if(b.text&&c$r(b.text)){let w=await Promise.resolve().then(()=>(T4e(),E4e));try{let{elements:T,files:C={}}=await w.parseMermaidToExcalidraw(b.text),S=h3e(T,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:S,files:C,position:"cursor"});return}catch(T){console.warn(`parsing pasted text as mermaid definition failed: ${T.message}`)}}let x=Ite(b.text).split(/\n+/).map(w=>w.trim()).filter(Boolean),E=x.map(w=>dRe(w)).filter(w=>RU(w,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(w)||v5(w)?.type==="video"));if(!uK&&E.length>0&&E.length===x.length){let w=[];for(let T of E){let C=w[w.length-1],S=this.insertEmbeddableElement({sceneX:C?C.x+C.width+20:g,sceneY:y,link:fd(T)});S&&w.push(S)}w.length&&this.setState({selectedElementIds:Object.fromEntries(w.map(T=>[T.id,!0]))});return}this.addTextFromPaste(b.text,h)}this.setActiveTool({type:"selection"}),d?.preventDefault()})),Oe(this,"addElementsFromPasteOrLibrary",d=>{let h=aB(d.elements,null,void 0),[f,p,m,g]=mi(h),y=Ql(f,m)/2,v=Ql(p,g)/2,b=typeof d.position=="object"?d.position.clientX:d.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,x=typeof d.position=="object"?d.position.clientY:d.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:E,y:w}=ca({clientX:b,clientY:x},this.state),T=E-y,C=w-v,[S,R]=os(T,C,this.getEffectiveGridSize()),U=Qre(h.map(D=>Tn(D,{x:D.x+S-f,y:D.y+R-p})),{randomizeSeed:!d.retainSeed}),L=this.scene.getElementsIncludingDeleted(),I=[...L,...U];I=this.props.onDuplicate?.(I,L)||I,Op(I,Hr(U));let A=this.getTopLayerFrameAtSceneCoords({x:E,y:w});if(A){let D=FRe(U,A);LT(I,D,A,this.state)}this.scene.replaceAllElements(I),U.forEach(D=>{if(er(D)&&ga(D)){let M=$s(D,this.scene.getElementsMapIncludingDeleted());Mc(D,M,this.scene.getElementsMapIncludingDeleted())}}),v8e&&Em.loadElementsFonts(U).then(D=>{this.fonts.onLoaded(D)}),d.files&&this.addMissingFiles(d.files),this.store.shouldCaptureIncrement();let P=pB(U);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&W0.get(N3e)?this.state.openSidebar:null,...Rc({editingGroupId:null,selectedElementIds:P.reduce((D,M)=>(ga(M)||(D[M.id]=!0),D),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{d.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),d.fitToContent&&this.scrollToContent(U,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),Oe(this,"setAppState",(d,h)=>{this.setState(d,h)}),Oe(this,"removePointer",d=>{nw&&this.resetContextMenuTimer(),Ci.pointers.delete(d.pointerId)}),Oe(this,"toggleLock",(d="ui")=>{this.state.activeTool.locked||pa("toolbar","toggleLock",`${d} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(h=>({activeTool:{...h.activeTool,...Bo(this.state,h.activeTool.locked?{type:"selection"}:h.activeTool),locked:!h.activeTool.locked}}))}),Oe(this,"updateFrameRendering",d=>{this.setState(h=>{let f=typeof d=="function"?d(h.frameRendering):d;return{frameRendering:{enabled:f?.enabled??h.frameRendering.enabled,clip:f?.clip??h.frameRendering.clip,name:f?.name??h.frameRendering.name,outline:f?.outline??h.frameRendering.outline}}})}),Oe(this,"togglePenMode",d=>{this.setState(h=>({penMode:d??!h.penMode,penDetected:!0}))}),Oe(this,"onHandToolToggle",()=>{this.actionManager.executeAction(mHr)}),Oe(this,"zoomCanvas",d=>{this.setState({...D6({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:Tm(d)},this.state)})}),Oe(this,"cancelInProgressAnimation",null),Oe(this,"scrollToContent",(d=this.scene.getNonDeletedElements(),h)=>{if(typeof d=="string"){let y;if(IT(d)?y=yRe(d):y=d,y){let v=this.scene.getElementsFromId(y);v?.length?this.scrollToContent(v,{fitToContent:h?.fitToContent??!0,animate:h?.animate??!0}):IT(d)&&this.setState({toast:{message:ce("elementLink.notFound"),duration:3e3,closable:!0}})}return}this.cancelInProgressAnimation?.();let f=Array.isArray(d)?d:[d],p=this.state.zoom,m=this.state.scrollX,g=this.state.scrollY;if(h?.fitToContent||h?.fitToViewport){let{appState:y}=HK({canvasOffsets:h.canvasOffsets,targetElements:f,appState:this.state,fitToViewport:!!h?.fitToViewport,viewportZoomFactor:h?.viewportZoomFactor,minZoom:h?.minZoom,maxZoom:h?.maxZoom});p=y.zoom,m=y.scrollX,g=y.scrollY}else{let y=TT(f,this.state);m=y.scrollX,g=y.scrollY}if(h?.animate){let y=this.state.scrollX,v=this.state.scrollY,b=this.state.zoom.value,x=Q8e({fromValues:{scrollX:y,scrollY:v,zoom:b},toValues:{scrollX:m,scrollY:g,zoom:p.value},interpolateValue:(E,w,T,C)=>{if(C==="zoom")return E*Math.pow(w/E,Ub(T))},onStep:({scrollX:E,scrollY:w,zoom:T})=>{this.setState({scrollX:E,scrollY:w,zoom:{value:T}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:h?.duration??500});this.cancelInProgressAnimation=()=>{x(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:m,scrollY:g,zoom:p})}),Oe(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),Oe(this,"translateCanvas",d=>{this.cancelInProgressAnimation?.(),this.maybeUnfollowRemoteUser(),this.setState(d)}),Oe(this,"setToast",d=>{this.setState({toast:d})}),Oe(this,"restoreFileFromShare",async()=>{try{let d=await caches.open("web-share-target"),h=await d.match("shared-file");if(h){let f=await h.blob(),p=new File([f],f.name||"",{type:f.type});this.loadFileToCanvas(p,null),await d.delete("shared-file"),window.history.replaceState(null,x8e,window.location.pathname)}}catch(d){this.setState({errorMessage:d.message})}}),Oe(this,"addFiles",Do(d=>{let{addedFiles:h}=this.addMissingFiles(d);this.clearImageShapeCache(h),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),Oe(this,"addMissingFiles",(d,h=!1)=>{let f=h?{}:{...this.files},p={},m=Array.isArray(d)?d:Object.values(d);for(let g of m)if(!f[g.id]&&(p[g.id]=g,f[g.id]=g,g.mimeType===Mr.svg))try{let y=nMe(ine(aMe(g.dataURL)),Mr.svg);g.dataURL!==y&&(g.version=(g.version??1)+1,g.dataURL=y)}catch(y){console.error(y)}return this.files=f,{addedFiles:p}}),Oe(this,"updateScene",Do(d=>{let h=Cm(d.elements??[]);if(d.captureUpdate&&d.captureUpdate!==pt.EVENTUALLY){let f=this.store.snapshot.appState,p=this.store.snapshot.elements,m=d.appState?Object.assign({},f,d.appState):f,g=d.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),Hr(h)):p;d.captureUpdate===pt.IMMEDIATELY?this.store.captureIncrement(g,m):d.captureUpdate===pt.NEVER&&this.store.updateSnapshot(g,m)}d.appState&&this.setState(d.appState),d.elements&&this.scene.replaceAllElements(h),d.collaborators&&this.setState({collaborators:d.collaborators})})),Oe(this,"triggerRender",d=>{d===!0?this.scene.triggerUpdate():this.setState({})}),Oe(this,"toggleSidebar",({name:d,tab:h,force:f})=>{let p;f===void 0?p=this.state.openSidebar?.name===d&&this.state.openSidebar?.tab===h?null:d:p=f?d:null;let m=p?{name:p}:null;return m&&h&&(m.tab=h),this.setState({openSidebar:m}),!!p}),Oe(this,"updateCurrentCursorPosition",Do(d=>{this.lastViewportPosition.x=d.clientX,this.lastViewportPosition.y=d.clientY})),Oe(this,"getEditorUIOffsets",()=>{let d=this.excalidrawContainerRef?.current?.querySelector(".App-toolbar")?.getBoundingClientRect()?.bottom??0,h=this.excalidrawContainerRef?.current?.querySelector(".sidebar")?.getBoundingClientRect(),f=this.excalidrawContainerRef?.current?.querySelector(".App-menu__left")?.getBoundingClientRect(),p=16;return qD().rtl?{top:d+p,right:Math.max(this.state.width-(f?.left??this.state.width),0)+p,bottom:p,left:Math.max(h?.right??0,0)+p}:{top:d+p,right:Math.max(this.state.width-(h?.left??this.state.width)+p,0),bottom:p,left:Math.max(f?.right??0,0)+p}}),Oe(this,"onKeyDown",Do(d=>{if("Proxy"in window&&(!d.shiftKey&&/^[A-Z]$/.test(d.key)||d.shiftKey&&/^[a-z]$/.test(d.key))&&(d=new Proxy(d,{get(m,g){let y=m[g];return typeof y=="function"?y.bind(m):g==="key"?d.shiftKey?m.key.toUpperCase():m.key.toLowerCase():y}})),!fO(d.target)){if((d.key===qe.ESCAPE||d.key===qe.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let m=Un(this.scene.getNonDeletedElementsMap(),this.state);if(m.length===1&&hi(m[0])&&d.key===qe.ENTER){this.startImageCropping(m[0]);return}if(d.key===qe.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let g=xT(d.key);if(d[qe.CTRL_OR_CMD]&&g&&!d.shiftKey){d.preventDefault();let y=Un(this.scene.getNonDeletedElementsMap(),this.state);y.length===1&&gU(y[0])&&this.flowChartCreator.createNodes(y[0],this.scene.getNonDeletedElementsMap(),this.state,AAt(d.key)),this.flowChartCreator.pendingNodes?.length&&!FU(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(d.altKey){let y=Un(this.scene.getNonDeletedElementsMap(),this.state);if(y.length===1&&g){d.preventDefault();let v=this.flowChartNavigator.exploreByDirection(y[0],this.scene.getNonDeletedElementsMap(),AAt(d.key));if(v){this.setState(x=>({selectedElementIds:fi({[v]:!0},x)}));let b=this.scene.getNonDeletedElementsMap().get(v);b&&!FU([b],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(b,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(d[qe.CTRL_OR_CMD]&&d.key===qe.P&&!d.shiftKey&&!d.altKey){this.setToast({message:ce("commandPalette.shortcutHint",{shortcut:iu("commandPalette")})}),d.preventDefault();return}if(d[qe.CTRL_OR_CMD]&&d.key.toLowerCase()===qe.V&&(uK=d.shiftKey,clearTimeout(r7t),r7t=window.setTimeout(()=>{uK=!1},100)),d[qe.CTRL_OR_CMD]&&Ab(d.target)&&(d.code===ti.MINUS||d.code===ti.EQUAL)){d.preventDefault();return}if(Ab(d.target)&&d.key!==qe.ESCAPE||xT(d.key)&&fO(d.target))return;if(d.key===qe.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(d.key.toLowerCase()===qe.E&&d.shiftKey&&d[qe.CTRL_OR_CMD]){d.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(d.key===qe.PAGE_UP||d.key===qe.PAGE_DOWN){let m=(d.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;d.key===qe.PAGE_DOWN&&(m=-m),d.shiftKey?this.translateCanvas(g=>({scrollX:g.scrollX+m})):this.translateCanvas(g=>({scrollY:g.scrollY+m}))}if(this.state.openDialog?.name==="elementLinkSelector"||this.actionManager.handleKeyDown(d)||this.state.viewModeEnabled)return;if(d[qe.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),xT(d.key)){let m=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),g=m.find(ar),y=new Set;m.filter(ar).filter(E=>{let w=E.startBinding&&!m.some(C=>C.id===E.startBinding?.elementId),T=E.endBinding&&!m.some(C=>C.id===E.endBinding?.elementId);return w||T}).forEach(E=>y.add(E.id)),m=m.filter(E=>!y.has(E.id));let v=this.getEffectiveGridSize()&&(d.shiftKey?fte:this.getEffectiveGridSize())||(d.shiftKey?w8e:fte),b=0,x=0;d.key===qe.ARROW_LEFT?b=-v:d.key===qe.ARROW_RIGHT?b=v:d.key===qe.ARROW_UP?x=-v:d.key===qe.ARROW_DOWN&&(x=v),m.forEach(E=>{kt(E,{x:E.x+b,y:E.y+x},!1),gu(E,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:m})}),this.setState({suggestedBindings:GO(m.filter(E=>E.id!==g?.id||v!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),d.preventDefault()}else if(d.key===qe.ENTER){let m=this.scene.getSelectedElements(this.state);if(m.length===1){let g=m[0];if(d[qe.CTRL_OR_CMD])dn(g)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==m[0].id)&&(this.store.shouldCaptureIncrement(),ar(g)||this.setState({editingLinearElement:new rr(g)}));else if(er(g)||ZIe(g)){let y;er(g)||(y=g);let v=jO(g,this.state,this.scene.getNonDeletedElementsMap()),b=v.x,x=v.y;this.startTextEditing({sceneX:b,sceneY:x,container:y}),d.preventDefault();return}else qr(g)&&this.setState({editingFrame:g.id})}}else if(!d.ctrlKey&&!d.altKey&&!d.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let m=dIe(d.key);m?(this.state.activeTool.type!==m&&pa("toolbar",m,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),m==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(g=>({currentItemArrowType:g.currentItemArrowType===Xs.sharp?Xs.round:g.currentItemArrowType===Xs.round?Xs.elbow:Xs.sharp})),this.setActiveTool({type:m}),d.stopPropagation()):d.key===qe.Q&&(this.toggleLock("keyboard"),d.stopPropagation())}if(d.key===qe.SPACE&&Ci.pointers.size===0&&(L6=!0,Fi(this.interactiveCanvas,Ii.GRAB),d.preventDefault()),(d.key===qe.G||d.key===qe.S)&&!d.altKey&&!d[qe.CTRL_OR_CMD]){let m=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!m.length)return;d.key===qe.G&&(g5(this.state.activeTool.type)||m.some(g=>g5(g.type)))&&(this.setState({openPopup:"elementBackground"}),d.stopPropagation()),d.key===qe.S&&(this.setState({openPopup:"elementStroke"}),d.stopPropagation())}if(!d[qe.CTRL_OR_CMD]&&d.shiftKey&&d.key.toLowerCase()===qe.F){let m=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!m.length)return;(this.state.activeTool.type==="text"||m.find(g=>er(g)||hn(g,this.scene.getNonDeletedElementsMap())))&&(d.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(d.key===qe.K&&!d.altKey&&!d[qe.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}d[qe.CTRL_OR_CMD]&&(d.key===qe.BACKSPACE||d.key===qe.DELETE)&&W0.set(nZ,"clearCanvas");let h=d.key.toLocaleLowerCase(),f=h===qe.S&&d.shiftKey,p=d.key===qe.I||h===qe.G&&d.shiftKey;(f||p)&&this.openEyeDropper({type:f?"stroke":"background"})})),Oe(this,"onKeyUp",Do(d=>{if(d.key===qe.SPACE&&(this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector"?Fi(this.interactiveCanvas,Ii.GRAB):this.state.activeTool.type==="selection"?wf(this.interactiveCanvas):(Wp(this.interactiveCanvas,this.state),this.setState({selectedElementIds:fi({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),L6=!1),!d[qe.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),xT(d.key)&&(CU(this.scene.getSelectedElements(this.state).filter(dn),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Tb(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom),this.setState({suggestedBindings:[]})),d.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:pt.IMMEDIATELY})),!d[qe.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.pendingNodes?.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let h=this.flowChartCreator.pendingNodes?.[0];h&&(this.setState(f=>({selectedElementIds:fi({[h.id]:!0},f)})),FU([h],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(h,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:pt.IMMEDIATELY})}})),Oe(this,"isToolSupported",d=>this.props.UIOptions.tools?.[d]!==!1),Oe(this,"setActiveTool",d=>{if(!this.isToolSupported(d.type)){console.warn(`"${d.type}" tool is disabled via "UIOptions.canvasActions.tools.${d.type}"`);return}let h=Bo(this.state,d);h.type==="hand"?Fi(this.interactiveCanvas,Ii.GRAB):L6||Wp(this.interactiveCanvas,{...this.state,activeTool:h}),K8e(document.activeElement)&&this.focusContainer(),mO(h.type)||this.setState({suggestedBindings:[]}),h.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(d.type==="image"&&d.insertOnCanvasDirectly)??!1}),this.setState(f=>{let p={snapLines:f.snapLines.length?[]:f.snapLines,originSnapOffset:null,activeEmbeddable:null};return h.type==="freedraw"&&this.store.shouldCaptureIncrement(),h.type!=="selection"?{...f,activeTool:h,selectedElementIds:fi({},f),selectedGroupIds:fi({},f),editingGroupId:null,multiElement:null,...p}:{...f,activeTool:h,...p}})}),Oe(this,"setOpenDialog",d=>{this.setState({openDialog:d})}),Oe(this,"setCursor",d=>{Fi(this.interactiveCanvas,d)}),Oe(this,"resetCursor",()=>{wf(this.interactiveCanvas)}),Oe(this,"isTouchScreenMultiTouchGesture",()=>Ci.pointers.size>=2),Oe(this,"getName",()=>this.state.name||this.props.name||`${ce("labels.untitled")}-${Tte()}`),Oe(this,"onGestureStart",Do(d=>{d.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:fi({},this.state),activeEmbeddable:null}),Ci.initialScale=this.state.zoom.value})),Oe(this,"onGestureChange",Do(d=>{if(d.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let h=Ci.initialScale;h&&this.setState(f=>({...D6({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Tm(h*d.scale)},f)}))})),Oe(this,"onGestureEnd",Do(d=>{d.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:fi(this.state.previousSelectedElementIds,this.state)}),Ci.initialScale=null})),Oe(this,"startTextEditing",({sceneX:d,sceneY:h,insertAtParentCenter:f=!0,container:p,autoEdit:m=!0})=>{let g=!1,y=f&&this.getTextWysiwygSnappedToCenterPosition(d,h,this.state,p);p&&y&&(hn(p,this.scene.getNonDeletedElementsMap())||(g=!0));let v=null,b=this.scene.getSelectedElements(this.state);b.length===1?er(b[0])?v=b[0]:p?v=hn(b[0],this.scene.getNonDeletedElementsMap()):v=this.getTextElementAtPosition(d,h):v=this.getTextElementAtPosition(d,h);let x=v?.fontFamily||this.state.currentItemFontFamily,E=v?.lineHeight||_b(x),w=this.state.currentItemFontSize;if(!v&&g&&p&&!An(p)){let S=Nte(Bi({fontSize:w,fontFamily:x}),E),R=Pte(w,E),U=Math.max(p.height,R),L=Math.max(p.width,S);kt(p,{height:U,width:L}),d=p.x+L/2,h=p.y+U/2,y&&(y=this.getTextWysiwygSnappedToCenterPosition(d,h,this.state,p))}let T=this.getTopLayerFrameAtSceneCoords({x:d,y:h}),C=v||pd({x:y?y.elementCenterX:d,y:y?y.elementCenterY:h,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:w,fontFamily:x,textAlign:y?"center":this.state.currentItemTextAlign,verticalAlign:y?hd.MIDDLE:iU,containerId:g?p?.id:void 0,groupIds:p?.groupIds??[],lineHeight:E,angle:p?.angle??0,frameId:T?T.id:null});if(!v&&g&&p&&kt(p,{boundElements:(p.boundElements||[]).concat({type:"text",id:C.id})}),this.setState({editingTextElement:C}),!v)if(p&&g){let S=this.scene.getElementIndex(p.id);this.scene.insertElementAtIndex(C,S+1)}else this.scene.insertElement(C);m||v||p?this.handleTextWysiwyg(C,{isExistingElement:!!v}):this.setState({newElement:C,multiElement:null})}),Oe(this,"startImageCropping",d=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:d.id})}),Oe(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),Oe(this,"handleCanvasDoubleClick",d=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let h=this.scene.getSelectedElements(this.state),{x:f,y:p}=ca(d,this.state);if(h.length===1&&dn(h[0])){if(d[qe.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==h[0].id)&&!ar(h[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new rr(h[0])});return}else if(this.state.selectedLinearElement&&ar(h[0])){let m=rr.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:f,y:p},this.state,this.scene.getNonDeletedElementsMap()),g=m?rr.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,m,this.scene.getNonDeletedElementsMap()):-1;if(g&&g>-1){this.store.shouldCaptureIncrement(),rr.deleteFixedSegment(h[0],g);let y=rr.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:f,y:p},this.state,this.scene.getNonDeletedElementsMap()),v=y?rr.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,y,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:v,value:m,added:!1}},segmentMidPointHoveredCoords:y}});return}}}if(h.length===1&&hi(h[0])){this.startImageCropping(h[0]);return}if(wf(this.interactiveCanvas),Ob(this.state).length>0){let m=this.getElementAtPosition(f,p),g=m&&PIe(m,this.state.selectedGroupIds);if(g){this.store.shouldCaptureIncrement(),this.setState(y=>({...y,...Rc({editingGroupId:g,selectedElementIds:{[m.id]:!0}},this.scene.getNonDeletedElements(),y,this)}));return}}if(wf(this.interactiveCanvas),!d[qe.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let m=this.getElementAtPosition(f,p);if(dh(m)){this.setState({activeEmbeddable:{element:m,state:"active"}});return}let g=this.getTextBindableContainerAtPosition(f,p);if(g&&(md(g)||!df(g.backgroundColor)||m5({x:f,y:p,element:g,shape:pm(g,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let y=jO(g,this.state,this.scene.getNonDeletedElementsMap());f=y.x,p=y.y}this.startTextEditing({sceneX:f,sceneY:p,insertAtParentCenter:!d.altKey,container:g})}}),Oe(this,"getElementLinkAtPosition",(d,h)=>{let f=this.scene.getNonDeletedElements(),p=-1;for(let m=f.length-1;m>=0;m--){let g=f[m];if(h&&g.id===h.id&&(p=m),g.link&&m>=p&&eB(g,this.scene.getNonDeletedElementsMap(),this.state,ne(d.x,d.y),this.device.editor.isMobile))return g}}),Oe(this,"redirectToLink",(d,h)=>{let f=di(ne(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),ne(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||f>Sb)return;let p=ca(this.lastPointerDownEvent,this.state),m=this.scene.getNonDeletedElementsMap(),g=eB(this.hitLinkElement,m,this.state,ne(p.x,p.y),this.device.editor.isMobile),y=ca(this.lastPointerUpEvent,this.state),v=eB(this.hitLinkElement,m,this.state,ne(y.x,y.y),this.device.editor.isMobile);if(g&&v){mAt();let b=this.hitLinkElement.link;if(b){b=fd(b);let x;if(this.props.onLinkOpen&&(x=Ate("excalidraw-link",d.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:b},x)),!x?.defaultPrevented){let E=qre(b)?"_self":"_blank",w=window.open(void 0,E);w&&(w.opener=null,w.location=b)}}}}),Oe(this,"getTopLayerFrameAtSceneCoords",d=>{let h=this.scene.getNonDeletedElementsMap(),f=this.scene.getNonDeletedFramesLikes().filter(p=>Tne(d,p,h));return f.length?f[f.length-1]:null}),Oe(this,"handleCanvasPointerMove",d=>{this.savePointer(d.clientX,d.clientY,this.state.cursorButton),this.lastPointerMoveEvent=d.nativeEvent,Ci.pointers.has(d.pointerId)&&Ci.pointers.set(d.pointerId,{x:d.clientX,y:d.clientY});let h=Ci.initialScale;if(Ci.pointers.size===2&&Ci.lastCenter&&h&&Ci.initialDistance){let x=kAt(Ci.pointers),E=x.x-Ci.lastCenter.x,w=x.y-Ci.lastCenter.y;Ci.lastCenter=x;let T=CAt(Array.from(Ci.pointers.values())),C=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:T/Ci.initialDistance,S=C?Tm(h*C):this.state.zoom.value;this.setState(R=>{let U=D6({viewportX:x.x,viewportY:x.y,nextZoom:S},R);this.translateCanvas({zoom:U.zoom,scrollX:U.scrollX+2*(E/S),scrollY:U.scrollY+2*(w/S),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else Ci.lastCenter=Ci.initialDistance=Ci.initialScale=null;if(L6||_D||B4e||c5(this.state))return;let f=IAt(F4e,d.clientX-this.state.offsetLeft,d.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(f?wf(this.interactiveCanvas):Wp(this.interactiveCanvas,this.state));let p=ca(d,this.state),{x:m,y:g}=p;if(!this.state.newElement&&qIe(this.state.activeTool.type)){let{originOffset:x,snapLines:E}=HIe(this.scene.getNonDeletedElements(),this,{x:m,y:g},d,this.scene.getNonDeletedElementsMap());this.setState(w=>{let T=vT(w.snapLines,E),C=w.originSnapOffset?vT(w.originSnapOffset,x):x;return w.snapLines===T&&w.originSnapOffset===C?null:{snapLines:T,originSnapOffset:C}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(x=>x.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let x=rr.handlePointerMove(d,m,g,this,this.scene.getNonDeletedElementsMap());x&&x!==this.state.editingLinearElement&&(0,iw.flushSync)(()=>{this.setState({editingLinearElement:x})}),x?.lastUncommittedPoint!=null?this.maybeSuggestBindingAtCursor(p,x.elbowed):(0,iw.flushSync)(()=>{this.setState({suggestedBindings:[]})})}if(Lte(this.state.activeTool.type)){let{newElement:x}=this.state;Lp(x,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(x,[p],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(p,!1)}if(this.state.multiElement){let{multiElement:x}=this.state,{x:E,y:w}=x,{points:T,lastCommittedPoint:C}=x,S=T[T.length-1];if(Wp(this.interactiveCanvas,this.state),S===C)di(ne(m-E,g-w),S)>=rU?kt(x,{points:[...T,ne(m-E,g-w)]},!1):Fi(this.interactiveCanvas,Ii.POINTER);else if(T.length>2&&C&&di(ne(m-E,g-w),C)1&&!f&&this.state.openDialog?.name!=="elementLinkSelector"){let x=Nne(mi(v),m,g,this.state.zoom,d.pointerType,this.device);if(x){Fi(this.interactiveCanvas,_ne({transformHandleType:x}));return}}let b=this.getElementAtPosition(p.x,p.y);this.hitLinkElement=this.getElementLinkAtPosition(p,b),!zp(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(Fi(this.interactiveCanvas,Ii.POINTER),jHr(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(mAt(),b&&(b.link||vu(b))&&this.state.selectedElementIds[b.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?Fi(this.interactiveCanvas,er(b)?Ii.TEXT:Ii.CROSSHAIR):this.state.viewModeEnabled?Fi(this.interactiveCanvas,Ii.GRAB):this.state.openDialog?.name==="elementLinkSelector"?Fi(this.interactiveCanvas,Ii.AUTO):f?Fi(this.interactiveCanvas,Ii.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,m,g):d[qe.CTRL_OR_CMD]?Fi(this.interactiveCanvas,Ii.AUTO):(b||this.isHittingCommonBoundingBoxOfSelectedElements(p,v))&&!b?.locked&&(b&&dh(b)&&this.isIframeLikeElementCenter(b,d,m,g)?(Fi(this.interactiveCanvas,Ii.POINTER),this.setState({activeEmbeddable:{element:b,state:"hover"}})):(!b||!ar(b))&&(Fi(this.interactiveCanvas,Ii.MOVE),this.state.activeEmbeddable?.state==="hover"&&this.setState({activeEmbeddable:null})))),this.state.openDialog?.name==="elementLinkSelector"&&b?this.setState(x=>({hoveredElementIds:vT(x.hoveredElementIds,Rc({editingGroupId:x.editingGroupId,selectedElementIds:{[b.id]:!0}},this.scene.getNonDeletedElements(),x,this).selectedElementIds)})):this.state.openDialog?.name==="elementLinkSelector"&&!b&&this.setState(x=>({hoveredElementIds:vT(x.hoveredElementIds,{})})))}),Oe(this,"handleEraser",(d,h,f)=>{this.eraserTrail.addPointToPath(f.x,f.y);let p=!1,m=new Set,g=this.scene.getNonDeletedElements(),y=w=>{for(let T of w){if(T.locked)return;if(d.altKey?this.elementsPendingErasure.delete(T.id)&&(p=!0):this.elementsPendingErasure.has(T.id)||(p=!0,this.elementsPendingErasure.add(T.id)),p&&T.groupIds?.length){let C=T.groupIds.at(-1);if(!m.has(C)){m.add(C);let S=ya(g,C);for(let R of S)d.altKey?this.elementsPendingErasure.delete(R.id):this.elementsPendingErasure.add(R.id)}}}},v=di(ne(h.lastCoords.x,h.lastCoords.y),ne(f.x,f.y)),b=this.getElementHitThreshold(),x={...h.lastCoords},E=0;for(;E<=v;){let w=this.getElementsAtPosition(x.x,x.y);if(y(w),E===v)break;E=Math.min(E+b,v);let T=E/v,C=(1-T)*x.x+T*f.x,S=(1-T)*x.y+T*f.y;x.x=C,x.y=S}if(h.lastCoords.x=f.x,h.lastCoords.y=f.y,p){for(let w of this.scene.getNonDeletedElements())ga(w)&&(this.elementsPendingErasure.has(w.id)||this.elementsPendingErasure.has(w.containerId))&&(d.altKey?(this.elementsPendingErasure.delete(w.id),this.elementsPendingErasure.delete(w.containerId)):(this.elementsPendingErasure.add(w.id),this.elementsPendingErasure.add(w.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),Oe(this,"handleTouchMove",d=>{PD=!0}),Oe(this,"handleCanvasPointerDown",d=>{let h=d.target;if(h.setPointerCapture&&h.setPointerCapture(d.pointerId),this.maybeCleanupAfterMissingPointerUp(d.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(b=>({searchMatches:b.searchMatches.map(x=>({...x,focus:!1}))})),W0.set(jUt,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(d),d.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let b=this.state.newElement;this.updateScene({...b.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(x=>x.id!==b.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:fi(Object.keys(this.state.selectedElementIds).filter(x=>x!==b.id).reduce((x,E)=>(x[E]=this.state.selectedElementIds[E],x),{}),this.state)},captureUpdate:this.state.openDialog?.name==="elementLinkSelector"?pt.EVENTUALLY:pt.NEVER});return}let f=document.getSelection();if(f?.anchorNode&&f.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(d),!this.state.penDetected&&d.pointerType==="pen"&&this.setState(b=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(d.pointerType)&&(this.device=fU(this.device,{isTouchScreen:!0})),_D||(this.lastPointerDownEvent=d,this.handleCanvasPanUsingWheelOrSpaceDrag(d)))return;if(this.setState({lastPointerDownWith:d.pointerType,cursorButton:"down"}),this.savePointer(d.clientX,d.clientY,"down"),d.button===z1.ERASER&&this.state.activeTool.type!==vs.eraser){this.setState({activeTool:Bo(this.state,{type:vs.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(d);let b=()=>{x(),E?.(),zp(this.state)&&this.setState({activeTool:Bo(this.state,{...this.state.activeTool.lastActiveTool||{type:vs.selection},lastActiveToolBeforeEraser:null})})},x=Ga(window,"pointerup",b,{once:!0}),E;requestAnimationFrame(()=>{E=this.missingPointerEventCleanupEmitter.once(b)})});return}if(d.button!==z1.MAIN&&d.button!==z1.TOUCH&&d.button!==z1.ERASER||Ci.pointers.size>1)return;let p=this.initialPointerDownState(d);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(d,p)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(d),this.handleSelectionOnPointerDown(d,p))||!(!this.state.penMode||d.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(d,p);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(d,this.state.activeTool.type,p);else if(this.state.activeTool.type==="image"){Fi(this.interactiveCanvas,Ii.CROSSHAIR);let b=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!b)return;this.setState({newElement:b,pendingImageElementId:null,multiElement:null});let{x,y:E}=ca(d,this.state),w=this.getTopLayerFrameAtSceneCoords({x,y:E});kt(b,{x,y:E,frameId:w?w.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(d,this.state.activeTool.type,p):this.state.activeTool.type==="custom"?Wp(this.interactiveCanvas,this.state):this.state.activeTool.type===vs.frame||this.state.activeTool.type===vs.magicframe?this.createFrameElementOnPointerDown(p,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(p.lastCoords.x,p.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,p);this.props?.onPointerDown?.(this.state.activeTool,p),this.onPointerDownEmitter.trigger(this.state.activeTool,p,d),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(p.lastCoords.x,p.lastCoords.y);let m=this.onPointerMoveFromPointerDownHandler(p),g=this.onPointerUpFromPointerDownHandler(p),y=this.onKeyDownFromPointerDownHandler(p),v=this.onKeyUpFromPointerDownHandler(p);this.missingPointerEventCleanupEmitter.once(b=>g(b||d.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",m),window.addEventListener("pointerup",g),window.addEventListener("keydown",y),window.addEventListener("keyup",v),p.eventListeners.onMove=m,p.eventListeners.onUp=g,p.eventListeners.onKeyUp=v,p.eventListeners.onKeyDown=y)}),Oe(this,"handleCanvasPointerUp",d=>{this.removePointer(d),this.lastPointerUpEvent=d;let h=ca({clientX:d.clientX,clientY:d.clientY},this.state),f=d.timeStamp-(this.lastPointerDownEvent?.timeStamp??0);if(this.device.editor.isMobile&&f<300){let p=this.getElementAtPosition(h.x,h.y);if(dh(p)&&this.isIframeLikeElementCenter(p,d,h.x,h.y)){this.handleEmbeddableCenterClick(p);return}}if(this.device.isTouchScreen){let p=this.getElementAtPosition(h.x,h.y);this.hitLinkElement=this.getElementLinkAtPosition(h,p)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?f<300&&dh(this.hitLinkElement)&&!ane(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,ne(h.x,h.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(d,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),Oe(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",d=>{d.pointerType==="touch"&&(PD=!1,nw?PD=!0:nw=window.setTimeout(()=>{nw=0,PD||this.handleCanvasContextMenu(d)},M8e))}),Oe(this,"resetContextMenuTimer",()=>{clearTimeout(nw),nw=0,PD=!1}),Oe(this,"maybeCleanupAfterMissingPointerUp",d=>{OD?.(),this.missingPointerEventCleanupEmitter.trigger(d).clear()}),Oe(this,"handleCanvasPanUsingWheelOrSpaceDrag",d=>{if(!(Ci.pointers.size<=1&&(d.button===z1.WHEEL||d.button===z1.MAIN&&L6||c5(this.state)||this.state.viewModeEnabled)))return!1;_D=!0,this.focusContainer(),this.state.editingTextElement||d.preventDefault();let h=!1,f=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);Fi(this.interactiveCanvas,Ii.GRABBING);let{clientX:p,clientY:m}=d,g=D4e(v=>{let b=p-v.clientX,x=m-v.clientY;if(p=v.clientX,m=v.clientY,f&&!h&&(Math.abs(b)>1||Math.abs(x)>1)){h=!0;let E=T=>{document.body.removeEventListener("paste",E),T.stopPropagation()},w=()=>{setTimeout(()=>{document.body.removeEventListener("paste",E),window.removeEventListener("pointerup",w)},100)};document.body.addEventListener("paste",E),window.addEventListener("pointerup",w)}this.translateCanvas({scrollX:this.state.scrollX-b/this.state.zoom.value,scrollY:this.state.scrollY-x/this.state.zoom.value})}),y=Do(OD=()=>{OD=null,_D=!1,L6||(this.state.viewModeEnabled?Fi(this.interactiveCanvas,Ii.GRAB):Wp(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(d.clientX,d.clientY,"up"),window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),g.flush()});return window.addEventListener("blur",y),window.addEventListener("pointermove",g,{passive:!0}),window.addEventListener("pointerup",y),!0}),Oe(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:fi({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),Oe(this,"handleSelectionOnPointerDown",(d,h)=>{if(this.state.activeTool.type==="selection"){let f=this.scene.getNonDeletedElements(),p=this.scene.getNonDeletedElementsMap(),m=this.scene.getSelectedElements(this.state);if(m.length===1&&!this.state.editingLinearElement&&!ar(m[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let g=Dne(f,this.state,h.origin.x,h.origin.y,this.state.zoom,d.pointerType,this.scene.getNonDeletedElementsMap(),this.device);g!=null&&(g.transformHandleType==="rotation"?(this.setState({resizingElement:g.element}),h.resize.handleType=g.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:g.element}),h.resize.handleType=g.transformHandleType))}else m.length>1&&(h.resize.handleType=Nne(mi(m),h.origin.x,h.origin.y,this.state.zoom,d.pointerType,this.device));if(h.resize.handleType)h.resize.isResizing=!0,h.resize.offset=hf(qRe(h.resize.handleType,m,p,h.origin.x,h.origin.y)),m.length===1&&dn(m[0])&&m[0].points.length===2&&(h.resize.arrowDirection=YRe(h.resize.handleType,m[0]));else{if(this.state.selectedLinearElement){let v=this.state.editingLinearElement||this.state.selectedLinearElement,b=rr.handlePointerDown(d,this,this.store,h.origin,v,this.scene);if(b.hitElement&&(h.hit.element=b.hitElement),b.linearElementEditor&&(this.setState({selectedLinearElement:b.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:b.linearElementEditor})),b.didAddPoint)return!0}if(h.hit.element=h.hit.element??this.getElementAtPosition(h.origin.x,h.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(h.origin,h.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&h.hit.element?.id!==this.state.croppingElementId&&this.finishImageCropping(),h.hit.element&&this.getElementLinkAtPosition({x:h.origin.x,y:h.origin.y},h.hit.element))return!1;h.hit.allHitElements=this.getElementsAtPosition(h.origin.x,h.origin.y);let g=h.hit.element,y=h.hit.allHitElements.some(v=>this.isASelectedElement(v));if((g===null||!y)&&!d.shiftKey&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(g),this.state.editingLinearElement)this.setState({selectedElementIds:fi({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(g!=null){if(d[qe.CTRL_OR_CMD])return this.state.selectedElementIds[g.id]||(h.hit.wasAddedToSelection=!0),this.setState(v=>({..._Ie(v,g),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[g.id]||(this.state.editingGroupId&&!kT(g,this.state.editingGroupId)&&this.setState({selectedElementIds:fi({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!y&&!h.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(v=>{let b={...v.selectedElementIds,[g.id]:!0},x=[];if(Object.keys(v.selectedElementIds).forEach(E=>{let w=this.scene.getElement(E);w&&x.push(w)}),qr(g))Yp(x,g.id).forEach(E=>{delete b[E.id]});else if(g.frameId)b[g.frameId]&&delete b[g.id];else{let E=g.groupIds,w=new Set(E.flatMap(T=>ya(this.scene.getNonDeletedElements(),T)).filter(T=>qr(T)).map(T=>T.id));w.size>0&&x.forEach(T=>{T.frameId&&w.has(T.frameId)&&(delete b[T.id],T.groupIds.flatMap(C=>ya(this.scene.getNonDeletedElements(),C)).forEach(C=>{delete b[C.id]}))})}return v.openDialog?.name==="elementLinkSelector"&&(g.groupIds.some(E=>v.selectedGroupIds[E])||(b={[g.id]:!0})),{...Rc({editingGroupId:v.editingGroupId,selectedElementIds:b},this.scene.getNonDeletedElements(),v,this),showHyperlinkPopup:g.link||vu(g)?"info":!1}}),h.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),Oe(this,"handleTextOnPointerDown",(d,h)=>{if(this.state.editingTextElement)return;let f=h.origin.x,p=h.origin.y,m=this.getElementAtPosition(f,p,{includeBoundTextElement:!0}),g=this.getTextBindableContainerAtPosition(f,p);md(m)&&(g=m,f=m.x+m.width/2,p=m.y+m.height/2),this.startTextEditing({sceneX:f,sceneY:p,insertAtParentCenter:!d.altKey,container:g,autoEdit:!1}),wf(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:Bo(this.state,{type:"selection"})})}),Oe(this,"handleFreeDrawElementOnPointerDown",(d,h,f)=>{let[p,m]=os(f.origin.x,f.origin.y,null),g=this.getTopLayerFrameAtSceneCoords({x:p,y:m}),y=d.pressure===.5,v=iRe({type:h,x:p,y:m,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:y,locked:!1,frameId:g?g.id:null,points:[ne(0,0)],pressures:y?[]:[d.pressure]});this.scene.insertElement(v),this.setState(x=>{let E={...x.selectedElementIds};return delete E[v.id],{selectedElementIds:fi(E,x)}});let b=vf(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:v,startBoundElement:b,suggestedBindings:[]})}),Oe(this,"insertIframeElement",({sceneX:d,sceneY:h,width:f,height:p})=>{let[m,g]=os(d,h,this.lastPointerDownEvent?.[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=rRe({type:"iframe",x:m,y:g,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:f,height:p});return this.scene.insertElement(y),y}),Oe(this,"insertEmbeddableElement",({sceneX:d,sceneY:h,link:f})=>{let[p,m]=os(d,h,this.lastPointerDownEvent?.[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=v5(f);if(!g)return;g.error instanceof URIError&&this.setToast({message:ce("toast.unrecognizedLinkFormat"),closable:!0});let y=Xre({type:"embeddable",x:p,y:m,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:g.intrinsicSize.w,height:g.intrinsicSize.h,link:f});return this.scene.insertElement(y),y}),Oe(this,"createImageElement",({sceneX:d,sceneY:h,addToFrameUnderCursor:f=!0})=>{let[p,m]=os(d,h,this.lastPointerDownEvent?.[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=f?this.getTopLayerFrameAtSceneCoords({x:p,y:m}):null;return Kre({type:"image",x:p,y:m,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:g?g.id:null})}),Oe(this,"handleLinearElementOnPointerDown",(d,h,f)=>{if(this.state.multiElement){let{multiElement:p}=this.state;if(p.type==="line"&&mm(p.points,this.state.zoom.value)){kt(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(z0);return}if(ar(p)&&p.points.length>1){kt(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(z0);return}let{x:m,y:g,lastCommittedPoint:y}=p;if(p.points.length>1&&y&&di(ne(f.origin.x-m,f.origin.y-g),y)({selectedElementIds:fi({...v.selectedElementIds,[p.id]:!0},v)})),kt(p,{lastCommittedPoint:p.points[p.points.length-1]}),Fi(this.interactiveCanvas,Ii.POINTER)}else{let[p,m]=os(f.origin.x,f.origin.y,d[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=this.getTopLayerFrameAtSceneCoords({x:p,y:m}),{currentItemStartArrowhead:y,currentItemEndArrowhead:v}=this.state,[b,x]=h==="arrow"?[y,v]:[null,null],E=h==="arrow"?KO({type:h,x:p,y:m,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===Xs.round?{type:as.PROPORTIONAL_RADIUS}:null,startArrowhead:b,endArrowhead:x,locked:!1,frameId:g?g.id:null,elbowed:this.state.currentItemArrowType===Xs.elbow,fixedSegments:this.state.currentItemArrowType===Xs.elbow?[]:null}):bb({type:h,x:p,y:m,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:as.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:g?g.id:null});this.setState(T=>{let C={...T.selectedElementIds};return delete C[E.id],{selectedElementIds:fi(C,T)}}),kt(E,{points:[...E.points,ne(0,0)]});let w=vf(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,ar(E),ar(E));this.scene.insertElement(E),this.setState({newElement:E,startBoundElement:w,suggestedBindings:[]})}}),Oe(this,"createGenericElementOnPointerDown",(d,h)=>{let[f,p]=os(h.origin.x,h.origin.y,this.lastPointerDownEvent?.[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=this.getTopLayerFrameAtSceneCoords({x:f,y:p}),g={x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(d),locked:!1,frameId:m?m.id:null},y;d==="embeddable"?y=Xre({type:"embeddable",...g}):y=Hp({type:d,...g}),y.type==="selection"?this.setState({selectionElement:y}):(this.scene.insertElement(y),this.setState({multiElement:null,newElement:y}))}),Oe(this,"createFrameElementOnPointerDown",(d,h)=>{let[f,p]=os(d.origin.x,d.origin.y,this.lastPointerDownEvent?.[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m={x:f,y:p,opacity:this.state.currentItemOpacity,locked:!1,...Ca},g=h===vs.magicframe?$O(m):XO(m);this.scene.insertElement(g),this.setState({multiElement:null,newElement:g})}),Oe(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),Oe(this,"eraseElements",()=>{let d=!1,h=this.scene.getElementsIncludingDeleted().map(f=>this.elementsPendingErasure.has(f.id)||f.frameId&&this.elementsPendingErasure.has(f.frameId)||ga(f)&&this.elementsPendingErasure.has(f.containerId)?(d=!0,Tn(f,{isDeleted:!0})):f);this.elementsPendingErasure=new Set,d&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(h))}),Oe(this,"initializeImage",async({imageFile:d,imageElement:h,showCursorImagePreview:f=!1})=>{if(!Fb(d))throw new Error(ce("errors.unsupportedFileType"));let p=d.type;if(Fi(this.interactiveCanvas,"wait"),p===Mr.svg)try{d=qne(ine(await d.text()),d.name)}catch(v){throw console.warn(v),new Error(ce("errors.svgImageInsertError"))}let m=await(this.props.generateIdForFile?.(d)||rMe(d));if(!m)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(ce("errors.imageInsertError"));if(!this.files[m]?.dataURL){try{d=await EB(d,{maxWidthOrHeight:B8e})}catch(v){console.error("Error trying to resizing image file on insertion",v)}if(d.size>gte)throw new Error(ce("errors.fileTooBig",{maxSize:`${Math.trunc(gte/1024/1024)}MB`}))}if(f){let v=this.files[m]?.dataURL,b=v&&iMe(v);this.setImagePreviewCursor(b||d)}let g=this.files[m]?.dataURL||await Hne(d),y=kt(h,{fileId:m},!1);return new Promise(async(v,b)=>{try{this.addMissingFiles([{mimeType:p,id:m,dataURL:g,created:Date.now(),lastRetrieved:Date.now()}]);let x=this.imageCache.get(m);x||(this.addNewImagesToImageCache(),await this.updateImageCache([y])),x?.image instanceof Promise&&await x.image,this.state.pendingImageElementId!==y.id&&this.state.newElement?.id!==y.id&&this.initializeImageDimensions(y,!0),v(y)}catch(x){console.error(x),b(new Error(ce("errors.imageInsertError")))}finally{f||wf(this.interactiveCanvas)}})}),Oe(this,"insertImageElement",async(d,h,f)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:ce("errors.imageToolNotSupported")});return}this.scene.insertElement(d);try{return await this.initializeImage({imageFile:h,imageElement:d,showCursorImagePreview:f})}catch(p){return kt(d,{isDeleted:!0}),this.actionManager.executeAction(z0),this.setState({errorMessage:p.message||ce("errors.imageInsertError")}),null}}),Oe(this,"setImagePreviewCursor",async d=>{let h;try{h=await EB(d,{maxWidthOrHeight:96})}catch(p){throw p.cause==="UNSUPPORTED"?new Error(ce("errors.unsupportedFileType")):p}let f=await Hne(h);if(d.type===Mr.svg){let p=await tne(f),m=Math.min(p.height,96),g=m*(p.width/p.height);g>96&&(g=96,m=g*(p.height/p.width));let y=document.createElement("canvas");y.height=m,y.width=g,y.getContext("2d").drawImage(p,0,0,g,m),f=y.toDataURL(Mr.svg)}this.state.pendingImageElementId&&Fi(this.interactiveCanvas,`url(${f}) 4 4, auto`)}),Oe(this,"onImageAction",async({insertOnCanvasDirectly:d})=>{try{let h=this.state.width/2+this.state.offsetLeft,f=this.state.height/2+this.state.offsetTop,{x:p,y:m}=ca({clientX:h,clientY:f},this.state),g=await QO({description:"Image",extensions:Object.keys(o5)}),y=this.createImageElement({sceneX:p,sceneY:m,addToFrameUnderCursor:!1});d?(this.insertImageElement(y,g),this.initializeImageDimensions(y),this.setState({selectedElementIds:fi({[y.id]:!0},this.state)},()=>{this.actionManager.executeAction(z0)})):this.setState({pendingImageElementId:y.id},()=>{this.insertImageElement(y,g,!0)})}catch(h){h.name!=="AbortError"?console.error(h):console.warn(h),this.setState({pendingImageElementId:null,newElement:null,activeTool:Bo(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(z0)})}}),Oe(this,"initializeImageDimensions",(d,h=!1)=>{let f=mh(d)&&this.imageCache.get(d.fileId)?.image;if(!f||f instanceof Promise){if(d.width{let{updatedFiles:f,erroredFiles:p}=await rne({imageCache:this.imageCache,fileIds:d.map(m=>m.fileId),files:h});if(f.size||p.size)for(let m of d)f.has(m.fileId)&&za.delete(m);return p.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(m=>mh(m)&&p.has(m.fileId)?Tn(m,{status:"error"}):m)),{updatedFiles:f,erroredFiles:p}}),Oe(this,"addNewImagesToImageCache",async(d=nne(this.scene.getNonDeletedElements()),h=this.files)=>{let f=d.filter(p=>!p.isDeleted&&!this.imageCache.has(p.fileId));if(f.length){let{updatedFiles:p}=await this.updateImageCache(f,h);p.size&&this.scene.triggerUpdate()}}),Oe(this,"scheduleImageRefresh",(0,E9t.default)(()=>{this.addNewImagesToImageCache()},I8e)),Oe(this,"updateBindingEnabledOnPointerMove",d=>{let h=RIe(d);this.state.isBindingEnabled!==h&&this.setState({isBindingEnabled:h})}),Oe(this,"maybeSuggestBindingAtCursor",(d,h)=>{let f=vf(d,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,h);this.setState({suggestedBindings:f!=null?[f]:[]})}),Oe(this,"maybeSuggestBindingsForLinearElementAtCoords",(d,h,f)=>{if(!h.length)return;let p=h.reduce((m,g)=>{let y=vf(g,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,ar(d),ar(d));return y!=null&&!Mre(d,f?.id,y)&&m.push(y),m},[]);this.setState({suggestedBindings:p})}),Oe(this,"handleInteractiveCanvasRef",d=>{d!==null?(this.interactiveCanvas=d,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):(this.interactiveCanvas?.removeEventListener("touchstart",this.onTouchStart),this.interactiveCanvas?.removeEventListener("touchend",this.onTouchEnd))}),Oe(this,"handleAppOnDrop",async d=>{let{file:h,fileHandle:f}=await sMe(d),{x:p,y:m}=ca(d,this.state);try{if(Fb(h)&&this.isToolSupported("image")){if(h?.type===Mr.png||h?.type===Mr.svg)try{let v=await Wne(h,this.state,this.scene.getElementsIncludingDeleted(),f);this.syncActionResult({...v,appState:{...v.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:pt.IMMEDIATELY});return}catch(v){if(v.name!=="EncodingError")throw new Error(ce("alerts.couldNotLoadInvalidFile"))}let y=this.createImageElement({sceneX:p,sceneY:m});this.insertImageElement(y,h),this.initializeImageDimensions(y),this.setState({selectedElementIds:fi({[y.id]:!0},this.state)});return}}catch(y){return this.setState({isLoading:!1,errorMessage:y.message})}let g=d.dataTransfer.getData(Mr.excalidrawlib);if(g&&typeof g=="string"){try{let y=Vne(g);this.addElementsFromPasteOrLibrary({elements:b8t(y),position:d,files:null})}catch(y){this.setState({errorMessage:y.message})}return}if(h&&await this.loadFileToCanvas(h,f),d.dataTransfer?.types?.includes("text/plain")){let y=d.dataTransfer?.getData("text");if(y&&RU(y,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(y)||v5(y)?.type==="video")){let v=this.insertEmbeddableElement({sceneX:p,sceneY:m,link:fd(y)});v&&this.setState({selectedElementIds:{[v.id]:!0}})}}}),Oe(this,"loadFileToCanvas",async(d,h)=>{d=await TB(d);try{let f=this.scene.getElementsIncludingDeleted(),p;try{p=await Gne(d,this.state,f,h)}catch(m){let g=m instanceof gb;if(g&&m.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:ce("errors.imageToolNotSupported")});return}let y=ce(g?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:y})}if(!p)return;p.type===Mr.excalidraw?(Cm(f.concat(p.data.elements)),this.store.updateSnapshot(Hr(f),this.state),this.setState({isLoading:!0}),this.syncActionResult({...p.data,appState:{...p.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:pt.IMMEDIATELY})):p.type===Mr.excalidrawlib&&await this.library.updateLibrary({libraryItems:d,merge:!0,openLibraryMenu:!0}).catch(m=>{console.error(m),this.setState({errorMessage:ce("errors.importLibraryError")})})}catch(f){this.setState({isLoading:!1,errorMessage:f.message})}}),Oe(this,"handleCanvasContextMenu",d=>{if(d.preventDefault(),("pointerType"in d.nativeEvent&&d.nativeEvent.pointerType==="touch"||"pointerType"in d.nativeEvent&&d.nativeEvent.pointerType==="pen"&&d.button!==z1.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:h,y:f}=ca(d,this.state),p=this.getElementAtPosition(h,f,{preferSelected:!0,includeLockedElements:!0}),m=this.scene.getSelectedElements(this.state),g=this.isHittingCommonBoundingBoxOfSelectedElements({x:h,y:f},m),y=p||g?"element":"canvas",v=this.excalidrawContainerRef.current,{top:b,left:x}=v.getBoundingClientRect(),E=d.clientX-x,w=d.clientY-b;pa("contextMenu","openContextMenu",y),this.setState({...p&&!this.state.selectedElementIds[p.id]?{...this.state,...Rc({editingGroupId:this.state.editingGroupId,selectedElementIds:{[p.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:dn(p)?new rr(p):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:w,left:E,items:this.getContextMenuItems(y)}})})}),Oe(this,"maybeDragNewGenericElement",(d,h,f=!0)=>{let p=this.state.selectionElement,m=d.lastCoords;if(p&&this.state.activeTool.type!=="eraser"){Bne({newElement:p,elementType:this.state.activeTool.type,originX:d.origin.x,originY:d.origin.y,x:m.x,y:m.y,width:Ql(d.origin.x,m.x),height:Ql(d.origin.y,m.y),shouldMaintainAspectRatio:wT(h),shouldResizeFromCenter:LO(h),zoom:this.state.zoom.value,informMutation:f});return}let g=this.state.newElement;if(!g)return;let[y,v]=os(m.x,m.y,h[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),b=mh(g)&&this.imageCache.get(g.fileId)?.image,x=b&&!(b instanceof Promise)?b.width/b.height:null;this.maybeCacheReferenceSnapPoints(h,[g]);let{snapOffset:E,snapLines:w}=VIe(g,this,h,{x:d.originInGrid.x+(this.state.originSnapOffset?.x??0),y:d.originInGrid.y+(this.state.originSnapOffset?.y??0)},{x:y-d.originInGrid.x,y:v-d.originInGrid.y},this.scene.getNonDeletedElementsMap());y+=E.x,v+=E.y,this.setState({snapLines:w}),Bne({newElement:g,elementType:this.state.activeTool.type,originX:d.originInGrid.x,originY:d.originInGrid.y,x:y,y:v,width:Ql(d.originInGrid.x,y),height:Ql(d.originInGrid.y,v),shouldMaintainAspectRatio:hi(g)?!wT(h):wT(h),shouldResizeFromCenter:LO(h),zoom:this.state.zoom.value,widthAspectRatio:x,originOffset:this.state.originSnapOffset,informMutation:f}),this.setState({newElement:g}),(this.state.activeTool.type===vs.frame||this.state.activeTool.type===vs.magicframe)&&this.setState({elementsToHighlight:NU(this.scene.getNonDeletedElements(),g,this.state,this.scene.getNonDeletedElementsMap())})}),Oe(this,"maybeHandleCrop",(d,h)=>{if(!this.state.croppingElementId)return!1;let f=d.resize.handleType,p=d.lastCoords,[m,g]=os(p.x-d.resize.offset.x,p.y-d.resize.offset.y,h[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(f&&y&&hi(y)){let v=d.originalElements.get(y.id),b=mh(y)&&this.imageCache.get(y.fileId)?.image;if(v&&hi(v)&&b&&!(b instanceof Promise)){let[x,E]=os(p.x,p.y,h[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:x-d.originInGrid.x,y:E-d.originInGrid.y};this.maybeCacheReferenceSnapPoints(h,[y]);let{snapOffset:T,snapLines:C}=Wre([y],[v],this,h,w,f);kt(y,mIe(y,f,b.naturalWidth,b.naturalHeight,m+T.x,g+T.y,h.shiftKey?v.width/v.height:void 0)),gu(y,this.scene.getNonDeletedElementsMap(),{newSize:{width:y.width,height:y.height}}),this.setState({isCropping:f&&f!=="rotation",snapLines:C})}return!0}return!1}),Oe(this,"maybeHandleResize",(d,h)=>{let f=this.scene.getSelectedElements(this.state),p=f.filter(x=>qr(x)),m=d.resize.handleType;if(p.length>0&&m==="rotation"||f.length===1&&ar(f[0])||this.state.croppingElementId)return!1;this.setState({isResizing:m&&m!=="rotation",isRotating:m==="rotation",activeEmbeddable:null});let g=d.lastCoords,[y,v]=os(g.x-d.resize.offset.x,g.y-d.resize.offset.y,h[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),b=new Map;if(p.forEach(x=>{Yp(this.scene.getNonDeletedElements(),x.id).forEach(E=>{b.set(x.id+E.id,{x:E.x-x.x,y:E.y-x.y})})}),!this.state.selectedElementsAreBeingDragged){let[x,E]=os(g.x,g.y,h[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:x-d.originInGrid.x,y:E-d.originInGrid.y},T=[...d.originalElements.values()];this.maybeCacheReferenceSnapPoints(h,f);let{snapOffset:C,snapLines:S}=Wre(f,Un(T,this.state),this,h,w,m);y+=C.x,v+=C.y,this.setState({snapLines:S})}if(HRe(d.originalElements,m,f,this.scene.getElementsMapIncludingDeleted(),this.scene,oT(h),LO(h),f.some(x=>hi(x))?!wT(h):wT(h),y,v,d.resize.center.x,d.resize.center.y)){let x=GO(f,this.scene.getNonDeletedElementsMap(),this.state.zoom),E=new Set;return p.forEach(w=>{NU(this.scene.getNonDeletedElements(),w,this.state,this.scene.getNonDeletedElementsMap()).forEach(T=>E.add(T))}),this.setState({elementsToHighlight:[...E],suggestedBindings:x}),!0}return!1}),Oe(this,"getContextMenuItems",d=>{let h=[];return h.push(dAt,uAt),d==="canvas"?this.state.viewModeEnabled?[...h,fAt,X4e,jAt,$4e]:[lAt,fl,dAt,uAt,hAt,fl,RVr,ZHr,fl,fAt,BHr,X4e,jAt,$4e]:(h.push(hAt),this.state.viewModeEnabled?[gK,...h]:[fl,cAt,gK,lAt,fl,wXr,EXr,TXr,fl,pYr,fl,...h,fl,THr,kHr,fl,SHr,l$r,FHr,zHr,VHr,AHr,fl,MHr,fl,SVr,AVr,UVr,IVr,fl,_Hr,PHr,fl,fYr,fl,f8t,W8t,fl,NVr,KHr,fl,h7t])}),Oe(this,"handleWheel",Do(d=>{if(!(d.target instanceof HTMLCanvasElement||d.target instanceof HTMLTextAreaElement||d.target instanceof HTMLIFrameElement)){d[qe.CTRL_OR_CMD]&&d.preventDefault();return}if(d.preventDefault(),_D)return;let{deltaX:h,deltaY:f}=d;if(d.metaKey||d.ctrlKey){let p=Math.sign(f),m=sU*100,g=Math.abs(f),y=f;g>m&&(y=m*p);let v=this.state.zoom.value-y/100;v+=Math.log10(Math.max(1,this.state.zoom.value))*-p*Math.min(1,g/20),this.translateCanvas(b=>({...D6({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Tm(v)},b),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(d.shiftKey){this.translateCanvas(({zoom:p,scrollX:m})=>({scrollX:m-(f||h)/p.value}));return}this.translateCanvas(({zoom:p,scrollX:m,scrollY:g})=>({scrollX:m-h/p.value,scrollY:g-f/p.value}))})),Oe(this,"savePointer",(d,h,f)=>{if(!d||!h)return;let{x:p,y:m}=ca({clientX:d,clientY:h},this.state);isNaN(p)||isNaN(m);let g={x:p,y:m,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};this.props.onPointerUpdate?.({pointer:g,button:f,pointersMap:Ci.pointers})}),Oe(this,"resetShouldCacheIgnoreZoomDebounced",d5(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),Oe(this,"updateDOMRect",d=>{if(this.excalidrawContainerRef?.current){let h=this.excalidrawContainerRef.current,{width:f,height:p,left:m,top:g}=h.getBoundingClientRect(),{width:y,height:v,offsetTop:b,offsetLeft:x}=this.state;if(f===y&&p===v&&m===x&&g===b){d&&d();return}this.setState({width:f,height:p,offsetLeft:m,offsetTop:g},()=>{d&&d()})}}),Oe(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let r=Fp(),{excalidrawAPI:n,viewModeEnabled:i=!1,zenModeEnabled:a=!1,gridModeEnabled:o=!1,objectsSnapModeEnabled:s=!1,theme:l=r.theme,name:u=`${ce("labels.untitled")}-${Tte()}`}=t;if(this.state={...r,theme:l,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:a,objectsSnapModeEnabled:s,gridModeEnabled:o??r.gridModeEnabled,name:u,width:window.innerWidth,height:window.innerHeight},this.id=FE(),this.library=new sqr(this),this.actionManager=new vYr(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new vm,this.canvas=document.createElement("canvas"),this.rc=lf.canvas(this.canvas),this.renderer=new e7t(this.scene),this.visibleElements=[],this.store=new cRe,this.history=new TAt,n){let d={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:h=>{this.actionManager.registerAction(h)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:h=>this.onChangeEmitter.on(h),onPointerDown:h=>this.onPointerDownEmitter.on(h),onPointerUp:h=>this.onPointerUpEmitter.on(h),onScrollChange:h=>this.onScrollChangeEmitter.on(h),onUserFollow:h=>this.onUserFollowEmitter.on(h)};typeof n=="function"?n(d):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new Em(this.scene),this.history=new TAt,this.actionManager.registerAll(JP),this.actionManager.registerAction(gYr(this.history,this.store)),this.actionManager.registerAction(yYr(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let r=null;try{r=JSON.parse(t.data)}catch{}if(r)switch(t.origin){case"https://player.vimeo.com":if(r.method==="paused"){let n=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let a of i)a.contentWindow===t.source&&(n=a.contentWindow);n?.postMessage(JSON.stringify({method:r.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(r.event==="infoDelivery"&&r.info&&r.id&&typeof r.info.playerState=="number"){let n=r.id,i=r.info.playerState;Object.values(nU).includes(i)&&z4e.set(n,i)}break}}cacheEmbeddableRef(t,r){r&&this.iFrameRefs.set(t.id,r)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){if(this.state.activeEmbeddable?.element===t&&this.state.activeEmbeddable?.state==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),W1(t)))return;let r=this.getHTMLIFrameElement(t);if(r?.contentWindow){if(r.src.includes("youtube")){let n=z4e.get(t.id);switch(n||(z4e.set(t.id,nU.UNSTARTED),r.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),n){case nU.PLAYING:case nU.BUFFERING:r.contentWindow?.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:r.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}r.src.includes("player.vimeo.com")&&r.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,r,n,i){return t&&!r.altKey&&!r.shiftKey&&!r.metaKey&&!r.ctrlKey&&(this.state.activeEmbeddable?.element!==t||this.state.activeEmbeddable?.state==="hover"||!this.state.activeEmbeddable)&&n>=t.x+t.width/3&&n<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,r=this.state.width,n=this.state.height,i=this.scene.getNonDeletedElements().filter(a=>vu(a)&&this.embedsValidationStatus.get(a.id)===!0||W1(a));return(0,Xn.jsx)(Xn.Fragment,{children:i.map(a=>{let{x:o,y:s}=mf({sceneX:a.x,sceneY:a.y},this.state),l=BU(a,r,n,this.state,this.scene.getNonDeletedElementsMap()),u=this.initializedEmbeds.has(a.id);if(l&&!u&&this.initializedEmbeds.add(a.id),!(l||u))return null;let d;if(W1(a)){d=null;let p=(a.customData?.generationData??this.magicGenerations.get(a.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(p.status==="done"){let m=p.html;d={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>m}}else if(p.status==="pending")d={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>nT(` - -

    - - - -
    -
    Generating...
    - `)};else{let m;p.code==="ERR_GENERATION_INTERRUPTED"?m="Generation was interrupted...":m=p.message||"Generation failed",d={intrinsicSize:{w:a.width,h:a.height},type:"document",srcdoc:()=>nT(` - -

    Error!

    -

    ${m}

    - `)}}}else d=v5(Yre(a.link||""));let h=this.state.activeEmbeddable?.element===a&&this.state.activeEmbeddable?.state==="active",f=this.state.activeEmbeddable?.element===a&&this.state.activeEmbeddable?.state==="hover";return(0,Xn.jsx)("div",{className:St("excalidraw__embeddable-container",{"is-hovered":f}),style:{transform:l?`translate(${o-this.state.offsetLeft}px, ${s-this.state.offsetTop}px) scale(${t})`:"none",display:l?"block":"none",opacity:Ere(a,yu(a,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,this.state.openDialog?.name==="elementLinkSelector"?bte:1),"--embeddable-radius":`${ff(Math.min(a.width,a.height),a)}px`},children:(0,Xn.jsxs)("div",{className:"excalidraw__embeddable-container__inner",style:{width:l?`${a.width}px`:0,height:l?`${a.height}px`:0,transform:l?`rotate(${a.angle}rad)`:"none",pointerEvents:h?i5.enabled:i5.disabled},children:[f&&(0,Xn.jsx)("div",{className:"excalidraw__embeddable-hint",children:ce("buttons.embeddableInteractionButton")}),(0,Xn.jsx)("div",{className:"excalidraw__embeddable__outer",style:{padding:`${a.strokeWidth}px`},children:(vu(a)?this.props.renderEmbeddable?.(a,this.state):null)??(0,Xn.jsx)("iframe",{ref:p=>this.cacheEmbeddableRef(a,p),className:"excalidraw__embeddable",srcDoc:d?.type==="document"?d.srcdoc(this.state.theme):void 0,src:d?.type!=="document"?d?.link??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${d?.sandbox?.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},a.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:r,renderCustomStats:n}=this.props,i=this.scene.getSceneNonce(),{elementsMap:a,visibleElements:o}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:this.state.newElement?.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=o;let s=this.scene.getNonDeletedElementsMap(),l="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",u=t[0];return(0,Xn.jsx)("div",{className:St("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":l?i5.disabled:i5.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:(0,Xn.jsx)(_9t.Provider,{value:this,children:(0,Xn.jsx)(P9t.Provider,{value:this.props,children:(0,Xn.jsx)(W3e.Provider,{value:this.excalidrawContainerValue,children:(0,Xn.jsx)(G3e.Provider,{value:this.device,children:(0,Xn.jsx)(q3e.Provider,{value:this.setAppState,children:(0,Xn.jsx)(H3e.Provider,{value:this.state,children:(0,Xn.jsxs)(V3e.Provider,{value:this.scene.getNonDeletedElements(),children:[(0,Xn.jsxs)(Y3e.Provider,{value:this.actionManager,children:[(0,Xn.jsx)(vXr,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:qD().code,renderTopRightUI:r,renderCustomStats:n,showExitZenModeBtn:typeof this.props?.zenModeEnabled>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),(0,Xn.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,Xn.jsx)("div",{className:"excalidraw-contextMenuContainer"}),(0,Xn.jsx)("div",{className:"excalidraw-eye-dropper-container"}),(0,Xn.jsx)(QXr,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&this.state.openDialog?.name!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&(0,Xn.jsx)(YHr,{element:u,elementsMap:s,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},u.id),this.props.aiEnabled!==!1&&t.length===1&&mU(u)&&(0,Xn.jsx)(t7t,{element:u,elementsMap:a,children:(0,Xn.jsx)(P4e,{title:ce("labels.convertToCode"),icon:fre,checked:!1,onChange:()=>this.onMagicFrameGenerate(u,"button")})}),t.length===1&&W1(u)&&u.customData?.generationData?.status==="done"&&(0,Xn.jsxs)(t7t,{element:u,elementsMap:a,children:[(0,Xn.jsx)(P4e,{title:ce("labels.copySource"),icon:AO,checked:!1,onChange:()=>this.onIframeSrcCopy(u)}),(0,Xn.jsx)(P4e,{title:"Enter fullscreen",icon:A9e,checked:!1,onChange:()=>{let d=this.getHTMLIFrameElement(u);if(d)try{d.requestFullscreen(),this.setState({activeEmbeddable:{element:u,state:"active"},selectedElementIds:{[u.id]:!0},newElement:null,selectionElement:null})}catch(h){console.warn(h),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&(0,Xn.jsx)(xXr,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&(0,Xn.jsx)(xYr,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:d=>{this.setState({contextMenu:null},()=>{this.focusContainer(),d?.()})}}),(0,Xn.jsx)(ZXr,{canvas:this.canvas,rc:this.rc,elementsMap:a,allElementsMap:s,visibleElements:o,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:CT(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&(0,Xn.jsx)(f$r,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:a,allElementsMap:s,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),(0,Xn.jsx)(XXr,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:a,visibleElements:o,allElementsMap:s,selectedElements:t,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&(0,Xn.jsx)(n$r,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,r){let n=this.plugins.diagramToCode?.generate;if(!n){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=fB(this.scene.getNonDeletedElements(),t).filter(o=>!mU(o));if(!i.length){r==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),pa("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let a=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(a){this.updateMagicGeneration({frameElement:a,data:{status:"pending"}}),this.setState({selectedElementIds:{[a.id]:!0}}),pa("ai","generate (start)","d2c");try{let{html:o}=await n({frame:t,children:i});if(pa("ai","generate (success)","d2c"),!o.trim()){this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let s=o.includes("")&&o.includes("")?o.slice(o.indexOf(""),o.indexOf("")+7):o;this.updateMagicGeneration({frameElement:a,data:{status:"done",html:s}})}catch(o){pa("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:a,data:{status:"error",code:"ERR_OAI",message:o.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){t.customData?.generationData?.status==="done"&&(RT(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let r=t??this.files;this.scene.getNonDeletedElements().forEach(n=>{mh(n)&&r[n.fileId]&&(this.imageCache.delete(n.fileId),za.delete(n))})}async componentDidMount(){if(this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,en.MODE===mu.TEST||en.DEV){let t=this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...r)=>this.setState(...r)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})}this.store.onStoreIncrementEmitter.on(t=>{this.history.record(t.elementsChange,t.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),xm()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),aO&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),this.resizeObserver?.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),b8e()&&!fUe()&&this.setState({errorMessage:(0,Xn.jsx)(CXr,{})})}componentWillUnmount(){window.launchQueue?.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new vm,this.fonts=new Em(this.scene),this.renderer=new e7t(this.scene),this.files={},this.imageCache.clear(),this.resizeObserver?.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),za.destroy(),km.destroy(),clearTimeout(nw),ss.clearCache(),Rc.clearCache(),nw=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(Ga(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(Ga(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Ga(window,"message",this.onWindowMessage,!1),Ga(document,"pointerup",this.removePointer,{passive:!1}),Ga(document,"copy",this.onCopy,{passive:!1}),Ga(document,"keyup",this.onKeyUp,{passive:!0}),Ga(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),Ga(document.fonts,"loadingdone",t=>{let r=t.fontfaces;this.fonts.onLoaded(r)},{passive:!1}),Ga(document,"gesturestart",this.onGestureStart,!1),Ga(document,"gesturechange",this.onGestureChange,!1),Ga(document,"gestureend",this.onGestureEnd,!1),Ga(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(Ga(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),Ga(document,"paste",this.pasteFromClipboard,{passive:!1}),Ga(document,"cut",this.onCut,{passive:!1}),Ga(window,"resize",this.onResize,!1),Ga(window,"unload",this.onUnload,!1),Ga(window,"blur",this.onBlur,!1),Ga(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Ga(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),Ga(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(Ga(rUe(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,r){this.updateEmbeddables();let n=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),a=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!n.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),r.userToFollow&&!this.state.collaborators.has(r.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(r.zoom.value!==this.state.zoom.value||r.scrollX!==this.state.scrollX||r.scrollY!==this.state.scrollY)&&(this.props?.onScrollChange?.(this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),r.userToFollow!==this.state.userToFollow&&(r.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:r.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&zp(this.state)&&this.setState({activeTool:Bo(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&r.theme!==this.state.theme&&jre(this.interactiveCanvas,this.state.theme),r.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),zp(r)&&!zp(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),r.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(r.openDialog?.name==="elementLinkSelector"||this.state.openDialog?.name==="elementLinkSelector")&&r.openDialog?.name!==this.state.openDialog?.name&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),this.excalidrawContainerRef.current?.classList.toggle("theme--dark",this.state.theme===Gn.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(z0)}),this.state.editingTextElement?.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:o}=r;r.activeTool!==this.state.activeTool&&o!=null&&Tb(this.state)&&Lp(o,!1)&&WO(o,this.state,hf(rr.getPointAtIndexGlobalCoordinates(o,-1,a)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||(this.props.onChange?.(n,this.state,this.files),this.onChangeEmitter.trigger(n,this.state,this.files))}static resetTapTwice(){ND=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:r,sceneX:n,sceneY:i}){if(!r&&t.some(a=>a.type==="imageUrl")&&this.isToolSupported("image")){let a=t.filter(h=>h.type==="imageUrl").map(h=>h.value),o=await Promise.all(a.map(async h=>{try{return{file:await oMe(h)}}catch(f){let p=f.message;return f.cause==="FETCH_ERROR"?p=ce("errors.failedToFetchImage"):f.cause==="UNSUPPORTED"&&(p=ce("errors.unsupportedFileType")),{errorMessage:p}}})),s=i,l=!1,u={};for(let h of o)if(h.file){let f=this.createImageElement({sceneX:n,sceneY:s}),p=await this.insertImageElement(f,h.file);p&&(l||(l=!0,s-=p.height/2),kt(p,{y:s},!1),s=f.y+f.height+25,u[f.id]=!0)}this.setState({selectedElementIds:fi(u,this.state)});let d=o.find(h=>!!h.errorMessage);d&&d.errorMessage&&this.setState({errorMessage:d.errorMessage})}else{let a=t.filter(o=>o.type==="text");a.length&&this.addTextFromPaste(a.map(o=>o.value).join(` - -`),r)}}addTextFromPaste(t,r=!1){let{x:n,y:i}=ca({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),a={x:n,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:hT,verticalAlign:iU,locked:!1},o=Bi({fontSize:a.fontSize,fontFamily:a.fontFamily}),s=_b(a.fontFamily),[l,,u]=IIe(this.state),d=Math.max(Math.min((u-l)*.5,800),200),h=10,f=i,p=r?[t]:t.split(` -`),m=p.reduce((g,y,v)=>{let b=f5(y).trim();if(b.length){let x=this.getTopLayerFrameAtSceneCoords({x:n,y:f}),E=Jl(b,o,s),w=E.width>d,T=w?Lb(b,o,d):b;E=w?Jl(T,o,s):E;let C=n-E.width/2,S=f-E.height/2,R=pd({...a,x:C,y:S,text:T,originalText:b,lineHeight:s,autoResize:!w,frameId:x?x.id:null});g.push(R),f+=R.height+h}else p[v-1]?.trim()&&(f+=bT(a.fontSize,s)+h);return g},[]);m.length!==0&&(this.scene.insertElements(m),this.setState({selectedElementIds:fi(Object.fromEntries(m.map(g=>[g.id,!0])),this.state)}),!r&&m.length>1&&n7t===!1&&!this.device.editor.isMobile&&(this.setToast({message:ce("toast.pasteAsSingleElement",{shortcut:Tt("CtrlOrCmd+Shift+V")}),duration:5e3}),n7t=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:r=!1}){let n=this.scene.getElementsMapIncludingDeleted(),i=(a,o)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(s=>s.id===t.id&&er(s)?Tn(s,{originalText:a,isDeleted:o??s.isDeleted,...$re(s,$s(s,n),n,a)}):s)])};s$r({id:t.id,canvas:this.canvas,getViewportCoords:(a,o)=>{let{x:s,y:l}=mf({sceneX:a,sceneY:o},this.state);return[s-this.state.offsetLeft,l-this.state.offsetTop]},onChange:Do(a=>{i(a,!1),xB(t)&&gu(t,this.scene.getNonDeletedElementsMap())}),onSubmit:Do(({viaKeyboard:a,nextOriginalText:o})=>{let s=!o.trim();if(i(o,s),!s&&a){let l=t.containerId?t.containerId:t.id;(0,iw.flushSync)(()=>{this.setState(u=>({selectedElementIds:fi({...u.selectedElementIds,[l]:!0},u)}))})}s&&Dre(this.scene.getNonDeletedElements(),[t]),(!s||r)&&this.store.shouldCaptureIncrement(),(0,iw.flushSync)(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&Wp(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:fi({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,r){let n=this.getElementAtPosition(t,r,{includeBoundTextElement:!0});return n&&er(n)&&!n.isDeleted?n:null}getElementAtPosition(t,r,n){let i=this.getElementsAtPosition(t,r,n?.includeBoundTextElement,n?.includeLockedElements);if(i.length>1){if(n?.preferSelected){for(let o=i.length-1;o>-1;o--)if(this.state.selectedElementIds[i[o].id])return i[o]}let a=i[i.length-1];return m5({x:t,y:r,element:a,shape:pm(a,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:qr(a)?this.frameNameBoundsCache.get(a):null})?a:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,r,n=!1,i=!1){let a=[],o=this.scene.getNonDeletedElementsMap();return(n&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(s=>(i||!s.locked)&&(n||!(er(s)&&s.containerId)))).filter(s=>this.hitElement(t,r,s)).filter(s=>{let l=yu(s,o);return l&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?Tne({x:t,y:r},l,o):!0}).filter(s=>W1(s)?(a.push(s),!1):!0).concat(a)}getElementHitThreshold(){return C8e/this.state.zoom.value}hitElement(t,r,n,i=!0){if(i&&this.state.selectedElementIds[n.id]&&Lne([n],this.state)){let a=nIe(n,this.scene.getNonDeletedElementsMap(),hi(n)?0:this.getElementHitThreshold());if(Z8(ne(t,r),a))return!0}return xre(t,r,wre(n,this.scene.getNonDeletedElementsMap()))?!0:m5({x:t,y:r,element:n,shape:pm(n,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:qr(n)?this.frameNameBoundsCache.get(n):null})}getTextBindableContainerAtPosition(t,r){let n=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return Mb(i[0],!1)?i[0]:null;let a=null;for(let o=n.length-1;o>=0;--o){if(n[o].isDeleted)continue;let[s,l,u,d]=un(n[o],this.scene.getNonDeletedElementsMap());if(An(n[o])&&m5({x:t,y:r,element:n[o],shape:pm(n[o],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){a=n[o];break}else if(s=0)||s?Fi(this.interactiveCanvas,Ii.POINTER):this.hitElement(r,n,a)&&Fi(this.interactiveCanvas,Ii.MOVE)):this.hitElement(r,n,a)&&(!ar(a)||!(a.startBinding||a.endBinding))&&Fi(this.interactiveCanvas,Ii.MOVE),this.state.selectedLinearElement.hoverPointIndex!==o&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:o}}),rr.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,s)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:s}})}else Fi(this.interactiveCanvas,Ii.AUTO)}updateGestureOnPointerDown(t){Ci.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),Ci.pointers.size===2&&(Ci.lastCenter=kAt(Ci.pointers),Ci.initialScale=this.state.zoom.value,Ci.initialDistance=CAt(Array.from(Ci.pointers.values())))}initialPointerDownState(t){let r=ca(t,this.state),n=this.scene.getSelectedElements(this.state),[i,a,o,s]=mi(n),l=n.findIndex(ar)===0;return{origin:r,withCmdOrCtrl:t[qe.CTRL_OR_CMD],originInGrid:hf(os(r.x,r.y,t[qe.CTRL_OR_CMD]||l?null:this.getEffectiveGridSize())),scrollbars:IAt(F4e,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...r},originalElements:this.scene.getNonDeletedElements().reduce((u,d)=>(u.set(d.id,Bb(d)),u),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+i)/2,y:(s+a)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(r,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,r){if(!(r.scrollbars.isOverEither&&!this.state.multiElement))return!1;B4e=!0,r.lastCoords.x=t.clientX,r.lastCoords.y=t.clientY;let n=D4e(a=>{a.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(a,r)}),i=Do(()=>{OD=null,B4e=!1,Wp(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",i),n.flush()});return OD=i,window.addEventListener("pointermove",n),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,r){if(r.length<2)return!1;let n=this.getElementHitThreshold(),[i,a,o,s]=mi(r);return t.x>i-n&&t.xa-n&&t.y{this.maybeHandleResize(t,r)||this.maybeDragNewGenericElement(t,r)})}onKeyUpFromPointerDownHandler(t){return Do(r=>{r.key===qe.ALT&&r.preventDefault(),!this.maybeHandleResize(t,r)&&this.maybeDragNewGenericElement(t,r)})}onPointerMoveFromPointerDownHandler(t){return D4e(r=>{if(this.state.openDialog?.name==="elementLinkSelector")return;let n=ca(r,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[d,h]=os(n.x,n.y,r[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),f=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(f<0){let m=rr.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:d,y:h},this.state,this.scene.getNonDeletedElementsMap());f=m?rr.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,m,this.scene.getNonDeletedElementsMap()):-1}let p=rr.moveFixedSegment(this.state.selectedLinearElement,f,d,h,this.scene.getNonDeletedElementsMap());(0,iw.flushSync)(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:p.segmentMidPointHoveredCoords,pointerDownState:p.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=n,t.drag.offset===null&&(t.drag.offset=hf(XRe(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(r.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(r,t))return;if(zp(this.state)){this.handleEraser(r,t,n);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(n.x,n.y);let[a,o]=os(n.x,n.y,r[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&di(ne(n.x,n.y),ne(t.origin.x,t.origin.y)){this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:h.pointerDownState,selectedPointsIndices:h.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:h.pointerDownState,selectedPointsIndices:h.selectedPointsIndices}})});return}else if(d.pointerDownState.segmentMidpoint.value!==null&&!d.pointerDownState.segmentMidpoint.added)return;if(rr.handlePointDragging(r,this,n.x,n.y,(h,f)=>{this.maybeSuggestBindingsForLinearElementAtCoords(h,f)},d,this.scene)){t.lastCoords.x=n.x,t.lastCoords.y=n.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let l=t.hit.allHitElements.some(d=>this.isASelectedElement(d)),u=this.state.editingLinearElement&&r.shiftKey&&this.state.editingLinearElement.elementId===t.hit.element?.id;if((l||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!u){let d=this.scene.getSelectedElements(this.state);if(d.every(m=>m.locked))return;let h=d.find(m=>qr(m)),f=this.getTopLayerFrameAtSceneCoords(n),p=f&&!h?f:null;if(this.state.frameToHighlight!==p&&(0,iw.flushSync)(()=>{this.setState({frameToHighlight:p})}),t.drag.hasOccurred=!0,d.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&this.state.activeEmbeddable?.state!=="active"){let m={x:n.x-t.origin.x,y:n.y-t.origin.y},g=[...t.originalElements.values()],y=r.shiftKey;if(y){let x=Math.abs(m.x),E=Math.abs(m.y),w=y&&xE;w&&(m.x=0),T&&(m.y=0)}if(this.state.croppingElementId){let x=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(x&&hi(x)&&x.crop!==null&&t.hit.element===x){let E=x.crop,w=mh(x)&&this.imageCache.get(x.fileId)?.image;if(w&&!(w instanceof Promise)){let T=no(wl(n.x-i.x,n.y-i.y),Math.max(this.state.zoom.value,2)),[C,S,R,U,L,I]=un(x,s),A=br(ht(ne(C,S),ne(L,I),x.angle)),P=br(ht(ne(R,S),ne(L,I),x.angle)),D=br(ht(ne(C,U),ne(L,I),x.angle)),M=Zl(j8(P,A)),O=Zl(j8(D,A)),_=wl(xte(T,M),xte(T,O)),B={...E,x:Nn(E.x-_[0]*Math.sign(x.scale[0]),0,w.naturalWidth-E.width),y:Nn(E.y-_[1]*Math.sign(x.scale[1]),0,w.naturalHeight-E.height)};kt(x,{crop:B});return}}}this.maybeCacheVisibleGaps(r,d),this.maybeCacheReferenceSnapPoints(r,d);let{snapOffset:v,snapLines:b}=WIe(g,m,this,r,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:b}),this.state.editingFrame||jRe(t,d,m,this.scene,v,r[qe.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(d.length!==1||!ar(d[0]))&&this.setState({suggestedBindings:GO(d,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),r.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let x=[],E=[],w=new Map,T=new Map,C=t.hit.element,S=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(L=>L.id)),R=this.scene.getElementsIncludingDeleted();for(let L of R){let I=S.has(L.id)||L.id===C?.id&&t.hit.wasAddedToSelection;if(Math.abs(L.x)>1e7||Math.abs(L.x)>1e7||Math.abs(L.width)>1e7||Math.abs(L.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",L.x,L.y,L.width,L.height,I);return}if(I){let A=Zre(this.state.editingGroupId,w,L);if(Math.abs(A.x)>1e7||Math.abs(A.x)>1e7||Math.abs(A.width)>1e7||Math.abs(A.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",A.x,A.y,A.width,A.height);return}let P=t.originalElements.get(L.id);if(Math.abs(P.x)>1e7||Math.abs(P.x)>1e7||Math.abs(P.width)>1e7||Math.abs(P.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",P.x,P.y,P.width,P.height);return}kt(A,{x:P.x,y:P.y}),t.originalElements.set(A.id,A),x.push(A),E.push(L),T.set(L.id,A.id)}else x.push(L)}let U=[...x,...E];U=this.props.onDuplicate?.(U,R)||U,Op(U,Hr(E)),Hre(x,E,T),Lre(U,E,T,"duplicatesServeAsOld"),xne(U,E,T),this.scene.replaceAllElements(U),this.maybeCacheVisibleGaps(r,d,!0),this.maybeCacheReferenceSnapPoints(r,d,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=n.x,t.lastCoords.y=n.y,this.maybeDragNewGenericElement(t,r);else{let d=this.state.newElement;if(!d)return;if(d.type==="freedraw"){let h=d.points,f=n.x-d.x,p=n.y-d.y,m=h.length>0&&h[h.length-1];if(!(m&&m[0]===f&&m[1]===p)){let g=d.simulatePressure?d.pressures:[...d.pressures,r.pressure];kt(d,{points:[...h,ne(f,p)],pressures:g},!1),this.setState({newElement:d})}}else if(dn(d)){t.drag.hasOccurred=!0;let h=d.points,f=a-d.x,p=o-d.y;oT(r)&&h.length===2&&({width:f,height:p}=gB(d.x,d.y,n.x,n.y)),h.length===1?kt(d,{points:[...h,ne(f,p)]},!1):(h.length===2||h.length>1&&ar(d))&&kt(d,{points:[...h.slice(0,-1),ne(f,p)]},!1,{isDragging:!0}),this.setState({newElement:d}),Lp(d,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(d,[n],this.state.startBoundElement)}else t.lastCoords.x=n.x,t.lastCoords.y=n.y,this.maybeDragNewGenericElement(t,r,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let d=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)rr.handleBoxSelection(r,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let h=!0;!r.shiftKey&&ss(d,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(p=>Rc({...p,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),p,this)):h=!1);let f=this.state.selectionElement?mB(d,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(p=>{let m={...h&&p.selectedElementIds,...f.reduce((g,y)=>(g[y.id]=!0,g),{})};return t.hit.element&&(f.length?delete m[t.hit.element.id]:m[t.hit.element.id]=!0),p=h?p:{...p,selectedGroupIds:{},editingGroupId:null},{...Rc({editingGroupId:p.editingGroupId,selectedElementIds:m},this.scene.getNonDeletedElements(),p,this),selectedLinearElement:f.length===1&&dn(f[0])?new rr(f[0]):null,showHyperlinkPopup:f.length===1&&(f[0].link||vu(f[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,r){if(r.scrollbars.isOverHorizontal){let n=t.clientX,i=n-r.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),r.lastCoords.x=n,!0}if(r.scrollbars.isOverVertical){let n=t.clientY,i=n-r.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),r.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(t){return Do(r=>{this.removePointer(r),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:n,resizingElement:i,croppingElementId:a,multiElement:o,activeTool:s,isResizing:l,isRotating:u,isCropping:d}=this.state;this.setState(g=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:vT(g.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,km.setReferenceSnapPoints(null),km.setVisibleGaps(null),this.savePointer(r.clientX,r.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let h=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&t.hit?.element?.id){let g=h.get(t.hit.element.id);yf(g)&&g.boundElements?.filter(y=>y.type==="arrow").map(y=>h.get(y.id)).filter(y=>ar(y)).forEach(y=>{y&&kt(y,{},!0)})}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&t.hit?.element?.id!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(z0);else{let g=rr.handlePointerUp(r,this.state.editingLinearElement,this.state,this.scene);g!==this.state.editingLinearElement&&this.setState({editingLinearElement:g,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let g=rr.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());g&&kt(g,{},!0)}if(t.hit?.element?.id!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let g=rr.handlePointerUp(r,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:y,endBindingElement:v}=g,b=this.scene.getElement(g.elementId);Lp(b)&&kU(b,y,v,h,this.scene),g!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...g,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),this.props?.onPointerUp?.(s,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,r),n?.type==="freedraw"){let g=ca(r,this.state),y=n.points,v=g.x-n.x,b=g.y-n.y;v===y[0][0]&&b===y[0][1]&&(b+=1e-4,v+=1e-4);let x=n.simulatePressure?[]:[...n.pressures,r.pressure];kt(n,{points:[...y,ne(v,b)],pressures:x,lastCommittedPoint:ne(v,b)}),this.actionManager.executeAction(z0);return}if(hi(n)){let g=n;try{this.initializeImageDimensions(g),this.setState({selectedElementIds:fi({[g.id]:!0},this.state)},()=>{this.actionManager.executeAction(z0)})}catch(y){console.error(y),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(v=>v.id!==g.id)),this.actionManager.executeAction(z0)}return}if(dn(n)){n.points.length>1&&this.store.shouldCaptureIncrement();let g=ca(r,this.state);!t.drag.hasOccurred&&n&&!o?(kt(n,{points:[...n.points,ne(g.x-n.x,g.y-n.y)]}),this.setState({multiElement:n,newElement:n})):t.drag.hasOccurred&&!o&&(Tb(this.state)&&Lp(n,!1)&&WO(n,this.state,g,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),s.locked?this.setState(y=>({newElement:null})):(wf(this.interactiveCanvas),this.setState(y=>({newElement:null,activeTool:Bo(this.state,{type:"selection"}),selectedElementIds:fi({...y.selectedElementIds,[n.id]:!0},y),selectedLinearElement:new rr(n)}))),this.scene.triggerUpdate());return}if(er(n)){let g=gO(Bi({fontSize:n.fontSize,fontFamily:n.fontFamily}),n.lineHeight);n.widthg.id!==n.id),appState:{newElement:null},captureUpdate:pt.NEVER});return}if(qr(n)){let g=BRe(this.scene.getElementsIncludingDeleted(),n,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(LT(this.scene.getElementsMapIncludingDeleted(),g,n,this.state))}if(n&&(kt(n,Ine(n)),this.scene.triggerUpdate()),t.drag.hasOccurred){let g=ca(r,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let y=this.scene.getElement(this.state.selectedLinearElement.elementId);if(y?.frameId){let v=yu(y,h);v&&y&&(F1(y,v,this.scene.getNonDeletedElementsMap())||(kt(y,{groupIds:[]}),_U([y],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let y=this.getTopLayerFrameAtSceneCoords(g),v=this.scene.getSelectedElements(this.state),b=this.scene.getElementsMapIncludingDeleted(),x=E=>{if(E.length>0){for(let w of E){let T=w.groupIds.indexOf(this.state.editingGroupId);kt(w,{groupIds:w.groupIds.slice(0,T)},!1)}b.forEach(w=>{w.groupIds.length&&ya(b,w.groupIds[w.groupIds.length-1]).length<2&&kt(w,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(y&&!this.state.selectedElementIds[y.id]){let E=v.filter(w=>w.frameId!==y.id&&PU(w,b,this.state));this.state.editingGroupId&&x(E),b=LT(b,E,y,this.state)}else if(!y&&this.state.editingGroupId){let E=v.filter(w=>w.frameId&&!PU(w,b,this.state));x(E)}b=x5(b,this.state,this),this.scene.replaceAllElements(b)}}if(i&&this.store.shouldCaptureIncrement(),i&&w5(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(g=>g.id!==i.id),captureUpdate:pt.NEVER}),t.resize.isResizing){let g=x5(this.scene.getElementsIncludingDeleted(),this.state,this),y=this.scene.getSelectedElements(this.state).filter(v=>qr(v));for(let v of y)g=Cne(g,NU(this.scene.getElementsIncludingDeleted(),v,this.state,h),v,this);this.scene.replaceAllElements(g)}let f=t.hit.element;this.state.selectedLinearElement?.elementId!==f?.id&&dn(f)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new rr(f)}),(!a||a&&(!f&&!d||f&&f.id!==a))&&this.finishImageCropping();let p=this.lastPointerDownEvent,m=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(zp(this.state)&&p&&m){if(this.eraserTrail.endPath(),di(ne(p.clientX,p.clientY),ne(m.clientX,m.clientY))===0){let g=ca({clientX:m.clientX,clientY:m.clientY},this.state);this.getElementsAtPosition(g.x,g.y).forEach(y=>this.elementsPendingErasure.add(y.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(f&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(r.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[f.id]?Ore(this.state,f)?this.setState(g=>{let y={...g.selectedElementIds};for(let v of f.groupIds.flatMap(b=>ya(this.scene.getNonDeletedElements(),b)))delete y[v.id];return{selectedGroupIds:{...g.selectedElementIds,...f.groupIds.map(v=>({[v]:!1})).reduce((v,b)=>({...v,...b}),{})},selectedElementIds:fi(y,g)}}):this.state.selectedLinearElement?.isDragging||this.setState(g=>{let y={...g.selectedElementIds};delete y[f.id];let v=Un(this.scene.getNonDeletedElements(),{selectedElementIds:y});return{...Rc({editingGroupId:g.editingGroupId,selectedElementIds:y},this.scene.getNonDeletedElements(),g,this),selectedLinearElement:v.length===1&&dn(v[0])?new rr(v[0]):g.selectedLinearElement}}):f.frameId&&this.state.selectedElementIds[f.frameId]?this.setState(g=>{let y={...g.selectedElementIds,[f.id]:!0};return delete y[f.frameId],(this.scene.getElement(f.frameId)?.groupIds??[]).flatMap(v=>ya(this.scene.getNonDeletedElements(),v)).forEach(v=>{delete y[v.id]}),{...Rc({editingGroupId:g.editingGroupId,selectedElementIds:y},this.scene.getNonDeletedElements(),g,this),showHyperlinkPopup:f.link||vu(f)?"info":!1}}):this.setState(g=>({selectedElementIds:fi({...g.selectedElementIds,[f.id]:!0},g)})):this.setState(g=>({...Rc({editingGroupId:g.editingGroupId,selectedElementIds:{[f.id]:!0}},this.scene.getNonDeletedElements(),g,this),selectedLinearElement:dn(f)&&g.selectedLinearElement?.elementId!==f.id?new rr(f):g.selectedLinearElement}))),!(f&&ar(f))&&!t.drag.hasOccurred&&!this.state.isResizing&&(f&&cIe({x:t.origin.x,y:t.origin.y,element:f,shape:pm(f,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:qr(f)?this.frameNameBoundsCache.get(f):null},h)||!f&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:fi({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),Fi(this.interactiveCanvas,Ii.AUTO);return}if(!s.locked&&s.type!=="freedraw"&&n&&this.setState(g=>({selectedElementIds:fi({...g.selectedElementIds,[n.id]:!0},g),showHyperlinkPopup:vu(n)&&!n.link?"editor":g.showHyperlinkPopup})),(s.type!=="selection"||ss(this.scene.getNonDeletedElements(),this.state)||!El(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||l||u||d){let g=this.scene.getSelectedElements(this.state).filter(dn);CU(g,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Tb(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom)}if(s.type==="laser"){this.laserTrails.endPath();return}!s.locked&&s.type!=="freedraw"?(wf(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:Bo(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),f&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&Ci.pointers.size<=1&&dh(f)&&this.isIframeLikeElementCenter(f,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(f)})}clearSelection(t){this.setState(r=>({selectedElementIds:fi({},r),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:r.editingGroupId&&t!=null&&kT(t,r.editingGroupId)?r.editingGroupId:null})),this.setState({selectedElementIds:fi({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,r,n,i){if(i){let a=i.x+i.width/2,o=i.y+i.height/2,s=jO(i,n,this.scene.getNonDeletedElementsMap());if(s&&(a=s.x,o=s.y),Math.hypot(t-a,r-o)r.code===this.props.langCode)||n7;await o7t(t),this.setAppState({})}},m$r=()=>{(en.MODE===mu.TEST||en.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app?.scene.getElementsIncludingDeleted()},set(e){return this.app?.scene.replaceAllElements(Cm(e))}},scene:{configurable:!0,get(){return this.app?.scene}}}))};m$r();var g$r=p$r,y$r=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},v$r=y$r,b$r=({children:e})=>{let{FooterCenterTunnel:t}=Qu(),r=Ec();return(0,m3e.jsx)(t.In,{children:(0,m3e.jsx)("div",{className:St("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":r.zenModeEnabled}),children:e})})};b$r.displayName="FooterCenter";var x$r=()=>(0,lp.jsx)("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:(0,lp.jsx)("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),w$r=()=>(0,lp.jsxs)("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[(0,lp.jsx)("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),(0,lp.jsx)("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),(0,lp.jsx)("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),(0,lp.jsx)("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),E$r=({style:e,size:t="small",withText:r})=>(0,lp.jsxs)("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[(0,lp.jsx)(x$r,{}),r&&(0,lp.jsx)(w$r,{})]}),j3e=({icon:e,shortcut:t,children:r})=>{let n=gl();return(0,ma.jsxs)(ma.Fragment,{children:[(0,ma.jsx)("div",{className:"welcome-screen-menu-item__icon",children:e}),(0,ma.jsx)("div",{className:"welcome-screen-menu-item__text",children:r}),t&&!n.editor.isMobile&&(0,ma.jsx)("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};j3e.displayName="WelcomeScreenMenuItemContent";var gN=({onSelect:e,children:t,icon:r,shortcut:n,className:i="",...a})=>(0,ma.jsx)("button",{...a,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:(0,ma.jsx)(j3e,{icon:r,shortcut:n,children:t})});gN.displayName="WelcomeScreenMenuItem";var F9t=({children:e,href:t,icon:r,shortcut:n,className:i="",...a})=>(0,ma.jsx)("a",{...a,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:(0,ma.jsx)(j3e,{icon:r,shortcut:n,children:e})});F9t.displayName="WelcomeScreenMenuItemLink";var Z0=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=Qu();return(0,ma.jsx)(t.In,{children:(0,ma.jsx)("div",{className:"welcome-screen-center",children:e||(0,ma.jsxs)(ma.Fragment,{children:[(0,ma.jsx)(X3e,{}),(0,ma.jsx)($3e,{children:ce("welcomeScreen.defaults.center_heading")}),(0,ma.jsxs)(K3e,{children:[(0,ma.jsx)(Q3e,{}),(0,ma.jsx)(Z3e,{})]})]})})})};Z0.displayName="Center";var X3e=({children:e})=>(0,ma.jsx)("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||(0,ma.jsx)(E$r,{withText:!0})});X3e.displayName="Logo";var $3e=({children:e})=>(0,ma.jsx)("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});$3e.displayName="Heading";var K3e=({children:e})=>(0,ma.jsx)("div",{className:"welcome-screen-menu",children:e});K3e.displayName="Menu";var Z3e=()=>{let e=Qd();return(0,ma.jsx)(gN,{onSelect:()=>e.executeAction(S3e),shortcut:"?",icon:TO,children:ce("helpDialog.title")})};Z3e.displayName="MenuItemHelp";var Q3e=()=>{let e=Ec(),t=Qd();return e.viewModeEnabled?null:(0,ma.jsx)(gN,{onSelect:()=>t.executeAction(Y4e),shortcut:iu("loadScene"),icon:CO,children:ce("buttons.load")})};Q3e.displayName="MenuItemLoadScene";var z9t=({onSelect:e})=>{let{t}=au();return(0,ma.jsx)(gN,{shortcut:null,onSelect:e,icon:nre,children:t("labels.liveCollaboration")})};z9t.displayName="MenuItemLiveCollaborationTrigger";Z0.Logo=X3e;Z0.Heading=$3e;Z0.Menu=K3e;Z0.MenuItem=gN;Z0.MenuItemLink=F9t;Z0.MenuItemHelp=Z3e;Z0.MenuItemLoadScene=Q3e;Z0.MenuItemLiveCollaborationTrigger=z9t;var J3e=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=Qu();return(0,$0.jsx)(t.In,{children:(0,$0.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[vUe,(0,$0.jsx)("div",{className:"welcome-screen-decor-hint__label",children:e||ce("welcomeScreen.defaults.menuHint")})]})})};J3e.displayName="MenuHint";var e6e=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=Qu();return(0,$0.jsx)(t.In,{children:(0,$0.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[(0,$0.jsx)("div",{className:"welcome-screen-decor-hint__label",children:e||ce("welcomeScreen.defaults.toolbarHint")}),xUe]})})};e6e.displayName="ToolbarHint";var t6e=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=Qu();return(0,$0.jsx)(t.In,{children:(0,$0.jsxs)("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[(0,$0.jsx)("div",{children:e||ce("welcomeScreen.defaults.helpHint")}),bUe]})})};t6e.displayName="HelpHint";var dZ=e=>(0,G0.jsx)(G0.Fragment,{children:e.children||(0,G0.jsxs)(G0.Fragment,{children:[(0,G0.jsx)(Z0,{}),(0,G0.jsx)(J3e,{}),(0,G0.jsx)(e6e,{}),(0,G0.jsx)(t6e,{})]})});dZ.displayName="WelcomeScreen";dZ.Center=Z0;dZ.Hints={MenuHint:J3e,ToolbarHint:e6e,HelpHint:t6e};var vw=dZ,T$r=({isCollaborating:e,onSelect:t,...r})=>{let n=Ec(),i=n.width<830;return(0,hZ.jsxs)(X6,{...r,className:St("collab-button",{active:e}),type:"button",onSelect:t,style:{position:"relative",width:i?void 0:"auto"},title:ce("labels.liveCollaboration"),children:[i?NUe:ce("labels.share"),n.collaborators.size>0&&(0,hZ.jsx)("div",{className:"CollabButton-collaborators",children:n.collaborators.size})]})};T$r.displayName="LiveCollaborationTrigger";var qjn=(0,G9t.default)((e,t,r)=>{if(en.DEV||en.MODE===mu.TEST||window?.DEBUG_FRACTIONAL_INDICES){let n=Cm(e.map(i=>({...i})));ZO(n,{shouldThrow:en.DEV||en.MODE===mu.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:r}})}},1e3*60,{leading:!0,trailing:!1});var k$r=({children:e,icon:t})=>{let{TTDDialogTriggerTunnel:r}=Qu(),n=Bs();return(0,uN.jsx)(r.In,{children:(0,uN.jsxs)(wa.Item,{onSelect:()=>{pa("ai","dialog open","ttd"),n({openDialog:{name:"ttd",tab:"text-to-diagram"}})},icon:t??I9e,children:[e??ce("labels.textToDiagram"),(0,uN.jsx)(wa.Item.Badge,{children:"AI"})]})})};k$r.displayName="TTDDialogTrigger";v$r();var S$r=e=>{let{onChange:t,initialData:r,excalidrawAPI:n,isCollaborating:i=!1,onPointerUpdate:a,renderTopRightUI:o,langCode:s=n7.code,viewModeEnabled:l,zenModeEnabled:u,gridModeEnabled:d,libraryReturnUrl:h,theme:f,name:p,renderCustomStats:m,onPaste:g,detectScroll:y=!0,handleKeyboardGlobally:v=!1,onLibraryChange:b,autoFocus:x=!1,generateIdForFile:E,onLinkOpen:w,generateLinkForSelection:T,onPointerDown:C,onPointerUp:S,onScrollChange:R,onDuplicate:U,children:L,validateEmbeddable:I,renderEmbeddable:A,aiEnabled:P,showDeprecatedFonts:D}=e,M=e.UIOptions?.canvasActions,O={...e.UIOptions,canvasActions:{...mte.canvasActions,...M},tools:{image:e.UIOptions?.tools?.image??!0}};return M?.export&&(O.canvasActions.export.saveFileToDisk=M.export?.saveFileToDisk??mte.canvasActions.export.saveFileToDisk),O.canvasActions.toggleTheme===null&&typeof f>"u"&&(O.canvasActions.toggleTheme=!0),(0,UK.useEffect)(()=>{(async()=>await Promise.resolve().then(()=>Ue(qSt(),1)))();let _=B=>{typeof B.scale=="number"&&B.scale!==1&&B.preventDefault()};return document.addEventListener("touchmove",_,{passive:!1}),()=>{document.removeEventListener("touchmove",_)}},[]),(0,xK.jsx)(fVr,{store:W0,children:(0,xK.jsx)(yVr,{langCode:s,theme:f,children:(0,xK.jsx)(g$r,{onChange:t,initialData:r,excalidrawAPI:n,isCollaborating:i,onPointerUpdate:a,renderTopRightUI:o,langCode:s,viewModeEnabled:l,zenModeEnabled:u,gridModeEnabled:d,libraryReturnUrl:h,theme:f,name:p,renderCustomStats:m,UIOptions:O,onPaste:g,detectScroll:y,handleKeyboardGlobally:v,onLibraryChange:b,autoFocus:x,generateIdForFile:E,onLinkOpen:w,generateLinkForSelection:T,onPointerDown:C,onPointerUp:S,onScrollChange:R,onDuplicate:U,validateEmbeddable:I,renderEmbeddable:A,aiEnabled:P!==!1,showDeprecatedFonts:D,children:L})})})},A$r=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:r,UIOptions:n={},...i}=e,{initialData:a,UIOptions:o={},...s}=t,l=Object.keys(n),u=Object.keys(o);return l.length!==u.length?!1:l.every(d=>d==="canvasActions"?Object.keys(n.canvasActions).every(h=>h==="export"&&n?.canvasActions?.export&&o?.canvasActions?.export?n.canvasActions.export.saveFileToDisk===o.canvasActions.export.saveFileToDisk:n?.canvasActions?.[h]===o?.canvasActions?.[h]):n[d]===o[d])&&El(i,s)},r6e=UK.default.memo(S$r,A$r);r6e.displayName="Excalidraw";var U$r='{"type":"excalidraw"}';function W9t(e){let t;try{t=JSON.parse(e.trim()===""?U$r:e)}catch(r){throw new Error(`the file is not valid JSON (${r.message})`)}if(typeof t!="object"||t===null||Array.isArray(t)||t.type!=="excalidraw")throw new Error('the file is not an Excalidraw scene (expected "type": "excalidraw")');if(t.elements!==void 0&&!Array.isArray(t.elements))throw new Error('"elements" must be an array');return{data:t,source:typeof t.source=="string"?t.source:void 0}}function V9t(e,t){return t===void 0?e:JSON.stringify({...JSON.parse(e),source:t},null,2)}var Yl=Ue(it(),1),I$r=250,R$r={canvasActions:{loadScene:!1,saveToActiveFile:!1,export:!1,saveAsImage:!1,toggleTheme:!1,changeViewBackgroundColor:!0,clearCanvas:!0},tools:{image:!0}};function H9t(){return document.documentElement.classList.contains("dark")?"dark":"light"}function M$r(e,t,r){return[Fne(e),t.viewBackgroundColor,t.gridModeEnabled,t.gridSize,t.gridStep,Object.keys(r).length].join(":")}function L$r(e){return b5(e,null,null,{repairBindings:!0})}function D$r(){let[e,t]=(0,Uv.useState)(H9t);return(0,Uv.useEffect)(()=>{let r=new MutationObserver(()=>t(H9t()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e}function N$r(){let e=D$r(),[t,r]=(0,Uv.useState)({status:"waiting"}),n=(0,Uv.useRef)(null),i=(0,Uv.useRef)({source:void 0,readOnly:!0,awaitingBaseline:!1,baseline:null,documentVersion:null,version:null,latest:null,lastPosted:null,timer:void 0,mounts:0});return(0,Uv.useEffect)(()=>{let a=i.current,o=({elements:h,appState:f,files:p})=>V9t(UT(zi(h),f,p,"local"),a.source),s=()=>{if(window.clearTimeout(a.timer),a.timer=void 0,a.readOnly||a.baseline===null||a.latest===null||a.documentVersion===null)return;let h=o(a.latest);if(h!==a.baseline)return a.baseline=h,a.lastPosted=h,window.orca.document.applyEdit({baseVersion:a.documentVersion,content:{kind:"text",text:h}}).catch(()=>{a.baseline="",a.lastPosted=null})};a.onChange=(h,f,p)=>{if(f.isLoading)return;a.latest={elements:h,appState:f,files:p};let m=M$r(h,f,p);if(a.awaitingBaseline){a.awaitingBaseline=!1,a.version=m,a.baseline=o(a.latest);return}m!==a.version&&(a.version=m,!(a.readOnly||a.baseline===null)&&(window.clearTimeout(a.timer),a.timer=window.setTimeout(s,I$r)))};let l=(h,f)=>{let p=n.current;if(p&&h===a.lastPosted){a.readOnly=f,r(y=>y.status==="ready"?{...y,readOnly:f}:y);return}window.clearTimeout(a.timer),a.timer=void 0,a.baseline=null,a.latest=null,a.lastPosted=null,a.readOnly=f;let m;try{m=W9t(h)}catch(y){n.current=null,r({status:"error",message:y.message});return}a.source=m.source;let g=L$r(m.data);if(a.awaitingBaseline=!0,p){p.addFiles(Object.values(g.files)),p.updateScene({elements:g.elements,appState:{viewBackgroundColor:g.appState.viewBackgroundColor,gridModeEnabled:g.appState.gridModeEnabled,gridSize:g.appState.gridSize,gridStep:g.appState.gridStep},captureUpdate:pt.NEVER}),p.history.clear(),r(y=>({...y,readOnly:f}));return}a.mounts+=1,r({status:"ready",readOnly:f,mountKey:a.mounts,initialData:{...g,scrollToContent:!0}})},u=h=>{Number.isSafeInteger(h.version)&&h.content?.kind==="text"&&(a.documentVersion=h.version,l(h.content.text,h.readOnly===!0))},d=[window.orca.document.onDidChange(u),window.orca.on("editor.flush",()=>s())];return()=>d.forEach(h=>h.dispose())},[]),t.status==="waiting"?null:t.status==="error"?(0,Yl.jsxs)("div",{className:"orca-excalidraw-message",role:"alert",children:["Cannot display this file as an Excalidraw drawing: ",t.message,". Switch to Source to fix it."]}):(0,Yl.jsxs)(r6e,{initialData:t.initialData,excalidrawAPI:a=>{n.current=a},onChange:(a,o,s)=>i.current.onChange?.(a,o,s),onLinkOpen:(a,o)=>o.preventDefault(),validateEmbeddable:!1,aiEnabled:!1,theme:e,viewModeEnabled:t.readOnly,UIOptions:R$r,children:[(0,Yl.jsxs)(gs,{children:[(0,Yl.jsx)(gs.DefaultItems.SearchMenu,{}),(0,Yl.jsx)(gs.DefaultItems.Help,{}),(0,Yl.jsx)(gs.DefaultItems.ClearCanvas,{}),(0,Yl.jsx)(gs.Separator,{}),(0,Yl.jsx)(gs.DefaultItems.ChangeCanvasBackground,{})]}),(0,Yl.jsxs)(vw,{children:[(0,Yl.jsx)(vw.Hints.ToolbarHint,{}),(0,Yl.jsx)(vw.Hints.MenuHint,{children:"Search, help and canvas background"}),(0,Yl.jsx)(vw.Hints.HelpHint,{}),(0,Yl.jsxs)(vw.Center,{children:[(0,Yl.jsx)(vw.Center.Logo,{}),(0,Yl.jsx)(vw.Center.Heading,{children:"Pick a tool and start drawing"})]})]})]},t.mountKey)}(0,q9t.createRoot)(document.getElementById("root")).render((0,Yl.jsx)(N$r,{}));})(); - - - diff --git a/plugins/excalidraw/images/cover.png b/plugins/excalidraw/images/cover.png deleted file mode 100644 index 4270bfa..0000000 Binary files a/plugins/excalidraw/images/cover.png and /dev/null differ diff --git a/plugins/excalidraw/images/dark.png b/plugins/excalidraw/images/dark.png deleted file mode 100644 index 7a92380..0000000 Binary files a/plugins/excalidraw/images/dark.png and /dev/null differ diff --git a/plugins/excalidraw/images/editing.png b/plugins/excalidraw/images/editing.png deleted file mode 100644 index de1cc5c..0000000 Binary files a/plugins/excalidraw/images/editing.png and /dev/null differ diff --git a/plugins/excalidraw/images/tab-icon.png b/plugins/excalidraw/images/tab-icon.png deleted file mode 100644 index b6cad89..0000000 Binary files a/plugins/excalidraw/images/tab-icon.png and /dev/null differ diff --git a/plugins/excalidraw/orca-plugin.json b/plugins/excalidraw/orca-plugin.json deleted file mode 100644 index b1679ca..0000000 --- a/plugins/excalidraw/orca-plugin.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-excalidraw", - "publisher": "stablyai", - "name": "Excalidraw", - "version": "1.1.0", - "execution": "sandboxed-ui", - "description": "Draw and edit .excalidraw diagrams right in Orca's editor.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/excalidraw", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "customEditors": [ - { - "id": "excalidraw", - "title": "Excalidraw", - "icon": "images/tab-icon.png", - "extensions": [".excalidraw", ".excalidraw.json"], - "entry": "editor/index.html", - "priority": "default" - } - ], - "newFiles": [ - { - "id": "drawing", - "title": "New Excalidraw drawing", - "extension": ".excalidraw", - "template": "templates/empty.excalidraw", - "icon": "images/tab-icon.png" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A hand-drawn architecture sketch of a web app, API gateway, services and database open in the Excalidraw editor" - }, - "screenshots": [ - { - "path": "images/editing.png", - "alt": "A box in the sketch selected, with Excalidraw's stroke, fill and font options beside it", - "caption": "Editing a diagram" - }, - { - "path": "images/dark.png", - "alt": "The same sketch in Excalidraw's dark theme", - "caption": "Follows Orca's dark theme" - } - ] -} diff --git a/plugins/excalidraw/templates/empty.excalidraw b/plugins/excalidraw/templates/empty.excalidraw deleted file mode 100644 index 025f41d..0000000 --- a/plugins/excalidraw/templates/empty.excalidraw +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "excalidraw", - "version": 2, - "source": "https://excalidraw.com", - "elements": [], - "appState": { - "gridSize": null, - "viewBackgroundColor": "#ffffff" - }, - "files": {} -} diff --git a/plugins/github-light-theme/LICENSE b/plugins/github-light-theme/LICENSE deleted file mode 100644 index 1db9fd8..0000000 --- a/plugins/github-light-theme/LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Upstream palette license: - -MIT License - -Copyright (c) 2020 Primer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/github-light-theme/README.md b/plugins/github-light-theme/README.md deleted file mode 100644 index 763f149..0000000 --- a/plugins/github-light-theme/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# GitHub Light for Orca - -A crisp white application theme inspired by GitHub's default light palette, with matching terminal colors. - -Select **GitHub Light** in Appearance settings for the app and in terminal theme settings -for matching ANSI colors. Includes syntax colors for source files and Markdown. - -Secondary controls use a deeper cool gray (`#d8dee4`) so buttons such as **AI Fix** -remain visible on the light gray cards, muted surfaces, and sidebar (`#f6f8fa`), -including their translucent hover state. The secondary foreground stays `#1f2328`. -Muted text uses `#57606a` to keep at least 4.5:1 contrast on secondary surfaces too, -such as inline badges. - -## Attribution - -Adapted for Orca from the [GitHub Light upstream project](https://github.com/primer/github-vscode-theme). -The Orca token mapping is maintained here; this is an unofficial port. -Upstream MIT notices are included in [LICENSE](LICENSE). diff --git a/plugins/github-light-theme/images/cover.png b/plugins/github-light-theme/images/cover.png deleted file mode 100644 index 65666ab..0000000 Binary files a/plugins/github-light-theme/images/cover.png and /dev/null differ diff --git a/plugins/github-light-theme/orca-plugin.json b/plugins/github-light-theme/orca-plugin.json deleted file mode 100644 index 1e05c22..0000000 --- a/plugins/github-light-theme/orca-plugin.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-github-light-theme", - "publisher": "stablyai", - "name": "GitHub Light for Orca", - "version": "1.0.2", - "execution": "data", - "description": "A crisp white application theme inspired by GitHub's default light palette, with matching terminal colors.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/github-light-theme", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "github-light", - "title": "GitHub Light", - "path": "themes/github-light.json" - } - ], - "terminalThemes": [ - { - "id": "github-light", - "title": "GitHub Light", - "path": "terminal/github-light.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "GitHub Light theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches" - } -} diff --git a/plugins/github-light-theme/terminal/github-light.json b/plugins/github-light-theme/terminal/github-light.json deleted file mode 100644 index aef8708..0000000 --- a/plugins/github-light-theme/terminal/github-light.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "light", - "terminal": { - "background": "#ffffff", - "foreground": "#1f2328", - "cursor": "#0969da", - "selectionBackground": "#ddf4ff", - "black": "#24292f", - "red": "#cf222e", - "green": "#116329", - "yellow": "#4d2d00", - "blue": "#0969da", - "magenta": "#8250df", - "cyan": "#1b7c83", - "white": "#6e7781", - "brightBlack": "#57606a", - "brightRed": "#a40e26", - "brightGreen": "#1a7f37", - "brightYellow": "#633c01", - "brightBlue": "#218bff", - "brightMagenta": "#a475f9", - "brightCyan": "#3192aa", - "brightWhite": "#8c959f" - } -} diff --git a/plugins/github-light-theme/themes/github-light.json b/plugins/github-light-theme/themes/github-light.json deleted file mode 100644 index 2eb790d..0000000 --- a/plugins/github-light-theme/themes/github-light.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "base": "light", - "tokens": { - "--background": "#ffffff", - "--editor-surface": "#ffffff", - "--foreground": "#1f2328", - "--card": "#f6f8fa", - "--card-foreground": "#1f2328", - "--popover": "#ffffff", - "--popover-foreground": "#1f2328", - "--primary": "#0969da", - "--primary-foreground": "#ffffff", - "--secondary": "#d8dee4", - "--secondary-foreground": "#1f2328", - "--muted": "#f6f8fa", - "--muted-foreground": "#57606a", - "--accent": "#ddf4ff", - "--accent-foreground": "#1f2328", - "--border": "#d0d7de", - "--input": "#d0d7de", - "--ring": "#0969da", - "--sidebar": "#f6f8fa", - "--sidebar-foreground": "#1f2328", - "--sidebar-accent": "#ddf4ff", - "--sidebar-accent-foreground": "#1f2328", - "--sidebar-border": "#d0d7de", - "--sidebar-ring": "#0969da" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#6e7781", - "fontStyle": "italic" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "support.variable" - ], - "settings": { - "foreground": "#1f2328" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#0550ae" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#0550ae" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#cf222e" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#cf222e" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#0a3069" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#0550ae" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function" - ], - "settings": { - "foreground": "#8250df" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#953800" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#1f2328" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#116329" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#0550ae" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#8250df" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#0969da", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#0969da", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#6e7781", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#cf222e" - } - } - ] -} diff --git a/plugins/gleam/LICENSE b/plugins/gleam/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/gleam/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/gleam/images/cover.png b/plugins/gleam/images/cover.png deleted file mode 100644 index 8cc44b0..0000000 Binary files a/plugins/gleam/images/cover.png and /dev/null differ diff --git a/plugins/gleam/images/editor.png b/plugins/gleam/images/editor.png deleted file mode 100644 index 7928c63..0000000 Binary files a/plugins/gleam/images/editor.png and /dev/null differ diff --git a/plugins/gleam/orca-plugin.json b/plugins/gleam/orca-plugin.json deleted file mode 100644 index 4309332..0000000 --- a/plugins/gleam/orca-plugin.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-gleam", - "publisher": "stablyai", - "name": "Gleam Language", - "version": "1.0.0", - "execution": "data", - "description": "Syntax highlighting, comment toggling and bracket matching for Gleam files.", - "license": "MIT AND Apache-2.0", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/gleam", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "syntaxes": [ - { - "id": "gleam", - "title": "Gleam", - "scopeName": "source.gleam", - "path": "syntaxes/gleam.tmLanguage.json", - "configuration": "syntaxes/language-configuration.json", - "extensions": [ - ".gleam" - ] - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A Gleam router module with highlighted keywords, types and strings next to the Gleam star" - }, - "screenshots": [ - { - "path": "images/editor.png", - "alt": "A highlighted Gleam module in the editor with gleam test output in the terminal below", - "caption": "Editor and terminal" - } - ] -} diff --git a/plugins/gleam/syntaxes/gleam-LICENSE.txt b/plugins/gleam/syntaxes/gleam-LICENSE.txt deleted file mode 100644 index 2bbe4ac..0000000 --- a/plugins/gleam/syntaxes/gleam-LICENSE.txt +++ /dev/null @@ -1,216 +0,0 @@ -Gleam TextMate grammar - -Source: https://github.com/gleam-lang/vscode-gleam/blob/d6ce8c4358c278245e913b99a281d118637c9399/syntaxes/gleam.tmLanguage.json -Modifications by Orca: JSON formatting; the $schema key is removed. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 - present Louis Pilfold - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -## Runtime Library Exception to the Apache 2.0 License: ## - - - As an exception, if you use this Software to compile your source code and - portions of this Software are embedded into the binary product as a result, - you may redistribute such product without providing attribution as would - otherwise be required by Sections 4(a), 4(b) and 4(d) of the License. diff --git a/plugins/gleam/syntaxes/gleam.tmLanguage.json b/plugins/gleam/syntaxes/gleam.tmLanguage.json deleted file mode 100644 index c677043..0000000 --- a/plugins/gleam/syntaxes/gleam.tmLanguage.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "name": "Gleam", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#keywords" - }, - { - "include": "#strings" - }, - { - "include": "#constant" - }, - { - "include": "#entity" - }, - { - "include": "#discards" - } - ], - "repository": { - "keywords": { - "patterns": [ - { - "name": "keyword.control.gleam", - "match": "\\b(as|use|case|if|fn|import|let|assert|pub|type|opaque|const|todo|panic|else|echo)\\b" - }, - { - "name": "keyword.operator.arrow.gleam", - "match": "(<\\-|\\->)" - }, - { - "name": "keyword.operator.pipe.gleam", - "match": "\\|>" - }, - { - "name": "keyword.operator.splat.gleam", - "match": "\\.\\." - }, - { - "name": "keyword.operator.comparison.gleam", - "match": "(==|!=)" - }, - { - "name": "keyword.operator.comparison.float.gleam", - "match": "(<=\\.|>=\\.|<\\.|>\\.)" - }, - { - "name": "keyword.operator.comparison.int.gleam", - "match": "(<=|>=|<|>)" - }, - { - "name": "keyword.operator.logical.gleam", - "match": "(&&|\\|\\|)" - }, - { - "name": "keyword.operator.string.gleam", - "match": "<>" - }, - { - "name": "keyword.operator.other.gleam", - "match": "\\|" - }, - { - "name": "keyword.operator.arithmetic.float.gleam", - "match": "(\\+\\.|\\-\\.|/\\.|\\*\\.)" - }, - { - "name": "keyword.operator.arithmetic.int.gleam", - "match": "(\\+|\\-|/|\\*|%)" - }, - { - "name": "keyword.operator.assignment.gleam", - "match": "=" - } - ] - }, - "strings": { - "name": "string.quoted.double.gleam", - "begin": "\"", - "end": "\"", - "patterns": [ - { - "name": "constant.character.escape.gleam", - "match": "\\\\." - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.line.gleam", - "match": "//.*" - } - ] - }, - "constant": { - "patterns": [ - { - "include": "#binary_number" - }, - { - "include": "#octal_number" - }, - { - "include": "#hexadecimal_number" - }, - { - "include": "#decimal_number" - }, - { - "name": "entity.name.type.gleam", - "match": "[[:upper:]][[:alnum:]]*" - } - ] - }, - "binary_number": { - "name": "constant.numeric.binary.gleam", - "match": "\\b0[bB][01_]*\\b", - "patterns": [] - }, - "octal_number": { - "name": "constant.numeric.octal.gleam", - "match": "\\b0[oO][0-7_]*\\b", - "patterns": [] - }, - "decimal_number": { - "name": "constant.numeric.decimal.gleam", - "match": "\\b([0-9][0-9_]*)(\\.([0-9_]*)?(e-?[0-9]+)?)?\\b", - "patterns": [] - }, - "hexadecimal_number": { - "name": "constant.numeric.hexadecimal.gleam", - "match": "\\b0[xX][0-9a-fA-F_]+\\b", - "patterns": [] - }, - "entity": { - "patterns": [ - { - "begin": "\\b([[:lower:]][[:word:]]*)\\b[[:space:]]*\\(", - "end": "\\)", - "patterns": [ - { - "include": "$self" - } - ], - "captures": { - "1": { - "name": "entity.name.function.gleam" - } - } - }, - { - "name": "variable.parameter.gleam", - "match": "\\b([[:lower:]][[:word:]]*):\\s" - }, - { - "name": "entity.name.namespace.gleam", - "match": "\\b([[:lower:]][[:word:]]*):" - } - ] - }, - "discards": { - "name": "comment.unused.gleam", - "match": "\\b_(?:[[:word:]]+)?\\b" - } - }, - "scopeName": "source.gleam", - "fileTypes": [ - "gleam" - ] -} diff --git a/plugins/gleam/syntaxes/language-configuration.json b/plugins/gleam/syntaxes/language-configuration.json deleted file mode 100644 index 6d6f755..0000000 --- a/plugins/gleam/syntaxes/language-configuration.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "comments": { "lineComment": "//" }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "\"", "close": "\"" } - ], - "surroundingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "\"", "close": "\"" } - ] -} diff --git a/plugins/godot/LICENSE b/plugins/godot/LICENSE deleted file mode 100644 index b559e80..0000000 --- a/plugins/godot/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016-2022 The Godot Engine community - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/godot/README.md b/plugins/godot/README.md deleted file mode 100644 index 50ab0d5..0000000 --- a/plugins/godot/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Godot Syntax - -Highlights GDScript (`.gd`), Godot text scenes and resources (`.tscn`, `.tres`, `.escn`), project settings and metadata (`.godot`, `.import`, `.remap`, `.gdextension`), and shaders (`.gdshader`, `.gdshaderinc`). - -The GDScript and resource grammars are from the MIT-licensed [Godot VS Code plugin](https://github.com/godotengine/godot-vscode-plugin), vendored from [Orca PR #20454](https://github.com/stablyai/orca/pull/20454) at commit `079777ea0df7782b3c6ea80c7cb2a43590efe3cd`. The shader grammar is from the same upstream project at `145a0f0ad5a6c726b27b18b517c217a5e1bfa91c`. Its license is included. diff --git a/plugins/godot/orca-plugin.json b/plugins/godot/orca-plugin.json deleted file mode 100644 index bf47639..0000000 --- a/plugins/godot/orca-plugin.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "manifestVersion": 2, - "publisher": "stablyai", - "version": "1.0.0", - "execution": "data", - "license": "MIT", - "engines": { - "orca": ">=1.4.245" - }, - "capabilities": [], - "id": "orca-godot", - "name": "Godot Syntax", - "description": "Syntax highlighting for GDScript, Godot resources and shaders.", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/godot", - "contributes": { - "syntaxes": [ - { - "id": "gdscript", - "title": "GDScript", - "scopeName": "source.gdscript", - "path": "syntaxes/gdscript.tmLanguage.json", - "configuration": "syntaxes/gdscript-configuration.json", - "extensions": [ - ".gd" - ] - }, - { - "id": "gdresource", - "title": "Godot Resource", - "scopeName": "source.gdresource", - "path": "syntaxes/gdresource.tmLanguage.json", - "configuration": "syntaxes/gdresource-configuration.json", - "extensions": [ - ".tscn", - ".tres", - ".escn", - ".godot", - ".import", - ".remap", - ".gdextension" - ] - }, - { - "id": "gdshader", - "title": "Godot Shader", - "scopeName": "source.gdshader", - "path": "syntaxes/gdshader.tmLanguage.json", - "configuration": "syntaxes/gdshader-configuration.json", - "extensions": [ - ".gdshader", - ".gdshaderinc" - ] - } - ] - } -} diff --git a/plugins/godot/syntaxes/gdresource-configuration.json b/plugins/godot/syntaxes/gdresource-configuration.json deleted file mode 100644 index d208ed4..0000000 --- a/plugins/godot/syntaxes/gdresource-configuration.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "comments": { - "lineComment": ";" - }, - "brackets": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ] - ], - "autoClosingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "'", - "close": "'" - } - ], - "surroundingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "'", - "close": "'" - } - ] -} diff --git a/plugins/godot/syntaxes/gdresource.tmLanguage.json b/plugins/godot/syntaxes/gdresource.tmLanguage.json deleted file mode 100644 index d1d3fe2..0000000 --- a/plugins/godot/syntaxes/gdresource.tmLanguage.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "scopeName": "source.gdresource", - "uuid": "e076faa2-3c52-42fa-a8e6-9a7c453c1a5b", - "patterns": [ - { "include": "#embedded_shader" }, - { "include": "#embedded_gdscript" }, - { "include": "#comment" }, - { "include": "#heading" }, - { "include": "#key_value" } - ], - "repository": { - "comment": { - "captures": { "1": { "name": "punctuation.definition.comment.gdresource" } }, - "match": "(;).*$\\n?", - "name": "comment.line.gdresource" - }, - "embedded_shader": { - "name": "meta.embedded.block.gdshader", - "begin": "(code) = \"", - "end": "\"", - "beginCaptures": { "1": { "name": "variable.other.property.gdresource" } }, - "patterns": [{ "include": "source.gdshader" }] - }, - "embedded_gdscript": { - "comment": "meta.embedded.block.gdscript", - "begin": "(script/source) = \"", - "end": "\"", - "beginCaptures": { "1": { "name": "variable.other.property.gdresource" } }, - "patterns": [{ "include": "source.gdscript" }] - }, - "heading": { - "begin": "\\[([a-z_]*)\\s?", - "beginCaptures": { "1": { "name": "keyword.control.gdresource" } }, - "end": "\\]", - "patterns": [{ "include": "#heading_properties" }, { "include": "#data" }] - }, - "heading_properties": { - "patterns": [ - { - "name": "invalid.illegal.noValue.gdresource", - "match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)" - }, - { - "begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*", - "beginCaptures": { - "1": { "name": "variable.other.property.gdresource" }, - "2": { "name": "punctuation.definition.keyValue.gdresource" } - }, - "end": "($|(?==)|\\,?|\\s*(?=\\}))", - "patterns": [{ "include": "#data" }] - } - ] - }, - "key_value": { - "patterns": [ - { - "name": "invalid.illegal.noValue.gdresource", - "match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)" - }, - { - "begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*", - "beginCaptures": { - "1": { "name": "variable.other.property.gdresource" }, - "2": { "name": "punctuation.definition.keyValue.gdresource" } - }, - "end": "($|(?==)|\\,|\\s*(?=\\}))", - "patterns": [{ "include": "#data" }] - } - ] - }, - "data": { - "patterns": [ - { "include": "#comment" }, - { - "begin": "(?=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n", - "captures": { - "1": { "name": "constant.character.format.placeholder.other.gdscript" }, - "3": { "name": "storage.type.format.gdscript" }, - "4": { "name": "storage.type.format.gdscript" } - } - }, - { - "name": "meta.format.brace.gdscript", - "match": "(?x)\n (\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n (![rsa])?\n (:)\n [^'\"{}\\n]* (?:\n \\{ [^'\"}\\n]*? \\} [^'\"{}\\n]*\n )*\n }\n )\n", - "captures": { - "1": { "name": "constant.character.format.placeholder.other.gdscript" }, - "3": { "name": "storage.type.format.gdscript" }, - "4": { "name": "storage.type.format.gdscript" } - } - } - ] - }, - "nodepath_object": { - "name": "meta.literal.nodepath.gdscript", - "begin": "(NodePath)\\s*(?:\\()", - "beginCaptures": { "1": { "name": "support.class.library.gdscript" } }, - "end": "(?:\\))", - "patterns": [ - { - "begin": "(\"|')", - "end": "\\1", - "name": "string.quoted.gdscript constant.character.escape.gdscript", - "patterns": [ - { - "match": "%", - "name": "keyword.control.flow.gdscript" - } - ] - } - ] - }, - "nodepath_function": { - "name": "meta.function.gdscript", - "contentName": "meta.function.parameters.gdscript", - "begin": "(get_node_or_null|has_node|has_node_and_resource|find_node|get_node)\\s*(\\()", - "beginCaptures": { - "1": { "name": "entity.name.function.gdscript" }, - "2": { "name": "punctuation.definition.parameters.begin.gdscript" } - }, - "end": "(\\))", - "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.gdscript" } }, - "patterns": [ - { - "begin": "(\"|')", - "end": "\\1", - "name": "string.quoted.gdscript meta.literal.nodepath.gdscript constant.character.escape.gdscript", - "patterns": [ - { - "match": "%", - "name": "keyword.control.flow.gdscript" - } - ] - }, - { "include": "#expression" } - ] - }, - "func": { - "match": "\\bfunc\\b", - "name": "keyword.language.gdscript storage.type.function.gdscript" - }, - "in_keyword": { - "patterns": [ - { - "begin": "\\b(for)\\b", - "end": ":", - "captures": { "1": { "name": "keyword.control.gdscript" } }, - "patterns": [ - { - "match": "\\bin\\b", - "name": "keyword.control.gdscript" - }, - { "include": "#base_expression" }, - { "include": "#any_variable" }, - { "include": "#any_property" } - ] - }, - { - "match": "\\bin\\b", - "name": "keyword.operator.wordlike.gdscript" - } - ] - }, - "operators": { - "patterns": [ - { "include": "#wordlike_operator" }, - { "include": "#boolean_operator" }, - { "include": "#arithmetic_operator" }, - { "include": "#bitwise_operator" }, - { "include": "#compare_operator" } - ] - }, - "wordlike_operator": { - "match": "\\b(and|or|not)\\b", - "name": "keyword.operator.wordlike.gdscript" - }, - "boolean_operator": { - "match": "(&&|\\|\\|)", - "name": "keyword.operator.boolean.gdscript" - }, - "bitwise_operator": { - "match": "&|\\||<<=|>>=|<<|>>|\\^|~", - "name": "keyword.operator.bitwise.gdscript" - }, - "compare_operator": { - "match": "<=|>=|==|<|>|!=|!", - "name": "keyword.operator.comparison.gdscript" - }, - "arithmetic_operator": { - "match": "->|\\+=|-=|\\*\\*=|\\*=|\\^=|/=|%=|&=|~=|\\|=|\\*\\*|\\*|/|%|\\+|-", - "name": "keyword.operator.arithmetic.gdscript" - }, - "assignment_operator": { - "match": "=", - "name": "keyword.operator.assignment.gdscript" - }, - "control_flow": { - "match": "\\b(?:if|elif|else|while|break|continue|pass|return|when|yield|await)\\b", - "name": "keyword.control.gdscript" - }, - "match_keyword": { - "match": "(?:^|:)\\s*(match)\\b", - "captures": { "1": { "name": "keyword.control.flow.gdscript" } } - }, - "keywords": { - "match": "\\b(?:class|class_name|is|onready|tool|static|export|as|enum|assert|breakpoint|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|trait|namespace|super|self)\\b", - "name": "keyword.language.gdscript" - }, - "letter": { - "match": "\\b(?:true|false|null)\\b", - "name": "constant.language.literal.gdscript" - }, - "numbers": { - "patterns": [ - { - "match": "0b[01_]+", - "name": "constant.numeric.integer.binary.gdscript" - }, - { - "match": "0x[0-9A-Fa-f_]+", - "name": "constant.numeric.integer.hexadecimal.gdscript" - }, - { - "match": "\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?", - "name": "constant.numeric.float.gdscript" - }, - { - "match": "([0-9][0-9_]*)\\.[0-9_]*([eE][+-]?[0-9_]+)?", - "name": "constant.numeric.float.gdscript" - }, - { - "match": "([0-9][0-9_]*)?\\.[0-9_]*([eE][+-]?[0-9_]+)", - "name": "constant.numeric.float.gdscript" - }, - { - "match": "[0-9][0-9_]*[eE][+-]?[0-9_]+", - "name": "constant.numeric.float.gdscript" - }, - { - "match": "[-]?[0-9][0-9_]*", - "name": "constant.numeric.integer.gdscript" - } - ] - }, - "variable_declaration": { - "name": "meta.variable.declaration.gdscript", - "begin": "\\b(?:(var)|(const))\\b", - "beginCaptures": { - "1": { "name": "keyword.language.gdscript storage.type.var.gdscript" }, - "2": { "name": "keyword.language.gdscript storage.type.const.gdscript" } - }, - "end": "$|;", - "patterns": [ - { - "match": "(:)?\\s*(set|get)\\s+=\\s+([a-zA-Z_]\\w*)", - "captures": { - "1": { "name": "punctuation.separator.annotation.gdscript" }, - "2": { "name": "entity.name.function.gdscript" }, - "3": { "name": "entity.name.function.gdscript" } - } - }, - { - "match": ":=|=(?!=)", - "name": "keyword.operator.assignment.gdscript" - }, - { - "match": "(:)\\s*([a-zA-Z_]\\w*)?", - "captures": { - "1": { "name": "punctuation.separator.annotation.gdscript" }, - "2": { "name": "entity.name.type.class.gdscript" } - } - }, - { - "match": "(setget)\\s+([a-zA-Z_]\\w*)(?:[,]\\s*([a-zA-Z_]\\w*))?", - "captures": { - "1": { "name": "keyword.language.gdscript" }, - "2": { "name": "entity.name.function.gdscript" }, - "3": { "name": "entity.name.function.gdscript" } - } - }, - { "include": "#expression" }, - { "include": "#letter" }, - { "include": "#any_variable" }, - { "include": "#any_property" }, - { "include": "#keywords" } - ] - }, - "getter_setter_godot4": { - "patterns": [ - { - "name": "meta.variable.declaration.getter.gdscript", - "match": "(get)\\s*(:)", - "captures": { - "1": { "name": "entity.name.function.gdscript" }, - "2": { "name": "punctuation.separator.annotation.gdscript" } - } - }, - { - "name": "meta.variable.declaration.setter.gdscript", - "match": "(set)\\s*(\\()\\s*([A-Za-z_]\\w*)\\s*(\\))\\s*(:)", - "captures": { - "1": { "name": "entity.name.function.gdscript" }, - "2": { "name": "punctuation.definition.arguments.begin.gdscript" }, - "3": { "name": "variable.other.gdscript" }, - "4": { "name": "punctuation.definition.arguments.end.gdscript" }, - "5": { "name": "punctuation.separator.annotation.gdscript" } - } - } - ] - }, - "class_declaration": { - "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)", - "captures": { - "1": { "name": "entity.name.type.class.gdscript" }, - "2": { "name": "class.other.gdscript" } - } - }, - "class_new": { - "match": "\\b([a-zA-Z_]\\w*).(new)\\(", - "captures": { - "1": { "name": "entity.name.type.class.gdscript" }, - "2": { "name": "storage.type.new.gdscript" }, - "3": { "name": "punctuation.parenthesis.begin.gdscript" } - } - }, - "class_is": { - "match": "\\s+(is)\\s+(not?)\\s+\\s+([a-zA-Z_]\\w*)", - "captures": { - "1": { "name": "storage.type.is.gdscript" }, - "2": { "name": "storage.type.not.gdscript" }, - "3": { "name": "entity.name.type.class.gdscript" } - } - }, - "class_enum": { - "match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)", - "captures": { - "1": { "name": "entity.name.type.class.gdscript" }, - "2": { "name": "variable.other.enummember.gdscript" } - } - }, - "class_name": { - "match": "(?<=class_name)\\s+([a-zA-Z_]\\w*(\\.([a-zA-Z_]\\w*))?)", - "captures": { - "1": { "name": "entity.name.type.class.gdscript" }, - "2": { "name": "class.other.gdscript" } - } - }, - "builtin_get_node_shorthand": { - "patterns": [ - { "include": "#builtin_get_node_shorthand_quoted" }, - { "include": "#builtin_get_node_shorthand_bare" }, - { "include": "#builtin_get_node_shorthand_bare_multi" } - ] - }, - "builtin_get_node_shorthand_quoted": { - "name": "string.quoted.gdscript meta.literal.nodepath.gdscript constant.character.escape.gdscript", - "begin": "(?:(\\$|%)|(&|\\^|@))(\"|')", - "beginCaptures": { - "1": { "name": "keyword.control.flow.gdscript" }, - "2": { "name": "variable.other.enummember.gdscript" } - }, - "end": "(\\3)", - "patterns": [ - { - "match": "%", - "name": "keyword.control.flow" - } - ] - }, - "builtin_get_node_shorthand_bare": { - "name": "meta.literal.nodepath.bare.gdscript", - "match": "(?)\\s*(void\\w*)|([a-zA-Z_]\\w*)\\s*\\:)", - "endCaptures2": { - "1": { "name": "punctuation.separator.annotation.result.gdscript" }, - "2": { "name": "entity.name.type.class.builtin.gdscript" }, - "3": { "name": "entity.name.type.class.gdscript markup.italic" } - }, - "patterns": [ - { "include": "#parameters" }, - { "include": "#line_continuation" }, - { "include": "#base_expression" }, - { "include": "#any_variable" }, - { "include": "#any_property" } - ] - }, - "function_declaration": { - "name": "meta.function.gdscript", - "begin": "(?x) \\s*\n (func) \\s+\n ([a-zA-Z_]\\w*) \\s*\n (?=\\()", - "beginCaptures": { - "1": { "name": "keyword.language.gdscript storage.type.function.gdscript" }, - "2": { "name": "entity.name.function.gdscript" } - }, - "end": "(:)|\n", - "endCaptures": { "1": { "name": "punctuation.section.function.begin.gdscript" } }, - "patterns": [ - { "include": "#parameters" }, - { "include": "#line_continuation" }, - { "include": "#base_expression" } - ] - }, - "parameters": { - "name": "meta.function.parameters.gdscript", - "begin": "(\\()", - "end": "(\\))", - "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.gdscript" } }, - "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.gdscript" } }, - "patterns": [ - { "include": "#annotated_parameter" }, - { - "match": "(?x)\n ([a-zA-Z_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n", - "captures": { - "1": { "name": "variable.parameter.function.language.gdscript" }, - "2": { "name": "punctuation.separator.parameters.gdscript" } - } - }, - { "include": "#comment" }, - { "include": "#loose_default" } - ] - }, - "loose_default": { - "begin": "(=)", - "end": "(,)|(?=\\))", - "beginCaptures": { "1": { "name": "keyword.operator.gdscript" } }, - "endCaptures": { "1": { "name": "punctuation.separator.parameters.gdscript" } }, - "patterns": [{ "include": "#expression" }] - }, - "annotated_parameter": { - "begin": "(?x)\n \\s* ([a-zA-Z_]\\w*) \\s* (:)\\s* ([a-zA-Z_]\\w*)? \n", - "beginCaptures": { - "1": { "name": "variable.parameter.function.language.gdscript" }, - "2": { "name": "punctuation.separator.annotation.gdscript" }, - "3": { "name": "entity.name.type.class.gdscript" } - }, - "end": "(,)|(?=\\))", - "endCaptures": { "1": { "name": "punctuation.separator.parameters.gdscript" } }, - "patterns": [ - { "include": "#expression" }, - { - "name": "keyword.operator.assignment.gdscript", - "match": "=(?!=)" - } - ] - }, - "curly_braces": { - "begin": "\\{", - "end": "\\}", - "beginCaptures": { "0": { "name": "punctuation.definition.dict.begin.gdscript" } }, - "endCaptures": { "0": { "name": "punctuation.definition.dict.end.gdscript" } }, - "patterns": [{ "include": "#base_expression" }, { "include": "#any_variable" }] - }, - "square_braces": { - "begin": "\\[", - "end": "\\]", - "beginCaptures": { "0": { "name": "punctuation.definition.list.begin.gdscript" } }, - "endCaptures": { "0": { "name": "punctuation.definition.list.end.gdscript" } }, - "patterns": [{ "include": "#base_expression" }, { "include": "#any_variable" }] - }, - "round_braces": { - "begin": "\\(", - "end": "\\)", - "beginCaptures": { "0": { "name": "punctuation.parenthesis.begin.gdscript" } }, - "endCaptures": { "0": { "name": "punctuation.parenthesis.end.gdscript" } }, - "patterns": [{ "include": "#base_expression" }, { "include": "#any_variable" }] - }, - "line_continuation": { - "patterns": [ - { - "match": "(\\\\)\\s*(\\S.*$\\n?)", - "captures": { - "1": { "name": "punctuation.separator.continuation.line.gdscript" }, - "2": { "name": "invalid.illegal.line.continuation.gdscript" } - } - }, - { - "begin": "(\\\\)\\s*$\\n?", - "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n", - "beginCaptures": { "1": { "name": "punctuation.separator.continuation.line.gdscript" } }, - "patterns": [{ "include": "#base_expression" }] - } - ] - }, - "any_method": { - "match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))", - "name": "entity.name.function.other.gdscript" - }, - "any_variable": { - "match": "\\b(?\\>\\=?|[-+*/&|<>=!]\\=|\\&\\&|[|][|]|[-+~!*/%<>&^|=]" - } - } -} diff --git a/plugins/gruvbox-theme/LICENSE b/plugins/gruvbox-theme/LICENSE deleted file mode 100644 index 1447d55..0000000 --- a/plugins/gruvbox-theme/LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Upstream palette license: - -MIT License - -Copyright (c) 2021 NpX - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/gruvbox-theme/README.md b/plugins/gruvbox-theme/README.md deleted file mode 100644 index 5ab9e2b..0000000 --- a/plugins/gruvbox-theme/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Gruvbox for Orca - -Retro warm dark and light application themes, with matching Gruvbox terminal colors. - -Select **Gruvbox Dark**, **Gruvbox Light** in Appearance and terminal settings. - -## Attribution - -An unofficial Orca port of [Gruvbox](https://github.com/ellisonleao/gruvbox.nvim). -The app mapping and syntax scopes are maintained here. Low-contrast syntax shades -are adjusted to pass Orca’s runtime checks; terminal ANSI colors use the upstream palette. -Upstream license notices are included in [LICENSE](LICENSE). diff --git a/plugins/gruvbox-theme/images/cover.png b/plugins/gruvbox-theme/images/cover.png deleted file mode 100644 index 53b8da8..0000000 Binary files a/plugins/gruvbox-theme/images/cover.png and /dev/null differ diff --git a/plugins/gruvbox-theme/orca-plugin.json b/plugins/gruvbox-theme/orca-plugin.json deleted file mode 100644 index 5f04d4b..0000000 --- a/plugins/gruvbox-theme/orca-plugin.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-gruvbox-theme", - "publisher": "stablyai", - "name": "Gruvbox for Orca", - "version": "1.0.0", - "execution": "data", - "description": "Retro warm dark and light application themes, with matching Gruvbox terminal colors.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/gruvbox-theme", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "gruvbox-dark", - "title": "Gruvbox Dark", - "path": "themes/gruvbox-dark.json" - }, - { - "id": "gruvbox-light", - "title": "Gruvbox Light", - "path": "themes/gruvbox-light.json" - } - ], - "terminalThemes": [ - { - "id": "gruvbox-dark", - "title": "Gruvbox Dark", - "path": "terminal/gruvbox-dark.json" - }, - { - "id": "gruvbox-light", - "title": "Gruvbox Light", - "path": "terminal/gruvbox-light.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "Gruvbox theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches" - } -} diff --git a/plugins/gruvbox-theme/terminal/gruvbox-dark.json b/plugins/gruvbox-theme/terminal/gruvbox-dark.json deleted file mode 100644 index 68eb370..0000000 --- a/plugins/gruvbox-theme/terminal/gruvbox-dark.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "dark", - "terminal": { - "background": "#282828", - "foreground": "#ebdbb2", - "cursor": "#fabd2f", - "selectionBackground": "#504945", - "black": "#282828", - "red": "#cc241d", - "green": "#98971a", - "yellow": "#d79921", - "blue": "#458588", - "magenta": "#b16286", - "cyan": "#689d6a", - "white": "#a89984", - "brightBlack": "#928374", - "brightRed": "#fb4934", - "brightGreen": "#b8bb26", - "brightYellow": "#fabd2f", - "brightBlue": "#83a598", - "brightMagenta": "#d3869b", - "brightCyan": "#8ec07c", - "brightWhite": "#ebdbb2" - } -} diff --git a/plugins/gruvbox-theme/terminal/gruvbox-light.json b/plugins/gruvbox-theme/terminal/gruvbox-light.json deleted file mode 100644 index d2467c3..0000000 --- a/plugins/gruvbox-theme/terminal/gruvbox-light.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "light", - "terminal": { - "background": "#fbf1c7", - "foreground": "#3c3836", - "cursor": "#9d0006", - "selectionBackground": "#ebdbb2", - "black": "#fbf1c7", - "red": "#cc241d", - "green": "#98971a", - "yellow": "#d79921", - "blue": "#458588", - "magenta": "#b16286", - "cyan": "#689d6a", - "white": "#7c6f64", - "brightBlack": "#928374", - "brightRed": "#9d0006", - "brightGreen": "#79740e", - "brightYellow": "#b57614", - "brightBlue": "#076678", - "brightMagenta": "#8f3f71", - "brightCyan": "#427b58", - "brightWhite": "#3c3836" - } -} diff --git a/plugins/gruvbox-theme/themes/gruvbox-dark.json b/plugins/gruvbox-theme/themes/gruvbox-dark.json deleted file mode 100644 index d57d9f9..0000000 --- a/plugins/gruvbox-theme/themes/gruvbox-dark.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "base": "dark", - "tokens": { - "--background": "#282828", - "--editor-surface": "#282828", - "--foreground": "#ebdbb2", - "--card": "#32302f", - "--card-foreground": "#ebdbb2", - "--popover": "#282828", - "--popover-foreground": "#ebdbb2", - "--primary": "#fabd2f", - "--primary-foreground": "#282828", - "--secondary": "#32302f", - "--secondary-foreground": "#ebdbb2", - "--muted": "#32302f", - "--muted-foreground": "#a89984", - "--accent": "#504945", - "--accent-foreground": "#ebdbb2", - "--border": "#665c54", - "--input": "#665c54", - "--ring": "#fabd2f", - "--sidebar": "#1d2021", - "--sidebar-foreground": "#ebdbb2", - "--sidebar-accent": "#504945", - "--sidebar-accent-foreground": "#ebdbb2", - "--sidebar-border": "#665c54", - "--sidebar-ring": "#fabd2f" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#928374", - "fontStyle": "italic" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "support.variable" - ], - "settings": { - "foreground": "#ebdbb2" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#d3869b" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#d3869b" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#fb4934" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#fb4934" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#b8bb26" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#d3869b" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function" - ], - "settings": { - "foreground": "#b8bb26" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#fabd2f" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#ebdbb2" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#fb4934" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#8ec07c" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#b8bb26" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#fabd2f", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#fabd2f", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#928374", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#fb4934" - } - } - ] -} diff --git a/plugins/gruvbox-theme/themes/gruvbox-light.json b/plugins/gruvbox-theme/themes/gruvbox-light.json deleted file mode 100644 index eca035d..0000000 --- a/plugins/gruvbox-theme/themes/gruvbox-light.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "base": "light", - "tokens": { - "--background": "#fbf1c7", - "--editor-surface": "#fbf1c7", - "--foreground": "#3c3836", - "--card": "#f2e5bc", - "--card-foreground": "#3c3836", - "--popover": "#fbf1c7", - "--popover-foreground": "#3c3836", - "--primary": "#9d0006", - "--primary-foreground": "#fbf1c7", - "--secondary": "#f2e5bc", - "--secondary-foreground": "#3c3836", - "--muted": "#f2e5bc", - "--muted-foreground": "#665c54", - "--accent": "#ebdbb2", - "--accent-foreground": "#3c3836", - "--border": "#a89984", - "--input": "#a89984", - "--ring": "#9d0006", - "--sidebar": "#f2e5bc", - "--sidebar-foreground": "#3c3836", - "--sidebar-accent": "#ebdbb2", - "--sidebar-accent-foreground": "#3c3836", - "--sidebar-border": "#a89984", - "--sidebar-ring": "#9d0006" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#928374", - "fontStyle": "italic" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "support.variable" - ], - "settings": { - "foreground": "#3c3836" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#8f3f71" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#8f3f71" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#9d0006" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#9d0006" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#79740e" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#8f3f71" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function" - ], - "settings": { - "foreground": "#79740e" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#b57614" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#3c3836" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#9d0006" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#427b58" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#79740e" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#9d0006", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#9d0006", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#928374", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#9d0006" - } - } - ] -} diff --git a/plugins/latex/LICENSE b/plugins/latex/LICENSE deleted file mode 100644 index 0ac28ee..0000000 --- a/plugins/latex/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015 - present Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/latex/README.md b/plugins/latex/README.md deleted file mode 100644 index c8d9081..0000000 --- a/plugins/latex/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# LaTeX Syntax - -Highlights `.tex`, `.ltx`, and `.sty` files. The LaTeX and TeX TextMate grammars are from Shiki's `@shikijs/langs` 4.5.0, derived from [VS Code's MIT-licensed grammars](https://github.com/microsoft/vscode/tree/main/extensions/latex). The TeX grammar is included as a dependency. Embedded languages whose grammars are not included may remain plain. diff --git a/plugins/latex/orca-plugin.json b/plugins/latex/orca-plugin.json deleted file mode 100644 index 866c621..0000000 --- a/plugins/latex/orca-plugin.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "manifestVersion": 2, - "publisher": "stablyai", - "version": "1.0.0", - "execution": "data", - "engines": { - "orca": ">=1.4.245" - }, - "capabilities": [], - "id": "orca-latex", - "name": "LaTeX Syntax", - "description": "Syntax highlighting for LaTeX documents and packages.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/latex", - "contributes": { - "syntaxes": [ - { - "id": "latex", - "title": "LaTeX", - "scopeName": "text.tex.latex", - "path": "syntaxes/latex.tmLanguage.json", - "configuration": "syntaxes/language-configuration.json", - "extensions": [ - ".tex", - ".ltx", - ".sty" - ] - }, - { - "id": "tex", - "title": "TeX grammar dependency", - "scopeName": "text.tex", - "path": "syntaxes/tex.tmLanguage.json" - } - ] - } -} diff --git a/plugins/latex/syntaxes/language-configuration.json b/plugins/latex/syntaxes/language-configuration.json deleted file mode 100644 index a8ba953..0000000 --- a/plugins/latex/syntaxes/language-configuration.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "comments": { - "lineComment": "%" - }, - "brackets": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ] - ], - "autoClosingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "\"", - "close": "\"" - } - ], - "surroundingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - } - ] -} diff --git a/plugins/latex/syntaxes/latex.tmLanguage.json b/plugins/latex/syntaxes/latex.tmLanguage.json deleted file mode 100644 index db8e023..0000000 --- a/plugins/latex/syntaxes/latex.tmLanguage.json +++ /dev/null @@ -1,4477 +0,0 @@ -{ - "displayName": "LaTeX", - "name": "latex", - "patterns": [ - { - "match": "(?<=\\\\(?:[@\\w]|[@\\w]{2}|[@\\w]{3}|[@\\w]{4}|[@\\w]{5}|[@\\w]{6}))\\s", - "name": "meta.space-after-command.latex" - }, - { - "include": "#songs-env" - }, - { - "include": "#embedded-code-env" - }, - { - "include": "#verbatim-env" - }, - { - "include": "#document-env" - }, - { - "include": "#all-balanced-env" - }, - { - "include": "#documentclass-usepackage-macro" - }, - { - "include": "#input-macro" - }, - { - "include": "#sections-macro" - }, - { - "include": "#hyperref-macro" - }, - { - "include": "#newcommand-macro" - }, - { - "include": "#text-font-macro" - }, - { - "include": "#citation-macro" - }, - { - "include": "#references-macro" - }, - { - "include": "#label-macro" - }, - { - "include": "#verb-macro" - }, - { - "include": "#inline-code-macro" - }, - { - "include": "#all-other-macro" - }, - { - "include": "#display-math" - }, - { - "include": "#inline-math" - }, - { - "include": "#column-specials" - }, - { - "include": "text.tex" - } - ], - "repository": { - "all-balanced-env": { - "patterns": [ - { - "begin": "\\s*((\\\\)begin)(\\{)((?:\\+?array|equation|(?:IEEE|sub)?eqnarray|multline|align|aligned|alignat|alignedat|flalign|flaligned|flalignat|split|gather|gathered|(?:[+dr]|dr)?cases|(?:display)?math|\\+?[A-Za-z]*matrix|[BVbpv]?NiceMatrix|[BVbpv]?NiceArray|(?:arg)?m(?:ini|axi))[!*]?)(})(\\s*\\n)?", - "captures": { - "1": { - "name": "support.function.be.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "4": { - "name": "variable.parameter.function.latex" - }, - "5": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "meta.math.block.latex support.class.math.block.environment.latex", - "end": "\\s*((\\\\)end)(\\{)(\\4)(})(?:\\s*\\n)?", - "name": "meta.function.environment.math.latex", - "patterns": [ - { - "match": "(?]*>)?((?:\\[[^]]*])*)(\\{)", - "captures": { - "1": { - "name": "keyword.control.cite.latex" - }, - "2": { - "name": "punctuation.definition.keyword.latex" - }, - "3": { - "patterns": [ - { - "include": "#autocites-arg" - } - ] - }, - "4": { - "patterns": [ - { - "include": "#optional-arg-angle-no-highlight" - } - ] - }, - "5": { - "patterns": [ - { - "include": "#optional-arg-bracket-no-highlight" - } - ] - }, - "6": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.citation.latex", - "patterns": [ - { - "captures": { - "1": { - "name": "comment.line.percentage.tex" - }, - "2": { - "name": "punctuation.definition.comment.tex" - } - }, - "match": "((%).*)$" - }, - { - "match": "[-.:\\p{Alphabetic}\\p{N}]+", - "name": "constant.other.reference.citation.latex" - } - ] - }, - "column-specials": { - "captures": { - "1": { - "name": "punctuation.definition.column-specials.begin.latex" - }, - "2": { - "name": "punctuation.definition.column-specials.end.latex" - } - }, - "match": "[<>](\\{)\\$(})", - "name": "meta.column-specials.latex" - }, - "display-math": { - "patterns": [ - { - "begin": "\\\\\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.latex" - } - }, - "end": "\\\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.latex" - } - }, - "name": "meta.math.block.latex support.class.math.block.environment.latex", - "patterns": [ - { - "include": "text.tex#math-content" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "\\$\\$", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.latex" - } - }, - "end": "\\$\\$", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.latex" - } - }, - "name": "meta.math.block.latex support.class.math.block.environment.latex", - "patterns": [ - { - "match": "\\\\\\$", - "name": "constant.character.escape.latex" - }, - { - "include": "text.tex#math-content" - }, - { - "include": "$self" - } - ] - } - ] - }, - "document-env": { - "patterns": [ - { - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "match": "(\\s*\\\\begin\\{document})", - "name": "meta.function.begin-document.latex" - }, - { - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "match": "(\\s*\\\\end\\{document})", - "name": "meta.function.end-document.latex" - } - ] - }, - "documentclass-usepackage-macro": { - "begin": "((\\\\)(?:usepackage|documentclass))\\b(?=[\\[{])", - "beginCaptures": { - "1": { - "name": "keyword.control.preamble.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.preamble.latex", - "patterns": [ - { - "include": "#multiline-optional-arg" - }, - { - "begin": "((?:\\G|(?<=]))\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "support.class.latex", - "end": "(})", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "embedded-code-env": { - "patterns": [ - { - "begin": "(?:^\\s*)?\\\\begin\\{(lstlisting|minted|pyglist)}(?=[\\[{])", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\\\end\\{\\1}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(asy(?:|mptote))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.asy", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.asy" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(bash)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.shell", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.shell" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(c(?:|pp))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.cpp.embedded.latex", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.cpp.embedded.latex" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(css)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.css", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.css" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(gnuplot)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.gnuplot", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.gnuplot" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(h(?:s|askell))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.haskell", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.haskell" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(html)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "text.html", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "text.html.basic" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(java)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.java", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.java" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(j(?:l|ulia))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.julia", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.julia" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(j(?:s|avascript))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.js", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.js" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(lua)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.lua", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.lua" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(py|python|sage)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.python" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(r(?:b|uby))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.ruby", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.ruby" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(rust)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.rust", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.rust" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(t(?:s|ypescript))(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.ts", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.ts" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(xml)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "text.xml", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "text.xml" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(\\{)(yaml)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "source.yaml", - "end": "^\\s*(?=\\\\end\\{(?:minted|lstlisting|pyglist)})", - "patterns": [ - { - "include": "source.yaml" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(?:(\\{)([A-Za-z]*)(}))?", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "meta.function.embedded.latex", - "end": "^\\s*(?=\\\\end\\{(?:lstlisting|minted|pyglist)})", - "name": "meta.embedded.block.generic.latex" - } - ] - }, - { - "begin": "\\s*\\\\begin\\{asy(?:|code)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{asy(?:|code)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.asymptote", - "end": "^\\s*(?=\\\\end\\{asy(?:|code)\\*?})", - "patterns": [ - { - "include": "source.asymptote" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{cppcode\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{cppcode\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.cpp.embedded.latex", - "end": "^\\s*(?=\\\\end\\{cppcode\\*?})", - "patterns": [ - { - "include": "source.cpp.embedded.latex" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{dot(?:2tex|code)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{dot(?:2tex|code)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.dot", - "end": "^\\s*(?=\\\\end\\{dot(?:2tex|code)\\*?})", - "patterns": [ - { - "include": "source.dot" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{gnuplot\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{gnuplot\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.gnuplot", - "end": "^\\s*(?=\\\\end\\{gnuplot\\*?})", - "patterns": [ - { - "include": "source.gnuplot" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{hscode\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{hscode\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.haskell", - "end": "^\\s*(?=\\\\end\\{hscode\\*?})", - "patterns": [ - { - "include": "source.haskell" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{java(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{java(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.java", - "end": "^\\s*(?=\\\\end\\{java(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.java" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{jl(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{jl(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.julia", - "end": "^\\s*(?=\\\\end\\{jl(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.julia" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{julia(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{julia(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.julia", - "end": "^\\s*(?=\\\\end\\{julia(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.julia" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{lua(?:code|draw)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{lua(?:code|draw)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.lua", - "end": "^\\s*(?=\\\\end\\{lua(?:code|draw)\\*?})", - "patterns": [ - { - "include": "source.lua" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{py(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{py(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{py(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{pylab(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{pylab(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{pylab(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{(?:sageblock|sagesilent|sageverbatim|sageexample|sagecommandline|pythonq??|pythonrepl)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{(?:sageblock|sagesilent|sageverbatim|sageexample|sagecommandline|pythonq??|pythonrepl)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{(?:sageblock|sagesilent|sageverbatim|sageexample|sagecommandline|pythonq??|pythonrepl)\\*?})", - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{scalacode\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{scalacode\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.scala", - "end": "^\\s*(?=\\\\end\\{scalacode\\*?})", - "patterns": [ - { - "include": "source.scala" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{sympy(?:code|verbatim|block|concode|console|converbatim)\\*?}(?:\\[[-0-9A-Z_a-z]*])?(?=[\\[{]|\\s*$)", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\s*\\\\end\\{sympy(?:code|verbatim|block|concode|console|converbatim)\\*?}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "variable.parameter.function.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - } - }, - { - "begin": "^(?=\\s*)", - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{sympy(?:code|verbatim|block|concode|console|converbatim)\\*?})", - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "\\s*\\\\begin\\{((?:[A-Za-z]*code|lstlisting|minted|pyglist)\\*?)}(?:\\[.*])?(?:\\{.*})?", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "meta.function.embedded.latex", - "end": "\\\\end\\{\\1}(?:\\s*\\n)?", - "name": "meta.embedded.block.generic.latex" - }, - { - "begin": "((?:^\\s*)?\\\\begin\\{((?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?))})(?:\\[[^]]*]){0,2}(?=\\{)", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "(\\\\end\\{\\2})", - "patterns": [ - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:asy(?:|mptote))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.asy", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.asy" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:bash)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.shell", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.shell" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:c(?:|pp))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.cpp.embedded.latex", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.cpp.embedded.latex" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:css)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.css", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.css" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:gnuplot)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.gnuplot", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.gnuplot" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:h(?:s|askell))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.haskell", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.haskell" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:html)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "text.html", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "text.html.basic" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:java)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.java", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.java" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:j(?:l|ulia))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.julia", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.julia" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:j(?:s|avascript))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.js", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.js" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:lua)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.lua", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.lua" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:py|python|sage)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.python", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:r(?:b|uby))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.ruby", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.ruby" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:rust)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.rust", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.rust" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:t(?:s|ypescript))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.ts", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.ts" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:xml)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "text.xml", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "text.xml" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:yaml)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "source.yaml", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "source.yaml" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)(?:__|[a-z\\s]*)(?i:tikz(?:|picture))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "text.tex.latex", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "include": "text.tex.latex" - } - ] - } - ] - }, - { - "begin": "\\G(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "patterns": [ - { - "begin": "\\G", - "end": "(})\\s*$", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "^(\\s*)", - "contentName": "meta.function.embedded.latex", - "end": "^\\s*(?=\\\\end\\{(?:RobExt)?(?:CacheMeCode|PlaceholderPathFromCode\\*?|PlaceholderFromCode\\*?|SetPlaceholderCode\\*?)})", - "name": "meta.embedded.block.generic.latex" - } - ] - } - ] - }, - { - "begin": "(?:^\\s*)?\\\\begin\\{(terminal\\*?)}(?=[\\[{])", - "captures": { - "0": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "end": "\\\\end\\{\\1}", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)([A-Za-z]*)(})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "contentName": "meta.function.embedded.latex", - "end": "^\\s*(?=\\\\end\\{terminal\\*?})", - "name": "meta.embedded.block.generic.latex" - } - ] - } - ] - }, - "hyperref-macro": { - "patterns": [ - { - "begin": "\\s*((\\\\)h(?:ref|yperref|yperimage))(?=[\\[{])", - "beginCaptures": { - "1": { - "name": "support.function.url.latex" - } - }, - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.function.hyperlink.latex", - "patterns": [ - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=]))(\\{)([^}]*)(})(?:\\{[^}]*}){2}?(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "markup.underline.link.latex" - }, - "3": { - "name": "punctuation.definition.arguments.end.latex" - }, - "4": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "meta.variable.parameter.function.latex", - "end": "(?=})", - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "begin": "(?:\\G|(?<=]))(?:(\\{)[^}]*(}))?(\\{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "2": { - "name": "punctuation.definition.arguments.end.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "meta.variable.parameter.function.latex", - "end": "(?=})", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - { - "captures": { - "1": { - "name": "support.function.url.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "4": { - "name": "markup.underline.link.latex" - }, - "5": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "match": "\\s*((\\\\)(?:url|path))(\\{)([^}]*)(})", - "name": "meta.function.link.url.latex" - } - ] - }, - "inline-code-macro": { - "patterns": [ - { - "begin": "((\\\\)addplot)\\+?(\\[[^\\[]*])*\\s*(gnuplot)\\s*(\\[[^\\[]*])*\\s*(\\{)", - "captures": { - "1": { - "name": "support.function.be.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "4": { - "name": "variable.parameter.function.latex" - }, - "5": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "6": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "\\s*(};)", - "patterns": [ - { - "begin": "%", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.latex" - } - }, - "end": "$\\n?", - "name": "comment.line.percentage.latex" - }, - { - "include": "source.gnuplot" - } - ] - }, - { - "captures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "4": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "5": { - "name": "punctuation.definition.arguments.end.latex" - }, - "6": { - "name": "punctuation.definition.verb.latex" - }, - "7": { - "name": "markup.raw.verb.latex" - }, - "8": { - "name": "punctuation.definition.verb.latex" - }, - "9": { - "name": "punctuation.definition.verb.latex" - }, - "10": { - "name": "markup.raw.verb.latex" - }, - "11": { - "name": "punctuation.definition.verb.latex" - } - }, - "match": "((\\\\)mint(?:|inline))((?:\\[[^\\[]*?])?)(\\{)[A-Za-z]*(})(?:([^A-Za-{])(.*?)(\\6)|(\\{)(.*?)(}))", - "name": "meta.function.verb.latex" - }, - { - "captures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "4": { - "name": "punctuation.definition.verb.latex" - }, - "5": { - "name": "markup.raw.verb.latex" - }, - "6": { - "name": "punctuation.definition.verb.latex" - }, - "7": { - "name": "punctuation.definition.verb.latex" - }, - "8": { - "name": "markup.raw.verb.latex" - }, - "9": { - "name": "punctuation.definition.verb.latex" - } - }, - "match": "((\\\\)[a-z]+inline)((?:\\[[^\\[]*?])?)(?:([^A-Za-{])(.*?)(\\4)|(\\{)(.*?)(}))", - "name": "meta.function.verb.latex" - }, - { - "captures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "4": { - "name": "punctuation.definition.verb.latex" - }, - "5": { - "name": "source.python", - "patterns": [ - { - "include": "source.python" - } - ] - }, - "6": { - "name": "punctuation.definition.verb.latex" - }, - "7": { - "name": "punctuation.definition.verb.latex" - }, - "8": { - "name": "source.python", - "patterns": [ - { - "include": "source.python" - } - ] - }, - "9": { - "name": "punctuation.definition.verb.latex" - } - }, - "match": "((\\\\)(?:(?:py|pycon|pylab|pylabcon|sympy|sympycon)[cv]?|pyq|pycq|pyif))((?:\\[[^\\[]*?])?)(?:([^](),;A-\\[a-{}\\s])(.*?)(\\4)|(\\{)(.*?)(}))", - "name": "meta.function.verb.latex" - }, - { - "captures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "4": { - "name": "punctuation.definition.verb.latex" - }, - "5": { - "name": "source.julia", - "patterns": [ - { - "include": "source.julia" - } - ] - }, - "6": { - "name": "punctuation.definition.verb.latex" - }, - "7": { - "name": "punctuation.definition.verb.latex" - }, - "8": { - "name": "source.julia", - "patterns": [ - { - "include": "source.julia" - } - ] - }, - "9": { - "name": "punctuation.definition.verb.latex" - } - }, - "match": "((\\\\)j(?:l|ulia)[cv]?)((?:\\[[^\\[]*?])?)(?:([^A-Za-{])(.*?)(\\4)|(\\{)(.*?)(}))", - "name": "meta.function.verb.latex" - }, - { - "begin": "((\\\\)(?:directlua|luadirect|luaexec))(\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.lua", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.lua" - }, - { - "include": "text.tex#braces" - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:asy(?:|mptote))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.asy", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.asy" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:bash)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.shell", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.shell" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:c(?:|pp))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.cpp.embedded.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.cpp.embedded.latex" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:css)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.css", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.css" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:gnuplot)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.gnuplot", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.gnuplot" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:h(?:s|askell))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.haskell", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.haskell" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:html)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "text.html", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.html.basic" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:java)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.java", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.java" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:j(?:l|ulia))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.julia", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.julia" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:j(?:s|avascript))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.js", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.js" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:lua)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.lua", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.lua" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:py|python|sage)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.python", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.python" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:r(?:b|uby))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.ruby", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.ruby" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:rust)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.rust", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.rust" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:t(?:s|ypescript))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.ts", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.ts" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:xml)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "text.xml", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.xml" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:yaml)\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "source.yaml", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "source.yaml" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=\\[(?i:tikz(?:|picture))\\b|\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "text.tex.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex.latex" - } - ] - } - ] - }, - { - "begin": "((\\\\)cacheMeCode)(?=[\\[{])", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - } - }, - "end": "(?<=})", - "patterns": [ - { - "include": "text.tex.latex#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?<=])(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "meta.embedded.block.generic.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "patterns": [ - { - "include": "text.tex#braces" - } - ] - } - ] - }, - { - "begin": "((\\\\)sys_get_shell:nnN(?:TF)?\\s?)(\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "markup.raw.verb.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - } - } - ] - }, - "inline-math": { - "patterns": [ - { - "begin": "\\\\\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.latex" - } - }, - "end": "\\\\\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.latex" - } - }, - "name": "meta.math.block.latex support.class.math.block.environment.latex", - "patterns": [ - { - "include": "text.tex#math-content" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "\\$(?!\\$)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.tex" - } - }, - "end": "(?)", - "name": "meta.parameter.optional.latex" - } - ] - }, - "optional-arg-bracket": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.optional.end.latex" - } - }, - "match": "(\\[)([^\\[]*?)(])", - "name": "meta.parameter.optional.latex" - } - ] - }, - "optional-arg-bracket-no-highlight": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "2": { - "name": "punctuation.definition.arguments.optional.end.latex" - } - }, - "match": "(\\[)[^\\[]*?(])", - "name": "meta.parameter.optional.latex" - } - ] - }, - "optional-arg-parenthesis": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "2": { - "name": "variable.parameter.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.optional.end.latex" - } - }, - "match": "(\\()([^(]*?)(\\))", - "name": "meta.parameter.optional.latex" - } - ] - }, - "optional-arg-parenthesis-no-highlight": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.arguments.optional.begin.latex" - }, - "2": { - "name": "punctuation.definition.arguments.optional.end.latex" - } - }, - "match": "(\\()[^(]*?(\\))", - "name": "meta.parameter.optional.latex" - } - ] - }, - "references-macro": { - "patterns": [ - { - "begin": "((\\\\)\\w*[Rr]ef\\*?)(?:\\[[^]]*])?(\\{)", - "beginCaptures": { - "1": { - "name": "keyword.control.ref.latex" - }, - "2": { - "name": "punctuation.definition.keyword.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.reference.label.latex", - "patterns": [ - { - "match": "[!*,-/:^_\\p{Alphabetic}\\p{N}]+", - "name": "constant.other.reference.label.latex" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.control.ref.latex" - }, - "2": { - "name": "punctuation.definition.keyword.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "4": { - "name": "constant.other.reference.label.latex" - }, - "5": { - "name": "punctuation.definition.arguments.end.latex" - }, - "6": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "7": { - "name": "constant.other.reference.label.latex" - }, - "8": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "match": "((\\\\)\\w*[Rr]efrange\\*?)(?:\\[[^]]*])?(\\{)([!*,-/:^_\\p{Alphabetic}\\p{N}]+)(})(\\{)([!*,-/:^_\\p{Alphabetic}\\p{N}]+)(})" - }, - { - "begin": "((\\\\)bibentry)(\\{)", - "captures": { - "1": { - "name": "keyword.control.cite.latex" - }, - "2": { - "name": "punctuation.definition.keyword.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.citation.latex", - "patterns": [ - { - "match": "[.:\\p{Alphabetic}\\p{N}]+", - "name": "constant.other.reference.citation.latex" - } - ] - } - ] - }, - "sections-macro": { - "begin": "((\\\\)((?:sub){0,2}section|(?:sub)?paragraph|chapter|part|addpart|addchap|addsec|minisec|frametitle)\\*?)((?:\\[[^\\[]*?]){0,2})(\\{)", - "beginCaptures": { - "1": { - "name": "support.function.section.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "4": { - "patterns": [ - { - "include": "#optional-arg-bracket" - } - ] - }, - "5": { - "name": "punctuation.definition.arguments.begin.latex" - } - }, - "contentName": "entity.name.section.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "name": "meta.function.section.$3.latex", - "patterns": [ - { - "include": "#braces" - }, - { - "include": "$self" - } - ] - }, - "songs-chords": { - "patterns": [ - { - "begin": "\\\\\\[", - "end": "]", - "name": "meta.chord.block.latex support.class.chord.block.environment.latex", - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "match": "\\^", - "name": "meta.chord.block.latex support.class.chord.block.environment.latex" - }, - { - "include": "$self" - } - ] - }, - "songs-env": { - "patterns": [ - { - "begin": "(\\s*\\\\begin\\{songs}\\{.*})", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "meta.data.environment.songs.latex", - "end": "(\\\\end\\{songs}(?:\\s*\\n)?)", - "name": "meta.function.environment.songs.latex", - "patterns": [ - { - "include": "text.tex.latex#songs-chords" - } - ] - }, - { - "begin": "\\s*((\\\\)beginsong)(?=\\{)", - "captures": { - "1": { - "name": "support.function.be.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.arguments.begin.latex" - }, - "4": { - "name": "punctuation.definition.arguments.end.latex" - } - }, - "end": "((\\\\)endsong)(?:\\s*\\n)?", - "name": "meta.function.environment.song.latex", - "patterns": [ - { - "include": "#multiline-arg-no-highlight" - }, - { - "include": "#multiline-optional-arg-no-highlight" - }, - { - "begin": "(?:\\G|(?<=[]}]))\\s*", - "contentName": "meta.data.environment.song.latex", - "end": "\\s*(?=\\\\endsong)", - "patterns": [ - { - "include": "text.tex.latex#songs-chords" - } - ] - } - ] - } - ] - }, - "text-font-macro": { - "patterns": [ - { - "begin": "((\\\\)emph)(\\{)", - "beginCaptures": { - "1": { - "name": "support.function.emph.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.emph.begin.latex" - } - }, - "contentName": "markup.italic.emph.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.emph.end.latex" - } - }, - "name": "meta.function.emph.latex", - "patterns": [ - { - "include": "#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "((\\\\)textit)(\\{)", - "captures": { - "1": { - "name": "support.function.textit.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.textit.begin.latex" - } - }, - "contentName": "markup.italic.textit.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.textit.end.latex" - } - }, - "name": "meta.function.textit.latex", - "patterns": [ - { - "include": "#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "((\\\\)textbf)(\\{)", - "captures": { - "1": { - "name": "support.function.textbf.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.textbf.begin.latex" - } - }, - "contentName": "markup.bold.textbf.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.textbf.end.latex" - } - }, - "name": "meta.function.textbf.latex", - "patterns": [ - { - "include": "#braces" - }, - { - "include": "$self" - } - ] - }, - { - "begin": "((\\\\)texttt)(\\{)", - "captures": { - "1": { - "name": "support.function.texttt.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.texttt.begin.latex" - } - }, - "contentName": "markup.raw.texttt.latex", - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.texttt.end.latex" - } - }, - "name": "meta.function.texttt.latex", - "patterns": [ - { - "include": "#braces" - }, - { - "include": "$self" - } - ] - } - ] - }, - "unbalanced-env": { - "patterns": [ - { - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "match": "(\\s*\\\\(?:begin|end)\\{(\\p{Alphabetic}+\\*?)})", - "name": "meta.function.environment.general.latex" - } - ] - }, - "verb-macro": { - "patterns": [ - { - "begin": "((\\\\)(?:[Vv]|spv)erb\\*?)\\s*((\\\\)scantokens)(\\{)", - "beginCaptures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "support.function.verb.latex" - }, - "4": { - "name": "punctuation.definition.verb.latex" - }, - "5": { - "name": "punctuation.definition.begin.latex" - } - }, - "contentName": "markup.raw.verb.latex", - "end": "(})", - "endCaptures": { - "1": { - "name": "punctuation.definition.end.latex" - } - }, - "name": "meta.function.verb.latex", - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "captures": { - "1": { - "name": "support.function.verb.latex" - }, - "2": { - "name": "punctuation.definition.function.latex" - }, - "3": { - "name": "punctuation.definition.verb.latex" - }, - "4": { - "name": "markup.raw.verb.latex" - }, - "5": { - "name": "punctuation.definition.verb.latex" - } - }, - "match": "((\\\\)(?:[Vv]|spv)erb\\*?)\\s*((?<=\\s)\\S|[^A-Za-z])(.*?)(\\3|$)", - "name": "meta.function.verb.latex" - } - ] - }, - "verbatim-env": { - "patterns": [ - { - "begin": "(\\s*\\\\begin\\{((?:fboxv|boxedv|[Vv]|spv)erbatim\\*?)})", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "markup.raw.verbatim.latex", - "end": "(\\\\end\\{\\2})", - "name": "meta.function.verbatim.latex" - }, - { - "begin": "(\\s*\\\\begin\\{VerbatimOut}\\{[^}]*})", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "markup.raw.verbatim.latex", - "end": "(\\\\end\\{VerbatimOut})", - "name": "meta.function.verbatim.latex" - }, - { - "begin": "(\\s*\\\\begin\\{alltt})", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "markup.raw.verbatim.latex", - "end": "(\\\\end\\{alltt})", - "name": "meta.function.alltt.latex", - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.function.latex" - } - }, - "match": "(\\\\)[A-Za-z]+", - "name": "support.function.general.latex" - } - ] - }, - { - "begin": "(\\s*\\\\begin\\{([Cc]omment)})", - "captures": { - "1": { - "patterns": [ - { - "include": "#macro-with-args-tokenizer" - } - ] - } - }, - "contentName": "comment.line.percentage.latex", - "end": "(\\\\end\\{\\2})", - "name": "meta.function.verbatim.latex" - } - ] - } - }, - "scopeName": "text.tex.latex", - "embeddedLangs": [ - "tex" - ], - "embeddedLangsLazy": [ - "shellscript", - "css", - "gnuplot", - "haskell", - "html", - "java", - "julia", - "javascript", - "lua", - "python", - "ruby", - "rust", - "typescript", - "xml", - "yaml", - "scala" - ] -} diff --git a/plugins/latex/syntaxes/tex.tmLanguage.json b/plugins/latex/syntaxes/tex.tmLanguage.json deleted file mode 100644 index bcd0b54..0000000 --- a/plugins/latex/syntaxes/tex.tmLanguage.json +++ /dev/null @@ -1,375 +0,0 @@ -{ - "displayName": "TeX", - "name": "tex", - "patterns": [ - { - "include": "#iffalse-block" - }, - { - "include": "#macro-control" - }, - { - "include": "#catcode" - }, - { - "include": "#comment" - }, - { - "match": "[]\\[]", - "name": "punctuation.definition.brackets.tex" - }, - { - "include": "#dollar-math" - }, - { - "match": "\\\\\\\\", - "name": "keyword.control.newline.tex" - }, - { - "include": "#ifnextchar" - }, - { - "include": "#macro-general" - } - ], - "repository": { - "braces": { - "begin": "(?\\[|]|\\\\[{|}]|\\\\[lr]?[Vv]ert|\\\\[lr]angle)", - "name": "punctuation.math.bracket.pair.big.tex" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.constant.math.tex" - } - }, - "match": "(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c([au]p)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook((?:lef|righ)tarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n([ew]arrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v([Dd]ash)|warrow|le(ss|q(slant|q)?|ft((?:|right)arrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left((?:|right)arrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot([ps])?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee((?:down|up)arrow)?|wedge((?:down|up)arrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead((?:lef|righ)tarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u([bp]set))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C([au]p)|u(n([lr]hd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t([ah])|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P((?:s|h?)i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left((?:|right)arrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot([ps])|e(ss(sim|dot|eq(q?gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(v??dash)|r(h([do])|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(q?less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc([au]p))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left((?:|right)arrow)|rightarrow|maps(to|from))|eft((?:|right)arrow)|leftarrow|ambda|bag)|ge|le|Arrownot)(?![@-Za-z])", - "name": "constant.character.math.tex" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.constant.math.tex" - } - }, - "match": "(\\\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\\b", - "name": "constant.character.math.tex" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.constant.math.tex" - } - }, - "match": "(\\\\)(arccos|arcsin|arctan|arg|cosh??|coth??|csc|deg|det|dim|exp|gcd|hom|inf|ker|lg|lim|liminf|limsup|ln|log|max|min|pr|sec|sinh??|sup|tanh??)\\b", - "name": "constant.other.math.tex" - }, - { - "begin": "((\\\\)Sexpr(\\{))", - "beginCaptures": { - "1": { - "name": "support.function.sexpr.math.tex" - }, - "2": { - "name": "punctuation.definition.function.math.tex" - }, - "3": { - "name": "punctuation.section.embedded.begin.math.tex" - } - }, - "contentName": "support.function.sexpr.math.tex", - "end": "(((})))", - "endCaptures": { - "1": { - "name": "support.function.sexpr.math.tex" - }, - "2": { - "name": "punctuation.section.embedded.end.math.tex" - }, - "3": { - "name": "source.r" - } - }, - "name": "meta.embedded.line.r", - "patterns": [ - { - "begin": "\\G(?!})", - "end": "(?=})", - "name": "source.r", - "patterns": [ - { - "include": "source.r" - } - ] - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.definition.constant.math.tex" - } - }, - "match": "(\\\\)(?!begin\\{|verb)([A-Za-z]+)", - "name": "constant.other.general.math.tex" - }, - { - "match": "(?=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "midnight", - "title": "Orca Midnight", - "path": "themes/midnight.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A crescent moon and stars over a deep blue-grey night sky, with the word Midnight and the theme palette" - }, - "screenshots": [ - { - "path": "images/editor.png", - "alt": "Orca Midnight on the editor and terminal", - "caption": "Editor and terminal" - }, - { - "path": "images/settings.png", - "alt": "Orca Midnight selected in Appearance settings", - "caption": "Appearance settings" - } - ] -} diff --git a/plugins/midnight-theme/themes/midnight.json b/plugins/midnight-theme/themes/midnight.json deleted file mode 100644 index 9762d7d..0000000 --- a/plugins/midnight-theme/themes/midnight.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "base": "dark", - "tokens": { - "--background": "#101216", - "--editor-surface": "#0c0e12", - "--foreground": "#e8eaf0", - "--card": "#161920", - "--card-foreground": "#e8eaf0", - "--popover": "#181b22", - "--popover-foreground": "#e8eaf0", - "--primary": "#e8eaf0", - "--primary-foreground": "#101216", - "--secondary": "#242832", - "--secondary-foreground": "#e8eaf0", - "--muted": "#20242c", - "--muted-foreground": "#a7adbb", - "--accent": "#292e39", - "--accent-foreground": "#f4f5f8", - "--border": "#343a47", - "--input": "#1b1e26", - "--ring": "#9ca7bd", - "--sidebar": "#13161b", - "--sidebar-foreground": "#dfe2e9", - "--sidebar-accent": "#252a34", - "--sidebar-accent-foreground": "#f4f5f8", - "--sidebar-border": "#303642", - "--sidebar-ring": "#9ca7bd" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#7f879a", - "fontStyle": "italic" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#b9a7f8" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#9ca7bd" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#a6d9a0" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#f0c27b" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#f2a97f" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#f2a97f" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function", - "meta.function-call" - ], - "settings": { - "foreground": "#86b6ff" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#76d2d0" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "variable.parameter", - "support.variable" - ], - "settings": { - "foreground": "#e8eaf0" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#a7adbb" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#b9a7f8" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#76d2d0" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#f0c27b" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#86b6ff", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#76d2d0", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#7f879a", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#ff7b7b" - } - } - ] -} diff --git a/plugins/minimal-icons/LICENSE b/plugins/minimal-icons/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/minimal-icons/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/minimal-icons/icons/file.svg b/plugins/minimal-icons/icons/file.svg deleted file mode 100644 index 6d208df..0000000 --- a/plugins/minimal-icons/icons/file.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/folder-open.svg b/plugins/minimal-icons/icons/folder-open.svg deleted file mode 100644 index 1608288..0000000 --- a/plugins/minimal-icons/icons/folder-open.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/folder.svg b/plugins/minimal-icons/icons/folder.svg deleted file mode 100644 index cf8fef6..0000000 --- a/plugins/minimal-icons/icons/folder.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/json.svg b/plugins/minimal-icons/icons/json.svg deleted file mode 100644 index 191bfff..0000000 --- a/plugins/minimal-icons/icons/json.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/markdown.svg b/plugins/minimal-icons/icons/markdown.svg deleted file mode 100644 index 5a7fa4b..0000000 --- a/plugins/minimal-icons/icons/markdown.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/package.svg b/plugins/minimal-icons/icons/package.svg deleted file mode 100644 index 3322a71..0000000 --- a/plugins/minimal-icons/icons/package.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/plugin.svg b/plugins/minimal-icons/icons/plugin.svg deleted file mode 100644 index b7df7b4..0000000 --- a/plugins/minimal-icons/icons/plugin.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/icons/theme.json b/plugins/minimal-icons/icons/theme.json deleted file mode 100644 index 89ff7ab..0000000 --- a/plugins/minimal-icons/icons/theme.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "schemaVersion": 1, - "icons": { - "file": "icons/file.svg", - "folder": "icons/folder.svg", - "folder-open": "icons/folder-open.svg" - }, - "fileNames": { - "package.json": "icons/package.svg", - "orca-plugin.json": "icons/plugin.svg" - }, - "fileExtensions": { - "ts": "icons/typescript.svg", - "tsx": "icons/typescript.svg", - "md": "icons/markdown.svg", - "json": "icons/json.svg" - } -} diff --git a/plugins/minimal-icons/icons/typescript.svg b/plugins/minimal-icons/icons/typescript.svg deleted file mode 100644 index 6e38d3c..0000000 --- a/plugins/minimal-icons/icons/typescript.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/minimal-icons/images/cover.png b/plugins/minimal-icons/images/cover.png deleted file mode 100644 index a8d3ff5..0000000 Binary files a/plugins/minimal-icons/images/cover.png and /dev/null differ diff --git a/plugins/minimal-icons/images/explorer.png b/plugins/minimal-icons/images/explorer.png deleted file mode 100644 index 73b5b96..0000000 Binary files a/plugins/minimal-icons/images/explorer.png and /dev/null differ diff --git a/plugins/minimal-icons/orca-plugin.json b/plugins/minimal-icons/orca-plugin.json deleted file mode 100644 index e6706dd..0000000 --- a/plugins/minimal-icons/orca-plugin.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-minimal-icons", - "publisher": "stablyai", - "name": "Orca Minimal Icons", - "version": "2.0.0", - "execution": "data", - "description": "A compact monochrome icon theme for common source files.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/minimal-icons", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "iconThemes": [ - { - "id": "minimal", - "title": "Minimal", - "path": "icons/theme.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "The Minimal icons in the file explorer and the eight icons the theme provides" - }, - "screenshots": [ - { - "path": "images/explorer.png", - "alt": "Minimal icons in the explorer and editor tabs", - "caption": "Explorer and tabs" - } - ] -} diff --git a/plugins/multipass-recipes/LICENSE b/plugins/multipass-recipes/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/multipass-recipes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/multipass-recipes/images/cover.png b/plugins/multipass-recipes/images/cover.png deleted file mode 100644 index 2f23048..0000000 Binary files a/plugins/multipass-recipes/images/cover.png and /dev/null differ diff --git a/plugins/multipass-recipes/images/session.png b/plugins/multipass-recipes/images/session.png deleted file mode 100644 index 218b756..0000000 Binary files a/plugins/multipass-recipes/images/session.png and /dev/null differ diff --git a/plugins/multipass-recipes/orca-plugin.json b/plugins/multipass-recipes/orca-plugin.json deleted file mode 100644 index 855ed81..0000000 --- a/plugins/multipass-recipes/orca-plugin.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-multipass-recipes", - "publisher": "stablyai", - "name": "Multipass VM Recipes", - "version": "2.0.0", - "execution": "declarative", - "description": "A reviewed starter lifecycle for disposable Multipass workspaces.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/multipass-recipes", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "vmRecipes": [ - { - "path": "recipes/ubuntu-lts.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "The Multipass Ubuntu LTS recipe with its create, suspend, resume and destroy commands" - }, - "screenshots": [ - { - "path": "images/session.png", - "alt": "A terminal on a Multipass machine created by the recipe", - "caption": "Machine terminal" - } - ] -} diff --git a/plugins/multipass-recipes/recipes/ubuntu-lts.json b/plugins/multipass-recipes/recipes/ubuntu-lts.json deleted file mode 100644 index b2c60c7..0000000 --- a/plugins/multipass-recipes/recipes/ubuntu-lts.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "schemaVersion": 1, - "id": "multipass-ubuntu-lts", - "name": "Multipass Ubuntu LTS", - "description": "Creates a four-CPU disposable Ubuntu workspace with Multipass.", - "create": "multipass launch 24.04 --name \"$ORCA_VM_NAME\" --cpus 4 --memory 8G --disk 40G", - "suspend": "multipass suspend \"$ORCA_VM_NAME\"", - "resume": "multipass start \"$ORCA_VM_NAME\"", - "destroy": "multipass delete \"$ORCA_VM_NAME\" --purge" -} diff --git a/plugins/nix/LICENSE b/plugins/nix/LICENSE deleted file mode 100644 index dc224ec..0000000 --- a/plugins/nix/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 noor - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/plugins/nix/README.md b/plugins/nix/README.md deleted file mode 100644 index c3e79b7..0000000 --- a/plugins/nix/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Nix Syntax - -Highlights `.nix` files. The TextMate grammar is from [nix-community/vscode-nix-ide](https://github.com/nix-community/vscode-nix-ide), vendored from [Orca PR #9198](https://github.com/stablyai/orca/pull/9198) at commit `f43575f8487615d15a78216c5e67a0dd3716dd38`. Its MIT license is included. diff --git a/plugins/nix/orca-plugin.json b/plugins/nix/orca-plugin.json deleted file mode 100644 index fee2628..0000000 --- a/plugins/nix/orca-plugin.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "manifestVersion": 2, - "publisher": "stablyai", - "version": "1.0.0", - "execution": "data", - "license": "MIT", - "engines": { - "orca": ">=1.4.245" - }, - "capabilities": [], - "id": "orca-nix", - "name": "Nix Syntax", - "description": "Syntax highlighting and editor configuration for Nix files.", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/nix", - "contributes": { - "syntaxes": [ - { - "id": "nix", - "title": "Nix", - "scopeName": "source.nix", - "path": "syntaxes/nix.tmLanguage.json", - "configuration": "syntaxes/language-configuration.json", - "extensions": [ - ".nix" - ] - } - ] - } -} diff --git a/plugins/nix/syntaxes/language-configuration.json b/plugins/nix/syntaxes/language-configuration.json deleted file mode 100644 index d803d78..0000000 --- a/plugins/nix/syntaxes/language-configuration.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "comments": { - "lineComment": "#", - "blockComment": [ - "/*", - "*/" - ] - }, - "brackets": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ] - ], - "autoClosingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "'", - "close": "'" - } - ], - "surroundingPairs": [ - { - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "\"", - "close": "\"" - }, - { - "open": "'", - "close": "'" - } - ] -} diff --git a/plugins/nix/syntaxes/nix-LICENSE.txt b/plugins/nix/syntaxes/nix-LICENSE.txt deleted file mode 100644 index dc224ec..0000000 --- a/plugins/nix/syntaxes/nix-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 noor - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/plugins/nix/syntaxes/nix.tmLanguage.json b/plugins/nix/syntaxes/nix.tmLanguage.json deleted file mode 100644 index 1d02a5b..0000000 --- a/plugins/nix/syntaxes/nix.tmLanguage.json +++ /dev/null @@ -1,1188 +0,0 @@ -{ - "name": "Nix", - "scopeName": "source.nix", - "fileTypes": [ - "nix" - ], - "uuid": "0514fd5f-acb6-436d-b42c-7643e6d36c8f", - "patterns": [ - { - "include": "#expression" - } - ], - "repository": { - "expression": { - "patterns": [ - { - "include": "#parens-and-cont" - }, - { - "include": "#list-and-cont" - }, - { - "include": "#string" - }, - { - "include": "#interpolation" - }, - { - "include": "#with-assert" - }, - { - "include": "#function-for-sure" - }, - { - "include": "#attrset-for-sure" - }, - { - "include": "#attrset-or-function" - }, - { - "include": "#let" - }, - { - "include": "#if" - }, - { - "include": "#operator-unary" - }, - { - "include": "#operator-binary" - }, - { - "include": "#constants" - }, - { - "include": "#bad-reserved" - }, - { - "include": "#parameter-name-and-cont" - }, - { - "include": "#others" - } - ] - }, - "expression-cont": { - "begin": "(?=.?)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#parens" - }, - { - "include": "#list" - }, - { - "include": "#string" - }, - { - "include": "#interpolation" - }, - { - "include": "#function-for-sure" - }, - { - "include": "#attrset-for-sure" - }, - { - "include": "#attrset-or-function" - }, - { - "include": "#operator-binary" - }, - { - "include": "#constants" - }, - { - "include": "#bad-reserved" - }, - { - "include": "#parameter-name" - }, - { - "include": "#others" - } - ] - }, - "parens": { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.expression.nix" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.expression.nix" - } - }, - "patterns": [ - { - "include": "#expression" - } - ] - }, - "parens-and-cont": { - "begin": "(?=\\()", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#parens" - }, - { - "include": "#expression-cont" - } - ] - }, - "list": { - "begin": "\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.list.nix" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.list.nix" - } - }, - "patterns": [ - { - "include": "#expression" - } - ] - }, - "list-and-cont": { - "begin": "(?=\\[)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#list" - }, - { - "include": "#expression-cont" - } - ] - }, - "attrset-for-sure": { - "patterns": [ - { - "begin": "(?=\\brec\\b)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "begin": "\\brec\\b", - "end": "(?=\\{)", - "beginCaptures": { - "0": { - "name": "keyword.other.nix" - } - }, - "patterns": [ - { - "include": "#others" - } - ] - }, - { - "include": "#attrset-definition" - }, - { - "include": "#others" - } - ] - }, - { - "begin": "(?=\\{\\s*(\\}|[^,?]*(=|;)))", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#attrset-definition" - }, - { - "include": "#others" - } - ] - } - ] - }, - "attrset-definition": { - "begin": "(?=\\{)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "begin": "(\\{)", - "end": "(\\})", - "beginCaptures": { - "0": { - "name": "punctuation.definition.attrset.nix" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.attrset.nix" - } - }, - "patterns": [ - { - "include": "#attrset-contents" - } - ] - }, - { - "begin": "(?<=\\})", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - } - ] - }, - "attrset-definition-brace-opened": { - "patterns": [ - { - "begin": "(?<=\\})", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - }, - { - "begin": "(?=.?)", - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.attrset.nix" - } - }, - "patterns": [ - { - "include": "#attrset-contents" - } - ] - } - ] - }, - "attrset-contents": { - "patterns": [ - { - "include": "#attribute-inherit" - }, - { - "include": "#bad-reserved" - }, - { - "include": "#attribute-bind" - }, - { - "include": "#others" - } - ] - }, - "function-header-open-brace": { - "begin": "\\{", - "end": "(?=\\})", - "beginCaptures": { - "0": { - "name": "punctuation.definition.entity.function.2.nix" - } - }, - "patterns": [ - { - "include": "#function-contents" - } - ] - }, - "function-header-close-brace-no-arg": { - "begin": "\\}", - "end": "(?=\\:)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.entity.function.nix" - } - }, - "patterns": [ - { - "include": "#others" - } - ] - }, - "function-header-terminal-arg": { - "begin": "(?=@)", - "end": "(?=\\:)", - "patterns": [ - { - "begin": "\\@", - "end": "(?=\\:)", - "patterns": [ - { - "begin": "(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*)", - "end": "(?=\\:)", - "name": "variable.parameter.function.3.nix" - }, - { - "include": "#others" - } - ] - }, - { - "include": "#others" - } - ] - }, - "function-header-close-brace-with-arg": { - "begin": "\\}", - "end": "(?=\\:)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.entity.function.nix" - } - }, - "patterns": [ - { - "include": "#function-header-terminal-arg" - }, - { - "include": "#others" - } - ] - }, - "function-header-until-colon-no-arg": { - "begin": "(?=\\{)", - "end": "(?=\\:)", - "patterns": [ - { - "include": "#function-header-open-brace" - }, - { - "include": "#function-header-close-brace-no-arg" - } - ] - }, - "function-header-until-colon-with-arg": { - "begin": "(?=\\{)", - "end": "(?=\\:)", - "patterns": [ - { - "include": "#function-header-open-brace" - }, - { - "include": "#function-header-close-brace-with-arg" - } - ] - }, - "function-body-from-colon": { - "begin": "(\\:)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "beginCaptures": { - "0": { - "name": "punctuation.definition.function.nix" - } - }, - "patterns": [ - { - "include": "#expression" - } - ] - }, - "function-definition": { - "begin": "(?=.?)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-body-from-colon" - }, - { - "begin": "(?=.?)", - "end": "(?=\\:)", - "patterns": [ - { - "begin": "(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*)", - "end": "(?=\\:)", - "beginCaptures": { - "0": { - "name": "variable.parameter.function.4.nix" - } - }, - "patterns": [ - { - "begin": "\\@", - "end": "(?=\\:)", - "patterns": [ - { - "include": "#function-header-until-colon-no-arg" - }, - { - "include": "#others" - } - ] - }, - { - "include": "#others" - } - ] - }, - { - "begin": "(?=\\{)", - "end": "(?=\\:)", - "patterns": [ - { - "include": "#function-header-until-colon-with-arg" - } - ] - } - ] - }, - { - "include": "#others" - } - ] - }, - "function-definition-brace-opened": { - "begin": "(?=.?)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-body-from-colon" - }, - { - "begin": "(?=.?)", - "end": "(?=\\:)", - "patterns": [ - { - "include": "#function-header-close-brace-with-arg" - }, - { - "begin": "(?=.?)", - "end": "(?=\\})", - "patterns": [ - { - "include": "#function-contents" - } - ] - } - ] - }, - { - "include": "#others" - } - ] - }, - "function-for-sure": { - "patterns": [ - { - "begin": "(?=(\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*\\s*[:@]|\\{[^}\\\"']*\\}\\s*:|\\{[^#}\"'/=]*[,\\?]))", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-definition" - } - ] - } - ] - }, - "function-contents": { - "patterns": [ - { - "include": "#bad-reserved" - }, - { - "include": "#function-parameter" - }, - { - "include": "#others" - } - ] - }, - "attrset-or-function": { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.attrset-or-function.nix" - } - }, - "end": "(?=([\\])};]|\\b(else|then)\\b))", - "patterns": [ - { - "begin": "(?=(\\s*\\}|\\\"|\\binherit\\b|\\$\\{|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*(\\s*\\.|\\s*=[^=])))", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#attrset-definition-brace-opened" - } - ] - }, - { - "begin": "(?=(\\.\\.\\.|\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*\\s*[,?]))", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-definition-brace-opened" - } - ] - }, - { - "include": "#bad-reserved" - }, - { - "begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "end": "(?=([\\])};]|\\b(else|then)\\b))", - "beginCaptures": { - "0": { - "name": "variable.parameter.function.maybe.nix" - } - }, - "patterns": [ - { - "begin": "(?=\\.)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#attrset-definition-brace-opened" - } - ] - }, - { - "begin": "\\s*(\\,)", - "beginCaptures": { - "1": { - "name": "keyword.operator.nix" - } - }, - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-definition-brace-opened" - } - ] - }, - { - "begin": "(?=\\=)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#attribute-bind-from-equals" - }, - { - "include": "#attrset-definition-brace-opened" - } - ] - }, - { - "begin": "(?=\\?)", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-parameter-default" - }, - { - "begin": "\\,", - "beginCaptures": { - "0": { - "name": "keyword.operator.nix" - } - }, - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#function-definition-brace-opened" - } - ] - } - ] - }, - { - "include": "#others" - } - ] - }, - { - "include": "#others" - } - ] - }, - "with-assert": { - "begin": "(?)", - "beginCaptures": { - "0": { - "name": "string.unquoted.spath.nix" - } - }, - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - }, - { - "begin": "([a-zA-Z][a-zA-Z0-9\\+\\-\\.]*\\:[a-zA-Z0-9\\%\\/\\?\\:\\@\\&\\=\\+\\$\\,\\-\\_\\.\\!\\~\\*\\']+)", - "beginCaptures": { - "0": { - "name": "string.unquoted.url.nix" - } - }, - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - } - ] - }, - "parameter-name": { - "match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "captures": { - "0": { - "name": "variable.parameter.name.nix" - } - } - }, - "parameter-name-and-cont": { - "begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "beginCaptures": { - "0": { - "name": "variable.parameter.name.nix" - } - }, - "patterns": [ - { - "include": "#expression-cont" - } - ] - }, - "attribute-name-single": { - "match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "name": "entity.other.attribute-name.single.nix" - }, - "attribute-name": { - "patterns": [ - { - "match": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "name": "entity.other.attribute-name.multipart.nix" - }, - { - "match": "\\." - }, - { - "include": "#string-quoted" - }, - { - "include": "#interpolation" - } - ] - }, - "function-parameter-default": { - "begin": "\\?", - "beginCaptures": { - "0": { - "name": "keyword.operator.nix" - } - }, - "end": "(?=[,}])", - "patterns": [ - { - "include": "#expression" - } - ] - }, - "function-parameter": { - "patterns": [ - { - "begin": "(\\.\\.\\.)", - "end": "(,|(?=\\}))", - "name": "keyword.operator.nix", - "patterns": [ - { - "include": "#others" - } - ] - }, - { - "begin": "\\b[a-zA-Z\\_][a-zA-Z0-9\\_\\'\\-]*", - "beginCaptures": { - "0": { - "name": "variable.parameter.function.1.nix" - } - }, - "end": "(,|(?=\\}))", - "endCaptures": { - "0": { - "name": "keyword.operator.nix" - } - }, - "patterns": [ - { - "include": "#whitespace" - }, - { - "include": "#comment" - }, - { - "include": "#function-parameter-default" - }, - { - "include": "#expression" - } - ] - }, - { - "include": "#others" - } - ] - }, - "attribute-inherit": { - "begin": "\\binherit\\b", - "beginCaptures": { - "0": { - "name": "keyword.other.inherit.nix" - } - }, - "end": "\\;", - "endCaptures": { - "0": { - "name": "punctuation.terminator.inherit.nix" - } - }, - "patterns": [ - { - "begin": "\\(", - "end": "(?=\\;)", - "beginCaptures": { - "0": { - "name": "punctuation.section.function.arguments.nix" - } - }, - "patterns": [ - { - "begin": "\\)", - "end": "(?=\\;)", - "beginCaptures": { - "0": { - "name": "punctuation.section.function.arguments.nix" - } - }, - "patterns": [ - { - "include": "#bad-reserved" - }, - { - "include": "#attribute-name-single" - }, - { - "include": "#others" - } - ] - }, - { - "include": "#expression" - } - ] - }, - { - "begin": "(?=[a-zA-Z\\_])", - "end": "(?=\\;)", - "patterns": [ - { - "include": "#bad-reserved" - }, - { - "include": "#attribute-name-single" - }, - { - "include": "#others" - } - ] - }, - { - "include": "#others" - } - ] - }, - "attribute-bind-from-equals": { - "begin": "\\=", - "beginCaptures": { - "0": { - "name": "keyword.operator.bind.nix" - } - }, - "end": "\\;", - "endCaptures": { - "0": { - "name": "punctuation.terminator.bind.nix" - } - }, - "patterns": [ - { - "include": "#expression" - } - ] - }, - "attribute-bind": { - "patterns": [ - { - "include": "#attribute-name" - }, - { - "include": "#attribute-bind-from-equals" - } - ] - }, - "operator-unary": { - "name": "keyword.operator.unary.nix", - "match": "(!|-)" - }, - "operator-binary": { - "name": "keyword.operator.nix", - "match": "(\\bor\\b|\\.|\\|\\>|\\<\\||==|!=|!|\\<\\=|\\<|\\>\\=|\\>|&&|\\|\\||-\\>|//|\\?|\\+\\+|-|\\*|/(?=([^*]|$))|\\+)" - }, - "constants": { - "patterns": [ - { - "begin": "\\b(builtins|true|false|null)\\b", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "beginCaptures": { - "0": { - "name": "constant.language.nix" - } - }, - "patterns": [ - { - "include": "#expression-cont" - } - ] - }, - { - "beginCaptures": { - "0": { - "name": "support.function.nix" - } - }, - "begin": "\\b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\\b", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - }, - { - "beginCaptures": { - "0": { - "name": "constant.numeric.nix" - } - }, - "begin": "\\b[0-9]+\\b", - "end": "(?=([\\])};,]|\\b(else|then)\\b))", - "patterns": [ - { - "include": "#expression-cont" - } - ] - } - ] - }, - "whitespace": { - "match": "\\s+" - }, - "illegal": { - "match": ".", - "name": "invalid.illegal" - }, - "others": { - "patterns": [ - { - "include": "#whitespace" - }, - { - "include": "#comment" - }, - { - "include": "#illegal" - } - ] - }, - "bad-reserved": { - "match": "(?=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "nord", - "title": "Nord", - "path": "themes/nord.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "The Nord theme on an editor with a file tree and a TypeScript file" - }, - "screenshots": [ - { - "path": "images/editor.png", - "alt": "Nord on the editor and terminal", - "caption": "Editor and terminal" - }, - { - "path": "images/settings.png", - "alt": "Nord selected in Appearance settings", - "caption": "Appearance settings" - } - ] -} diff --git a/plugins/nord-theme/themes/nord.json b/plugins/nord-theme/themes/nord.json deleted file mode 100644 index e87fccd..0000000 --- a/plugins/nord-theme/themes/nord.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "base": "dark", - "tokens": { - "--background": "#2e3440", - "--editor-surface": "#292e39", - "--foreground": "#eceff4", - "--card": "#3b4252", - "--card-foreground": "#eceff4", - "--popover": "#3b4252", - "--popover-foreground": "#eceff4", - "--primary": "#88c0d0", - "--primary-foreground": "#2e3440", - "--secondary": "#434c5e", - "--secondary-foreground": "#eceff4", - "--muted": "#3b4252", - "--muted-foreground": "#d8dee9", - "--accent": "#4c566a", - "--accent-foreground": "#eceff4", - "--border": "#4c566a", - "--input": "#3b4252", - "--ring": "#81a1c1", - "--sidebar": "#292e39", - "--sidebar-foreground": "#e5e9f0", - "--sidebar-accent": "#434c5e", - "--sidebar-accent-foreground": "#eceff4", - "--sidebar-border": "#4c566a", - "--sidebar-ring": "#81a1c1" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#9099ac", - "fontStyle": "italic" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#81a1c1" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#81a1c1" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#a3be8c" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#ebcb8b" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#b48ead" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#81a1c1" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function", - "meta.function-call" - ], - "settings": { - "foreground": "#88c0d0" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#8fbcbb" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "variable.parameter", - "support.variable" - ], - "settings": { - "foreground": "#d8dee9" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#eceff4" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#81a1c1" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#8fbcbb" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#d08770" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#88c0d0", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#88c0d0", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#9099ac", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#dc8088" - } - } - ] -} diff --git a/plugins/oled-theme/LICENSE b/plugins/oled-theme/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/oled-theme/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/oled-theme/images/cover.png b/plugins/oled-theme/images/cover.png deleted file mode 100644 index b33d258..0000000 Binary files a/plugins/oled-theme/images/cover.png and /dev/null differ diff --git a/plugins/oled-theme/images/palette.png b/plugins/oled-theme/images/palette.png deleted file mode 100644 index 064fe0f..0000000 Binary files a/plugins/oled-theme/images/palette.png and /dev/null differ diff --git a/plugins/oled-theme/images/workspace.png b/plugins/oled-theme/images/workspace.png deleted file mode 100644 index 21f2388..0000000 Binary files a/plugins/oled-theme/images/workspace.png and /dev/null differ diff --git a/plugins/oled-theme/orca-plugin.json b/plugins/oled-theme/orca-plugin.json deleted file mode 100644 index 2970b38..0000000 --- a/plugins/oled-theme/orca-plugin.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-oled-theme", - "publisher": "stablyai", - "name": "Orca OLED", - "version": "1.1.1", - "execution": "data", - "description": "A true-black dark theme and terminal theme for OLED displays.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/oled-theme", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "oled", - "title": "Orca OLED", - "path": "themes/oled.json" - } - ], - "terminalThemes": [ - { - "id": "oled-terminal", - "title": "Orca OLED", - "path": "terminal/oled-terminal.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "The word OLED in large white letters on true black, mirrored below in a fading reflection" - }, - "screenshots": [ - { - "path": "images/workspace.png", - "alt": "Orca OLED on the editor, terminal and file tree, separated by thin dark grey lines", - "caption": "Editor and terminal" - }, - { - "path": "images/palette.png", - "alt": "The Orca OLED terminal colours on true black", - "caption": "Terminal palette" - } - ] -} diff --git a/plugins/oled-theme/terminal/oled-terminal.json b/plugins/oled-theme/terminal/oled-terminal.json deleted file mode 100644 index e2ec1e5..0000000 --- a/plugins/oled-theme/terminal/oled-terminal.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "dark", - "terminal": { - "background": "#000000", - "foreground": "#e6e6e6", - "cursor": "#e6e6e6", - "cursorAccent": "#000000", - "selectionBackground": "#3a3a3a", - "black": "#1c1c1c", - "red": "#ff6b6b", - "green": "#5fd38d", - "yellow": "#f2c94c", - "blue": "#6cb6ff", - "magenta": "#d68cff", - "cyan": "#4fd6d6", - "white": "#d0d0d0", - "brightBlack": "#7a7a7a", - "brightRed": "#ff8f8f", - "brightGreen": "#85e0a8", - "brightYellow": "#ffdc7a", - "brightBlue": "#99ccff", - "brightMagenta": "#e3b0ff", - "brightCyan": "#80e8e8", - "brightWhite": "#ffffff" - } -} diff --git a/plugins/oled-theme/themes/oled.json b/plugins/oled-theme/themes/oled.json deleted file mode 100644 index 9ef3a45..0000000 --- a/plugins/oled-theme/themes/oled.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "base": "dark", - "tokens": { - "--background": "#000000", - "--editor-surface": "#000000", - "--foreground": "#e6e6e6", - "--card": "#000000", - "--card-foreground": "#e6e6e6", - "--popover": "#000000", - "--popover-foreground": "#e6e6e6", - "--primary": "#e6e6e6", - "--primary-foreground": "#000000", - "--secondary": "#141414", - "--secondary-foreground": "#e6e6e6", - "--muted": "#0f0f0f", - "--muted-foreground": "#a3a3a3", - "--accent": "#1a1a1a", - "--accent-foreground": "#f5f5f5", - "--border": "#1f1f1f", - "--input": "#2a2a2a", - "--ring": "#8c8c8c", - "--sidebar": "#000000", - "--sidebar-foreground": "#e6e6e6", - "--sidebar-primary": "#e6e6e6", - "--sidebar-primary-foreground": "#000000", - "--sidebar-accent": "#1a1a1a", - "--sidebar-accent-foreground": "#f5f5f5", - "--sidebar-border": "#1f1f1f", - "--sidebar-ring": "#8c8c8c", - "--worktree-sidebar": "#000000", - "--worktree-sidebar-foreground": "#e6e6e6", - "--worktree-sidebar-accent": "#1a1a1a", - "--worktree-sidebar-accent-foreground": "#f5f5f5", - "--worktree-sidebar-border": "#1f1f1f", - "--worktree-sidebar-ring": "#8c8c8c" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#8c8c8c", - "fontStyle": "italic" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#c7a8ff" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#b3b3b3" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#9ee39e" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#ffd479" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#ffb070" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#ffb070" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function", - "meta.function-call" - ], - "settings": { - "foreground": "#7cc4ff" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#6fe0d0" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "variable.parameter", - "support.variable" - ], - "settings": { - "foreground": "#e6e6e6" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#a3a3a3" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#c7a8ff" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#6fe0d0" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#ffd479" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#7cc4ff", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#6fe0d0", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#8c8c8c", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#ff6b6b" - } - } - ] -} diff --git a/plugins/orca-runner/LICENSE b/plugins/orca-runner/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/orca-runner/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/orca-runner/README.md b/plugins/orca-runner/README.md deleted file mode 100644 index fa6b9bf..0000000 --- a/plugins/orca-runner/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Orca Run - -A pixel art, Chrome Dino-inspired endless runner starring a little black-and-white orca. Jump icebergs, -duck seabirds, and see how far you can swim. Opens from the **Orca Run** (lightning bolt) -icon in Orca's right sidebar. It was called Orca Runner before 1.2.0; the plugin ID is still `orca-runner`, so -existing installs update in place. - -## Try it in Orca - -Requires Orca **1.4.245 or later**. - -1. Open **Settings → Plugins → Development folders…**. -2. Add this directory (`plugins/orca-runner`), then review and enable the plugin. -3. Select **Orca Run** in the right sidebar, click the game and press **Space**. - -The game runs offline in a `sandboxed-ui` panel with **no requested capabilities**. It has no -worker, dependencies, network requests, tracking, or access to the workspace. Best scores are -kept for the current panel instance; switching sidebar panels, closing, or reloading resets them. Switching focus -or hiding the document pauses gameplay. Resume with Space, P or a tap. - -## Controls - -| Input | Action | -| --- | --- | -| Space / ↑ / tap the game | Jump (hold for more airtime); start or restart a run | -| ↓ (hold) | Swim underwater to avoid seabirds; descend faster in the air; start or resume a run | -| P / Escape | Pause or resume | - -Click the game to focus keyboard input. Controls only handle keys inside the panel and leave -Cmd/Ctrl shortcuts to Orca. Speed increases with distance; birds join after the opening stretch, and the sky turns -from day to dusk to an aurora night as you swim. -Release ↓ to surface again. Icebergs extend underwater, so jump over them. -Like the offline dino page, the panel is just the game: score, best and prompts are drawn inside it. -The page follows Orca's light/dark theme and the game fits narrow sidebars. - -Pixel art is the game's only visual style: each frame is painted on a grid of up to 240×94 art pixels (one per 3 world units) with -hand-placed sprites and ordered-dither gradients, then scaled up by the browser without smoothing. Physics and -collision boxes use the same world units as before, so the art never changes how a run plays. - -## Development - -Source lives in `src/`. After editing it, rebuild the installable, self-contained HTML: - -```sh -node plugins/orca-runner/scripts/build.mjs -node --test plugins/orca-runner/tests/*.test.mjs -``` - -To preview outside Orca, open `panel/index.html` in a browser, or serve the repository with a -static HTTP server. No install step is required. To validate against an Orca checkout: - -```sh -node "$ORCA_DIR/config/scripts/validate-plugin-files.mjs" plugins/orca-runner -``` - -The generated `panel/index.html` is committed with the source because Orca's sandbox only -allows inline styles/scripts and data images. No build runs at installation. To list a public -release in the official catalog, follow the repository's `CONTRIBUTING.md`: commit the plugin, -then generate its pinned release and content hash. - -## Open-source research and license - -We evaluated [wayou/t-rex-runner](https://github.com/wayou/t-rex-runner) (BSD-3-Clause), an -extraction of Chromium's runner, and -[KarthikNedunchezhiyan/google-chrome-dino](https://github.com/KarthikNedunchezhiyan/google-chrome-dino) -(MIT). Both can be adapted, but this plugin uses an original, small Canvas implementation to -fit Orca's opaque-origin sandbox without Chromium page APIs, audio assets, or storage access. -No source code or sprites from either project are included. The sprites are drawn as text grids in `src/game.js`. - -Code and artwork are MIT licensed; see `LICENSE`. diff --git a/plugins/orca-runner/orca-plugin.json b/plugins/orca-runner/orca-plugin.json deleted file mode 100644 index 40ea460..0000000 --- a/plugins/orca-runner/orca-plugin.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-runner", - "publisher": "stablyai", - "name": "Orca Run", - "version": "1.2.3", - "execution": "sandboxed-ui", - "description": "A pixel art ocean escape. Jump icebergs and duck seabirds in a Chrome Dino-inspired runner starring Orca.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/orca-runner", - "engines": { "orca": ">=1.4.245" }, - "contributes": { - "panels": [{ "id": "runner", "title": "Orca Run", "icon": "zap", "entry": "panel/index.html" }] - }, - "capabilities": [] -} diff --git a/plugins/orca-runner/panel/index.html b/plugins/orca-runner/panel/index.html deleted file mode 100644 index 14d1dd5..0000000 --- a/plugins/orca-runner/panel/index.html +++ /dev/null @@ -1,898 +0,0 @@ - - - - - - -Orca Run - - - -
    -

    Orca Run

    -
    -

    -
    - - - - diff --git a/plugins/orca-runner/scripts/build.mjs b/plugins/orca-runner/scripts/build.mjs deleted file mode 100644 index 2f577b9..0000000 --- a/plugins/orca-runner/scripts/build.mjs +++ /dev/null @@ -1,10 +0,0 @@ -// Orca frames accept inline scripts/styles only. Keep the installable entry self-contained. -import { readFileSync, writeFileSync } from 'node:fs' -const root = new URL('../', import.meta.url) -const read = path => readFileSync(new URL(path, root), 'utf8') -const html = read('src/panel.html') - .replace('/* PANEL_STYLES */', () => read('src/panel.css')) - .replace('/* GAME_ENGINE */', () => read('src/game.js')) - .replace('/* PANEL_CONTROLLER */', () => read('src/panel.js')) -writeFileSync(new URL('panel/index.html', root), html) -console.log('Built panel/index.html (self-contained, no runtime dependencies)') diff --git a/plugins/orca-runner/src/game.js b/plugins/orca-runner/src/game.js deleted file mode 100644 index cbac1f8..0000000 --- a/plugins/orca-runner/src/game.js +++ /dev/null @@ -1,788 +0,0 @@ -/* Orca Run — original canvas game. Copyright (c) 2026 Orca contributors. MIT. */ -(function () { - 'use strict'; - const WIDTH = 720; - const HEIGHT = 280; - const GROUND = 210; - const HORIZON = 146; - const SURFACE = GROUND - 7; - const PLAYER_X = 82; - const DIVE_DEPTH = 48; - const ICE_DEPTH = 15; - const GRAVITY = 1450; - const JUMP_VELOCITY = 505; - // One full day → dusk → aurora night → dawn loop, measured in world distance (1200 points). - const CYCLE = 12000; - const TILE = 960; - // Physics keeps the 720×280 world; every frame is painted on a grid of 3-unit art pixels and - // the browser scales that grid up with nearest-neighbour sampling. - const PIXEL = 3; - const ROWS = Math.ceil(HEIGHT / PIXEL); - const HORIZON_ROW = Math.round(HORIZON / PIXEL); - const SURFACE_ROW = Math.round(SURFACE / PIXEL); - const GROUND_ROW = GROUND / PIXEL; - const TILE_COLUMNS = TILE / PIXEL; - // 4×4 ordered dither: gradients step through a few flat bands instead of blending smoothly. - const BAYER = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5].map(value => (value + 0.5) / 16); - function threshold(x, y) { - return BAYER[(y & 3) * 4 + (x & 3)]; - } - // Picks a band for a fractional level: flat colour, dithered only near each seam. - function band(level, x, y) { - const base = Math.floor(level); - const seam = Math.min(1, Math.max(0, (level - base - 0.5) * 3 + 0.5)); - return base + (seam > threshold(x, y) ? 1 : 0); - } - - function hex(value) { - const number = parseInt(value.slice(1), 16); - return [number >> 16, (number >> 8) & 255, number & 255]; - } - function palette(colors) { - const parsed = {}; - for (const key of Object.keys(colors)) parsed[key] = typeof colors[key] === 'string' ? hex(colors[key]) : colors[key]; - return parsed; - } - const DAY = palette({ skyTop:'#5aaee6', skyLow:'#d4edfa', sun:'#fff7dc', haze:'#b2d3e8', ridge:'#86b4d4', snow:'#f6fbff', sea:'#3f93cc', deep:'#0c3566', crest:'#8cc6ec', foam:'#f4fbff', ice:'#f8fdff', iceShade:'#9acbea', iceDeep:'#4f92c4', cloud:'#ffffff', rim:'#9cc4e0', night:0, sunY:58 }); - const DUSK = palette({ skyTop:'#3b4c8c', skyLow:'#ffb48c', sun:'#ffc887', haze:'#c79bb5', ridge:'#8b76a2', snow:'#ffe3d3', sea:'#7273ac', deep:'#1b2252', crest:'#c9a5c6', foam:'#fff0e6', ice:'#fff4ec', iceShade:'#c6a8cc', iceDeep:'#7c6ca6', cloud:'#ffcbb6', rim:'#ffb78e', night:0.2, sunY:132 }); - const NIGHT = palette({ skyTop:'#06122a', skyLow:'#1a3d66', sun:'#ffd9a8', haze:'#2a4c74', ridge:'#1e3b5f', snow:'#a3bfda', sea:'#1c4570', deep:'#030b1d', crest:'#3d71a0', foam:'#c0d9ee', ice:'#dbecfa', iceShade:'#7ea7cd', iceDeep:'#3f6b98', cloud:'#2a496d', rim:'#8fb8de', night:1, sunY:190 }); - const DAWN = palette({ skyTop:'#6c93cc', skyLow:'#ffd4ba', sun:'#ffe7c4', haze:'#c6b6d0', ridge:'#979ec6', snow:'#fff1ea', sea:'#7aa0d0', deep:'#1a3868', crest:'#b8c9e8', foam:'#fff7f2', ice:'#fffaf7', iceShade:'#b5c1e2', iceDeep:'#7189c0', cloud:'#ffe1d3', rim:'#ffcfb6', night:0.15, sunY:118 }); - const SKY = [[0, DAY], [0.38, DAY], [0.5, DUSK], [0.6, NIGHT], [0.86, NIGHT], [0.95, DAWN], [1, DAY]]; - const WHITE = [255, 255, 255]; - - // Scenery is generated once from fixed seeds, so every run sails past the same coastline. - function seeded(seed) { - return function () { - seed = (seed * 1664525 + 1013904223) >>> 0; - return seed / 4294967296; - }; - } - function ridge(seed, low, high) { - const random = seeded(seed); - const points = [{ x: 0, y: HORIZON - 9, peak: false }]; - let x = 0; - while (x < TILE - 130) { - x += 34 + random() * 46; - points.push({ x, y: HORIZON - low - random() * (high - low), peak: true }); - x += 30 + random() * 50; - points.push({ x, y: HORIZON - 5 - random() * 12, peak: false }); - } - points.push({ x: TILE, y: HORIZON - 9, peak: false }); - return points; - } - // Each art-pixel column of a ridge tile stores its top row, whether it is the leeward face - // and how far a ragged snow cap reaches down from tall peaks. - function heightmap(points, seed) { - const jitter = seeded(seed); - const columns = []; - let segment = 0; - for (let column = 0; column < TILE_COLUMNS; column++) { - const x = column * PIXEL + PIXEL / 2; - while (segment < points.length - 2 && x > points[segment + 1].x) segment++; - const a = points[segment]; - const b = points[segment + 1]; - const peak = a.peak ? a : b; - const tall = (HORIZON - peak.y) / PIXEL; - columns.push({ - top: Math.round((a.y + (b.y - a.y) * (x - a.x) / (b.x - a.x)) / PIXEL), - shade: a.peak, - snow: tall >= 8 ? Math.round(peak.y / PIXEL + tall * 0.3) + Math.floor(jitter() * 2) : -1 - }); - } - return columns; - } - const FAR_RIDGE = heightmap(ridge(3, 30, 74), 5); - const NEAR_RIDGE = heightmap(ridge(21, 14, 38), 8); - const CLOUDS = (function () { - const random = seeded(7); - return Array.from({ length: 6 }, (_, index) => ({ x: index * 190 + random() * 90, y: 24 + random() * 58, size: 0.6 + random() * 0.7 })); - })(); - const STARS = (function () { - const random = seeded(11); - return Array.from({ length: 54 }, () => ({ x: random() * WIDTH, y: 6 + random() * (HORIZON - 46), phase: random() * 6.3, size: random() < 0.18 ? 1.8 : 1 })); - })(); - - // ---- Sprites ------------------------------------------------------------------------------ - // One character per art pixel; '.' is transparent. Letters map to colours at draw time so - // the rim light, ice and clouds follow the sky. - function sprite(rows) { - return { width: rows[0].length, height: rows.length, rows }; - } - // Facing right. Column 10 is the orca's world x and row 22 its waterline. - const ORCA_FIN = [ - '..................r.................', - '.................bgr................', - '.................bbgr...............', - '.................bbbgr..............', - '.................bbbbgr.............', - '.................bbbbgr.............', - '.................bbbbbgr............', - '.................bbbbbbggrr.........', - '...............rrbbbbbbbbgggrr......' - ]; - const ORCA_FOLDED = [ - '....................................', - '....................................', - '....................................', - '....................................', - '....................................', - '....................................', - '..............rrrr..................', - '.............rbbbbbbbbbbggr.........', - '...............bbbbbbbbbbgggrr......' - ]; - const ORCA_BODY = [ - '.............rrssssbbbbbbbggggrr....', - '............rsbbbbbbbbbbbwwwbbbbr...', - '............rbbbbbbbbbbwwwwwbbEEbr..', - '.rr........rbbbbbbbbbbbwwwbbbbEebr..', - '..rb......rbbbbbbbbbbbbbbbbbbbbbbbb.', - '..bbr...rrbbbbbbbbbbbbbbbbbbbbbbbbb.', - '...bbrrrbbbbwbbbbbbbbbbbbbbbbbbbww..', - '...bbbbbbbbbbwwwbbbbbbbbbbbbbbbwww..', - '..bbbb..bbbbbbwwwwwbbkbbbbbbwwwww...', - '..bb........bbbbwwwwkkbbwwwwwww.....', - '.bb............kklllkklllllllk......', - '.................kkkkkkkkkkk........', - '....................kk..............', - '.....................k..............' - ]; - const ORCA = sprite(ORCA_FIN.concat(ORCA_BODY)); - const ORCA_DIVE = sprite(ORCA_FOLDED.concat(ORCA_BODY)); - const ORCA_X_EYES = sprite(['w.w', '.w.', 'w.w']); - const SPOUT = sprite(['f...f', '.fff.', '..f..', '..f..']); - // Facing left; three wing poses. - const GULL_FRAMES = [ - sprite(['..........kk.', '.........lk..', '........ll...', '.......ll....', '..ww..ll.....', '.wewwwlwwwt..', 'oowwwwwwwwtt.', '...gwwwwwg...', '.............']), - sprite(['.............', '.............', '.............', '.............', '..ww..lllllkk', '.wewwwwwwwt..', 'oowwwwwwwwtt.', '...gwwwwwg...', '.............']), - sprite(['.............', '.............', '.............', '.............', '..ww.........', '.wewwwwwwwt..', 'oowwwwllwwtt.', '...gwwwllg...', '.......lk....']) - ]; - // Three iceberg silhouettes share one hitbox; only the facets differ. - const ICEBERGS = [ - sprite(['....o.......', '...oHo......', '...oHSo.....', '..oHWSo.o...', '..oHWDSoSo..', '.oHWWDSSSo..', '.oWWWDSSSSo.', '.oWWWDDSSSo.', 'oWWWWWDSSSSo', 'oWWWWWDSSSSo', 'oWWWWWDDSSSo', 'oWWWWWWDSSSo', 'oWWWWWWDSSSo']), - sprite(['......o.....', '.....oHo....', '..o..oHSo...', '.oHo.oHSSo..', '.oHWooWSSo..', 'oHWWSWWSSSo.', 'oWWWDWWSSSo.', 'oWWWDWWDSSSo', 'oWWDDWWDSSSo', 'oWWWDWWWDSSo', 'oWWWWWWWDSSo', 'oWWWWWWWDSSo', 'oWWWWWWWDSSo']), - sprite(['............', '...ooooo....', '..oHHHWSoo..', '.oHWWWWSSSo.', '.oHWWWDSSSo.', 'oHWWWWDSSSo.', 'oWWWWWDSSSSo', 'oWWWWWDDSSSo', 'oWWWWWWDSSSo', 'oWWWWWWDSSSo', 'oWWWWWWDSSSo', 'oWWWWWWWDSSo', 'oWWWWWWWDSSo']) - ]; - const CLOUD_BIG = sprite(['.......cccc.......', '...ccc.cccccc.....', '..cccccccccccccc..', '.cccccccccccccccc.', 'cccccccccccccccccc', '.ssssssssssssssss.']); - const CLOUD_SMALL = sprite(['....ccc....', '..ccccccc..', '.ccccccccc.', 'ccccccccccc', '.sssssssss.']); - const IMPACT = sprite(['....w....', '.w..w..w.', '..w.w.w..', '...wyw...', 'wwwyyywww', '...wyw...', '..w.w.w..', '.w..w..w.', '....w....']); - // The score and messages are painted in the scene with a tiny 5-pixel-tall font. - const FONT = { - '0': ['###', '#.#', '#.#', '#.#', '###'], '1': ['.#.', '##.', '.#.', '.#.', '###'], '2': ['###', '..#', '###', '#..', '###'], - '3': ['###', '..#', '.##', '..#', '###'], '4': ['#.#', '#.#', '###', '..#', '..#'], '5': ['###', '#..', '###', '..#', '###'], - '6': ['###', '#..', '###', '#.#', '###'], '7': ['###', '..#', '..#', '.#.', '.#.'], '8': ['###', '#.#', '###', '#.#', '###'], - '9': ['###', '#.#', '###', '..#', '###'], ' ': ['..', '..', '..', '..', '..'], '!': ['#', '#', '#', '.', '#'], '↓': ['..#..', '..#..', '#.#.#', '.###.', '..#..'], - A: ['.#.', '#.#', '###', '#.#', '#.#'], B: ['##.', '#.#', '##.', '#.#', '##.'], C: ['.##', '#..', '#..', '#..', '.##'], - D: ['##.', '#.#', '#.#', '#.#', '##.'], E: ['###', '#..', '##.', '#..', '###'], G: ['.##.', '#...', '#.##', '#..#', '.##.'], - H: ['#.#', '#.#', '###', '#.#', '#.#'], I: ['###', '.#.', '.#.', '.#.', '###'], L: ['#..', '#..', '#..', '#..', '###'], M: ['#...#', '##.##', '#.#.#', '#...#', '#...#'], - N: ['#..#', '##.#', '#.##', '#..#', '#..#'], O: ['.##.', '#..#', '#..#', '#..#', '.##.'], P: ['##.', '#.#', '##.', '#..', '#..'], - R: ['##.', '#.#', '##.', '#.#', '#.#'], S: ['.##', '#..', '.#.', '..#', '##.'], T: ['###', '.#.', '.#.', '.#.', '.#.'], - U: ['#.#', '#.#', '#.#', '#.#', '###'], V: ['#.#', '#.#', '#.#', '#.#', '.#.'], W: ['#...#', '#...#', '#.#.#', '##.##', '#...#'] - }; - const RESTART = ['...####.#.', '.##....##.', '.#....###.', '#.........', '#.........', '#........#', '.#......#.', '.##....##.', '...####...']; - const GULL_COLORS = { w: WHITE, l: hex('#d3e0ea'), g: hex('#a9bccd'), k: hex('#253545'), o: hex('#f39a4c'), e: hex('#1a2735'), t: hex('#e3ebf2') }; - - window.createOrcaRunner = function ({ canvas, onStateChange = function () {}, onScore = function () {} }) { - const context = canvas.getContext('2d'); - if (!context) throw new Error('Orca Run needs a 2D canvas.'); - const sparkle = seeded(99); - let state = 'ready'; - let frame = null; - let lastTime = null; - let distance = 0; - let clock = 0; - let score = 0; - let best = 0; - let height = 0; - let velocity = 0; - let ducking = false; - let dive = 0; - let obstacles = []; - let particles = []; - let spawned = 0; - let untilSpawn = 1.8; - let untilWake = 0; - let impact = null; - let bestBefore = 0; - let flashUntil = 0; - let destroyed = false; - let viewportWidth = WIDTH; - let columns = WIDTH / PIXEL; - let image = null; - let pixels = null; - // Marks sprite pixels so the front water only tints what sits below the surface. - let covered = null; - let phaseStart = 0; - - function setState(next) { - if (state === next) return; - state = next; - onStateChange(state); - } - function cancelFrame() { - if (frame !== null) window.cancelAnimationFrame(frame); - frame = null; - lastTime = null; - } - function scheduleFrame() { - if (!destroyed && state === 'running' && frame === null) frame = window.requestAnimationFrame(tick); - } - function speed() { - return Math.min(430, 255 + distance * 0.009); - } - function playerY() { - return GROUND - height + dive * DIVE_DEPTH; - } - - // ---- Colour ----------------------------------------------------------------------------- - function mix(a, b, amount) { - return a + (b - a) * amount; - } - function mixColor(a, b, amount) { - return [mix(a[0], b[0], amount), mix(a[1], b[1], amount), mix(a[2], b[2], amount)]; - } - function pack(color) { - return (255 << 24 | Math.round(color[2]) << 16 | Math.round(color[1]) << 8 | Math.round(color[0])) >>> 0; - } - function unpack(value) { - return [value & 255, (value >> 8) & 255, (value >> 16) & 255]; - } - function bands(stops, count) { - const result = []; - for (let index = 0; index < count; index++) { - const position = index / (count - 1) * (stops.length - 1); - const from = Math.min(stops.length - 2, Math.floor(position)); - result.push(pack(mixColor(stops[from], stops[from + 1], position - from))); - } - return result; - } - function skyAt(time) { - let index = 0; - while (index < SKY.length - 2 && time > SKY[index + 1][0]) index++; - const [from, a] = SKY[index]; - const [to, b] = SKY[index + 1]; - const linear = to === from ? 0 : Math.min(1, Math.max(0, (time - from) / (to - from))); - const amount = linear * linear * (3 - 2 * linear); - const result = {}; - for (const key of Object.keys(a)) { - result[key] = Array.isArray(a[key]) ? a[key].map((value, channel) => mix(value, b[key][channel], amount)) : mix(a[key], b[key], amount); - } - return result; - } - - // ---- Pixel primitives ------------------------------------------------------------------- - function inside(x, y) { - return x >= 0 && x < columns && y >= 0 && y < ROWS; - } - function plot(x, y, value) { - if (inside(x, y)) pixels[y * columns + x] = value; - } - function blend(x, y, color, amount) { - if (!inside(x, y) || amount <= 0) return; - const index = y * columns + x; - pixels[index] = pack(mixColor(unpack(pixels[index]), color, Math.min(1, amount))); - } - function span(left, y, count, color, amount) { - for (let x = left; x < left + count; x++) blend(x, y, color, amount); - } - function wrap(value, size) { - return ((value % size) + size) % size; - } - function toColumn(x) { - return Math.round(x / PIXEL); - } - // Draws a sprite with an optional per-column vertical offset (used to tilt the orca). - function blit(art, left, top, colors, offset) { - for (let row = 0; row < art.height; row++) { - const line = art.rows[row]; - for (let column = 0; column < art.width; column++) { - const color = colors[line[column]]; - if (!color) continue; - const x = left + column; - const y = top + row + (offset ? offset(column) : 0); - if (!inside(x, y)) continue; - pixels[y * columns + x] = color; - covered[y * columns + x] = 1; - } - } - } - function packed(colors) { - const result = {}; - for (const key of Object.keys(colors)) result[key] = pack(colors[key]); - return result; - } - function disc(centerX, centerY, radius, paint) { - const reach = Math.ceil(radius); - for (let y = centerY - reach; y <= centerY + reach; y++) { - for (let x = centerX - reach; x <= centerX + reach; x++) { - const d = Math.hypot(x - centerX, y - centerY); - if (d <= radius) paint(x, y, d); - } - } - } - - // ---- Sky -------------------------------------------------------------------------------- - function drawSky(sky) { - const tones = bands([sky.skyTop, sky.skyLow], 6); - for (let y = 0; y < HORIZON_ROW; y++) { - const level = y / (HORIZON_ROW - 1) * (tones.length - 1); - for (let x = 0; x < columns; x++) pixels[y * columns + x] = tones[Math.min(tones.length - 1, band(level, x, y))]; - } - if (sky.night > 0.25) { - const starlight = (sky.night - 0.25) / 0.75; - for (const star of STARS) { - const x = toColumn(star.x); - const y = toColumn(star.y); - if (x >= columns) continue; - const twinkle = starlight * (0.45 + 0.4 * Math.sin(clock * 2.4 + star.phase)); - if (twinkle < 0.2) continue; - blend(x, y, WHITE, twinkle + 0.15); - // Bright stars flare into a little cross at the top of their twinkle. - if (star.size > 1 && twinkle > 0.62) for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) blend(x + dx, y + dy, WHITE, twinkle * 0.45); - } - drawAurora(starlight); - drawMoon(starlight); - } - drawSun(sky); - } - function drawAurora(strength) { - // Curtains: dithered vertical rays under a drifting crest, brighter in slow-moving patches. - const ribbons = [[44, [110, 255, 190], 0], [70, [150, 140, 255], 2.2]]; - for (const [base, color, phase] of ribbons) { - for (let x = 0; x < columns; x++) { - const world = x * PIXEL; - const top = base - 22 + Math.sin(world * 0.012 + clock * 0.45 + phase) * 13 + Math.sin(world * 0.033 + phase) * 4; - const patch = Math.max(0, Math.sin(world * 0.011 - clock * 0.3 + phase * 1.7)); - const rays = 0.65 + 0.35 * Math.sin(world * 0.37 + phase + clock * 0.8); - const glow = strength * patch * patch * rays; - if (glow < 0.05) continue; - const first = toColumn(top); - const length = Math.round(64 * (0.8 + 0.4 * Math.sin(world * 0.05 + phase)) / PIXEL); - for (let step = 0; step < length; step++) { - const along = step / length; - const profile = along < 0.2 ? along / 0.2 : (1 - along) / 0.8; - const y = first + step; - if (y < HORIZON_ROW && glow * profile * 1.25 > threshold(x, y)) blend(x, y, color, 0.55); - } - } - } - } - function drawMoon(strength) { - const centerX = toColumn(viewportWidth - 160); - const centerY = toColumn(40); - disc(centerX, centerY, 9, (x, y, d) => { - if (d <= 4.4) blend(x, y, [238, 244, 255], strength); - else if (threshold(x, y) < 0.45 * (1 - (d - 4.4) / 4.6) * strength) blend(x, y, [220, 235, 255], 0.3); - }); - for (const [dx, dy] of [[-1, -1], [1, 1], [2, -1], [-2, 1]]) blend(centerX + dx, centerY + dy, [160, 184, 214], 0.5 * strength); - } - function drawSun(sky) { - if (sky.sunY > HORIZON + 24) return; - const centerX = toColumn(viewportWidth - 92); - const centerY = toColumn(sky.sunY); - // Two dithered halos ring a flat pixel disc. - disc(centerX, centerY, 18, (x, y, d) => { - if (y >= HORIZON_ROW) return; - if (d <= 6.6) plot(x, y, pack(sky.sun)); - else if (d <= 8.6) blend(x, y, sky.sun, 0.5); - else if (d <= 18 && threshold(x, y) < 0.5 * (1 - (d - 8.6) / 9.4)) blend(x, y, sky.sun, 0.3); - }); - } - function drawClouds(sky) { - for (const cloud of CLOUDS) { - const art = cloud.size > 0.95 ? CLOUD_BIG : CLOUD_SMALL; - const left = toColumn(wrap(cloud.x - distance * 0.025 * cloud.size - clock * 3, 1140) - 120); - const top = toColumn(cloud.y) - art.height + 2; - const behind = mixColor(sky.skyTop, sky.skyLow, Math.max(0, top) / HORIZON_ROW); - const alpha = (0.55 + 0.35 * cloud.size) * (1 - sky.night * 0.75); - blit(art, left, top, packed({ c: mixColor(behind, sky.cloud, alpha), s: mixColor(behind, mixColor(sky.cloud, sky.rim, 0.5), alpha) })); - } - } - function drawRidge(map, parallax, fill, shade, snow) { - const colors = [pack(fill), pack(mixColor(fill, shade, 0.5)), pack(snow), pack(mixColor(snow, shade, 0.25))]; - const offset = toColumn(wrap(distance * parallax, TILE)); - for (let x = 0; x < columns; x++) { - const column = map[(x + offset) % TILE_COLUMNS]; - for (let y = Math.max(0, column.top); y <= HORIZON_ROW; y++) { - pixels[y * columns + x] = colors[(y <= column.snow ? 2 : 0) + (column.shade ? 1 : 0)]; - } - } - } - - // ---- Sea -------------------------------------------------------------------------------- - function drawSea(sky) { - const tones = bands([sky.sea, mixColor(sky.sea, sky.deep, 0.55), sky.deep], 8); - const rows = ROWS - 1 - HORIZON_ROW; - for (let y = HORIZON_ROW; y < ROWS; y++) { - const level = (y - HORIZON_ROW) / rows * (tones.length - 1); - for (let x = 0; x < columns; x++) pixels[y * columns + x] = tones[Math.min(tones.length - 1, band(level, x, y))]; - } - span(0, HORIZON_ROW, columns, sky.foam, 0.45); - // Glitter path under the sun or moon. - const shine = sky.sunY < HORIZON ? sky.sun : sky.night > 0.5 ? [238, 244, 255] : null; - if (shine) { - const center = sky.sunY < HORIZON ? viewportWidth - 92 : viewportWidth - 160; - const strength = sky.sunY < HORIZON ? 0.6 * (1 - sky.night * 0.6) : 0.4 * sky.night; - for (let y = HORIZON + 4; y < GROUND - 12; y += 5) { - const reach = 8 + (y - HORIZON) * 0.55; - const wobble = Math.sin(clock * 3 + y * 0.7) * reach * 0.35; - const width = reach * (0.4 + 0.3 * Math.sin(y + clock * 5)); - span(toColumn(center - reach / 2 + wobble), toColumn(y), Math.max(1, toColumn(width)), shine, strength); - } - } - drawWaves(sky, 9, HORIZON + 5, GROUND - 10, 0.08, 0.7); - } - function drawWaves(sky, rows, top, bottom, slowest, fastest) { - for (let row = 0; row < rows; row++) { - const depth = row / (rows - 1); - const y = toColumn(top + depth * depth * (bottom - top)); - const parallax = mix(slowest, fastest, depth); - const length = Math.max(2, toColumn(5 + depth * 18)); - const spacing = 46 + depth * 54 + (row % 3) * 9; - for (let x = wrap(row * 53 - distance * parallax, spacing) - 40; x < viewportWidth + 40; x += spacing) { - const left = toColumn(x + wrap(x * 7.3 + row * 31, 23) - 11); - // Near crests get a raised middle so they read as little pixel wavelets. - span(left, y, length, sky.crest, 0.5); - if (depth > 0.5 && length > 3) span(left + Math.floor(length / 4), y - 1, Math.ceil(length / 2), sky.crest, 0.35); - } - } - } - function drawFrontWater(sky) { - const scroll = toColumn(distance); - for (let x = 0; x < columns; x++) { - const lifted = Math.sin((x * PIXEL + distance) * 0.045) > 0.55; - const surface = SURFACE_ROW - (lifted ? 1 : 0); - for (let y = surface + 1; y < ROWS; y++) { - // Anything under the surface takes on the water's colour. - if (covered[y * columns + x]) blend(x, y, mixColor(sky.sea, sky.deep, (y - surface) / (ROWS - surface)), 0.5); - } - if (!covered[surface * columns + x]) blend(x, surface, sky.foam, lifted || wrap(x + scroll, 9) < 2 ? 0.6 : 0.28); - } - drawWaves(sky, 5, GROUND + 9, HEIGHT - 8, 1.05, 1.5); - } - - // ---- Hazards ---------------------------------------------------------------------------- - function drawIce(obstacle, sky) { - const art = ICEBERGS[obstacle.variant % ICEBERGS.length]; - const left = toColumn(obstacle.x - 3); - // The submerged base shows through the water as a dithered shelf. - for (let row = 0; row < ICE_DEPTH / PIXEL; row++) { - for (let x = left - 1 + (row >> 1); x <= left + art.width - (row >> 1); x++) { - if (threshold(x, GROUND_ROW + row) < 0.55 - row * 0.09) blend(x, GROUND_ROW + row, sky.iceDeep, 0.6); - } - } - blit(art, left, GROUND_ROW - art.height, packed({ o: mixColor(sky.iceDeep, sky.deep, 0.35), W: sky.ice, S: sky.iceShade, D: sky.iceDeep, H: WHITE })); - } - function drawIceFoam(obstacle, sky) { - const left = toColumn(obstacle.x - 3); - const lap = Math.round(Math.sin(clock * 6 + obstacle.x * 0.05)); - span(left - 1 - lap, SURFACE_ROW, 2, sky.foam, 0.9); - span(left + 11 + lap, SURFACE_ROW, 2, sky.foam, 0.9); - span(left + 1 - lap, SURFACE_ROW + 1, 10 + lap * 2, sky.foam, 0.8); - } - function drawGull(obstacle, sky) { - const flap = Math.sin(clock * 13 + obstacle.x * 0.02); - const art = GULL_FRAMES[flap > 0.4 ? 0 : flap > -0.4 ? 1 : 2]; - const left = toColumn(obstacle.x - 4); - span(left + 3, SURFACE_ROW - 1, 7, sky.deep, 0.3); - blit(art, left, toColumn(obstacle.y - 9), packed(GULL_COLORS)); - } - - // ---- Orca ------------------------------------------------------------------------------- - function drawOrca(sky) { - const swimming = state === 'running' && height === 0; - const bob = swimming && dive < 0.5 ? Math.round(Math.sin(clock * 7) * 0.7) : 0; - const tilt = height > 0 ? Math.max(-0.32, Math.min(0.38, -velocity / 1300)) : 0; - // Tilting shears the sprite column by column in eighth-pixel steps, so it never smears. - const shear = Math.round(Math.tan(tilt) * 8) / 8; - const tail = swimming ? Math.round(Math.sin(clock * 9)) : height > 0 ? Math.round(Math.sin(clock * 16) * 0.8) : 0; - const offset = column => Math.round((column - 21) * shear) + (column < 7 ? tail : 0); - const left = toColumn(PLAYER_X) - 10; - // The folded fin and whole body sink below the surface, along with the hitbox. - const top = toColumn(playerY()) + bob - 22; - if (height > 0) { - const fade = Math.max(0, 1 - height / 180); - const reach = Math.round(10 * (0.5 + fade / 2)); - span(toColumn(PLAYER_X + 34) - reach, SURFACE_ROW, reach * 2, sky.deep, 0.5 * fade); - } - const over = state === 'gameover'; - const body = hex('#0d1926'); - blit(dive > 0.5 ? ORCA_DIVE : ORCA, left, top, packed({ - r: mixColor(hex('#2a3f55'), sky.rim, 0.6), g: hex('#22374c'), b: body, k: hex('#060c14'), s: hex('#3a4d61'), - w: WHITE, l: hex('#c6d8e6'), E: over ? body : WHITE, e: over ? body : hex('#0a1622') - }), offset); - if (over) blit(ORCA_X_EYES, left + 30, top + 11, packed({ w: WHITE }), column => offset(column + 30)); - // A little spout says hello before the first run. - if (state === 'ready') blit(SPOUT, left + 24, top + 1, packed({ f: sky.foam })); - } - - // ---- Particles -------------------------------------------------------------------------- - function splash(count, x, y, reach) { - const drift = -speed() * 0.45; - for (let index = 0; index < count; index++) { - particles.push({ kind: 'drop', x: x + sparkle() * reach, y, vx: drift + (sparkle() - 0.5) * 140, vy: -(110 + sparkle() * 170), life: 0.7, age: 0, size: 1.2 + sparkle() * 1.8 }); - } - for (let index = 0; index < count / 3; index++) { - particles.push({ kind: 'foam', x: x + sparkle() * reach, y: SURFACE + sparkle() * 2, vx: -speed(), vy: 0, life: 0.6, age: 0, size: 3 + sparkle() * 4 }); - } - if (particles.length > 160) particles = particles.slice(-160); - } - function updateParticles(dt, worldSpeed) { - untilWake -= dt; - if (state === 'running' && height === 0 && untilWake <= 0) { - untilWake = 0.045; - if (dive > 0.5) particles.push({ kind: 'bubble', x: PLAYER_X + 10 + sparkle() * 50, y: playerY() - 20 + sparkle() * 10, vx: -worldSpeed * 0.8, vy: -45, life: 0.8, age: 0, size: 1 + sparkle() * 1.6 }); - else particles.push({ kind: 'foam', x: PLAYER_X - 10 + sparkle() * 14, y: SURFACE + sparkle() * 2.5, vx: -worldSpeed, vy: 0, life: 0.55, age: 0, size: 2 + sparkle() * 3 }); - } - for (const particle of particles) { - particle.age += dt; - particle.x += particle.vx * dt; - particle.y += particle.vy * dt; - if (particle.kind === 'drop') particle.vy += 900 * dt; - } - particles = particles.filter(particle => particle.age < particle.life && particle.x > -20 && (particle.kind !== 'drop' || particle.y < SURFACE + 4) && (particle.kind !== 'bubble' || particle.y > SURFACE)); - } - function drawParticles(sky) { - for (const particle of particles) { - const fade = 1 - particle.age / particle.life; - const x = toColumn(particle.x); - const y = toColumn(particle.y); - if (particle.kind === 'foam') { - const reach = Math.max(1, Math.round(particle.size * (1 + particle.age * 2) / PIXEL)); - span(x - reach, y, reach * 2, sky.foam, 0.7 * fade); - } else if (particle.kind === 'bubble') { - if (particle.size > 1.6) for (const [dx, dy] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) blend(x + dx, y + dy, sky.foam, 0.6 * fade); - else blend(x, y, sky.foam, 0.6 * fade); - } else { - blend(x, y, sky.foam, 0.95 * fade); - if (particle.size > 2.2) blend(x + 1, y, sky.foam, 0.7 * fade); - } - } - } - function drawImpact(sky) { - if (impact) blit(IMPACT, toColumn(impact.x) - 4, toColumn(impact.y) - 4, packed({ w: sky.foam, y: hex('#ffd36b') })); - } - - // ---- Score and messages ----------------------------------------------------------------- - function measure(value, gap) { - let width = -gap; - for (const character of value) width += FONT[character][0].length + gap; - return width; - } - function stamp(rows, left, top, color) { - rows.forEach((line, y) => { - for (let x = 0; x < line.length; x++) if (line[x] === '#') plot(left + x, top + y, color); - }); - } - function write(value, left, top, color, gap) { - for (const character of value) { - stamp(FONT[character], left, top, color); - left += FONT[character][0].length + gap; - } - } - function centered(value, top, color, gap) { - write(value, Math.round((columns - measure(value, gap)) / 2), top, color, gap); - } - function drawHud(sky) { - // Plain ink like the dino page: dark on a bright sky, light once dusk sets in. - const behind = mixColor(sky.skyTop, sky.skyLow, 0.3); - const bright = behind[0] * 0.3 + behind[1] * 0.59 + behind[2] * 0.11 > 140; - const ink = bright ? hex('#10273b') : hex('#f4fbff'); - const color = pack(ink); - const pad = value => String(value).padStart(5, '0'); - if (state !== 'ready' || best > 0) { - const current = pad(score); - const right = columns - 5 - measure(current, 1); - const blinking = clock < flashUntil && Math.floor((flashUntil - clock) / 0.2) % 2 === 1; - if (!blinking) write(current, right, 4, color, 1); - if (best > 0) { - const record = 'HI ' + pad(best); - write(record, right - 6 - measure(record, 1), 4, pack(mixColor(ink, behind, 0.4)), 1); - } - } - if (state === 'ready') { - centered('PRESS SPACE TO SWIM', 16, color, 1); - centered('HOLD ↓ TO DIVE', 24, color, 1); - } - else if (state === 'paused') { - centered('PAUSED', 14, color, 2); - centered('PRESS SPACE', 23, color, 1); - } else if (state === 'gameover') { - // Sits below the score row so narrow panels never crowd the two together. - if (score > bestBefore) centered('NEW BEST!', 12, pack(hex(bright ? '#b5650d' : '#ffd36b')), 1); - centered('GAME OVER', 20, color, 2); - stamp(RESTART, Math.round(columns / 2) - 5, 29, color); - } - } - - // ---- Frame ------------------------------------------------------------------------------ - function draw() { - if (destroyed) return; - const sky = skyAt(wrap(phaseStart + distance / CYCLE, 1)); - drawSky(sky); - drawClouds(sky); - drawRidge(FAR_RIDGE, 0.03, sky.haze, mixColor(sky.haze, sky.deep, 0.25), mixColor(sky.haze, sky.snow, 0.85)); - drawRidge(NEAR_RIDGE, 0.07, sky.ridge, mixColor(sky.ridge, sky.deep, 0.35), sky.snow); - // Clouds are sprites too, but only hazards and the orca take the underwater tint. - covered.fill(0); - drawSea(sky); - for (const obstacle of obstacles) { - if (obstacle.kind === 'bird') drawGull(obstacle, sky); - else drawIce(obstacle, sky); - } - drawOrca(sky); - drawFrontWater(sky); - for (const obstacle of obstacles) if (obstacle.kind === 'ice') drawIceFoam(obstacle, sky); - drawParticles(sky); - if (state === 'gameover') drawImpact(sky); - drawHud(sky); - context.putImageData(image, 0, 0); - } - function intersects(a, b) { - return a.x < b.x+b.width && a.x+a.width > b.x && a.y < b.y+b.height && a.y+a.height > b.y; - } - function update(dt) { - const worldSpeed = speed(); - distance += worldSpeed*dt; - clock += dt; - const nextScore = Math.floor(distance/10); - // Blink the score at every hundred, like a little arcade fanfare. - if (Math.floor(nextScore / 100) > Math.floor(score / 100)) flashUntil = clock + 1.2; - if (nextScore !== score) { - score = nextScore; - best = Math.max(best, score); - onScore(score,best); - } - if (height > 0 || velocity > 0) { - velocity -= GRAVITY*dt; - height = Math.max(0,height+velocity*dt); - if (height === 0 && velocity < 0) { - velocity = 0; - splash(12, PLAYER_X + 8, SURFACE, 50); - } - } - const diveTarget = ducking && height === 0 ? 1 : 0; - const previousDive = dive; - dive += (diveTarget - dive) * Math.min(1, dt * 22); - if (Math.abs(diveTarget - dive) < 0.005) dive = diveTarget; - if ((previousDive < 0.5 && dive >= 0.5) || (previousDive >= 0.5 && dive < 0.5)) splash(6, PLAYER_X + 10, SURFACE, 46); - untilSpawn -= dt; - if (untilSpawn <= 0) { - const bird = score > 180 && Math.random() < 0.3; - obstacles.push(bird - ? {kind:'bird',x:WIDTH+35,y:170,width:30,height:17} - : {kind:'ice',x:WIDTH+35,y:GROUND-34,width:27,height:34,variant:spawned}); - spawned++; - // Space hazards by time, so acceleration cannot create impossible clusters. - untilSpawn = 1.35+Math.random()*0.75; - } - updateParticles(dt, worldSpeed); - const player = {x:PLAYER_X+8,y:playerY()-37,width:51,height:31}; - for (const obstacle of obstacles) { - obstacle.x -= worldSpeed*dt; - const hazard = obstacle.kind === 'bird' - ? {x:obstacle.x+3,y:obstacle.y+4,width:25,height:11} - // Ice extends into the visible submerged shelf: diving still requires avoiding it. - : {x:obstacle.x+5,y:GROUND-26,width:17,height:26+ICE_DEPTH}; - if (intersects(player,hazard)) { - const left = Math.max(player.x, hazard.x); - const top = Math.max(player.y, hazard.y); - impact = {x:(left+Math.min(player.x+player.width,hazard.x+hazard.width))/2, y:(top+Math.min(player.y+player.height,hazard.y+hazard.height))/2}; - ducking = false; - setState('gameover'); - return; - } - } - obstacles = obstacles.filter(obstacle => obstacle.x+obstacle.width > -25); - } - function tick(time) { - frame = null; - if (destroyed || state !== 'running') return; - const dt = lastTime === null ? 0 : Math.max(0,Math.min((time-lastTime)/1000,0.032)); - lastTime = time; - update(dt); - draw(); - if (state === 'running') scheduleFrame(); - else lastTime = null; - } - function start() { - if (destroyed || state === 'running') return; - if (state !== 'paused') { - bestBefore = best; - flashUntil = 0; - distance = 0; - score = 0; - height = 0; - velocity = 0; - dive = 0; - obstacles = []; - particles = []; - impact = null; - untilSpawn = 1.8; - onScore(0,best); - } - ducking = false; - lastTime = null; - setState('running'); - draw(); - scheduleFrame(); - } - function jump() { - if (destroyed) return; - if (state === 'paused') { start(); return; } - if (state === 'ready' || state === 'gameover') start(); - if (state === 'running' && height === 0 && velocity === 0) { - ducking = false; - velocity = JUMP_VELOCITY; - splash(10, PLAYER_X + 14, SURFACE, 44); - } - } - function pause() { - if (destroyed || state !== 'running') return; - ducking = false; - cancelFrame(); - setState('paused'); - draw(); - } - function resize() { - if (destroyed) return; - const width = Math.max(1,canvas.parentElement.getBoundingClientRect().width); - // Dark themes open the run under the aurora; light themes start at midday. - phaseStart = parseFloat(window.getComputedStyle(canvas).getPropertyValue('--game-phase')) || 0; - // Crop distant scenery on narrow panels instead of shrinking the orca to a speck. - // World coordinates, obstacle timing and collision geometry stay the same. - viewportWidth = Math.min(WIDTH, Math.max(480, width)); - columns = Math.ceil(viewportWidth / PIXEL); - // The canvas holds one device pixel per art pixel; CSS scales it up without smoothing. - canvas.width = columns; - canvas.height = ROWS; - canvas.style.width = '100%'; - canvas.style.height = 'auto'; - image = context.createImageData(columns, ROWS); - pixels = new Uint32Array(image.data.buffer); - covered = new Uint8Array(columns * ROWS); - draw(); - } - resize(); - onStateChange(state); - onScore(score,best); - return Object.freeze({ - start, jump, pause, resize, - releaseJump: function () { if (velocity > 190) velocity = 190; }, - setDucking: function (value) { - if (destroyed) return; - if (value && state !== 'running') start(); - ducking = state === 'running' && Boolean(value); - if (ducking && height > 0) velocity = Math.min(velocity, -330); - draw(); - }, - togglePause: function () { if (state === 'paused') start(); else pause(); }, - getState: function () { return state; }, - // Read-only physics snapshot for tests; the artwork can change without touching them. - inspect: function () { - return {y: playerY(), crouched: ducking && height === 0, hazards: obstacles.map(obstacle => ({kind: obstacle.kind, x: obstacle.x}))}; - }, - destroy: function () { destroyed = true; cancelFrame(); obstacles = []; particles = []; } - }); - }; -})(); diff --git a/plugins/orca-runner/src/panel.css b/plugins/orca-runner/src/panel.css deleted file mode 100644 index 04c7923..0000000 --- a/plugins/orca-runner/src/panel.css +++ /dev/null @@ -1,18 +0,0 @@ -:root { - color-scheme: light; - --page: var(--orca-background, #f4f9fc); - --focus: #1679bd; - --game-phase: 0; -} -* { box-sizing: border-box; } -html, body { height: 100%; } -body { margin: 0; background: var(--page); } -/* Just the game, centred on the panel like the offline dino page. */ -main { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; } -.playfield { width: 100%; touch-action: none; } -canvas { display: block; width: 100%; outline: none; touch-action: none; cursor: pointer; image-rendering: crisp-edges; image-rendering: pixelated; } -canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; } -.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; } - -.dark { color-scheme: dark; --page: var(--orca-background,#0d1a26); --focus: #5fb8f0; --game-phase: .7; } -@media (prefers-color-scheme: dark) { :root:not(.light):not(.dark) { color-scheme: dark; --page:#0d1a26; --focus:#5fb8f0; --game-phase:.7; } } diff --git a/plugins/orca-runner/src/panel.html b/plugins/orca-runner/src/panel.html deleted file mode 100644 index 65e4a62..0000000 --- a/plugins/orca-runner/src/panel.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - -Orca Run - - - -
    -

    Orca Run

    -
    -

    -
    - - - - diff --git a/plugins/orca-runner/src/panel.js b/plugins/orca-runner/src/panel.js deleted file mode 100644 index c09c943..0000000 --- a/plugins/orca-runner/src/panel.js +++ /dev/null @@ -1,73 +0,0 @@ -(() => { - 'use strict' - const canvas = document.getElementById('game') - const announcement = document.getElementById('announcement') - // The canvas shows score and prompts; this live region repeats them for screen readers. - const messages = { - running: 'Swimming. Space to jump, down arrow to dive.', - paused: 'Paused. Press space or P to keep going.' - } - let score = 0 - let bestBeforeRun = 0 - let best = 0 - const game = window.createOrcaRunner({ - canvas, - onScore(value, record) { score = value; best = record }, - onStateChange(state) { - if (state === 'running' && score === 0) bestBeforeRun = best - if (state === 'gameover') announcement.textContent = `Run over. Score ${score}.${score > bestBeforeRun ? ' New best!' : ''} Press space to swim again.` - else if (messages[state]) announcement.textContent = messages[state] - } - }) - const jumpKeys = new Set(['Space', 'ArrowUp']) - // Some webviews and synthesized key events provide key without a physical code. - const keyCodes = { ' ': 'Space', p: 'KeyP', P: 'KeyP' } - const keyCode = event => event.code || keyCodes[event.key] || event.key - document.addEventListener('keydown', event => { - if (event.metaKey || event.ctrlKey || event.altKey || event.target.closest('button, input, textarea, select, [contenteditable="true"]')) return - const code = keyCode(event) - if (jumpKeys.has(code)) { - event.preventDefault() - if (!event.repeat) game.jump() - } else if (code === 'ArrowDown') { - event.preventDefault() - if (!event.repeat) game.setDucking(true) - } else if (code === 'KeyP' || code === 'Escape') { - event.preventDefault() - if (!event.repeat) game.togglePause() - } - }) - document.addEventListener('keyup', event => { - const code = keyCode(event) - if (jumpKeys.has(code)) game.releaseJump() - if (code === 'ArrowDown') game.setDucking(false) - }) - // Tap or click the ocean to jump; holding gives more airtime. - const release = () => game.releaseJump() - canvas.addEventListener('pointerdown', event => { - if (event.button !== 0) return - event.preventDefault() - canvas.setPointerCapture(event.pointerId) - canvas.focus({ preventScroll: true }) - game.jump() - }) - canvas.addEventListener('pointerup', release) - canvas.addEventListener('pointercancel', release) - canvas.addEventListener('lostpointercapture', release) - function pauseAway() { game.setDucking(false); game.releaseJump(); game.pause() } - window.addEventListener('blur', pauseAway) - document.addEventListener('visibilitychange', () => { if (document.hidden) pauseAway() }) - let resizeFrame = null - let observedWidth = document.getElementById('playfield').getBoundingClientRect().width - const resize = new ResizeObserver(entries => { - const width = entries[0].contentRect.width - if (Math.abs(width - observedWidth) < 0.5) return - observedWidth = width - if (resizeFrame !== null) cancelAnimationFrame(resizeFrame) - resizeFrame = requestAnimationFrame(() => { resizeFrame = null; game.resize() }) - }) - resize.observe(document.getElementById('playfield')) - const theme = new MutationObserver(() => game.resize()) - theme.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style'] }) - window.addEventListener('pagehide', () => { resize.disconnect(); theme.disconnect(); if (resizeFrame !== null) cancelAnimationFrame(resizeFrame); game.destroy() }, { once: true }) -})() diff --git a/plugins/orca-runner/tests/engine.test.mjs b/plugins/orca-runner/tests/engine.test.mjs deleted file mode 100644 index 92ab3a2..0000000 --- a/plugins/orca-runner/tests/engine.test.mjs +++ /dev/null @@ -1,194 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert/strict'; -import vm from 'node:vm'; -import { readFileSync } from 'node:fs'; -const source = readFileSync(new URL('../src/game.js', import.meta.url), 'utf8'); - -function harness(width = 720, random = () => 0.5) { - let nextId = 0; - let time = 0; - let score = 0; - let best = 0; - const frames = new Map(); - const states = []; - // Frames paint into a real pixel buffer; putting it on the canvas is a no-op. - const context = { - createImageData: (w, h) => ({width: w, height: h, data: new Uint8ClampedArray(w * h * 4)}), - putImageData() {} - }; - const canvas = { style: {}, parentElement: { getBoundingClientRect: () => ({width}) }, getContext: () => context }; - const window = { - devicePixelRatio: 2, - getComputedStyle: () => ({getPropertyValue: () => ''}), - requestAnimationFrame(callback) { const id = ++nextId; frames.set(id,callback); return id; }, - cancelAnimationFrame(id) { frames.delete(id); } - }; - vm.runInNewContext(source, {window,Math:Object.assign(Object.create(Math), {random})}); - const game = window.createOrcaRunner({ canvas, onStateChange: state => states.push(state), onScore(s,b) { score = s; best = b; } }); - function step(ms = 16) { - time += ms; - const callbacks = [...frames.values()]; - frames.clear(); - callbacks.forEach(callback => callback(time)); - } - function advance(ms) { for (let i = 0; i < ms; i += 16) step(); } - return {game,canvas,states,step,advance,get hazards() {return game.inspect().hazards;},get score() {return score;},get best() {return best;},get y() {return game.inspect().y;},get crouched() {return game.inspect().crouched;},get pending() {return frames.size;}}; -} - -test('starts idle, pauses without scheduling work, and resumes without losing score', () => { - const h = harness(); - assert.equal(h.game.getState(),'ready'); - assert.equal(h.pending,0); - h.game.start(); h.advance(1500); - assert.ok(h.score > 30); - h.game.pause(); - const pausedScore = h.score; - assert.equal(h.pending,0); - h.advance(5000); - assert.equal(h.score,pausedScore); - h.game.start(); h.advance(200); - assert.ok(h.score > pausedScore); - assert.deepEqual(h.states,['ready','running','paused','running']); -}); - -test('collides with ice, stops frame loop, and restart preserves session best', () => { - const h = harness(); - h.game.start(); - for (let i = 0; i < 800 && h.game.getState() !== 'gameover'; i++) h.step(); - assert.equal(h.game.getState(),'gameover'); - assert.equal(h.pending,0); - assert.ok(h.best > 80); - const record = h.best; - h.game.start(); - assert.equal(h.score,0); - assert.equal(h.best,record); - assert.equal(h.game.getState(),'running'); -}); - -test('jump cannot be retriggered in the air and releasing jump shortens its height', () => { - const held = harness(); - const repeated = harness(); - const short = harness(); - for (const h of [held,repeated,short]) {h.game.jump(); h.advance(112);} - short.game.releaseJump(); - repeated.game.jump(); - for (const h of [held,repeated,short]) h.advance(112); - assert.equal(held.y,repeated.y); - assert.ok(short.y > held.y, 'released jump stays lower'); - held.advance(1200); - assert.equal(held.y,210,'lands back on waterline'); -}); - -test('a delayed frame is bounded, narrow panels retain game geometry, and destroy cancels work', () => { - const h = harness(280); - assert.equal(h.canvas.width,160,'a 480-unit viewport is 160 art pixels wide'); - assert.equal(h.canvas.height,94); - h.game.start(); h.step(); h.step(30000); - assert.ok(h.score < 2,'background time does not advance the world by 30 seconds'); - h.game.destroy(); - assert.equal(h.pending,0); - h.game.start(); h.game.jump(); - assert.equal(h.pending,0); -}); - -test('diving starts a run, stays underwater while held, and surfaces on release', () => { - const h = harness(); - h.game.setDucking(true); - assert.equal(h.game.getState(),'running'); - h.advance(256); - assert.ok(h.y > 250,'the whole orca sinks beneath the waterline'); - assert.equal(h.crouched,true); - const depth = h.y; - h.advance(256); - assert.equal(h.y,depth,'holding down maintains dive depth'); - h.game.setDucking(false); - h.advance(256); - assert.equal(h.y,210,'releasing down returns to the waterline'); - h.game.jump(); h.advance(112); - assert.ok(h.y < 210,'jumping still works after surfacing'); -}); - -test('pausing underwater freezes the dive and resuming surfaces without a stuck input', () => { - const h = harness(); - h.game.start(); h.game.setDucking(true); - h.advance(256); - assert.equal(h.crouched,true); - h.game.pause(); - assert.equal(h.crouched,false); - const depth = h.y; - h.advance(1000); - assert.equal(h.y,depth); - assert.equal(h.pending,0); - h.game.togglePause(); - assert.equal(h.game.getState(),'running'); - h.advance(256); - assert.equal(h.y,210); - h.game.jump(); h.advance(112); - assert.ok(h.y < 210); -}); - - -test('a timed jump clears the first iceberg that otherwise ends a run', () => { - const h = harness(); - h.game.start(); h.advance(3900); - h.game.jump(); h.advance(900); - assert.equal(h.game.getState(),'running'); - assert.equal(h.y,210); - assert.ok(h.score > 120); -}); - - -test('holding down in midair fast falls and continues underwater after landing', () => { - const falling = harness(); - const held = harness(); - for (const h of [falling,held]) { h.game.jump(); h.advance(112); } - falling.game.setDucking(true); - for (const h of [falling,held]) h.advance(112); - assert.ok(falling.y > 210,'fast fall has landed and started diving'); - assert.ok(held.y < 150,'ordinary held jump is still high in the air'); - falling.advance(256); - assert.ok(falling.y > 250,'held down keeps diving after landing'); -}); - -test('the submerged iceberg shelf still blocks a diving orca and restart clears the dive', () => { - const h = harness(); - h.game.setDucking(true); - for (let i = 0; i < 800 && h.game.getState() !== 'gameover'; i++) h.step(); - assert.equal(h.game.getState(),'gameover'); - assert.ok(h.y > 250,'collision happened underwater'); - h.game.start(); - assert.equal(h.y,210,'a new run starts at the surface'); - assert.equal(h.crouched,false); -}); - -function reachFirstBird(duck) { - const h = harness(720, () => 0); - let encounteredBird = false; - h.game.start(); - for (let step = 0; step < 1000 && h.game.getState() === 'running'; step++) { - const approachingIce = h.hazards.some(o => o.kind === 'ice' && o.x < 185 && o.x > 110); - if (approachingIce && h.y === 210) h.game.jump(); - const approachingBird = h.hazards.some(o => o.kind === 'bird' && o.x < 185 && o.x > 40); - if (approachingBird) { - encounteredBird = true; - if (duck) h.game.setDucking(true); - } - h.step(); - if (encounteredBird && h.hazards.some(o => o.kind === 'bird' && o.x < 35)) break; - } - return {h,encounteredBird}; -} - -test('a low bird hits a standing orca after the early icebergs', () => { - const {h,encounteredBird} = reachFirstBird(false); - assert.ok(encounteredBird,'test reached bird difficulty'); - assert.ok(h.score > 180); - assert.equal(h.game.getState(),'gameover'); -}); - -test('ducking safely clears the same low bird', () => { - const {h,encounteredBird} = reachFirstBird(true); - assert.ok(encounteredBird,'test reached bird difficulty'); - assert.ok(h.hazards.some(o => o.kind === 'bird' && o.x < 35),'bird passed player'); - assert.equal(h.game.getState(),'running'); -}); diff --git a/plugins/orca-runner/tests/panel.test.mjs b/plugins/orca-runner/tests/panel.test.mjs deleted file mode 100644 index c425929..0000000 --- a/plugins/orca-runner/tests/panel.test.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert/strict'; -import vm from 'node:vm'; -import { readFileSync } from 'node:fs'; - -const source = readFileSync(new URL('../src/panel.js', import.meta.url), 'utf8'); - -function harness() { - const events = new Map(); - const calls = []; - const game = Object.fromEntries(['jump', 'releaseJump', 'setDucking', 'togglePause', 'pause'] - .map(name => [name, (...args) => calls.push([name, ...args])])); - const element = { addEventListener() {}, getBoundingClientRect: () => ({width: 720}) }; - const document = { - documentElement: {}, - getElementById: () => element, - addEventListener: (type, listener) => events.set(type, listener) - }; - const window = { createOrcaRunner: () => game, addEventListener() {} }; - class Observer { observe() {} disconnect() {} } - vm.runInNewContext(source, {window, document, ResizeObserver: Observer, MutationObserver: Observer}); - function key(type, properties) { - const event = {target: {closest: () => false}, preventDefault() { this.prevented = true; }, ...properties}; - events.get(type)(event); - return event; - } - return {key, calls, events, document}; -} - -for (const code of ['ArrowDown', '']) { - test(`down arrow dives while held and releases with code ${JSON.stringify(code)}`, () => { - const h = harness(); - const event = h.key('keydown', {key: 'ArrowDown', code}); - assert.equal(event.prevented, true, 'down does not scroll the panel'); - h.key('keyup', {key: 'ArrowDown', code}); - assert.deepEqual(h.calls, [['setDucking', true], ['setDucking', false]]); - }); -} - -test('key-only jump and pause inputs work alongside diving', () => { - const h = harness(); - h.key('keydown', {key: ' ', code: ''}); - h.key('keyup', {key: ' ', code: ''}); - h.key('keydown', {key: 'P', code: ''}); - assert.deepEqual(h.calls, [['jump'], ['releaseJump'], ['togglePause']]); -}); - -test('holding down does not auto-restart a run after a collision', () => { - const h = harness(); - const event = h.key('keydown', {key: 'ArrowDown', repeat: true}); - assert.equal(event.prevented, true); - assert.deepEqual(h.calls, []); -}); - -test('modified shortcuts and editable fields do not trigger diving', () => { - const h = harness(); - for (const modifier of ['metaKey', 'ctrlKey', 'altKey']) { - h.key('keydown', {key: 'ArrowDown', code: 'ArrowDown', [modifier]: true}); - } - h.key('keydown', {key: 'ArrowDown', target: {closest: () => true}}); - assert.deepEqual(h.calls, []); -}); - -test('hiding the panel releases dive and jump inputs before pausing', () => { - const h = harness(); - h.key('keydown', {key: 'ArrowDown'}); - h.events.get('visibilitychange')(); - assert.deepEqual(h.calls, [['setDucking', true]]); - h.document.hidden = true; - h.events.get('visibilitychange')(); - assert.deepEqual(h.calls, [['setDucking', true], ['setDucking', false], ['releaseJump'], ['pause']]); -}); diff --git a/plugins/prisma/LICENSE b/plugins/prisma/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/prisma/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/prisma/images/cover.png b/plugins/prisma/images/cover.png deleted file mode 100644 index 2a7768f..0000000 Binary files a/plugins/prisma/images/cover.png and /dev/null differ diff --git a/plugins/prisma/images/editor.png b/plugins/prisma/images/editor.png deleted file mode 100644 index 643add6..0000000 Binary files a/plugins/prisma/images/editor.png and /dev/null differ diff --git a/plugins/prisma/orca-plugin.json b/plugins/prisma/orca-plugin.json deleted file mode 100644 index b04dd98..0000000 --- a/plugins/prisma/orca-plugin.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-prisma", - "publisher": "stablyai", - "name": "Prisma Syntax", - "version": "1.0.0", - "execution": "data", - "description": "Prisma-aware highlighting for .prisma schema files: block keywords, model names, scalar types, attributes and built-in functions.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/prisma", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "syntaxes": [ - { - "id": "prisma", - "title": "Prisma", - "scopeName": "source.prisma", - "path": "syntaxes/prisma.tmLanguage.json", - "configuration": "syntaxes/language-configuration.json", - "extensions": [ - ".prisma" - ] - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A Prisma model and enum with highlighted keywords, scalar types, attributes and functions" - }, - "screenshots": [ - { - "path": "images/editor.png", - "alt": "A Prisma schema with generator, datasource and model blocks highlighted in the editor", - "caption": "Editor" - } - ] -} diff --git a/plugins/prisma/syntaxes/language-configuration.json b/plugins/prisma/syntaxes/language-configuration.json deleted file mode 100644 index 6d6f755..0000000 --- a/plugins/prisma/syntaxes/language-configuration.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "comments": { "lineComment": "//" }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "\"", "close": "\"" } - ], - "surroundingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "\"", "close": "\"" } - ] -} diff --git a/plugins/prisma/syntaxes/prisma.tmLanguage.json b/plugins/prisma/syntaxes/prisma.tmLanguage.json deleted file mode 100644 index 8a0fc2e..0000000 --- a/plugins/prisma/syntaxes/prisma.tmLanguage.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "Prisma", - "scopeName": "source.prisma", - "patterns": [ - { "include": "#comment" }, - { "include": "#block" }, - { "include": "#attribute" }, - { "include": "#string" }, - { "include": "#number" }, - { "include": "#type" }, - { "include": "#constant" } - ], - "repository": { - "comment": { - "patterns": [ - { "name": "comment.line.documentation.prisma", "match": "///.*$" }, - { "name": "comment.line.double-slash.prisma", "match": "//.*$" } - ] - }, - "block": { - "match": "^\\s*(model|enum|type|view|datasource|generator)\\s+([A-Za-z_][A-Za-z0-9_]*)", - "captures": { - "1": { "name": "keyword.declaration.prisma" }, - "2": { "name": "entity.name.type.prisma" } - } - }, - "attribute": { - "match": "(@@?[A-Za-z_][A-Za-z0-9_.]*)", - "name": "entity.name.function.attribute.prisma" - }, - "string": { - "name": "string.quoted.double.prisma", - "begin": "\"", - "end": "\"", - "patterns": [{ "name": "constant.character.escape.prisma", "match": "\\\\." }] - }, - "number": { - "name": "constant.numeric.prisma", - "match": "\\b-?[0-9]+(?:\\.[0-9]+)?\\b" - }, - "type": { - "name": "support.type.prisma", - "match": "\\b(String|Boolean|Int|BigInt|Float|Decimal|DateTime|Json|Bytes|Unsupported)\\b\\??\\[?\\]?" - }, - "constant": { - "name": "constant.language.prisma", - "match": "\\b(true|false|null|now|autoincrement|uuid|cuid|env|dbgenerated)\\b" - } - } -} diff --git a/plugins/solarized-light-theme/LICENSE b/plugins/solarized-light-theme/LICENSE deleted file mode 100644 index fbb0937..0000000 --- a/plugins/solarized-light-theme/LICENSE +++ /dev/null @@ -1,44 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Upstream palette license: - -Copyright (c) 2011 Ethan Schoonover - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/plugins/solarized-light-theme/README.md b/plugins/solarized-light-theme/README.md deleted file mode 100644 index 9fac274..0000000 --- a/plugins/solarized-light-theme/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Solarized Light for Orca - -A warm cream application theme based on Ethan Schoonover's Solarized Light palette, with matching terminal colors. - -Select **Solarized Light** in Appearance settings for the app and in terminal theme settings -for matching ANSI colors. Includes syntax colors for source files and Markdown. - -## Attribution - -Adapted for Orca from the [Solarized Light upstream project](https://ethanschoonover.com/solarized/). -The Orca token mapping is maintained here; this is an unofficial port. -Upstream MIT notices are included in [LICENSE](LICENSE). - -UI text, button blue, and low-contrast syntax shades are darkened for Orca's -contrast checks. Sidebar hover uses a deeper cream to stay visible. The terminal -uses the original Solarized ANSI palette. diff --git a/plugins/solarized-light-theme/images/cover.png b/plugins/solarized-light-theme/images/cover.png deleted file mode 100644 index 345630e..0000000 Binary files a/plugins/solarized-light-theme/images/cover.png and /dev/null differ diff --git a/plugins/solarized-light-theme/orca-plugin.json b/plugins/solarized-light-theme/orca-plugin.json deleted file mode 100644 index 0ef5f19..0000000 --- a/plugins/solarized-light-theme/orca-plugin.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-solarized-light-theme", - "publisher": "stablyai", - "name": "Solarized Light for Orca", - "version": "1.0.1", - "execution": "data", - "description": "A warm cream application theme based on Ethan Schoonover's Solarized Light palette, with matching terminal colors.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/solarized-light-theme", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "themes": [ - { - "id": "solarized-light", - "title": "Solarized Light", - "path": "themes/solarized-light.json" - } - ], - "terminalThemes": [ - { - "id": "solarized-light", - "title": "Solarized Light", - "path": "terminal/solarized-light.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "Solarized Light theme preview with a file tree, syntax-highlighted TypeScript, terminal output, and palette swatches" - } -} diff --git a/plugins/solarized-light-theme/terminal/solarized-light.json b/plugins/solarized-light-theme/terminal/solarized-light.json deleted file mode 100644 index e47559e..0000000 --- a/plugins/solarized-light-theme/terminal/solarized-light.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "light", - "terminal": { - "background": "#fdf6e3", - "foreground": "#657b83", - "cursor": "#268bd2", - "selectionBackground": "#eee8d5", - "black": "#073642", - "red": "#dc322f", - "green": "#859900", - "yellow": "#b58900", - "blue": "#268bd2", - "magenta": "#d33682", - "cyan": "#2aa198", - "white": "#eee8d5", - "brightBlack": "#002b36", - "brightRed": "#cb4b16", - "brightGreen": "#586e75", - "brightYellow": "#657b83", - "brightBlue": "#839496", - "brightMagenta": "#6c71c4", - "brightCyan": "#93a1a1", - "brightWhite": "#fdf6e3" - } -} diff --git a/plugins/solarized-light-theme/themes/solarized-light.json b/plugins/solarized-light-theme/themes/solarized-light.json deleted file mode 100644 index 898ffa2..0000000 --- a/plugins/solarized-light-theme/themes/solarized-light.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "base": "light", - "tokens": { - "--background": "#fdf6e3", - "--editor-surface": "#fdf6e3", - "--foreground": "#586e75", - "--card": "#eee8d5", - "--card-foreground": "#435b63", - "--popover": "#fdf6e3", - "--popover-foreground": "#586e75", - "--primary": "#2073ae", - "--primary-foreground": "#fdf6e3", - "--secondary": "#eee8d5", - "--secondary-foreground": "#435b63", - "--muted": "#eee8d5", - "--muted-foreground": "#435b63", - "--accent": "#eee8d5", - "--accent-foreground": "#435b63", - "--border": "#93a1a1", - "--input": "#93a1a1", - "--ring": "#268bd2", - "--sidebar": "#eee8d5", - "--sidebar-foreground": "#435b63", - "--sidebar-accent": "#e1dbc8", - "--sidebar-accent-foreground": "#435b63", - "--sidebar-border": "#93a1a1", - "--sidebar-ring": "#268bd2" - }, - "tokenColors": [ - { - "name": "Comments", - "scope": [ - "comment", - "punctuation.definition.comment" - ], - "settings": { - "foreground": "#818e8e", - "fontStyle": "italic" - } - }, - { - "name": "Variables", - "scope": [ - "variable", - "support.variable" - ], - "settings": { - "foreground": "#657b83" - } - }, - { - "name": "Constants", - "scope": [ - "constant", - "support.constant", - "variable.other.constant" - ], - "settings": { - "foreground": "#cb4b16" - } - }, - { - "name": "Numbers", - "scope": [ - "constant.numeric" - ], - "settings": { - "foreground": "#d33682" - } - }, - { - "name": "Keywords", - "scope": [ - "keyword", - "storage.type", - "storage.modifier", - "variable.language" - ], - "settings": { - "foreground": "#819400" - } - }, - { - "name": "Operators", - "scope": [ - "keyword.operator" - ], - "settings": { - "foreground": "#819400" - } - }, - { - "name": "Strings", - "scope": [ - "string", - "punctuation.definition.string", - "markup.inline.raw", - "markup.raw" - ], - "settings": { - "foreground": "#299c93" - } - }, - { - "name": "Escapes and regular expressions", - "scope": [ - "constant.character.escape", - "string.regexp" - ], - "settings": { - "foreground": "#cb4b16" - } - }, - { - "name": "Functions", - "scope": [ - "entity.name.function", - "support.function" - ], - "settings": { - "foreground": "#268bd2" - } - }, - { - "name": "Types", - "scope": [ - "entity.name.type", - "entity.name.class", - "entity.name.namespace", - "entity.other.inherited-class", - "support.type", - "support.class" - ], - "settings": { - "foreground": "#b18600" - } - }, - { - "name": "Punctuation", - "scope": [ - "punctuation", - "meta.brace" - ], - "settings": { - "foreground": "#657b83" - } - }, - { - "name": "Tags", - "scope": [ - "entity.name.tag" - ], - "settings": { - "foreground": "#268bd2" - } - }, - { - "name": "Attributes and keys", - "scope": [ - "entity.other.attribute-name", - "support.type.property-name" - ], - "settings": { - "foreground": "#b18600" - } - }, - { - "name": "Decorators", - "scope": [ - "meta.decorator", - "entity.name.function.decorator" - ], - "settings": { - "foreground": "#268bd2" - } - }, - { - "name": "Headings", - "scope": [ - "markup.heading", - "entity.name.section" - ], - "settings": { - "foreground": "#268bd2", - "fontStyle": "bold" - } - }, - { - "name": "Bold", - "scope": [ - "markup.bold" - ], - "settings": { - "fontStyle": "bold" - } - }, - { - "name": "Italic", - "scope": [ - "markup.italic" - ], - "settings": { - "fontStyle": "italic" - } - }, - { - "name": "Links", - "scope": [ - "markup.underline.link", - "string.other.link" - ], - "settings": { - "foreground": "#268bd2", - "fontStyle": "underline" - } - }, - { - "name": "Quotes", - "scope": [ - "markup.quote" - ], - "settings": { - "foreground": "#818e8e", - "fontStyle": "italic" - } - }, - { - "name": "Invalid", - "scope": [ - "invalid" - ], - "settings": { - "foreground": "#dc322f" - } - } - ] -} diff --git a/plugins/solarized-terminal/LICENSE b/plugins/solarized-terminal/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/solarized-terminal/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/solarized-terminal/images/cover.png b/plugins/solarized-terminal/images/cover.png deleted file mode 100644 index b20a173..0000000 Binary files a/plugins/solarized-terminal/images/cover.png and /dev/null differ diff --git a/plugins/solarized-terminal/images/palette.png b/plugins/solarized-terminal/images/palette.png deleted file mode 100644 index f47a2c0..0000000 Binary files a/plugins/solarized-terminal/images/palette.png and /dev/null differ diff --git a/plugins/solarized-terminal/images/terminal.png b/plugins/solarized-terminal/images/terminal.png deleted file mode 100644 index 9555c84..0000000 Binary files a/plugins/solarized-terminal/images/terminal.png and /dev/null differ diff --git a/plugins/solarized-terminal/orca-plugin.json b/plugins/solarized-terminal/orca-plugin.json deleted file mode 100644 index d443f1e..0000000 --- a/plugins/solarized-terminal/orca-plugin.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-solarized-terminal", - "publisher": "stablyai", - "name": "Solarized Terminal", - "version": "2.0.0", - "execution": "data", - "description": "Solarized Dark terminal colors packaged for Orca.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/solarized-terminal", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "terminalThemes": [ - { - "id": "solarized-dark", - "title": "Solarized Dark", - "path": "terminal/solarized-dark.json" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A terminal in Solarized Dark colours with git, ls and test output, and its 16-colour palette" - }, - "screenshots": [ - { - "path": "images/terminal.png", - "alt": "A Solarized Dark terminal beside the worktree list", - "caption": "Terminal" - }, - { - "path": "images/palette.png", - "alt": "The 16 Solarized Dark terminal colours", - "caption": "Palette" - } - ] -} diff --git a/plugins/solarized-terminal/terminal/solarized-dark.json b/plugins/solarized-terminal/terminal/solarized-dark.json deleted file mode 100644 index ddc6058..0000000 --- a/plugins/solarized-terminal/terminal/solarized-dark.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schemaVersion": 1, - "mode": "dark", - "terminal": { - "background": "#002b36", - "foreground": "#839496", - "cursor": "#93a1a1", - "selectionBackground": "#073642", - "black": "#073642", - "red": "#dc322f", - "green": "#859900", - "yellow": "#b58900", - "blue": "#268bd2", - "magenta": "#d33682", - "cyan": "#2aa198", - "white": "#eee8d5", - "brightBlack": "#586e75", - "brightRed": "#cb4b16", - "brightGreen": "#586e75", - "brightYellow": "#657b83", - "brightBlue": "#839496", - "brightMagenta": "#6c71c4", - "brightCyan": "#93a1a1", - "brightWhite": "#fdf6e3" - } -} diff --git a/plugins/spreadsheet/.gitattributes b/plugins/spreadsheet/.gitattributes deleted file mode 100644 index 159b6ba..0000000 --- a/plugins/spreadsheet/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -# Built by build/build.mjs. -editor/index.html linguist-generated=true -diff -THIRD_PARTY_NOTICES.txt linguist-generated=true diff --git a/plugins/spreadsheet/LICENSE b/plugins/spreadsheet/LICENSE deleted file mode 100644 index fbf46fc..0000000 --- a/plugins/spreadsheet/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Lovecast Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/plugins/spreadsheet/README.md b/plugins/spreadsheet/README.md deleted file mode 100644 index 19f2736..0000000 --- a/plugins/spreadsheet/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Spreadsheet Viewer - -Opens Excel and OpenDocument spreadsheets in Orca's editor for viewing: `.xlsx`, `.xlsm`, `.xlsb`, -`.xls` and `.ods`. Every visible sheet gets a tab along the bottom, and the grid shows each cell as -the file formats it — currency, percentages, dates, errors such as `#DIV/0!` — with merged cells -drawn as one. The bar above the grid shows the selected cell's address, its value, its formula and, -when it differs from what is displayed, the value stored in the file. The status bar shows the -sheet's size and, for a selection, its count, sum and average. - -CSV and TSV files are not handled here: Orca opens those in its own editable table view. - -## Keyboard - -| Keys | Does | -| --- | --- | -| Arrow keys | Move the active cell | -| Ctrl/Cmd + arrow | Jump to the edge of the data | -| Shift + any move, or Shift + click | Extend the selection | -| Tab / Shift+Tab, Enter / Shift+Enter | Move right / left, down / up; inside a selection, walk its cells | -| Page Up / Page Down | Move a screen up or down | -| Home / End | First column / last filled cell of the row | -| Ctrl/Cmd + Home / End | First cell / last cell of the sheet | -| Ctrl/Cmd + A | Select the whole sheet | -| Shift+Space / Ctrl+Space | Select the row / column | -| Ctrl/Cmd + Page Up / Page Down, or Alt + Left / Right | Previous / next sheet | -| Ctrl/Cmd + C | Copy the selection | - -Click and drag to select a range; click a row number or column letter to select the row or column, -and the corner to select everything. Tab leaves the grid from its last cell, and the sheet tabs -take Left, Right, Home and End. - -Copying puts the selection on the clipboard as tab-separated text, as Excel does, so it pastes into -spreadsheets, documents and terminals; rich-text targets also get an HTML table. Cells are copied -as they are displayed, not as raw numbers. - -## Limits - -- **View only, for now.** Cells cannot be edited yet, so the viewer never writes back to the file. -- **Formulas are not recalculated.** The grid shows the results saved in the file by the - application that last wrote it; a file saved without results shows those cells empty. -- **Macros never run.** `.xlsm` workbooks open as plain data. -- **Cell data only.** Charts, images, comments, conditional formatting, fonts, colours and borders - are not shown. Chart sheets say so; hidden sheets are left out (the tab bar counts them), and - hidden rows and columns stay hidden. -- **Size.** Orca opens files of up to 64 MiB. Zip-based workbooks (`.xlsx`, `.xlsm`, `.xlsb`, - `.ods`) are also refused if their contents expand past 256 MB or 4,000 parts, so a damaged or - hostile file cannot exhaust memory. -- **Encrypted workbooks** (password to open) are not supported; a password that only protects - sheets from editing does not matter here. -- Old `.xls` files that use a non-Western code page (BIFF5 and earlier) may show garbled text; - `.xls` files from Excel 97 and later are fine. - -The viewer runs in Orca's sandboxed editor frame. - -## Licence - -MIT. The viewer bundles [SheetJS Community Edition](https://sheetjs.com/) (Apache-2.0); see -[THIRD_PARTY_NOTICES.txt](THIRD_PARTY_NOTICES.txt). How it is built is in -[build/README.md](build/README.md). diff --git a/plugins/spreadsheet/build/.gitignore b/plugins/spreadsheet/build/.gitignore deleted file mode 100644 index c2658d7..0000000 --- a/plugins/spreadsheet/build/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/plugins/spreadsheet/build/README.md b/plugins/spreadsheet/build/README.md deleted file mode 100644 index 5e107cc..0000000 --- a/plugins/spreadsheet/build/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Building Spreadsheet Viewer - -`../editor/index.html` is generated. Orca loads it as one document inside a sandboxed frame whose -CSP allows only inline scripts and styles and no workers, so the build inlines -everything into that one file. There is no framework: the grid is plain DOM, and the only -dependency in the bundle is SheetJS. - -```sh -npm ci --ignore-scripts -node build.mjs -npm test # unit tests, then the headless browser tests against the built file -``` - -The build is deterministic: the same lockfile produces the same bytes. It also rewrites -`../THIRD_PARTY_NOTICES.txt` from the packages in the bundle, and fails if a package's licence -differs from the reviewed copy in `licenses/`. - -## SheetJS - -SheetJS Community Edition is pinned to the official tarball, -`https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz` (the lockfile records its integrity hash). -The `xlsx` package on the npm registry stopped at 0.18.5, which has known vulnerabilities -(CVE-2023-30533, prototype pollution; CVE-2024-22363, ReDoS); do not switch to it. To update, -check for a newer release, change the URL in `package.json`, run -`npm install --ignore-scripts`, review the licence and update `licenses/xlsx.txt` if it changed. - -Workbooks are read with `dense: true` (rows as arrays, which is what makes 50,000-row sheets cheap), -`cellFormula: true` and SheetJS's formatted text (`.w`). `cellStyles: true` is set only because -SheetJS reads column widths and row heights under it. - -What the build leaves out, and why: - -- SheetJS's code-page tables (`cpexcel`, ~470 KB): only BIFF5-and-earlier `.xls` files with - non-Western code pages need them. -- Writing, and every format other than the five Orca routes here. - -## Safety checks before parsing - -- Zip-based files (`.xlsx`, `.xlsm`, `.xlsb`, `.ods`): the zip central directory is walked without - inflating anything, and the file is refused if it declares more than 256 MB uncompressed or more - than 4,000 entries (`src/zip-budget.js`). This guard is adapted from the Office zip check in - [stablyai/orca#29678](https://github.com/stablyai/orca/pull/29678) by @nebourocket. -- Bytes that are not a zip, a compound file, a BIFF stream or markup (SpreadsheetML/HTML saved as - `.xls`) are refused as damaged, because SheetJS would otherwise read them as CSV text. -- Encrypted packages and password-protected `.xls` files are recognised from SheetJS's errors. - -## Source layout - -| File | What it holds | -| --- | --- | -| `src/editor.js` | Entry: `window.orca` documents, workbook state, sheet tabs, detail and status bars, copy | -| `src/grid-view.js` | The virtualized grid: rendering, scrolling, keyboard and pointer input | -| `src/open-workbook.js` | Container sniffing, the zip check, SheetJS options, error classification | -| `src/zip-budget.js` | The zip-bomb guard | -| `src/workbook-model.js` | Sheets, used extent, column widths and row heights from a SheetJS workbook | -| `src/selection.js` | Selection and navigation, as a pure reducer | -| `src/merge-index.js` | Merged-cell lookup by cell and by window | -| `src/range-copy.js` | Selection to TSV and HTML, and the status bar's count/sum/average | -| `src/cell-display.js`, `src/address.js` | Cell text, kinds, formulas; A1 addresses | -| `src/document-message.js` | Validation of the document `window.orca` delivers | -| `scripts/make-fixtures.mjs` | Writes the test workbooks to `/private/tmp/xlsx-fixtures` (or `$SPREADSHEET_FIXTURES`) | -| `test/harness.mjs` | An Orca-like host: the same CSP, tokens and sandboxed `srcdoc` frame, in headless Chromium | - -The browser tests use the Chromium that `playwright-core` expects (`npx playwright-core install -chromium-headless-shell` if it is missing). Set `SPREADSHEET_SCREENSHOTS=` to save screenshots. - -## Protocol - -The frame talks to its editor tab with `postMessage`. The viewer does not edit cells yet, so it never posts edits. - -| Direction | Message | Meaning | -| --- | --- | --- | -| frame → Orca | `{ type: 'orca-editor-ready' }` | Listening; send the document. | -| Orca → frame | `{ type: 'orca-editor-document', version, readOnly, fileType, content: { kind: 'bytes', bytes } }` | The file's bytes as a transferred `ArrayBuffer`, on open and whenever the file changes on disk; `version` grows with each change. The active sheet, selection and scroll position are kept when the sheet still exists. | - -Messages from anything but the parent window, documents whose `version` is not newer than the -last one rendered, and `content.kind: 'text'` documents are ignored. `fileType` is informational; the format is detected from the bytes. Orca -answers its watchdog pings in the frame shell, so the editor yields before parsing and keeps every -step well under the 5 s pong timeout (a 50,000 × 12 workbook parses in under a second). Copy works -through the native `copy` event, which Orca's Edit menu fires in the frame; the sandbox grants no -clipboard API. diff --git a/plugins/spreadsheet/build/build.mjs b/plugins/spreadsheet/build/build.mjs deleted file mode 100644 index e5e473a..0000000 --- a/plugins/spreadsheet/build/build.mjs +++ /dev/null @@ -1,101 +0,0 @@ -// Builds ../editor/index.html: one self-contained file, because the editor frame's CSP allows only -// inline scripts and styles, with no network and no workers. Also writes ../THIRD_PARTY_NOTICES.txt -// from the packages that end up in the bundle. -// Usage: npm ci && node build.mjs -import { build, transform } from 'esbuild' -import { mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs' -import path from 'node:path' -import vm from 'node:vm' - -const HERE = import.meta.dirname -const PLUGIN = path.resolve(HERE, '..') -const OUT = path.join(PLUGIN, 'editor', 'index.html') -const NOTICES = path.join(PLUGIN, 'THIRD_PARTY_NOTICES.txt') - -const result = await build({ - entryPoints: [path.join(HERE, 'src', 'editor.js')], - bundle: true, - write: false, - format: 'iife', - platform: 'browser', - target: 'chrome120', - minify: true, - legalComments: 'none', - metafile: true, - logLevel: 'warning', - absWorkingDir: HERE -}) -const css = ( - await transform(readFileSync(path.join(HERE, 'src', 'editor.css'), 'utf8'), { loader: 'css', minify: true }) -).code.trim() - -// Why: `"));var s;return(s=fr(r,"numFmts"))&&xh(s[0],i,n),(s=fr(r,"fonts"))&&hh(s[0],i,a,n),(s=fr(r,"fills"))&&uh(s[0],i,a,n),(s=fr(r,"borders"))&&lh(s[0],i,a,n),(s=fr(r,"cellXfs"))&&dh(s[0],i,n),i}})();function vh(e,t){var r=e.read_shift(2),a=pr(e,t-2);return[r,a]}function ph(e,t,r){var a={};a.sz=e.read_shift(2)/20;var n=yo(e,2,r);n.fItalic&&(a.italic=1),n.fCondense&&(a.condense=1),n.fExtend&&(a.extend=1),n.fShadow&&(a.shadow=1),n.fOutline&&(a.outline=1),n.fStrikeout&&(a.strike=1);var i=e.read_shift(2);switch(i===700&&(a.bold=1),e.read_shift(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break}var s=e.read_shift(1);s!=0&&(a.underline=s);var f=e.read_shift(1);f>0&&(a.family=f);var c=e.read_shift(1);switch(c>0&&(a.charset=c),e.l++,a.color=To(e,8),e.read_shift(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break}return a.name=pr(e,t-21),a}var gh=_r;function _h(e,t){var r=e.l+t,a=e.read_shift(2),n=e.read_shift(2);return e.l=r,{ixfe:a,numFmtId:n}}var wh=_r;function kh(e,t,r){var a={};a.NumberFmt=[];for(var n in Se)a.NumberFmt[n]=Se[n];a.CellXf=[],a.Fonts=[];var i=[],s=!1;return ot(e,function(c,o,l){switch(l){case 44:a.NumberFmt[c[0]]=c[1],Ft(c[1],c[0]);break;case 43:a.Fonts.push(c),c.color.theme!=null&&t&&t.themeElements&&t.themeElements.clrScheme&&(c.color.rgb=Ja(t.themeElements.clrScheme[c.color.theme].rgb,c.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:i[i.length-1]==617&&a.CellXf.push(c);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:i.push(l),s=!0;break;case 38:i.pop(),s=!1;break;default:if(o.T>0)i.push(l);else if(o.T<0)i.pop();else if(!s||r.WTF&&i[i.length-1]!=37)throw new Error("Unexpected record 0x"+l.toString(16))}}),a}var Eh=["","","","","","","","","","","",""];function Th(e,t,r){t.themeElements.clrScheme=[];var a={};(e[0].match(ur)||[]).forEach(function(n){var i=he(n);switch(i[0]){case"":break;case"":break;case"":break;case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":i[0].charAt(1)==="/"?(t.themeElements.clrScheme[Eh.indexOf(i[0])]=a,a={}):a.name=i[0].slice(3,i[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}})}function yh(e,t,r){t.themeElements={};var a;if(!(a=At(e,"a:clrScheme")))throw new Error("clrScheme not found in themeElements");if(Th(a,t,r),!(a=At(e,"a:fontScheme")))throw new Error("fontScheme not found in themeElements");if(!(a=At(e,"a:fmtScheme")))throw new Error("fmtScheme not found in themeElements");}function Ds(e,t){(!e||e.length===0)&&(e=Sh());var r,a={};if(!(r=At(e,"a:themeElements")))throw new Error("themeElements not found in theme");return yh(r[0],a,t),a.raw=e,a}function Sh(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[Gi];return r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]='',r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]='',r[r.length]="",r[r.length]="",r[r.length]="",r[r.length]="",r.join("")}function Fh(e,t,r){var a=e.l+t,n=e.read_shift(4);if(n!==124226){if(!r.cellStyles){e.l=a;return}var i=e.slice(e.l);e.l=a;var s;try{s=$i(i,{type:"array"})}catch{return}var f=yr(s,"theme/theme/theme1.xml",!0);if(f)return Ds(f,r)}}function Ah(e){return e.read_shift(4)}function Ch(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:e.l+=4;break;case 1:t.xclrValue=bh(e,4);break;case 2:t.xclrValue=vs(e,4);break;case 3:t.xclrValue=Ah(e,4);break;case 4:e.l+=4;break}return e.l+=8,t}function bh(e,t){return _r(e,t)}function Dh(e,t){return _r(e,t)}function Ih(e){var t=e.read_shift(2),r=e.read_shift(2)-4,a=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:a[1]=Ch(e,r);break;case 6:a[1]=Dh(e,r);break;case 14:case 15:a[1]=e.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return a}function Oh(e,t){var r=e.l+t;e.l+=2;var a=e.read_shift(2);e.l+=2;for(var n=e.read_shift(2),i=[];n-- >0;)i.push(Ih(e,r-e.l));return{ixfe:a,ext:i}}function Nh(e,t){t.forEach(function(r){switch(r[0]){case 4:break;case 5:break;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:break;case 13:break;case 14:break;case 15:break}})}function Rh(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:pr(e,t-8)}}function Lh(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function Ph(e){return e.l+=4,e.read_shift(4)!=0}function Bh(e,t,r){var a={Types:[],Cell:[],Value:[]},n=r||{},i=[],s=!1,f=2;return ot(e,function(c,o,l){switch(l){case 335:a.Types.push({name:c.name});break;case 51:c.forEach(function(v){f==1?a.Cell.push({type:a.Types[v[0]-1].name,index:v[1]}):f==0&&a.Value.push({type:a.Types[v[0]-1].name,index:v[1]})});break;case 337:f=c?1:0;break;case 338:f=2;break;case 35:i.push(l),s=!0;break;case 36:i.pop(),s=!1;break;default:if(!o.T){if(!s||n.WTF&&i[i.length-1]!=35)throw new Error("Unexpected record 0x"+l.toString(16))}}}),a}function Mh(e,t,r){var a={Types:[],Cell:[],Value:[]};if(!e)return a;var n=!1,i=2,s;return e.replace(ur,function(f){var c=he(f);switch(Hr(c[0])){case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":i=2;break;case"":i=2;break;case"":case"":case"":break;case"":n=!1;break;case"":case"":break;case"]*r:id="([^<>"]*)"/)||["",""])[1];return t["!id"][r].Target}function $h(e,t,r){var a=0;(Wi(e,"shape")||[]).forEach(function(n){var i="",s=!0,f=-1,c=-1,o=-1;if(n.replace(ur,function(v,x){var u=he(v);switch(Hr(u[0])){case"":s=!1;break;case"":f=x+v.length;break;case"":c=+n.slice(f,x).trim();break;case"":f=x+v.length;break;case"":o=+n.slice(f,x).trim();break}return""}),i==="Note"){var l=Xn(t,c>=0&&o>=0?Me({r:c,c:o}):r[a].ref);l.c&&(l.c.hidden=s),++a}})}function ui(e,t,r,a){var n=e["!data"]!=null,i;t.forEach(function(s){var f=Rr(s.ref);if(!(f.r<0||f.c<0)){if(n?(e["!data"][f.r]||(e["!data"][f.r]=[]),i=e["!data"][f.r][f.c]):i=e[s.ref],!i){i={t:"z"},n?e["!data"][f.r][f.c]=i:e[s.ref]=i;var c=lr(e["!ref"]||"BDWGO1000001:A1");c.s.r>f.r&&(c.s.r=f.r),c.e.rf.c&&(c.s.c=f.c),c.e.c=0;--v){if(!r&&i.c[v].T)return;r&&!i.c[v].T&&i.c.splice(v,1)}if(r&&a){for(v=0;v/))return[];var r=[],a=[],n=fr(e,"authors");n&&n[1]&&n[1].split(/<\/\w*:?author>/).forEach(function(s){if(!(s===""||s.trim()==="")){var f=s.match(/<(?:\w+:)?author[^<>]*>(.*)/);f&&r.push(f[1])}});var i=fr(e,"commentList");return i&&i[1]&&i[1].split(/<\/\w*:?comment>/).forEach(function(s){if(!(s===""||s.trim()==="")){var f=s.match(/<(?:\w+:)?comment[^<>]*>/);if(f){var c=he(f[0]),o={author:c.authorId&&r[c.authorId]||"sheetjsghost",ref:c.ref,guid:c.guid},l=Rr(c.ref);if(!(t.sheetRows&&t.sheetRows<=l.r)){var v=fr(s,"text"),x=!!v&&!!v[1]&&f0(v[1])||{r:"",t:"",h:""};o.r=x.r,x.r==""&&(x.t=x.h=""),o.t=(x.t||"").replace(/\r\n/g,` -`).replace(/\r/g,` -`),t.cellHTML&&(o.h=x.h),a.push(o)}}}}),a}function zh(e,t){var r=[],a=!1,n={},i=0;return e.replace(ur,function(f,c){var o=he(f);switch(Hr(o[0])){case"":break;case"":n.t!=null&&r.push(n);break;case"":case"":n.t=e.slice(i,c).replace(/\r\n/g,` -`).replace(/\r/g,` -`);break;case"":a=!0;break;case"":a=!1;break;case"":case"":case"":break;case"":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return f}),r}function Kh(e,t){var r=[],a=!1;return e.replace(ur,function(i){var s=he(i);switch(Hr(s[0])){case"":break;case"":break;case"":case"":case"":break;case"":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+s[0]+" in threaded comments")}return i}),r}function Yh(e){var t={};t.iauthor=e.read_shift(4);var r=Bt(e,16);return t.rfx=r.s,t.ref=Me(r.s),e.l+=16,t}var jh=pr;function Zh(e,t){var r=[],a=[],n={},i=!1;return ot(e,function(f,c,o){switch(o){case 632:a.push(f);break;case 635:n=f;break;case 637:n.t=f.t,n.h=f.h,n.r=f.r;break;case 636:if(n.author=a[n.iauthor],delete n.iauthor,t.sheetRows&&n.rfx&&t.sheetRows<=n.rfx.r)break;n.t||(n.t=""),delete n.rfx,r.push(n);break;case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:break;case 38:break;default:if(!c.T){if(!i||t.WTF)throw new Error("Unexpected record 0x"+o.toString(16))}}}),r}var Jh="application/vnd.ms-office.vbaProject";function qh(e){var t=Pe.utils.cfb_new({root:"R"});return e.FullPaths.forEach(function(r,a){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var n=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");Pe.utils.cfb_add(t,n,e.FileIndex[a].content)}}),Pe.write(t)}function Qh(){return{"!type":"dialog"}}function e1(){return{"!type":"dialog"}}function r1(){return{"!type":"macro"}}function t1(){return{"!type":"macro"}}var bt=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(a,n,i,s){var f=!1,c=!1;i.length==0?c=!0:i.charAt(0)=="["&&(c=!0,i=i.slice(1,-1)),s.length==0?f=!0:s.charAt(0)=="["&&(f=!0,s=s.slice(1,-1));var o=i.length>0?parseInt(i,10)|0:0,l=s.length>0?parseInt(s,10)|0:0;return f?l+=t.c:--l,c?o+=t.r:--o,n+(f?"":"$")+Ve(l)+(c?"":"$")+ze(o)}return function(n,i){return t=i,n.replace(e,r)}})(),o0=/(^|[^._A-Z0-9])(\$?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])(\$?)(\d{1,7})(?![_.\(A-Za-z0-9])/g;try{o0=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g}catch{}var a1=(function(){return function(t,r){return t.replace(o0,function(a,n,i,s,f,c){var o=is(s)-(i?0:r.c),l=ns(c)-(f?0:r.r),v=f=="$"?l+1:l==0?"":"["+l+"]",x=i=="$"?o+1:o==0?"":"["+o+"]";return n+"R"+v+"C"+x})}})();function Is(e,t){return e.replace(o0,function(r,a,n,i,s,f){return a+(n=="$"?n+i:Ve(is(i)+t.c))+(s=="$"?s+f:ze(ns(f)+t.r))})}function hi(e,t,r){var a=a0(t),n=a.s,i=Rr(r),s={r:i.r-n.r,c:i.c-n.c};return Is(e,s)}function n1(e){return e.length!=1}function xi(e){return e.replace(/_xlfn\./g,"")}function qe(e){e.l+=1}function gt(e,t){var r=e.read_shift(t==1?1:2);return[r&16383,r>>14&1,r>>15&1]}function Os(e,t,r){var a=2;if(r){if(r.biff>=2&&r.biff<=5)return Ns(e,t,r);r.biff==12&&(a=4)}var n=e.read_shift(a),i=e.read_shift(a),s=gt(e,2),f=gt(e,2);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:f[0],cRel:f[1],rRel:f[2]}}}function Ns(e){var t=gt(e,2),r=gt(e,2),a=e.read_shift(1),n=e.read_shift(1);return{s:{r:t[0],c:a,cRel:t[1],rRel:t[2]},e:{r:r[0],c:n,cRel:r[1],rRel:r[2]}}}function i1(e,t,r){if(r.biff<8)return Ns(e,t,r);var a=e.read_shift(r.biff==12?4:2),n=e.read_shift(r.biff==12?4:2),i=gt(e,2),s=gt(e,2);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:n,c:s[0],cRel:s[1],rRel:s[2]}}}function Rs(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return s1(e,t,r);var a=e.read_shift(r&&r.biff==12?4:2),n=gt(e,2);return{r:a,c:n[0],cRel:n[1],rRel:n[2]}}function s1(e){var t=gt(e,2),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function f1(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function c1(e,t,r){var a=r&&r.biff?r.biff:8;if(a>=2&&a<=5)return o1(e,t,r);var n=e.read_shift(a>=12?4:2),i=e.read_shift(2),s=(i&16384)>>14,f=(i&32768)>>15;if(i&=16383,f==1)for(;n>524287;)n-=1048576;if(s==1)for(;i>8191;)i=i-16384;return{r:n,c:i,cRel:s,rRel:f}}function o1(e){var t=e.read_shift(2),r=e.read_shift(1),a=(t&32768)>>15,n=(t&16384)>>14;return t&=16383,a==1&&t>=8192&&(t=t-16384),n==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:n,rRel:a}}function l1(e,t,r){var a=(e[e.l++]&96)>>5,n=Os(e,r.biff>=2&&r.biff<=5?6:8,r);return[a,n]}function u1(e,t,r){var a=(e[e.l++]&96)>>5,n=e.read_shift(2,"i"),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}var s=Os(e,i,r);return[a,n,s]}function h1(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[a]}function x1(e,t,r){var a=(e[e.l++]&96)>>5,n=e.read_shift(2),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}return e.l+=i,[a,n]}function d1(e,t,r){var a=(e[e.l++]&96)>>5,n=i1(e,t-1,r);return[a,n]}function m1(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[a]}function di(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function v1(e,t,r){e.l+=2;for(var a=e.read_shift(r&&r.biff==2?1:2),n=[],i=0;i<=a;++i)n.push(e.read_shift(r&&r.biff==2?1:2));return n}function p1(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function g1(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function _1(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function w1(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[a]}function Ls(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function k1(e){return e.read_shift(2),Ls(e,2)}function E1(e){return e.read_shift(2),Ls(e,2)}function T1(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var n=Rs(e,0,r);return[a,n]}function y1(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var n=c1(e,0,r);return[a,n]}function S1(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var n=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var i=Rs(e,0,r);return[a,n,i]}function F1(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var n=e.read_shift(r&&r.biff<=3?1:2);return[Ax[n],Ms[n],a]}function A1(e,t,r){var a=e[e.l++],n=e.read_shift(1),i=r&&r.biff<=3?[a==88?-1:0,e.read_shift(1)]:C1(e);return[n,(i[0]===0?Ms:Fx)[i[1]]]}function C1(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function b1(e,t,r){e.l+=r&&r.biff==2?3:4}function D1(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var a=e.read_shift(2),n=e.read_shift(r&&r.biff==2?1:2);return[a,n]}function I1(e){return e.l++,et[e.read_shift(1)]}function O1(e){return e.l++,e.read_shift(2)}function N1(e){return e.l++,e.read_shift(1)!==0}function R1(e){return e.l++,vr(e,8)}function L1(e,t,r){return e.l++,Kt(e,t-1,r)}function P1(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=Ye(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=et[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=vr(e,8);break;case 2:r[1]=Mt(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function B1(e,t,r){for(var a=e.read_shift(r.biff==12?4:2),n=[],i=0;i!=a;++i)n.push((r.biff==12?Bt:fn)(e,8));return n}function M1(e,t,r){var a=0,n=0;r.biff==12?(a=e.read_shift(4),n=e.read_shift(4)):(n=1+e.read_shift(1),a=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--a,--n==0&&(n=256));for(var i=0,s=[];i!=a&&(s[i]=[]);++i)for(var f=0;f!=n;++f)s[i][f]=P1(e,r.biff);return s}function U1(e,t,r){var a=e.read_shift(1)>>>5&3,n=!r||r.biff>=8?4:2,i=e.read_shift(n);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[a,0,i]}function W1(e,t,r){if(r.biff==5)return H1(e,t,r);var a=e.read_shift(1)>>>5&3,n=e.read_shift(2),i=e.read_shift(4);return[a,n,i]}function H1(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var a=e.read_shift(2);return e.l+=12,[t,r,a]}function X1(e,t,r){var a=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var n=e.read_shift(r&&r.biff==2?1:2);return[a,n]}function V1(e,t,r){var a=e.read_shift(1)>>>5&3,n=e.read_shift(r&&r.biff==2?1:2);return[a,n]}function $1(e,t,r){var a=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[a]}function G1(e,t,r){var a=(e[e.l++]&96)>>5,n=e.read_shift(2),i=4;if(r)switch(r.biff){case 5:i=15;break;case 12:i=6;break}return e.l+=i,[a,n]}var z1=_r,K1=_r,Y1=_r;function ya(e,t,r){return e.l+=2,[f1(e,4,r)]}function l0(e){return e.l+=6,[]}var j1=ya,Z1=l0,J1=l0,q1=ya;function Ps(e){return e.l+=2,[Ke(e),e.read_shift(2)&1]}var Q1=ya,ex=Ps,rx=l0,tx=ya,ax=ya,nx=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function ix(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),n=e.read_shift(2),i=e.read_shift(2),s=nx[r>>2&31];return{ixti:t,coltype:r&3,rt:s,idx:a,c:n,C:i}}function sx(e){return e.l+=2,[e.read_shift(4)]}function fx(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function cx(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function ox(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function lx(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function ux(e){return e.l+=4,[0,0]}var mi={1:{n:"PtgExp",f:D1},2:{n:"PtgTbl",f:Y1},3:{n:"PtgAdd",f:qe},4:{n:"PtgSub",f:qe},5:{n:"PtgMul",f:qe},6:{n:"PtgDiv",f:qe},7:{n:"PtgPower",f:qe},8:{n:"PtgConcat",f:qe},9:{n:"PtgLt",f:qe},10:{n:"PtgLe",f:qe},11:{n:"PtgEq",f:qe},12:{n:"PtgGe",f:qe},13:{n:"PtgGt",f:qe},14:{n:"PtgNe",f:qe},15:{n:"PtgIsect",f:qe},16:{n:"PtgUnion",f:qe},17:{n:"PtgRange",f:qe},18:{n:"PtgUplus",f:qe},19:{n:"PtgUminus",f:qe},20:{n:"PtgPercent",f:qe},21:{n:"PtgParen",f:qe},22:{n:"PtgMissArg",f:qe},23:{n:"PtgStr",f:L1},26:{n:"PtgSheet",f:fx},27:{n:"PtgEndSheet",f:cx},28:{n:"PtgErr",f:I1},29:{n:"PtgBool",f:N1},30:{n:"PtgInt",f:O1},31:{n:"PtgNum",f:R1},32:{n:"PtgArray",f:m1},33:{n:"PtgFunc",f:F1},34:{n:"PtgFuncVar",f:A1},35:{n:"PtgName",f:U1},36:{n:"PtgRef",f:T1},37:{n:"PtgArea",f:l1},38:{n:"PtgMemArea",f:X1},39:{n:"PtgMemErr",f:z1},40:{n:"PtgMemNoMem",f:K1},41:{n:"PtgMemFunc",f:V1},42:{n:"PtgRefErr",f:$1},43:{n:"PtgAreaErr",f:h1},44:{n:"PtgRefN",f:y1},45:{n:"PtgAreaN",f:d1},46:{n:"PtgMemAreaN",f:ox},47:{n:"PtgMemNoMemN",f:lx},57:{n:"PtgNameX",f:W1},58:{n:"PtgRef3d",f:S1},59:{n:"PtgArea3d",f:u1},60:{n:"PtgRefErr3d",f:G1},61:{n:"PtgAreaErr3d",f:x1},255:{}},hx={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},xx={1:{n:"PtgElfLel",f:Ps},2:{n:"PtgElfRw",f:tx},3:{n:"PtgElfCol",f:j1},6:{n:"PtgElfRwV",f:ax},7:{n:"PtgElfColV",f:q1},10:{n:"PtgElfRadical",f:Q1},11:{n:"PtgElfRadicalS",f:rx},13:{n:"PtgElfColS",f:Z1},15:{n:"PtgElfColSV",f:J1},16:{n:"PtgElfRadicalLel",f:ex},25:{n:"PtgList",f:ix},29:{n:"PtgSxName",f:sx},255:{}},dx={0:{n:"PtgAttrNoop",f:ux},1:{n:"PtgAttrSemi",f:w1},2:{n:"PtgAttrIf",f:g1},4:{n:"PtgAttrChoose",f:v1},8:{n:"PtgAttrGoto",f:p1},16:{n:"PtgAttrSum",f:b1},32:{n:"PtgAttrBaxcel",f:di},33:{n:"PtgAttrBaxcel",f:di},64:{n:"PtgAttrSpace",f:k1},65:{n:"PtgAttrSpaceSemi",f:E1},128:{n:"PtgAttrIfError",f:_1},255:{}};function Sa(e,t,r,a){if(a.biff<8)return _r(e,t);for(var n=e.l+t,i=[],s=0;s!==r.length;++s)switch(r[s][0]){case"PtgArray":r[s][1]=M1(e,0,a),i.push(r[s][1]);break;case"PtgMemArea":r[s][2]=B1(e,r[s][1],a),i.push(r[s][2]);break;case"PtgExp":a&&a.biff==12&&(r[s][1][1]=e.read_shift(4),i.push(r[s][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[s][0];default:break}return t=n-e.l,t!==0&&i.push(_r(e,t)),i}function Fa(e,t,r){for(var a=e.l+t,n,i,s=[];a!=e.l;)t=a-e.l,i=e[e.l],n=mi[i]||mi[hx[i]],(i===24||i===25)&&(n=(i===24?xx:dx)[e[e.l+1]]),!n||!n.f?_r(e,t):s.push([n.n,n.f(e,t,r)]);return s}function mx(e){for(var t=[],r=0;r=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function px(e,t){var r=e.lastIndexOf("!"),a=t.lastIndexOf("!");return r==-1&&a==-1?e+":"+t:r>0&&a>0&&e.slice(0,r).toLowerCase()==t.slice(0,a).toLowerCase()?e+":"+t.slice(a+1):(console.error("Cannot hydrate range",e,t),e+":"+t)}function Bs(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!a)return"SH33TJSERR1";var n="";if(r.biff>8)switch(e[a[0]][0]){case 357:return n=a[1]==-1?"#REF":e.SheetNames[a[1]],a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[a[0]][0];default:return"SH33TJSSRC"+e[a[0]][0]}switch(e[a[0]][0][0]){case 1025:return n=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3",a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 14849:return e[a[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return e[a[0]][0][3]?(n=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4",a[1]==a[2]?n:n+":"+e[a[0]][0][3][a[2]]):"SH33TJSERR2"}}function vi(e,t,r){var a=Bs(e,t,r);return a=="#REF"?a:vo(a,r)}function dr(e,t,r,a,n){var i=n&&n.biff||8,s={s:{c:0,r:0},e:{c:0,r:0}},f=[],c,o,l,v=0,x=0,u,m="";if(!e[0]||!e[0][0])return"";for(var p=-1,h="",d=0,E=e[0].length;d=0){switch(e[0][p][1][0]){case 0:h=Le(" ",e[0][p][1][1]);break;case 1:h=Le("\r",e[0][p][1][1]);break;default:if(h="",n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}o=o+h,p=-1}f.push(o+vx[g[0]]+c);break;case"PtgIsect":c=f.pop(),o=f.pop(),f.push(o+" "+c);break;case"PtgUnion":c=f.pop(),o=f.pop(),f.push(o+","+c);break;case"PtgRange":c=f.pop(),o=f.pop(),f.push(px(o,c));break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":l=ia(g[1][1],s,n),f.push(sa(l,i));break;case"PtgRefN":l=r?ia(g[1][1],r,n):g[1][1],f.push(sa(l,i));break;case"PtgRef3d":v=g[1][1],l=ia(g[1][2],s,n),m=vi(a,v,n);var b=m;f.push(m+"!"+sa(l,i));break;case"PtgFunc":case"PtgFuncVar":var R=g[1][0],G=g[1][1];R||(R=0),R&=127;var P=R==0?[]:f.slice(-R);f.length-=R,G==="User"&&(G=P.shift()),f.push(G+"("+P.join(",")+")");break;case"PtgBool":f.push(g[1]?"TRUE":"FALSE");break;case"PtgInt":f.push(g[1]);break;case"PtgNum":f.push(String(g[1]));break;case"PtgStr":f.push('"'+g[1].replace(/"/g,'""')+'"');break;case"PtgErr":f.push(g[1]);break;case"PtgAreaN":u=Y0(g[1][1],r?{s:r}:s,n),f.push(Fn(u,n));break;case"PtgArea":u=Y0(g[1][1],s,n),f.push(Fn(u,n));break;case"PtgArea3d":v=g[1][1],u=g[1][2],m=vi(a,v,n),f.push(m+"!"+Fn(u,n));break;case"PtgAttrSum":f.push("SUM("+f.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":x=g[1][2];var N=(a.names||[])[x-1]||(a[0]||[])[x],D=N?N.Name:"SH33TJSNAME"+String(x);D&&D.slice(0,6)=="_xlfn."&&!n.xlfn&&(D=D.slice(6)),f.push(D);break;case"PtgNameX":var B=g[1][1];x=g[1][2];var U;if(n.biff<=5)B<0&&(B=-B),a[B]&&(U=a[B][x]);else{var M="";if(((a[B]||[])[0]||[])[0]==14849||(((a[B]||[])[0]||[])[0]==1025?a[B][x]&&a[B][x].itab>0&&(M=a.SheetNames[a[B][x].itab-1]+"!"):M=a.SheetNames[x-1]+"!"),a[B]&&a[B][x])M+=a[B][x].Name;else if(a[0]&&a[0][x])M+=a[0][x].Name;else{var z=(Bs(a,B,n)||"").split(";;");z[x-1]?M=z[x-1]:M+="SH33TJSERRX"}f.push(M);break}U||(U={Name:"SH33TJSERRY"}),f.push(U.Name);break;case"PtgParen":var oe="(",q=")";if(p>=0){switch(h="",e[0][p][1][0]){case 2:oe=Le(" ",e[0][p][1][1])+oe;break;case 3:oe=Le("\r",e[0][p][1][1])+oe;break;case 4:q=Le(" ",e[0][p][1][1])+q;break;case 5:q=Le("\r",e[0][p][1][1])+q;break;default:if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}p=-1}f.push(oe+f.pop()+q);break;case"PtgRefErr":f.push("#REF!");break;case"PtgRefErr3d":f.push("#REF!");break;case"PtgExp":l={c:g[1][1],r:g[1][0]};var pe={c:r.c,r:r.r};if(a.sharedf[Me(l)]){var J=a.sharedf[Me(l)];f.push(dr(J,s,pe,a,n))}else{var xe=!1;for(c=0;c!=a.arrayf.length;++c)if(o=a.arrayf[c],!(l.co[0].e.c)&&!(l.ro[0].e.r)){f.push(dr(o[1],s,pe,a,n)),xe=!0;break}xe||f.push(g[1])}break;case"PtgArray":f.push("{"+mx(g[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":p=d;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":f.push("");break;case"PtgAreaErr":f.push("#REF!");break;case"PtgAreaErr3d":f.push("#REF!");break;case"PtgList":f.push("Table"+g[1].idx+"[#"+g[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(g));default:throw new Error("Unrecognized Formula Token: "+String(g))}var ge=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(n.biff!=3&&p>=0&&ge.indexOf(e[0][d][0])==-1){g=e[0][p];var ae=!0;switch(g[1][0]){case 4:ae=!1;case 0:h=Le(" ",g[1][1]);break;case 5:ae=!1;case 1:h=Le("\r",g[1][1]);break;default:if(h="",n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+g[1][0])}f.push((ae?h:"")+f.pop()+(ae?"":h)),p=-1}}if(f.length>1&&n.WTF)throw new Error("bad formula stack");return f[0]=="TRUE"?!0:f[0]=="FALSE"?!1:f[0]}function gx(e,t,r){var a=e.l+t,n=r.biff==2?1:2,i,s=e.read_shift(n);if(s==65535)return[[],_r(e,t-2)];var f=Fa(e,s,r);return t!==s+n&&(i=Sa(e,t-s-n,f,r)),e.l=a,[f,i]}function _x(e,t,r){var a=e.l+t,n=r.biff==2?1:2,i,s=e.read_shift(n);if(s==65535)return[[],_r(e,t-2)];var f=Fa(e,s,r);return t!==s+n&&(i=Sa(e,t-s-n,f,r)),e.l=a,[f,i]}function wx(e,t,r,a){var n=e.l+t,i=Fa(e,a,r),s;return n!==e.l&&(s=Sa(e,n-e.l,i,r)),[i,s]}function kx(e,t,r){var a=e.l+t,n,i=e.read_shift(2),s=Fa(e,i,r);return i==65535?[[],_r(e,t-2)]:(t!==i+2&&(n=Sa(e,a-i-2,s,r)),[s,n])}function Ex(e){var t;if(it(e,e.l+6)!==65535)return[vr(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=e[e.l+2]===1,e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function bn(e,t,r){var a=e.l+t,n=Yr(e,6,r),i=Ex(e,8),s=e.read_shift(1);r.biff!=2&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var f=_x(e,a-e.l,r);return{cell:n,val:i[0],formula:f,shared:s>>3&1,tt:i[1]}}function cn(e,t,r){var a=e.read_shift(4),n=Fa(e,a,r),i=e.read_shift(4),s=i>0?Sa(e,i,n,r):null;return[n,s]}var Tx=cn,on=cn,yx=cn,Sx=cn;var Fx={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Ms={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},Ax={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function pi(e){return e.slice(0,3)=="of:"&&(e=e.slice(3)),e.charCodeAt(0)==61&&(e=e.slice(1),e.charCodeAt(0)==61&&(e=e.slice(1))),e=e.replace(/COM\.MICROSOFT\./g,""),e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(t,r){return r.replace(/\./g,"")}),e=e.replace(/\$'([^']|'')+'/g,function(t){return t.slice(1)}),e=e.replace(/\$([^\]\. #$]+)/g,function(t,r){return r.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?t:r}),e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),e.replace(/[;~]/g,",").replace(/\|/g,";")}function Dn(e){e=e.replace(/\$'([^']|'')+'/g,function(a){return a.slice(1)}),e=e.replace(/\$([^\]\. #$]+)/g,function(a,n){return n.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?a:n});var t=e.split(":"),r=t[0].split(".")[0];return[r,t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}var la={},$t={};function ua(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];t=="xlml"&&(r=[1,1,1,1,.5,.5]),e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function Us(e,t,r,a,n,i,s){try{a.cellNF&&(e.z=Se[t])}catch(c){if(a.WTF)throw c}if(!(e.t==="z"&&!a.cellStyles)){if(e.t==="d"&&typeof e.v=="string"&&(e.v=gr(e.v)),(!a||a.cellText!==!1)&&e.t!=="z")try{if(Se[t]==null&&Ft(kc[t]||"General",t),e.t==="e")e.w=e.w||et[e.v];else if(t===0)if(e.t==="n")(e.v|0)===e.v?e.w=e.v.toString(10):e.w=ma(e.v);else if(e.t==="d"){var f=or(e.v,!!s);(f|0)===f?e.w=f.toString(10):e.w=ma(f)}else{if(e.v===void 0)return"";e.w=It(e.v,$t)}else e.t==="d"?e.w=Pr(t,or(e.v,!!s),$t):e.w=Pr(t,e.v,$t)}catch(c){if(a.WTF)throw c}if(a.cellStyles&&r!=null)try{e.s=i.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=Ja(n.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),a.WTF&&(e.s.fgColor.raw_rgb=n.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=Ja(n.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),a.WTF&&(e.s.bgColor.raw_rgb=n.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(c){if(a.WTF&&i.Fills)throw c}}}function Cx(e,t){var r=lr(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=We(r))}var bx=/<(?:\w+:)?mergeCell ref=["'][A-Z0-9:]+['"]\s*[\/]?>/g,Dx=/<(?:\w+:)?hyperlink [^<>]*>/mg,Ix=/"(\w*:\w*)"/,Ox=/<(?:\w+:)?col\b[^<>]*[\/]?>/g,Nx=/<(?:\w+:)?autoFilter[^>]*/g,Rx=/<(?:\w+:)?pageMargins[^<>]*\/>/g,Ws=/<(?:\w+:)?sheetPr\b[^<>]*?\/>/;function Lx(e,t,r,a,n,i,s){if(!e)return e;a||(a={"!id":{}}),ar!=null&&t.dense==null&&(t.dense=ar);var f={};t.dense&&(f["!data"]=[]);var c={s:{r:2e6,c:2e6},e:{r:0,c:0}},o="",l="",v=fr(e,"sheetData");v?(o=e.slice(0,v.index),l=e.slice(v.index+v[0].length)):o=l=e;var x=o.match(Ws);x?u0(x[0],f,n,r):(x=fr(o,"sheetPr"))&&Px(x[0],x[1]||"",f,n,r,s,i);var u=(o.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(u>0){var m=o.slice(u,u+50).match(Ix);m&&!(t&&t.nodim)&&Cx(f,m[1])}var p=fr(o,"sheetViews");p&&p[1]&&Xx(p[1],n);var h=[];if(t.cellStyles){var d=o.match(Ox);d&&Ux(h,d)}v&&Vx(v[1],f,t,c,i,s,n);var E=l.match(Nx);E&&(f["!autofilter"]=Wx(E[0]));var g=[],b=l.match(bx);if(b)for(u=0;u!=b.length;++u)g[u]=lr(b[u].slice(b[u].indexOf("=")+2));var R=l.match(Dx);R&&Bx(f,R,a);var G=l.match(Rx);G&&(f["!margins"]=Mx(he(G[0])));var P;if((P=l.match(/legacyDrawing r:id="(.*?)"/))&&(f["!legrel"]=P[1]),t&&t.nodim&&(c.s.c=c.s.r=0),!f["!ref"]&&c.e.c>=c.s.c&&c.e.r>=c.s.r&&(f["!ref"]=We(c)),t.sheetRows>0&&f["!ref"]){var N=lr(f["!ref"]);t.sheetRows<=+N.e.r&&(N.e.r=t.sheetRows-1,N.e.r>c.e.r&&(N.e.r=c.e.r),N.e.rc.e.c&&(N.e.c=c.e.c),N.e.c0&&(f["!cols"]=h),g.length>0&&(f["!merges"]=g),a["!id"][f["!legrel"]]&&(f["!legdrawel"]=a["!id"][f["!legrel"]]),f}function u0(e,t,r,a){var n=he(e);r.Sheets[a]||(r.Sheets[a]={}),n.codeName&&(r.Sheets[a].CodeName=Ne(Xe(n.codeName)))}function Px(e,t,r,a,n){u0(e.slice(0,e.indexOf(">")),r,a,n)}function Bx(e,t,r){for(var a=e["!data"]!=null,n=0;n!=t.length;++n){var i=he(Xe(t[n]),!0);if(!i.ref)return;var s=((r||{})["!id"]||[])[i.id];s?(i.Target=s.Target,i.location&&(i.Target+="#"+Ne(i.location))):(i.Target="#"+Ne(i.location),s={Target:i.Target,TargetMode:"Internal"}),i.Rel=s,i.tooltip&&(i.Tooltip=i.tooltip,delete i.tooltip);for(var f=lr(i.ref),c=f.s.r;c<=f.e.r;++c)for(var o=f.s.c;o<=f.e.c;++o){var l=Ve(o)+ze(c);a?(e["!data"][c]||(e["!data"][c]=[]),e["!data"][c][o]||(e["!data"][c][o]={t:"z",v:void 0}),e["!data"][c][o].l=i):(e[l]||(e[l]={t:"z",v:void 0}),e[l].l=i)}}}function Mx(e){var t={};return["left","right","top","bottom","header","footer"].forEach(function(r){e[r]&&(t[r]=parseFloat(e[r]))}),t}function Ux(e,t){for(var r=!1,a=0;a!=t.length;++a){var n=he(t[a],!0);n.hidden&&(n.hidden=Ue(n.hidden));var i=parseInt(n.min,10)-1,s=parseInt(n.max,10)-1;for(n.outlineLevel&&(n.level=+n.outlineLevel||0),delete n.min,delete n.max,n.width=+n.width,!r&&n.width&&(r=!0,c0(n.width)),Yt(n);i<=s;)e[i++]=rr(n)}}function Wx(e){var t={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return t}var Hx=/<(?:\w:)?sheetView(?:[^<>a-z][^<>]*)?\/?>/g;function Xx(e,t){t.Views||(t.Views=[{}]),(e.match(Hx)||[]).forEach(function(r,a){var n=he(r);t.Views[a]||(t.Views[a]={}),+n.zoomScale&&(t.Views[a].zoom=+n.zoomScale),n.rightToLeft&&Ue(n.rightToLeft)&&(t.Views[a].RTL=!0)})}var Vx=(function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,a=/ref=["']([^"']*)["']/;return function(i,s,f,c,o,l,v){for(var x=0,u="",m=[],p=[],h=0,d=0,E=0,g="",b,R,G=0,P=0,N,D,B=0,U=0,M=Array.isArray(l.CellXf),z,oe=[],q=[],pe=s["!data"]!=null,J=[],xe={},ge=!1,ae=!!f.sheetStubs,Ee=!!((v||{}).WBProps||{}).date1904,Z=i.split(t),ve=0,ue=Z.length;ve!=ue;++ve){u=Z[ve].trim();var Ce=u.length;if(Ce!==0){var de=0;e:for(x=0;x":if(u[x-1]!="/"){++x;break e}if(f&&f.cellStyles){if(R=he(u.slice(de,x),!0),G=R.r!=null?parseInt(R.r,10):G+1,P=-1,f.sheetRows&&f.sheetRows=x)break;if(R=he(u.slice(de,x),!0),G=R.r!=null?parseInt(R.r,10):G+1,P=-1,!(f.sheetRows&&f.sheetRowsG-1&&(c.s.r=G-1),c.e.r":"")+u,p!=null&&p.length===2){for(h=0,g=p[1],d=0;d!=g.length&&!((E=g.charCodeAt(d)-64)<1||E>26);++d)h=26*h+E;--h,P=h}else++P;for(d=0;d!=u.length&&u.charCodeAt(d)!==62;++d);if(++d,R=he(u.slice(0,d),!0),R.r||(R.r=Me({r:G-1,c:P})),g=u.slice(d),b={t:""},(p=fr(g,"v"))!=null&&p[1]!==""&&(b.v=Ne(p[1])),f.cellFormula){if((p=fr(g,"f"))!=null){if(p[1]=="")p[0].indexOf('t="shared"')>-1&&(D=he(p[0]),q[D.si]&&(b.f=hi(q[D.si][1],q[D.si][2],R.r)));else if(b.f=Ne(Xe(p[1]),!0),f.xlfn||(b.f=xi(b.f)),p[0].indexOf('t="array"')>-1)b.F=(g.match(a)||[])[1],b.F.indexOf(":")>-1&&oe.push([lr(b.F),b.F]);else if(p[0].indexOf('t="shared"')>-1){D=he(p[0]);var A=Ne(Xe(p[1]));f.xlfn||(A=xi(A)),q[parseInt(D.si,10)]=[D,A,R.r]}}else(p=g.match(/]*\/>/))&&(D=he(p[0]),q[D.si]&&(b.f=hi(q[D.si][1],q[D.si][2],R.r)));var L=Rr(R.r);for(d=0;d=oe[d][0].s.r&&L.r<=oe[d][0].e.r&&L.c>=oe[d][0].s.c&&L.c<=oe[d][0].e.c&&(b.F=oe[d][1])}if(R.t==null&&b.v===void 0)if(b.f||b.F)b.v=0,b.t="n";else if(ae)b.t="z";else continue;else b.t=R.t||"n";switch(c.s.c>P&&(c.s.c=P),c.e.c"u"){if(!ae)continue;b.t="z"}else N=la[parseInt(b.v,10)],b.v=N.t,b.r=N.r,f.cellHTML&&(b.h=N.h);break;case"str":b.t="s",b.v=b.v!=null?Ne(Xe(b.v),!0):"",f.cellHTML&&(b.h=Yi(b.v));break;case"inlineStr":p=fr(g,"is"),b.t="s",p!=null&&(N=f0(p[1]))?(b.v=N.t,f.cellHTML&&(b.h=N.h)):b.v="";break;case"b":b.v=Ue(b.v);break;case"d":f.cellDates?b.v=gr(b.v,Ee):(b.v=or(gr(b.v,Ee),Ee),b.t="n");break;case"e":(!f||f.cellText!==!1)&&(b.w=b.v),b.v=Sr[b.v];break}if(B=U=0,z=null,M&&R.s!==void 0&&(z=l.CellXf[R.s],z!=null&&(z.numFmtId!=null&&(B=z.numFmtId),f.cellStyles&&z.fillId!=null&&(U=z.fillId))),Us(b,B,U,f,o,l,Ee),f.cellDates&&M&&b.t=="n"&&Qr(Se[B])&&(b.v=vt(b.v+(Ee?1462:0)),b.t=typeof b.v=="number"?"n":"d"),R.cm&&f.xlmeta){var O=(f.xlmeta.Cell||[])[+R.cm-1];O&&O.type=="XLDAPR"&&(b.D=!0)}var w;f.nodim&&(w=Rr(R.r),c.s.r>w.r&&(c.s.r=w.r),c.e.r0&&(s["!rows"]=J)}})();function $x(e,t){var r={},a=e.l+t;r.r=e.read_shift(4),e.l+=4;var n=e.read_shift(2);e.l+=1;var i=e.read_shift(1);return e.l=a,i&7&&(r.level=i&7),i&16&&(r.hidden=!0),i&32&&(r.hpt=n/20),r}var Gx=Bt;function zx(){}function Kx(e,t){var r={},a=e[e.l];return++e.l,r.above=!(a&64),r.left=!(a&128),e.l+=18,r.name=ko(e,t-19),r}function Yx(e){var t=Xr(e);return[t]}function jx(e){var t=Pt(e);return[t]}function Zx(e){var t=Xr(e),r=e.read_shift(1);return[t,r,"b"]}function Jx(e){var t=Pt(e),r=e.read_shift(1);return[t,r,"b"]}function qx(e){var t=Xr(e),r=e.read_shift(1);return[t,r,"e"]}function Qx(e){var t=Pt(e),r=e.read_shift(1);return[t,r,"e"]}function ed(e){var t=Xr(e),r=e.read_shift(4);return[t,r,"s"]}function rd(e){var t=Pt(e),r=e.read_shift(4);return[t,r,"s"]}function td(e){var t=Xr(e),r=vr(e);return[t,r,"n"]}function Hs(e){var t=Pt(e),r=vr(e);return[t,r,"n"]}function ad(e){var t=Xr(e),r=sn(e);return[t,r,"n"]}function nd(e){var t=Pt(e),r=sn(e);return[t,r,"n"]}function id(e){var t=Xr(e),r=n0(e);return[t,r,"is"]}function sd(e){var t=Xr(e),r=pr(e);return[t,r,"str"]}function fd(e){var t=Pt(e),r=pr(e);return[t,r,"str"]}function cd(e,t,r){var a=e.l+t,n=Xr(e);n.r=r["!row"];var i=e.read_shift(1),s=[n,i,"b"];if(r.cellFormula){e.l+=2;var f=on(e,a-e.l,r);s[3]=dr(f,null,n,r.supbooks,r)}else e.l=a;return s}function od(e,t,r){var a=e.l+t,n=Xr(e);n.r=r["!row"];var i=e.read_shift(1),s=[n,i,"e"];if(r.cellFormula){e.l+=2;var f=on(e,a-e.l,r);s[3]=dr(f,null,n,r.supbooks,r)}else e.l=a;return s}function ld(e,t,r){var a=e.l+t,n=Xr(e);n.r=r["!row"];var i=vr(e),s=[n,i,"n"];if(r.cellFormula){e.l+=2;var f=on(e,a-e.l,r);s[3]=dr(f,null,n,r.supbooks,r)}else e.l=a;return s}function ud(e,t,r){var a=e.l+t,n=Xr(e);n.r=r["!row"];var i=pr(e),s=[n,i,"str"];if(r.cellFormula){e.l+=2;var f=on(e,a-e.l,r);s[3]=dr(f,null,n,r.supbooks,r)}else e.l=a;return s}var hd=Bt;function xd(e,t){var r=e.l+t,a=Bt(e,16),n=nn(e),i=pr(e),s=pr(e),f=pr(e);e.l=r;var c={rfx:a,relId:n,loc:i,display:f};return s&&(c.Tooltip=s),c}function dd(){}function md(e,t,r){var a=e.l+t,n=ss(e,16),i=e.read_shift(1),s=[n];if(s[2]=i,r.cellFormula){var f=Tx(e,a-e.l,r);s[1]=f}else e.l=a;return s}function vd(e,t,r){var a=e.l+t,n=Bt(e,16),i=[n];if(r.cellFormula){var s=Sx(e,a-e.l,r);i[1]=s,e.l=a}else e.l=a;return i}var pd=["left","right","top","bottom","header","footer"];function gd(e){var t={};return pd.forEach(function(r){t[r]=vr(e,8)}),t}function _d(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function wd(){}function kd(){}function Ed(e,t,r,a,n,i,s){if(!e)return e;var f=t||{};a||(a={"!id":{}}),ar!=null&&f.dense==null&&(f.dense=ar);var c={};f.dense&&(c["!data"]=[]);var o,l={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=[],x=!1,u=!1,m,p,h,d,E,g,b,R,G,P=[];f.biff=12,f["!row"]=0;var N=0,D=!1,B=[],U={},M=f.supbooks||n.supbooks||[[]];if(M.sharedf=U,M.arrayf=B,M.SheetNames=n.SheetNames||n.Sheets.map(function(Ee){return Ee.name}),!f.supbooks&&(f.supbooks=M,n.Names))for(var z=0;z0),E=Z[0].c==-1?E+1:Z[0].c,f.dense?(c["!data"][d]||(c["!data"][d]=[]),c["!data"][d][E]=p):c[Ve(E)+R]=p,f.cellFormula){for(D=!1,N=0;N=Ce[0].s.r&&m.r<=Ce[0].e.r&&E>=Ce[0].s.c&&E<=Ce[0].e.c&&(p.F=We(Ce[0]),D=!0)}!D&&Z.length>3&&(p.f=Z[3])}if(l.s.r>m.r&&(l.s.r=m.r),l.s.c>E&&(l.s.c=E),l.e.rm.r&&(l.s.r=m.r),l.s.c>E&&(l.s.c=E),l.e.r=Z.s;)oe[Z.e--]={width:Z.w/256,hidden:!!(Z.flags&1),level:Z.level},pe||(pe=!0,c0(Z.w/256)),Yt(oe[Z.e+1]);break;case 551:Z&&(c["!legrel"]=Z);break;case 161:c["!autofilter"]={ref:We(Z)};break;case 476:c["!margins"]=Z;break;case 147:n.Sheets[r]||(n.Sheets[r]={}),Z.name&&(n.Sheets[r].CodeName=Z.name),(Z.above||Z.left)&&(c["!outline"]={above:Z.above,left:Z.left});break;case 137:n.Views||(n.Views=[{}]),n.Views[0]||(n.Views[0]={}),Z.RTL&&(n.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:x=!0;break;case 36:x=!1;break;case 37:v.push(ue),x=!0;break;case 38:v.pop(),x=!1;break;default:if(!ve.T){if(!x||f.WTF)throw new Error("Unexpected record 0x"+ue.toString(16))}}},f),delete f.supbooks,delete f["!row"],!c["!ref"]&&(l.s.r<2e6||o&&(o.e.r>0||o.e.c>0||o.s.r>0||o.s.c>0))&&(c["!ref"]=We(o||l)),f.sheetRows&&c["!ref"]){var ae=lr(c["!ref"]);f.sheetRows<=+ae.e.r&&(ae.e.r=f.sheetRows-1,ae.e.r>l.e.r&&(ae.e.r=l.e.r),ae.e.rl.e.c&&(ae.e.c=l.e.c),ae.e.c0&&(c["!merges"]=P),oe.length>0&&(c["!cols"]=oe),q.length>0&&(c["!rows"]=q),a["!id"][c["!legrel"]]&&(c["!legdrawel"]=a["!id"][c["!legrel"]]),c}function Td(e){var t=[],r=e.match(/^/),a;(e.match(/\/]*>([^<])<\/c:v><\/c:pt>/mg)||[]).forEach(function(i){var s=i.match(/\/]*>([^<]*)<\/c:v><\/c:pt>/);s&&(t[+s[1]]=r?+s[2]:s[2])});var n=Ne((At(e,"c:formatCode")||["","General"])[1]);return(Zn(e,"","")||[]).forEach(function(i){a=i.replace(/<[^<>]*>/g,"")}),[t,n,a]}function yd(e,t,r,a,n,i){var s=i||{"!type":"chart"};if(!e)return i;var f=0,c=0,o="A",l={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(Zn(e,"","")||[]).forEach(function(v){var x=Td(v);l.s.r=l.s.c=0,l.e.c=f,o=Ve(f),x[0].forEach(function(u,m){s["!data"]?(s["!data"][m]||(s["!data"][m]=[]),s["!data"][m][f]={t:"n",v:u,z:x[1]}):s[o+ze(m)]={t:"n",v:u,z:x[1]},c=m}),l.e.r0&&(s["!ref"]=We(l)),s}function Sd(e,t,r,a,n){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},s,f=e.match(Ws);return f&&u0(f[0],i,n,r),(s=e.match(/drawing r:id="(.*?)"/))&&(i["!rel"]=s[1]),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}function Fd(e,t){e.l+=10;var r=pr(e,t-10);return{name:r}}function Ad(e,t,r,a,n){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},s=[],f=!1;return ot(e,function(o,l,v){switch(v){case 550:i["!rel"]=o;break;case 651:n.Sheets[r]||(n.Sheets[r]={}),o.name&&(n.Sheets[r].CodeName=o.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:f=!0;break;case 36:f=!1;break;case 37:s.push(v);break;case 38:s.pop();break;default:if(l.T>0)s.push(v);else if(l.T<0)s.pop();else if(!f||t.WTF)throw new Error("Unexpected record 0x"+v.toString(16))}},t),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}var Xs=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],Cd=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],bd=[],Dd=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function gi(e,t){for(var r=0;r!=e.length;++r)for(var a=e[r],n=0;n!=t.length;++n){var i=t[n];if(a[i[0]]==null)a[i[0]]=i[1];else switch(i[2]){case"bool":typeof a[i[0]]=="string"&&(a[i[0]]=Ue(a[i[0]]));break;case"int":typeof a[i[0]]=="string"&&(a[i[0]]=parseInt(a[i[0]],10));break}}}function _i(e,t){for(var r=0;r!=t.length;++r){var a=t[r];if(e[a[0]]==null)e[a[0]]=a[1];else switch(a[2]){case"bool":typeof e[a[0]]=="string"&&(e[a[0]]=Ue(e[a[0]]));break;case"int":typeof e[a[0]]=="string"&&(e[a[0]]=parseInt(e[a[0]],10));break}}}function Vs(e){_i(e.WBProps,Xs),_i(e.CalcPr,Dd),gi(e.WBView,Cd),gi(e.Sheets,bd),$t.date1904=Ue(e.WBProps.date1904)}var Id=":][*?/\\".split("");function Od(e,t){try{if(e=="")throw new Error("Sheet name cannot be blank");if(e.length>31)throw new Error("Sheet name cannot exceed 31 chars");if(e.charCodeAt(0)==39||e.charCodeAt(e.length-1)==39)throw new Error("Sheet name cannot start or end with apostrophe (')");if(e.toLowerCase()=="history")throw new Error("Sheet name cannot be 'History'");Id.forEach(function(r){if(e.indexOf(r)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")})}catch(r){if(t)return!1;throw r}return!0}var Nd=/<\w+:workbook/;function Rd(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},a=!1,n="xmlns",i={},s=0;if(e.replace(ur,function(c,o){var l=he(c);switch(Hr(l[0])){case"":break;case"":case"":break;case"":break;case"":Xs.forEach(function(v){if(l[v[0]]!=null)switch(v[2]){case"bool":r.WBProps[v[0]]=Ue(l[v[0]]);break;case"int":r.WBProps[v[0]]=parseInt(l[v[0]],10);break;default:r.WBProps[v[0]]=l[v[0]]}}),l.codeName&&(r.WBProps.CodeName=Xe(l.codeName));break;case"":break;case"":break;case"":case"":break;case"":delete l[0],r.WBView.push(l);break;case"":break;case"":case"":break;case"":break;case"":break;case"":case"":break;case"":break;case"":case"":a=!1;break;case"":i.Ref=Ne(Xe(e.slice(s,o))),r.Names.push(i);break;case"":break;case"":delete l[0],r.CalcPr=l;break;case"":break;case"":case"":case"":break;case"":case"":case"":break;case"":case"":break;case"":break;case"":break;case"":case"":break;case"":case"":case"":break;case"":a=!1;break;case"":a=!0;break;case"":a=!1;break;case"8?pr(e):"";return n.length>0&&(r.CodeName=n),r.autoCompressPictures=!!(a&65536),r.backupFile=!!(a&64),r.checkCompatibility=!!(a&4096),r.date1904=!!(a&1),r.filterPrivacy=!!(a&8),r.hidePivotFieldList=!!(a&1024),r.promptedSolutions=!!(a&16),r.publishItems=!!(a&2048),r.refreshAllConnections=!!(a&262144),r.saveExternalLinkValues=!!(a&128),r.showBorderUnselectedTables=!!(a&4),r.showInkAnnotation=!!(a&32),r.showObjects=["all","placeholders","none"][a>>13&3],r.showPivotChartFilter=!!(a&32768),r.updateLinks=["userSet","never","always"][a>>8&3],r}function Bd(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function Md(e,t,r){var a=e.l+t,n=e.read_shift(4);e.l+=1;var i=e.read_shift(4),s=Eo(e),f,c="";try{f=yx(e,0,r);try{c=nn(e)}catch{}}catch{console.error("Could not parse defined name "+s)}n&32&&(s="_xlnm."+s),e.l=a;var o={Name:s,Ptg:f,Flags:n};return i<268435455&&(o.Sheet=i),c&&(o.Comment=c),o}function Ud(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},a=[],n=!1;t||(t={}),t.biff=12;var i=[],s=[[]];return s.SheetNames=[],s.XTI=[],en[16]={n:"BrtFRTArchID$",f:Bd},ot(e,function(c,o,l){switch(l){case 156:s.SheetNames.push(c.name),r.Sheets.push(c);break;case 153:r.WBProps=c;break;case 39:c.Sheet!=null&&(t.SID=c.Sheet),c.Ref=c.Ptg?dr(c.Ptg,null,null,s,t):"#REF!",delete t.SID,delete c.Ptg,i.push(c);break;case 1036:break;case 357:case 358:case 355:case 667:s[0].length?s.push([l,c]):s[0]=[l,c],s[s.length-1].XTI=[];break;case 362:s.length===0&&(s[0]=[],s[0].XTI=[]),s[s.length-1].XTI=s[s.length-1].XTI.concat(c),s.XTI=s.XTI.concat(c);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:a.push(l),n=!0;break;case 36:a.pop(),n=!1;break;case 37:a.push(l),n=!0;break;case 38:a.pop(),n=!1;break;case 16:break;default:if(!o.T){if(!n||t.WTF&&a[a.length-1]!=37&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+l.toString(16))}}},t),Vs(r),r.Names=i,r.supbooks=s,r}function Wd(e,t,r){return t.slice(-4)===".bin"?Ud(e,r):Rd(e,r)}function Hd(e,t,r,a,n,i,s,f){return t.slice(-4)===".bin"?Ed(e,a,r,n,i,s,f):Lx(e,a,r,n,i,s,f)}function Xd(e,t,r,a,n,i,s,f){return t.slice(-4)===".bin"?Ad(e,a,r,n,i,s,f):Sd(e,a,r,n,i,s,f)}function Vd(e,t,r,a,n,i,s,f){return t.slice(-4)===".bin"?r1(e,a,r,n,i,s,f):t1(e,a,r,n,i,s,f)}function $d(e,t,r,a,n,i,s,f){return t.slice(-4)===".bin"?Qh(e,a,r,n,i,s,f):e1(e,a,r,n,i,s,f)}function Gd(e,t,r,a){return t.slice(-4)===".bin"?kh(e,r,a):mh(e,r,a)}function zd(e,t,r){return t.slice(-4)===".bin"?Pu(e,r):Ru(e,r)}function Kd(e,t,r){return t.slice(-4)===".bin"?Zh(e,r):Gh(e,r)}function Yd(e,t,r){return t.slice(-4)===".bin"?Hh(e,t,r):Uh(e,t,r)}function jd(e,t,r,a){return r.slice(-4)===".bin"?Xh(e,t,r,a):void 0}function Zd(e,t,r){return t.slice(-4)===".bin"?Bh(e,t,r):Mh(e,t,r)}var $s=/\b((?:\w+:)?[\w]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,Gs=/\b((?:\w+:)?[\w]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function $r(e,t){var r=e.split(/\s+/),a=[];if(t||(a[0]=r[0]),r.length===1)return a;var n=e.match($s),i,s,f,c;if(n)for(c=0;c!=n.length;++c)i=n[c].match(Gs),(s=i[1].indexOf(":"))===-1?a[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?f="xmlns"+i[1].slice(6):f=i[1].slice(s+1),a[f]=i[2].slice(1,i[2].length-1));return a}function Jd(e){var t=e.split(/\s+/),r={};if(t.length===1)return r;var a=e.match($s),n,i,s,f;if(a)for(f=0;f!=a.length;++f)n=a[f].match(Gs),(i=n[1].indexOf(":"))===-1?r[n[1]]=n[2].slice(1,n[2].length-1):(n[1].slice(0,6)==="xmlns:"?s="xmlns"+n[1].slice(6):s=n[1].slice(i+1),r[s]=n[2].slice(1,n[2].length-1));return r}var ha;function qd(e,t,r){var a=ha[e]||Ne(e);return a==="General"?It(t):Pr(a,t,{date1904:!!r})}function Qd(e,t,r,a){var n=a;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":n=Ue(a);break;case"i2":case"int":n=parseInt(a,10);break;case"r4":case"float":n=parseFloat(a);break;case"date":case"dateTime.tz":n=gr(a);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[Ne(t)]=n}function e2(e,t,r,a){if(e.t!=="z"){if(!r||r.cellText!==!1)try{e.t==="e"?e.w=e.w||et[e.v]:t==="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=ma(e.v):e.w=It(e.v):e.w=qd(t||"General",e.v,a)}catch(s){if(r.WTF)throw s}try{var n=ha[t]||t||"General";if(r.cellNF&&(e.z=n),r.cellDates&&e.t=="n"&&Qr(n)){var i=at(e.v+(a?1462:0));i&&(e.t="d",e.v=new Date(Date.UTC(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u)))}}catch(s){if(r.WTF)throw s}}}function r2(e,t,r){if(r.cellStyles&&t.Interior){var a=t.Interior;a.Pattern&&(a.patternType=oh[a.Pattern]||a.Pattern)}e[t.ID]=t}function t2(e,t,r,a,n,i,s,f,c,o,l){var v="General",x=a.StyleID,u={};o=o||{};var m=[],p=0;for(x===void 0&&f&&(x=f.StyleID),x===void 0&&s&&(x=s.StyleID);i[x]!==void 0;){var h=i[x];if(h.nf&&(v=h.nf),h.Interior&&m.push(h.Interior),!h.Parent)break;x=h.Parent}switch(r.Type){case"Boolean":a.t="b",a.v=Ue(e);break;case"String":a.t="s",a.r=U0(Ne(e)),a.v=e.indexOf("<")>-1?Ne(t||e).replace(/<[^<>]*>/g,""):a.r;break;case"DateTime":e.slice(-1)!="Z"&&(e+="Z"),a.v=or(gr(e,l),l),a.v!==a.v&&(a.v=Ne(e)),(!v||v=="General")&&(v="yyyy-mm-dd");case"Number":a.v===void 0&&(a.v=+e),a.t||(a.t="n");break;case"Error":a.t="e",a.v=Sr[e],o.cellText!==!1&&(a.w=e);break;default:e==""&&t==""?a.t="z":(a.t="s",a.v=U0(t||e));break}if(e2(a,v,o,l),o.cellFormula!==!1)if(a.Formula){var d=Ne(a.Formula);d.charCodeAt(0)==61&&(d=d.slice(1)),a.f=bt(d,n),delete a.Formula,a.ArrayRange=="RC"?a.F=bt("RC:RC",n):a.ArrayRange&&(a.F=bt(a.ArrayRange,n),c.push([lr(a.F),a.F]))}else for(p=0;p=c[p][0].s.r&&n.r<=c[p][0].e.r&&n.c>=c[p][0].s.c&&n.c<=c[p][0].e.c&&(a.F=c[p][1]);o.cellStyles&&(m.forEach(function(E){!u.patternType&&E.patternType&&(u.patternType=E.patternType)}),a.s=u),a.StyleID!==void 0&&(a.ixfe=a.StyleID)}function a2(e){return os.indexOf("_xlnm."+e)>-1?"_xlnm."+e:e}function n2(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,` -`).replace(/\r/g,` -`),e.v=e.w=e.ixfe=void 0}function In(e,t){var r=t||{};Pi();var a=ra(tn(e));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(typeof Oe<"u"?a=Oe.utils.decode(65001,Rn(a)):a=Xe(a));var n=a.slice(0,1024).toLowerCase(),i=!1;if(n=n.replace(/".*?"/g,""),(n.indexOf(">")&1023)>Math.min(n.indexOf(",")&1023,n.indexOf(";")&1023)){var s=rr(r);return s.type="string",pa.to_workbook(a,s)}if(n.indexOf("=0&&(i=!0)}),i)return l2(a,r);ha={"General Number":"General","General Date":Se[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":Se[15],"Short Date":Se[14],"Long Time":Se[19],"Medium Time":Se[18],"Short Time":Se[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:Se[2],Standard:Se[4],Percent:Se[10],Scientific:Se[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var f,c=[],o;ar!=null&&r.dense==null&&(r.dense=ar);var l={},v=[],x={},u="";r.dense&&(x["!data"]=[]);var m={},p={},h=$r(''),d=0,E=0,g=0,b={s:{r:2e6,c:2e6},e:{r:0,c:0}},R={},G={},P="",N=0,D=[],B={},U={},M=0,z=[],oe=[],q={},pe=[],J,xe=!1,ge=[],ae=[],Ee={},Z=0,ve=0,ue={Sheets:[],WBProps:{date1904:!1}},Ce={};er.lastIndex=0,a=ka(a,"\x3C!--","-->");for(var de="";f=er.exec(a);)switch(f[3]=(de=f[3]).toLowerCase()){case"data":if(de=="data"){if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else f[0].charAt(f[0].length-2)!=="/"&&c.push([f[3],!0]);break}if(c[c.length-1][1])break;f[1]==="/"?t2(a.slice(d,f.index),P,h,c[c.length-1][0]=="comment"?q:m,{c:E,r:g},R,pe[E],p,ge,r,ue.WBProps.date1904):(P="",h=$r(f[0]),d=f.index+f[0].length);break;case"cell":if(f[1]==="/")if(oe.length>0&&(m.c=oe),(!r.sheetRows||r.sheetRows>g)&&m.v!==void 0&&(r.dense?(x["!data"][g]||(x["!data"][g]=[]),x["!data"][g][E]=m):x[Ve(E)+ze(g)]=m),m.HRef&&(m.l={Target:Ne(m.HRef)},m.HRefScreenTip&&(m.l.Tooltip=m.HRefScreenTip),delete m.HRef,delete m.HRefScreenTip),(m.MergeAcross||m.MergeDown)&&(Z=E+(parseInt(m.MergeAcross,10)|0),ve=g+(parseInt(m.MergeDown,10)|0),(Z>E||ve>g)&&D.push({s:{c:E,r:g},e:{c:Z,r:ve}})),!r.sheetStubs)m.MergeAcross?E=Z+1:++E;else if(m.MergeAcross||m.MergeDown){for(var _e=E;_e<=Z;++_e)for(var A=g;A<=ve;++A)(_e>E||A>g)&&(r.dense?(x["!data"][A]||(x["!data"][A]=[]),x["!data"][A][_e]={t:"z"}):x[Ve(_e)+ze(A)]={t:"z"});E=Z+1}else++E;else m=Jd(f[0]),m.Index&&(E=+m.Index-1),Eb.e.c&&(b.e.c=E),f[0].slice(-2)==="/>"&&++E,oe=[];break;case"row":f[1]==="/"||f[0].slice(-2)==="/>"?(gb.e.r&&(b.e.r=g),f[0].slice(-2)==="/>"&&(p=$r(f[0]),p.Index&&(g=+p.Index-1)),E=0,++g):(p=$r(f[0]),p.Index&&(g=+p.Index-1),Ee={},(p.AutoFitHeight=="0"||p.Height)&&(Ee.hpx=parseInt(p.Height,10),Ee.hpt=bs(Ee.hpx),ae[g]=Ee),p.Hidden=="1"&&(Ee.hidden=!0,ae[g]=Ee));break;case"worksheet":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"));v.push(u),b.s.r<=b.e.r&&b.s.c<=b.e.c&&(x["!ref"]=We(b),r.sheetRows&&r.sheetRows<=b.e.r&&(x["!fullref"]=x["!ref"],b.e.r=r.sheetRows-1,x["!ref"]=We(b))),D.length&&(x["!merges"]=D),pe.length>0&&(x["!cols"]=pe),ae.length>0&&(x["!rows"]=ae),l[u]=x}else b={s:{r:2e6,c:2e6},e:{r:0,c:0}},g=E=0,c.push([f[3],!1]),o=$r(f[0]),u=Ne(o.Name),x={},r.dense&&(x["!data"]=[]),D=[],ge=[],ae=[],Ce={name:u,Hidden:0},ue.Sheets.push(Ce);break;case"table":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else{if(f[0].slice(-2)=="/>")break;c.push([f[3],!1]),pe=[],xe=!1}break;case"style":f[1]==="/"?r2(R,G,r):G=$r(f[0]);break;case"numberformat":G.nf=Ne($r(f[0]).Format||"General"),ha[G.nf]&&(G.nf=ha[G.nf]);for(var L=0;L!=392&&Se[L]!=G.nf;++L);if(L==392){for(L=57;L!=392;++L)if(Se[L]==null){Ft(G.nf,L);break}}break;case"column":if(c[c.length-1][0]!=="table"||f[1]==="/")break;if(J=$r(f[0]),J.Hidden&&(J.hidden=!0,delete J.Hidden),J.Width&&(J.wpx=parseInt(J.Width,10)),!xe&&J.wpx>10){xe=!0,Tr=As;for(var O=0;O0&&(k.Sheet=ue.Sheets.length-1),ue.Names.push(k);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(f[0].slice(-2)==="/>")break;f[1]==="/"?P+=a.slice(N,f.index):N=f.index+f[0].length;break;case"interior":if(!r.cellStyles)break;G.Interior=$r(f[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(f[0].slice(-2)==="/>")break;f[1]==="/"?zo(B,de,a.slice(M,f.index)):M=f.index+f[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else c.push([f[3],!1]);break;case"comment":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"));n2(q),oe.push(q)}else c.push([f[3],!1]),o=$r(f[0]),Ue(o.ShowAlways||"0")||(oe.hidden=!0),q={a:o.Author};break;case"autofilter":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else if(f[0].charAt(f[0].length-2)!=="/"){var te=$r(f[0]);x["!autofilter"]={ref:bt(te.Range).replace(/\$/g,"")},c.push([f[3],!0])}break;case"name":break;case"datavalidation":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else f[0].charAt(f[0].length-2)!=="/"&&c.push([f[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(f[1]==="/"){if((o=c.pop())[0]!==f[3])throw new Error("Bad state: "+o.join("|"))}else f[0].charAt(f[0].length-2)!=="/"&&c.push([f[3],!0]);break;case"null":break;default:if(c.length==0&&f[3]=="document"||c.length==0&&f[3]=="uof")return Ti(a,r);var j=!0;switch(c[c.length-1][0]){case"officedocumentsettings":switch(f[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:j=!1}break;case"componentoptions":switch(f[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:j=!1}break;case"excelworkbook":switch(f[3]){case"date1904":ue.WBProps.date1904=!0;break;case"hidehorizontalscrollbar":break;case"hideverticalscrollbar":break;case"hideworkbooktabs":break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:j=!1}break;case"workbookoptions":switch(f[3]){case"owcversion":break;case"height":break;case"width":break;default:j=!1}break;case"worksheetoptions":switch(f[3]){case"visible":if(f[0].slice(-2)!=="/>")if(f[1]==="/")switch(a.slice(M,f.index)){case"SheetHidden":Ce.Hidden=1;break;case"SheetVeryHidden":Ce.Hidden=2;break}else M=f.index+f[0].length;break;case"header":x["!margins"]||ua(x["!margins"]={},"xlml"),isNaN(+he(f[0]).Margin)||(x["!margins"].header=+he(f[0]).Margin);break;case"footer":x["!margins"]||ua(x["!margins"]={},"xlml"),isNaN(+he(f[0]).Margin)||(x["!margins"].footer=+he(f[0]).Margin);break;case"pagemargins":var K=he(f[0]);x["!margins"]||ua(x["!margins"]={},"xlml"),isNaN(+K.Top)||(x["!margins"].top=+K.Top),isNaN(+K.Left)||(x["!margins"].left=+K.Left),isNaN(+K.Right)||(x["!margins"].right=+K.Right),isNaN(+K.Bottom)||(x["!margins"].bottom=+K.Bottom);break;case"displayrighttoleft":ue.Views||(ue.Views=[]),ue.Views[0]||(ue.Views[0]={}),ue.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":x["!outline"]||(x["!outline"]={}),x["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":x["!outline"]||(x["!outline"]={}),x["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:j=!1}break;case"pivottable":case"pivotcache":switch(f[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:j=!1}break;case"pagebreaks":switch(f[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:j=!1}break;case"autofilter":switch(f[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:j=!1}break;case"querytable":switch(f[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:j=!1}break;case"datavalidation":switch(f[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:j=!1}break;case"sorting":case"conditionalformatting":switch(f[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:j=!1}break;case"mapinfo":case"schema":case"data":switch(f[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:j=!1}break;case"smarttags":break;default:j=!1;break}if(j||f[3].match(/!\[CDATA/))break;if(!c[c.length-1][1])throw"Unrecognized tag: "+f[3]+"|"+c.join("|");if(c[c.length-1][0]==="customdocumentproperties"){if(f[0].slice(-2)==="/>")break;f[1]==="/"?Qd(U,de,z,a.slice(M,f.index)):(z=f,M=f.index+f[0].length);break}if(r.WTF)throw"Unrecognized tag: "+f[3]+"|"+c.join("|")}var fe={};return!r.bookSheets&&!r.bookProps&&(fe.Sheets=l),fe.SheetNames=v,fe.Workbook=ue,fe.SSF=rr(Se),fe.Props=B,fe.Custprops=U,fe.bookType="xlml",fe}function Wn(e,t){switch(h0(t=t||{}),t.type||"base64"){case"base64":return In(Lr(e),t);case"binary":case"buffer":case"file":return In(e,t);case"array":return In(ct(e),t)}}function i2(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=So(r),r.length-r.l<=4)return t;var a=r.read_shift(4);if(a==0||a>40||(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(a=r.read_shift(4),a!==1907505652)||(t.UnicodeClipboardFormat=Fo(r),a=r.read_shift(4),a==0||a>40))return t;r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr")}var s2=[60,1084,2066,2165,2175];function f2(e,t,r,a,n){var i=a,s=[],f=r.slice(r.l,r.l+i);if(n&&n.enc&&n.enc.insitu&&f.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:n.enc.insitu(f)}s.push(f),r.l+=i;for(var c=it(r,r.l),o=Hn[c],l=0;o!=null&&s2.indexOf(c)>-1;)i=it(r,r.l+2),l=r.l+4,c==2066?l+=4:(c==2165||c==2175)&&(l+=12),f=r.slice(l,r.l+4+i),s.push(f),r.l+=4+i,o=Hn[c=it(r,r.l)];var v=dt(s);tr(v,0);var x=0;v.lens=[];for(var u=0;u1)&&!(He.sheetRows&&ye.r>=He.sheetRows)){if(He.cellStyles&&ke.XF&&ke.XF.data&&U(ke,He),delete ke.ixfe,delete ke.XF,v=ye,x=Me(ye),(!s||!s.s||!s.e)&&(s={s:{r:0,c:0},e:{r:0,c:0}}),ye.rs.e.r&&(s.e.r=ye.r+1),ye.c+1>s.e.c&&(s.e.c=ye.c+1),He.cellFormula&&ke.f){for(var Ge=0;Geye.c||E[Ge][0].s.r>ye.r)&&!(E[Ge][0].e.c>8)!==L)throw new Error("rt mismatch: "+I+"!="+L);w.r==12&&(e.l+=10,O-=10)}var k={};if(L===10?k=w.f(e,O,z):k=f2(L,w,e,O,z),Z==0&&[9,521,1033,2057].indexOf(Ee)===-1)continue;switch(L){case 34:r.opts.Date1904=P.WBProps.date1904=k;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(z.enc||(e.l=0),z.enc=k,!t.password)throw new Error("File is password-protected");if(k.valid==null)throw new Error("Encryption scheme unsupported");if(!k.valid)throw new Error("Password is incorrect");break;case 92:z.lastuser=k;break;case 66:var te=Number(k);switch(te){case 21010:te=1200;break;case 32768:te=1e4;break;case 32769:te=1252;break}Gr(z.codepage=te),_e=!0;break;case 317:z.rrtabid=k;break;case 25:z.winlocked=k;break;case 439:r.opts.RefreshAll=k;break;case 12:r.opts.CalcCount=k;break;case 16:r.opts.CalcDelta=k;break;case 17:r.opts.CalcIter=k;break;case 13:r.opts.CalcMode=k;break;case 14:r.opts.CalcPrecision=k;break;case 95:r.opts.CalcSaveRecalc=k;break;case 15:z.CalcRefMode=k;break;case 2211:r.opts.FullCalc=k;break;case 129:k.fDialog&&(n["!type"]="dialog"),k.fBelow||((n["!outline"]||(n["!outline"]={})).above=!0),k.fRight||((n["!outline"]||(n["!outline"]={})).left=!0);break;case 67:case 579:case 1091:case 224:R.push(k);break;case 430:ae.push([k]),ae[ae.length-1].XTI=[];break;case 35:case 547:ae[ae.length-1].push(k);break;case 24:case 536:de={Name:k.Name,Ref:dr(k.rgce,s,null,ae,z)},k.itab>0&&(de.Sheet=k.itab-1),ae.names.push(de),ae[0]||(ae[0]=[],ae[0].XTI=[]),ae[ae.length-1].push(k),k.Name=="_xlnm._FilterDatabase"&&k.itab>0&&k.rgce&&k.rgce[0]&&k.rgce[0][0]&&k.rgce[0][0][0]=="PtgArea3d"&&(Ce[k.itab-1]={ref:We(k.rgce[0][0][1][2])});break;case 22:z.ExternCount=k;break;case 23:ae.length==0&&(ae[0]=[],ae[0].XTI=[]),ae[ae.length-1].XTI=ae[ae.length-1].XTI.concat(k),ae.XTI=ae.XTI.concat(k);break;case 2196:if(z.biff<8)break;de!=null&&(de.Comment=k[1]);break;case 18:n["!protect"]=k;break;case 19:k!==0&&z.WTF&&console.error("Password verifier: "+k);break;case 133:i[z.biff==4?z.snames.length:k.pos]=k,z.snames.push(k.name);break;case 10:{if(--Z?!D:D)break;if(s.e){if(s.e.r>0&&s.e.c>0){if(s.e.r--,s.e.c--,n["!ref"]=We(s),t.sheetRows&&t.sheetRows<=s.e.r){var j=s.e.r;s.e.r=t.sheetRows-1,n["!fullref"]=n["!ref"],n["!ref"]=We(s),s.e.r=j}s.e.r++,s.e.c++}q.length>0&&(n["!merges"]=q),pe.length>0&&(n["!objects"]=pe),J.length>0&&(n["!cols"]=J),xe.length>0&&(n["!rows"]=xe),P.Sheets.push(N)}o===""?l=n:a[o]=n,n={},t.dense&&(n["!data"]=[])}break;case 9:case 521:case 1033:case 2057:{if(z.biff===8&&(z.biff={9:2,521:3,1033:4}[L]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[k.BIFFVer]||8),z.biffguess=k.BIFFVer==0,k.BIFFVer==0&&k.dt==4096&&(z.biff=5,_e=!0,Gr(z.codepage=28591)),z.biff==4&&k.dt&256&&(D=!0),z.biff==8&&k.BIFFVer==0&&k.dt==16&&(z.biff=2),Z++&&!D)break;if(n={},t.dense&&(n["!data"]=[]),z.biff<8&&!_e&&(_e=!0,Gr(z.codepage=t.codepage||1252)),z.biff==4&&D)o=(i[z.snames.indexOf(o)+1]||{name:""}).name;else if(z.biff<5||k.BIFFVer==0&&k.dt==4096){o===""&&(o="Sheet1"),s={s:{r:0,c:0},e:{r:0,c:0}};var K={pos:e.l-O,name:o};i[K.pos]=K,z.snames.push(o)}else o=(i[A]||{name:""}).name;k.dt==32&&(n["!type"]="chart"),k.dt==64&&(n["!type"]="macro"),q=[],pe=[],z.arrayf=E=[],J=[],xe=[],ge=!1,N={Hidden:(i[A]||{hs:0}).hs,name:o}}break;case 515:case 3:case 2:n["!type"]=="chart"&&(t.dense?(n["!data"][k.r]||[])[k.c]:n[Ve(k.c)+ze(k.r)])&&++k.c,g={ixfe:k.ixfe,XF:R[k.ixfe]||{},v:k.val,t:"n"},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t);break;case 5:case 517:g={ixfe:k.ixfe,XF:R[k.ixfe],v:k.val,t:k.t},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t);break;case 638:g={ixfe:k.ixfe,XF:R[k.ixfe],v:k.rknum,t:"n"},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t);break;case 189:for(var fe=k.c;fe<=k.C;++fe){var we=k.rkrec[fe-k.c][0];g={ixfe:we,XF:R[we],v:k.rkrec[fe-k.c][1],t:"n"},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:fe,r:k.r},g,t)}break;case 6:case 518:case 1030:{if(k.val=="String"){f=k;break}if(g=Xa(k.val,k.cell.ixfe,k.tt),g.XF=R[g.ixfe],t.cellFormula){var ce=k.formula;if(ce&&ce[0]&&ce[0][0]&&ce[0][0][0]=="PtgExp"){var be=ce[0][0][1][0],le=ce[0][0][1][1],Te=Me({r:be,c:le});d[Te]?g.f=""+dr(k.formula,s,k.cell,ae,z):g.F=((t.dense?(n["!data"][be]||[])[le]:n[Te])||{}).F}else g.f=""+dr(k.formula,s,k.cell,ae,z)}ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M(k.cell,g,t),f=k}break;case 7:case 519:if(f)f.val=k,g=Xa(k,f.cell.ixfe,"s"),g.XF=R[g.ixfe],t.cellFormula&&(g.f=""+dr(f.formula,s,f.cell,ae,z)),ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M(f.cell,g,t),f=null;else throw new Error("String record expects Formula");break;case 33:case 545:{E.push(k);var Re=Me(k[0].s);if(u=t.dense?(n["!data"][k[0].s.r]||[])[k[0].s.c]:n[Re],t.cellFormula&&u){if(!f||!Re||!u)break;u.f=""+dr(k[1],s,k[0],ae,z),u.F=We(k[0])}}break;case 1212:{if(!t.cellFormula)break;if(x){if(!f)break;d[Me(f.cell)]=k[0],u=t.dense?(n["!data"][f.cell.r]||[])[f.cell.c]:n[Me(f.cell)],(u||{}).f=""+dr(k[0],s,v,ae,z)}}break;case 253:g=Xa(c[k.isst].t,k.ixfe,"s"),c[k.isst].h&&(g.h=c[k.isst].h),g.XF=R[g.ixfe],ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t);break;case 513:t.sheetStubs&&(g={ixfe:k.ixfe,XF:R[k.ixfe],t:"z"},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t));break;case 190:if(t.sheetStubs)for(var re=k.c;re<=k.C;++re){var ie=k.ixfe[re-k.c];g={ixfe:ie,XF:R[ie],t:"z"},ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:re,r:k.r},g,t)}break;case 214:case 516:case 4:g=Xa(k.val,k.ixfe,"s"),g.XF=R[g.ixfe],ve>0&&(g.z=g.XF&&g.XF.numFmtId&&ue[g.XF.numFmtId]||ue[g.ixfe>>8&63]),Zr(g,t,r.opts.Date1904),M({c:k.c,r:k.r},g,t);break;case 0:case 512:Z===1&&(s=k);break;case 252:c=k;break;case 1054:if(z.biff>=3&&z.biff<=4){ue[ve++]=k[1];for(var Br=0;Br=163&&Ft(k[1],ve+163)}else Ft(k[1],k[0]);break;case 30:{ue[ve++]=k;for(var hr=0;hr=163&&Ft(k,ve+163)}break;case 229:q=q.concat(k);break;case 93:pe[k.cmo[0]]=z.lastobj=k;break;case 438:z.lastobj.TxO=k;break;case 127:z.lastobj.ImData=k;break;case 440:for(h=k[0].s.r;h<=k[0].e.r;++h)for(p=k[0].s.c;p<=k[0].e.c;++p)u=t.dense?(n["!data"][h]||[])[p]:n[Me({c:p,r:h})],u&&(u.l=k[1]);break;case 2048:for(h=k[0].s.r;h<=k[0].e.r;++h)for(p=k[0].s.c;p<=k[0].e.c;++p)u=t.dense?(n["!data"][h]||[])[p]:n[Me({c:p,r:h})],u&&u.l&&(u.l.Tooltip=k[1]);break;case 28:{if(u=t.dense?(n["!data"][k[0].r]||[])[k[0].c]:n[Me(k[0])],u||(t.dense?(n["!data"][k[0].r]||(n["!data"][k[0].r]=[]),u=n["!data"][k[0].r][k[0].c]={t:"z"}):u=n[Me(k[0])]={t:"z"},s.e.r=Math.max(s.e.r,k[0].r),s.s.r=Math.min(s.s.r,k[0].r),s.e.c=Math.max(s.e.c,k[0].c),s.s.c=Math.min(s.s.c,k[0].c)),u.c||(u.c=[]),z.biff<=5&&z.biff>=2)m={a:"SheetJ5",t:k[1]};else{var Ze=pe[k[2]];m={a:k[1],t:Ze.TxO.t},k[3]!=null&&!(k[3]&2)&&(u.c.hidden=!0)}u.c.push(m)}break;case 2173:Nh(R[k.ixfe],k.ext);break;case 125:{if(!z.cellStyles)break;for(;k.e>=k.s;)J[k.e--]={width:k.w/256,level:k.level||0,hidden:!!(k.flags&1)},ge||(ge=!0,c0(k.w/256)),Yt(J[k.e+1])}break;case 520:{var kr={};k.level!=null&&(xe[k.r]=kr,kr.level=k.level),k.hidden&&(xe[k.r]=kr,kr.hidden=!0),k.hpt&&(xe[k.r]=kr,kr.hpt=k.hpt,kr.hpx=_a(k.hpt))}break;case 38:case 39:case 40:case 41:n["!margins"]||ua(n["!margins"]={}),n["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[L]]=k;break;case 161:n["!margins"]||ua(n["!margins"]={}),n["!margins"].header=k.header,n["!margins"].footer=k.footer;break;case 574:k.RTL&&(P.Views[0].RTL=!0);break;case 146:G=k;break;case 2198:oe=k;break;case 140:b=k;break;case 442:o?N.CodeName=k||N.name:P.WBProps.CodeName=k||"ThisWorkbook";break}}else w||console.error("Missing Info for XLS Record 0x"+L.toString(16)),e.l+=O}return r.SheetNames=qr(i).sort(function(Dr,ye){return Number(Dr)-Number(ye)}).map(function(Dr){return i[Dr].name}),t.bookSheets||(r.Sheets=a),!r.SheetNames.length&&l["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=l)):r.Preamble=l,r.Sheets&&Ce.forEach(function(Dr,ye){r.Sheets[r.SheetNames[ye]]["!autofilter"]=Dr}),r.Strings=c,r.SSF=rr(Se),z.enc&&(r.Encryption=z.enc),oe&&(r.Themes=oe),r.Metadata={},b!==void 0&&(r.Metadata.Country=b),ae.names.length>0&&(P.Names=ae.names),r.Workbook=P,r}var wi={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function o2(e,t,r){var a=Pe.find(e,"/!DocumentSummaryInformation");if(a&&a.size>0)try{var n=ti(a,Oo,wi.DSI);for(var i in n)t[i]=n[i]}catch(o){if(r.WTF)throw o}var s=Pe.find(e,"/!SummaryInformation");if(s&&s.size>0)try{var f=ti(s,No,wi.SI);for(var c in f)t[c]==null&&(t[c]=f[c])}catch(o){if(r.WTF)throw o}t.HeadingPairs&&t.TitlesOfParts&&(us(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function zs(e,t){t||(t={}),h0(t),Si(),t.codepage&&$n(t.codepage);var r,a;if(e.FullPaths){if(Pe.find(e,"/encryption"))throw new Error("File is password-protected");r=Pe.find(e,"!CompObj"),a=Pe.find(e,"/Workbook")||Pe.find(e,"/Book")}else{switch(t.type){case"base64":e=Nr(Lr(e));break;case"binary":e=Nr(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e));break}tr(e,0),a={content:e}}var n,i;if(r&&i2(r),t.bookProps&&!t.bookSheets)n={};else{var s=Ie?"buffer":"array";if(a&&a.content)n=c2(a.content,t);else if((i=Pe.find(e,"PerfectOffice_MAIN"))&&i.content)n=oa.to_workbook(i.content,(t.type=s,t));else if((i=Pe.find(e,"NativeContent_MAIN"))&&i.content)n=oa.to_workbook(i.content,(t.type=s,t));else throw(i=Pe.find(e,"MN0"))&&i.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");t.bookVBA&&e.FullPaths&&Pe.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(n.vbaraw=qh(e))}var f={};return e.FullPaths&&o2(e,f,t),n.Props=n.Custprops=f,t.bookFiles&&(n.cfb=e),n}var en={0:{f:$x},1:{f:Yx},2:{f:ad},3:{f:qx},4:{f:Zx},5:{f:td},6:{f:sd},7:{f:ed},8:{f:ud},9:{f:ld},10:{f:cd},11:{f:od},12:{f:jx},13:{f:nd},14:{f:Qx},15:{f:Jx},16:{f:Hs},17:{f:fd},18:{f:rd},19:{f:n0},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:Md},40:{},42:{},43:{f:ph},44:{f:vh},45:{f:gh},46:{f:wh},47:{f:_h},48:{},49:{f:go},50:{},51:{f:Lh},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:Es},62:{f:id},63:{f:Wh},64:{f:wd},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:_r,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:_d},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:Kx},148:{f:Gx,p:16},151:{f:dd},152:{},153:{f:Pd},154:{},155:{},156:{f:Ld},157:{},158:{},159:{T:1,f:Lu},160:{T:-1},161:{T:1,f:Bt},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:hd},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:Rh},336:{T:-1},337:{f:Ph,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:Bn},357:{},358:{},359:{},360:{T:1},361:{},362:{f:ks},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:md},427:{f:vd},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:gd},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:zx},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:xd},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:Bn},551:{f:nn},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:jh},633:{T:1},634:{T:-1},635:{T:1,f:Yh},636:{T:-1},637:{f:wo},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:Fd},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:kd},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},Hn={6:{f:bn},10:{f:xt},12:{f:Ke},13:{f:Ke},14:{f:Ye},15:{f:Ye},16:{f:vr},17:{f:Ye},18:{f:Ye},19:{f:Ke},20:{f:ii},21:{f:ii},23:{f:ks},24:{f:fi},25:{f:Ye},26:{},27:{},28:{f:Zl},29:{},34:{f:Ye},35:{f:si},38:{f:vr},39:{f:vr},40:{f:vr},41:{f:vr},42:{f:Ye},43:{f:Ye},47:{f:eh},49:{f:bl},51:{f:Ke},60:{},61:{f:Fl},64:{f:Ye},65:{f:Cl},66:{f:Ke},77:{},80:{},81:{},82:{},85:{f:Ke},89:{},90:{},91:{},92:{f:gl},93:{f:ql},94:{},95:{f:Ye},96:{},97:{},99:{f:Ye},125:{f:Es},128:{f:Xl},129:{f:_l},130:{f:Ke},131:{f:Ye},132:{f:Ye},133:{f:wl},134:{},140:{f:nu},141:{f:Ke},144:{},146:{f:su},151:{},152:{},153:{},154:{},155:{},156:{f:Ke},157:{},158:{},160:{f:uu},161:{f:cu},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:Ll},190:{f:Pl},193:{f:xt},197:{},198:{},199:{},200:{},201:{},202:{f:Ye},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Ke},220:{},221:{f:Ye},222:{},224:{f:Ml},225:{f:pl},226:{f:xt},227:{},229:{f:Jl},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:kl},253:{f:Dl},255:{f:El},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:ds},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:Ye},353:{f:xt},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Gl},431:{f:Ye},432:{},433:{},434:{},437:{},438:{f:ru},439:{f:Ye},440:{f:tu},441:{},442:{f:Ta},443:{},444:{f:Ke},445:{},446:{},448:{f:xt},449:{f:Sl,r:2},450:{f:xt},512:{f:ni},513:{f:lu},515:{f:$l},516:{f:Il},517:{f:Vl},519:{f:hu},520:{f:Tl},523:{},545:{f:oi},549:{f:ai},566:{},574:{f:Al},638:{f:Rl},659:{},1048:{},1054:{f:Ol},1084:{},1212:{f:Kl},2048:{f:au},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Ma},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:xt},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:fu,r:12},2173:{f:Oh,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:Ye,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:zl,r:12},2197:{},2198:{f:Fh,r:12},2199:{},2200:{},2201:{},2202:{f:Yl,r:12},2203:{f:xt},2204:{},2205:{},2206:{},2207:{},2211:{f:yl},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Ke},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:ou},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:iu},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:ni},1:{},2:{f:vu},3:{f:mu},4:{f:du},5:{f:gu},7:{f:pu},8:{},9:{f:Ma},11:{},22:{f:Ke},30:{f:Nl},31:{},32:{},33:{f:oi},36:{},37:{f:ai},50:{f:_u},62:{},52:{},67:{f:Ul},68:{f:Ke},69:{},86:{},126:{},127:{f:xu},135:{},136:{},137:{},143:{f:ku},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:wu},223:{},234:{},354:{},421:{},518:{f:bn},521:{f:Ma},536:{f:fi},547:{f:si},561:{},579:{f:Wl},1030:{f:bn},1033:{f:Ma},1091:{f:Hl},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},101:{},102:{},105:{},106:{},107:{},109:{},112:{},114:{},29282:{}};function Or(e,t,r,a){var n=t;if(!isNaN(n)){var i=a||(r||[]).length||0,s=e.next(4);s.write_shift(2,n),s.write_shift(2,i),i>0&&ts(r)&&e.push(r)}}function ki(e,t){var r=t||{},a=r.dense!=null?r.dense:ar,n={};a&&(n["!data"]=[]),e=ka(e,"\x3C!--","-->");var i=e.match(/");var s=e.match(/<\/table/i),f=i.index,c=s&&s.index||e.length,o=Mc(e.slice(f,c),/(:?]*>)/i,""),l=-1,v=0,x=0,u=0,m={s:{r:1e7,c:1e7},e:{r:0,c:0}},p=[];for(f=0;f/i);for(c=0;c"))>-1;)b=b.slice(R+1);for(var G=0;G")));u=N.colspan?+N.colspan:1,((x=+N.rowspan)>1||u>1)&&p.push({s:{r:l,c:v},e:{r:l+(x||1)-1,c:v+u-1}});var D=N.t||N["data-t"]||"";if(!b.length){v+=u;continue}if(b=Jc(b),m.s.r>l&&(m.s.r=l),m.e.rv&&(m.s.c=v),m.e.c");if(r.length==1){var a=Lt(ki(r[0],t),t);return a.bookType="html",a}var n=Qs();return r.forEach(function(i,s){un(n,ki(i,t),"Sheet"+(s+1))}),n.bookType="html",n}function u2(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(//g," ").replace(//g,function(a,n){return Array(parseInt(n,10)+1).join(" ")}).replace(/]*\/>/g," ").replace(//g,` -`),r=Ne(t.replace(/<[^<>]*>/g,""));return[r]}function Ks(e,t,r){var a=r||{},n=tn(e);er.lastIndex=0,n=jn(ka(n,"\x3C!--","-->"));for(var i,s,f="",c="",o,l=0,v=-1,x=!1,u="";i=er.exec(n);)switch(i[3]=i[3].replace(/_[\s\S]*$/,"")){case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":case"text-style":i[1]==="/"?(x=!1,s["truncate-on-overflow"]=="false"&&(f.match(/h/)?f=f.replace(/h+/,"[$&]"):f.match(/m/)?f=f.replace(/m+/,"[$&]"):f.match(/s/)&&(f=f.replace(/s+/,"[$&]"))),a[s.name]=f,f=""):i[0].charAt(i[0].length-2)!=="/"&&(x=!0,f="",s=he(i[0],!1));break;case"boolean-style":i[1]==="/"?(x=!1,a[s.name]="General",f=""):i[0].charAt(i[0].length-2)!=="/"&&(x=!0,f="",s=he(i[0],!1));break;case"boolean":f+="General";break;case"text":i[1]==="/"?(u=n.slice(v,er.lastIndex-i[0].length),u=="%"&&s[0]=="=0"?f=a[o["apply-style-name"]]+";"+f:console.error("ODS number format may be incorrect: "+o.condition);break;case"number":if(i[1]==="/")break;o=he(i[0],!1),c="",c+=Le("0",+o["min-integer-digits"]||1),Ue(o.grouping)&&(c=nt(Le("#",Math.max(0,4-c.length))+c)),(+o["min-decimal-places"]||+o["decimal-places"])&&(c+="."),+o["min-decimal-places"]&&(c+=Le("0",+o["min-decimal-places"]||1)),+o["decimal-places"]-(+o["min-decimal-places"]||0)&&(c+=Le("0",+o["decimal-places"]-(+o["min-decimal-places"]||0))),f+=c;break;case"embedded-text":i[1]==="/"?l==0?f+='"'+n.slice(v,er.lastIndex-i[0].length).replace(/"/g,'""')+'"':f=f.slice(0,l)+'"'+n.slice(v,er.lastIndex-i[0].length).replace(/"/g,'""')+'"'+f.slice(l):i[0].charAt(i[0].length-2)!=="/"&&(v=er.lastIndex,l=-+he(i[0],!1).position||0);break}return a}function Ys(e,t,r){var a=t||{};ar!=null&&a.dense==null&&(a.dense=ar);var n=tn(e),i=[],s,f,c,o="",l=0,v,x,u={},m=[],p={};a.dense&&(p["!data"]=[]);var h,d,E={value:""},g={},b="",R=0,G,P="",N=0,D=[],B=[],U=-1,M=-1,z={s:{r:1e6,c:1e7},e:{r:0,c:0}},oe=0,q=r||{},pe={},J=[],xe={},ge=0,ae=0,Ee=[],Z=1,ve=1,ue=[],Ce={Names:[],WBProps:{}},de={},_e=["",""],A=[],L={},O="",w=0,I=!1,k=!1,te=0;for(er.lastIndex=0,n=jn(ka(n,"\x3C!--","-->"));h=er.exec(n);)switch(h[3]=h[3].replace(/_[\s\S]*$/,"")){case"table":case"\u5DE5\u4F5C\u8868":h[1]==="/"?(z.e.c>=z.s.c&&z.e.r>=z.s.r?p["!ref"]=We(z):p["!ref"]="A1:A1",a.sheetRows>0&&a.sheetRows<=z.e.r&&(p["!fullref"]=p["!ref"],z.e.r=a.sheetRows-1,p["!ref"]=We(z)),J.length&&(p["!merges"]=J),Ee.length&&(p["!rows"]=Ee),v.name=v.\u540D\u79F0||v.name,typeof JSON<"u"&&JSON.stringify(v),m.push(v.name),u[v.name]=p,k=!1):h[0].charAt(h[0].length-2)!=="/"&&(v=he(h[0],!1),U=M=-1,z.s.r=z.s.c=1e7,z.e.r=z.e.c=0,p={},a.dense&&(p["!data"]=[]),J=[],Ee=[],k=!0);break;case"table-row-group":h[1]==="/"?--oe:++oe;break;case"table-row":case"\u884C":if(h[1]==="/"){U+=Z,Z=1;break}if(x=he(h[0],!1),x.\u884C\u53F7?U=x.\u884C\u53F7-1:U==-1&&(U=0),Z=+x["number-rows-repeated"]||1,Z<10)for(te=0;te0&&(Ee[U+te]={level:oe});M=-1;break;case"covered-table-cell":if(h[1]!=="/")if(++M,E=he(h[0],!1),ve=parseInt(E["number-columns-repeated"]||"1",10)||1,a.sheetStubs){for(;ve-- >0;)a.dense?(p["!data"][U]||(p["!data"][U]=[]),p["!data"][U][M]={t:"z"}):p[Me({r:U,c:M})]={t:"z"},++M;--M}else M+=ve-1;b="",D=[];break;case"table-cell":case"\u6570\u636E":if(h[0].charAt(h[0].length-2)==="/")++M,E=he(h[0],!1),ve=parseInt(E["number-columns-repeated"]||"1",10)||1,d={t:"z",v:null},E.formula&&a.cellFormula!=!1&&(d.f=pi(Ne(E.formula))),E["style-name"]&&pe[E["style-name"]]&&(d.z=pe[E["style-name"]]),(E.\u6570\u636E\u7C7B\u578B||E["value-type"])=="string"&&(d.t="s",d.v=Ne(E["string-value"]||""),a.dense?(p["!data"][U]||(p["!data"][U]=[]),p["!data"][U][M]=d):p[Ve(M)+ze(U)]=d),M+=ve-1;else if(h[1]!=="/"){++M,b=P="",R=N=0,D=[],B=[],ve=1;var j=Z?U+Z-1:U;if(M>z.e.c&&(z.e.c=M),Mz.e.r&&(z.e.r=j),E=he(h[0],!1),g=Kc(h[0],!0),A=[],L={},d={t:E.\u6570\u636E\u7C7B\u578B||E["value-type"],v:null},E["style-name"]&&pe[E["style-name"]]&&(d.z=pe[E["style-name"]]),a.cellFormula)if(E.formula&&(E.formula=Ne(E.formula)),E["number-matrix-columns-spanned"]&&E["number-matrix-rows-spanned"]&&(ge=parseInt(E["number-matrix-rows-spanned"],10)||0,ae=parseInt(E["number-matrix-columns-spanned"],10)||0,xe={s:{r:U,c:M},e:{r:U+ge-1,c:M+ae-1}},d.F=We(xe),ue.push([xe,d.F])),E.formula)d.f=pi(E.formula);else for(te=0;te=ue[te][0].s.r&&U<=ue[te][0].e.r&&M>=ue[te][0].s.c&&M<=ue[te][0].e.c&&(d.F=ue[te][1]);switch((E["number-columns-spanned"]||E["number-rows-spanned"])&&(ge=parseInt(E["number-rows-spanned"]||"1",10)||1,ae=parseInt(E["number-columns-spanned"]||"1",10)||1,ge*ae>1&&(xe={s:{r:U,c:M},e:{r:U+ge-1,c:M+ae-1}},J.push(xe))),E["number-columns-repeated"]&&(ve=parseInt(E["number-columns-repeated"],10)),d.t){case"boolean":d.t="b",d.v=Ue(E["boolean-value"])||+E["boolean-value"]>=1;break;case"float":d.t="n",d.v=parseFloat(E.value),a.cellDates&&d.z&&Qr(d.z)&&(d.v=vt(d.v+(Ce.WBProps.date1904?1462:0)),d.t=typeof d.v=="number"?"n":"d");break;case"percentage":d.t="n",d.v=parseFloat(E.value);break;case"currency":d.t="n",d.v=parseFloat(E.value);break;case"date":d.t="d",d.v=gr(E["date-value"],Ce.WBProps.date1904),a.cellDates||(d.t="n",d.v=or(d.v,Ce.WBProps.date1904)),d.z||(d.z="m/d/yy");break;case"time":d.t="n",d.v=Cc(E["time-value"])/86400,a.cellDates&&(d.v=vt(d.v),d.t=typeof d.v=="number"?"n":"d"),d.z||(d.z="HH:MM:SS");break;case"number":d.t="n",d.v=parseFloat(E.\u6570\u636E\u6570\u503C);break;default:if(d.t==="string"||d.t==="text"||!d.t)d.t="s",E["string-value"]!=null&&(b=Ne(E["string-value"]),D=[]);else throw new Error("Unsupported value type "+d.t)}}else{if(I=!1,g["calcext:value-type"]=="error"&&Sr[b]!=null&&(d.t="e",d.w=b,d.v=Sr[b]),d.t==="s"&&(d.v=b||"",D.length&&(d.R=D),I=R==0),de.Target&&(d.l=de),A.length>0&&(d.c=A,A=[]),b&&a.cellText!==!1&&(d.w=b),I&&(d.t="z",delete d.v),(!I||a.sheetStubs)&&!(a.sheetRows&&a.sheetRows<=U))for(var K=0;K0;)p["!data"][U+K][M+ve]=rr(d);else for(p[Me({r:U+K,c:M})]=d;--ve>0;)p[Me({r:U+K,c:M+ve})]=rr(d);z.e.c<=M&&(z.e.c=M)}ve=parseInt(E["number-columns-repeated"]||"1",10),M+=ve-1,ve=0,d={},b="",D=[]}de={};break;case"document":case"document-content":case"\u7535\u5B50\u8868\u683C\u6587\u6863":case"spreadsheet":case"\u4E3B\u4F53":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(h[1]==="/"){if((s=i.pop())[0]!==h[3])throw"Bad state: "+s}else h[0].charAt(h[0].length-2)!=="/"&&i.push([h[3],!0]);break;case"annotation":if(h[1]==="/"){if((s=i.pop())[0]!==h[3])throw"Bad state: "+s;L.t=b,D.length&&(L.R=D),L.a=O,A.push(L),b=P,R=N,D=B}else if(h[0].charAt(h[0].length-2)!=="/"){i.push([h[3],!1]);var fe=he(h[0],!0);fe.display&&Ue(fe.display)||(A.hidden=!0),P=b,N=R,B=D,b="",R=0,D=[]}O="",w=0;break;case"creator":h[1]==="/"?O=n.slice(w,h.index):w=h.index+h[0].length;break;case"meta":case"\u5143\u6570\u636E":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(h[1]==="/"){if((s=i.pop())[0]!==h[3])throw"Bad state: "+s}else h[0].charAt(h[0].length-2)!=="/"&&i.push([h[3],!1]);b="",R=0,D=[];break;case"scientific-number":case"currency-symbol":case"fill-character":break;case"text-style":case"boolean-style":case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":if(h[1]==="/"){var we=er.lastIndex;Ks(n.slice(c,er.lastIndex),t,q),er.lastIndex=we}else h[0].charAt(h[0].length-2)!=="/"&&(c=er.lastIndex-h[0].length);break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":{var ce=he(h[0],!1);ce.family=="table-cell"&&q[ce["data-style-name"]]&&(pe[ce.name]=q[ce["data-style-name"]])}break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":break;case"boolean":break;case"text":if(h[0].slice(-2)==="/>")break;if(h[1]==="/")switch(i[i.length-1][0]){case"number-style":case"date-style":case"time-style":o+=n.slice(l,h.index);break}else l=h.index+h[0].length;break;case"named-range":f=he(h[0],!1),_e=Dn(f["cell-range-address"]);var be={Name:f.name,Ref:_e[0]+"!"+_e[1]};k&&(be.Sheet=m.length),Ce.Names.push(be);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"\u7535\u5B50\u8868\u683C":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":f=he(h[0],!1),f["date-value"]==="1904-01-01"&&(Ce.WBProps.date1904=!0);break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"\u6587\u672C\u4E32":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if(h[1]==="/"&&(!E||!E["string-value"])){var le=u2(n.slice(R,h.index),G);b=(b.length>0?b+` -`:"")+le[0]}else h[0].slice(-2)=="/>"?b+=` -`:(G=he(h[0],!1),R=h.index+h[0].length);break;case"s":break;case"database-range":if(h[1]==="/")break;try{_e=Dn(he(h[0])["target-range-address"]),u[_e[0]]["!autofilter"]={ref:_e[1]}}catch{}break;case"date":break;case"object":break;case"title":case"\u6807\u9898":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"filter-set-item":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(h[1]!=="/"){if(de=he(h[0],!1),!de.href)break;de.Target=Ne(de.href),delete de.href,de.Target.charAt(0)=="#"&&de.Target.indexOf(".")>-1?(_e=Dn(de.Target.slice(1)),de.Target="#"+_e[0]+"!"+_e[1]):de.Target.match(/^\.\.[\\\/]/)&&(de.Target=de.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(h[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"\u8868:":case"\u5B57:":break;default:if(a.WTF)throw new Error(h)}}var Te={Sheets:u,SheetNames:m,Workbook:Ce};return a.bookSheets&&delete Te.Sheets,Te}function Ei(e,t){t=t||{},Wr(e,"META-INF/manifest.xml")&&Wo(Qe(e,"META-INF/manifest.xml"),t);var r=yr(e,"styles.xml"),a=r&&Ks(Xe(r),t),n=yr(e,"content.xml");if(!n)throw new Error("Missing content.xml in ODS / UOF file");var i=Ys(Xe(n),t,a);return Wr(e,"meta.xml")&&(i.Props=ls(Qe(e,"meta.xml"))),i.bookType="ods",i}function Ti(e,t){var r=Ys(e,t);return r.bookType="fods",r}var cr=(function(){try{return typeof Uint8Array>"u"||typeof Uint8Array.prototype.subarray>"u"?"slice":typeof Buffer<"u"?typeof Buffer.prototype.subarray>"u"?"slice":(typeof Buffer.from=="function"?Buffer.from([72,62]):new Buffer([72,62]))instanceof Uint8Array?"subarray":"slice":"subarray"}catch{return"slice"}})();function wa(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Gt(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Xe(ct(e))}function js(e){for(var t=0,r=0;r>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>>24}function h2(e,t){for(var r=(e[t+15]&127)<<7|e[t+14]>>1,a=e[t+14]&1,n=t+13;n>=t;--n)a=a*256+e[n];return(e[t+15]&128?-a:a)*Math.pow(10,r-6176)}function rn(e,t){var r=t.l,a=e[r]&127;e:if(e[r++]>=128&&(a|=(e[r]&127)<<7,e[r++]<128||(a|=(e[r]&127)<<14,e[r++]<128)||(a|=(e[r]&127)<<21,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t.l=r,a}function Be(e){var t=0,r=e[t]&127;return e[t++]<128||(r|=(e[t]&127)<<7,e[t++]<128)||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128)||(r|=(e[t]&15)<<28),r}function De(e){for(var t=[],r={l:0};r.l=128;);s=e[cr](r.l,f),r.l=f}break;case 1:s=e[cr](f,f+8),r.l=f+8;break;case 2:{var c=rn(e,r);s=e[cr](r.l,r.l+c),r.l+=c}break;case 5:s=e[cr](f,f+4),r.l=f+4;break;default:throw new Error("PB Type ".concat(i," for Field ").concat(n," at offset ").concat(a))}var o={data:s,type:i};t[n]==null&&(t[n]=[]),t[n].push(o)}return t}function ln(e,t){return e?.map(function(r){return t(r.data)})||[]}function x2(e){for(var t,r=[],a={l:0};a.l>>0>0),r.push(s)}return r}function d2(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r={l:0},a=rn(t,r),n=[],i=r.l;i>2;if(f<60)++f;else{var c=f-59;f=t[i],c>1&&(f|=t[i+1]<<8),c>2&&(f|=t[i+2]<<16),c>3&&(f|=t[i+3]<<24),f>>>=0,f++,i+=c}n.push(t[cr](i,i+f)),i+=f;continue}else{var o=0,l=0;if(s==1?(l=(t[i]>>2&7)+4,o=(t[i++]&224)<<3,o|=t[i++]):(l=(t[i++]>>2)+1,s==2?(o=t[i]|t[i+1]<<8,i+=2):(o=(t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24)>>>0,i+=4)),o==0)throw new Error("Invalid offset 0");for(var v=n.length-1,x=o;v>=0&&x>=n[v].length;)x-=n[v].length,--v;if(v<0)if(x==0)x=n[v=0].length;else throw new Error("Invalid offset beyond length");if(l0&&(n.push(n[v][cr](n[v].length-x)),l-=x),++v;l>=n[v].length;)n.push(n[v]),l-=n[v].length,++v;l&&n.push(n[v][cr](0,l))}n.length>25&&(n=[js(n)])}}for(var u=0,m=0;m>8,v=l>=5?n:a;e:if(r&(l>4?8:4)&&e.t=="n"&&o==7){var x=(i=v[7])!=null&&i[0]?Be(v[7][0].data):-1;if(x==-1)break e;var u=(s=v[15])!=null&&s[0]?Be(v[15][0].data):-1,m=(f=v[16])!=null&&f[0]?Be(v[16][0].data):-1,p=(c=v[40])!=null&&c[0]?Be(v[40][0].data):-1,h=e.v,d=h;r:if(p){if(h==0){u=m=2;break r}h>=604800?u=1:h>=86400?u=2:h>=3600?u=4:h>=60?u=8:h>=1?u=16:u=32,Math.floor(h)!=h?m=32:h%60?m=16:h%3600?m=8:h%86400?m=4:h%604800&&(m=2),m=2&&(d=h/86400,m>2&&(d|=0,h-=86400*d),g.push('d"d"'),E.push(d+(x==2?" day"+(d==1?"":"s"):x==1?"d":""))),u<=4&&m>=4&&(d=h/3600,m>4&&(d|=0,h-=3600*d),g.push((u>=4?"[h]":"h")+'"h"'),E.push(d+(x==2?" hour"+(d==1?"":"s"):x==1?"h":""))),u<=8&&m>=8&&(d=h/60,m>8&&(d|=0,h-=60*d),g.push((u>=8?"[m]":"m")+'"m"'),x==0?E.push((u==8&&m==8||d>=10?"":"0")+d):E.push(d+(x==2?" minute"+(d==1?"":"s"):x==1?"m":""))),u<=16&&m>=16&&(d=h,m>16&&(d|=0,h-=d),g.push((u>=16?"[s]":"s")+'"s"'),x==0?E.push((m==16&&u==16||d>=10?"":"0")+d):E.push(d+(x==2?" second"+(d==1?"":"s"):x==1?"s":""))),m>=32&&(d=Math.round(1e3*h),u<32&&g.push('.000"ms"'),x==0?E.push((d>=100?"":d>=10?"0":"00")+d):E.push(d+(x==2?" millisecond"+(d==1?"":"s"):x==1?"ms":""))),e.w=E.join(x==0?":":" "),e.z=g.join(x==0?'":"':" "),x==0&&(e.w=e.w.replace(/:(\d\d\d)$/,".$1"))}}function p2(e,t,r,a){var n=wa(e),i=n.getUint32(4,!0),s=-1,f=-1,c=-1,o=NaN,l=0,v=new Date(Date.UTC(2001,0,1)),x=r>1?12:8;i&2&&(c=n.getUint32(x,!0),x+=4),x+=xa(i&(r>1?3468:396))*4,i&512&&(s=n.getUint32(x,!0),x+=4),x+=xa(i&(r>1?12288:4096))*4,i&16&&(f=n.getUint32(x,!0),x+=4),i&32&&(o=n.getFloat64(x,!0),x+=8),i&64&&(v.setTime(v.getTime()+(l=n.getFloat64(x,!0))*1e3),x+=8),r>1&&(i=n.getUint32(8,!0)>>>16,i&255&&(c==-1&&(c=n.getUint32(x,!0)),x+=4));var u,m=e[r>=4?1:2];switch(m){case 0:return;case 2:u={t:"n",v:o};break;case 3:u={t:"s",v:t.sst[f]};break;case 5:a?.cellDates?u={t:"d",v}:u={t:"n",v:l/86400+35430,z:Se[14]};break;case 6:u={t:"b",v:o>0};break;case 7:u={t:"n",v:o};break;case 8:u={t:"e",v:0};break;case 9:if(s>-1){var p=t.rsst[s];u={t:"s",v:p.v},p.l&&(u.l={Target:p.l})}else throw new Error("Unsupported cell type ".concat(e[cr](0,4)));break;default:throw new Error("Unsupported cell type ".concat(e[cr](0,4)))}return c>-1&&Zs(u,m|r<<8,i,t.ofmt[c],t.nfmt[c]),m==7&&(u.v/=86400),u}function g2(e,t,r){var a=wa(e),n=a.getUint32(4,!0),i=a.getUint32(8,!0),s=12,f=-1,c=-1,o=-1,l=NaN,v=NaN,x=0,u=new Date(Date.UTC(2001,0,1)),m=-1,p=-1;i&1&&(l=h2(e,s),s+=16),i&2&&(v=a.getFloat64(s,!0),s+=8),i&4&&(u.setTime(u.getTime()+(x=a.getFloat64(s,!0))*1e3),s+=8),i&8&&(c=a.getUint32(s,!0),s+=4),i&16&&(f=a.getUint32(s,!0),s+=4),s+=xa(i&480)*4,i&512&&(p=a.getUint32(s,!0),s+=4),s+=xa(i&1024)*4,i&2048&&(m=a.getUint32(s,!0),s+=4);var h,d=e[1];switch(d){case 0:h={t:"z"};break;case 2:h={t:"n",v:l};break;case 3:h={t:"s",v:t.sst[c]};break;case 5:r?.cellDates?h={t:"d",v:u}:h={t:"n",v:x/86400+35430,z:Se[14]};break;case 6:h={t:"b",v:v>0};break;case 7:h={t:"n",v};break;case 8:h={t:"e",v:0};break;case 9:if(f>-1){var E=t.rsst[f];h={t:"s",v:E.v},E.l&&(h.l={Target:E.l})}else throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(i&31," : ").concat(e[cr](0,4)));break;case 10:h={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(i&31," : ").concat(e[cr](0,4)))}if(s+=xa(i&4096)*4,i&516096&&(o==-1&&(o=a.getUint32(s,!0)),s+=4),i&524288){var g=a.getUint32(s,!0);s+=4,t.cmnt[g]&&(h.c=E2(t.cmnt[g]))}return o>-1&&Zs(h,d|1280,i>>13,t.ofmt[o],t.nfmt[o]),d==7&&(h.v/=86400),h}function _2(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:case 4:return p2(e,t,e[0],r);case 5:return g2(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function ir(e){var t=De(e);return Be(t[1][0].data)}function yt(e,t){var r=De(t.data),a=Be(r[1][0].data),n=r[3],i=[];return(n||[]).forEach(function(s){var f,c,o=De(s.data);if(o[1]){var l=Be(o[1][0].data)>>>0;switch(a){case 1:i[l]=Gt(o[3][0].data);break;case 8:{var v=e[ir(o[9][0].data)][0],x=De(v.data),u=e[ir(x[1][0].data)][0],m=Be(u.meta[1][0].data);if(m!=2001)throw new Error("2000 unexpected reference to ".concat(m));var p=De(u.data),h={v:p[3].map(function(g){return Gt(g.data)}).join("")};i[l]=h;e:if((f=p?.[11])!=null&&f[0]){var d=(c=De(p[11][0].data))==null?void 0:c[1];if(!d)break e;d.forEach(function(g){var b,R,G,P=De(g.data);if((b=P[2])!=null&&b[0]){var N=e[ir((R=P[2])==null?void 0:R[0].data)][0],D=Be(N.meta[1][0].data);switch(D){case 2032:var B=De(N.data);(G=B?.[2])!=null&&G[0]&&!h.l&&(h.l=Gt(B[2][0].data));break;case 2039:break;default:console.log("unrecognized ObjectAttribute type ".concat(D))}}})}}break;case 2:i[l]=De(o[6][0].data);break;case 3:i[l]=De(o[5][0].data);break;case 10:{var E=e[ir(o[10][0].data)][0];i[l]=Js(e,E.data)}break;default:throw a}}}),i}function w2(e,t){var r,a,n,i,s,f,c,o,l,v,x,u,m,p,h=De(e),d=Be(h[1][0].data)>>>0,E=Be(h[2][0].data)>>>0,g=((a=(r=h[8])==null?void 0:r[0])==null?void 0:a.data)&&Be(h[8][0].data)>0||!1,b,R;if((i=(n=h[7])==null?void 0:n[0])!=null&&i.data&&t!=0)b=(f=(s=h[7])==null?void 0:s[0])==null?void 0:f.data,R=(o=(c=h[6])==null?void 0:c[0])==null?void 0:o.data;else if((v=(l=h[4])==null?void 0:l[0])!=null&&v.data&&t!=1)b=(u=(x=h[4])==null?void 0:x[0])==null?void 0:u.data,R=(p=(m=h[3])==null?void 0:m[0])==null?void 0:p.data;else throw"NUMBERS Tile missing ".concat(t," cell storage");for(var G=g?4:1,P=wa(b),N=[],D=0;D=1&&(U[N[N.length-1][0]]=R[cr](N[N.length-1][1]*G)),{R:d,cells:U}}function k2(e,t){var r,a=De(t.data),n=-1;(r=a?.[7])!=null&&r[0]&&(Be(a[7][0].data)>>>0?n=1:n=0);var i=ln(a[5],function(s){return w2(s,n)});return{nrows:Be(a[4][0].data)>>>0,data:i.reduce(function(s,f){return s[f.R]||(s[f.R]=[]),f.cells.forEach(function(c,o){if(s[f.R][o])throw new Error("Duplicate cell r=".concat(f.R," c=").concat(o));s[f.R][o]=c}),s},[])}}function Js(e,t){var r,a,n,i,s,f,c,o,l,v,x={t:"",a:""},u=De(t);if((a=(r=u?.[1])==null?void 0:r[0])!=null&&a.data&&(x.t=Gt((i=(n=u?.[1])==null?void 0:n[0])==null?void 0:i.data)||""),(f=(s=u?.[3])==null?void 0:s[0])!=null&&f.data){var m=e[ir((o=(c=u?.[3])==null?void 0:c[0])==null?void 0:o.data)][0],p=De(m.data);(v=(l=p[1])==null?void 0:l[0])!=null&&v.data&&(x.a=Gt(p[1][0].data))}return u?.[4]&&(x.replies=[],u[4].forEach(function(h){var d=e[ir(h.data)][0];x.replies.push(Js(e,d.data))})),x}function E2(e){var t=[];return t.push({t:e.t||"",a:e.a,T:e.replies&&e.replies.length>0}),e.replies&&e.replies.forEach(function(r){t.push({t:r.t||"",a:r.a,T:!0})}),t}function T2(e,t,r,a){var n,i,s,f,c,o,l,v,x,u,m,p,h,d,E=De(t.data),g={s:{r:0,c:0},e:{r:0,c:0}};if(g.e.r=(Be(E[6][0].data)>>>0)-1,g.e.r<0)throw new Error("Invalid row varint ".concat(E[6][0].data));if(g.e.c=(Be(E[7][0].data)>>>0)-1,g.e.c<0)throw new Error("Invalid col varint ".concat(E[7][0].data));r["!ref"]=We(g);var b=r["!data"]!=null,R=r,G=De(E[4][0].data),P=v2();(n=G[4])!=null&&n[0]&&(P.sst=yt(e,e[ir(G[4][0].data)][0])),(i=G[6])!=null&&i[0]&&(P.fmla=yt(e,e[ir(G[6][0].data)][0])),(s=G[11])!=null&&s[0]&&(P.ofmt=yt(e,e[ir(G[11][0].data)][0])),(f=G[12])!=null&&f[0]&&(P.ferr=yt(e,e[ir(G[12][0].data)][0])),(c=G[17])!=null&&c[0]&&(P.rsst=yt(e,e[ir(G[17][0].data)][0])),(o=G[19])!=null&&o[0]&&(P.cmnt=yt(e,e[ir(G[19][0].data)][0])),(l=G[22])!=null&&l[0]&&(P.nfmt=yt(e,e[ir(G[22][0].data)][0]));var N=De(G[3][0].data),D=0;if(!((v=G[9])!=null&&v[0]))throw"NUMBERS file missing row tree";var B=De(G[9][0].data)[1].map(function(q){return De(q.data)});if(B.forEach(function(q){D=Be(q[1][0].data);var pe=Be(q[2][0].data),J=N[1][pe];if(!J)throw"NUMBERS missing tile "+pe;var xe=De(J.data),ge=e[ir(xe[2][0].data)][0],ae=Be(ge.meta[1][0].data);if(ae!=6002)throw new Error("6001 unexpected reference to ".concat(ae));var Ee=k2(e,ge);Ee.data.forEach(function(Z,ve){Z.forEach(function(ue,Ce){var de=_2(ue,P,a);de&&(b?(R["!data"][D+ve]||(R["!data"][D+ve]=[]),R["!data"][D+ve][Ce]=de):r[Ve(Ce)+ze(D+ve)]=de)})}),D+=Ee.nrows}),(x=G[13])!=null&&x[0]){var U=e[ir(G[13][0].data)][0],M=Be(U.meta[1][0].data);if(M!=6144)throw new Error("Expected merge type 6144, found ".concat(M));r["!merges"]=(u=De(U.data))==null?void 0:u[1].map(function(q){var pe=De(q.data),J=wa(De(pe[1][0].data)[1][0].data),xe=wa(De(pe[2][0].data)[1][0].data);return{s:{r:J.getUint16(0,!0),c:J.getUint16(2,!0)},e:{r:J.getUint16(0,!0)+xe.getUint16(0,!0)-1,c:J.getUint16(2,!0)+xe.getUint16(2,!0)-1}}})}if(!((m=r["!merges"])!=null&&m.length)&&((p=E[47])!=null&&p[0])){var z=De(E[47][0].data);if((h=z[2])!=null&&h[0]){var oe=De(z[2][0].data);(d=oe[3])!=null&&d[0]&&(r["!merges"]=ln(oe[3],function(q){var pe,J,xe,ge,ae,Ee=De(q),Z=De(Ee[2][0].data),ve=De(Z[1][0].data);if((pe=ve[1])!=null&&pe[0]){var ue=De(ve[1][0].data),Ce=Be(ue[1][0].data);if(Ce==67){var de=De(ue[40][0].data);if(!(!((J=de[3])!=null&&J[0])||!((xe=de[4])!=null&&xe[0]))){var _e=De(de[3][0].data),A=De(de[4][0].data),L=Be(_e[1][0].data),O=(ge=_e[2])!=null&&ge[0]?Be(_e[2][0].data):L,w=Be(A[1][0].data),I=(ae=A[2])!=null&&ae[0]?Be(A[2][0].data):w;return{s:{r:w,c:L},e:{r:I,c:O}}}}}}).filter(function(q){return q!=null}))}}}function y2(e,t,r){var a=De(t.data),n={"!ref":"A1"};r?.dense&&(n["!data"]=[]);var i=e[ir(a[2][0].data)],s=Be(i[0].meta[1][0].data);if(s!=6001)throw new Error("6000 unexpected reference to ".concat(s));return T2(e,i[0],n,r),n}function S2(e,t,r){var a,n=De(t.data),i={name:(a=n[1])!=null&&a[0]?Gt(n[1][0].data):"",sheets:[]},s=ln(n[2],ir);return s.forEach(function(f){e[f].forEach(function(c){var o=Be(c.meta[1][0].data);o==6e3&&i.sheets.push(y2(e,c,r))})}),i}function F2(e,t,r){var a,n=Qs();n.Workbook={WBProps:{date1904:!0}};var i=De(t.data);if((a=i[2])!=null&&a[0])throw new Error("Keynote presentations are not supported");var s=ln(i[1],ir);if(s.forEach(function(f){e[f].forEach(function(c){var o=Be(c.meta[1][0].data);if(o==2){var l=S2(e,c,r);l.sheets.forEach(function(v,x){un(n,v,x==0?l.name:l.name+"_"+x,!0)})}})}),n.SheetNames.length==0)throw new Error("Empty NUMBERS file");return n.bookType="numbers",n}function On(e,t){var r,a,n,i,s,f,c,o={},l=[];if(e.FullPaths.forEach(function(x){if(x.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),e.FileIndex.forEach(function(x){if(x.name.match(/\.iwa$/)&&x.content[0]==0){var u;try{u=m2(x.content)}catch(p){return console.log("?? "+x.content.length+" "+(p.message||p))}var m;try{m=x2(u)}catch(p){return console.log("## "+(p.message||p))}m.forEach(function(p){o[p.id]=p.messages,l.push(p.id)})}}),!l.length)throw new Error("File has no messages");if((n=(a=(r=o?.[1])==null?void 0:r[0].meta)==null?void 0:a[1])!=null&&n[0].data&&Be(o[1][0].meta[1][0].data)==1e4)throw new Error("Pages documents are not supported");var v=((c=(f=(s=(i=o?.[1])==null?void 0:i[0])==null?void 0:s.meta)==null?void 0:f[1])==null?void 0:c[0].data)&&Be(o[1][0].meta[1][0].data)==1&&o[1][0];if(v||l.forEach(function(x){o[x].forEach(function(u){var m=Be(u.meta[1][0].data)>>>0;if(m==1)if(!v)v=u;else throw new Error("Document has multiple roots")})}),!v)throw new Error("Cannot find Document root");return F2(o,v,t)}function A2(e){return function(r){for(var a=0;a!=e.length;++a){var n=e[a];r[n[0]]===void 0&&(r[n[0]]=n[1]),n[2]==="n"&&(r[n[0]]=Number(r[n[0]]))}}}function h0(e){A2([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function C2(e){return tt.WS.indexOf(e)>-1?"sheet":tt.CS&&e==tt.CS?"chart":tt.DS&&e==tt.DS?"dialog":tt.MS&&e==tt.MS?"macro":e&&e.length?e:"sheet"}function b2(e,t){if(!e)return 0;try{e=t.map(function(a){return a.id||(a.id=a.strRelID),[a.name,e["!id"][a.id].Target,C2(e["!id"][a.id].Type)]})}catch{return null}return!e||e.length===0?null:e}function D2(e,t,r,a,n,i,s,f){if(!(!e||!e["!legdrawel"])){var c=Xt(e["!legdrawel"].Target,a),o=yr(r,c,!0);o&&$h(Xe(o),e,f||[])}}function I2(e,t,r,a,n,i,s,f,c,o,l,v){try{i[a]=fa(yr(e,r,!0),t);var x=Qe(e,t),u;switch(f){case"sheet":u=Hd(x,t,n,c,i[a],o,l,v);break;case"chart":if(u=Xd(x,t,n,c,i[a],o,l,v),!u||!u["!drawel"])break;var m=Xt(u["!drawel"].Target,t),p=Mn(m),h=Vh(yr(e,m,!0),fa(yr(e,p,!0),m)),d=Xt(h,m),E=Mn(d);u=yd(yr(e,d,!0),d,c,fa(yr(e,E,!0),d),o,u);break;case"macro":u=Vd(x,t,n,c,i[a],o,l,v);break;case"dialog":u=$d(x,t,n,c,i[a],o,l,v);break;default:throw new Error("Unrecognized sheet type "+f)}s[a]=u;var g=[],b=[];i&&i[a]&&qr(i[a]).forEach(function(R){var G="";if(i[a][R].Type==tt.CMNT){if(G=Xt(i[a][R].Target,t),g=Kd(Qe(e,G,!0),G,c),!g||!g.length)return;ui(u,g,!1)}i[a][R].Type==tt.TCMNT&&(G=Xt(i[a][R].Target,t),b=b.concat(zh(Qe(e,G,!0),c)))}),b&&b.length&&ui(u,b,!0,c.people||[]),D2(u,f,e,t,n,c,o,g)}catch(R){if(c.WTF)throw R}}function Mr(e){return e.charAt(0)=="/"?e.slice(1):e}function O2(e,t){if(Pi(),t=t||{},h0(t),Wr(e,"META-INF/manifest.xml")||Wr(e,"objectdata.xml"))return Ei(e,t);if(Wr(e,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof On<"u"){if(e.FileIndex)return On(e,t);var r=Pe.utils.cfb_new();return B0(e).forEach(function(q){Vc(r,q,Vi(e,q))}),On(r,t)}throw new Error("Unsupported NUMBERS file")}if(!Wr(e,"[Content_Types].xml")){if(Wr(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(Wr(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");var a=Pe.find(e,"Index.zip");if(a)return t=rr(t),delete t.type,typeof a.content=="string"&&(t.type="binary"),typeof Bun<"u"&&Buffer.isBuffer(a.content)?Dt(new Uint8Array(a.content),t):Dt(a.content,t);throw new Error("Unsupported ZIP file")}var n=B0(e),i=Mo(yr(e,"[Content_Types].xml")),s=!1,f,c;if(i.workbooks.length===0&&(c="xl/workbook.xml",Qe(e,c,!0)&&i.workbooks.push(c)),i.workbooks.length===0){if(c="xl/workbook.bin",!Qe(e,c,!0))throw new Error("Could not find workbook");i.workbooks.push(c),s=!0}i.workbooks[0].slice(-3)=="bin"&&(s=!0);var o={},l={};if(!t.bookSheets&&!t.bookProps){if(la=[],i.sst)try{la=zd(Qe(e,Mr(i.sst)),i.sst,t)}catch(q){if(t.WTF)throw q}t.cellStyles&&i.themes.length&&(o=Ds(yr(e,i.themes[0].replace(/^\//,""),!0)||"",t)),i.style&&(l=Gd(Qe(e,Mr(i.style)),i.style,o,t))}i.links.map(function(q){try{var pe=fa(yr(e,Mn(Mr(q))),q);return jd(Qe(e,Mr(q)),pe,q,t)}catch{}});var v=Wd(Qe(e,Mr(i.workbooks[0])),i.workbooks[0],t),x={},u="";i.coreprops.length&&(u=Qe(e,Mr(i.coreprops[0]),!0),u&&(x=ls(u)),i.extprops.length!==0&&(u=Qe(e,Mr(i.extprops[0]),!0),u&&Xo(u,x,t)));var m={};(!t.bookSheets||t.bookProps)&&i.custprops.length!==0&&(u=yr(e,Mr(i.custprops[0]),!0),u&&(m=$o(u,t)));var p={};if((t.bookSheets||t.bookProps)&&(v.Sheets?f=v.Sheets.map(function(pe){return pe.name}):x.Worksheets&&x.SheetNames.length>0&&(f=x.SheetNames),t.bookProps&&(p.Props=x,p.Custprops=m),t.bookSheets&&typeof f<"u"&&(p.SheetNames=f),t.bookSheets?p.SheetNames:t.bookProps))return p;f={};var h={};t.bookDeps&&i.calcchain&&(h=Yd(Qe(e,Mr(i.calcchain)),i.calcchain,t));var d=0,E={},g,b;{var R=v.Sheets;x.Worksheets=R.length,x.SheetNames=[];for(var G=0;G!=R.length;++G)x.SheetNames[G]=R[G].name}var P=s?"bin":"xml",N=i.workbooks[0].lastIndexOf("/"),D=(i.workbooks[0].slice(0,N+1)+"_rels/"+i.workbooks[0].slice(N+1)+".rels").replace(/^\//,"");Wr(e,D)||(D="xl/_rels/workbook."+P+".rels");var B=fa(yr(e,D,!0),D.replace(/_rels.*/,"s5s"));(i.metadata||[]).length>=1&&(t.xlmeta=Zd(Qe(e,Mr(i.metadata[0])),i.metadata[0],t)),(i.people||[]).length>=1&&(t.people=Kh(Qe(e,Mr(i.people[0])),t)),B&&(B=b2(B,v.Sheets));var U=Qe(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(d=0;d!=x.Worksheets;++d){var M="sheet";if(B&&B[d]?(g="xl/"+B[d][1].replace(/[\/]?xl\//,""),Wr(e,g)||(g=B[d][1]),Wr(e,g)||(g=D.replace(/_rels\/[\S\s]*$/,"")+B[d][1]),M=B[d][2]):(g="xl/worksheets/sheet"+(d+1-U)+"."+P,g=g.replace(/sheet0\./,"sheet.")),b=g.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&t.sheets!=null)switch(typeof t.sheets){case"number":if(d!=t.sheets)continue e;break;case"string":if(x.SheetNames[d].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var z=!1,oe=0;oe!=t.sheets.length;++oe)typeof t.sheets[oe]=="number"&&t.sheets[oe]==d&&(z=1),typeof t.sheets[oe]=="string"&&t.sheets[oe].toLowerCase()==x.SheetNames[d].toLowerCase()&&(z=1);if(!z)continue e}}I2(e,g,b,x.SheetNames[d],d,E,f,M,t,v,o,l)}return p={Directory:i,Workbook:v,Props:x,Custprops:m,Deps:h,Sheets:f,SheetNames:x.SheetNames,Strings:la,Styles:l,Themes:o,SSF:rr(Se)},t&&t.bookFiles&&(e.files?(p.keys=n,p.files=e.files):(p.keys=[],p.files={},e.FullPaths.forEach(function(q,pe){q=q.replace(/^Root Entry[\/]/,""),p.keys.push(q),p.files[q]=e.FileIndex[pe]}))),t&&t.bookVBA&&(i.vba.length>0?p.vbaraw=Qe(e,Mr(i.vba[0]),!0):i.defaults&&i.defaults.bin===Jh&&(p.vbaraw=Qe(e,"xl/vbaProject.bin",!0))),p.bookType=s?"xlsb":"xlsx",p}function N2(e,t){var r=t||{},a="Workbook",n=Pe.find(e,a);try{if(a="/!DataSpaces/Version",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(Bu(n.content),a="/!DataSpaces/DataSpaceMap",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=Uu(n.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var s=Wu(n.content);if(s.length!=1||s[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);Xu(n.content)}catch{}if(a="/EncryptionInfo",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var f=Vu(n.content);if(a="/EncryptedPackage",n=Pe.find(e,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(f[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(f[1],n.content,r.password||"",r);if(f[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(f[1],n.content,r.password||"",r);throw new Error("File is password-protected")}function x0(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Lr(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function R2(e,t){return Pe.find(e,"EncryptedPackage")?N2(e,t):zs(e,t)}function L2(e,t){var r,a=e,n=t||{};return n.type||(n.type=Ie&&Buffer.isBuffer(e)?"buffer":"base64"),r=$i(a,n),O2(r,n)}function qs(e,t){var r=0;e:for(;r"u"&&console.error("Codepage tables are not loaded. Non-ASCII characters may not give expected results"),typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer)return Dt(new Uint8Array(e),(r=rr(r),r.type="array",r));if(typeof Int8Array<"u"&&e instanceof Int8Array)return Dt(new Uint8Array(e.buffer,e.byteOffset,e.length),r);typeof Uint8Array<"u"&&e instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var a=e,n=[0,0,0,0],i=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),$t={},r.dateNF&&($t.dateNF=r.dateNF),r.type||(r.type=Ie&&Buffer.isBuffer(e)?"buffer":"base64"),r.type=="file"&&(r.type=Ie?"buffer":"binary",a=Sc(e),typeof Uint8Array<"u"&&!Ie&&(r.type="array")),r.type=="string"&&(i=!0,r.type="binary",r.codepage=65001,a=M2(e)),r.type=="array"&&typeof Uint8Array<"u"&&e instanceof Uint8Array&&typeof ArrayBuffer<"u"){var s=new ArrayBuffer(3),f=new Uint8Array(s);if(f.foo="bar",!f.foo)return r=rr(r),r.type="array",Dt(Gn(a),r)}switch((n=x0(a,r))[0]){case 208:if(n[1]===207&&n[2]===17&&n[3]===224&&n[4]===161&&n[5]===177&&n[6]===26&&n[7]===225)return R2(Pe.read(a,r),r);break;case 9:if(n[1]<=8)return zs(a,r);break;case 60:return Wn(a,r);case 73:if(n[1]===73&&n[2]===42&&n[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(n[1]===68)return Fu(a,r);break;case 84:if(n[1]===65&&n[2]===66&&n[3]===76)return yu.to_workbook(a,r);break;case 80:return n[1]===75&&n[2]<9&&n[3]<9?L2(a,r):Nn(e,a,r,i);case 239:return n[3]===60?Wn(a,r):Nn(e,a,r,i);case 255:if(n[1]===254)return B2(a,r);if(n[1]===0&&n[2]===2&&n[3]===0)return oa.to_workbook(a,r);break;case 0:if(n[1]===0&&(n[2]>=2&&n[3]===0||n[2]===0&&(n[3]===8||n[3]===9)))return oa.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return li.to_workbook(a,r);case 123:if(n[1]===92&&n[2]===114&&n[3]===116)return th(a,r);break;case 10:case 13:case 32:return P2(a,r);case 137:if(n[1]===80&&n[2]===78&&n[3]===71)throw new Error("PNG Image File is not a spreadsheet");break;case 8:if(n[1]===231)throw new Error("Unsupported Multiplan 1.x file!");break;case 12:if(n[1]===236)throw new Error("Unsupported Multiplan 2.x file!");if(n[1]===237)throw new Error("Unsupported Multiplan 3.x file!");break}return Eu.indexOf(n[0])>-1&&n[2]<=12&&n[3]<=31?li.to_workbook(a,r):Nn(e,a,r,i)}function U2(e,t,r,a,n,i,s){var f=ze(r),c=s.defval,o=s.raw||!Object.prototype.hasOwnProperty.call(s,"raw"),l=!0,v=e["!data"]!=null,x=n===1?[]:{};if(n!==1)if(Object.defineProperty)try{Object.defineProperty(x,"__rowNum__",{value:r,enumerable:!1})}catch{x.__rowNum__=r}else x.__rowNum__=r;if(!v||e["!data"][r])for(var u=t.s.c;u<=t.e.c;++u){var m=v?(e["!data"][r]||[])[u]:e[a[u]+f];if(m==null||m.t===void 0){if(c===void 0)continue;i[u]!=null&&(x[i[u]]=c);continue}var p=m.v;switch(m.t){case"z":if(p==null)break;continue;case"e":p=p==0?null:void 0;break;case"s":case"b":case"n":if(!m.z||!Qr(m.z)||(p=vt(p),typeof p=="number"))break;case"d":s&&(s.UTC||s.raw===!1)||(p=Nt(new Date(p)));break;default:throw new Error("unrecognized type "+m.t)}if(i[u]!=null){if(p==null)if(m.t=="e"&&p===null)x[i[u]]=null;else if(c!==void 0)x[i[u]]=c;else if(o&&p===null)x[i[u]]=null;else continue;else x[i[u]]=(m.t==="n"&&typeof s.rawNumbers=="boolean"?s.rawNumbers:o)?p:va(m,p,s);p!=null&&(l=!1)}}return{row:x,isempty:l}}function W2(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},a=0,n=1,i=[],s=0,f="",c={s:{r:0,c:0},e:{r:0,c:0}},o=t||{},l=o.range!=null?o.range:e["!ref"];switch(o.header===1?a=1:o.header==="A"?a=2:Array.isArray(o.header)?a=3:o.header==null&&(a=0),typeof l){case"string":c=lr(l);break;case"number":c=lr(e["!ref"]),c.s.r=l;break;default:c=l}a>0&&(n=0);var v=ze(c.s.r),x=[],u=[],m=0,p=0,h=e["!data"]!=null,d=c.s.r,E=0,g={};h&&!e["!data"][d]&&(e["!data"][d]=[]);var b=o.skipHidden&&e["!cols"]||[],R=o.skipHidden&&e["!rows"]||[];for(E=c.s.c;E<=c.e.c;++E)if(!(b[E]||{}).hidden)switch(x[E]=Ve(E),r=h?e["!data"][d][E]:e[x[E]+v],a){case 1:i[E]=E-c.s.c;break;case 2:i[E]=x[E];break;case 3:i[E]=o.header[E-c.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),f=s=va(r,null,o),p=g[s]||0,!p)g[s]=1;else{do f=s+"_"+p++;while(g[f]);g[s]=p,g[f]=1}i[E]=f}for(d=c.s.r+n;d<=c.e.r;++d)if(!(R[d]||{}).hidden){var G=U2(e,c,d,x,a,i,o);(G.isempty===!1||(a===1?o.blankrows!==!1:o.blankrows))&&(u[m++]=G.row)}return u.length=m,u}function Xn(e,t,r){if(typeof t=="string"){if(e["!data"]!=null){var a=Rr(t);return e["!data"][a.r]||(e["!data"][a.r]=[]),e["!data"][a.r][a.c]||(e["!data"][a.r][a.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?Xn(e,Me(t)):Xn(e,Ve(r||0)+ze(t))}function Qs(e,t){var r={SheetNames:[],Sheets:{}};return e&&un(r,e,t||"Sheet1"),r}function un(e,t,r,a){var n=1;if(!r)for(;n<=65535&&e.SheetNames.indexOf(r="Sheet"+n)!=-1;++n,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&e.SheetNames.indexOf(r)>=0&&r.length<32){var i=r.match(/\d+$/);n=i&&+i[0]||0;var s=i&&r.slice(0,i.index)||r;for(++n;n<=65535&&e.SheetNames.indexOf(r=s+n)!=-1;++n);}if(Od(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}var Dm=yi.version;function d0(e){let t="";for(let r=e+1;r>0;r=Math.floor((r-1)/26))t=String.fromCharCode(65+(r-1)%26)+t;return t}function hn(e,t){return`${d0(t)}${e+1}`}function m0({r0:e,c0:t,r1:r,c1:a}){let n=hn(e,t);return e===r&&t===a?n:`${n}:${hn(r,a)}`}var H2={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA"};function wt(e){return!e||e.t==="z"||e.v==null&&e.w==null&&!e.f}function ef(e){if(wt(e))return"empty";switch(e.t){case"n":case"d":return"number";case"b":return"boolean";case"e":return"error";default:return"text"}}function jr(e){return wt(e)?"":e.t==="b"?e.v?"TRUE":"FALSE":e.t==="e"?e.w??H2[e.v]??"#ERROR!":e.w!=null?String(e.w):e.v==null?"":e.v instanceof Date?e.v.toISOString():String(e.v)}function rf(e){if(!e||typeof e.f!="string"||e.f==="")return null;let t=e.f.replace(/\[\.(\$?[A-Z]+\$?\d+)(?::\.(\$?[A-Z]+\$?\d+))?\]/g,(r,a,n)=>n?`${a}:${n}`:a);return e.F?`{=${t}}`:`=${t}`}function tf(e){if(!e||e.t!=="n"||typeof e.v!="number")return null;let t=String(e.v);return t===jr(e)?null:t}function af(e){return e&&e.t==="n"&&typeof e.v=="number"&&Number.isFinite(e.v)?e.v:null}var X2=new Set(["xlsx","xlsm","xlsb","xls","ods"]);function nf(e){if(e===null||typeof e!="object"||!Number.isSafeInteger(e.version))return null;let{content:t}=e;if(t===null||typeof t!="object"||t.kind!=="bytes"||!(t.bytes instanceof ArrayBuffer))return null;let r=X2.has(e.fileType)?e.fileType:null;return{version:e.version,bytes:new Uint8Array(t.bytes),fileType:r}}function Aa(e){let t=e.length,r=new Float64Array(t+1);for(let a=0;ar[a],size:a=>e[a],end:a=>r[a+1],isHidden:a=>e[a]===0,indexAt(a){if(t===0)return-1;if(a<=0)return 0;if(a>=r[t])return t-1;let n=0,i=t-1;for(;n>1;r[s]<=a?n=s:i=s-1}return n}}}function Ca(e){let t=new Map;for(let n of e)for(let i=Math.floor(n.s.r/64);i<=Math.floor(n.e.r/64);i++){let s=t.get(i);s||t.set(i,s=[]),s.push(n)}function r(n,i){let s=t.get(Math.floor(n/64));if(!s)return null;for(let f of s)if(n>=f.s.r&&n<=f.e.r&&i>=f.s.c&&i<=f.e.c)return f;return null}function a(n,i,s,f){let c=new Set;for(let o=Math.floor(n/64);o<=Math.floor(i/64);o++)for(let l of t.get(o)??[])l.e.r>=n&&l.s.r<=i&&l.e.c>=s&&l.s.c<=f&&c.add(l);return[...c]}return{at:r,inWindow:a,isEmpty:e.length===0}}function sf(e,t){if(t.isEmpty)return e;let{r0:r,c0:a,r1:n,c1:i}=e;for(let s=!0;s;){s=!1;for(let f of t.inWindow(r,n,a,i))f.s.rn&&(n=f.e.r,s=!0),f.e.c>i&&(i=f.e.c,s=!0)}return{r0:r,c0:a,r1:n,c1:i}}function ff(e,t,r){let a=[];for(let n=e.r0;n<=e.r1;n++){let i=[];for(let s=e.c0;s<=e.c1;s++)i.push($2(V2(n,s,t,r)));a.push(i.join(" "))}return a.join(` -`)}function cf(e,t,r){let a=[];for(let n=e.r0;n<=e.r1;n++){let i="";for(let s=e.c0;s<=e.c1;s++){let f=r.at(n,s),c="";if(f){let l=Math.max(f.s.r,e.r0),v=Math.max(f.s.c,e.c0);if(n!==l||s!==v)continue;let x=Math.min(f.e.r,e.r1)-l+1,u=Math.min(f.e.c,e.c1)-v+1;x>1&&(c+=` rowspan="${x}"`),u>1&&(c+=` colspan="${u}"`)}let o=jr(t(f?f.s.r:n,f?f.s.c:s));i+=`${v0(o)}`}a.push(`${i}`)}return`
    ${a.join("")}
    `}function V2(e,t,r,a){let n=a.at(e,t);return n&&(n.s.r!==e||n.s.c!==t)?"":jr(r(e,t))}function $2(e){return/[\t\n\r"]/.test(e)?`"${e.replaceAll('"','""')}"`:e}function v0(e){return e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`)}function of(e,t){let r=0,a=0,n=0,i=Math.min(e.r1,t.length-1);for(let s=e.r0;s<=i;s++){let f=t[s];if(!f)continue;let c=Math.min(e.c1,f.length-1);for(let o=e.c0;o<=c;o++){let l=f[o];if(!l||jr(l)==="")continue;r++;let v=af(l);v!==null&&(a++,n+=v)}}return{count:r,numericCount:a,sum:n,average:a>0?n/a:null}}function dn(e,t){return{active:{r:e,c:t},anchor:{r:e,c:t},corner:{r:e,c:t}}}function p0(e,t){return{active:e,anchor:e,corner:t}}function ba(e,t){let{anchor:r,corner:a}=e,n={r0:Math.min(r.r,a.r),c0:Math.min(r.c,a.c),r1:Math.max(r.r,a.r),c1:Math.max(r.c,a.c)};return t?sf(n,t):n}function Zt({r0:e,c0:t,r1:r,c1:a}){return(r-e+1)*(a-t+1)}function lf(e,t,r){if(t<=0||r<=0)return null;let a=({r:n,c:i})=>({r:Math.min(n,t-1),c:Math.min(i,r-1)});return{active:a(e.active),anchor:a(e.anchor),corner:a(e.corner)}}function Jt(e,t,r){let a=Math.max(0,r.rowCount-1),n=Math.max(0,r.columnCount-1),i=!!t.extend,s=i?e.corner:e.active,f=(c,o)=>{let l={r:xn(c,0,a),c:xn(o,0,n)};return i?{...e,corner:l}:dn(...uf(l,r))};switch(t.type){case"move":{let{dr:c=0,dc:o=0}=t,l=t.toEdge?Y2(s,c,o,r):z2(s,c,o,r);return f(l.r,l.c)}case"page":return f(hf(s.r+t.dr*Math.max(1,r.pageRows),t.dr,r),s.c);case"rowStart":return f(s.r,0);case"rowEnd":{let c=n;for(;c>0&&r.isEmpty(s.r,c);)c--;return f(s.r,r.isEmpty(s.r,c)?n:c)}case"sheetStart":return f(0,0);case"sheetEnd":return f(a,n);case"cell":return f(t.r,t.c);case"row":{let c=xn(t.r,0,a);return i?{...e,corner:{r:c,c:n}}:p0({r:c,c:0},{r:c,c:n})}case"column":{let c=xn(t.c,0,n);return i?{...e,corner:{r:a,c}}:p0({r:0,c},{r:a,c})}case"all":return p0({r:0,c:0},{r:a,c:n});case"cycle":return G2(e,t,r);default:return e}}function G2(e,{across:t,back:r},a){let n=ba(e,a.merges),i=r?-1:1;if(Zt(n)===1)return Jt(e,{type:"move",dr:t?0:i,dc:t?i:0},a);let{r:s,c:f}=e.active,c=a.merges.at(s,f);t?(f=i>0?(c?c.e.c:f)+1:(c?c.s.c:f)-1,f>n.c1?(f=n.c0,s=s+1>n.r1?n.r0:s+1):f0?(c?c.e.r:s)+1:(c?c.s.r:s)-1,s>n.r1?(s=n.r0,f=f+1>n.c1?n.c0:f+1):sr?r:e}function uf(e,t){let r=t.merges.at(e.r,e.c);return r?[r.s.r,r.s.c]:[e.r,e.c]}function z2(e,t,r,a){let n=a.merges.at(e.r,e.c),i=e.r,s=e.c;n&&(t>0&&(i=n.e.r),t<0&&(i=n.s.r),r>0&&(s=n.e.c),r<0&&(s=n.s.c));let f={r:hf(i+t,t,a),c:K2(s+r,r,a)};return f.r<0||f.r>=a.rowCount||f.c<0||f.c>=a.columnCount?e:f}function hf(e,t,r){if(!r.isRowHidden||t===0)return e;for(;e>=0&&e=0&&ef>=0&&f=0&&c{let s=e.Sheets[n];if(s){if(t[i]?.Hidden){a++;return}r.push(Q2(n,s))}}),{sheets:r,hiddenCount:a}}function Q2(e,t){let r=t["!type"]==="chart"?"chart":t["!type"]==="macro"||t["!type"]==="dialog"?"other":"worksheet",a=rm(t),n=(t["!merges"]??[]).filter(em),i=0,s=0;for(let f=a.length-1;f>=0;f--){let c=a[f];if(c){for(let o=c.length-1;o>=0;o--)if(!wt(c[o])){i===0&&(i=f+1),o+1>s&&(s=o+1);break}}}for(let f of n)i=Math.max(i,f.e.r+1),s=Math.max(s,f.e.c+1);return{name:e,kind:r,data:a,rowCount:i,columnCount:s,merges:n,columnInfo:t["!cols"]??[],rowInfo:t["!rows"]??[]}}function Ut(e,t,r){return e.data[t]?.[r]}function em(e){return e&&e.s&&e.e&&Number.isInteger(e.s.r)&&Number.isInteger(e.s.c)&&Number.isInteger(e.e.r)&&Number.isInteger(e.e.c)&&e.s.r>=0&&e.s.c>=0&&e.e.r>=e.s.r&&e.e.c>=e.s.c&&(e.e.r>e.s.r||e.e.c>e.s.c)}function rm(e){if(Array.isArray(e["!data"]))return e["!data"];let t=[];for(let r of Object.keys(e)){if(r[0]==="!")continue;let a=/^([A-Z]+)(\d+)$/.exec(r);if(!a)continue;let n=0;for(let s of a[1])n=n*26+s.charCodeAt(0)-64;let i=Number(a[2])-1;(t[i]??=[])[n-1]=e[r]}return t}function tm(e){return e?e.hidden?0:Number.isFinite(e.wpx)?Math.round(e.wpx):Number.isFinite(e.wch)?Math.round(e.wch*7+5):Number.isFinite(e.width)?Math.round(e.width*7):null:null}function am(e){return e?e.hidden?0:Number.isFinite(e.hpx)?Math.round(e.hpx):Number.isFinite(e.hpt)?Math.round(e.hpt*4/3):null:null}function nm(e){let t=[],r=Math.min(e,q2);for(let a=0;ar){let a=(e-r)/df;for(let n=0;ni.e.c>i.s.c));for(let i of nm(e.rowCount)){let s=e.data[i];if(s)for(let f of a){let c=s[f];if(wt(c)||n.at(i,f))continue;let o=jr(c),l=o.length>200?o.slice(0,200):o,v=t(l.split(` -`,1)[0])+J2;v>r[f]&&(r[f]=v)}}for(let i of a)r[i]=Math.min(j2,Math.ceil(Math.max(r[i],xf)));return r}function pf(e){let t=new Float64Array(e.rowCount).fill(Z2);return e.rowInfo.forEach((r,a)=>{if(a>=e.rowCount)return;let n=am(r);n!==null&&(t[a]=n)}),t}var kt=24,gf=10,_f=3,im=12,wf=1e3,kf=24;function Ef(e,t){e.innerHTML=` -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    `;let r=e.querySelector(".scroller"),a=e.querySelector(".spacer"),n=e.querySelector(".viewport"),i=e.querySelector(".col-header .strip"),s=e.querySelector(".corner"),f=e.querySelector(".body"),c=e.querySelector(".rows"),o=e.querySelector(".row-list"),l=e.querySelector(".selection .range"),v=e.querySelector(".selection .active"),x=`g${Math.random().toString(36).slice(2,8)}`,u=null,m=Aa([]),p=Aa([]),h=Ca([]),d=40,E=dn(0,0),g=null,b=0,R=0,G=0,P=0,N=null,D=0,B=()=>({rowCount:m.count,columnCount:p.count,pageRows:Math.max(1,m.indexAt(P+R-kt)-m.indexAt(P)),isEmpty:(w,I)=>wt(Ut(u,w,I)),merges:h,isRowHidden:m.isHidden,isColumnHidden:p.isHidden});function U(w,I={}){u=w,m=Aa(pf(u)),p=Aa(vf(u,t.measureText)),h=Ca(u.merges),d=Math.ceil(t.measureText(String(Math.max(1,u.rowCount)))+20),E=I.selection??dn(0,0),n.setAttribute("aria-label",w.name),n.setAttribute("aria-rowcount",String(m.count+1)),n.setAttribute("aria-colcount",String(p.count+1)),n.style.setProperty("--gutter",`${d}px`),a.style.width=`${d+p.total}px`,a.style.height=`${kt+m.total}px`,g=null,M(),r.scrollTop=I.scrollTop??0,r.scrollLeft=I.scrollLeft??0,oe(),q()}function M(){b=r.clientWidth,R=r.clientHeight,n.style.width=`${b}px`,n.style.height=`${R}px`}function z(){let w=P,I=P+Math.max(0,R-kt),k=G,te=G+Math.max(0,b-d);return{r0:m.indexAt(w),r1:m.indexAt(I),c0:p.indexAt(k),c1:p.indexAt(te)}}function oe(){G=r.scrollLeft,P=r.scrollTop,n.style.setProperty("--sx",`${-G}px`),c.style.transform=`translate3d(0, ${-P}px, 0)`;let w=z();(!g||w.r0g.r1||w.c0g.c1)&&q()}function q(){if(!u||m.count===0||p.count===0)return;let w=z(),I={r0:Math.max(0,w.r0-gf),r1:Math.min(m.count-1,w.r1+gf),c0:Math.max(0,w.c0-_f),c1:Math.min(p.count-1,w.c1+_f)};g=I;let k=ba(E,h),{active:te}=E,j="";for(let le=I.c0;le<=I.c1;le++){if(p.isHidden(le))continue;let Te=le>=k.c0&&le<=k.c1?" lit":"";j+=`
    ${d0(le)}
    `}i.innerHTML=j;let K=new Map,fe=(le,Te)=>{let Re=K.get(le);Re||K.set(le,Re=new Set),Re.add(Te)};for(let le of h.inWindow(I.r0,I.r1,I.c0,I.c1))(le.s.rI.r1||te.cI.c1)&&fe(te.r,te.c);let we="",ce=(le,Te)=>{if(m.isHidden(le))return;let Re=le>=k.r0&&le<=k.r1?" lit":"",re="";for(let ie of Te)re+=pe(le,ie,k,I);we+=`
    ${le+1}
    ${re}
    `},be=[];for(let le=I.c0;le<=I.c1;le++)be.push(le);for(let le of[...K.keys()].filter(Te=>TeTe-Re))ce(le,[...K.get(le)]);for(let le=I.r0;le<=I.r1;le++){let Te=K.get(le);ce(le,Te?[...new Set([...Te,...be])].sort((Re,re)=>Re-re):be)}for(let le of[...K.keys()].filter(Te=>Te>I.r1).sort((Te,Re)=>Te-Re))ce(le,[...K.get(le)]);o.innerHTML=we,s.classList.toggle("lit",k.r0===0&&k.c0===0&&k.r1===m.count-1&&k.c1===p.count-1),ge(k),n.setAttribute("aria-activedescendant",J(te.r,te.c))}function pe(w,I,k,te){if(p.isHidden(I))return"";let j=h.at(w,I);if(j&&(j.s.r!==w||j.s.c!==I))return"";let K=Ut(u,w,I),fe=ef(K),we=p.size(I),ce=m.size(w),be="";if(j)we=p.end(j.e.c)-p.start(I),ce=m.end(j.e.r)-m.start(w),be=" merged";else if(fe==="text"){let Re=I+1,re=Math.min(p.count-1,te.c1+1,I+im);for(;Re<=re&&wt(Ut(u,w,Re))&&!h.at(w,Re);)Re++;Re>I+1&&(we=p.end(Re-1)-p.start(I),be=" spill")}let le=w>=k.r0&&w<=k.r1&&I>=k.c0&&I<=k.c1,Te=jr(K);return Te.length>wf&&(Te=Te.slice(0,wf)),`
    ${v0(Te)}
    `}function J(w,I){return`${x}-${w}-${I}`}function xe(w,I){let k=h.at(w,I),te=k?k.e.r:w,j=k?k.e.c:I;return{x:p.start(k?k.s.c:I),y:m.start(k?k.s.r:w),x1:p.end(j),y1:m.end(te)}}function ge(w){let I=(te,j,K,fe,we)=>{te.style.left=`${j}px`,te.style.top=`${K}px`,te.style.width=`${Math.max(0,fe-j)}px`,te.style.height=`${Math.max(0,we-K)}px`};I(l,p.start(w.c0),m.start(w.r0),p.end(w.c1),m.end(w.r1)),l.hidden=w.r0===w.r1&&w.c0===w.c1;let k=xe(E.active.r,E.active.c);I(v,k.x,k.y,k.x1,k.y1)}function ae(w,I){let k=xe(w,I),te=b-d,j=R-kt,K=r.scrollTop,fe=r.scrollLeft;k.yK+j&&(K=Math.min(k.y,k.y1-j)),k.xfe+te&&(fe=Math.min(k.x,k.x1-te)),K!==r.scrollTop&&(r.scrollTop=K),fe!==r.scrollLeft&&(r.scrollLeft=fe),oe()}function Ee(w,I){E=w,I&&ae(w[I].r,w[I].c),q(),t.onSelectionChange()}function Z(w,I=w.extend?"corner":"active"){!u||m.count===0||Ee(Jt(E,w,B()),I)}function ve(w){if(!u||m.count===0)return;let I=w.ctrlKey||w.metaKey,k=w.shiftKey,te={ArrowUp:[-1,0],ArrowDown:[1,0],ArrowLeft:[0,-1],ArrowRight:[0,1]},j=null;if(w.key in te){let[K,fe]=te[w.key];if(w.altKey&&!I){fe&&(w.preventDefault(),t.onSwitchSheet(fe));return}j={type:"move",dr:K,dc:fe,extend:k,toEdge:I}}else if(w.key==="PageDown"||w.key==="PageUp"){let K=w.key==="PageDown"?1:-1;if(I){w.preventDefault(),t.onSwitchSheet(K);return}j={type:"page",dr:K,extend:k}}else if(w.key==="Home"||w.key==="End"){let K=w.key==="Home";j={type:I?K?"sheetStart":"sheetEnd":K?"rowStart":"rowEnd",extend:k}}else if(w.key==="Tab"&&!I&&!w.altKey){let{r:K,c:fe}=E.active;if(Zt(ba(E,h))===1&&(k&&fe===0||!k&&K===m.count-1&&fe===p.count-1))return;j={type:"cycle",across:!0,back:k}}else w.key==="Enter"&&!I&&!w.altKey?j={type:"cycle",across:!1,back:k}:w.key==="Escape"&&!I?j={type:"cell",r:E.active.r,c:E.active.c}:(w.key==="a"||w.key==="A")&&I&&!w.altKey&&!k?j={type:"all"}:w.key===" "&&k&&!I?j={type:"row",r:E.active.r}:w.key===" "&&w.ctrlKey&&!k&&(j={type:"column",c:E.active.c});j&&(w.preventDefault(),Z(j,j.type==="all"||j.type==="row"||j.type==="column"?!1:void 0))}function ue(w,I){let k=n.getBoundingClientRect(),te=w-k.left,j=I-k.top,K=m.indexAt(j-kt+P),fe=p.indexAt(te-d+G);return tew.right-kf&&(I=1)),N.zone!=="column"&&(N.yw.bottom-kf&&(k=1)),(I||k)&&(r.scrollLeft+=I*16,r.scrollTop+=k*16,oe(),_e()),D=requestAnimationFrame(A)}function L(w){N&&(N=null,cancelAnimationFrame(D),n.hasPointerCapture(w.pointerId)&&n.releasePointerCapture(w.pointerId))}let O=new ResizeObserver(()=>{M(),g=null,oe()});return O.observe(r),r.addEventListener("scroll",oe,{passive:!0}),n.addEventListener("keydown",ve),n.addEventListener("pointerdown",Ce),n.addEventListener("pointermove",de),n.addEventListener("pointerup",L),n.addEventListener("pointercancel",L),{element:n,setSheet:U,dispatch:Z,focus:()=>n.focus({preventScroll:!0}),get selection(){return E},range:()=>ba(E,h),merges:()=>h,state:()=>({selection:E,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),activeAddress:()=>hn(E.active.r,E.active.c),destroy(){O.disconnect(),cancelAnimationFrame(D),e.innerHTML=""}}}var lt={opening:"Opening spreadsheet\u2026",corrupt:"This file couldn't be read as a spreadsheet. It may be damaged or in a format Spreadsheet Viewer doesn't support.",encrypted:"This workbook is password-protected. Spreadsheet Viewer can't open encrypted files.","too-large":"This file is too large to view. Its contents expand to more than 256 MB or 4,000 parts, which Spreadsheet Viewer refuses to unpack.",noSheets:"This workbook has no sheets.",allHidden:"Every sheet in this workbook is hidden.",emptySheet:"This sheet is empty",chartSheet:"This is a chart sheet. Spreadsheet Viewer shows cell data only.",otherSheet:"This is a macro or dialog sheet. Spreadsheet Viewer shows worksheets only."};function Tf(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=sm(t);if(r<0)return"corrupt";let a=t.getUint16(r+10,!0);if(a>4e3)return"too-large";let n=t.getUint32(r+16,!0),i=0;for(let s=0;st.byteLength||t.getUint32(n,!0)!==33639248)return"corrupt";if(i+=t.getUint32(n+24,!0),i>268435456)return"too-large";n+=46+t.getUint16(n+28,!0)+t.getUint16(n+30,!0)+t.getUint16(n+32,!0)}return"ok"}function sm(e){let t=e.byteLength-22,r=Math.max(0,t-65535);for(let a=t;a>=r;a--)if(e.getUint32(a,!0)===101010256)return a;return-1}var yf=67324752,Sf=33639248,Ff=101010256,Af=22,_0=46,mn=30,g0=4294967295,w0=0,om=8,lm=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let a=0;a<8;a++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r>>>0}return e})();function um(e){let t=4294967295;for(let r=0;r>>8;return(t^4294967295)>>>0}function hm(e){let t=e.byteLength-Af;for(let r=t;r>=Math.max(0,t-65535);r--)if(e.getUint32(r,!0)===Ff)return r;return-1}var vn=class extends Error{};async function xm(e,t){let a=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate-raw")).getReader(),n=[],i=0;for(;;){let{done:c,value:o}=await a.read();if(c)break;if(i+=o.byteLength,i>t)throw await a.cancel(),new vn;n.push(o)}let s=new Uint8Array(i),f=0;for(let c of n)s.set(c,f),f+=c.byteLength;return s}function dm(e){let t=new TextEncoder,r=[],a=[],n=0;for(let{name:l,data:v}of e){let x=t.encode(l),u=um(v),m=new DataView(new ArrayBuffer(mn));m.setUint32(0,yf,!0),m.setUint16(4,20,!0),m.setUint16(8,w0,!0),m.setUint32(14,u,!0),m.setUint32(18,v.byteLength,!0),m.setUint32(22,v.byteLength,!0),m.setUint16(26,x.byteLength,!0);let p=new DataView(new ArrayBuffer(_0));p.setUint32(0,Sf,!0),p.setUint16(4,20,!0),p.setUint16(6,20,!0),p.setUint16(10,w0,!0),p.setUint32(16,u,!0),p.setUint32(20,v.byteLength,!0),p.setUint32(24,v.byteLength,!0),p.setUint16(28,x.byteLength,!0),p.setUint32(42,n,!0),r.push(new Uint8Array(m.buffer),x,v),a.push(new Uint8Array(p.buffer),x),n+=mn+x.byteLength+v.byteLength}let i=a.reduce((l,v)=>l+v.byteLength,0),s=new DataView(new ArrayBuffer(Af));s.setUint32(0,Ff,!0),s.setUint16(8,e.length,!0),s.setUint16(10,e.length,!0),s.setUint32(12,i,!0),s.setUint32(16,n,!0);let f=[...r,...a,new Uint8Array(s.buffer)],c=new Uint8Array(f.reduce((l,v)=>l+v.byteLength,0)),o=0;for(let l of f)c.set(l,o),o+=l.byteLength;return c}async function Cf(e,t=268435456){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),a=hm(r);if(a<0)return{status:"corrupt"};let n=r.getUint16(a+10,!0);if(n>4e3)return{status:"too-large"};let i=r.getUint32(a+16,!0),s=new TextDecoder,f=[],c=0;try{for(let o=0;or.byteLength)return{status:"corrupt"};if(r.getUint32(i,!0)!==Sf)return{status:"corrupt"};let l=r.getUint16(i+10,!0),v=r.getUint32(i+20,!0),x=r.getUint32(i+24,!0),u=r.getUint16(i+28,!0),m=r.getUint16(i+30,!0),p=r.getUint16(i+32,!0),h=r.getUint32(i+42,!0);if(v===g0||x===g0||h===g0)return{status:"too-large"};let d=i+_0;if(d+u>r.byteLength)return{status:"corrupt"};let E=s.decode(e.subarray(d,d+u));if(i=d+u+m+p,h+mn>r.byteLength)return{status:"corrupt"};if(r.getUint32(h,!0)!==yf)return{status:"corrupt"};let g=h+mn+r.getUint16(h+26,!0)+r.getUint16(h+28,!0);if(g+v>r.byteLength)return{status:"corrupt"};let b=e.subarray(g,g+v),R;if(l===w0){if(R=b,c+R.byteLength>t)return{status:"too-large"}}else if(l===om)R=await xm(b,t-c);else return{status:"corrupt"};c+=R.byteLength,E.endsWith("/")||f.push({name:E,data:R})}}catch(o){return{status:o instanceof vn?"too-large":"corrupt"}}return{status:"ok",bytes:dm(f)}}var mm=Object.freeze({type:"array",dense:!0,cellFormula:!0,cellText:!0,cellNF:!1,cellHTML:!1,cellStyles:!0,cellDates:!1,sheetStubs:!1,bookVBA:!1,bookDeps:!1,bookFiles:!1});function vm(e){let t=a=>adocument.getElementById(e),Ae={message:br("message"),workbook:br("workbook"),address:br("address"),formula:br("detail-formula"),value:br("detail-value"),raw:br("detail-raw"),gridHost:br("grid-host"),sheetMessage:br("sheet-message"),tabs:br("tabs"),hiddenNote:br("hidden-note"),dims:br("status-dims"),stats:br("status-stats"),note:br("status-note"),live:br("live")},Df=new Intl.NumberFormat(void 0,{maximumFractionDigits:6}),Da=new Intl.NumberFormat(void 0),Rf=document.createElement("canvas").getContext("2d");Rf.font=gm;var pn=new Map;function Em(e){let t=pn.get(e);return t===void 0&&(t=Rf.measureText(e).width,pn.size>5e4&&pn.clear(),pn.set(e,t)),t}var If=-1/0,k0=0,wr=null,ut=-1,E0=new Map,Of=0,Nf=0,Vr=Ef(Ae.gridHost,{measureText:Em,onSelectionChange:Lf,onSwitchSheet:e=>{if(!wr)return;let t=ut+e;t>=0&&t{r===k0&&ym(t,r)},0)}async function ym(e,t){let r=await bf({read:Dt},e);if(t!==k0)return;let a=kn()?.name??null,n=ut;if(a!==null&&!Ae.gridHost.hidden&&E0.set(a,Vr.state()),wr=null,ut=-1,r.status!=="ok"){gn(lt[r.status]);return}let i=mf(r.workbook);if(i.sheets.length===0){gn(i.hiddenCount>0?lt.allHidden:lt.noSheets);return}wr=i,Ae.message.hidden=!0,Ae.workbook.hidden=!1,Sm();let s=wr.sheets.findIndex(f=>f.name===a);wn(s>=0?s:Math.min(Math.max(n,0),wr.sheets.length-1),s>=0)}function Sm(){Ae.tabs.replaceChildren(...wr.sheets.map((e,t)=>{let r=document.createElement("button");return r.type="button",r.className="tab",r.id=`tab-${t}`,r.setAttribute("role","tab"),r.setAttribute("aria-controls","grid"),r.textContent=e.name,r.title=e.name,r.addEventListener("click",()=>wn(t)),r})),Ae.hiddenNote.hidden=wr.hiddenCount===0,Ae.hiddenNote.textContent=wr.hiddenCount===1?"1 hidden sheet not shown":`${Da.format(wr.hiddenCount)} hidden sheets not shown`}function wn(e,t=!0){let r=kn();r&&e!==ut&&!Ae.gridHost.hidden&&E0.set(r.name,Vr.state()),ut=e;let a=wr.sheets[e];Ae.tabs.querySelectorAll('[role="tab"]').forEach((f,c)=>{f.setAttribute("aria-selected",String(c===e)),f.tabIndex=c===e?0:-1}),Ae.tabs.children[e]?.scrollIntoView({block:"nearest",inline:"nearest"});let n=a.kind!=="worksheet"||a.rowCount===0||a.columnCount===0;if(Ae.gridHost.hidden=n,Ae.sheetMessage.hidden=!n,Ae.sheetMessage.textContent=a.kind==="chart"?lt.chartSheet:a.kind==="other"?lt.otherSheet:lt.emptySheet,Ae.dims.textContent=n?"":`${Da.format(a.rowCount)} ${a.rowCount===1?"row":"rows"} \xD7 ${Da.format(a.columnCount)} ${a.columnCount===1?"column":"columns"}`,n){Fm(),_n(`${a.name}. ${Ae.sheetMessage.textContent}`);return}let i=t?E0.get(a.name):void 0,s=i&&lf(i.selection,a.rowCount,a.columnCount);Vr.setSheet(a,s?{...i,selection:s}:{}),Lf(),_n(`Sheet ${a.name}`)}function Fm(){Ae.address.textContent="",Ae.formula.textContent="",Ae.value.textContent="",Ae.raw.textContent="",Ae.stats.textContent=""}function kn(){return wr&&ut>=0?wr.sheets[ut]:null}function Lf(){let e=kn();if(!e)return;let{active:t}=Vr.selection,r=Ut(e,t.r,t.c),a=rf(r),n=jr(r),i=tf(r);Ae.address.textContent=Vr.activeAddress(),Ae.formula.textContent=a??"",Ae.formula.hidden=!a,Ae.value.textContent=a?n===""?"":`= ${n}`:n,Ae.value.classList.toggle("result",!!a),Ae.raw.textContent=i===null?"":`Stored value ${i}`;let s=Vr.range(),f=Zt(s);if(f>1){let c=of(s,e.data),o=[`${m0(s)}`,`Count ${Da.format(c.count)}`];c.numericCount>0&&o.push(`Sum ${Df.format(c.sum)}`,`Average ${Df.format(c.average)}`),Ae.stats.textContent=o.join(" \xB7 ")}else Ae.stats.textContent="";clearTimeout(Nf),Nf=setTimeout(()=>{_n(f>1?`Selected ${m0(s)}`:a?`${Ae.address.textContent}, formula ${a}`:Ae.address.textContent)},km)}function _n(e){Ae.live.textContent="",requestAnimationFrame(()=>Ae.live.textContent=e)}function Am(e){Ae.note.textContent=e,clearTimeout(Of),Of=setTimeout(()=>Ae.note.textContent="",wm)}function Cm(e){let t=kn();if(!t||Ae.gridHost.hidden||!e.clipboardData)return;let r=document.getSelection();if(r&&!r.isCollapsed&&!Vr.element.contains(r.anchorNode))return;let a=Vr.range(),n=(f,c)=>Ut(t,f,c);e.preventDefault(),e.clipboardData.setData("text/plain",ff(a,n,Vr.merges()));let i=Zt(a);i<=_m&&e.clipboardData.setData("text/html",cf(a,n,Vr.merges()));let s=`Copied ${Da.format(i)} ${i===1?"cell":"cells"}`;Am(s),_n(s)}function bm(e){if(!wr)return;let t=wr.sheets.length-1,r=e.key==="ArrowRight"?Math.min(t,ut+1):e.key==="ArrowLeft"?Math.max(0,ut-1):e.key==="Home"?0:e.key==="End"?t:null;r!==null&&(e.preventDefault(),wn(r),Ae.tabs.children[r].focus())}Ae.tabs.addEventListener("keydown",bm);document.addEventListener("copy",Cm);gn(lt.opening);window.orca.document.onDidChange(e=>{let t=nf(e);t&&Tm(t)});})(); - - diff --git a/plugins/spreadsheet/images/cover.png b/plugins/spreadsheet/images/cover.png deleted file mode 100644 index 8c2b94a..0000000 Binary files a/plugins/spreadsheet/images/cover.png and /dev/null differ diff --git a/plugins/spreadsheet/images/dark.png b/plugins/spreadsheet/images/dark.png deleted file mode 100644 index 3891eef..0000000 Binary files a/plugins/spreadsheet/images/dark.png and /dev/null differ diff --git a/plugins/spreadsheet/images/sheets.png b/plugins/spreadsheet/images/sheets.png deleted file mode 100644 index e9c6501..0000000 Binary files a/plugins/spreadsheet/images/sheets.png and /dev/null differ diff --git a/plugins/spreadsheet/images/tab-icon.png b/plugins/spreadsheet/images/tab-icon.png deleted file mode 100644 index b75aca9..0000000 Binary files a/plugins/spreadsheet/images/tab-icon.png and /dev/null differ diff --git a/plugins/spreadsheet/orca-plugin.json b/plugins/spreadsheet/orca-plugin.json deleted file mode 100644 index bb59208..0000000 --- a/plugins/spreadsheet/orca-plugin.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "manifestVersion": 2, - "id": "orca-spreadsheet", - "publisher": "stablyai", - "name": "Spreadsheet Viewer", - "version": "1.1.0", - "execution": "sandboxed-ui", - "description": "View Excel and OpenDocument spreadsheets in Orca's editor: every sheet, formulas and formatted values, even for very large files.", - "license": "MIT", - "repository": "https://github.com/stablyai/orca-plugins/tree/main/plugins/spreadsheet", - "engines": { - "orca": ">=1.4.245" - }, - "contributes": { - "customEditors": [ - { - "id": "spreadsheet", - "title": "Spreadsheet", - "icon": "images/tab-icon.png", - "extensions": [".xlsx", ".xlsm", ".xlsb", ".xls", ".ods"], - "entry": "editor/index.html", - "priority": "default", - "contentKind": "bytes" - } - ] - }, - "capabilities": [], - "cover": { - "path": "images/cover.png", - "alt": "A quarterly summary workbook in Spreadsheet Viewer: formatted currency, percentages and dates, a SUM formula above the grid, and sheet tabs" - }, - "screenshots": [ - { - "path": "images/sheets.png", - "alt": "A 50,000-row data sheet with a block of cells selected and its count, sum and average in the status bar", - "caption": "Large sheets scroll smoothly" - }, - { - "path": "images/dark.png", - "alt": "The same summary workbook in Orca's dark theme, with merged title and notes cells and a #DIV/0! error in red", - "caption": "Follows Orca's dark theme" - } - ] -}