From 5c0e6ed900d30d09d083c48952d0e3dfb3ed8a5c Mon Sep 17 00:00:00 2001 From: wait4xx Date: Thu, 5 Nov 2026 20:13:09 +0800 Subject: [PATCH] =?UTF-8?q?chore(spec):=20=E5=BD=92=E6=A1=A3=20blog-5n?= =?UTF-8?q?=E2=80=94=E2=80=94=E5=85=AB=E4=BB=BB=E5=8A=A1=E6=94=B6=E6=95=9B?= =?UTF-8?q?=EF=BC=88=E5=90=8E=E5=8F=B0=E6=B7=B1=E5=BA=A6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=A8=E5=AE=B6=E6=A1=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spec: 2026-11-05_blog-5n-admin-deep-optimization Co-authored-by: GLM-5.3 --- .../completion-summary.md | 101 +++ .../evidence/verify_t1.sh | 9 + .../evidence/verify_t2.sh | 9 + .../evidence/verify_t3.sh | 11 + .../evidence/verify_t4.sh | 11 + .../evidence/verify_t5.sh | 8 + .../evidence/verify_t6.sh | 9 + .../evidence/verify_t7.sh | 7 + .../evidence/verify_t8.sh | 8 + .../runs.jsonl | 16 + .../spec.md | 80 ++ .../tasks.md | 47 ++ content/posts/writing-template.md | 2 +- content/site/home.yaml | 26 +- docs/后台回滚指引.md | 26 + docs/管理台.md | 15 + infra/deploy/build.sh | 21 +- public/admin/config.yml | 140 ++-- public/admin/deploy-status.js | 161 ++++ public/admin/index.html | 26 +- public/admin/manifest.webmanifest | 21 + public/admin/preview-style.js | 86 +- public/admin/sveltia-cms.js | 751 +++++++++--------- scripts/build-perf/gen-admin-stats.py | 295 +++++++ scripts/deploy/translate-step.sh | 41 + .../__pycache__/tencent_tmt.cpython-313.pyc | Bin 11194 -> 11194 bytes src/content.config.ts | 86 +- src/lib/site-content.ts | 46 +- tests/e2e.mjs | 12 + 29 files changed, 1559 insertions(+), 512 deletions(-) create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/completion-summary.md create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/runs.jsonl create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/spec.md create mode 100644 .spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/tasks.md create mode 100644 docs/后台回滚指引.md create mode 100644 public/admin/deploy-status.js create mode 100644 public/admin/manifest.webmanifest create mode 100644 scripts/build-perf/gen-admin-stats.py create mode 100755 scripts/deploy/translate-step.sh diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/completion-summary.md b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/completion-summary.md new file mode 100644 index 0000000..39029b3 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/completion-summary.md @@ -0,0 +1,101 @@ +# blog-5n:后台深度优化全家桶(14 项全量) - 完成总结 + +## 交付结论 +- 结果:完成 +- 完成时间:2026-11-05 20:12 + +## 假设回顾 +### 已验证假设 +- Sveltia 0.259 与 0.252 对本站用到的 API(registerEditorComponent/registerPreviewStyle/config schema)兼容(升级后全量回归验证) +- TMT 翻译单篇耗时 < 构建容忍度(守卫超时 180s,失败不阻断部署、保留旧英文版) + +### 仍未完全验证的假设 +- 无 + +## 交付范围 +### 已交付 +- task_0001 Sveltia 0.259 升级与回归 +- task_0002 A1 翻译进构建链 +- task_0003 A2+A3+A4+C3 表单优化批 +- task_0004 B1+B2+D1+E1 后台页面批 +- task_0005 C1 首页设置分组 +- task_0006 C2 内容仪表盘 +- task_0007 暗色预览 +- task_0008 媒体库归置 + +### 未交付 +- 无 + +### 偏差说明 +- 无 + +## 简化决策 +### 保持简单的关键选择 +- 最简可行:新文件优先(守卫脚本/状态条/统计脚本/manifest)+ 共享文件主会话三批统一改(build.sh/config.yml/index.html)+ 升级先行(后续工作全部在新版上验证) +- 暂不引入: 自定义 Sveltia widget 开发、翻译并发加速 +- 不做的抽象: 后台微前端/工具页框架(静态页够用) +- 范围级别:package +- 变更对象: public/admin 全域 + build.sh + content/site schema + 文档 +- 快速检查: `pnpm astro build` + `python3 scripts/build-perf/config-check.py .` +- 集成检查: E2E 61/61 + content-lint 0/0/0 + admin 页加载零控制台错误(playwright 预登录态)+ build-status.json 产物断言 + 翻译守卫 dry-run +- 全项目检查: 部署后人工核验后台(登录态表单可编辑/状态条/速通坞/暗色预览);**升级条件**——仅当 Sveltia 升级引致行为差异时升级全站回归,本包已含升级后 E2E 全跑 +- 升级触发: admin 为独立资源面,升级为「后台人工核验」即可 + +### 本轮明确不做的内容 +- 照片摄取管线目录迁移;TMT 凭据变更;评论系统本身 + +## 变更边界 +### 本轮主要改动模块 +- 见 tasks.md 的 boundary 记录 + +### 明确未触碰的区域 +- 照片摄取管线目录迁移;TMT 凭据变更;评论系统本身 + +## 验证证据 +### 备注 +- 机器证据:runs.jsonl(见验证范围的机器验证率) + +## 验证范围 +- 级别:package +- 机器验证率:8/8 +- 规则:check 与 done 复用该范围;只有记录升级触发时才执行全项目检查 + +## 哲学生效证据 +### 行为成效回填 +- Development Record 行为门禁通过 + +### 一致性门禁回顾 +- 验收面(checklist 或成功标准)已通过 + +## Git 记录 +- 日期时间:2026-11-05 20:12 +- 范围:blog-5n:后台深度优化全家桶(14 项全量) +- 功能:task_0001 Sveltia 0.259 升级与回归;task_0002 A1 翻译进构建链;task_0003 A2+A3+A4+C3 表单优化批;task_0004 B1+B2+D1+E1 后台页面批;task_0005 C1 首页设置分组;task_0006 C2 内容仪表盘;task_0007 暗色预览;task_0008 媒体库归置 +- 操作:提交 / 推送 +- 成效:Development Record 行为门禁通过 +- 提交:pending local commit +- 提交区间:a555a3e450cd26a8e53f6ea86009c211b981cce8..a555a3e450cd26a8e53f6ea86009c211b981cce8 +- 推送:not-run (push stage follows commit) + +## AGENTS.md 增量提议 +```diff +后台深度优化全家桶 14 项全量落地:Sveltia 0.259 升级、TMT 翻译进构建链(保存中文即自动出英文)、标签/模板/SEO/中英表单四优化、部署状态条+PWA+速通坞+回滚指引、首页设置分组(Sveltia 嵌套雷区规避 B 案)、内容仪表盘、暗色预览、媒体库归置。多队友协同:@worker-one 领单未达由主会话兜底、4 子代理并行交付(其中 C1 子代理识别出与上午热修的嵌套雷区冲突请示拍板,选 B 案压平)。 +``` + +## 被拒绝的扩展提议 +- 无 + +## 门禁证据 +- check_spec_package.py exit 0 + +## 遗留事项 +- 无;问题处置见下方结构化区块 + +## 问题处置 + +```json +{ + "issues": [], + "version": 1 +} +``` diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh new file mode 100644 index 0000000..3f143c7 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +export PATH="$HOME/.local/node/bin:$PATH" +grep -q '0\.259\.0' public/admin/sveltia-cms.js +node --check public/admin/sveltia-cms.js +grep -c "registerPreviewStyle" public/admin/sveltia-cms.js >/dev/null +pnpm astro build >/dev/null 2>&1 +echo "verify_t1 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh new file mode 100644 index 0000000..17d5686 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +[ -x scripts/deploy/translate-step.sh ] +grep -q "translate-step" infra/deploy/build.sh +grep -q "build-status.json" infra/deploy/build.sh +grep -q "trap 'write_status fail'" infra/deploy/build.sh +bash scripts/deploy/translate-step.sh --dry-run +echo "verify_t2 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh new file mode 100644 index 0000000..5e67930 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +export PATH="$HOME/.local/node/bin:$PATH" +python3 scripts/build-perf/config-check.py . | grep -q 全部通过 +grep -q "≤32 字" public/admin/config.yml +grep -q "60–120 字" public/admin/config.yml +grep -q "避免同义新造" public/admin/config.yml +grep -q "写作模板》复制起手" public/admin/config.yml +grep -q "英文版构建时自动机翻" public/admin/config.yml +echo "verify_t3 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh new file mode 100644 index 0000000..416af3e --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +node --check public/admin/deploy-status.js +grep -q "deploy-status.js" public/admin/index.html +grep -q "quick-dock" public/admin/index.html +grep -q "manifest.webmanifest" public/admin/index.html +grep -q "favicon.svg" public/admin/index.html +[ -f docs/后台回滚指引.md ] +grep -q "一句话版本" docs/后台回滚指引.md +echo "verify_t4 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh new file mode 100644 index 0000000..84c8ac2 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +export PATH="$HOME/.local/node/bin:$PATH" +pnpm astro build >/dev/null 2>&1 +grep -q "tagline\|avatar" dist/index.html +grep -q "identity\|socials" src/content.config.ts +echo "verify_t5 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh new file mode 100644 index 0000000..19cc796 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +export PATH="$HOME/.local/node/bin:$PATH" +pnpm astro build >/dev/null 2>&1 +python3 scripts/build-perf/gen-admin-stats.py dist +[ -f dist/admin/stats.html ] +python3 -c "import json;d=json.load(open('dist/admin/stats.json'));assert d['posts_visible']>0 and 'top_tags' in d" +echo "verify_t6 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh new file mode 100644 index 0000000..e6bc957 --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +node --check public/admin/preview-style.js +grep -q "prefers-color-scheme: dark" public/admin/preview-style.js +python3 -c "import json;m=json.load(open('public/admin/manifest.webmanifest'));assert m['start_url']=='/admin/' and len(m['icons'])==2" +echo "verify_t7 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh new file mode 100644 index 0000000..91ff7cf --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(git rev-parse --show-toplevel)" +export PATH="$HOME/.local/node/bin:$PATH" +python3 scripts/build-perf/config-check.py . | grep -q 全部通过 +grep -q "上传后构建自动优化" public/admin/config.yml +grep -q "媒体" docs/管理台.md +echo "verify_t8 OK" diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/runs.jsonl b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/runs.jsonl new file mode 100644 index 0000000..90d4b2e --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/runs.jsonl @@ -0,0 +1,16 @@ +{"task": "task_0001", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh", "exit": 0, "duration_s": 31.176, "stdout_tail_sha256": "cced3c08cf1601b8177b7728e48c6add6982099d0785fa9fa4dd470b1f4900a5", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:10:50+00:00"} +{"task": "task_0002", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh", "exit": 0, "duration_s": 0.116, "stdout_tail_sha256": "a539567e2a1bad8a450d90a3998841921d5f353cdf8a13cd1dd9499117f71287", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:10:51+00:00"} +{"task": "task_0003", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh", "exit": 0, "duration_s": 0.15, "stdout_tail_sha256": "409ed685a0bde8695328c75cd1e92fb1e54398e22f911a252c1385f2262db9b3", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:10:51+00:00"} +{"task": "task_0004", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh", "exit": 0, "duration_s": 0.048, "stdout_tail_sha256": "8338018e17e2e8b7c9c6aeb8468f164497a332d7b9fbe69a027eec2f3eed2dab", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:10:51+00:00"} +{"task": "task_0005", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh", "exit": 0, "duration_s": 21.431, "stdout_tail_sha256": "99a2c86534e476be7ff3365a14ce028321c3efe5f6849f7831d8c5fe5fc4e6e2", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:11:12+00:00"} +{"task": "task_0006", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh", "exit": 0, "duration_s": 21.644, "stdout_tail_sha256": "625069f2ee6d8e41eb00af14da68816cbe639979296adc0375ffc20780fadf19", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:11:34+00:00"} +{"task": "task_0007", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh", "exit": 0, "duration_s": 0.06, "stdout_tail_sha256": "6d54a7fb09f6d6b7db49450f842bd397759f0aede9ed53b6e2edb0aa67271f6b", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:11:34+00:00"} +{"task": "task_0008", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh", "exit": 0, "duration_s": 0.205, "stdout_tail_sha256": "2f95596c0c69d4a3e9e5e800876d2007624acea62f90b35243c0dc3aa3f737c8", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:11:35+00:00"} +{"task": "task_0001", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh", "exit": 0, "duration_s": 23.758, "stdout_tail_sha256": "cced3c08cf1601b8177b7728e48c6add6982099d0785fa9fa4dd470b1f4900a5", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:11+00:00"} +{"task": "task_0002", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh", "exit": 0, "duration_s": 0.083, "stdout_tail_sha256": "a539567e2a1bad8a450d90a3998841921d5f353cdf8a13cd1dd9499117f71287", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:11+00:00"} +{"task": "task_0003", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh", "exit": 0, "duration_s": 0.146, "stdout_tail_sha256": "409ed685a0bde8695328c75cd1e92fb1e54398e22f911a252c1385f2262db9b3", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:11+00:00"} +{"task": "task_0004", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh", "exit": 0, "duration_s": 0.043, "stdout_tail_sha256": "8338018e17e2e8b7c9c6aeb8468f164497a332d7b9fbe69a027eec2f3eed2dab", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:11+00:00"} +{"task": "task_0005", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh", "exit": 0, "duration_s": 16.974, "stdout_tail_sha256": "99a2c86534e476be7ff3365a14ce028321c3efe5f6849f7831d8c5fe5fc4e6e2", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:28+00:00"} +{"task": "task_0006", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh", "exit": 0, "duration_s": 28.626, "stdout_tail_sha256": "625069f2ee6d8e41eb00af14da68816cbe639979296adc0375ffc20780fadf19", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:57+00:00"} +{"task": "task_0007", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh", "exit": 0, "duration_s": 0.062, "stdout_tail_sha256": "6d54a7fb09f6d6b7db49450f842bd397759f0aede9ed53b6e2edb0aa67271f6b", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:57+00:00"} +{"task": "task_0008", "cmd": "bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh", "exit": 0, "duration_s": 0.172, "stdout_tail_sha256": "2f95596c0c69d4a3e9e5e800876d2007624acea62f90b35243c0dc3aa3f737c8", "tree_fp": "85e5901717ba7746d406493c34a028b8314068453ac38a6f6bfb3606f10c66a8", "at": "2026-11-05T12:12:57+00:00"} diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/spec.md b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/spec.md new file mode 100644 index 0000000..b94aebe --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/spec.md @@ -0,0 +1,80 @@ + +# blog-5n:后台深度优化全家桶(14 项全量) + +- **slug**: 2026-11-05_blog-5n-admin-deep-optimization +- **日期**: 2026-11-05 +- **状态**: 进行中 +- Git integration branch:`spec/2026-11-05_blog-5n-admin-deep-optimization` +- 证据协议:evidence: runs +- **提案**: 用户拍板「全部都做包括暂缓的」:写作链路(A1 翻译进构建链/A2 标签防手滑/A3 起手模板/A4 SEO 提示)、发布反馈(B1 部署状态条/B2 favicon+PWA)、内容管理(C1 首页设置分组/C2 内容仪表盘/C3 中英对照提示)、工具入口(D1 速通坞)、安全网(E1 回滚指引)、暂缓档转正(Sveltia 0.252→0.259 升级、暗色预览、媒体库归置)。多队友协同:@worker-one + 4 子代理 + 主会话集成。 + +## 1. 问题定义 +- **项目目标**: 后台从「功能齐」到「全程顺手」——写作(双语零操作/标签不散/起手不空)、发布(状态可见/入口收拢/回滚有指引)、管理(分组/统计/对照)三条线一步到位;底层 Sveltia 升级到 0.259.0 并全量回归。 +- **目标用户**: 站长(唯一编辑者,高频写作与内容管理) +- **核心价值**: 把这一周散落的「后台不好用」类反馈一次性清零;英文站从手动操作变全自动。 + +## 2. 假设与待确认 + +### 2.1 已确认事实 +- TMT 翻译脚本 translate_posts.py 幂等 + locked 保护,可直接挂构建链 +- Sveltia 最新 0.259.0(registry 核实);本站 bundle 0.252.0 pinned 本地 +- Artalk 评论管理在 https://wait4x.online/artalk;rollback 脚本在 infra/deploy/ 已存在 +- build.sh 为部署链核心(A1/B1/C2 三项都挂它,由主会话统一改避免竞态) + +### 2.2 关键假设 +- Sveltia 0.259 与 0.252 对本站用到的 API(registerEditorComponent/registerPreviewStyle/config schema)兼容(升级后全量回归验证) +- TMT 翻译单篇耗时 < 构建容忍度(守卫超时 180s,失败不阻断部署、保留旧英文版) + +### 2.3 待确认问题 +- [x] 全量范围:用户明确「全部都做包括暂缓的」 +- [x] 协同分工:@worker-one 独立文件 ×2、子代理 ×4(新文件/独立文件)、共享文件(config.yml/index.html/build.sh)主会话独占 +- [x] 媒体库归置取低风险形态:照片目录不动(摄取管线契约),归置=上传落点核对+文档+hints + +### 2.4 可选解释与取舍 +- A2 标签防手滑:若 Sveltia select 无 multiple 则退 list+常用标签 hint(不引自定义 widget) +- A3 起手模板:利用现有隐藏「写作模板」+ Sveltia 条目复制能力 + hint 指引(不建模板机制) +- C1 分组:仅改 home 单例形状(schema+yaml+消费端+后台表单),不动其他单例 + +### 2.5 已证伪路径 +- 无(新增包) + +## 3. 功能范围 + +### 3.1 核心功能(MVP) +- [x] T1 Sveltia 0.259 升级 + 全量回归(三脚本注册/预览/集合加载) +- [x] T2 A1 翻译进构建链(translate-step 守卫 + build.sh 挂载) +- [x] T3 A2+A3+A4+C3 表单优化批(config.yml:标签建议/模板指引/SEO 提示/中英对照) +- [x] T4 B1+B2+D1+E1 后台页面批(状态条/favicon/PWA/速通坞/回滚指引) +- [x] T5 C1 首页设置分组(schema 迁移 + 消费端 + 表单) +- [x] T6 C2 内容仪表盘(构建期统计 + 静态页) +- [x] T7 暗色预览(preview-style.js 双主题) +- [x] T8 媒体库归置(落点核对 + hints + 文档) + +### 3.2 扩展功能 +- 无 + +### 3.3 不在范围内 +- 照片摄取管线目录迁移;TMT 凭据变更;评论系统本身 + +## 4. 最小实现路径 +- 最简可行:新文件优先(守卫脚本/状态条/统计脚本/manifest)+ 共享文件主会话三批统一改(build.sh/config.yml/index.html)+ 升级先行(后续工作全部在新版上验证) +- 暂不引入: 自定义 Sveltia widget 开发、翻译并发加速 +- 不做的抽象: 后台微前端/工具页框架(静态页够用) + +### 5.1 验证策略 +- 范围级别:package +- 变更对象: public/admin 全域 + build.sh + content/site schema + 文档 +- 快速检查: `pnpm astro build` + `python3 scripts/build-perf/config-check.py .` +- 集成检查: E2E 61/61 + content-lint 0/0/0 + admin 页加载零控制台错误(playwright 预登录态)+ build-status.json 产物断言 + 翻译守卫 dry-run +- 全项目检查: 部署后人工核验后台(登录态表单可编辑/状态条/速通坞/暗色预览);**升级条件**——仅当 Sveltia 升级引致行为差异时升级全站回归,本包已含升级后 E2E 全跑 +- 升级触发: admin 为独立资源面,升级为「后台人工核验」即可 + +## 6. 成功标准与验证方式 +- [x] Sveltia 0.259 上线且三脚本/预览/表单全可用 -> verify: task_0001 +- [x] 中文保存→英文自动出(守卫不阻断)-> verify: task_0002 +- [x] 表单四优化与页面四件套生效 -> verify: task_0003 + task_0004 +- [x] 首页分组/仪表盘/暗色预览/媒体归置落地 -> verify: task_0005..task_0008 + +## 7. 关联与风险 +- 最大风险 = Sveltia 升级破坏现有定制(三脚本 API 面);缓解:升级后立即 playwright 冒烟 + 生产灰度观察,异常即回滚 bundle(git revert 单文件) +- 翻译挂链风险 = TMT 配额/网络抖动;缓解:守卫永不阻断 + last-good 英文版保留 diff --git a/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/tasks.md b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/tasks.md new file mode 100644 index 0000000..4973fdb --- /dev/null +++ b/.spec/specs/archive/2026-11-05_blog-5n-admin-deep-optimization/tasks.md @@ -0,0 +1,47 @@ +# Phase 5n:后台深度优化全家桶 - 任务拆解 + +## 使用规则 +- 共享文件(public/admin/config.yml、public/admin/index.html、infra/deploy/build.sh)仅主会话编辑,队友产出片段/新文件 +- E2E 口径:`pnpm astro build → gz-server.py 18925 → E2E_BASE=http://127.0.0.1:18925 node tests/e2e.mjs`(基线 61) + +## 阶段一:实现 + +- [x] task_0001 Sveltia 0.259 升级与回归 + - claim: orchestrator + - boundary: public/admin/sveltia-cms.js(bundle 置换) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t1.sh` + +- [x] task_0002 A1 翻译进构建链 + - claim: orchestrator + worker-one + - boundary: scripts/deploy/translate-step.sh(新,worker-one)、infra/deploy/build.sh(主会话挂载) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t2.sh` + +- [x] task_0003 A2+A3+A4+C3 表单优化批 + - claim: orchestrator + - boundary: public/admin/config.yml(标签/模板指引/SEO/中英 hint)、content/posts/writing-template.md + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t3.sh` + +- [x] task_0004 B1+B2+D1+E1 后台页面批 + - claim: orchestrator + worker-one + 子代理 + - boundary: public/admin/deploy-status.js(新,子代理)、public/admin/manifest.webmanifest(新,子代理)、docs/后台回滚指引.md(新,worker-one)、public/admin/index.html(主会话接线) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t4.sh` + +- [x] task_0005 C1 首页设置分组 + - claim: orchestrator + 子代理 + - boundary: src/content.config.ts(siteHome schema)、content/site/home.yaml、src/lib/site-content.ts(消费端)、public/admin/config.yml(home 条目,主会话拼装子代理片段) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t5.sh` + +- [x] task_0006 C2 内容仪表盘 + - claim: 子代理 + - boundary: scripts/build-perf/gen-admin-stats.mjs(新)、infra/deploy/build.sh 挂载(主会话) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t6.sh` + +- [x] task_0007 暗色预览 + - claim: 子代理 + - boundary: public/admin/preview-style.js(双主题改造) + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t7.sh` + +- [x] task_0008 媒体库归置 + - claim: orchestrator + - boundary: public/admin/config.yml(media_folder hints)、docs/管理台.md + - verify: `bash .spec/specs/2026-11-05_blog-5n-admin-deep-optimization/evidence/verify_t8.sh` diff --git a/content/posts/writing-template.md b/content/posts/writing-template.md index c31349a..22a4242 100644 --- a/content/posts/writing-template.md +++ b/content/posts/writing-template.md @@ -6,7 +6,7 @@ tags: - 写作 - 模板 pinned: true -description: 一篇文章演示全站可用的排版能力:标题层级、彩色强调、字族、引用、代码窗、表格、图、链接卡、折叠。复制它开始写新文。 +description: 「复制起手」母版(后台可见、前台隐藏):演示全站排版能力——标题层级、彩色强调、字族、引用、代码窗、表格、图、链接卡、折叠。新文章从它 Duplicate 开始。 hidden: true draft: false hiddenTag: true diff --git a/content/site/home.yaml b/content/site/home.yaml index 8fa01ac..a2335b2 100644 --- a/content/site/home.yaml +++ b/content/site/home.yaml @@ -1,15 +1,17 @@ -tagline: - zh: 拥抱开源,热爱开源 - en: Embracing open source, loving open source. -latestPhotos: 4 -perTrackLimit: 6 -sections: - tracks: true - photos: true - heatmap: true - projects: true -avatar: ./assets/118a04cd0986b9c5.jpg -favicon: assets/118a04cd0986b9c5.jpg +# 5n C1 后台折叠分组:平铺字段收进 identity/copy/content 三个可选组(组内压平叶子),socials 顶层原位。 +# 旧→新映射见 src/content.config.ts 的 siteHome schema 注释;本次迁移值逐字保留,零功能变化。 +identity: + tagline_zh: 拥抱开源,热爱开源 + tagline_en: Embracing open source, loving open source. + avatar: ./assets/118a04cd0986b9c5.jpg + favicon: assets/118a04cd0986b9c5.jpg +content: + latestPhotos: 4 + perTrackLimit: 6 + sections_tracks: true + sections_photos: true + sections_heatmap: true + sections_projects: true socials: - label: GitHub url: https://github.com/wait4xx diff --git a/docs/后台回滚指引.md b/docs/后台回滚指引.md new file mode 100644 index 0000000..bca71b8 --- /dev/null +++ b/docs/后台回滚指引.md @@ -0,0 +1,26 @@ +# 后台回滚指引 + +> **一句话版本**:改坏了内容 → 后台再保存一次对的就好;整次部署坏了 → Gitea 网页里把坏提交 Revert 掉;全站级灾难 → 找主理人执行灾备开关。 + +## 什么时候需要哪一层 + +| 情形 | 用什么 | 频率预期 | +|---|---|---| +| 某篇文章/瞬间/设置改坏了 | **后台再改一次**(Git 只是保险,不是日常工具) | 常见 | +| 一次部署把多处弄坏、说不清单点 | **Gitea 网页 Revert**(下面三步) | 偶发 | +| 静态站整体故障无法快速修复 | 灾备开关切回旧 Halo(仅主理人执行,见文末) | 理论上不会 | + +## Gitea 网页 Revert 三步 + +1. 打开提交历史:https://git.wait4x.online/wait4x/blog/commits/branch/main + (每次后台「保存」都是一条提交,时间与描述能对上) +2. 点开**弄坏的那条提交** → 右上角 **Revert** 按钮 → 确认。Gitea 会自动生成一条反向提交并提示创建 PR/直接合并——选择直接合并到 `main` +3. 推送后 30–60 秒自动构建部署,站点回到坏提交**之前**的状态 + +注意: +- Revert 撤销的是**整条提交**(那一次保存改动的所有内容)。如果好改动和坏改动混在同一次保存里,别 Revert,回后台把坏的部分再改回来更精准 +- 只想回退构建但保留内容?不存在这种需求场景——构建永远反映 main 最新状态 + +## 灾备开关(仅主理人) + +`infra/deploy/rollback.sh` 是**整站切换**:把 nginx 从静态站切回旧 Halo(127.0.0.1:18090),秒级生效。这是静态站全面故障时的逃生通道,日常内容问题永远用不上它。预演:`bash infra/deploy/rollback.sh`(默认 dry-run);执行需 root + `--exec`。 diff --git a/docs/管理台.md b/docs/管理台.md index 173ed45..c66d6e3 100644 --- a/docs/管理台.md +++ b/docs/管理台.md @@ -240,3 +240,18 @@ token 位在 `~/docker_apps/blog/github-token.txt`(本机,0600)。 - 启动时探测 /api/forgejo 报 404 属良性回落(日志噪音,无影响) - 大视频仍走仓外 store + /media/ 绝对路径(见写作指南体积纪律表) + + +## 媒体文件落点地图(5n 归置) + +上传的文件各归各位,不用记——表里的「落点」由后台自动处理: + +| 在哪上传 | 落到仓库哪 | 网页上从哪读 | +|---|---|---| +| 文章封面/文内图 | content/posts/assets/ | 构建期自动优化为 WebP | +| 瞬间配图 | 同上(按集合相对路径) | 同上 | +| 主页头像/关于页图 | content/site/assets/ | 构建期优化 | +| 站点图标 favicon | public/icons/ | 原样分发 | +| 图库照片 | content/photos/(摄取管线) | 灯箱走原图、列表走优化图 | + +「媒体库」页面(后台左侧 Media)列出的是图库照片目录。要找某篇文章的配图,直接进那篇文章的编辑页点开图片字段即可。 diff --git a/infra/deploy/build.sh b/infra/deploy/build.sh index 72479e5..a41e9f7 100755 --- a/infra/deploy/build.sh +++ b/infra/deploy/build.sh @@ -27,7 +27,20 @@ git clean -fd --exclude node_modules SHA=$(git rev-parse --short HEAD) echo "[build] 构建源: origin/main @ $SHA" +# 5n B1:构建状态生命周期(后台 /admin/deploy-status.js 轮询 /admin/build-status.json)。 +# building 态写在 rsync 前(此时 staging 仍服务上一版),ok 态写在末尾并解除 trap; +# 任何中途退出(set -e 炸链)由 trap 兜底写 fail——状态文件每次 rsync 后重写,不依赖 dist +mkdir -p "$STAGING/admin" 2>/dev/null || true +write_status() { printf '{"sha":"%s","time":"%s","state":"%s","pages":%s}\n' "$SHA" "$(date -Is)" "$1" "${2:-0}" > "$STAGING/admin/build-status.json" 2>/dev/null || true; } +trap 'write_status fail' EXIT +write_status building + pnpm install --frozen-lockfile >/dev/null + +# 5n A1:TMT 翻译先于构建(译文进 content/posts-en/,随同一次部署上线)。 +# 守卫先行 + 守卫自身永不阻断(超时/无凭据/失败都只 WARN 并保留旧英文版) +[ -f scripts/deploy/translate-step.sh ] && bash scripts/deploy/translate-step.sh || echo "[build] translate-step 未就绪,跳过" + pnpm astro build # 按页字体 CSS 子集化(车道 A 任务 1):裁 @font-face 声明数,构建仓与本地同链; @@ -39,6 +52,9 @@ pnpm astro build [ -f scripts/build-perf/gen-sw-precache.mjs ] && node scripts/build-perf/gen-sw-precache.mjs dist || echo "[build] sw-precache 生成器未就绪,跳过" [ -f scripts/build-perf/inline-home-css.mjs ] && node scripts/build-perf/inline-home-css.mjs || echo "[build] inline-home 脚本未就绪,跳过" +# 5n C2:内容仪表盘(产物 dist/admin/stats.{html,json},随 rsync 上线) +[ -f scripts/build-perf/gen-admin-stats.py ] && python3 scripts/build-perf/gen-admin-stats.py dist || echo "[build] stats 生成器未就绪,跳过" + # README 动效资产(5i 引入、5j T2 退役):贡献蛇与 streak 快照已删——连续贡献改为 # 热力图同源本地计算(见 src/lib/heatmap.ts 的 streakStats),界面上标注"数据更新于"。 # fetch-readme-assets.mjs 保留骨架但 ASSETS 已清空,如将来要加新的自托管资产再启用。 @@ -52,7 +68,10 @@ rsync -a --delete "$BUILD_REPO/dist/" "$STAGING/" ORIG="$HOME/docker_apps/blog/photos-originals" if [ -d "$ORIG" ]; then rsync -a "$ORIG/" "$STAGING/photos-originals/"; fi printf 'built %s at %s\n' "$SHA" "$(date -Is)" > "$STAGING/.build-stamp" -echo "[build] done: $(find "$STAGING" -name '*.html' | wc -l) html files @ $SHA" +PAGES=$(find "$STAGING" -name '*.html' | wc -l) +echo "[build] done: $PAGES html files @ $SHA" +write_status ok "$PAGES" +trap - EXIT # 生产冒烟(T3):staging 三断言。首版容忍失败(robots 待 T1 落地,smoke FAIL 属预期), # T1 收编后改硬门:去掉 `|| echo` 让断言失败直接炸构建 diff --git a/public/admin/config.yml b/public/admin/config.yml index 6aa4420..bc1cdf1 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -24,6 +24,7 @@ collections: label_singular: 文章 folder: content/posts create: true + hint: 新文章可从置顶的《写作模板》复制起手(列表打开模板 → ⋯ 菜单 → Duplicate);英文版构建时自动机翻上线,无需在此维护 # 中文主稿;英文为 TMT 预翻译入仓的 .en.md(posts-en 集合不在后台,防误改译文) slug: '{{slug}}' summary: '{{pubDate}} · {{title}}' @@ -34,14 +35,14 @@ collections: media_folder: assets public_folder: ./assets fields: - - { label: 标题, name: title, widget: string } + - { label: 标题, name: title, widget: string, hint: '建议 ≤32 字(搜索结果超长会截断)' } - { label: 日期, name: pubDate, widget: datetime, date_format: 'YYYY-MM-DD', time_format: false, format: 'YYYY-MM-DD' } - { label: 分轨, name: category, widget: select, options: [{label: 阅读, value: reading}, {label: 技术, value: tech}, {label: 照片, value: photo}] } - - { label: 标签, name: tags, widget: list, required: true, hint: '至少一个(可写 read/写作/站点更新等);schema 必填,漏了构建会拦' } + - { label: 标签, name: tags, widget: list, required: true, hint: '至少一个;优先复用现有标签:read(书评)/ 写作 / 站点更新——避免同义新造(如 阅读/read 分家);schema 必填,漏了构建会拦' } - { label: 置顶, name: pinned, widget: boolean, required: false, default: false, hint: '置顶文章排在首页/归档/书架最前;只影响顺序,不改日期、URL 与 RSS 时间语义' } - { label: 情绪色(书评色脊), name: mood, widget: color, required: false, hint: '#RRGGBB,仅阅读轨使用' } - { label: 原书作者, name: bookAuthor, widget: string, required: false } - - { label: 一句话描述(书架策展语), name: description, widget: text, required: false } + - { label: 一句话描述(书架策展语), name: description, widget: text, required: false, hint: '60–120 字最佳(搜索摘要与列表导语共用)' } - { label: 书封图, name: cover, widget: image, required: false, hint: '上传后自动生成,无需手填路径;仅阅读轨展示' } - label: 附视频(可选) name: video @@ -108,7 +109,7 @@ collections: widget: markdown required: false hint: '与图片至少填一项。支持 markdown 与排版类 HTML,例如 彩色+楷体;选中文字 → Insert ▸ 排版 可视化选字体/颜色(预览窗格直接显色显字体)。装饰色仍守“外壳灰阶、彩色只作强调”的纪律' - - { label: 图片, name: image, widget: image, required: false, hint: '与文字至少填一项;建议先压缩' } + - { label: 图片, name: image, widget: image, required: false, hint: '与文字至少填一项;上传后构建自动优化(WebP),原图无需手工压缩' } - label: 标签 name: tags widget: list @@ -185,96 +186,82 @@ collections: media_folder: assets public_folder: ./assets fields: - - label: 身份语 - name: tagline + - label: 身份名片 + name: identity widget: object required: false - hint: 首页大字身份语(双语,markdown 富文本);可写 … 做局部强调 + collapsed: true + hint: 头像、身份语、副标题与站点图标(首页名片区 + 浏览器标签图标) fields: - - { label: 中文, name: zh, widget: string, required: false } - - { label: 英文, name: en, widget: string, required: false } - - label: 页面排版覆盖(可选) - name: typography + - { label: 身份语(中文), name: tagline_zh, widget: string, required: false, hint: '首页大字身份语(markdown 富文本);可写 … 做局部强调' } + - { label: 身份语(英文), name: tagline_en, widget: string, required: false } + - { label: 副标题(中文,markdown 短文本), name: subtitle_zh, widget: string, required: false, hint: '渲染在身份语下方;留空不渲染' } + - { label: 副标题(英文), name: subtitle_en, widget: string, required: false } + - label: 头像(可选) + name: avatar + widget: image + required: false + hint: '留空 = 内置渐变占位;上传后自动优化为 60px WebP' + - label: 站点图标 favicon + name: favicon + widget: image + required: false + # media_folder 按 file 集合语义相对 content/site/ 解析(写 content/site/assets 会嵌套翻倍——5l 实测教训) + media_folder: ../../public/icons + public_folder: /icons + hint: '直接上传 .svg/.ico/.png(建议 64–512px 方图);留空回退 /favicon.svg' + - label: 文案与排版 + name: copy widget: object required: false - hint: 本页正文默认字体 / 强调色 / 字号缩放(0.8–1.25);不填用全站默认,只影响本页 + collapsed: true + hint: 公告(渲染在名片区下方,留空不显示)+ 页面排版覆盖(本页正文默认字体/强调色/字号缩放,不填用全站默认,只影响主页) fields: + - { label: 公告(中文,markdown), name: announcement_zh, widget: markdown, required: false, hint: '渲染在名片区下方;留空则不显示公告块' } + - { label: 公告(英文), name: announcement_en, widget: markdown, required: false } - label: 正文字体类 - name: font + name: typography_font widget: select required: false hint: 整页正文换字族;艺术/展示类字族体积大。5i 新增六款(小薇/庆科黄油/马善政/柳建毛草/得意黑/新晰黑)均按站内用字切片,单页增量 27–46KB;站外用字(生僻字)会回落系统字族,需按 docs 里的命令重切 options: [font-serif, font-kai, font-sans, font-mono, font-song, font-kai-sys, font-hei-sys, font-fangsong, font-huiwen, font-kuaile, font-xiaowei, font-huangyou, font-mashanzheng, font-liujianmaocao, font-smiley, font-neoxihei] - label: 强调色类 - name: accent + name: typography_accent widget: select required: false options: [ink-accent, ink-accent-soft, c-blue, c-blue-soft, c-teal, c-teal-soft, c-green, c-green-soft, c-yellow, c-yellow-soft, c-orange, c-orange-soft, c-red, c-red-soft, c-pink, c-pink-soft, c-purple, c-purple-soft] - - { label: 字号缩放, name: scale, widget: number, required: false, value_type: float, min: 0.8, max: 1.25, step: 0.05, hint: '0.8–1.25;1 = 全站默认' } - - label: 公告(可选,markdown) - name: announcement + - { label: 字号缩放, name: typography_scale, widget: number, required: false, value_type: float, min: 0.8, max: 1.25, step: 0.05, hint: '0.8–1.25;1 = 全站默认' } + - label: 内容与开关 + name: content widget: object required: false - hint: 渲染在名片区下方;留空则不显示公告块 + collapsed: true + hint: 各区块条数与显隐开关;关掉的区块不渲染,越界数值自动夹取(默认 = 现状) fields: - - { label: 中文, name: zh, widget: markdown, required: false } - - { label: 英文, name: en, widget: markdown, required: false } - - { label: 项目墙条数, name: projectsLimit, widget: number, required: false, value_type: int, min: 1, max: 99, hint: '首页项目墙显示几条(1–99,缺省 6)' } - - label: 轨细分开关(首页文章列表) - name: postsTracks - widget: object - required: false - hint: 关掉某轨则该轨文章不在首页列出(全开=现状) - fields: - - { label: 阅读轨, name: reading, widget: boolean, required: false, default: true } - - { label: 技术轨, name: tech, widget: boolean, required: false, default: true } - - { label: 照片轨, name: photo, widget: boolean, required: false, default: true } - - label: 副标题(可选,markdown 短文本) - name: subtitle - widget: object - hint: 渲染在身份语下方;留空不渲染 - fields: - - { label: 中文, name: zh, widget: string, required: false } - - { label: 英文, name: en, widget: string, required: false } - - label: 最新影像张数 - name: latestPhotos - widget: number - required: false - default: 4 - min: 0 - max: 6 - hint: '1-6;填 0 = 隐藏「最新影像」区块。留空默认 4' - - label: 首页每轨文章条数 - name: perTrackLimit - widget: number - required: false - default: 6 - min: 4 - max: 8 - hint: 阅读轨/技术轨各显示条数,留空默认 6 - - label: 区块开关 - name: sections - widget: object - required: false - hint: 关掉的区块不渲染(默认全开) - fields: - - { label: 文章列表, name: tracks, widget: boolean, required: false, default: true } - - { label: 最新影像, name: photos, widget: boolean, required: false, default: true } - - { label: 贡献热力图, name: heatmap, widget: boolean, required: false, default: true } - - { label: 项目墙, name: projects, widget: boolean, required: false, default: true } - - label: 头像(可选) - name: avatar - widget: image - required: false - hint: '留空 = 内置渐变占位;上传后自动优化为 60px WebP' - - label: 站点图标 favicon - name: favicon - widget: image - required: false - # media_folder 按 file 集合语义相对 content/site/ 解析(写 content/site/assets 会嵌套翻倍——5l 实测教训) - media_folder: ../../public/icons - public_folder: /icons - hint: '直接上传 .svg/.ico/.png(建议 64–512px 方图);留空回退 /favicon.svg' + - label: 最新影像张数 + name: latestPhotos + widget: number + required: false + default: 4 + min: 0 + max: 6 + hint: '1-6;填 0 = 隐藏「最新影像」区块。留空默认 4' + - label: 首页每轨文章条数 + name: perTrackLimit + widget: number + required: false + default: 6 + min: 4 + max: 8 + hint: 阅读轨/技术轨各显示条数,留空默认 6 + - { label: 项目墙条数, name: projectsLimit, widget: number, required: false, value_type: int, min: 1, max: 99, hint: '首页项目墙显示几条(1–99,缺省 6)' } + - { label: 阅读轨, name: postsTracks_reading, widget: boolean, required: false, default: true, hint: '关掉则阅读轨文章不在首页列出(归档页仍可见);三轨全开 = 现状' } + - { label: 技术轨, name: postsTracks_tech, widget: boolean, required: false, default: true } + - { label: 照片轨, name: postsTracks_photo, widget: boolean, required: false, default: true } + - { label: 显示文章列表, name: sections_tracks, widget: boolean, required: false, default: true } + - { label: 显示最新影像, name: sections_photos, widget: boolean, required: false, default: true } + - { label: 显示贡献热力图, name: sections_heatmap, widget: boolean, required: false, default: true } + - { label: 显示项目墙, name: sections_projects, widget: boolean, required: false, default: true } - label: 社交链接(顺序即展示顺序) name: socials widget: list @@ -289,6 +276,7 @@ collections: required: false options: [github, rss, email, bilibili, x] hint: '不在列表里的留空 → 显示纯文字按钮' + - name: about label: 关于页 file: content/site/about.yaml diff --git a/public/admin/deploy-status.js b/public/admin/deploy-status.js new file mode 100644 index 0000000..20b42b4 --- /dev/null +++ b/public/admin/deploy-status.js @@ -0,0 +1,161 @@ +/** + * 后台部署状态条(5n B1):Sveltia 管理页右下角浮层,轮询站点构建状态。 + * spec:.spec/specs/2026-11-05_blog-5n-admin-deep-optimization(T4) + * + * JSON 接口契约(build.sh 每次部署写 /admin/build-status.json): + * { "sha": "a555a3e…", // 部署 commit(展示取前 7 位) + * "time": "2026-11-05T19:20:25+08:00", // 构建完成时刻(展示取 HH:MM) + * "state": "ok" | "building" | "fail", + * "pages": 53 } // 页面数(仪表盘消费,本条不读) + * 文件缺失 / 响应非 200 / JSON 解析失败 / state 非法 → 视为「不可知」: + * 胶囊淡出、不报错,下一轮照常再试——状态条是增益件,接口坏了不能吵主人。 + * + * 为什么轮询而不是 SSE/WebSocket:本站是纯静态托管(CDN 上没有可驻留的 + * 服务端进程,无推送通道);「保存→看部署结果」的节奏里 10s 间隔已足够 + * 感知,且零服务端成本、零额外基础设施。 + */ +(function () { + 'use strict'; + + if (window.DEPLOY_STATUS) return; // 防重复初始化:脚本被引入两次时静默退出 + var POLL_MS = 10000; + var timer = null; // null = 停表中(初始 / 页面隐藏) + + var STATES = { + ok: { bg: 'rgba(28,30,34,.92)', label: '已上线' }, + building: { bg: 'rgba(52,84,209,.92)', label: '构建中…' }, + fail: { bg: 'rgba(179,32,32,.92)', label: '构建失败' }, + }; + + /** 构建中呼吸动画的 keyframes 无法用元素内联样式表达,注入一次 - + + @@ -20,5 +40,7 @@ + + diff --git a/public/admin/manifest.webmanifest b/public/admin/manifest.webmanifest new file mode 100644 index 0000000..5f83405 --- /dev/null +++ b/public/admin/manifest.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "wait4x 后台", + "short_name": "后台", + "start_url": "/admin/", + "scope": "/admin/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#3454d1", + "icons": [ + { + "src": "/icons/icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/icons/icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/public/admin/preview-style.js b/public/admin/preview-style.js index 909b0ec..d90787f 100644 --- a/public/admin/preview-style.js +++ b/public/admin/preview-style.js @@ -1,5 +1,5 @@ /** - * 后台预览一致性(5l T1):把站点排版效果注入 Sveltia 预览窗格。 + * 后台预览一致性(5l T1 / 5n T7):把站点排版效果注入 Sveltia 预览窗格。 * * 现状问题:markdown 里的排版类(font- 字体、c-/ink- 颜色)在预览里是素文本—— * 类名随 DOM 保留(typography-editor 的 toPreview 输出带 class),但预览 @@ -12,6 +12,10 @@ * 2. 自托管艺术字体挂切片 CSS(public/fonts//fonts.css, * unicode-range 按需取片——预览里只拉用到的字所落在的切片,不整包)。 * + * 暗色(5n T7):所有色值走 CSS 自定义属性,变量缺省值 = 亮态(与改造前同一批 + * 字面量,无暗色命中时逐字节等价),末尾一段 @media (prefers-color-scheme: dark) + * 统一换档——后台切暗色时预览不再用亮态色值配暗底。 + * * serif/kai/kuaile 的 CSS 经 Vite ?url 打包成哈希名,后台引不到稳定 URL, * 预览走字体栈里的系统回退(Kaiti SC/Songti)——近似可见,文档已注明。 * 加载顺序:须在 typography-classes.js 之后、CMS init 之前(index.html 固定序)。 @@ -20,30 +24,96 @@ const CLASSES = window.TYPOGRAPHY_CLASSES; if (!CLASSES || !window.CMS || !window.CMS.registerPreviewStyle) return; + /** + * 基础排版的暗态值(亮态值不在这里登记,直接作各条 var() 的回落值)。 + * 出处:src/styles/tokens.css `[data-theme="dark"]` 段,勿凭观感改。 + */ + const BASE_DARK = { + 'pv-accent': '#8ea2ff', // --accent + 'pv-line': '#262b33', // --line(站点暗色分隔线就是这个档) + 'pv-quote-ink': '#8b8f98', // --ink-3 + 'pv-code-bg': '#1f242b', // --bg-soft + }; + + /** + * 颜色类暗态值,键 = typography-classes.js 里的 cls。同样取自暗色 tokens 段: + * 站点语义色板暗态是独立取值(不是亮态加亮),硬套亮态在 #191d23 底上不达 AA。 + */ + const CLASS_DARK = { + 'ink-1': '#f5f5f7', // --ink-1 + 'ink-2': '#c9ccd4', // --ink-2 + 'ink-3': '#8b8f98', // --ink-3 + // 站点 CSS 里 ink-muted 映射 --ink-4,而暗态 --ink-4 (#5c6066) 是装饰档, + // 暗底上近乎不可见;亮态 swatch 本就取的是 --ink-faint 的值,暗态随之一致 + 'ink-muted': '#84888f', // --ink-faint + 'ink-warm': '#d6cbbd', // --ink-warm + 'ink-cool': '#b9c6d6', // --ink-cool + 'ink-faint': '#84888f', // --ink-faint + 'ink-accent': '#8ea2ff', // --accent + 'ink-accent-soft': '#a8b7f7', // --accent-soft-text + 'c-blue': '#7fb0ff', + 'c-blue-soft': '#3381ff', + 'c-teal': '#6fd6c8', + 'c-teal-soft': '#2a9384', + 'c-green': '#7ddf99', + 'c-green-soft': '#269a47', + 'c-yellow': '#ffd166', + 'c-yellow-soft': '#af7a00', + 'c-orange': '#ffb163', + 'c-orange-soft': '#d16800', + 'c-red': '#ff8b8b', + 'c-red-soft': '#ff2828', + 'c-pink': '#ff9ecb', + 'c-pink-soft': '#ff0d7e', + 'c-purple': '#c4a6ff', + 'c-purple-soft': '#9a67ff', + }; + + /** + * 未登记暗态值的类(清单后续新增)用 color-mix 提亮近似——宁可偏亮, + * 也不要暗底上跑亮态深色(那是这次要修的问题本身)。 + */ + const approxDark = (swatch) => `color-mix(in oklab, ${swatch} 82%, #fff)`; + /** 预览基调:近似站点 .rich 的通用排版(目标是类效果可见,非像素级还原) */ const baseCss = [ 'p{margin:.6em 0;line-height:1.75}', 'h1,h2,h3,h4{font-weight:600;line-height:1.4;margin:1.2em 0 .5em}', 'h2{font-size:1.3em}h3{font-size:1.15em}', 'ul,ol{padding-left:1.5em;margin:.6em 0}li{margin:.25em 0}', - 'a{color:#3454d1;text-decoration:underline}', - 'blockquote{margin:.8em 0;padding:.2em 1em;border-left:3px solid #e6e7eb;color:#6b6e78}', - "code{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.92em;background:#f2f3f5;padding:.1em .35em;border-radius:4px}", + 'a{color:var(--pv-accent,#3454d1);text-decoration:underline}', + 'blockquote{margin:.8em 0;padding:.2em 1em;border-left:3px solid var(--pv-line,#e6e7eb);color:var(--pv-quote-ink,#6b6e78)}', + "code{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.92em;background:var(--pv-code-bg,#f2f3f5);padding:.1em .35em;border-radius:4px}", 'img{max-width:100%}', - 'hr{border:none;border-top:1px solid #e6e7eb;margin:1.5em 0}', + 'hr{border:none;border-top:1px solid var(--pv-line,#e6e7eb);margin:1.5em 0}', 'strong{font-weight:700}', ].join(''); - /** 排版类规则:清单驱动(swatch/ family 即预览所用值,亮态口径) */ + /** 排版类规则:清单驱动(swatch/family 亮态值作 var() 回落 = 面板所见) */ const rules = []; + const darkDecls = []; for (const f of CLASSES.font || []) { if (f.family) rules.push(`.${f.cls}{font-family:${f.family}}`); } for (const c of CLASSES.color || []) { - if (c.swatch) rules.push(`.${c.cls}{color:${c.swatch}}`); + if (!c.swatch) continue; + const name = `--pv-${c.cls}`; + rules.push(`.${c.cls}{color:var(${name},${c.swatch})}`); + darkDecls.push(`${name}:${CLASS_DARK[c.cls] || approxDark(c.swatch)}`); } + for (const [name, value] of Object.entries(BASE_DARK)) darkDecls.push(`--${name}:${value}`); - window.CMS.registerPreviewStyle(baseCss + rules.join(''), { raw: true }); + /** + * 为什么用媒体查询而不是监听「后台切主题」:Sveltia 的 registerPreviewStyle 是 + * 一次性注入(无更新/移除接口),registerEventListener 只支持 pre/postSave 与 + * pre/postPublish 这类保存事件,没有任何主题切换回调;后台主题默认跟随系统, + * 预览文档的 prefers-color-scheme 与后台同源,浏览器自己换档即可,零重注入。 + * 代价:用户在后台显式选 light 而系统是 dark 时预览偏暗——已知取舍,比监听 + * Sveltia 内部 DOM(非公开契约)稳妥。 + */ + const darkCss = darkDecls.length ? `@media (prefers-color-scheme: dark){:root{${darkDecls.join(';')}}}` : ''; + + window.CMS.registerPreviewStyle(baseCss + rules.join('') + darkCss, { raw: true }); // 字体切片(URL 模式):预览文档自己的 @font-face;去重后逐个挂 const seen = new Set(); diff --git a/public/admin/sveltia-cms.js b/public/admin/sveltia-cms.js index 02f5dde..52f45e8 100644 --- a/public/admin/sveltia-cms.js +++ b/public/admin/sveltia-cms.js @@ -8,7 +8,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=d()})),p=s(((e,t)=>{ +var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=d()})),p=s(((e,t)=>{ /* object-assign (c) Sindre Sorhus @@ -19,55 +19,61 @@ var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.pr function g(e,t){this.v=e,this.k=t}function _(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2?n-2:0),i=2;i1?t-1:0),r=1;r`u`?null:Ne(BigInt.prototype.toString),Oe=typeof Symbol>`u`?null:Ne(Symbol.prototype.toString),ke=Ne(Object.prototype.hasOwnProperty),Ae=Ne(Object.prototype.toString),je=Ne(RegExp.prototype.test),Me=Pe(TypeError);function Ne(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:ye;if(T&&T(e,null),!he(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ee(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ie(e){for(let t=0;t/g),tt=ie(/\${[\w\W]*/g),nt=ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),rt=ie(/^aria-[\-\w]+$/),it=ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),at=ie(/^(?:\w+script|data):/i),eee=ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ot=ie(/^html$/i),tee=ie(/^[a-z][.\w]*(-[.\w]+)+$/i),st=ie(/<[/\w!]/g),ct=ie(/<[/\w]/g),nee=ie(/<\/no(script|embed|frames)/i),lt=ie(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ree=re(Fe({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),iee=function(){return typeof window>`u`?null:window},aee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(e,t,n,r){return ke(e,t)&&he(e[t])?Fe(r.base?Le(r.base):{},e[t],r.transform):n},pt=function(e,t,n){let r=ke(e,t)?e[t]:void 0;return r&&typeof r==`object`?Le(r):n()};function mt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iee(),t=e=>mt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==ut.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=ze(d,`cloneNode`),p=ze(d,`remove`),m=ze(d,`removeAttributeNode`),h=ze(d,`nextSibling`),g=ze(d,`childNodes`),_=ze(d,`parentNode`),v=ze(d,`shadowRoot`),y=ze(d,`attributes`),b=o&&o.prototype?ze(o.prototype,`nodeType`):null,x=o&&o.prototype?ze(o.prototype,`nodeName`):null,S=o&&o.prototype?ze(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=Be(d,`namespaceURI`),te=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ne,oe=``,se,ce=!1,Te=0,Ee=function(){if(Te>0)throw Me(`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.`)},De=function(e){Ee(),Te++;try{return ne.createHTML(e)}finally{Te--}},Oe=function(e){Ee(),Te++;try{return ne.createScriptURL(e)}finally{Te--}},Ae=function(){return ce||=(se=aee(u,i),!0),se},Ne=n,Pe=Ne.implementation,Ie=Ne.createNodeIterator,ht=Ne.createDocumentFragment,gt=Ne.getElementsByTagName,_t=r.importNode,vt=dt();t.isSupported=typeof w==`function`&&typeof _==`function`&&Pe&&Pe.createHTMLDocument!==void 0;let yt=$e,bt=et,xt=tt,St=nt,Ct=rt,wt=at,Tt=eee,oee=tee,Et=it,Dt=null,Ot=Fe({},[...He,...Ue,...We,...Ke,...Je]),kt=null,At=Fe({},[...Ye,...Xe,...Ze,...Qe]),jt=Object.seal(ae(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}})),Mt=null,Nt=null,Pt=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ft=!0,It=!0,Lt=!1,Rt=!0,zt=!1,Bt=!0,Vt=!1,Ht=!1,Ut=null,Wt=null,Gt=!1,Kt=!1,qt=!1,Jt=!1,Yt=!0,Xt=!1,Zt=`user-content-`,Qt=!0,$t=!1,en=null,tn={},nn=null,rn=Fe({},`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`.split(`.`)),an=null,on=Fe({},[`audio`,`video`,`img`,`source`,`image`,`track`]),sn=null,cn=Fe({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),ln=`http://www.w3.org/1998/Math/MathML`,un=`http://www.w3.org/2000/svg`,dn=`http://www.w3.org/1999/xhtml`,fn=dn,pn=!1,mn=null,see=Fe({},[ln,un,dn],be),hn=re([`mi`,`mo`,`mn`,`ms`,`mtext`]),gn=Fe({},hn),_n=re([`annotation-xml`]),vn=Fe({},_n),yn=Fe({},[`title`,`style`,`font`,`a`,`script`]),bn=null,xn=[`application/xhtml+xml`,`text/html`],Sn=null,Cn=null,wn=n.createElement(`form`),Tn=function(e){return e instanceof RegExp||e instanceof Function},En=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Cn&&Cn===e)return;e&&typeof e==`object`||(e={}),e=Le(e),bn=xn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Sn=bn===`application/xhtml+xml`?be:ye,Dt=ft(e,`ALLOWED_TAGS`,Ot,{transform:Sn}),kt=ft(e,`ALLOWED_ATTR`,At,{transform:Sn}),mn=ft(e,`ALLOWED_NAMESPACES`,see,{transform:be}),sn=ft(e,`ADD_URI_SAFE_ATTR`,cn,{transform:Sn,base:cn}),an=ft(e,`ADD_DATA_URI_TAGS`,on,{transform:Sn,base:on}),nn=ft(e,`FORBID_CONTENTS`,rn,{transform:Sn}),Mt=ft(e,`FORBID_TAGS`,Le({}),{transform:Sn}),Nt=ft(e,`FORBID_ATTR`,Le({}),{transform:Sn}),tn=ke(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Le(e.USE_PROFILES):e.USE_PROFILES:!1,Ft=e.ALLOW_ARIA_ATTR!==!1,It=e.ALLOW_DATA_ATTR!==!1,Lt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=e.SAFE_FOR_TEMPLATES||!1,Bt=e.SAFE_FOR_XML!==!1,Vt=e.WHOLE_DOCUMENT||!1,Kt=e.RETURN_DOM||!1,qt=e.RETURN_DOM_FRAGMENT||!1,Jt=e.RETURN_TRUSTED_TYPE||!1,Gt=e.FORCE_BODY||!1,Yt=e.SANITIZE_DOM!==!1,Xt=e.SANITIZE_NAMED_PROPS||!1,Qt=e.KEEP_CONTENT!==!1,$t=e.IN_PLACE||!1,Et=Ve(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:it,fn=typeof e.NAMESPACE==`string`?e.NAMESPACE:dn,gn=pt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Fe({},hn)),vn=pt(e,`HTML_INTEGRATION_POINTS`,()=>Fe({},_n));let t=pt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(jt=ae(null),ke(t,`tagNameCheck`)&&Tn(t.tagNameCheck)&&(jt.tagNameCheck=t.tagNameCheck),ke(t,`attributeNameCheck`)&&Tn(t.attributeNameCheck)&&(jt.attributeNameCheck=t.attributeNameCheck),ke(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(jt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ie(jt),zt&&(It=!1),qt&&(Kt=!0),tn&&(Dt=Fe({},Je),kt=ae(null),tn.html===!0&&(Fe(Dt,He),Fe(kt,Ye)),tn.svg===!0&&(Fe(Dt,Ue),Fe(kt,Xe),Fe(kt,Qe)),tn.svgFilters===!0&&(Fe(Dt,We),Fe(kt,Xe),Fe(kt,Qe)),tn.mathMl===!0&&(Fe(Dt,Ke),Fe(kt,Ze),Fe(kt,Qe))),Pt.tagCheck=null,Pt.attributeCheck=null,ke(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Pt.tagCheck=e.ADD_TAGS:he(e.ADD_TAGS)&&(Dt===Ot&&(Dt=Le(Dt)),Fe(Dt,e.ADD_TAGS,Sn))),ke(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Pt.attributeCheck=e.ADD_ATTR:he(e.ADD_ATTR)&&(kt===At&&(kt=Le(kt)),Fe(kt,e.ADD_ATTR,Sn))),ke(e,`ADD_FORBID_CONTENTS`)&&he(e.ADD_FORBID_CONTENTS)&&(nn===rn&&(nn=Le(nn)),Fe(nn,e.ADD_FORBID_CONTENTS,Sn)),Qt&&(Dt[`#text`]=!0),Vt&&Fe(Dt,[`html`,`head`,`body`]),Dt.table&&(Fe(Dt,[`tbody`]),delete Mt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Me(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Me(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ne;ne=e.TRUSTED_TYPES_POLICY;try{oe=De(``)}catch(e){throw ne=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ne=void 0,oe=``):(ne===void 0&&(ne=Ae()),ne&&typeof oe==`string`&&(oe=De(``)));re&&re(e),Cn=e},Dn=Fe({},[...Ue,...We,...Ge]),On=Fe({},[...Ke,...qe]),kn=function(e,t,n){return t.namespaceURI===dn?e===`svg`:t.namespaceURI===ln?e===`svg`&&(n===`annotation-xml`||gn[n]):!!Dn[e]},An=function(e,t,n){return t.namespaceURI===dn?e===`math`:t.namespaceURI===un?e===`math`&&vn[n]:!!On[e]},cee=function(e,t,n){return t.namespaceURI===un&&!vn[n]||t.namespaceURI===ln&&!gn[n]?!1:!On[e]&&(yn[e]||!Dn[e])},lee=function(e){let t=te(e),n=ye(T(e)),r=_(e),i,a;return r&&C(r)===ut.element?(i={namespaceURI:te(r)},a=ye(T(r))):(i={namespaceURI:fn},a=`template`),mn[t]?t===un?kn(n,i,a):t===ln?An(n,i,a):t===dn?cee(n,i,a):!!(bn===`application/xhtml+xml`&&mn[t]):!1},jn=function(e){fe(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Me(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Mn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Nn=function(e){Ln(e);let t=g(e);t&&le(pe(t),e=>{try{p(e)}catch{}});let n=C(e)===ut.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Mn(e,r,i)}},Pn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}fe(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Kt||qt)try{jn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Fn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||kt[Sn(i)]||Mn(e,r,i)}},In=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===ut.element){let t=v(e);Zn(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Ln=function(e){In(e,e=>{C(e)===ut.element&&Fn(e)})},Rn=function(e){let t=[];return In(e,e=>{t.push(e)},!0),t},zn=function(e,t){let n=ge();le(Rn(e),e=>{C(e)===ut.element&&_e(n,e)}),le(t,e=>{C(e)===ut.element&&!ve(n,e)&&Fn(e)})},Bn=function(e,n){let r=!1;return le(t.removed,t=>{t.element&&(r||=t.element===e,Ln(t.element))}),zn(e,n),r},Vn=function(e,t){let n=en,r=null,i=()=>(r||(r=ge(),le(t,e=>{_e(r,e)})),r);for(let t=0;;t++){let r=Rn(e),a=[e],o=!1;if(le(r,e=>{C(e)===ut.documentFragment?fe(a,e):!o&&!ve(n,e)&&(o=ve(i(),e))}),!o)return;if(t>=8)throw Me(`the tree kept changing during in-place sanitization; refusing to return it`);le(a,(t,n)=>{uee(t,n>0,e,i())})}},uee=function(e,t,n,r){let i=Kn(e),a;for(;a=i.nextNode();)ve(r,a)&&!ve(en,a)&&(t&&$n(vt.uponSanitizeShadowNode,a,null),ar(a,n),fr(a,n),Zn(a.content)&&pr(a.content))},Hn=function(e){en&&_e(en,e)},Un=function(e,t){return Bt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Wn=function(e){Bt&&In(e,e=>{let t=C(e);if(t===ut.processingInstruction||t===ut.comment&&je(ct,e.data)){try{p(e)}catch{}return!1}if(t===ut.element){let t=e,n=Sn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Un(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Gn=function(e){let t=null,r=null;if(Gt)e=``+e;else{let t=xe(e,/^[\r\n\t ]+/);r=t&&t[0]}bn===`application/xhtml+xml`&&fn===dn&&(e=``+e+``);let i=ne?De(e):e;if(fn===dn)try{t=new l().parseFromString(i,bn)}catch{}if(!t||!t.documentElement){t=Pe.createDocument(fn,`template`,null);try{t.documentElement.innerHTML=pn?oe:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),fn===dn?gt.call(t,Vt?`html`:`body`)[0]:Vt?t.documentElement:a},Kn=function(e){let t=S?S(e):e.ownerDocument;return Ie.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},qn=function(e){return e=Se(e,yt,` `),e=Se(e,bt,` `),e=Se(e,xt,` `),e},Jn=function(e){Yn(e);let t=e.querySelectorAll?.call(e,`template`);t&&le(t,e=>{Zn(e.content)&&Jn(e.content)})},Yn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=Ie.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=qn(r.data),r=n.nextNode()},Xn=function(e){let t=x?x(e):null;return typeof t!=`string`||Sn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Zn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===ut.documentFragment}catch{return!1}},Qn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function $n(e,n,r){e.length!==0&&le(e,e=>{e.call(t,n,r,Cn)})}let er=function(e,t){return!!(Bt&&e.hasChildNodes()&&!Qn(e.firstElementChild)&&je(st,e.textContent)&&je(st,e.innerHTML)||Bt&&ree[t]&&C(e)===ut.element&&te(e)===dn&&(Qn(e.firstElementChild)||typeof e.textContent==`string`&&je(st,e.textContent))||e.nodeType===ut.processingInstruction||Bt&&e.nodeType===ut.comment&&je(ct,e.data))},tr=function(e,t){if(e instanceof RegExp)return je(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return jn(e),!0},rr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Le(t):t},ir=function(e,t){return e===t||_(e)!==null?!1:($t&&Ln(e),!0)},ar=function(e,n){if(Hn(e),$n(vt.beforeSanitizeElements,e,null),ir(e,n))return!0;if(Xn(e))return jn(e),!0;let r=Sn(T(e));if(Dt=rr(vt.uponSanitizeElement,Dt,Ot,Ut),$n(vt.uponSanitizeElement,e,{tagName:r,allowedTags:Dt}),ir(e,n))return!0;if(er(e,r))return jn(e),!0;if(Mt[r]||!(Pt.tagCheck instanceof Function&&Pt.tagCheck(r))&&!Dt[r]){let t=nr(e,r,n);return t===!1&&($n(vt.afterSanitizeElements,e,null),ir(e,n))?!0:t}if(C(e)===ut.element&&!lee(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&je(nee,e.innerHTML))return jn(e),!0;if(zt&&e.nodeType===ut.text){let n=qn(e.textContent);e.textContent!==n&&(fe(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $n(vt.afterSanitizeElements,e,null),ir(e,n)},or=function(e,t,r){if(Nt[t]||Un(t,e)||Yt&&(t===`id`||t===`name`)&&(r in n||r in wn))return!1;let i=kt[t]||Pt.attributeCheck instanceof Function&&Pt.attributeCheck(t,e);return It&&je(St,t)||Ft&&je(Ct,t)?!0:i?sn[t]||je(Et,Se(r,Tt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ce(r,`data:`)===0&&an[e]||Lt&&!je(wt,Se(r,Tt,``))?!0:!r:cr(e)&&tr(jt.tagNameCheck,e)&&tr(jt.attributeNameCheck,t,e)||t===`is`&&jt.allowCustomizedBuiltInElements&&tr(jt.tagNameCheck,r)},sr=Fe({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),cr=function(e){return!sr[ye(e)]&&je(oee,e)},lr=function(e,t,n,r){if(ne&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return De(r);case`TrustedScriptURL`:return Oe(r)}return r},ur=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Xn(e)||(jn(e),!1)}catch{return Pn(t,e),!1}},dr=function(e,t){return Bt&&je(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ye(e)===`attributename`&&xe(t,`href`)!==null},fr=function(e,n){if($n(vt.beforeSanitizeAttributes,e,null),ir(e,n))return;let r=e.attributes;if(!r||Xn(e))return;kt=rr(vt.uponSanitizeAttribute,kt,At,Wt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:kt,forceKeepAttr:void 0},a=r.length,o=Sn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Sn(s),d=l,f=s===`value`?d:we(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$n(vt.uponSanitizeAttribute,e,i),f=i.attrValue,Xt&&(u===`id`||u===`name`)&&Ce(f,Zt)!==0&&(Pn(s,e,n),f=Zt+f,p=!0),dr(s,f)?Pn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Rt&&je(lt,f)?Pn(s,e,n):(zt&&(f=qn(f)),or(o,u,f)?(f=lr(o,u,c,f),f!==d&&ur(e,s,c,f)&&p&&de(t.removed)):Pn(s,e,n)):Pn(s,e,n))}$n(vt.afterSanitizeAttributes,e,null),ir(e,n)},pr=function(e){let t=null,n=Kn(e);for($n(vt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($n(vt.uponSanitizeShadowNode,t,null),ar(t,e),fr(t,e),Zn(t.content)&&pr(t.content),C(t)===ut.element){let e=v(t);Zn(e)&&(E(e),pr(e))}zt&&Yn(e),$n(vt.afterSanitizeShadowDOM,e,null)},E=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){pr(e.shadow);continue}let n=e.node,r=C(n)===ut.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&Sn(e)===`template`){let e=n.content;Zn(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Zn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(pn=!e,pn&&(e=``),typeof e!=`string`&&!Qn(e)&&(e=Re(e),typeof e!=`string`))throw Me(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ht?(Dt=Ut,kt=Wt):En(n),(vt.uponSanitizeElement.length>0||vt.uponSanitizeAttribute.length>0)&&(Dt=Le(Dt)),vt.uponSanitizeAttribute.length>0&&(kt=Le(kt)),t.removed=[];let c=$t&&typeof e!=`string`&&Qn(e),l=[],u=en;if(c){Wn(e);let t=T(e);if(typeof t==`string`){let n=Sn(t);if(!Dt[n]||Mt[n])throw Nn(e),Me(`root node is forbidden and cannot be sanitized in-place`)}if(Xn(e))throw Nn(e),Me(`root node is clobbered and cannot be sanitized in-place`);l=Rn(e),en=ge()}else if(Qn(e))i=Gn(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===ut.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),E(i);else{if(!Kt&&!zt&&!Vt&&e.indexOf(`<`)===-1)return ne&&Jt?De(e):e;if(i=Gn(e),!i)return Kt?null:Jt?oe:``}i&&Gt&&jn(i.firstChild);let d=c?e:i;try{c&&E(e);let t=Kn(d);for(;o=t.nextNode();)ar(o,d),fr(o,d),Zn(o.content)&&pr(o.content);c&&Vn(e,l)}catch(t){throw c&&(Nn(e),Bn(e,l)),t}finally{en=u}if(c){if(Bn(e,l))throw Me(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return zt&&Jn(e),e}if(Kt){if(zt&&Jn(i),qt)for(s=ht.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(kt.shadowroot||kt.shadowrootmode)&&(s=_t.call(r,s,!0)),s}let f=Vt?i.outerHTML:i.innerHTML;return Vt&&Dt[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&je(ot,i.ownerDocument.doctype.name)&&(f=` -`+f),zt&&(f=qn(f)),ne&&Jt?De(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};En(e),Ht=!0,Ut=Dt,Wt=kt},t.clearConfig=function(){Cn=null,Ht=!1,Ut=null,Wt=null,ne=se,oe=``},t.isValidAttribute=function(e,t,n){Cn||En({});let r=Sn(e),i=Sn(t);return typeof n==`string`&&(dr(t,n)||!Rt&&je(lt,n))?!1:or(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&ke(vt,e)&&fe(vt[e],t)},t.removeHook=function(e,t){if(ke(vt,e)){if(t!==void 0){let n=ue(vt[e],t);return n===-1?void 0:me(vt[e],n,1)[0]}return de(vt[e])}},t.removeHooks=function(e){ke(vt,e)&&(vt[e]=[])},t.removeAllHooks=function(){vt=dt()},t}var ht=mt(),gt=ht,_t=ht.sanitize.bind(ht);ht.isSupported,ht.addHook.bind(ht),ht.removeHook.bind(ht),ht.removeHooks.bind(ht),ht.removeAllHooks.bind(ht),ht.setConfig.bind(ht),ht.clearConfig.bind(ht),ht.isValidAttribute.bind(ht),ht.version,ht.removed;function vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=vt();function bt(e){yt=e}var xt={exec:()=>null};function St(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Ct(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Tt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wt=((e=``)=>{try{return!!RegExp(`(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:St(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:St(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:St(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|RegExp(`^ {0,${e}}>`))},oee=/^(?:[ \t]*(?:\n|$))+/,Et=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ot=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,At=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mt=Ct(jt).replace(/bull/g,At).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Nt=Ct(jt).replace(/bull/g,At).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ft=/^[^\n]+/,It=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Lt=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,It).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rt=Ct(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,At).getRegex(),zt=`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`,Bt=/|$))/,Vt=Ct(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Bt).replace(`tag`,zt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ht=e=>Ct(Pt).replace(`hr`,Ot).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Wt).getRegex(),code:Et,def:Lt,fences:Dt,heading:kt,hr:Ot,html:Vt,lheading:Mt,list:Rt,newline:oee,paragraph:Ut,table:xt,text:Ft},Kt=Ct(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Ot).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Bt).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:xt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Pt).replace(`hr`,Ot).replace(`heading`,` *#{1,6} *[^ -]`).replace(`lheading`,Mt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Yt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Zt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Qt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,wt?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),ln=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,un=Ct(ln,`u`).replace(/punct/g,$t).getRegex(),dn=Ct(ln,`u`).replace(/punct/g,an).getRegex(),fn=Ct(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,rn).replace(/punct/g,$t).getRegex(),pn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,mn=Ct(pn,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),see=Ct(pn,`gu`).replace(/notPunctSpace/g,sn).replace(/punctSpace/g,on).replace(/punct/g,an).getRegex(),hn=Ct(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),gn=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),_n=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),vn=Ct(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,$t).getRegex(),yn=Ct(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),bn=Ct(/\\(punct)/,`gu`).replace(/punct/g,$t).getRegex(),xn=Ct(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,$t).getRegex(),Sn=Ct(/^<(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(),Cn=Ct(Bt).replace(`(?:-->|$)`,`-->`).getRegex(),wn=Ct(`^comment|^|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,Cn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Tn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,En=Ct(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Tn).getRegex(),Dn=Ct(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,En).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),On=Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,En).replace(`ref`,It).getRegex(),kn=Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,It).getRegex(),An=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,cee=Ct(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Tn).getRegex(),lee=Ct(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,cee).replace(`ref`,An).getRegex()).replace(`nolink`,Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,An).getRegex()).getRegex(),jn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mn=Ct(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Nn={_backpedal:xt,anyPunctuation:bn,anyPunctuationOutsideCode:xn,autolink:Sn,blockSkip:cn,br:Zt,code:Xt,del:xt,delLDelim:xt,delRDelim:xt,emStrongLDelim:un,emStrongRDelimAst:mn,emStrongRDelimUnd:gn,escape:Yt,link:Dn,nolink:kn,punctuation:nn,reflink:On,reflinkSearch:lee,tag:wn,text:Qt,url:xt},Pn={...Nn,emStrongLDelim:fn,emStrongRDelimAst:hn,emStrongRDelimUnd:_n,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace(`label`,En).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,En).getRegex()},Fn={...Nn,emStrongRDelimAst:see,emStrongLDelim:dn,delLDelim:vn,delRDelim:yn,url:Ct(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Mn).replace(`protocol`,jn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Bn=e=>zn[e];function Vn(e,t){if(t){if(Tt.escapeTest.test(e))return e.replace(Tt.escapeReplace,Bn)}else if(Tt.escapeTestNoEncode.test(e))return e.replace(Tt.escapeReplaceNoEncode,Bn);return e}function uee(e){return Tt.numericCharacterReference.test(e)?e.replace(Tt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Hn(e){try{e=encodeURI(e).replace(Tt.percentDecode,`%`)}catch{return null}return e}function Un(e,t){let n=e.replace(Tt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Tt.splitPipe),r=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.length2?n-2:0),i=2;i1?t-1:0),r=1;r`u`?null:Me(BigInt.prototype.toString),De=typeof Symbol>`u`?null:Me(Symbol.prototype.toString),Oe=Me(Object.prototype.hasOwnProperty),ke=Me(Object.prototype.toString),Ae=Me(RegExp.prototype.test),je=Ne(TypeError);function Me(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:ve;if(T&&T(e,null),!me(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ee(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Fe(e){for(let t=0;t/g),eee=re(/\${[\w\W]*/g),et=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=re(/^aria-[\-\w]+$/),nt=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rt=re(/^(?:\w+script|data):/i),it=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),at=re(/^html$/i),ot=re(/^[a-z][.\w]*(-[.\w]+)+$/i),st=re(/<[/\w!]/g),ct=re(/<[/\w]/g),tee=re(/<\/no(script|embed|frames)/i),lt=re(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nee=ne(Pe({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),ree=function(){return typeof window>`u`?null:window},iee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(e,t,n,r){return Oe(e,t)&&me(e[t])?Pe(r.base?Ie(r.base):{},e[t],r.transform):n},pt=function(e,t,n){let r=Oe(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ie(r):n()};function mt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ree(),t=e=>mt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==ut.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Re(d,`cloneNode`),p=Re(d,`remove`),m=Re(d,`removeAttributeNode`),h=Re(d,`nextSibling`),g=Re(d,`childNodes`),_=Re(d,`parentNode`),v=Re(d,`shadowRoot`),y=Re(d,`attributes`),b=o&&o.prototype?Re(o.prototype,`nodeType`):null,x=o&&o.prototype?Re(o.prototype,`nodeName`):null,S=o&&o.prototype?Re(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=ze(d,`namespaceURI`),E=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let te,ae=``,oe,se=!1,we=0,Te=function(){if(we>0)throw je(`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.`)},Ee=function(e){Te(),we++;try{return te.createHTML(e)}finally{we--}},De=function(e){Te(),we++;try{return te.createScriptURL(e)}finally{we--}},ke=function(){return se||=(oe=iee(u,i),!0),oe},Me=n,Ne=Me.implementation,Fe=Me.createNodeIterator,ht=Me.createDocumentFragment,gt=Me.getElementsByTagName,_t=r.importNode,vt=dt();t.isSupported=typeof w==`function`&&typeof _==`function`&&Ne&&Ne.createHTMLDocument!==void 0;let yt=Qe,bt=$e,xt=eee,St=et,Ct=tt,wt=rt,Tt=it,Et=ot,Dt=nt,Ot=null,kt=Pe({},[...Ve,...He,...Ue,...Ge,...qe]),At=null,jt=Pe({},[...Je,...Ye,...Xe,...Ze]),Mt=Object.seal(ie(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}})),Nt=null,Pt=null,Ft=Object.seal(ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),It=!0,Lt=!0,Rt=!1,zt=!0,Bt=!1,Vt=!0,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=!1,qt=!1,Jt=!1,Yt=!1,Xt=!0,Zt=!1,Qt=`user-content-`,$t=!0,en=!1,tn=null,nn={},rn=null,an=Pe({},`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`.split(`.`)),on=null,sn=Pe({},[`audio`,`video`,`img`,`source`,`image`,`track`]),cn=null,ln=Pe({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),un=`http://www.w3.org/1998/Math/MathML`,dn=`http://www.w3.org/2000/svg`,fn=`http://www.w3.org/1999/xhtml`,pn=fn,mn=!1,hn=null,aee=Pe({},[un,dn,fn],ye),gn=ne([`mi`,`mo`,`mn`,`ms`,`mtext`]),_n=Pe({},gn),vn=ne([`annotation-xml`]),yn=Pe({},vn),bn=Pe({},[`title`,`style`,`font`,`a`,`script`]),xn=null,Sn=[`application/xhtml+xml`,`text/html`],Cn=null,wn=null,Tn=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wn&&wn===e)return;e&&typeof e==`object`||(e={}),e=Ie(e),xn=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Cn=xn===`application/xhtml+xml`?ye:ve,Ot=ft(e,`ALLOWED_TAGS`,kt,{transform:Cn}),At=ft(e,`ALLOWED_ATTR`,jt,{transform:Cn}),hn=ft(e,`ALLOWED_NAMESPACES`,aee,{transform:ye}),cn=ft(e,`ADD_URI_SAFE_ATTR`,ln,{transform:Cn,base:ln}),on=ft(e,`ADD_DATA_URI_TAGS`,sn,{transform:Cn,base:sn}),rn=ft(e,`FORBID_CONTENTS`,an,{transform:Cn}),Nt=ft(e,`FORBID_TAGS`,Ie({}),{transform:Cn}),Pt=ft(e,`FORBID_ATTR`,Ie({}),{transform:Cn}),nn=Oe(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ie(e.USE_PROFILES):e.USE_PROFILES:!1,It=e.ALLOW_ARIA_ATTR!==!1,Lt=e.ALLOW_DATA_ATTR!==!1,Rt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=e.SAFE_FOR_TEMPLATES||!1,Vt=e.SAFE_FOR_XML!==!1,Ht=e.WHOLE_DOCUMENT||!1,qt=e.RETURN_DOM||!1,Jt=e.RETURN_DOM_FRAGMENT||!1,Yt=e.RETURN_TRUSTED_TYPE||!1,Kt=e.FORCE_BODY||!1,Xt=e.SANITIZE_DOM!==!1,Zt=e.SANITIZE_NAMED_PROPS||!1,$t=e.KEEP_CONTENT!==!1,en=e.IN_PLACE||!1,Dt=Be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:nt,pn=typeof e.NAMESPACE==`string`?e.NAMESPACE:fn,_n=pt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Pe({},gn)),yn=pt(e,`HTML_INTEGRATION_POINTS`,()=>Pe({},vn));let t=pt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ie(null));if(Mt=ie(null),Oe(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(Mt.tagNameCheck=t.tagNameCheck),Oe(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(Mt.attributeNameCheck=t.attributeNameCheck),Oe(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Mt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),re(Mt),Bt&&(Lt=!1),Jt&&(qt=!0),nn&&(Ot=Pe({},qe),At=ie(null),nn.html===!0&&(Pe(Ot,Ve),Pe(At,Je)),nn.svg===!0&&(Pe(Ot,He),Pe(At,Ye),Pe(At,Ze)),nn.svgFilters===!0&&(Pe(Ot,Ue),Pe(At,Ye),Pe(At,Ze)),nn.mathMl===!0&&(Pe(Ot,Ge),Pe(At,Xe),Pe(At,Ze))),Ft.tagCheck=null,Ft.attributeCheck=null,Oe(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ft.tagCheck=e.ADD_TAGS:me(e.ADD_TAGS)&&(Ot===kt&&(Ot=Ie(Ot)),Pe(Ot,e.ADD_TAGS,Cn))),Oe(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ft.attributeCheck=e.ADD_ATTR:me(e.ADD_ATTR)&&(At===jt&&(At=Ie(At)),Pe(At,e.ADD_ATTR,Cn))),Oe(e,`ADD_FORBID_CONTENTS`)&&me(e.ADD_FORBID_CONTENTS)&&(rn===an&&(rn=Ie(rn)),Pe(rn,e.ADD_FORBID_CONTENTS,Cn)),$t&&(Ot[`#text`]=!0),Ht&&Pe(Ot,[`html`,`head`,`body`]),Ot.table&&(Pe(Ot,[`tbody`]),delete Nt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=te;te=e.TRUSTED_TYPES_POLICY;try{ae=Ee(``)}catch(e){throw te=t,e}}else e.TRUSTED_TYPES_POLICY===null?(te=void 0,ae=``):(te===void 0&&(te=ke()),te&&typeof ae==`string`&&(ae=Ee(``)));ne&&ne(e),wn=e},On=Pe({},[...He,...Ue,...We]),kn=Pe({},[...Ge,...Ke]),An=function(e,t,n){return t.namespaceURI===fn?e===`svg`:t.namespaceURI===un?e===`svg`&&(n===`annotation-xml`||_n[n]):!!On[e]},jn=function(e,t,n){return t.namespaceURI===fn?e===`math`:t.namespaceURI===dn?e===`math`&&yn[n]:!!kn[e]},Mn=function(e,t,n){return t.namespaceURI===dn&&!yn[n]||t.namespaceURI===un&&!_n[n]?!1:!kn[e]&&(bn[e]||!On[e])},Nn=function(e){let t=E(e),n=ve(T(e)),r=_(e),i,a;return r&&C(r)===ut.element?(i={namespaceURI:E(r)},a=ve(T(r))):(i={namespaceURI:pn},a=`template`),hn[t]?t===dn?An(n,i,a):t===un?jn(n,i,a):t===fn?Mn(n,i,a):!!(xn===`application/xhtml+xml`&&hn[t]):!1},Pn=function(e){de(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw je(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Fn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},In=function(e){Bn(e);let t=g(e);t&&ce(fe(t),e=>{try{p(e)}catch{}});let n=C(e)===ut.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Fn(e,r,i)}},Ln=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(qt||Jt)try{Pn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Rn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||At[Cn(i)]||Fn(e,r,i)}},zn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===ut.element){let t=v(e);er(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Bn=function(e){zn(e,e=>{C(e)===ut.element&&Rn(e)})},Vn=function(e){let t=[];return zn(e,e=>{t.push(e)},!0),t},oee=function(e,t){let n=he();ce(Vn(e),e=>{C(e)===ut.element&&ge(n,e)}),ce(t,e=>{C(e)===ut.element&&!_e(n,e)&&Rn(e)})},Hn=function(e,n){let r=!1;return ce(t.removed,t=>{t.element&&(r||=t.element===e,Bn(t.element))}),oee(e,n),r},Un=function(e,t){let n=tn,r=null,i=()=>(r||(r=he(),ce(t,e=>{ge(r,e)})),r);for(let t=0;;t++){let r=Vn(e),a=[e],o=!1;if(ce(r,e=>{C(e)===ut.documentFragment?de(a,e):!o&&!_e(n,e)&&(o=_e(i(),e))}),!o)return;if(t>=8)throw je(`the tree kept changing during in-place sanitization; refusing to return it`);ce(a,(t,n)=>{Wn(t,n>0,e,i())})}},Wn=function(e,t,n,r){let i=Yn(e),a;for(;a=i.nextNode();)_e(r,a)&&!_e(tn,a)&&(t&&nr(vt.uponSanitizeShadowNode,a,null),cr(a,n),hr(a,n),er(a.content)&&gr(a.content))},Gn=function(e){tn&&ge(tn,e)},Kn=function(e,t){return Vt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},qn=function(e){Vt&&zn(e,e=>{let t=C(e);if(t===ut.processingInstruction||t===ut.comment&&Ae(ct,e.data)){try{p(e)}catch{}return!1}if(t===ut.element){let t=e,n=Cn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Kn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Jn=function(e){let t=null,r=null;if(Kt)e=``+e;else{let t=be(e,/^[\r\n\t ]+/);r=t&&t[0]}xn===`application/xhtml+xml`&&pn===fn&&(e=``+e+``);let i=te?Ee(e):e;if(pn===fn)try{t=new l().parseFromString(i,xn)}catch{}if(!t||!t.documentElement){t=Ne.createDocument(pn,`template`,null);try{t.documentElement.innerHTML=mn?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),pn===fn?gt.call(t,Ht?`html`:`body`)[0]:Ht?t.documentElement:a},Yn=function(e){let t=S?S(e):e.ownerDocument;return Fe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Xn=function(e){return e=xe(e,yt,` `),e=xe(e,bt,` `),e=xe(e,xt,` `),e},Zn=function(e){Qn(e);let t=e.querySelectorAll?.call(e,`template`);t&&ce(t,e=>{er(e.content)&&Zn(e.content)})},Qn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=Fe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Xn(r.data),r=n.nextNode()},$n=function(e){let t=x?x(e):null;return typeof t!=`string`||Cn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},er=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===ut.documentFragment}catch{return!1}},tr=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function nr(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,wn)})}let rr=function(e,t){return!!(Vt&&e.hasChildNodes()&&!tr(e.firstElementChild)&&Ae(st,e.textContent)&&Ae(st,e.innerHTML)||Vt&&nee[t]&&C(e)===ut.element&&E(e)===fn&&(tr(e.firstElementChild)||typeof e.textContent==`string`&&Ae(st,e.textContent))||e.nodeType===ut.processingInstruction||Vt&&e.nodeType===ut.comment&&Ae(ct,e.data))},ir=function(e,t){if(e instanceof RegExp)return Ae(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Pn(e),!0},or=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ie(t):t},sr=function(e,t){return e===t||_(e)!==null?!1:(en&&Bn(e),!0)},cr=function(e,n){if(Gn(e),nr(vt.beforeSanitizeElements,e,null),sr(e,n))return!0;if($n(e))return Pn(e),!0;let r=Cn(T(e));if(Ot=or(vt.uponSanitizeElement,Ot,kt,Wt),nr(vt.uponSanitizeElement,e,{tagName:r,allowedTags:Ot}),sr(e,n))return!0;if(rr(e,r))return Pn(e),!0;if(Nt[r]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(r))&&!Ot[r]){let t=ar(e,r,n);return t===!1&&(nr(vt.afterSanitizeElements,e,null),sr(e,n))?!0:t}if(C(e)===ut.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ae(tee,e.innerHTML))return Pn(e),!0;if(Bt&&e.nodeType===ut.text){let n=Xn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return nr(vt.afterSanitizeElements,e,null),sr(e,n)},lr=function(e,t,r){if(Pt[t]||Kn(t,e)||Xt&&(t===`id`||t===`name`)&&(r in n||r in Tn))return!1;let i=At[t]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(t,e);return Lt&&Ae(St,t)||It&&Ae(Ct,t)?!0:i?cn[t]||Ae(Dt,xe(r,Tt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Se(r,`data:`)===0&&on[e]||Rt&&!Ae(wt,xe(r,Tt,``))?!0:!r:dr(e)&&ir(Mt.tagNameCheck,e)&&ir(Mt.attributeNameCheck,t,e)||t===`is`&&Mt.allowCustomizedBuiltInElements&&ir(Mt.tagNameCheck,r)},ur=Pe({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),dr=function(e){return!ur[ve(e)]&&Ae(Et,e)},fr=function(e,t,n,r){if(te&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return Ee(r);case`TrustedScriptURL`:return De(r)}return r},pr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!$n(e)||(Pn(e),!1)}catch{return Ln(t,e),!1}},mr=function(e,t){return Vt&&Ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ve(e)===`attributename`&&be(t,`href`)!==null},hr=function(e,n){if(nr(vt.beforeSanitizeAttributes,e,null),sr(e,n))return;let r=e.attributes;if(!r||$n(e))return;At=or(vt.uponSanitizeAttribute,At,jt,Gt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:At,forceKeepAttr:void 0},a=r.length,o=Cn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Cn(s),d=l,f=s===`value`?d:Ce(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,nr(vt.uponSanitizeAttribute,e,i),f=i.attrValue,Zt&&(u===`id`||u===`name`)&&Se(f,Qt)!==0&&(Ln(s,e,n),f=Qt+f,p=!0),mr(s,f)?Ln(s,e,n):i.forceKeepAttr||(i.keepAttr?!zt&&Ae(lt,f)?Ln(s,e,n):(Bt&&(f=Xn(f)),lr(o,u,f)?(f=fr(o,u,c,f),f!==d&&pr(e,s,c,f)&&p&&ue(t.removed)):Ln(s,e,n)):Ln(s,e,n))}nr(vt.afterSanitizeAttributes,e,null),sr(e,n)},gr=function(e){let t=null,n=Yn(e);for(nr(vt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(nr(vt.uponSanitizeShadowNode,t,null),cr(t,e),hr(t,e),er(t.content)&&gr(t.content),C(t)===ut.element){let e=v(t);er(e)&&(_r(e),gr(e))}Bt&&Qn(e),nr(vt.afterSanitizeShadowDOM,e,null)},_r=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){gr(e.shadow);continue}let n=e.node,r=C(n)===ut.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&Cn(e)===`template`){let e=n.content;er(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);er(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(mn=!e,mn&&(e=``),typeof e!=`string`&&!tr(e)&&(e=Le(e),typeof e!=`string`))throw je(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ut?(Ot=Wt,At=Gt):Dn(n),(vt.uponSanitizeElement.length>0||vt.uponSanitizeAttribute.length>0)&&(Ot=Ie(Ot)),vt.uponSanitizeAttribute.length>0&&(At=Ie(At)),t.removed=[];let c=en&&typeof e!=`string`&&tr(e),l=[],u=tn;if(c){qn(e);let t=T(e);if(typeof t==`string`){let n=Cn(t);if(!Ot[n]||Nt[n])throw In(e),je(`root node is forbidden and cannot be sanitized in-place`)}if($n(e))throw In(e),je(`root node is clobbered and cannot be sanitized in-place`);l=Vn(e),tn=he()}else if(tr(e))i=Jn(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===ut.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_r(i);else{if(!qt&&!Bt&&!Ht&&e.indexOf(`<`)===-1)return te&&Yt?Ee(e):e;if(i=Jn(e),!i)return qt?null:Yt?ae:``}i&&Kt&&Pn(i.firstChild);let d=c?e:i;try{c&&_r(e);let t=Yn(d);for(;o=t.nextNode();)cr(o,d),hr(o,d),er(o.content)&&gr(o.content);c&&Un(e,l)}catch(t){throw c&&(In(e),Hn(e,l)),t}finally{tn=u}if(c){if(Hn(e,l))throw je(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Bt&&Zn(e),e}if(qt){if(Bt&&Zn(i),Jt)for(s=ht.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(At.shadowroot||At.shadowrootmode)&&(s=_t.call(r,s,!0)),s}let f=Ht?i.outerHTML:i.innerHTML;return Ht&&Ot[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ae(at,i.ownerDocument.doctype.name)&&(f=` +`+f),Bt&&(f=Xn(f)),te&&Yt?Ee(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Ut=!0,Wt=Ot,Gt=At},t.clearConfig=function(){wn=null,Ut=!1,Wt=null,Gt=null,te=oe,ae=``},t.isValidAttribute=function(e,t,n){wn||Dn({});let r=Cn(e),i=Cn(t);return typeof n==`string`&&(mr(t,n)||!zt&&Ae(lt,n))?!1:lr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Oe(vt,e)&&de(vt[e],t)},t.removeHook=function(e,t){if(Oe(vt,e)){if(t!==void 0){let n=le(vt[e],t);return n===-1?void 0:pe(vt[e],n,1)[0]}return ue(vt[e])}},t.removeHooks=function(e){Oe(vt,e)&&(vt[e]=[])},t.removeAllHooks=function(){vt=dt()},t}var ht=mt(),gt=ht,_t=ht.sanitize.bind(ht);ht.isSupported,ht.addHook.bind(ht),ht.removeHook.bind(ht),ht.removeHooks.bind(ht),ht.removeAllHooks.bind(ht),ht.setConfig.bind(ht),ht.clearConfig.bind(ht),ht.isValidAttribute.bind(ht),ht.version,ht.removed;function vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=vt();function bt(e){yt=e}var xt={exec:()=>null};function St(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Ct(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Tt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wt=((e=``)=>{try{return!!RegExp(`(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ 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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:St(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:St(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:St(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:St(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|RegExp(`^ {0,${e}}>`))},Et=/^(?:[ \t]*(?:\n|$))+/,Dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ot=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,kt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,At=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Nt=Ct(Mt).replace(/bull/g,jt).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Pt=Ct(Mt).replace(/bull/g,jt).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ft=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,It=/^[^\n]+/,Lt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Rt=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Lt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),zt=Ct(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),Bt=`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`,Vt=/|$))/,Ht=Ct(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)||$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Vt).replace(`tag`,Bt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=e=>Ct(Ft).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Gt).getRegex(),code:Dt,def:Rt,fences:Ot,heading:At,hr:kt,html:Ht,lheading:Nt,list:zt,newline:Et,paragraph:Wt,table:xt,text:It},qt=Ct(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|(?: *\\n{2,}|\\s*$)|\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,Vt).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:xt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Ft).replace(`hr`,kt).replace(`heading`,` *#{1,6} *[^ +]`).replace(`lheading`,Nt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Xt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,$t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,wt?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),un=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dn=Ct(un,`u`).replace(/punct/g,en).getRegex(),fn=Ct(un,`u`).replace(/punct/g,on).getRegex(),pn=Ct(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,an).replace(/punct/g,en).getRegex(),mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hn=Ct(mn,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),aee=Ct(mn,`gu`).replace(/notPunctSpace/g,cn).replace(/punctSpace/g,sn).replace(/punct/g,on).getRegex(),gn=Ct(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),_n=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),vn=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),yn=Ct(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,en).getRegex(),bn=Ct(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),xn=Ct(/\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),Sn=Ct(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),Cn=Ct(/^<(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(),wn=Ct(Vt).replace(`(?:-->|$)`,`-->`).getRegex(),Tn=Ct(`^comment|^|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,wn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),En=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Dn=Ct(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,En).getRegex(),On=Ct(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Dn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),kn=Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Dn).replace(`ref`,Lt).getRegex(),An=Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Lt).getRegex(),jn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Mn=Ct(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,En).getRegex(),Nn=Ct(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Mn).replace(`ref`,jn).getRegex()).replace(`nolink`,Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,jn).getRegex()).getRegex(),Pn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fn=Ct(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),In={_backpedal:xt,anyPunctuation:xn,anyPunctuationOutsideCode:Sn,autolink:Cn,blockSkip:ln,br:Qt,code:Zt,del:xt,delLDelim:xt,delRDelim:xt,emStrongLDelim:dn,emStrongRDelimAst:hn,emStrongRDelimUnd:_n,escape:Xt,link:On,nolink:An,punctuation:rn,reflink:kn,reflinkSearch:Nn,tag:Tn,text:$t,url:xt},Ln={...In,emStrongLDelim:pn,emStrongRDelimAst:gn,emStrongRDelimUnd:vn,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Dn).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Dn).getRegex()},Rn={...In,emStrongRDelimAst:aee,emStrongLDelim:fn,delLDelim:yn,delRDelim:bn,url:Ct(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Fn).replace(`protocol`,Pn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Hn=e=>oee[e];function Un(e,t){if(t){if(Tt.escapeTest.test(e))return e.replace(Tt.escapeReplace,Hn)}else if(Tt.escapeTestNoEncode.test(e))return e.replace(Tt.escapeReplaceNoEncode,Hn);return e}function Wn(e){return Tt.numericCharacterReference.test(e)?e.replace(Tt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Gn(e){try{e=encodeURI(e).replace(Tt.percentDecode,`%`)}catch{return null}return e}function Kn(e,t){let n=e.replace(Tt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Tt.splitPipe),r=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.length=0&&Tt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(` -`)}function Kn(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function qn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}function Jn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Yn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Xn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` +`)}function Yn(e){return e.trim().replace(Tt.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Xn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}var Zn=new WeakMap;function Qn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(` -`)}function Zn(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;it.length-i)return!0;i+=o[0].length-1}}return!1}var Qn=class{options;rules;lexer;constructor(e){this.options=e||yt}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 e=this.options.pedantic?t[0]:Gn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Xn(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Wn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Wn(t[0],` -`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Wn(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Wn(t[0],` +`)}function or(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;it.length-i)return!0;i+=o[0].length-1}}return!1}var sr=class{options;rules;lexer;constructor(e){this.options=e||yt}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 e=this.options.pedantic?t[0]:Jn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ar(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:qn(t[0],` +`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:qn(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qn(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;ot+rr(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,` $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n} ${s}`:s,r=r?`${r} -${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(` +${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(` `),o=t.raw+` `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(` -`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n} +`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n} ${d.join(` -`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+` +`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+` `+e.join(` -`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(` -`)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(` -`,1)[0],d=t[1].length,f=this.options.pedantic?Jn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Jn(e,d)),p=e.split(` -`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(` -`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>Jn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=` -`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=` -`+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Gn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&qn(t[2],`()`)!==-1)return;let e=Kn(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Wn(t[0],` -`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Un(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` -`):[],a={type:`table`,raw:Wn(t[0],` -`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Wn(t[0],` +`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(` +`).length:0;if(s>0){let t=e.slice(0,s).join(` +`);n=`${n} +${t}`,r=`${r} +${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(` +`,1)[0],d=t[1].length,f=this.options.pedantic?rr(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>rr(e,d)),p=e.split(` +`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(` +`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>rr(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=` +`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f} +${p}`)?` ${l.replace(/^ {0,3}/,``)}`:p;a+=` +`+e}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Jn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Xn(t[2],`()`)!==-1)return;let e=Yn(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:qn(t[0],` +`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Kn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` +`):[],a={type:`table`,raw:qn(t[0],` +`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:qn(t[0],` `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){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){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Zn(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Wn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=qn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Yn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Zn(e,n[1],r,this.rules))return;let i=t[Kn((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Yn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:uee(t[0]),escaped:e}}}},$n=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new Qn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Tt,block:Ln.normal,inline:Rn.normal};this.options.pedantic?(t.block=Ln.pedantic,t.inline=Rn.pedantic):this.options.gfm&&(t.block=Ln.gfm,t.inline=this.options.breaks?Rn.breaks:Rn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ln,inline:Rn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Tt.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let e=0;e(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=` +`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}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){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&or(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=qn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Xn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=qn(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),ir(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&or(e,n[1],r,this.rules))return;let i=t[Yn(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ir(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);sb);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=nr(this,t),l=t.length-e.length+n;if(cu);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Wn(t[0]),escaped:e}}}},cr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new sr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Tt,block:Bn.normal,inline:Vn.normal};this.options.pedantic?(t.block=Bn.pedantic,t.inline=Vn.pedantic):this.options.gfm&&(t.block=Bn.gfm,t.inline=this.options.breaks?Vn.breaks:Vn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bn,inline:Vn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Tt.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let e=0;e(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=` `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+i.raw,n.text+=` `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+i.raw,n.text+=` -`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(` +`+i.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}),t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(` `)?``:` `)+i.raw,r.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+i.raw,n.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Kn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Kn(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},er=class{options;parser;constructor(e){this.options=e||yt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Tt.notSpaceStart)?.[0],i=e?e.replace(Tt.endingNewline,``)+` -`:``;return r?`
`+(n?i:Vn(i,!0))+`
-`:`
`+(n?i:Vn(i,!0))+`
+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Yn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==sr.prototype.emStrong||this.tokenizer.del!==sr.prototype.del?this.#n(e):e;$n(this.tokenizer,n);try{return this.#t(e,n,t)}finally{er(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Yn(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=t.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},lr=class{options;parser;constructor(e){this.options=e||yt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Tt.notSpaceStart)?.[0],i=e?e.replace(Tt.endingNewline,``)+` +`:``;return r?`
`+(n?i:Un(i,!0))+`
+`:`
`+(n?i:Un(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)} @@ -83,29 +89,29 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Vn(e,!0)}`}br(e){return`
`}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Vn(n,!0):this.parser.parseInline(r),o=Hn(e);if(o===null)return a;e=Vn(o,i);let s=`
`+a+``,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Hn(e);if(i===null)return Vn(n);e=i;let a=`${Vn(n)}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Vn(e.text)}},tr=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},nr=class e{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new er,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tr}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n{let i=e[r].flat(1/0);ir(n,this.walkTokens(i,t))}):e.tokens&&ir(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new er(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Qn(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new rr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=rr.passThroughHooks.has(n)?e=>{if(this.defaults.async&&rr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&ir(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $n.lex(e,t??this.defaults)}parser(e,t){return nr.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(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 n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?$n.lex:$n.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?nr.parse:nr.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?$n.lex:$n.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?nr.parse:nr.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let e=`

An error occurred:

`+Vn(n.message+``,!0)+`
`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},or=new ar;function sr(e,t){return or.parse(e,t)}sr.options=sr.setOptions=function(e){return or.setOptions(e),sr.defaults=or.defaults,bt(sr.defaults),sr},sr.getDefaults=vt,sr.defaults=yt;function cr(...e){return or.use(...e),sr.defaults=or.defaults,bt(sr.defaults),sr}sr.use=cr,sr.walkTokens=function(e,t){return or.walkTokens(e,t)},sr.parseInline=or.parseInline,sr.Parser=nr,sr.parser=nr.parse,sr.Renderer=er,sr.TextRenderer=tr,sr.Lexer=$n,sr.lexer=$n.lex,sr.Tokenizer=Qn,sr.Hooks=rr,sr.parse=sr,sr.options,sr.setOptions,sr.walkTokens;var lr=sr.parseInline,ur=sr;nr.parse;var dr=$n.lex,fr=u(f(),1),pr=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`],E=e=>typeof e==`object`&&!!e&&!Array.isArray(e),mr=e=>JSON.parse(JSON.stringify(e)),hr=u(s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),gr=Array.isArray,dee=Array.prototype.indexOf,_r=Array.prototype.includes,vr=Array.from,yr=Object.defineProperty,br=Object.getOwnPropertyDescriptor,fee=Object.getOwnPropertyDescriptors,xr=Object.prototype,pee=Array.prototype,Sr=Object.getPrototypeOf,Cr=Object.isExtensible;function wr(e){return typeof e==`function`}var Tr=()=>{};function Er(e){return typeof e?.then==`function`}function mee(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function Dr(e,t,n=!1){return e===void 0?n?t():t:e}function Or(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var kr=Symbol(`$state`),gee=Symbol(`component`),Ar=Symbol(`legacy props`),_ee=Symbol(``),jr=Symbol(`attributes`),Mr=Symbol(`class`),Nr=Symbol(`style`),Pr=Symbol(`text`),Fr=Symbol(`form reset`),Ir=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Lr=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Rr={},zr=Symbol(`uninitialized`);function vee(){console.warn(`https://svelte.dev/e/derived_inert`)}function Br(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function yee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function bee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Vr=!1;function Hr(e){Vr=e}var Ur;function Wr(e){if(e===null)throw Br(),Rr;return Ur=e}function Gr(){return Wr(ea(Ur))}function D(e){if(Vr){if(ea(Ur)!==null)throw Br(),Rr;Ur=e}}function Kr(e=1){if(Vr){for(var t=e,n=Ur;t--;)n=ea(n);Ur=n}}function qr(e=!0){for(var t=0,n=Ur;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ea(n);e&&n.remove(),n=i}}function Jr(e){if(!e||e.nodeType!==8)throw Br(),Rr;return e.data}function Yr(e){return e===this.v}function xee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Xr(e){return!xee(e,this.v)}function Zr(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function See(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Cee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function wee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Tee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Eee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Dee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Oee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function kee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Aee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function jee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Mee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Nee=[];function Qr(e,t=!1,n=!1){return $r(e,new Map,``,Nee,null,n)}function $r(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(gr(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c{t===si&&ci()})}si.push(e)}function Iee(){for(;si.length>0;)ci()}var Lee=-7169;function ui(e,t){e.f=e.f&Lee|t}function di(e){e.f&512||e.deps===null?ui(e,1024):ui(e,4096)}function Ree(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ui(e,1024)}function zee(e,t){if(t){let t=document.body;e.autofocus=!0,li(()=>{document.activeElement===t&&e.focus()})}}function Bee(e){Vr&&$i(e)!==null&&ta(e)}var Vee=!1;function Hee(){Vee||(Vee=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Fr]?.()})},{capture:!0}))}function fi(e){var t=ka,n=Ma;ja(null),Na(null);try{return e()}finally{ja(t),Na(n)}}function Uee(e,t,n,r=n){e.addEventListener(t,()=>fi(n));let i=e[Fr];e[Fr]=i?()=>{i(),r(!0)}:()=>r(!0),Hee()}function pi(e,t,n,r){let i=oi()?_i:yi;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Ma,c=mi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){aa(e,s)}hi()}}var d=gi();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Wee(e))).then(u).catch(e=>aa(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),hi())}):f()}function mi(){var e=Ma,t=ka,n=ti,r=wi;return function(i=!0){Na(e),ja(t),ni(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function hi(e=!0){Na(null),ja(null),ni(null),e&&wi?.deactivate()}function gi(){var e=Ma,t=e.b,n=wi,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function _i(e){return Ma!==null&&(Ma.f|=524288),{ctx:ti,deps:null,effects:null,equals:Yr,f:2050,fn:e,reactions:null,rv:0,v:zr,wv:0,parent:Ma,ac:null}}var vi=Symbol(`obsolete`);function Wee(e,t,n){let r=Ma;r===null&&See();var i=void 0,a=Ui(zr),o=!ka,s=new Set;return ote(()=>{var t=Ma,n=hee();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ir&&n.reject(e)}).finally(hi)}catch(e){n.reject(e),hi()}var c=wi;if(o){if(t.f&32768)var l=gi();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(vi);else for(let e of s.values())e.reject(vi);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==vi&&(c.activate(),t?(a.f|=8388608,qi(a,t)):(a.f&8388608&&(a.f^=8388608),qi(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),la(()=>{for(let e of s)e.reject(vi)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=_i(e);return Fa(t),t}function yi(e){let t=_i(e);return t.equals=Xr,t}function Gee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(Ir),t.ac=null}),t.fn!==null&&(t.teardown=Tr),Ja(t,0),va(t))}function Si(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Ya(t)}var Ci=null,wi=null,Ti=null,Ei=null,Di=null,Oi=!1,ki=!1,Ai=null,ji=null,Mi=0,qee=1,Ni=class e{id=qee++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Ci===null?Ci=this:(Ci.#n=this,this.#t=Ci),Ci=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)ui(r,2048),t(r);for(r of n.m)ui(r,4096),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),ui(e,2048),this.schedule(e);for(let e of this.#d)ui(e,4096),this.schedule(e);this.apply();for(var t=Ai=[],n=[],r=ji=[];this.#c.length>0;){Mi++>1e3&&(this.#S(),Jee());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw zi(e),this.#h()||this.discard(),t}}if(wi=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Ai=null,ji=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Ri(e,t);r.length>0&&wi.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Ti=this,Ii(n),Ii(t),Ti=null,this.#s?.resolve();var o=wi;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Vi.clear(),o.#_())}}#v(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):Wa(r)&&(i&16&&this.#d.add(r),Ya(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),ui(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),wi=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=hee()).promise}static ensure(){if(wi===null){let t=wi=new e;!ki&&!Oi&&li(()=>{t.#e||t.flush()})}return wi}apply(){Ei=null}schedule(e){Di=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Ci=e:t.#t=e,this.linked=!1}}};function Pi(e){var t=Oi,n=Ti;Ti=null,Oi=!0;try{var r;for(e&&(Pi(),r=e());;){if(Iee(),wi===null)return r;wi.flush()}}finally{Oi=t,Ti=n}}function Jee(){try{Dee()}catch(e){aa(e,Di)}}var Fi=null;function Ii(e){var t=e.length;if(t!==0){for(var n=0;n0)){Vi.clear();for(let e of Fi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Fi.has(n)&&(Fi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Ya(n)}}Fi.clear()}}Fi=null}}function Li(e){wi.schedule(e)}function Ri(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ui(e,1024);for(var n=e.first;n!==null;)Ri(n,t),n=n.next}}function zi(e){ui(e,1024);for(var t=e.first;t!==null;)zi(t),t=t.next}var Bi=new Set,Vi=new Map,Hi=!1;function Ui(e,t){return{f:0,v:e,reactions:null,equals:Yr,rv:0,wv:0}}function j(e,t){let n=Ui(e,t);return Fa(n),n}function Wi(e,t=!1,n=!0){let r=Ui(e);return t||(r.equals=Xr),r}function M(e,t,n=!1){return ka!==null&&(!Aa||ka.f&131072)&&oi()&&ka.f&4325394&&(Pa===null||!Pa.has(e))&&jee(),qi(e,n?Yi(t):t,ji)}var Gi=null,Ki=0;function qi(e,t,n=null){if(!e.equals(t)){Da?Vi.set(e,t):Vi.has(e)||Vi.set(e,e.v);var r=Ni.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&bi(t),Ei===null&&di(t)}e.wv=Ua(),Gi=null,Ki=0,Xee(e,2048,n),Gi=null,oi()&&Ma!==null&&Ma.f&1024&&!(Ma.f&96)&&(Ra===null?dte([e]):Ra.push(e)),!r.is_fork&&Bi.size>0&&!Hi&&Yee()}return t}function Yee(){Hi=!1;for(let e of Bi){e.f&1024&&ui(e,4096);let t;try{t=Wa(e)}catch{t=!0}t&&Ya(e)}Bi.clear()}function Ji(e){M(e,e.v+1)}function Xee(e,t,n){var r=e.reactions;if(r!==null){var i=oi(),a=r.length;if(Ki+=a,Ki>1e5&&Gi===null&&(Gi=new Set),Gi!==null){if(Gi.has(e))return;Gi.add(e)}for(var o=0;o{if(Va===o)return e();var t=ka,n=Va;ja(null),Ha(o);var r=e();return ja(t),Ha(n),r};return r&&n.set(`length`,j(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||kee();var i=n.get(t);return i===void 0?s(()=>{var e=j(r.value,a);return n.set(t,e),e}):M(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>j(zr,a));n.set(t,e),Ji(i)}}else M(r,zr),Ji(i);return!0},get(t,r,i){if(r===kr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||br(t,r)?.writable)&&(o=s(()=>j(Yi(c?t[r]:zr),a)),n.set(r,o)),o!==void 0){var l=z(o);return l===zr?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=z(i);if(a===zr)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===kr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==zr||Reflect.has(e,t);return(r!==void 0||Ma!==null&&(!i||br(e,t)?.writable))&&(r===void 0&&(r=s(()=>j(i?Yi(e[t]):zr,a)),n.set(t,r)),z(r)===zr)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;dj(zr,a)),n.set(d+``,f)):M(f,zr)}if(l===void 0)(!u||br(e,t)?.writable)&&(l=s(()=>j(void 0,a)),M(l,Yi(o)),n.set(t,l));else{u=l.v!==zr;var p=s(()=>Yi(o));M(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&M(h,g+1)}Ji(i)}return!0},ownKeys(e){z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==zr});for(var[r,a]of n)a.v!==zr&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Aee()}})}function Zee(e){try{if(typeof e==`object`&&e&&kr in e)return e[kr]}catch{}return e}function Qee(e,t){return Object.is(Zee(e),Zee(t))}var Xi,Zi,$ee,ete,tte;function nte(){if(Xi===void 0){Xi=window,Zi=document,$ee=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ete=br(t,`firstChild`).get,tte=br(t,`nextSibling`).get,Cr(e)&&(e[Mr]=void 0,e[jr]=null,e[Nr]=void 0,e.__e=void 0),Cr(n)&&(n[Pr]=void 0)}}function Qi(e=``){return document.createTextNode(e)}function $i(e){return ete.call(e)}function ea(e){return tte.call(e)}function N(e,t){if(!Vr)return $i(e);var n=$i(Ur);if(n===null)n=Ur.appendChild(Qi());else if(t&&n.nodeType!==3){var r=Qi();return n?.before(r),Wr(r),r}return t&&ia(n),Wr(n),n}function P(e,t=!1){if(!Vr){var n=$i(e);return n instanceof Comment&&n.data===``?ea(n):n}if(t){if(Ur?.nodeType!==3){var r=Qi();return Ur?.before(r),Wr(r),r}ia(Ur)}return Ur}function F(e,t=!1){if(!Vr)return $i(e);var n=N(e,t);return D(e),n}function I(e,t=1,n=!1){let r=Vr?Ur:e;for(var i;t--;)i=r,r=ea(r);if(!Vr)return r;if(n){if(r?.nodeType!==3){var a=Qi();return r===null?i?.after(a):r.before(a),Wr(a),a}ia(r)}return Wr(r),r}function ta(e){e.textContent=``}function na(){return!1}function ra(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ia(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function rte(e){var t=Ma;if(t===null)return ka.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;aa(e,t)}function aa(e,t){if(e===Rr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function oa(e){Ma===null&&(ka===null&&Eee(e),Tee()),Da&&wee(e)}function ite(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function sa(e,t){var n=Ma;n!==null&&n.f&8192&&(e|=8192);var r={ctx:ti,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};wi?.register_created_effect(r);var i=r;if(e&4)Ai===null?Ni.ensure().schedule(r):Ai.push(r);else if(t!==null){try{Ya(r)}catch(e){throw ya(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&ite(i,n),ka!==null&&ka.f&2&&!(e&64))){var a=ka;(a.effects??=[]).push(i)}return r}function ca(){return ka!==null&&!Aa}function la(e){let t=sa(8,null);return ui(t,1024),t.teardown=e,t}function L(e){oa(`$effect`);var t=Ma.f;if(!ka&&t&32&&ti!==null&&!ti.i){var n=ti;(n.e??=[]).push(e)}else return ua(e)}function ua(e){return sa(1048580,e)}function da(e){return oa(`$effect.pre`),sa(1048584,e)}function fa(e){Ni.ensure();let t=sa(524352,e);return()=>{ya(t)}}function ate(e){Ni.ensure();let t=sa(524352,e);return(e={})=>new Promise(n=>{e.outro?Sa(t,()=>{ya(t),n(void 0)}):(ya(t),n(void 0))})}function pa(e){return sa(4,e)}function ote(e){return sa(4718592,e)}function ma(e,t=0){return sa(8|t,e)}function R(e,t=[],n=[],r=[]){pi(r,t,n,t=>{sa(8,()=>{e(...t.map(z))})})}function ste(e,t=[],n=[],r=[]){pi(r,t,n,t=>{sa(4,()=>e(...t.map(z)))})}function ha(e,t=0){return sa(16|t,e)}function cte(e,t=0){return sa(16777216|t,e)}function ga(e){return sa(524320,e)}function _a(e){var t=e.teardown;if(t!==null){let n=Da,r=ka;Oa(!0),ja(null);try{t.call(null)}catch(t){aa(t,e.parent)}finally{Oa(n),ja(r)}}}function va(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&fi(()=>{e.abort(Ir)});var r=n.next;n.f&64?n.parent=null:ya(n,t),n=r}}function lte(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ya(t),t=n}}function ya(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(ba(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,va(e,t&&!n),Ja(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();_a(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&xa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ba(e,t){for(;e!==null;){var n=e===t?null:ea(e);e.remove(),e=n}}function xa(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Sa(e,t,n=!0){var r=[];e.f|=256,Ca(e,r,!0);var i=()=>{n&&ya(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Ca(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Ca(i,t,o?n:!1)}i=a}}}function wa(e){e.f&=-257,Ta(e,!0)}function Ta(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(ui(e,2048),Ni.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Ta(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ea(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ea(n);t.append(n),n=i}}var ute=null,Da=!1;function Oa(e){Da=e}var ka=null,Aa=!1;function ja(e){ka=e}var Ma=null;function Na(e){Ma=e}var Pa=null;function Fa(e){ka!==null&&(ka.f&2097152||ka.f&2)&&(Pa??=new Set).add(e)}var Ia=null,La=0,Ra=null;function dte(e){Ra=e}var za=1,Ba=0,Va=Ba;function Ha(e){Va=e}function Ua(){return++za}function Wa(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Ei===null&&ui(e,1024)}return!1}function Ga(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Pa!==null&&Pa.has(e)))for(var i=0;i{e.ac.abort(Ir)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=qa(e);if(oi()&&Ra!==null&&!Aa&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=La+Ia.length,r=0;r{a.ac.abort(Ir),a.ac=null,ui(a,2048)}),Kee(a),Ja(a,0)}}function Ja(e,t){var n=e.deps;if(n!==null)for(var r=t;r{e.isConnected&&e.dispatchEvent(t)}))}function io(e,t,n,r={}){function i(e){if(r.capture||fo.call(t,e),!e.cancelBubble)return fi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,li(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function ao(e,t,n,r={}){var i=io(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function oo(e,t,n,r,i){var a={capture:r,passive:i},o=io(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&la(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function so(e,t,n){(t[to]??={})[e]=n}function co(e){for(var t=0;t{uo=!1,lo=null}));var o=0,s=lo===e&&e[to];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[to]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){yr(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=ka,d=Ma;ja(null),Na(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[to]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o{throw e});throw f}}finally{e[to]=t,delete e.currentTarget,ja(u),Na(d)}}}var wte=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Tte(e){return wte?.createHTML(e)??e}function Ete(e){var t=ra(`template`);return t.innerHTML=Tte(e.replaceAll(``,``)),t.content}function po(e,t){var n=Ma;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function B(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(Vr)return po(Ur,null),Ur;i===void 0&&(i=Ete(a?e:``+e),n||(i=$i(i)));var t=r||$ee?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=$i(t),s=t.lastChild;po(o,s)}else po(t,t);return t}}function V(e=``){if(!Vr){var t=Qi(e+``);return po(t,t),t}var n=Ur;return n.nodeType===3?ia(n):(n.before(n=Qi()),Wr(n)),po(n,n),n}function H(){if(Vr)return po(Ur,null),Ur;var e=document.createDocumentFragment(),t=document.createComment(``),n=Qi();return e.append(t,n),po(t,n),e}function U(e,t){if(Vr){var n=Ma;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Ur),Gr()}else e!==null&&e.before(t)}function mo(){if(Vr&&Ur&&Ur.nodeType===8&&Ur.textContent?.startsWith(`$`)){let e=Ur.textContent.substring(1);return Gr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Dte(e){let t=0,n=Ui(0),r;return()=>{ca()&&(z(n),ma(()=>(t===0&&(r=$a(()=>e(()=>Ji(n)))),t+=1,()=>{li(()=>{--t,t===0&&(r?.(),r=void 0,Ji(n))})})))}}var Ote=589824;function ho(e,t,n,r){new kte(e,t,n,r)}var kte=class{parent;is_pending=!1;transform_error;#e;#t=Vr?Ur:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Dte(()=>(this.#m=Ui(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Ma;t.b=this,t.f|=128,n(e)},this.parent=Ma.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=ha(()=>{if(Vr){let e=Jr(this.#t);Gr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},Ote),Vr&&(this.#e=Ur)}#g(){try{this.#a=ga(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);li(r),t&&(this.#s=ga(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?bee():(t=!0,n&&Mee(),this.#s!==null&&Sa(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){aa(e,this.#i&&this.#i.parent)}}}}#y(){return!!(this.#i.f&33570816)}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=ga(()=>e(this.#e)),li(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=Qi(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return ga(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){aa(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(wi)):this.#u===0&&(this.#e.before(e),this.#c=null,Sa(this.#o,()=>{this.#o=null}),this.#S(wi))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=ga(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ea(this.#a,e);let t=this.#n.pending;this.#o=ga(()=>t(this.#e))}else this.#S(wi)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ree(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=Ma,n=ka,r=ti;Na(this.#i),ja(this.#i),ni(this.#i.ctx);try{return Ni.ensure(),e()}finally{Na(t),ja(n),ni(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&Sa(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,li(()=>{this.#d=!1,this.#m&&qi(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),z(this.#m)}error(e){if(e===Rr||!this.#n.onerror&&!this.#n.failed)throw e;wi?.is_fork?(this.#a&&wi.skip_effect(this.#a),this.#o&&wi.skip_effect(this.#o),this.#s&&wi.skip_effect(this.#s),wi.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(ya(this.#a),null),this.#o&&=(ya(this.#o),null),this.#s&&=(ya(this.#s),null),Vr&&(Wr(this.#t),Kr(),Wr(qr()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return ga(()=>{var r=Ma;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return aa(e,this.#i.parent),null}}))};li(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){aa(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>aa(e,this.#i&&this.#i.parent)):n(t)}})}};function W(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Pr]??=e.nodeValue)&&(e[Pr]=n,e.nodeValue=`${n}`)}function go(e,t){return Ate(e,t)}var _o=new Map;function Ate(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){nte();var c=void 0,l=ate(()=>{var o=n??t.appendChild(Qi());ho(o,{pending:()=>{}},t=>{O({});var n=ti;if(a&&(n.c=a),i&&(r.$$events=i),Vr&&po(t,null),c=e(t,r)||ai(),Vr&&(Ma.nodes.end=Ur,Ur===null||Ur.nodeType!==8||Ur.data!==`]`))throw Br(),Rr;k()},s);var l=new Set,u=e=>{for(var n=0;n{for(var e of l)for(let n of[t,document]){var r=_o.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,fo),r.delete(e),r.size===0&&_o.delete(n)):r.set(e,i)}ro.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return vo.set(c,l),c}var vo=new WeakMap;function yo(e,t){let n=vo.get(e);return n?(vo.delete(e),n(t)):Promise.resolve()}var bo=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)wa(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(wa(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ya(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ea(r,t),t.append(Qi()),this.#n.set(e,{effect:r,fragment:t})}else ya(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Sa(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ya(n.effect),this.#n.delete(e))};ensure(e,t){var n=wi,r=na();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=Qi();i.append(a),this.#n.set(e,{effect:ga(()=>t(a)),fragment:i})}else this.#t.set(e,ga(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Vr&&(this.anchor=Ur),this.#a(n)}},xo=0,So=1,jte=2;function Co(e,t,n,r,i){Vr&&Gr();var a=oi(),o=zr,s=a?Ui(o):Wi(o,!1,!1),c=a?Ui(o):Wi(o,!1,!1),l=new bo(e);ha(()=>{var a=wi,o=t(),u=!1;let d=Vr&&Er(o)===(e.data===`[!`);if(d&&(Wr(qr()),Hr(!1)),Er(o)){var f=mi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),wi===a&&a.deactivate(),Ni.ensure();try{e()}finally{hi(!1),Oi||Pi()}}};o.then(t=>{e(()=>{qi(s,t),l.ensure(So,r&&(e=>r(e,s)))})},t=>{e(()=>{if(qi(c,t),l.ensure(jte,i&&(e=>i(e,c))),!i)throw c.v})}),Vr?l.ensure(xo,n):li(()=>{p||e(()=>{l.ensure(xo,n)})})}else qi(s,o),l.ensure(So,r&&(e=>r(e,s)));return d&&Hr(!0),()=>{u=!0}})}function G(e,t,n=!1){var r;Vr&&(r=Ur,Gr());var i=new bo(e),a=n?65536:0;function o(e,t){if(Vr){var n=Jr(r);if(e!==parseInt(n.substring(1))){var a=qr();Wr(a),i.anchor=a,Hr(!1),i.ensure(e,t),Hr(!0);return}}i.ensure(e,t)}ha(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Mte=Symbol(`NaN`);function wo(e,t,n){Vr&&Gr();var r=new bo(e),i=!oi();ha(()=>{var e=t();e!==e&&(e=Mte),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function To(e,t){Vr&&Wr($i(e)),ma(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Eo(e,t){return t}function Nte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Do(e,vr(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;ta(u),u.append(l),e.items.clear()}Do(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Do(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return gr(e)?e:e==null?[]:vr(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=z(u);h.fallback=l,Pte(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,jo(l,null,o)):wa(l):Sa(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:ha(()=>{var e=z(u),c=e.length;let h=!1;Vr&&Jr(o)===`[!`!=(c===0)&&(o=qr(),Wr(o),Hr(!1),h=!0);for(var g=new Set,_=wi,v=na(),y=0;ya(o)):(l=ga(()=>a(Oo??=Qi())),l.f|=33554432)),c>g.size&&Cee(``,``,``),Vr&&c>0&&Wr(qr()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Hr(!0),z(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,Vr&&(o=Ur)}function Ao(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Pte(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=Ao(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_0){var T=r&4&&o===0?n:null;if(a){for(_=0;_{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Fte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ui(n):Wi(n,!1,!1):null,l=o&2?Ui(i):null;return{v:c,i:l,e:ga(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function jo(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ea(r);if(a.before(r),r===i)return;r=o}}function Mo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function No(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;Vr&&(o=Wr($i(c)))}R(()=>{var e=Ma;if(s===(s=t()??``))Vr&&Gr();else if(n&&!Vr)e.nodes=null,c.innerHTML=s,s!==``&&po($i(c),c.lastChild);else if(e.nodes!==null&&(ba(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(Vr){for(var a=Ur.data,l=Gr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=ea(l);if(l===null)throw Br(),Rr;po(Ur,u),o=Wr(l)}else{var d=ra(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(po($i(f),f.lastChild),r||i)for(;$i(f);)o.before($i(f));else o.before(f)}}})}function Po(e,t,...n){var r=new bo(e);ha(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function Fo(e,t,n){var r;Vr&&(r=Ur,Gr());var i=new bo(e);ha(()=>{var e=t()??null;if(Vr&&Jr(r)===`[`!=(e!==null)){var a=qr();Wr(a),i.anchor=a,Hr(!1),i.ensure(e,e&&(t=>n(t,e))),Hr(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Ite=()=>performance.now(),Io={tick:e=>requestAnimationFrame(e),now:()=>Ite(),tasks:new Set};function Lo(){let e=Io.now();Io.tasks.forEach(t=>{t.c(e)||(Io.tasks.delete(t),t.f())}),Io.tasks.size!==0&&Io.tick(Lo)}function Lte(e){let t;return Io.tasks.size===0&&Io.tick(Lo),{promise:new Promise(n=>{Io.tasks.add(t={c:e,f:n})}),abort(){Io.tasks.delete(t)}}}function Rte(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Ro(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Rte(n.trim());t[i]=r.trim()}return t}var zte=e=>e,zo=null;function Bo(e){zo=e}function Vo(e,t,n){var r=(zo??Ma).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Ho(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Ho(e,t,n,r,i,a){var o=r===1,s=!1;if(wr(t)){var c;return li(()=>{s||(c=Ho(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:Tr,deactivate:Tr,reset:Tr,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=zte}=t;var p,m=()=>1-r;return li(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=Ro(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=Ro(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Lte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=Tr)},deactivate:()=>{a=Tr},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Bte(e,t,n,r,i,a){let o=Vr;Vr&&Gr();var s=null;Vr&&Ur.nodeType===1&&(s=Ur,Gr());var c=Vr?Ur:e,l=Ma,u=new bo(c,!1);ha(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=Vr;if(s=Vr?s:ra(e,a),po(s,s),r){var i=null;Vr&&Ste(e)&&s.append(i=document.createComment(``));var o=Vr?$i(s):s.appendChild(Qi());Vr&&(o===null?Hr(!1):Wr(o)),Bo(l),r(s,o),i?.remove(),Bo(null)}Ma.nodes.end=s,n||t.before(s)}Vr&&Wr(t)}),()=>{}},65536),la(()=>{}),o&&(Hr(!0),Wr(c))}function Uo(e,t){let n=null,r=Vr;var i;if(Vr){n=Ur;for(var a=$i(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=ea(a);if(a===null)Hr(!1);else{var o=ea(a);a.remove(),Wr(o)}}Vr||(i=document.head.appendChild(Qi()));try{ha(()=>{var e=ga(()=>t(i));e.f|=262144,Vr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(Hr(!0),Wr(n))}}function K(e,t){pa(()=>{e=Ma?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=ra(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function Wo(e,t){var n=void 0,r;cte(()=>{n!==(n=t())&&(r&&=(ya(r),null),n&&(r=ga(()=>{pa(()=>n(e))})))})}function Go(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||qo.includes(r[o-1]))&&(s===r.length||qo.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Jo(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Yo(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ute(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Yo)),i&&c.push(...Object.keys(i).map(Yo));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(Gte)||(`__defaultValue`in e&&ts(e,!1),`__value`in e&&ns(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),la(()=>{t.disconnect()})}function rs(e){return`__value`in e?e.__value:e.value}function Gte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var is=Symbol(`class`),as=Symbol(`style`),os=Symbol(`is custom element`),ss=Symbol(`is html`),Kte=Lr?`link`:`LINK`,cs=Lr?`input`:`INPUT`,qte=Lr?`option`:`OPTION`,ls=Lr?`select`:`SELECT`,Jte=Lr?`progress`:`PROGRESS`;function Yte(e){if(Vr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;q(e,`checked`,null),e.checked=r}}};e[Fr]=n,li(n),Hee()}}function q(e,t,n,r){var i=ds(e);Vr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Kte)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[_ee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ps(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Xte(e,t,n,r,i=!1,a=!1){Vr&&i&&e.nodeName===cs&&(`defaultValue`in n||`defaultChecked`in n||Yte(e));var o=ds(e),s=o[os],c=!o[ss];let l=Vr&&s;l&&Hr(!1);var u=t||{},d=e.nodeName===qte,f=e.nodeName===ls;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=Ko(n.class):(r||n[is])&&(n.class=null),n[as]&&(n.style??=null);var m=ps(e);if(e.nodeName===cs&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,q(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)Xo(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[is],n[is]),u[i]=l,u[is]=n[is];else if(i===`style`)Qo(e,l,t?.[as],n[as]),u[i]=l,u[as]=n[as];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=hte(r);if(pte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)so(r,e,l),co([r]);else if(l!=null){function y(e){u[i].call(this,e)}u[n]=io(r,e,y,t)}}else if(i===`style`)q(e,i,l);else if(i===`autofocus`)zee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===Jte)&&(e.value=l);else if(i===`selected`&&d)$o(e,l);else{var b=i;c||(b=vte(b));var x=b===`defaultValue`||b===`defaultChecked`;if(f&&b===`defaultValue`)continue;if(l==null&&!s&&!x){if(o[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else x||(s||typeof l!=`string`)&&m.has(b)?(e[b]=l,b in o&&(o[b]=zr)):typeof l!=`function`&&q(e,b,l,a)}}}}}}finally{l&&Hr(!0)}return u}function us(e,t,n=[],r=[],i=[],a,o=!1,s=!1){pi(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===ls,l=!1;if(cte(()=>{var u=t(...n.map(z)),d=Xte(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&es(f,u.defaultValue),`value`in u&&ns(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||ya(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&ya(i[t]),i[t]=ga(()=>Wo(e,()=>p))),d[t]=p}r=d}),c){var u=e;pa(()=>{var e=r;`defaultValue`in e&&es(u,e.defaultValue),ns(u,e.value,!0),Wte(u)})}l=!0})}function ds(e){return e[jr]??={[os]:e.nodeName.includes(`-`),[ss]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var fs=new Map;function ps(e){var t=e.getAttribute(`is`)||e.nodeName,n=fs.get(t);if(n)return n;fs.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=fee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=Sr(i)}return n}function Zte(e,t,n=t){var r=new WeakSet;Uee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ms(e)?hs(a):a,n(a),wi!==null&&r.add(wi),await Xa(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Vr&&e.defaultValue!==e.value||$a(t)==null&&e.value)&&(n(ms(e)?hs(e.value):e.value),wi!==null&&r.add(wi)),ma(()=>{var n=t();if(e===document.activeElement){var i=wi;if(r.has(i))return}ms(e)&&n===hs(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ms(e){var t=e.type;return t===`number`||t===`range`}function hs(e){return e===``?null:+e}var Qte=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function $te(e,t,n){var r=Qte.observe(e,()=>n(e[t]));pa(()=>($a(()=>n(e[t])),r))}function gs(e,t){return e===t||e?.[kr]===t}function _s(e=ai(),t,n,r){var i=ti.r,a=Ma;return pa(()=>{var o,s;return ma(()=>{o=s,s=r?.()||[],$a(()=>{gs(n(...s),e)||(t(e,...s),o&&gs(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&gs(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var vs=!1;function ene(e){var t=vs;try{return vs=!1,[e(),vs]}finally{vs=t}}var tne={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function ys(e,t,n){return new Proxy({props:e,exclude:t},tne)}var nne={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(wr(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];wr(i)&&(i=i());let a=br(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(wr(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=br(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===kr||t===Ar)return!1;for(let n of e.props)if(wr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(wr(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function bs(...e){return new Proxy({props:e},nne)}function J(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=_i(r),z(l)):(c&&(c=!1,s=o?$a(r):r),s);let d;if(a){var f=kr in e||Ar in e;d=br(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=ene(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Oee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?_i:yi)(()=>(_=!1,h()));a&&z(v);var y=Ma;return(function(e,t){if(arguments.length>0){let n=t?z(v):i&&a?Yi(e):e;return M(v,n),_=!0,s!==void 0&&(s=n),e}return Da&&_||y.f&16384?v.v:z(v)})}function xs(e){ti===null&&Zr(`onMount`),L(()=>{let t=$a(e);if(typeof t==`function`)return t})}function Ss(e){ti===null&&Zr(`onDestroy`),xs(()=>()=>$a(e))}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var rne=/^[\u061c\u200e\u200f\u2066-\u2069]+/,ine=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,ane=/^[-.0-9]/;function one(e,t){let n=t,r=e.slice(n).match(rne);r&&(n+=r[0].length);let i=e.slice(n).match(ine);if(!i)return null;let a=i[0];if(ane.test(a))return null;n+=a.length;let o=e.slice(n).match(rne);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var sne=(e,t)=>e.slice(t).match(ine)?.[0]??``,cne=Symbol.for(`CST`),Cs=class extends Error{type;constructor(e,t){super(t),this.type=e}},ws=class extends Cs{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},lne=class extends ws{constructor(e,t){let{start:n,end:r}=t[cne]??{start:-1,end:-1};super(e,n,r)}},Ts=class extends Cs{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Es=class extends Cs{source;cause;constructor(e,t){super(e,t),this.source=`�`}},une=new Set(`؜‎‏⁦⁧⁨⁩`),dne=new Set(` -\r  `),Ds,Os,ks=(e,t)=>new ws(`missing-syntax`,e,e+t.length,t),As=(...e)=>new ws(...e);function js(e,t){if(Os.startsWith(e,Ds))t&&(Ds+=e.length);else throw ks(Ds,e)}function fne(e){Ds=0,Os=e;let t=gne();if(Os.startsWith(`.match`,Ds))return pne(t);let n=t.length>0||Os.startsWith(`{{`,Ds);!n&&Ds>0&&(Ds=0);let r=hne(n);if(n&&(Is(),Ds{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function Ene(e,t=(e,t)=>{throw new lne(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;Tne(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var Dne=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Ls(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return Dne.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function One(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function Rs(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function zs(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Bs(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Es(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Vs(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Ls(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Ls(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function Hs(e,t,n){let r=Bs(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=Rs(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=zs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Vs(e,i,a,!0)}function kne(e,t,n){let r=Bs(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=Rs(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=zs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Vs(e,i,a,!0)}function Ane(e,t,n){let r=Bs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=zs(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Rs(r);break;case`currencyDisplay`:{let t=zs(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=zs(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=Rs(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Es(`bad-operand`,`A currency code is required for :currency`);return Vs(e,r.value,i,!1)}var jne=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Mne=new Set([`long`,`medium`,`short`]),Nne=new Set([`hour`,`minute`,`second`]),Pne=new Set([`long`,`short`]),Fne=(e,t,n)=>Us(`datetime`,e,t,n),Ine=(e,t,n)=>Us(`date`,e,t,n),Lne=(e,t,n)=>Us(`time`,e,t,n);function Us(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Es(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=zs(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=One(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=zs(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Es(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Ws(t,n,r,jne)??`year-month-day`,s=Ws(t,n,a,Mne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Ws(t,n,e===`time`?`precision`:`timePrecision`,Nne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Ws(t,n,`timeZoneStyle`,Pne)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Ls(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Ls(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Ws(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=zs(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Rne(e,t,n){let{value:r,options:i}=Bs(n),a;try{a=`add`in t?Rs(t.add):-1}catch{throw new Es(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?Rs(t.subtract):-1}catch{throw new Es(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Es(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),Hs(e,{},{valueOf:()=>r,options:i})}function zne(e,t,n){let r=Bs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=zs(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=Rs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Vs(e,r.value,i,!0)}function Bne(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Vne(e,t,n){let r=Bs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=zs(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Rs(r)}}catch(t){t instanceof Cs?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Es(`bad-operand`,`A unit identifier is required for :unit`);return Vs(e,r.value,i,!1)}var Gs={currency:Ane,integer:kne,number:Hs,offset:Rne,percent:zne,string:Bne};Gs=Object.freeze(Object.assign(Object.create(null),Gs));var Ks={date:Ine,datetime:Fne,time:Lne,unit:Vne};Ks=Object.freeze(Object.assign(Object.create(null),Ks));var qs=Symbol(`bidi-isolate`),Js=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Hne=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),Ys=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(tc(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Es(`bad-option`,`Unsupported value for u:dir option`);t.source=nc(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(tc(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Es?n=e:typeof e==`string`&&typeof t==`string`?n=new Es(e,t):(n=new Es(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function Une(e,t,{name:n,options:r}){let i=`:${n}`,a=nc(t)??i;try{let o=t?[tc(e,t)]:[],s=e.functions[n];if(!s)throw new Ts(`unknown-function`,`Unknown function ${i}`,a);let c=new Ys(e,a,r),l=s(c,Wne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new Ts(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[qs]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof Cs?t:new Ts(`bad-function-result`,String(t),a,t)),Js(a)}}function Wne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=tc(e,i));return n}function Xs(e,{arg:t,functionRef:n}){if(n)return Une(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Bne(new Ys(e,n),{},t.value);return r.source=n,r}case`variable`:return ec(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var Zs=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Gne=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function Qs(e,t){if(Gne(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return Qs(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function $s(e,{name:t}){let n=Qs(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new Ts(`unresolved-variable`,r,n))}else if(n instanceof Zs){let r=Xs(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function ec(e,t){let n=`$`+t.name,r=$s(e,t);if(r===void 0)return Js(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return Js(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Hne(n,r)}let o=new Ys(e,n),s=a(o,{},r);return s.source=n,s}function tc(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return $s(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function nc(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function rc(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Es(`bad-option`,`The option ${t} is not valid for markup`);r.source=nc(n),e.onError(r)}else{let r=tc(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function ic(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=ec(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new Ts(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;inull,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;enew Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Ls(this.#r[0]),this.#i=typeof t==`string`?fne(t):t,Ene(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),Gs,n.functions):Gs}format(e,t){let n=this.#o(e,t),r=``;for(let e of ic(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)rc(n,e);else{let t;try{if(t=Xs(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[qs])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new Es(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of ic(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(rc(n,e));else{let t;try{if(t=Xs(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[qs])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new Es(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new Zs(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var ac=j(``),oc=``,sc=Yi([]),cc=Yi({}),lc=``,uc=``,dc,fc={},Kne={},pc,mc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},hc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},gc=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},_c=new Map,vc=e=>{if(!_c.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();_c.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{_c.set(e,void 0)}return _c.get(e)},yc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=vc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=vc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>vc(t)?.region===e):void 0;return c(o)??c(vc(r)?.preferredRegion)??s[0]},bc=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,bc(r,i)):e[i]=r,e},Object.create(null)),xc=e=>{sc.includes(e)||(sc.push(e),uc=yc(lc,sc))},Sc=e=>{if(!e||!sc.length)return e;let t=yc(e,sc);return!sc.includes(t)&&uc&&sc.includes(uc)?uc:t},Cc=()=>{oc&&Sc(oc)!==z(ac)&&Oc.set(oc)},wc=(e,...t)=>{mc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),xc(e),cc[e]??={};let n=cc[e],r={...are,...Kne};t.forEach(t=>{Object.entries(bc(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),Cc()},Tc=new Map,Ec=new Map,qne=(e=z(ac))=>{if(hc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Ec.get(e);if(!t){let n=Tc.get(e);t=n?Promise.resolve(n()).then(t=>{wc(e,t)},()=>{if(Ec.delete(e),z(ac)===e&&!cc[e]&&uc&&uc!==e)return Oc.set(uc)}):Promise.resolve(),Ec.set(e,t)}return t},Dc=(e=z(ac))=>Ls(e)===`rtl`,Oc={get current(){return z(ac)},set(e){hc(`locale.set: value`,e),oc=e;let t=Sc(e);if(M(ac,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Ls(t);e!==`auto`&&(document.documentElement.dir=e)}return qne(t)}},Jne=(e,t)=>{mc(`register: localeCode`,e),gc(`register: loader`,t),Tc.set(e,t),Ec.delete(e),xc(e),Cc()},Yne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>yc(e,sc)).find(e=>sc.includes(e))??e[0]},Xne=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&hc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&gc(`init: handleMissingMessage`,e.handleMissingMessage),lc=e.fallbackLocale,uc=yc(lc,sc),dc=e.handleMissingMessage,fc=e.formats??{},e.initialLocale&&Oc.set(e.initialLocale)},Zne=(e,t)=>{let n=cc[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Qne=e=>{let t=e??z(ac);return t===uc?[t]:[t,uc]},Y=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return Y(t,n)}let a=Qne(n),[o]=a,s=a.reduce((t,n)=>t??Zne(n,e),void 0);pc=i;let c;try{c=s?.format(t)}finally{pc=void 0}if(c!==void 0)return c;if(dc){let t=dc(e,o,r);if(t!==void 0)return t}return r??e},$ne=`_default`,ere={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},tre=(e,t)=>fc[e]?.[t]??ere[e]?.[t],nre=e=>fc[e]?.[$ne],rre=e=>{let t=pc?.[e];return(typeof t==`string`?tre(e,t):t)??nre(e)},ire=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Ls(n):e.dir,toString:()=>t.format(r)}},kc=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=rre(t);if(!s)return o;let{locale:c,...l}=s;return ire(o,new n(c??r.locales,l),c)},are={...Ks,date:kc(Ks.date,`date`,Intl.DateTimeFormat),time:kc(Ks.time,`time`,Intl.DateTimeFormat),datetime:kc(Ks.datetime,`datetime`,Intl.DateTimeFormat),number:kc(Gs.number,`number`,Intl.NumberFormat),integer:kc(Gs.integer,`number`,Intl.NumberFormat)},ore=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),sre=B(` `),cre={hash:`svelte-tawm7e`,code:`.icon.small-arrow.svelte-tawm7e {overflow:hidden;width:12px;text-indent:-6px;}`};function Ac(e,t){K(e,cre);let n=ys(t,ore);var r=sre();us(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-tawm7e`);var i=F(r,!0);R(()=>W(i,t.name)),U(e,r)}var lre=B(` `,1),ure={hash:`svelte-13rggru`,code:`.status-label.svelte-13rggru {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function jc(e,t){O(t,!0),K(e,ure);let n=J(t,`children`,3,void 0),r=J(t,`icon`,3,void 0);var i=lre(),a=P(i),o=e=>{var t=H();Po(P(t),r),U(e,t)},s=e=>{{let n=A(()=>t.status===`success`?`check_circle`:t.status);Ac(e,{get name(){return z(n)}})}};G(a,e=>{r()?e(o):e(s,-1)});var c=I(a,2),l=F(c,!0);Po(I(c,2),()=>n()??Tr),R(e=>W(l,e),[()=>Y(`_sui.alert.${t.status}`)]),U(e,i),k()}var Mc=e=>e===`error`||e===`warning`?`alert`:`status`,Nc=(e,t)=>t??(e===`alert`?`assertive`:`polite`),dre=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),fre=B(`
`),pre={hash:`svelte-1og5kyy`,code:`.alert.svelte-1og5kyy {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-1og5kyy {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-1og5kyy {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-1og5kyy {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-1og5kyy {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function Pc(e,t){O(t,!0),K(e,pre);let n=J(t,`ariaLive`,3,void 0),r=ys(t,dre),i=A(()=>Mc(t.status));var a=fre();us(a,e=>({...r,role:z(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>Nc(z(i),n())],void 0,void 0,`svelte-1og5kyy`),jc(N(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),D(a),U(e,a),k()}var Fc,Ic=()=>(Fc??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),Fc),mre=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),hre=new Set([`Control`,`Meta`,`Alt`,`Shift`]),gre=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),_re=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(gre.has(e))return({code:t})=>t===e;let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&!e.getModifierState?.(`AltGraph`)?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},Lc=e=>e.replace(/\bAccel\b/g,Ic()?`Meta`:`Ctrl`),Rc=new Map,zc=e=>{let t=Rc.get(e);return t||(t=Lc(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!mre.has(e)).map(_re)}}),Rc.set(e,t)),t},Bc=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):hre.has(o)))},Vc=(e,t)=>Bc(e,zc(t)),Hc=new Map,vre=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},yre=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),bre=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!yre.has(e.type)),xre=e=>Ic()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&bre(e.composedPath()[0]),Uc=e=>{xre(e)||Hc.forEach((t,n)=>{Bc(e,t)&&vre(n,e)})},Wc=(e=``)=>{let t=Lc(e).trim().replace(/\s+/g,` `);if(!t)return()=>()=>{};let n=zc(e);return e=>(Hc.size||globalThis.addEventListener(`keydown`,Uc,{capture:!0}),Hc.set(e,n),e.setAttribute(`aria-keyshortcuts`,t),()=>{Hc.delete(e),e.removeAttribute(`aria-keyshortcuts`),Hc.size||globalThis.removeEventListener(`keydown`,Uc,{capture:!0})})},Gc=e=>e===null?`null`:typeof e,Sre=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},Cre=B(``),wre={hash:`svelte-g9unr9`,code:`.truncated-text.svelte-g9unr9 {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function Kc(e,t){K(e,wre);let n=J(t,`lines`,3,1),r=J(t,`children`,3,void 0);var i=Cre();let a;Po(N(i),()=>r()??Tr),D(i),R(()=>a=Qo(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),U(e,i)}var qc=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),Tre=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,Jc=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},Yc=`abcdefghijklmnopqrstuvwxyz234567`,Ere=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=Yc[n>>>r&31]}),r>0&&(t+=Yc[n<<5-r&31]),t},Xc=()=>Ere(Uint8Array.fromHex(Jc().replaceAll(`-`,``))),Zc=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},Qc=new WeakMap,$c,el=(e=`e`,t=7)=>[e,Jc(t)].join(`-`),tl=e=>{Qc.delete(e),$c?.unobserve(e)},Dre=()=>{if(`IntersectionObserver`in globalThis)return $c||($c=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=Qc.get(t);n&&(n(),tl(t))})}),$c)},Ore=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},nl=e=>{let t=Dre();if(t)return Ore(e)?Promise.resolve(void 0):new Promise(n=>{let r=Qc.get(e);Qc.set(e,r?()=>{r(),n()}:n),kre(()=>{Qc.has(e)&&t.observe(e)})})},Are=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},jre=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},rl=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},Mre=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=jre(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t,n,r)=>{let a=rl({position:f,from:e,to:t,size:i,room:n,otherRoom:r});f=a.position,p=a.cap??p};return f.startsWith(`bottom-`)?m(`bottom-`,`top-`,s,o):f.startsWith(`top-`)&&m(`top-`,`bottom-`,o,s),f.endsWith(`-top`)?m(`-top`,`-bottom`,u,d):f.endsWith(`-bottom`)&&m(`-bottom`,`-top`,d,u),f.endsWith(`-left`)&&a.left+r>n.width-8&&(f=f.replace(`-left`,`-right`)),f.endsWith(`-right`)&&a.right-r<8&&(f=f.replace(`-right`,`-left`)),f.startsWith(`right-`)?{position:f}=rl({position:f,from:`right-`,to:`left-`,size:r,room:l,otherRoom:c}):f.startsWith(`left-`)&&({position:f}=rl({position:f,from:`left-`,to:`right-`,size:r,room:c,otherRoom:l})),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},Nre=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},Pre=class{#e=j(!1);get open(){return z(this.#e)}set open(e){M(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=j(Yi({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return z(this.#t)}set style(e){M(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=el(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=ao(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=ao(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=ao(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.viewportResizeObserver.observe(e);let n=t??e;n.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let r=ao(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),i=ao(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{r(),i()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=Mre({position:Dc()?Are(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});Nre(o,this.style)||(this.style=o)}async hideImmediately(){this.popupElement&&(this.popupElement.hidden=!0),this.open=!1,await qc(50),this.popupElement&&(this.popupElement.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},Fre=(...e)=>new Pre(...e),il=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,Ire=({transitionDuration:e,transitionDelay:t})=>il(e)+il(t)+100;function al(e,t){var n=H();Po(P(n),()=>t.children??Tr),U(e,n)}var ol=Symbol(`sui-modal-retainer`),Lre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),Rre=B(` `),zre={hash:`svelte-c9ra7f`,code:`dialog.svelte-c9ra7f {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-c9ra7f::backdrop {background:transparent;}dialog.backdrop.svelte-c9ra7f {background-color:var(--sui-popup-backdrop-color);}dialog.open.svelte-c9ra7f {transition-duration:50ms;opacity:1;}dialog.svelte-c9ra7f:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-c9ra7f {transition-duration:1ms !important;}dialog.svelte-c9ra7f:not(.active) {pointer-events:none !important;}dialog.svelte-c9ra7f:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function sl(e,t){O(t,!0),K(e,zre);let n=e=>{var n=H(),l=P(n),u=e=>{var n=Rre(),l=({target:e})=>{C=e},u=({target:e})=>{let t=C;C=void 0,!(t&&t!==i())&&i()&&s()&&e?.matches(`dialog`)&&(i(i().returnValue=`cancel`,!0),r(!1))},f=e=>{e.preventDefault(),i()&&c()&&(i(i().returnValue=`cancel`,!0),r(!1))},p=()=>{b&&i()?.isConnected&&!i().open&&(c()?r(!1):i().showModal())};us(n,()=>({tabindex:`-1`,...d,inert:!z(m),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:l,onclick:u,oncancel:f,onclose:p,[is]:{backdrop:o(),open:z(m),active:z(h)}}),void 0,void 0,void 0,`svelte-c9ra7f`);var g=N(n);Po(g,()=>t.extraContent??Tr),Po(I(g,2),()=>t.children??Tr),D(n),_s(n,e=>i(e),()=>i()),U(e,n)};G(l,e=>{z(y)&&e(u)}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`dialog`,15),a=J(t,`role`,3,`dialog`),o=J(t,`showBackdrop`,3,!1),s=J(t,`lightDismiss`,3,!1),c=J(t,`escapeDismiss`,3,!0),l=J(t,`keepContent`,3,!1),u=J(t,`restoreFocus`,3,!0),d=ys(t,Lre),f=()=>{i()?.focus()},p=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},m=j(!1),h=j(!1),g=j(!1),_=j(0),v=ri(ol);ii(ol,{retain:()=>{$a(()=>{M(_,z(_)+1)})},release:()=>{$a(()=>{M(_,z(_)-1)})}});let y=A(()=>l()||z(g)||z(_)>0),b=!1,x=0,S,C,w,T=()=>{let e=S;S=void 0,u()&&e&&(w=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},ee=async()=>{if(await Xa(),!i())return;let e=Ire(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},te=async()=>{if(b)return;b=!0,x+=1;let e=x,{activeElement:n}=document;window.clearTimeout(w),S=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),M(g,!0),await Xa(),e===x&&i()&&!i().open&&(i().showModal(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),M(m,!0),await Xa(),e===x&&i()&&(i().contains(document.activeElement)||f(),await ee(),e===x&&M(h,!0)))},ne=async()=>{if(!b)return;b=!1,x+=1;let e=x,n=z(m),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),T(),M(h,!1),M(m,!1),n&&await ee(),e===x&&(M(g,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},re=Fee();return xs(()=>{let e=go(al,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:re});return()=>{window.clearTimeout(w),i()?.close(),yo(e)}}),L(()=>{r()?te():ne()}),L(()=>{if(z(g))return v?.retain(),()=>{v?.release()}}),k({focus:f,close:p})}var Bre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),Vre=B(`
`),Hre={hash:`svelte-j8glqq`,code:`.content.svelte-j8glqq {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:opacity, transform;}.content.menu.svelte-j8glqq {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-j8glqq .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-j8glqq {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-j8glqq .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-j8glqq {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-j8glqq .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-j8glqq {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-j8glqq {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-j8glqq {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-j8glqq {transform:scale(90%);}.content.touch.combobox.svelte-j8glqq .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-j8glqq {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-j8glqq {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-j8glqq {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-j8glqq {transform:none;}`};function cl(e,t){O(t,!0),K(e,Hre);let n=e=>{var n=Vre();let o,s;Po(N(n),()=>t.children??Tr),D(n),_s(n,e=>a(e),()=>a()),R(()=>{q(n,`hidden`,!r()),o=Xo(n,1,`content ${t.class??``} ${z(m)??``}`,`svelte-j8glqq`,o,{touch:z(v),nested:!!l()}),s=Qo(n,``,s,{inset:z(h)?.style.inset,"z-index":z(h)?.style.zIndex,"min-width":z(h)?.style.minWidth,"max-width":z(h)?.style.maxWidth,"max-height":z(h)?.style.height,visibility:z(h)?.style.inset?void 0:`hidden`})}),oo(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),oo(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`hovered`,15,!1),a=J(t,`content`,15,void 0),o=J(t,`showBackdrop`,3,void 0),s=J(t,`position`,3,`bottom-left`),c=J(t,`positionBaseElement`,3,void 0),l=J(t,`parentDialogElement`,3,void 0),u=J(t,`touchOptimized`,3,!1),d=ys(t,Bre),f=j(void 0),p=j(!1),m=j(void 0),h=j(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};L(()=>{z(h)&&r(z(h).open)}),L(()=>{z(h)&&z(h).open!==r()&&(z(h).open=r())}),L(()=>{l()&&!z(f)&&a()&&(M(f,l()),z(f).append(a()))}),L(()=>{t.anchor&&!z(h)&&(M(h,Fre(t.anchor,void 0,s(),c()),!0),M(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),L(()=>{if(z(h)&&z(f)&&a())return z(h).attachPopupElement(z(f),a()),()=>{z(h)?.detachPopupElement()}}),L(()=>{r()&&z(f)&&z(h)?.checkPosition()});let v=A(()=>u()&&z(p));xs(()=>(M(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{z(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=H(),b=P(y),x=e=>{n(e)},S=e=>{{let i=A(()=>o()??z(v));sl(e,bs(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return z(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await Xa(),a()&&!_({tabStopOnly:!0})&&(await qc(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return z(f)},set dialog(e){M(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};G(b,e=>{l()?e(x):e(S,-1)}),U(e,y),k()}var Ure=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),ll=B(``),Wre=B(` `,1),Gre=B(` `,1),Kre={hash:`svelte-1g8bcs`,code:`button.svelte-1g8bcs {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-1g8bcs {display:none !important;}button.svelte-1g8bcs:not(:disabled):focus-visible {z-index:1;}button.svelte-1g8bcs:is(.primary:where(.svelte-1g8bcs), .secondary:where(.svelte-1g8bcs), .tertiary:where(.svelte-1g8bcs), .ghost:where(.svelte-1g8bcs)) {justify-content:center;border-width:1px;}button.svelte-1g8bcs:is(.primary:where(.svelte-1g8bcs), .secondary:where(.svelte-1g8bcs), .tertiary:where(.svelte-1g8bcs), .ghost:where(.svelte-1g8bcs)) .label:where(.svelte-1g8bcs):only-child {padding:0 4px;}button.primary.svelte-1g8bcs {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-1g8bcs:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-1g8bcs {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-1g8bcs:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-1g8bcs {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-1g8bcs:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-1g8bcs {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-1g8bcs:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-1g8bcs {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-1g8bcs:hover .label:where(.svelte-1g8bcs) {outline:none !important;text-decoration:underline;}button.link.svelte-1g8bcs .label:where(.svelte-1g8bcs) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-1g8bcs .label:where(.svelte-1g8bcs) {text-decoration:underline;}button.small.svelte-1g8bcs {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-1g8bcs .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-1g8bcs {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-1g8bcs {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-1g8bcs {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-1g8bcs:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-1g8bcs {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-1g8bcs {background-color:var(--sui-error-background-color);}button.svelte-1g8bcs .label:where(.svelte-1g8bcs) {padding:0 4px;}button.svelte-1g8bcs > * {pointer-events:none;}`};function ul(e,t){O(t,!0),K(e,Kre);let n=e=>{var t=ll();Kc(N(t),{get lines(){return _()},children:(e,t)=>{Kr();var n=V();R(()=>W(n,h())),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`dir`,g()),t.dir=t.dir}),U(e,t)},r=J(t,`element`,15),i=J(t,`class`,3,``),a=J(t,`type`,3,`button`),o=J(t,`role`,3,`button`),s=J(t,`name`,3,void 0),c=J(t,`value`,3,void 0),l=J(t,`valueType`,19,()=>Gc(c())),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`pressed`,3,void 0),m=J(t,`keyShortcuts`,3,void 0),h=J(t,`label`,3,``),g=J(t,`labelDir`,3,void 0),_=J(t,`lines`,3,1),v=J(t,`variant`,3,void 0),y=J(t,`size`,3,`medium`),b=J(t,`iconic`,3,!1),x=J(t,`pill`,3,!1),S=J(t,`flex`,3,!1),C=J(t,`popupPosition`,3,`bottom-left`),w=J(t,`showPopupBackdrop`,3,!1),T=ys(t,Ure);var ee=Gre(),te=P(ee);us(te,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[is]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-1g8bcs`);var ne=N(te);Po(ne,()=>t.startIcon??Tr);var re=I(ne,2),ie=e=>{var r=H(),i=P(r),a=e=>{n(e)},o=e=>{var n=ll();Po(N(n),()=>t.children??Tr),D(n),U(e,n)};G(i,e=>{h()?e(a):e(o,-1)}),U(e,r)},ae=e=>{var r=Wre(),i=P(r),a=e=>{n(e)};G(i,e=>{h()&&e(a)}),Po(I(i,2),()=>t.children??Tr),U(e,r)};G(re,e=>{v()===`link`?e(ie):e(ae,-1)}),Po(I(re,2),()=>t.endIcon??Tr),D(te),_s(te,e=>r(e),()=>r()),Wo(te,()=>m()&&Wc(m()));var oe=I(te,2),se=e=>{cl(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=H();Po(P(r),()=>t.popup),U(e,r)},$$slots:{default:!0}})};G(oe,e=>{t.popup&&e(se)}),U(e,ee),k()}var qre=B(`
`),Jre=B(`
`),Yre={hash:`svelte-cn03xx`,code:`.infobar.svelte-cn03xx {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-cn03xx {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-cn03xx {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-cn03xx {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-cn03xx {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-cn03xx {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-cn03xx button {font-size:inherit !important;}.message.svelte-cn03xx .icon {font-size:16px; /* !hardcoded */}`};function dl(e,t){O(t,!0),K(e,Yre);let n=J(t,`show`,15,!0),r=J(t,`dismissible`,3,!0),i=J(t,`status`,3,`info`),a=J(t,`ariaLive`,3,void 0),o=J(t,`children`,3,void 0),s=J(t,`icon`,3,void 0),c=A(()=>Mc(i()));var l=H(),u=P(l),d=e=>{var l=Jre(),u=N(l);jc(N(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),D(u);var d=I(u,2),f=e=>{var r=qre(),i=N(r);{let e=A(()=>Y(`_sui.dismiss`));ul(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return z(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{Ac(e,{name:`close`})},$$slots:{default:!0}})}D(r),U(e,r)};G(d,e=>{r()&&e(f)}),D(l),R(e=>{Xo(l,1,Ko([`infobar`,i()]),`svelte-cn03xx`),q(u,`role`,z(c)),q(u,`aria-live`,e)},[()=>Nc(z(c),a())]),U(e,l)};G(u,e=>{n()&&e(d)}),U(e,l),k()}var Xre=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Zre=B(`
`),Qre={hash:`svelte-opt0i6`,code:`.bottom-navigation.svelte-opt0i6 {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-opt0i6:is([inert]:where(.svelte-opt0i6), [hidden]:where(.svelte-opt0i6)) {display:none;}.bottom-navigation.svelte-opt0i6 .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function $re(e,t){K(e,Qre);let n=ys(t,Xre);var r=Zre();us(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-opt0i6`),Po(N(r),()=>t.children??Tr),D(r),U(e,r)}var eie=B(`
`),tie={hash:`svelte-1j6mor0`,code:`.floating-action-button-wrapper.svelte-1j6mor0 {display:contents;} -@media (width < 768px) {.floating-action-button-wrapper.svelte-1j6mor0 {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-1j6mor0 button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-1j6mor0 button .icon {font-size:32px;} -}`};function fl(e,t){K(e,tie);let n=J(t,`children`,3,void 0);var r=eie();Po(N(r),()=>n()??Tr),D(r),U(e,r)}var pl=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},ml=Symbol(`sui-option-registry`),nie=class{#e=j(!1);get expanded(){return z(this.#e)}set expanded(e){M(this.#e,e,!0)}#t=new Set;#n=j(0);#r=[];#i=-1;get#a(){return this.#i!==z(this.#n)&&(this.#r=[...this.#t],this.#i=z(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),M(this.#n,z(this.#n)+1),()=>{this.#t.delete(e),M(this.#n,z(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},rie=()=>ii(ml,new nie),iie=()=>ri(ml),hl=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:Sre(e.dataset.value,t)}},aie=/\p{Diacritic}/gu,gl=e=>e.normalize(`NFD`).replace(aie,``).toLocaleLowerCase(),_l=e=>gl(e.trim()),vl=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},oie=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},bl=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;tn=>{e.activate(),t(n)},Sl=async(e,t)=>{await qc(100),t()||e.activate()},Cl=`[aria-disabled="true"], [aria-hidden="true"]`,wl=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},cie={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},lie=`a[href], button, input, select, textarea, summary, [tabindex]`,uie=(e,t)=>{let n=[...document.querySelectorAll(lie)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},El=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,die=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new yl;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=_l(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=el(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=xl(this,e=>this.onClick(e)),this._onKeyDown=xl(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=cie[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop()}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),Sl(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,El(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{pl(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{wl(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{wl(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.observer.takeRecords().length&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(Cl))}}return this.#n}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return Tl(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?Tl(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await qc(50),uie(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(Cl));if(e?.focus(),e&&document.activeElement===e)return;await qc(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#d(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#f(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#p(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=El(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#d(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#d(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#f(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#m(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#h(e,t,n){e.forEach(e=>{wl(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=El(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#p(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#m(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#h(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:hl(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach(pl)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#g(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#_(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=Dc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=vl(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#v(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#g(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#_(e,t){let{activeMembers:n}=this,r=bl(n.map(e=>_l(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#v(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=vl(this.orientation,n);return i[oie({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=vl(`horizontal`,n),u=c[sie({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=_l(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},Dl=e=>t=>{let n=typeof e==`function`,r=new die(t,n?$a(()=>e()):e);return n&&L(()=>{r.onUpdate(e())}),()=>{r.destroy()}},fie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),pie=B(`
`),mie={hash:`svelte-a5o3tz`,code:`.select-button-group.svelte-a5o3tz {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-a5o3tz:focus-visible {outline-width:0 !important;}.select-button-group.svelte-a5o3tz button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-a5o3tz button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-a5o3tz button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-a5o3tz button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-a5o3tz button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-a5o3tz button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-a5o3tz button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-a5o3tz button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-a5o3tz button {pointer-events:none;}.inner.svelte-a5o3tz {display:contents;}`};function Ol(e,t){O(t,!0),K(e,mie);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`ariaLabel`,3,void 0),c=ys(t,fie);var l=pie();us(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-a5o3tz`);var u=N(l);Po(N(u),()=>t.children??Tr),D(u),D(l),Wo(l,Dl),R(()=>u.inert=r()),U(e,l),k()}var hie=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function kl(e,t){O(t,!0);let n=J(t,`selected`,15,!1),r=ys(t,hie);ul(e,bs(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),k()}var gie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),_ie=B(` `,1);function Al(e,t){O(t,!0);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`popupPosition`,3,`bottom-left`),a=J(t,`popupPositionBaseElement`,3,void 0),o=J(t,`showPopupBackdrop`,3,!1),s=J(t,`label`,3,``),c=J(t,`variant`,3,void 0),l=J(t,`size`,3,`medium`),u=J(t,`iconic`,3,!1),d=ys(t,gie),f=j(void 0);var p={focus:()=>{z(f)?.focus()}},m=_ie(),h=P(m);return ul(h,bs(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e=>{var n=H();Po(P(n),()=>t.startIcon??Tr),U(e,n)},children:e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)},endIcon:e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.endIcon),U(e,n)},a=e=>{Ac(e,{name:`more_vert`})},o=e=>{Ac(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),cl(I(h,2),{get anchor(){return z(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=H();Po(P(r),()=>t.popup??Tr),U(e,r)},$$slots:{default:!0}}),U(e,m),k(p)}var vie=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),yie=B(`
`),bie={hash:`svelte-kq8f8b`,code:`.split-button.svelte-kq8f8b {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-kq8f8b button {margin:0;}.split-button.svelte-kq8f8b button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-kq8f8b button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function jl(e,t){O(t,!0),K(e,bie);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`label`,3,``),a=J(t,`variant`,3,void 0),o=J(t,`size`,3,`medium`),s=J(t,`popupPosition`,3,`bottom-left`),c=J(t,`showPopupBackdrop`,3,!1),l=ys(t,vie),u=j(void 0);var d=yie(),f=N(d);ul(f,bs(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=I(f,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{Ac(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},i=e=>{var n=H();Po(P(n),()=>t.popup??Tr),U(e,n)},l=A(()=>Y(`_sui.split_button.more_options`));Al(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return z(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return z(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}D(d),_s(d,e=>M(u,e),()=>z(u)),R(e=>{q(d,`hidden`,n()),q(d,`aria-hidden`,n()),q(d,`aria-disabled`,r()),q(d,`aria-label`,e)},[()=>Y(`_sui.split_button.x_options`,{values:{name:i()}})]),U(e,d),k()}var xie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),Sie=B(`
`),Cie={hash:`svelte-1q3i654`,code:`.checkbox-group.svelte-1q3i654 {display:inline-flex;}.checkbox-group.horizontal.svelte-1q3i654 {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-1q3i654 {gap:4px;flex-direction:column;} -@media (pointer: coarse) {.checkbox-group.vertical.svelte-1q3i654 {gap:8px;} -}.inner.svelte-1q3i654 {display:contents;}`};function wie(e,t){O(t,!0),K(e,Cie);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`ariaLabel`,3,void 0),o=ys(t,xie);var s=Sie();us(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>Y(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-1q3i654`);var c=N(s);Po(N(c),()=>t.children??Tr),D(c),D(s),R(()=>c.inert=r()),U(e,s),k()}var Tie=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),Eie=B(``),Die=B(`
`),Oie={hash:`svelte-12hva16`,code:`.checkbox.svelte-12hva16 {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-12hva16:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-12hva16:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-12hva16:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-12hva16:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-12hva16 button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-12hva16 button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-12hva16 button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-12hva16 button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-12hva16 button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-12hva16 label:where(.svelte-12hva16) {cursor:inherit;}.checkbox.readonly.svelte-12hva16 {cursor:default;}.checkbox.readonly.svelte-12hva16 button, .checkbox.readonly.svelte-12hva16:is(:where(.svelte-12hva16):hover, :where(.svelte-12hva16):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-12hva16 button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-12hva16:is(:where(.svelte-12hva16):hover, :where(.svelte-12hva16):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-12hva16 {display:contents;}`};function Ml(e,t){let n=mo();O(t,!0),K(e,Oie);let r=J(t,`checked`,15,!1),i=J(t,`name`,3,void 0),a=J(t,`value`,3,void 0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=J(t,`label`,3,void 0),f=J(t,`ariaLabel`,3,void 0),p=J(t,`group`,15),m=ys(t,Tie),h=j(void 0),g=A(()=>f()??m[`aria-label`]),_=A(()=>!!(t.children||d())),v=A(()=>r()===`mixed`);L(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=Die();let b;var x=N(y),S=N(x);{let e=e=>{var n=H(),i=P(n),a=e=>{var n=H();Po(P(n),()=>t.checkIcon),U(e,n)},o=e=>{Ac(e,{name:`remove`})},s=e=>{Ac(e,{name:`check`})};G(i,e=>{t.checkIcon?e(a):z(v)?e(o,1):r()&&e(s,2)}),U(e,n)},d=A(()=>z(g)||void 0),f=A(()=>!z(g)&&z(_)?`${n}-label`:void 0);ul(S,bs(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()},get"aria-label"(){return z(d)},get"aria-labelledby"(){return z(f)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!(s()||c())&&(r(z(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return z(h)},set element(e){M(h,e,!0)},startIcon:e,$$slots:{startIcon:!0}}))}var C=I(S,2),w=e=>{var r=Eie(),i=N(r),a=e=>{var n=H();Po(P(n),()=>t.children),U(e,n)},o=e=>{var t=V();R(()=>W(t,d())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(C,e=>{z(_)&&e(w)}),D(x),D(y),R(()=>{b=Xo(y,1,`sui checkbox ${t.class??``}`,`svelte-12hva16`,b,{checked:r(),indeterminate:z(v),disabled:s(),readonly:c()}),q(y,`hidden`,o()),x.inert=s()}),so(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||z(h)?.click()}),U(e,y),k()}co([`click`]);var kie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),Aie=B(`
`),jie={hash:`svelte-1fh461f`,code:`.spacer.flex.svelte-1fh461f:not([hidden]) {display:block;flex:auto;}.spacer.svelte-1fh461f:not(.flex) {width:8px;height:8px;}`};function Nl(e,t){K(e,jie);let n=J(t,`flex`,3,!1),r=ys(t,kie);var i=Aie();us(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[is]:{flex:n()}}),void 0,void 0,void 0,`svelte-1fh461f`),U(e,i)}function Pl(e,t){O(t,!0);let n=J(t,`class`,3,void 0),r=J(t,`closeIcon`,3,void 0);{let i=e=>{var t=H(),n=P(t),i=e=>{var t=H();Po(P(t),r),U(e,t)},a=e=>{Ac(e,{name:`close`})};G(n,e=>{r()?e(i):e(a,-1)}),U(e,t)},a=A(()=>Y(`_sui.close`));ul(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return z(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}k()}var Mie=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),Nie=B(`
`,1),Pie=B(`
`),Fie=B(` `,1),Iie=B(``),Lie=B(`
`),Rie={hash:`svelte-ad3i0k`,code:`.content.svelte-ad3i0k {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-ad3i0k {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-ad3i0k {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-ad3i0k {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;} -@media (max-height: 300px) {.content.x-small.svelte-ad3i0k {max-height:calc(100dvh - 32px);} -}.content.small.svelte-ad3i0k {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));} -@media (max-height: 400px) {.content.small.svelte-ad3i0k {max-height:calc(100dvh - 32px);} -}.content.medium.svelte-ad3i0k {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));} -@media (max-height: 600px) {.content.medium.svelte-ad3i0k {max-height:calc(100dvh - 32px);} -}.content.large.svelte-ad3i0k {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));} -@media (max-height: 800px) {.content.large.svelte-ad3i0k {max-height:calc(100dvh - 32px);} -}.content.x-large.svelte-ad3i0k {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));} -@media (max-height: 1000px) {.content.x-large.svelte-ad3i0k {max-height:calc(100dvh - 32px);} -}:is(.header.svelte-ad3i0k, .footer.svelte-ad3i0k) {display:flex;align-items:center;gap:4px;}.header.svelte-ad3i0k {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.svelte-ad3i0k .title:where(.svelte-ad3i0k) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-ad3i0k {margin:var(--sui-dialog-footer-margin, 0 24px 24px);} -@media (width < 768px) {.footer.svelte-ad3i0k {margin:var(--sui-dialog-footer-margin, 0 16px 16px);} -}.body.svelte-ad3i0k {overflow:auto;margin:var(--sui-dialog-body-margin, 24px 24px);white-space:normal;line-height:var(--sui-line-height-compact);} -@media (width < 768px) {.body.svelte-ad3i0k {margin:var(--sui-dialog-body-margin, 16px 16px);} -}`};function Fl(e,t){let n=mo();O(t,!0),K(e,Rie);let r=J(t,`open`,15,!1);J(t,`value`,11,``);let i=J(t,`ariaLabelledby`,3,void 0),a=J(t,`role`,3,`dialog`),o=J(t,`size`,3,`medium`),s=J(t,`showClose`,3,!1),c=J(t,`showOk`,3,!0),l=J(t,`showCancel`,3,!0),u=J(t,`okLabel`,3,``),d=J(t,`okShortcuts`,3,void 0),f=J(t,`okDisabled`,3,!1),p=J(t,`cancelLabel`,3,``),m=J(t,`cancelShortcuts`,3,void 0),h=J(t,`cancelDisabled`,3,!1),g=J(t,`focusInput`,3,!0),_=ys(t,Mie),v=A(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),y=A(()=>z(v)?void 0:t.title||void 0),b=j(void 0),x=j(void 0);L(()=>{if(r()&&z(x)){let e=!1;return(async()=>{if(await qc(50),e||z(x)?.contains(document.activeElement))return;let t=g()?z(x)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):z(b)?.focus()})(),()=>{e=!0}}}),_s(sl(e,bs(()=>_,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return z(y)},get"aria-labelledby"(){return z(v)},get"aria-describedby"(){return`${n}-body`},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=Lie(),a=N(i),g=e=>{var r=Pie(),i=N(r),a=e=>{var n=H();Po(P(n),()=>t.header),U(e,n)},o=e=>{var r=Nie(),i=P(r),a=F(i,!0),o=I(i,2);Nl(o,{flex:!0});var c=I(o,2);Po(c,()=>t.headerExtra??Tr);var l=I(c,2),u=e=>{Pl(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(b)?.close(`close`)}})};G(l,e=>{s()&&e(u)}),R(()=>{q(i,`id`,`${n}-title`),W(a,t.title)}),U(e,r)};G(i,e=>{t.header?e(a):e(o,-1)}),D(r),U(e,r)};G(a,e=>{(t.title||s()||t.header||t.headerExtra)&&e(g)});var _=I(a,2);Po(N(_),()=>t.children??Tr),D(_);var v=I(_,2),y=e=>{var n=Iie(),r=N(n),i=e=>{var n=H();Po(P(n),()=>t.footer??Tr),U(e,n)},a=e=>{var n=Fie(),r=P(n);Po(r,()=>t.footerExtra??Tr);var i=I(r,2);Nl(i,{flex:!0});var a=I(i,2),o=e=>{{let t=A(()=>u()||Y(`_sui.ok`));ul(e,{variant:`primary`,get label(){return z(t)},get keyShortcuts(){return d()},get disabled(){return f()},onclick:()=>{z(b)?.close(`ok`)}})}};G(a,e=>{c()&&e(o)});var s=I(a,2),g=e=>{{let t=A(()=>p()||Y(`_sui.cancel`));ul(e,{variant:`secondary`,get label(){return z(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{z(b)?.close(`cancel`)}})}};G(s,e=>{l()&&e(g)}),U(e,n)};G(r,e=>{t.footer?e(i):e(a,-1)}),D(n),U(e,n)};G(v,e=>{(c()||l()||t.footer||t.footerExtra)&&e(y)}),D(i),_s(i,e=>M(x,e),()=>z(x)),R(()=>{Xo(i,1,Ko([`content`,t.class,o()]),`svelte-ad3i0k`),q(_,`id`,`${n}-body`)}),U(e,i)},$$slots:{default:!0}})),e=>M(b,e,!0),()=>z(b)),k()}var zie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Il(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=ys(t,zie);Fl(e,bs(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),k()}var Bie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Ll(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=ys(t,Bie);Fl(e,bs(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),k()}var Vie=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),Hie=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);Vie.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||`​`,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},Uie=/(?<=^|[\s([{"'«])(?::)(?[a-zA-Z0-9_+-]{1,64})$/,Rl=/[-_]/,zl,Wie=e=>e.split(` -`).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),Bl=(e,t)=>{let n=e.split(Rl);return e===t?0:e.startsWith(t)&&Rl.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},Gie=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,Kie=({name:e,aliases:t},n)=>{let r=Bl(e,n),i=Gie(t,n);return{rank:Math.min(r,i),nameRank:r}},qie=({name:e,aliases:t},n)=>{if(Bl(e,n)<9)return e.split(Rl).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},Jie=e=>{let t=e.toLowerCase();return t?(zl??=Wie(`😀 grinning face +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Un(e,!0)}`}br(e){return`
`}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Un(n,!0):this.parser.parseInline(r),o=Gn(e);if(o===null)return a;e=Un(o,i);let s=``+a+``,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Gn(e);if(i===null)return Un(n);e=i;let a=`${Un(n)}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Un(e.text)}},ur=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return``}checkbox({raw:e}){return e}},dr=class e{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new lr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ur,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n{let i=e[r].flat(1/0);pr(n,this.walkTokens(i,t))}):e.tokens&&pr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new lr(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new sr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=fr.passThroughHooks.has(n)?e=>{if(t.options.async&&fr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return pr(n,r.call(this,e)),t&&pr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return cr.lex(e,t??this.defaults)}parser(e,t){return dr.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(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 n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?cr.lex:cr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?dr.parse:dr.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?cr.lex:cr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?dr.parse:dr.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let e=`

An error occurred:

`+Un(n.message+``,!0)+`
`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},hr=new mr;function gr(e,t){return hr.parse(e,t)}gr.options=gr.setOptions=function(e){return hr.setOptions(e),gr.defaults=hr.defaults,bt(gr.defaults),gr},gr.getDefaults=vt,gr.defaults=yt;function _r(...e){return hr.use(...e),gr.defaults=hr.defaults,bt(gr.defaults),gr}gr.use=_r,gr.walkTokens=function(e,t){return hr.walkTokens(e,t)},gr.parseInline=hr.parseInline,gr.Parser=dr,gr.parser=dr.parse,gr.Renderer=lr,gr.TextRenderer=ur,gr.Lexer=cr,gr.lexer=cr.lex,gr.Tokenizer=sr,gr.Hooks=fr,gr.parse=gr,gr.options,gr.setOptions,gr.walkTokens;var vr=gr.parseInline,yr=gr;dr.parse;var see=cr.lex,br=u(f(),1),{dependencies:cee,version:xr}={name:`@sveltia/cms`,version:`0.259.0`,description:`Sveltia CMS is a modern, lightweight, Git-based headless content management system.`,keywords:[`svelte`,`cms`,`content-management-system`],homepage:`https://sveltiacms.app/en/`,repository:{type:`git`,url:`git+https://github.com/sveltia/sveltia-cms.git`},funding:{type:`github`,url:`https://github.com/sponsors/kyoshino`},license:`MIT`,author:{name:`Kohei Yoshino`,url:`https://github.com/kyoshino`},type:`module`,scripts:{bench:`playwright test -c bench/playwright.config.js`,"bench:compare":`node bench/compare.js`,"bench:profile":`node bench/summarize-profile.js`,build:`vite build`,"build:watch":`vite build --watch`,check:`pnpm run --no-bail '/^check:.*/'`,"check:audit":`pnpm audit --ignore-registry-errors`,"check:cspell":`cspell --no-progress`,"check:duplicates":`jscpd --silent`,"check:eslint":`eslint .`,"check:imports":`node scripts/find-unused-imports.js`,"check:l10n":`node scripts/check-locales.js`,"check:oxlint":`oxlint .`,"check:prettier":`prettier --check .`,"check:stylelint":`stylelint '**/*.{css,scss,svelte}'`,"check:svelte":`svelte-check`,dev:`vite`,format:`prettier --write .`,prepublishOnly:`vite build`,preview:`vite preview`,test:`NODE_OPTIONS=--no-experimental-webstorage vitest run`,"test:components":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project browser`,"test:components:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project browser --coverage.include='src/lib/components/**/*.svelte' --coverage.thresholds.branches=98.4`,"test:e2e":`playwright test -c e2e/playwright.config.js`,"test:e2e:ui":`playwright test -c e2e/playwright.config.js --ui`,"test:unit":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project unit`,"test:unit:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project unit`,"test:watch":`NODE_OPTIONS=--no-experimental-webstorage vitest`},dependencies:{"@cfworker/json-schema":`^4.1.6`,"@discourse/heic":`^1.0.0`,"@fastify/deepmerge":`^3.2.4`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.53.0`,"@sindresorhus/transliterate":`^3.0.0`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.89.0`,"@sveltia/utils":`^0.13.2`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.1.9`,"isomorphic-dompurify":`^4.6.0`,"isomorphic-git":`^1.44.10`,leaflet:`^1.9.4`,lexical:`^0.53.0`,marked:`^18.1.3`,"marked-bidi":`^1.0.15`,mime:`^4.1.2`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.5.438`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.4`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.39.0`,"terra-draw-leaflet-adapter":`1.0.3`,turndown:`^7.2.4`,yaml:`^2.9.1`},devDependencies:{"@playwright/test":`^1.64.1`,"@stylistic/eslint-plugin":`^5.10.0`,"@sveltejs/vite-plugin-svelte":`^7.3.1`,"@types/leaflet":`^1.9.22`,"@types/node":`^26.6.6`,"@types/qrcode":`^1.5.6`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitest/browser-playwright":`^5.1.0`,"@vitest/coverage-v8":`^5.1.0`,cspell:`^10.4.0`,eslint:`^9.39.5`,"eslint-config-airbnb-extended":`^3.3.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jsdoc":`^65.4.3`,"eslint-plugin-package-json":`^1.14.0`,"eslint-plugin-svelte":`^3.24.0`,"eslint-plugin-unused-imports":`^4.4.1`,globals:`^17.14.0`,"happy-dom":`^21.0.4`,jscpd:`^5.4.2`,messageformat:`^4.1.0`,oxlint:`^1.91.0`,playwright:`^1.64.1`,"postcss-html":`^2.0.0`,prettier:`^3.9.10`,"prettier-plugin-svelte":`^4.1.1`,sonda:`^0.14.0`,stylelint:`^18.0.0`,"stylelint-config-recommended":`^19.0.0`,svelte:`^5.57.3`,"svelte-check":`^4.7.8`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.3`,vite:`^8.3.5`,vitest:`^5.1.0`,"vitest-browser-svelte":`^3.1.0`},publishConfig:{directory:`package`}},lee=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`],D=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Sr=e=>JSON.parse(JSON.stringify(e)),Cr=u(s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),wr=Array.isArray,uee=Array.prototype.indexOf,Tr=Array.prototype.includes,Er=Array.from,Dr=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,dee=Object.getOwnPropertyDescriptors,fee=Object.prototype,pee=Array.prototype,kr=Object.getPrototypeOf,mee=Object.isExtensible;function Ar(e){return typeof e==`function`}var jr=()=>{};function hee(e){return typeof e?.then==`function`}function gee(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function Nr(e,t,n=!1){return e===void 0?n?t():t:e}function Pr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var Fr=Symbol(`$state`),Ir=Symbol(`component`),Lr=Symbol(`legacy props`),_ee=Symbol(``),Rr=Symbol(`attributes`),zr=Symbol(`class`),Br=Symbol(`style`),Vr=Symbol(`text`),Hr=Symbol(`form reset`),Ur=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Wr=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Gr={},Kr=Symbol(`uninitialized`);function vee(){console.warn(`https://svelte.dev/e/derived_inert`)}function qr(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function yee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function bee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Jr=!1;function Yr(e){Jr=e}var Xr;function Zr(e){if(e===null)throw qr(),Gr;return Xr=e}function Qr(){return Zr(ua(Xr))}function O(e){if(Jr){if(ua(Xr)!==null)throw qr(),Gr;Xr=e}}function $r(e=1){if(Jr){for(var t=e,n=Xr;t--;)n=ua(n);Xr=n}}function ei(e=!0){for(var t=0,n=Xr;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ua(n);e&&n.remove(),n=i}}function ti(e){if(!e||e.nodeType!==8)throw qr(),Gr;return e.data}function ni(e){return e===this.v}function xee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function ri(e){return!xee(e,this.v)}function ii(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function See(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Cee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function wee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Tee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Eee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Dee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Oee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function kee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Aee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function jee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Mee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Nee=[];function ai(e,t=!1,n=!1){return oi(e,new Map,``,Nee,null,n)}function oi(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(wr(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c{t===mi&&hi()})}mi.push(e)}function Iee(){for(;mi.length>0;)hi()}var Lee=-7169;function _i(e,t){e.f=e.f&Lee|t}function vi(e){e.f&512||e.deps===null?_i(e,1024):_i(e,4096)}function Ree(e,t){e.f&2048?t.set(e,2048):e.f&4096&&t.get(e)!==2048&&t.set(e,4096),_i(e,1024)}function zee(e,t){if(t){let t=document.body;e.autofocus=!0,gi(()=>{document.activeElement===t&&e.focus()})}}function Bee(e){Jr&&la(e)!==null&&da(e)}var Vee=!1;function Hee(){Vee||(Vee=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Hr]?.()})},{capture:!0}))}function yi(e){var t=za,n=Ha;Va(null),Ua(null);try{return e()}finally{Va(t),Ua(n)}}function Uee(e,t,n,r=n){e.addEventListener(t,()=>yi(n));let i=e[Hr];e[Hr]=i?()=>{i(),r(!0)}:()=>r(!0),Hee()}function bi(e,t,n,r){let i=pi()?wi:Ei;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Ha,c=xi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ha(e,s)}Si()}}var d=Ci();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Wee(e))).then(u).catch(e=>ha(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),Si())}):f()}function xi(){var e=Ha,t=za,n=ci,r=ji;return function(i=!0){Ua(e),Va(t),li(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Si(e=!0){Ua(null),Va(null),li(null),e&&ji?.deactivate()}function Ci(){var e=Ha,t=e.b,n=ji,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function wi(e){return Ha!==null&&(Ha.f|=524288),{ctx:ci,deps:null,effects:null,equals:ni,f:2050,fn:e,reactions:null,rv:0,v:Kr,wv:0,parent:Ha,ac:null}}var Ti=Symbol(`obsolete`);function Wee(e,t,n){let r=Ha;r===null&&See();var i=void 0,a=Xi(Kr),o=!za,s=new Set;return ite(()=>{var t=Ha,n=Mr();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ur&&n.reject(e)}).finally(Si)}catch(e){n.reject(e),Si()}var c=ji;if(o){if(t.f&32768)var l=Ci();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Ti);else for(let e of s.values())e.reject(Ti);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Ti&&(c.activate(),t?(a.f|=8388608,ea(a,t)):(a.f&8388608&&(a.f^=8388608),ea(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),va(()=>{for(let e of s)e.reject(Ti)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function j(e){let t=wi(e);return cte(t),t}function Ei(e){let t=wi(e);return t.equals=ri,t}function Gee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(Ur),t.ac=null}),t.fn!==null&&(t.teardown=jr),ro(t,0),Oa(t))}function ki(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&io(t)}var Ai=null,ji=null,Mi=null,Ni=null,Pi=null,Fi=!1,Ii=!1,Li=null,Ri=null,zi=0,qee=1,Bi=class e{id=qee++;started=!1;linked=!0;prev=null;next=null;async_deriveds=new Map;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=new Map;#i=null;#a=[];#o=[];#s=new Map;#c=new Map;#l=new Set;is_fork=!1;#u=!1;constructor(){Ai===null?Ai=this:(Ai.next=this,this.prev=Ai),Ai=this}#d(){if(this.is_fork)return!0;for(let e of this.#r.keys())if(!this.#f(e))return!0;return!1}#f(e){for(var t=e;t!==null;t=t.parent)if(this.#c.has(t))return!0;return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#l.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#c.get(e);if(n){this.#c.delete(e);for(var r of n.d)_i(r,2048),t(r);for(r of n.m)_i(r,4096),t(r)}this.#l.add(e)}#p(){var e=[];for(let i of this.#a)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#a=[],e}#m(){this.started=!0;for(let[e,t]of this.#s)_i(e,t),this.schedule(e);this.apply();for(var t=Li=[],n=[],r=Ri=[];this.#a.length>0;){zi++>1e3&&(this.#b(),Jee());for(let e of this.#p())try{this.#h(e,t,n)}catch(t){throw Ki(e),this.#d()||this.discard(),t}}if(ji=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Li=null,Ri=null,this.#d()){this.#y(n),this.#y(t);for(let[e,t]of this.#c)Gi(e,t);r.length>0&&ji.#m();return}let a=this.#g();if(a)this.#y(n),this.#y(t),a.#v(this);else{this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),Mi=this,Ui(n),Ui(t),Mi=null,this.#i?.resolve();var o=ji;this.#n===0&&(this.#a.length===0||o!==null)&&this.#b(),o!==null&&(Ji.clear(),o.#m())}}#h(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):$a(r)&&(i&16&&this.add_dirty_reaction(r,4096),io(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(){for(var e=this.prev;e!==null;e=e.prev)if(!e.is_fork&&this.#_(e))return e;return null}#_(e){for(let[t,[,n]]of this.current)if(!n&&e.current.has(t))return!0;return!1}#v(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_reactions(e.#s);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#s.delete(i),_i(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#b(),ji=this,this.#m()}#y(e){for(var t=0;t{this.#u=!1,this.linked&&this.flush()}))}transfer_reactions(e){for(let[t,n]of e)this.add_dirty_reaction(t,n);e.clear()}add_dirty_reaction(e,t){(t===2048||this.#s.get(e)!==2048)&&this.#s.set(e,t)}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=Mr()).promise}static ensure(){if(ji===null){let t=ji=new e;!Ii&&!Fi&&gi(()=>{t.started||t.flush()})}return ji}apply(){Ni=null}schedule(e){Pi=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#a.push(e)}#b(){if(this.linked){var e=this.prev,t=this.next;e===null||(e.next=t),t===null?Ai=e:t.prev=e,this.linked=!1}}};function Vi(e){var t=Fi,n=Mi;Mi=null,Fi=!0;try{var r;for(e&&(Vi(),r=e());;){if(Iee(),ji===null)return r;ji.flush()}}finally{Fi=t,Mi=n}}function Jee(){try{Dee()}catch(e){ha(e,Pi)}}var Hi=null;function Ui(e){var t=e.length;if(t!==0){for(var n=0;n0)){Ji.clear();for(let e of Hi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Hi.has(n)&&(Hi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||io(n)}}Hi.clear()}}Hi=null}}function Wi(e){ji.schedule(e)}function Gi(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),_i(e,1024);for(var n=e.first;n!==null;)Gi(n,t),n=n.next}}function Ki(e){_i(e,1024);for(var t=e.first;t!==null;)Ki(t),t=t.next}var qi=new Set,Ji=new Map,Yi=!1;function Xi(e,t){return{f:0,v:e,reactions:null,equals:ni,rv:0,wv:0}}function M(e,t){let n=Xi(e,t);return cte(n),n}function Zi(e,t=!1,n=!0){let r=Xi(e);return t||(r.equals=ri),r}function N(e,t,n=!1){return za!==null&&(!Ba||za.f&131072)&&pi()&&za.f&4325394&&(Wa===null||!Wa.has(e))&&jee(),ea(e,n?na(t):t,Ri)}var Qi=null,$i=0;function ea(e,t,n=null){if(!e.equals(t)){La?Ji.set(e,t):Ji.has(e)||Ji.set(e,e.v);var r=Bi.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Di(t),Ni===null&&vi(t)}e.wv=Qa(),Qi=null,$i=0,Xee(e,2048,n),Qi=null,pi()&&Ha!==null&&Ha.f&1024&&!(Ha.f&96)&&(qa===null?lte([e]):qa.push(e)),!r.is_fork&&qi.size>0&&!Yi&&Yee()}return t}function Yee(){Yi=!1;for(let e of qi){e.f&1024&&_i(e,4096);let t;try{t=$a(e)}catch{t=!0}t&&io(e)}qi.clear()}function ta(e){N(e,e.v+1)}function Xee(e,t,n){var r=e.reactions;if(r!==null){var i=pi(),a=r.length;if($i+=a,$i>1e5&&Qi===null&&(Qi=new Set),Qi!==null){if(Qi.has(e))return;Qi.add(e)}for(var o=0;o{if(Xa===o)return e();var t=za,n=Xa;Va(null),Za(o);var r=e();return Va(t),Za(n),r};return r&&n.set(`length`,M(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||kee();var i=n.get(t);return i===void 0?s(()=>{var e=M(r.value,a);return n.set(t,e),e}):N(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>M(Kr,a));n.set(t,e),ta(i)}}else N(r,Kr),ta(i);return!0},get(t,r,i){if(r===Fr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||Or(t,r)?.writable)&&(o=s(()=>M(na(c?t[r]:Kr),a)),n.set(r,o)),o!==void 0){var l=B(o);return l===Kr?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=B(i);if(a===Kr)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===Fr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Kr||Reflect.has(e,t);return(r!==void 0||(Ha!==null||za!==null)&&(!i||Or(e,t)?.writable))&&(r===void 0&&(r=s(()=>M(i?na(e[t]):Kr,a)),n.set(t,r)),B(r)===Kr)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;dM(Kr,a)),n.set(d+``,f)):N(f,Kr)}if(l===void 0)(!u||Or(e,t)?.writable)&&(l=s(()=>M(void 0,a)),N(l,na(o)),n.set(t,l));else{u=l.v!==Kr;var p=s(()=>na(o));N(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&N(h,g+1)}ta(i)}return!0},ownKeys(e){B(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Kr});for(var[r,a]of n)a.v!==Kr&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Aee()}})}function Zee(e){try{if(typeof e==`object`&&e&&Fr in e)return e[Fr]}catch{}return e}function Qee(e,t){return Object.is(Zee(e),Zee(t))}var ra,ia,aa,oa,sa;function $ee(){if(ra===void 0){ra=window,ia=document,aa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;oa=Or(t,`firstChild`).get,sa=Or(t,`nextSibling`).get,mee(e)&&(e[zr]=void 0,e[Rr]=null,e[Br]=void 0,e.__e=void 0),mee(n)&&(n[Vr]=void 0)}}function ca(e=``){return document.createTextNode(e)}function la(e){return oa.call(e)}function ua(e){return sa.call(e)}function P(e,t){if(!Jr)return la(e);var n=la(Xr);if(n===null)n=Xr.appendChild(ca());else if(t&&n.nodeType!==3){var r=ca();return n?.before(r),Zr(r),r}return t&&ma(n),Zr(n),n}function F(e,t=!1){if(!Jr){var n=la(e);return n instanceof Comment&&n.data===``?ua(n):n}if(t){if(Xr?.nodeType!==3){var r=ca();return Xr?.before(r),Zr(r),r}ma(Xr)}return Xr}function I(e,t=!1){if(!Jr)return la(e);var n=P(e,t);return O(e),n}function L(e,t=1,n=!1){let r=Jr?Xr:e;for(var i;t--;)i=r,r=ua(r);if(!Jr)return r;if(n){if(r?.nodeType!==3){var a=ca();return r===null?i?.after(a):r.before(a),Zr(a),a}ma(r)}return Zr(r),r}function da(e){e.textContent=``}function fa(){return!1}function pa(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ma(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function ete(e){var t=Ha;if(t===null)return za.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;ha(e,t)}function ha(e,t){if(e===Gr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function tte(e){Ha===null&&(za===null&&Eee(e),Tee()),La&&wee(e)}function nte(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ga(e,t){var n=Ha;n!==null&&n.f&8192&&(e|=8192);var r={ctx:ci,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ji?.register_created_effect(r);var i=r;if(e&4)Li===null?Bi.ensure().schedule(r):Li.push(r);else if(t!==null){try{io(r)}catch(e){throw ka(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&nte(i,n),za!==null&&za.f&2&&!(e&64))){var a=za;(a.effects??=[]).push(i)}return r}function _a(){return za!==null&&!Ba}function va(e){let t=ga(8,null);return _i(t,1024),t.teardown=e,t}function R(e){tte(`$effect`);var t=Ha.f;if(!za&&t&32&&ci!==null&&!ci.i){var n=ci;(n.e??=[]).push(e)}else return ya(e)}function ya(e){return ga(1048580,e)}function ba(e){return tte(`$effect.pre`),ga(1048584,e)}function xa(e){Bi.ensure();let t=ga(524352,e);return()=>{ka(t)}}function rte(e){Bi.ensure();let t=ga(524352,e);return(e={})=>new Promise(n=>{e.outro?Ma(t,()=>{ka(t),n(void 0)}):(ka(t),n(void 0))})}function Sa(e){return ga(4,e)}function ite(e){return ga(4718592,e)}function Ca(e,t=0){return ga(8|t,e)}function z(e,t=[],n=[],r=[]){bi(r,t,n,t=>{ga(8,()=>{e(...t.map(B))})})}function ate(e,t=[],n=[],r=[]){bi(r,t,n,t=>{ga(4,()=>e(...t.map(B)))})}function wa(e,t=0){return ga(16|t,e)}function Ta(e,t=0){return ga(16777216|t,e)}function Ea(e){return ga(524320,e)}function Da(e){var t=e.teardown;if(t!==null){let n=La,r=za;Ra(!0),Va(null);try{t.call(null)}catch(t){ha(t,e.parent)}finally{Ra(n),Va(r)}}}function Oa(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&yi(()=>{e.abort(Ur)});var r=n.next;n.f&64?n.parent=null:ka(n,t),n=r}}function ote(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ka(t),t=n}}function ka(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Aa(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,Oa(e,t&&!n),ro(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Da(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&ja(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Aa(e,t){for(;e!==null;){var n=e===t?null:ua(e);e.remove(),e=n}}function ja(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ma(e,t,n=!0){var r=[];e.f|=256,Na(e,r,!0);var i=()=>{n&&ka(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Na(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Na(i,t,o?n:!1)}i=a}}}function Pa(e){e.f&=-257,Fa(e,!0)}function Fa(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(_i(e,2048),Bi.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Fa(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ia(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ua(n);t.append(n),n=i}}var ste=null,La=!1;function Ra(e){La=e}var za=null,Ba=!1;function Va(e){za=e}var Ha=null;function Ua(e){Ha=e}var Wa=null;function cte(e){za!==null&&(za.f&2097152||za.f&2)&&(Wa??=new Set).add(e)}var Ga=null,Ka=0,qa=null;function lte(e){qa=e}var Ja=1,Ya=0,Xa=Ya;function Za(e){Xa=e}function Qa(){return++Ja}function $a(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Ni===null&&_i(e,1024)}return!1}function eo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Wa!==null&&Wa.has(e)))for(var i=0;i{e.ac.abort(Ur)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=no(e);if(pi()&&qa!==null&&!Ba&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Ka+Ga.length,r=0;r{a.ac.abort(Ur),a.ac=null,_i(a,2048)}),Kee(a),ro(a,0)}}function ro(e,t){var n=e.deps;if(n!==null)for(var r=t;r{e.isConnected&&e.dispatchEvent(t)}))}function mo(e,t,n,r={}){function i(e){if(r.capture||xo.call(t,e),!e.cancelBubble)return yi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,gi(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function ho(e,t,n,r={}){var i=mo(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function go(e,t,n,r,i){var a={capture:r,passive:i},o=mo(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&va(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function _o(e,t,n){(t[uo]??={})[e]=n}function vo(e){for(var t=0;t{bo=!1,yo=null}));var o=0,s=yo===e&&e[uo];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[uo]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){Dr(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=za,d=Ha;Va(null),Ua(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[uo]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o{throw e});throw f}}finally{e[uo]=t,delete e.currentTarget,Va(u),Ua(d)}}}var Ste=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Cte(e){return Ste?.createHTML(e)??e}function wte(e){var t=pa(`template`);return t.innerHTML=Cte(e.replaceAll(``,``)),t.content}function So(e,t){var n=Ha;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(Jr)return So(Xr,null),Xr;i===void 0&&(i=wte(a?e:``+e),n||(i=la(i)));var t=r||aa?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=la(t),s=t.lastChild;So(o,s)}else So(t,t);return t}}function H(e=``){if(!Jr){var t=ca(e+``);return So(t,t),t}var n=Xr;return n.nodeType===3?ma(n):(n.before(n=ca()),Zr(n)),So(n,n),n}function U(){if(Jr)return So(Xr,null),Xr;var e=document.createDocumentFragment(),t=document.createComment(``),n=ca();return e.append(t,n),So(t,n),e}function W(e,t){if(Jr){var n=Ha;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Xr),Qr()}else e!==null&&e.before(t)}function Co(){if(Jr&&Xr&&Xr.nodeType===8&&Xr.textContent?.startsWith(`$`)){let e=Xr.textContent.substring(1);return Qr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Tte(e){let t=0,n=Xi(0),r;return()=>{_a()&&(B(n),Ca(()=>(t===0&&(r=co(()=>e(()=>ta(n)))),t+=1,()=>{gi(()=>{--t,t===0&&(r?.(),r=void 0,ta(n))})})))}}var Ete=589824;function wo(e,t,n,r){new Dte(e,t,n,r)}var Dte=class{parent;is_pending=!1;transform_error;#e;#t=Jr?Xr:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Map;#p=null;#m=Tte(()=>(this.#p=Xi(this.#l),()=>{this.#p=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Ha;t.b=this,t.f|=128,n(e)},this.parent=Ha.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=wa(()=>{if(Jr){let e=ti(this.#t);Qr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#g(t)}else t?this.#y():this.#h()}else this.#b()},Ete),Jr&&(this.#e=Xr)}#h(){try{this.#a=Ea(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#_(e);gi(r),t&&(this.#s=Ea(()=>{t(this.#e,()=>e,()=>n)}))}#_(e){var t=!1,n=!1;let r=()=>{this.#v()||(t?bee():(t=!0,n&&Mee(),this.#s!==null&&Ma(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})))};return{reset:r,invoke_onerror:()=>{if(!this.#v())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){ha(e,this.#i&&this.#i.parent)}}}}#v(){return!!(this.#i.f&33570816)}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Ea(()=>e(this.#e)),gi(()=>{if(!this.#v()){var e=this.#c=document.createDocumentFragment(),t=ca(),n=!1;e.append(t),this.#a=this.#S(()=>{try{return Ea(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){ha(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#x(ji)):this.#u===0&&(this.#e.before(e),this.#c=null,Ma(this.#o,()=>{this.#o=null}),this.#x(ji))}}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Ea(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ia(this.#a,e);let t=this.#n.pending;this.#o=Ea(()=>t(this.#e))}else this.#x(ji)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_reactions(this.#f)}defer_effect(e){Ree(e,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=Ha,n=za,r=ci;Ua(this.#i),Va(this.#i),li(this.#i.ctx);try{return Bi.ensure(),e()}finally{Ua(t),Va(n),li(r)}}#C(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Ma(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#C(e,t)}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!this.#p||this.#d||(this.#d=!0,gi(()=>{this.#d=!1,this.#p&&ea(this.#p,this.#l)}))}get_effect_pending(){return this.#m(),B(this.#p)}error(e){if(e===Gr||!this.#n.onerror&&!this.#n.failed)throw e;ji?.is_fork?(this.#a&&ji.skip_effect(this.#a),this.#o&&ji.skip_effect(this.#o),this.#s&&ji.skip_effect(this.#s),ji.oncommit(()=>{this.#v()||this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(ka(this.#a),null),this.#o&&=(ka(this.#o),null),this.#s&&=(ka(this.#s),null),Jr&&(Zr(this.#t),$r(),Zr(ei()));let t=this.#n.failed,n=e=>{if(this.#v())return;let{reset:n,invoke_onerror:r}=this.#_(e);r(),t&&!this.#v()&&(this.#s=this.#S(()=>{try{return Ea(()=>{var r=Ha;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return ha(e,this.#i.parent),null}}))};gi(()=>{if(!this.#v()){var t;try{t=this.transform_error(e)}catch(e){ha(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>ha(e,this.#i&&this.#i.parent)):n(t)}})}};function G(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Vr]??=e.nodeValue)&&(e[Vr]=n,e.nodeValue=`${n}`)}function To(e,t){return Ote(e,t)}var Eo=new Map;function Ote(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){$ee();var c=void 0,l=rte(()=>{var o=n??t.appendChild(ca());wo(o,{pending:()=>{}},t=>{k({});var n=ci;if(a&&(n.c=a),i&&(r.$$events=i),Jr&&So(t,null),c=e(t,r)||fi(),Jr&&(Ha.nodes.end=Xr,Xr===null||Xr.nodeType!==8||Xr.data!==`]`))throw qr(),Gr;A()},s);var l=new Set,u=e=>{for(var n=0;n{for(var e of l)for(let n of[t,document]){var r=Eo.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,xo),r.delete(e),r.size===0&&Eo.delete(n)):r.set(e,i)}po.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Do.set(c,l),c}var Do=new WeakMap;function Oo(e,t){let n=Do.get(e);return n?(Do.delete(e),n(t)):Promise.resolve()}var ko=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Pa(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Pa(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ka(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ia(r,t),t.append(ca()),this.#n.set(e,{effect:r,fragment:t})}else ka(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ma(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ka(n.effect),this.#n.delete(e))};ensure(e,t){var n=ji,r=fa();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=ca();i.append(a),this.#n.set(e,{effect:Ea(()=>t(a)),fragment:i})}else this.#t.set(e,Ea(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Jr&&(this.anchor=Xr),this.#a(n)}},Ao=0,jo=1,kte=2;function Mo(e,t,n,r,i){Jr&&Qr();var a=pi(),o=Kr,s=a?Xi(o):Zi(o,!1,!1),c=a?Xi(o):Zi(o,!1,!1),l=new ko(e);wa(()=>{var a=ji,o=t(),u=!1;let d=Jr&&hee(o)===(e.data===`[!`);if(d&&(Zr(ei()),Yr(!1)),hee(o)){var f=xi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),ji===a&&a.deactivate(),Bi.ensure();try{e()}finally{Si(!1),Fi||Vi()}}};o.then(t=>{e(()=>{ea(s,t),l.ensure(jo,r&&(e=>r(e,s)))})},t=>{e(()=>{if(ea(c,t),l.ensure(kte,i&&(e=>i(e,c))),!i)throw c.v})}),Jr?l.ensure(Ao,n):gi(()=>{p||e(()=>{l.ensure(Ao,n)})})}else ea(s,o),l.ensure(jo,r&&(e=>r(e,s)));return d&&Yr(!0),()=>{u=!0}})}function K(e,t,n=!1){var r;Jr&&(r=Xr,Qr());var i=new ko(e),a=n?65536:0;function o(e,t){if(Jr){var n=ti(r);if(e!==parseInt(n.substring(1))){var a=ei();Zr(a),i.anchor=a,Yr(!1),i.ensure(e,t),Yr(!0);return}}i.ensure(e,t)}wa(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Ate=Symbol(`NaN`);function No(e,t,n){Jr&&Qr();var r=new ko(e),i=!pi();wa(()=>{var e=t();e!==e&&(e=Ate),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Po(e,t){Jr&&Zr(la(e)),Ca(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Fo(e,t){return t}function jte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Io(e,Er(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;da(u),u.append(l),e.items.clear()}Io(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Io(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return wr(e)?e:e==null?[]:Er(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=B(u);h.fallback=l,Mte(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,Bo(l,null,o)):Pa(l):Ma(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:wa(()=>{var e=B(u),c=e.length;let h=!1;Jr&&ti(o)===`[!`!=(c===0)&&(o=ei(),Zr(o),Yr(!1),h=!0);for(var g=new Set,_=ji,v=fa(),y=0;ya(o)):(l=Ea(()=>a(Lo??=ca())),l.f|=33554432)),c>g.size&&Cee(``,``,``),Jr&&c>0&&Zr(ei()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Yr(!0),B(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,Jr&&(o=Xr)}function zo(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Mte(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=zo(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_0){var T=r&4&&o===0?n:null;if(a){for(_=0;_{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Nte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Xi(n):Zi(n,!1,!1):null,l=o&2?Xi(i):null;return{v:c,i:l,e:Ea(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Bo(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ua(r);if(a.before(r),r===i)return;r=o}}function Vo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ho(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;Jr&&(o=Zr(la(c)))}z(()=>{var e=Ha;if(s===(s=t()??``))Jr&&Qr();else if(n&&!Jr)e.nodes=null,c.innerHTML=s,s!==``&&So(la(c),c.lastChild);else if(e.nodes!==null&&(Aa(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(Jr){for(var a=Xr.data,l=Qr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=ua(l);if(l===null)throw qr(),Gr;So(Xr,u),o=Zr(l)}else{var d=pa(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(So(la(f),f.lastChild),r||i)for(;la(f);)o.before(la(f));else o.before(f)}}})}function Uo(e,t,...n){var r=new ko(e);wa(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function Wo(e,t,n){var r;Jr&&(r=Xr,Qr());var i=new ko(e);wa(()=>{var e=t()??null;if(Jr&&ti(r)===`[`!=(e!==null)){var a=ei();Zr(a),i.anchor=a,Yr(!1),i.ensure(e,e&&(t=>n(t,e))),Yr(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Pte=()=>performance.now(),Go={tick:e=>requestAnimationFrame(e),now:()=>Pte(),tasks:new Set};function Ko(){let e=Go.now();Go.tasks.forEach(t=>{t.c(e)||(Go.tasks.delete(t),t.f())}),Go.tasks.size!==0&&Go.tick(Ko)}function Fte(e){let t;return Go.tasks.size===0&&Go.tick(Ko),{promise:new Promise(n=>{Go.tasks.add(t={c:e,f:n})}),abort(){Go.tasks.delete(t)}}}function Ite(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function qo(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Ite(n.trim());t[i]=r.trim()}return t}var Lte=e=>e,Jo=null;function Yo(e){Jo=e}function Xo(e,t,n){var r=(Jo??Ha).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Zo(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Zo(e,t,n,r,i,a){var o=r===1,s=!1;if(Ar(t)){var c;return gi(()=>{s||(c=Zo(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:jr,deactivate:jr,reset:jr,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=Lte}=t;var p,m=()=>1-r;return gi(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=qo(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=qo(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Fte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=jr)},deactivate:()=>{a=jr},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Rte(e,t,n,r,i,a){let o=Jr;Jr&&Qr();var s=null;Jr&&Xr.nodeType===1&&(s=Xr,Qr());var c=Jr?Xr:e,l=Ha,u=new ko(c,!1);wa(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=Jr;if(s=Jr?s:pa(e,a),So(s,s),r){var i=null;Jr&&bte(e)&&s.append(i=document.createComment(``));var o=Jr?la(s):s.appendChild(ca());Jr&&(o===null?Yr(!1):Zr(o)),Yo(l),r(s,o),i?.remove(),Yo(null)}Ha.nodes.end=s,n||t.before(s)}Jr&&Zr(t)}),()=>{}},65536),va(()=>{}),o&&(Yr(!0),Zr(c))}function Qo(e,t){let n=null,r=Jr;var i;if(Jr){n=Xr;for(var a=la(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=ua(a);if(a===null)Yr(!1);else{var o=ua(a);a.remove(),Zr(o)}}Jr||(i=document.head.appendChild(ca()));try{wa(()=>{var e=Ea(()=>t(i));e.f|=262144,Jr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(Yr(!0),Zr(n))}}function q(e,t){Sa(()=>{e=Ha?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=pa(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function $o(e,t){var n=void 0,r;Ta(()=>{n!==(n=t())&&(r&&=(ka(r),null),n&&(r=Ea(()=>{Sa(()=>n(e))})))})}function es(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||Bte.includes(r[o-1]))&&(s===r.length||Bte.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Hte(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ns(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ute(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ns)),i&&c.push(...Object.keys(i).map(ns));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(Jte)||(`__defaultValue`in e&&Kte(e,!1),`__value`in e&&os(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),va(()=>{t.disconnect()})}function ss(e){return`__value`in e?e.__value:e.value}function Jte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var cs=Symbol(`class`),ls=Symbol(`style`),Yte=Symbol(`is custom element`),Xte=Symbol(`is html`),Zte=Wr?`link`:`LINK`,Qte=Wr?`input`:`INPUT`,$te=Wr?`option`:`OPTION`,ene=Wr?`select`:`SELECT`,tne=Wr?`progress`:`PROGRESS`;function nne(e){if(Jr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;J(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;J(e,`checked`,null),e.checked=r}}};e[Hr]=n,gi(n),Hee()}}function J(e,t,n,r){var i=ine(e);if(!(Jr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Zte))){var a=i[t];a!==(i[t]=n)&&(t===`loading`&&(e[_ee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&one(e).has(t)?e[t]=n:(!Jr||typeof n!=`number`&&typeof n!=`boolean`||a!==String(n))&&e.setAttribute(t,n))}}function rne(e,t,n,r,i=!1,a=!1){Jr&&i&&e.nodeName===Qte&&(`defaultValue`in n||`defaultChecked`in n||nne(e));var o=ine(e),s=o[Yte],c=!o[Xte];let l=Jr&&s;l&&Yr(!1);var u=t||{},d=e.nodeName===$te,f=e.nodeName===ene;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=ts(n.class):(r||n[cs])&&(n.class=null),n[ls]&&(n.style??=null);var m=one(e);if(e.nodeName===Qte&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,J(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)rs(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[cs],n[cs]),u[i]=l,u[cs]=n[cs];else if(i===`style`)as(e,l,t?.[ls],n[ls]),u[i]=l,u[ls]=n[ls];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=pte(r);if(dte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)_o(r,e,l),vo([r]);else if(l!=null){function y(e){u[i].call(this,e)}u[n]=mo(r,e,y,t)}}else if(i===`style`)J(e,i,l);else if(i===`autofocus`)zee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===tne)&&(e.value=l);else if(i===`selected`&&d)Wte(e,l);else{var b=i;c||(b=gte(b));var x=b===`defaultValue`||b===`defaultChecked`;if(f&&b===`defaultValue`)continue;if(l==null&&!s&&!x){if(o[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else x||(s||typeof l!=`string`)&&m.has(b)?(e[b]=l,b in o&&(o[b]=Kr)):typeof l!=`function`&&J(e,b,l,a)}}}}}}finally{l&&Yr(!0)}return u}function us(e,t,n=[],r=[],i=[],a,o=!1,s=!1){bi(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===ene,l=!1;if(Ta(()=>{var u=t(...n.map(B)),d=rne(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&Gte(f,u.defaultValue),`value`in u&&os(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||ka(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&ka(i[t]),i[t]=Ea(()=>$o(e,()=>p))),d[t]=p}r=d}),c){var u=e;Sa(()=>{var e=r;`defaultValue`in e&&Gte(u,e.defaultValue),os(u,e.value,!0),qte(u)})}l=!0})}function ine(e){return e[Rr]??={[Yte]:e.nodeName.includes(`-`),[Xte]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var ane=new Map;function one(e){var t=e.getAttribute(`is`)||e.nodeName,n=ane.get(t);if(n)return n;ane.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=dee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=kr(i)}return n}function sne(e,t,n=t){var r=new WeakSet;Uee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ds(e)?fs(a):a,n(a),ji!==null&&r.add(ji),await ao(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Jr&&e.defaultValue!==e.value||co(t)==null&&e.value)&&(n(ds(e)?fs(e.value):e.value),ji!==null&&r.add(ji)),Ca(()=>{var n=t();if(e===document.activeElement){var i=ji;if(r.has(i))return}ds(e)&&n===fs(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ds(e){var t=e.type;return t===`number`||t===`range`}function fs(e){return e===``?null:+e}var cne=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function lne(e,t,n){var r=cne.observe(e,()=>n(e[t]));Sa(()=>(co(()=>n(e[t])),r))}function ps(e,t){return e===t||e?.[Fr]===t}function ms(e=fi(),t,n,r){var i=ci.r,a=Ha;return Sa(()=>{var o,s;return Ca(()=>{o=s,s=r?.()||[],co(()=>{ps(n(...s),e)||(t(e,...s),o&&ps(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ps(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var hs=!1;function une(e){var t=hs;try{return hs=!1,[e(),hs]}finally{hs=t}}var dne={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function gs(e,t,n){return new Proxy({props:e,exclude:t},dne)}var fne={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Ar(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Ar(i)&&(i=i());let a=Or(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Ar(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=Or(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Fr||t===Lr)return!1;for(let n of e.props)if(Ar(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(Ar(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function _s(...e){return new Proxy({props:e},fne)}function Y(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=wi(r),B(l)):(c&&(c=!1,s=o?co(r):r),s);let d;if(a){var f=Fr in e||Lr in e;d=Or(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=une(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Oee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?wi:Ei)(()=>(_=!1,h()));a&&B(v);var y=Ha;return(function(e,t){if(arguments.length>0){let n=t?B(v):i&&a?na(e):e;return N(v,n),_=!0,s!==void 0&&(s=n),e}return La&&_||y.f&16384?v.v:B(v)})}function vs(e){ci===null&&ii(`onMount`),R(()=>{let t=co(e);if(typeof t==`function`)return t})}function ys(e){ci===null&&ii(`onDestroy`),vs(()=>()=>co(e))}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var bs=/^[\u061c\u200e\u200f\u2066-\u2069]+/,xs=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,pne=/^[-.0-9]/;function mne(e,t){let n=t,r=e.slice(n).match(bs);r&&(n+=r[0].length);let i=e.slice(n).match(xs);if(!i)return null;let a=i[0];if(pne.test(a))return null;n+=a.length;let o=e.slice(n).match(bs);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var hne=(e,t)=>e.slice(t).match(xs)?.[0]??``,gne=Symbol.for(`CST`),Ss=class extends Error{type;constructor(e,t){super(t),this.type=e}},Cs=class extends Ss{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},_ne=class extends Cs{constructor(e,t){let{start:n,end:r}=t[gne]??{start:-1,end:-1};super(e,n,r)}},ws=class extends Ss{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Ts=class extends Ss{source;cause;constructor(e,t){super(e,t),this.source=`�`}},Es=new Set(`؜‎‏⁦⁧⁨⁩`),Ds=new Set(` +\r  `),Os,ks,As=(e,t)=>new Cs(`missing-syntax`,e,e+t.length,t),js=(...e)=>new Cs(...e);function Ms(e,t){if(ks.startsWith(e,Os))t&&(Os+=e.length);else throw As(Os,e)}function vne(e){Os=0,ks=e;let t=xne();if(ks.startsWith(`.match`,Os))return yne(t);let n=t.length>0||ks.startsWith(`{{`,Os);!n&&Os>0&&(Os=0);let r=Ns(n);if(n&&(Vs(),Os{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function One(e,t=(e,t)=>{throw new _ne(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;Dne(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var kne=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Hs(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return kne.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function Ane(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function Us(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function Ws(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Gs(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Ts(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Ks(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Hs(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Hs(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function qs(e,t,n){let r=Gs(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=Us(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=Ws(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Ks(e,i,a,!0)}function jne(e,t,n){let r=Gs(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=Us(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=Ws(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Ks(e,i,a,!0)}function Mne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Us(r);break;case`currencyDisplay`:{let t=Ws(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=Ws(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=Us(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Ts(`bad-operand`,`A currency code is required for :currency`);return Ks(e,r.value,i,!1)}var Nne=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Pne=new Set([`long`,`medium`,`short`]),Fne=new Set([`hour`,`minute`,`second`]),Ine=new Set([`long`,`short`]),Lne=(e,t,n)=>Js(`datetime`,e,t,n),Rne=(e,t,n)=>Js(`date`,e,t,n),zne=(e,t,n)=>Js(`time`,e,t,n);function Js(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Ts(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=Ws(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=Ane(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=Ws(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Ts(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Ys(t,n,r,Nne)??`year-month-day`,s=Ys(t,n,a,Pne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Ys(t,n,e===`time`?`precision`:`timePrecision`,Fne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Ys(t,n,`timeZoneStyle`,Ine)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Hs(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Hs(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Ys(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=Ws(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Bne(e,t,n){let{value:r,options:i}=Gs(n),a;try{a=`add`in t?Us(t.add):-1}catch{throw new Ts(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?Us(t.subtract):-1}catch{throw new Ts(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Ts(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),qs(e,{},{valueOf:()=>r,options:i})}function Vne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=Us(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Ks(e,r.value,i,!0)}function Xs(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Hne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Us(r)}}catch(t){t instanceof Ss?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Ts(`bad-operand`,`A unit identifier is required for :unit`);return Ks(e,r.value,i,!1)}var Zs={currency:Mne,integer:jne,number:qs,offset:Bne,percent:Vne,string:Xs};Zs=Object.freeze(Object.assign(Object.create(null),Zs));var Qs={date:Rne,datetime:Lne,time:zne,unit:Hne};Qs=Object.freeze(Object.assign(Object.create(null),Qs));var $s=Symbol(`bidi-isolate`),ec=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Une=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),tc=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(sc(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Ts(`bad-option`,`Unsupported value for u:dir option`);t.source=cc(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(sc(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Ts?n=e:typeof e==`string`&&typeof t==`string`?n=new Ts(e,t):(n=new Ts(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function Wne(e,t,{name:n,options:r}){let i=`:${n}`,a=cc(t)??i;try{let o=t?[sc(e,t)]:[],s=e.functions[n];if(!s)throw new ws(`unknown-function`,`Unknown function ${i}`,a);let c=new tc(e,a,r),l=s(c,Gne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new ws(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[$s]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof Ss?t:new ws(`bad-function-result`,String(t),a,t)),ec(a)}}function Gne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=sc(e,i));return n}function nc(e,{arg:t,functionRef:n}){if(n)return Wne(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Xs(new tc(e,n),{},t.value);return r.source=n,r}case`variable`:return oc(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var rc=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Kne=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function ic(e,t){if(Kne(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return ic(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function ac(e,{name:t}){let n=ic(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new ws(`unresolved-variable`,r,n))}else if(n instanceof rc){let r=nc(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function oc(e,t){let n=`$`+t.name,r=ac(e,t);if(r===void 0)return ec(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return ec(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Une(n,r)}let o=new tc(e,n),s=a(o,{},r);return s.source=n,s}function sc(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return ac(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function cc(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function lc(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Ts(`bad-option`,`The option ${t} is not valid for markup`);r.source=cc(n),e.onError(r)}else{let r=sc(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function uc(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=oc(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new ws(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;inull,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;enew Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Hs(this.#r[0]),this.#i=typeof t==`string`?vne(t):t,One(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),Zs,n.functions):Zs}format(e,t){let n=this.#o(e,t),r=``;for(let e of uc(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)lc(n,e);else{let t;try{if(t=nc(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[$s])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new Ts(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of uc(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(lc(n,e));else{let t;try{if(t=nc(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[$s])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new Ts(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new rc(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var dc=M(``),fc=``,pc=na([]),mc=na({}),hc=``,gc=``,_c,vc={},qne={},yc,bc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},xc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},Sc=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},Cc=new Map,wc=e=>{if(!Cc.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();Cc.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{Cc.set(e,void 0)}return Cc.get(e)},Tc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=wc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=wc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>wc(t)?.region===e):void 0;return c(o)??c(wc(r)?.preferredRegion)??s[0]},Ec=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,Ec(r,i)):e[i]=r,e},Object.create(null)),Dc=e=>{pc.includes(e)||(pc.push(e),gc=Tc(hc,pc))},Oc=e=>{if(!e||!pc.length)return e;let t=Tc(e,pc);return!pc.includes(t)&&gc&&pc.includes(gc)?gc:t},kc=()=>{fc&&Oc(fc)!==B(dc)&&Fc.set(fc)},Ac=(e,...t)=>{bc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),Dc(e),mc[e]??={};let n=mc[e],r={...are,...qne};t.forEach(t=>{Object.entries(Ec(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),kc()},jc=new Map,Mc=new Map,Nc=(e=B(dc))=>{if(xc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Mc.get(e);if(!t){let n=jc.get(e);t=n?Promise.resolve(n()).then(t=>{Ac(e,t)},()=>{if(Mc.delete(e),B(dc)===e&&!mc[e]&&gc&&gc!==e)return Fc.set(gc)}):Promise.resolve(),Mc.set(e,t)}return t},Pc=(e=B(dc))=>Hs(e)===`rtl`,Fc={get current(){return B(dc)},set(e){xc(`locale.set: value`,e),fc=e;let t=Oc(e);if(N(dc,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Hs(t);e!==`auto`&&(document.documentElement.dir=e)}return Nc(t)}},Jne=(e,t)=>{bc(`register: localeCode`,e),Sc(`register: loader`,t),jc.set(e,t),Mc.delete(e),Dc(e),kc()},Yne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>Tc(e,pc)).find(e=>pc.includes(e))??e[0]},Xne=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&xc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&Sc(`init: handleMissingMessage`,e.handleMissingMessage),hc=e.fallbackLocale,gc=Tc(hc,pc),_c=e.handleMissingMessage,vc=e.formats??{},e.initialLocale&&Fc.set(e.initialLocale)},Zne=(e,t)=>{let n=mc[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Qne=e=>{let t=e??B(dc);return t===gc?[t]:[t,gc]},X=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return X(t,n)}let a=Qne(n),[o]=a,s=a.reduce((t,n)=>t??Zne(n,e),void 0);yc=i;let c;try{c=s?.format(t)}finally{yc=void 0}if(c!==void 0)return c;if(_c){let t=_c(e,o,r);if(t!==void 0)return t}return r??e},$ne=`_default`,ere={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},tre=(e,t)=>vc[e]?.[t]??ere[e]?.[t],nre=e=>vc[e]?.[$ne],rre=e=>{let t=yc?.[e];return(typeof t==`string`?tre(e,t):t)??nre(e)},ire=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Hs(n):e.dir,toString:()=>t.format(r)}},Ic=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=rre(t);if(!s)return o;let{locale:c,...l}=s;return ire(o,new n(c??r.locales,l),c)},are={...Qs,date:Ic(Qs.date,`date`,Intl.DateTimeFormat),time:Ic(Qs.time,`time`,Intl.DateTimeFormat),datetime:Ic(Qs.datetime,`datetime`,Intl.DateTimeFormat),number:Ic(Zs.number,`number`,Intl.NumberFormat),integer:Ic(Zs.integer,`number`,Intl.NumberFormat)},ore=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),sre=V(` `),cre={hash:`svelte-mf9rjk`,code:`.icon.small-arrow.svelte-mf9rjk {overflow:hidden;width:12px;text-indent:-6px;}`};function Lc(e,t){q(e,cre);let n=gs(t,ore);var r=sre();us(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-mf9rjk`);var i=I(r,!0);z(()=>G(i,t.name)),W(e,r)}var lre=V(` `,1),ure={hash:`svelte-wvtm40`,code:`.status-label.svelte-wvtm40 {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function Rc(e,t){k(t,!0),q(e,ure);let n=Y(t,`children`,3,void 0),r=Y(t,`icon`,3,void 0);var i=lre(),a=F(i),o=e=>{var t=U();Uo(F(t),r),W(e,t)},s=e=>{{let n=j(()=>t.status===`success`?`check_circle`:t.status);Lc(e,{get name(){return B(n)}})}};K(a,e=>{r()?e(o):e(s,-1)});var c=L(a,2),l=I(c,!0);Uo(L(c,2),()=>n()??jr),z(e=>G(l,e),[()=>X(`_sui.alert.${t.status}`)]),W(e,i),A()}var zc=e=>e===`error`||e===`warning`?`alert`:`status`,Bc=(e,t)=>t??(e===`alert`?`assertive`:`polite`),dre=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),fre=V(`
`),pre={hash:`svelte-1hkiqb4`,code:`.alert.svelte-1hkiqb4 {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-1hkiqb4 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-1hkiqb4 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-1hkiqb4 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-1hkiqb4 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function Vc(e,t){k(t,!0),q(e,pre);let n=Y(t,`ariaLive`,3,void 0),r=gs(t,dre),i=j(()=>zc(t.status));var a=fre();us(a,e=>({...r,role:B(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>Bc(B(i),n())],void 0,void 0,`svelte-1hkiqb4`),Rc(P(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),O(a),W(e,a),A()}var Hc,Uc=()=>(Hc??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),Hc),mre=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),hre=new Set([`Control`,`Meta`,`Alt`,`Shift`]),gre=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),_re=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(gre.has(e)){let t=e===`Space`?` `:e;return({key:n,code:r})=>r===e||n===t}let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&(Uc()||!e.getModifierState?.(`AltGraph`))?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},Wc=e=>e.replace(/\bAccel\b/g,Uc()?`Meta`:`Ctrl`),Gc=new Map,Kc=e=>{let t=Gc.get(e);return t||(t=Wc(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`).map(e=>e===`Control`?`Ctrl`:e);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!mre.has(e)).map(_re)}}),Gc.set(e,t)),t},vre=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):hre.has(o)))},qc=(e,t)=>vre(e,Kc(t)),Jc=new Map,yre=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},bre=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),xre=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!bre.has(e.type)),Sre=e=>Uc()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&xre(e.composedPath()[0]),Cre=e=>{Sre(e)||[...Jc.keys()].forEach(t=>{Jc.get(t)?.some(({parsedShortcuts:t})=>vre(e,t))&&yre(t,e)})},wre=(e,t)=>{t.length?e.setAttribute(`aria-keyshortcuts`,[...new Set(t.flatMap(({label:e})=>e.split(` `)))].join(` `)):e.removeAttribute(`aria-keyshortcuts`)},Tre=(e=``)=>{let t=Wc(e).trim().replace(/\s+/g,` `).replace(/\bCtrl\b/g,`Control`);if(!t)return()=>()=>{};let n=Kc(e);return e=>{Jc.size||globalThis.addEventListener(`keydown`,Cre,{capture:!0});let r={parsedShortcuts:n,label:t},i=Jc.get(e)??[];return i.push(r),Jc.set(e,i),wre(e,i),()=>{let t=i.indexOf(r);t!==-1&&(i.splice(t,1),wre(e,i),i.length||Jc.delete(e),Jc.size||globalThis.removeEventListener(`keydown`,Cre,{capture:!0}))}}},Yc=e=>e===null?`null`:typeof e,Ere=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},Dre=V(``),Ore={hash:`svelte-1t9fkqv`,code:`.truncated-text.svelte-1t9fkqv {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function Xc(e,t){q(e,Ore);let n=Y(t,`lines`,3,1),r=Y(t,`children`,3,void 0);var i=Dre();let a;Uo(P(i),()=>r()??jr),O(i),z(()=>a=as(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),W(e,i)}var Zc=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),kre=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,Qc=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},Are=`abcdefghijklmnopqrstuvwxyz234567`,jre=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=Are[n>>>r&31]}),r>0&&(t+=Are[n<<5-r&31]),t},$c=()=>jre(Uint8Array.fromHex(Qc().replaceAll(`-`,``))),el=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},tl=new WeakMap,nl,rl=(e=`e`,t=7)=>[e,Qc(t)].join(`-`),il=e=>{tl.delete(e),nl?.unobserve(e)},Mre=()=>{if(`IntersectionObserver`in globalThis)return nl||(nl=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=tl.get(t);n&&(n(),il(t))})}),nl)},Nre=new Map,Pre=e=>{if(!(`IntersectionObserver`in globalThis))return;let t=Nre.get(e);if(!t){let n=new Map,r=new Map;t={observer:new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{let i=n.get(t);i&&(r.set(t,e),[...i].forEach(t=>{i.has(t)&&t(e)}))})},{rootMargin:e}),listeners:n,states:r},Nre.set(e,t)}return t},Fre=(e,t,{rootMargin:n=`0px`}={})=>{let r=Pre(n);if(!r)return()=>{};let{observer:i,listeners:a,states:o}=r,s=a.get(e)??new Set;return s.size?o.has(e)&&!s.has(t)&&queueMicrotask(()=>{s.has(t)&&a.get(e)===s&&t(o.get(e))}):(a.set(e,s),i.observe(e)),s.add(t),()=>{s.delete(t),!s.size&&a.get(e)===s&&(a.delete(e),o.delete(e),i.unobserve(e))}},Ire=(e,t,{delay:n=100,...r}={})=>{if(!(`IntersectionObserver`in globalThis)){let e=!1;return queueMicrotask(()=>{e||t()}),()=>{e=!0}}let i,a=Fre(e,e=>{clearTimeout(i),e&&(i=setTimeout(()=>{a(),t()},n))},r);return()=>{clearTimeout(i),a()}},Lre=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},al=e=>{let t=Mre();if(t)return Lre(e)?Promise.resolve(void 0):new Promise(n=>{let r=tl.get(e);tl.set(e,r?()=>{r(),n()}:n),Rre(()=>{tl.has(e)&&t.observe(e)})})},zre=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},Bre=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},ol=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},Vre=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=Bre(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t,n,r)=>{let a=ol({position:f,from:e,to:t,size:i,room:n,otherRoom:r});f=a.position,p=a.cap??p};return f.startsWith(`bottom-`)?m(`bottom-`,`top-`,s,o):f.startsWith(`top-`)&&m(`top-`,`bottom-`,o,s),f.endsWith(`-top`)?m(`-top`,`-bottom`,u,d):f.endsWith(`-bottom`)&&m(`-bottom`,`-top`,d,u),f.endsWith(`-left`)?{position:f}=ol({position:f,from:`-left`,to:`-right`,size:r,room:n.width-a.left-8,otherRoom:a.right-8}):f.endsWith(`-right`)&&({position:f}=ol({position:f,from:`-right`,to:`-left`,size:r,room:a.right-8,otherRoom:n.width-a.left-8})),f.startsWith(`right-`)?{position:f}=ol({position:f,from:`right-`,to:`left-`,size:r,room:l,otherRoom:c}):f.startsWith(`left-`)&&({position:f}=ol({position:f,from:`left-`,to:`right-`,size:r,room:c,otherRoom:l})),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},Hre=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},Ure=class{#e=M(!1);get open(){return B(this.#e)}set open(e){N(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=M(na({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return B(this.#t)}set style(e){N(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;nested=!1;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=rl(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=ho(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=ho(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=ho(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t,{nested:n=!1}={}){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.nested=n,this.viewportResizeObserver.observe(e);let r=t??e;r.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let i=ho(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),a=ho(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{i(),a()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=Vre({position:Pc()?zre(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});Hre(o,this.style)||(this.style=o)}async hideImmediately(){let e=this.nested?this.contentElement:this.popupElement;e&&(e.hidden=!0),this.open=!1,await Zc(50),e?.isConnected&&(e.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},Wre=(...e)=>new Ure(...e),Gre=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,Kre=({transitionDuration:e,transitionDelay:t})=>Gre(e)+Gre(t)+100;function qre(e,t){var n=U();Uo(F(n),()=>t.children??jr),W(e,n)}var Jre=Symbol(`sui-modal-retainer`),Yre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),Xre=V(` `),Zre={hash:`svelte-1cwmgy1`,code:`dialog.svelte-1cwmgy1 {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-1cwmgy1::backdrop {background:transparent;}dialog.backdrop.svelte-1cwmgy1 {background-color:var(--sui-popup-backdrop-color);}dialog.open.svelte-1cwmgy1 {transition-duration:50ms;opacity:1;}dialog.svelte-1cwmgy1:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-1cwmgy1 {transition-duration:1ms !important;}dialog.svelte-1cwmgy1:not(.active) {pointer-events:none !important;}dialog.svelte-1cwmgy1:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function sl(e,t){k(t,!0),q(e,Zre);let n=e=>{var n=U(),l=F(n),u=e=>{var n=Xre(),l=({target:e})=>{C=e},u=({target:e})=>{let t=C;C=void 0,t&&t!==i()||i()&&s()&&e?.matches(`dialog`)&&(i(i().returnValue=`cancel`,!0),r(!1))},f=e=>{e.preventDefault(),i()&&c()&&(i(i().returnValue=`cancel`,!0),r(!1))},p=()=>{b&&i()?.isConnected&&!i().open&&(c()?r(!1):i().showModal())};us(n,()=>({tabindex:`-1`,...d,inert:!B(m),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:l,onclick:u,oncancel:f,onclose:p,[cs]:{backdrop:o(),open:B(m),active:B(h)}}),void 0,void 0,void 0,`svelte-1cwmgy1`);var g=P(n);Uo(g,()=>t.extraContent??jr),Uo(L(g,2),()=>t.children??jr),O(n),ms(n,e=>i(e),()=>i()),W(e,n)};K(l,e=>{B(y)&&e(u)}),W(e,n)},r=Y(t,`open`,15,!1),i=Y(t,`dialog`,15),a=Y(t,`role`,3,`dialog`),o=Y(t,`showBackdrop`,3,!1),s=Y(t,`lightDismiss`,3,!1),c=Y(t,`escapeDismiss`,3,!0),l=Y(t,`keepContent`,3,!1),u=Y(t,`restoreFocus`,3,!0),d=gs(t,Yre),f=()=>{i()?.focus()},p=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},m=M(!1),h=M(!1),g=M(!1),_=M(0),v=ui(Jre);di(Jre,{retain:()=>{co(()=>{N(_,B(_)+1)})},release:()=>{co(()=>{N(_,B(_)-1)})}});let y=j(()=>l()||B(g)||B(_)>0),b=!1,x=0,S,C,w,T=()=>{let e=S;S=void 0,u()&&e&&(w=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},ee=async()=>{if(await ao(),!i())return;let e=Kre(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},E=async()=>{if(b)return;b=!0,x+=1;let e=x,{activeElement:n}=document;window.clearTimeout(w),S=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),N(g,!0),await ao(),e===x&&i()&&!i().open&&(i().showModal(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),N(m,!0),await ao(),e===x&&i()&&(i().contains(document.activeElement)||f(),await ee(),e===x&&N(h,!0)))},te=async()=>{if(!b)return;b=!1,x+=1;let e=x,n=B(m),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),T(),N(h,!1),N(m,!1),n&&await ee(),e===x&&(N(g,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},ne=Fee();return vs(()=>{let e=To(qre,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:ne});return()=>{window.clearTimeout(w),i()?.close(),Oo(e)}}),R(()=>{r()?E():te()}),R(()=>{if(B(g))return v?.retain(),()=>{v?.release()}}),A({focus:f,close:p})}var Qre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),$re=V(`
`),eie={hash:`svelte-11fim4o`,code:`.content.svelte-11fim4o {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:opacity, transform;}.content.menu.svelte-11fim4o {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-11fim4o .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-11fim4o {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-11fim4o .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-11fim4o {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-11fim4o .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-11fim4o {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-11fim4o {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-11fim4o {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-11fim4o {transform:scale(90%);}.content.touch.combobox.svelte-11fim4o .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-11fim4o {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-11fim4o {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-11fim4o {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-11fim4o {transform:none;}`};function cl(e,t){k(t,!0),q(e,eie);let n=e=>{var n=$re();let o,s;Uo(P(n),()=>t.children??jr),O(n),ms(n,e=>a(e),()=>a()),z(()=>{J(n,`hidden`,!r()),o=rs(n,1,`content ${t.class??``} ${B(m)??``}`,`svelte-11fim4o`,o,{touch:B(v),nested:!!l()}),s=as(n,``,s,{inset:B(h)?.style.inset,"z-index":B(h)?.style.zIndex,"min-width":B(h)?.style.minWidth,"max-width":B(h)?.style.maxWidth,"max-height":B(h)?.style.height,visibility:B(h)?.style.inset?void 0:`hidden`})}),go(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),go(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),W(e,n)},r=Y(t,`open`,15,!1),i=Y(t,`hovered`,15,!1),a=Y(t,`content`,15,void 0),o=Y(t,`showBackdrop`,3,void 0),s=Y(t,`position`,3,`bottom-left`),c=Y(t,`positionBaseElement`,3,void 0),l=Y(t,`parentDialogElement`,3,void 0),u=Y(t,`touchOptimized`,3,!1),d=gs(t,Qre),f=M(void 0),p=M(!1),m=M(void 0),h=M(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};R(()=>{B(h)&&r(B(h).open)}),R(()=>{B(h)&&B(h).open!==r()&&(B(h).open=r())}),R(()=>{l()&&!B(f)&&a()&&(N(f,l()),B(f).append(a()))}),R(()=>{t.anchor&&!B(h)&&(N(h,Wre(t.anchor,void 0,s(),c()),!0),N(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),R(()=>{if(B(h)&&B(f)&&a())return B(h).attachPopupElement(B(f),a(),{nested:!!l()}),()=>{B(h)?.detachPopupElement()}}),R(()=>{r()&&B(f)&&B(h)?.checkPosition()});let v=j(()=>u()&&B(p));vs(()=>(N(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{B(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=U(),b=F(y),x=e=>{n(e)},S=e=>{{let i=j(()=>o()??B(v));sl(e,_s(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return B(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await ao(),a()&&!_({tabStopOnly:!0})&&(await Zc(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return B(f)},set dialog(e){N(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};K(b,e=>{l()?e(x):e(S,-1)}),W(e,y),A()}var tie=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),nie=V(``),rie=V(` `,1),iie=V(` `,1),aie={hash:`svelte-si31ue`,code:`button.svelte-si31ue {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-si31ue {display:none !important;}button.svelte-si31ue:not(:disabled):focus-visible {z-index:1;}button.svelte-si31ue:is(.primary:where(.svelte-si31ue), .secondary:where(.svelte-si31ue), .tertiary:where(.svelte-si31ue), .ghost:where(.svelte-si31ue)) {justify-content:center;border-width:1px;}button.svelte-si31ue:is(.primary:where(.svelte-si31ue), .secondary:where(.svelte-si31ue), .tertiary:where(.svelte-si31ue), .ghost:where(.svelte-si31ue)) .label:where(.svelte-si31ue):only-child {padding:0 4px;}button.primary.svelte-si31ue {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-si31ue:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-si31ue {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-si31ue:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-si31ue {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-si31ue {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-si31ue:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-si31ue {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-si31ue {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-si31ue:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-si31ue {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-si31ue {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-si31ue:hover .label:where(.svelte-si31ue) {outline:none !important;text-decoration:underline;}button.link.svelte-si31ue .label:where(.svelte-si31ue) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-si31ue .label:where(.svelte-si31ue) {text-decoration:underline;}button.small.svelte-si31ue {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-si31ue .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-si31ue {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-si31ue {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-si31ue {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-si31ue:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-si31ue {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-si31ue {background-color:var(--sui-error-background-color);}button.svelte-si31ue .label:where(.svelte-si31ue) {padding:0 4px;}button.svelte-si31ue > * {pointer-events:none;}`};function ll(e,t){k(t,!0),q(e,aie);let n=e=>{var t=nie();Xc(P(t),{get lines(){return _()},children:(e,t)=>{$r();var n=H();z(()=>G(n,h())),W(e,n)},$$slots:{default:!0}}),O(t),z(()=>{J(t,`dir`,g()),t.dir=t.dir}),W(e,t)},r=Y(t,`element`,15),i=Y(t,`class`,3,``),a=Y(t,`type`,3,`button`),o=Y(t,`role`,3,`button`),s=Y(t,`name`,3,void 0),c=Y(t,`value`,3,void 0),l=Y(t,`valueType`,19,()=>Yc(c())),u=Y(t,`hidden`,3,!1),d=Y(t,`disabled`,3,!1),f=Y(t,`readonly`,3,!1),p=Y(t,`pressed`,3,void 0),m=Y(t,`keyShortcuts`,3,void 0),h=Y(t,`label`,3,``),g=Y(t,`labelDir`,3,void 0),_=Y(t,`lines`,3,1),v=Y(t,`variant`,3,void 0),y=Y(t,`size`,3,`medium`),b=Y(t,`iconic`,3,!1),x=Y(t,`pill`,3,!1),S=Y(t,`flex`,3,!1),C=Y(t,`popupPosition`,3,`bottom-left`),w=Y(t,`showPopupBackdrop`,3,!1),T=gs(t,tie);var ee=iie(),E=F(ee);us(E,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[cs]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-si31ue`);var te=P(E);Uo(te,()=>t.startIcon??jr);var ne=L(te,2),re=e=>{var r=U(),i=F(r),a=e=>{n(e)},o=e=>{var n=nie();Uo(P(n),()=>t.children??jr),O(n),W(e,n)};K(i,e=>{h()?e(a):e(o,-1)}),W(e,r)},ie=e=>{var r=rie(),i=F(r),a=e=>{n(e)};K(i,e=>{h()&&e(a)}),Uo(L(i,2),()=>t.children??jr),W(e,r)};K(ne,e=>{v()===`link`?e(re):e(ie,-1)}),Uo(L(ne,2),()=>t.endIcon??jr),O(E),ms(E,e=>r(e),()=>r()),$o(E,()=>m()&&Tre(m()));var ae=L(E,2),oe=e=>{cl(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=U();Uo(F(r),()=>t.popup),W(e,r)},$$slots:{default:!0}})};K(ae,e=>{t.popup&&e(oe)}),W(e,ee),A()}var oie=V(`
`),sie=V(`
`),cie={hash:`svelte-yyked3`,code:`.infobar.svelte-yyked3 {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-yyked3 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-yyked3 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-yyked3 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-yyked3 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-yyked3 {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-yyked3 button {font-size:inherit !important;}.message.svelte-yyked3 .icon {font-size:16px; /* !hardcoded */}`};function ul(e,t){k(t,!0),q(e,cie);let n=Y(t,`show`,15,!0),r=Y(t,`dismissible`,3,!0),i=Y(t,`status`,3,`info`),a=Y(t,`ariaLive`,3,void 0),o=Y(t,`children`,3,void 0),s=Y(t,`icon`,3,void 0),c=j(()=>zc(i()));var l=U(),u=F(l),d=e=>{var l=sie(),u=P(l);Rc(P(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),O(u);var d=L(u,2),f=e=>{var r=oie(),i=P(r);{let e=j(()=>X(`_sui.dismiss`));ll(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return B(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{Lc(e,{name:`close`})},$$slots:{default:!0}})}O(r),W(e,r)};K(d,e=>{r()&&e(f)}),O(l),z(e=>{rs(l,1,ts([`infobar`,i()]),`svelte-yyked3`),J(u,`role`,B(c)),J(u,`aria-live`,e)},[()=>Bc(B(c),a())]),W(e,l)};K(u,e=>{n()&&e(d)}),W(e,l),A()}var lie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),uie=V(`
`),die={hash:`svelte-19v7sys`,code:`.bottom-navigation.svelte-19v7sys {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-19v7sys:is([inert]:where(.svelte-19v7sys), [hidden]:where(.svelte-19v7sys)) {display:none;}.bottom-navigation.svelte-19v7sys .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function fie(e,t){q(e,die);let n=gs(t,lie);var r=uie();us(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-19v7sys`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var pie=V(`
`),mie={hash:`svelte-18ubeee`,code:`.floating-action-button-wrapper.svelte-18ubeee {display:contents;} +@media (width < 768px) {.floating-action-button-wrapper.svelte-18ubeee {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-18ubeee button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-18ubeee button .icon {font-size:32px;} +}`};function dl(e,t){q(e,mie);let n=Y(t,`children`,3,void 0);var r=pie();Uo(P(r),()=>n()??jr),O(r),W(e,r)}var fl=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},pl=Symbol(`sui-option-registry`),hie=class{#e=M(!1);get expanded(){return B(this.#e)}set expanded(e){N(this.#e,e,!0)}#t=new Set;#n=M(0);#r=[];#i=-1;get#a(){return this.#i!==B(this.#n)&&(this.#r=[...this.#t],this.#i=B(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),N(this.#n,B(this.#n)+1),()=>{this.#t.delete(e),N(this.#n,B(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},gie=()=>di(pl,new hie),_ie=()=>ui(pl),ml=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:Ere(e.dataset.value,t)}},vie=/\p{Diacritic}/gu,hl=e=>e.normalize(`NFD`).replace(vie,``).toLocaleLowerCase(),gl=e=>hl(e.trim()),_l=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},yie=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},yl=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;tn=>{e.activate(),t(n)},xl=async(e,t)=>{await Zc(100),t()||e.activate()},Sl=`[aria-disabled="true"], [aria-hidden="true"]`,Cl=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},xie={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},Sie=`a[href], button, input, select, textarea, summary, [tabindex]`,Cie=(e,t)=>{let n=[...document.querySelectorAll(Sie)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},Tl=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,wie=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new vl;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=gl(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=rl(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=bl(this,e=>this.onClick(e)),this._onKeyDown=bl(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=xie[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#d(e)&&(this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop())}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),xl(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,Tl(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{fl(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{Cl(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{Cl(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.#d(this.observer.takeRecords())&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(Sl))}}return this.#n}#d(e){let{selector:t}=this,n=e=>e instanceof Element&&(e.matches(t)||!!e.querySelector(t));return e.some(({type:e,target:r,addedNodes:i,removedNodes:a})=>e===`attributes`?r instanceof Element&&r.matches(t):[...i].some(n)||[...a].some(n))}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return wl(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?wl(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await Zc(50),Cie(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(Sl));if(e?.focus(),e&&document.activeElement===e)return;await Zc(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#f(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#p(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#m(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=Tl(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#f(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#f(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#p(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#h(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#g(e,t,n){e.forEach(e=>{Cl(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=Tl(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#m(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#h(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#g(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach(fl)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#_(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#v(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=Pc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=_l(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#y(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#_(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#v(e,t){let{activeMembers:n}=this,r=yl(n.map(e=>gl(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#y(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=_l(this.orientation,n);return i[yie({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=_l(`horizontal`,n),u=c[bie({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=gl(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},El=e=>t=>{let n=typeof e==`function`,r=new wie(t,n?co(()=>e()):e);return n&&R(()=>{r.onUpdate(e())}),()=>{r.destroy()}},Tie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),Eie=V(`
`),Die={hash:`svelte-1muyued`,code:`.select-button-group.svelte-1muyued {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-1muyued:focus-visible {outline-width:0 !important;}.select-button-group.svelte-1muyued button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-1muyued button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-1muyued button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-1muyued button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-1muyued button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-1muyued button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-1muyued button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-1muyued button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-1muyued button {pointer-events:none;}.inner.svelte-1muyued {display:contents;}`};function Dl(e,t){k(t,!0),q(e,Die);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`ariaLabel`,3,void 0),c=gs(t,Tie);var l=Eie();us(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-1muyued`);var u=P(l);Uo(P(u),()=>t.children??jr),O(u),O(l),$o(l,El),z(()=>u.inert=r()),W(e,l),A()}var Oie=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function Ol(e,t){k(t,!0);let n=Y(t,`selected`,15,!1),r=gs(t,Oie);ll(e,_s(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),A()}var kie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),Aie=V(` `,1);function kl(e,t){k(t,!0);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`popupPosition`,3,`bottom-left`),a=Y(t,`popupPositionBaseElement`,3,void 0),o=Y(t,`showPopupBackdrop`,3,!1),s=Y(t,`label`,3,``),c=Y(t,`variant`,3,void 0),l=Y(t,`size`,3,`medium`),u=Y(t,`iconic`,3,!1),d=gs(t,kie),f=M(void 0);var p={focus:()=>{B(f)?.focus()}},m=Aie(),h=F(m);return ll(h,_s(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return B(f)},set element(e){N(f,e,!0)},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.endIcon),W(e,n)},a=e=>{Lc(e,{name:`more_vert`})},o=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})};K(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),W(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),cl(L(h,2),{get anchor(){return B(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=U();Uo(F(r),()=>t.popup??jr),W(e,r)},$$slots:{default:!0}}),W(e,m),A(p)}var jie=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),Mie=V(`
`),Nie={hash:`svelte-3n9pfd`,code:`.split-button.svelte-3n9pfd {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-3n9pfd button {margin:0;}.split-button.svelte-3n9pfd button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-3n9pfd button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function Al(e,t){k(t,!0),q(e,Nie);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`label`,3,``),a=Y(t,`variant`,3,void 0),o=Y(t,`size`,3,`medium`),s=Y(t,`popupPosition`,3,`bottom-left`),c=Y(t,`showPopupBackdrop`,3,!1),l=gs(t,jie),u=M(void 0);var d=Mie(),f=P(d);ll(f,_s(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=L(f,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),W(e,n)},i=e=>{var n=U();Uo(F(n),()=>t.popup??jr),W(e,n)},l=j(()=>X(`_sui.split_button.more_options`));kl(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return B(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return B(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}O(d),ms(d,e=>N(u,e),()=>B(u)),z(e=>{J(d,`hidden`,n()),J(d,`aria-hidden`,n()),J(d,`aria-disabled`,r()),J(d,`aria-label`,e)},[()=>X(`_sui.split_button.x_options`,{values:{name:i()}})]),W(e,d),A()}var Pie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),Fie=V(`
`),Iie={hash:`svelte-w8d0de`,code:`.checkbox-group.svelte-w8d0de {display:inline-flex;}.checkbox-group.horizontal.svelte-w8d0de {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-w8d0de {gap:4px;flex-direction:column;} +@media (pointer: coarse) {.checkbox-group.vertical.svelte-w8d0de {gap:8px;} +}.inner.svelte-w8d0de {display:contents;}`};function Lie(e,t){k(t,!0),q(e,Iie);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,Pie);var s=Fie();us(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>X(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-w8d0de`);var c=P(s);Uo(P(c),()=>t.children??jr),O(c),O(s),z(()=>c.inert=r()),W(e,s),A()}var Rie=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),zie=V(``),Bie=V(`
`),Vie={hash:`svelte-1qs7yhc`,code:`.checkbox.svelte-1qs7yhc {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-1qs7yhc:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-1qs7yhc:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-1qs7yhc:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-1qs7yhc:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-1qs7yhc button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-1qs7yhc button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-1qs7yhc button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-1qs7yhc button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-1qs7yhc button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-1qs7yhc label:where(.svelte-1qs7yhc) {cursor:inherit;}.checkbox.readonly.svelte-1qs7yhc {cursor:default;}.checkbox.readonly.svelte-1qs7yhc button, .checkbox.readonly.svelte-1qs7yhc:is(:where(.svelte-1qs7yhc):hover, :where(.svelte-1qs7yhc):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-1qs7yhc button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-1qs7yhc:is(:where(.svelte-1qs7yhc):hover, :where(.svelte-1qs7yhc):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-1qs7yhc {display:contents;}`};function jl(e,t){let n=Co();k(t,!0),q(e,Vie);let r=Y(t,`checked`,15,!1),i=Y(t,`name`,3,void 0),a=Y(t,`value`,3,void 0),o=Y(t,`hidden`,3,!1),s=Y(t,`disabled`,3,!1),c=Y(t,`readonly`,3,!1),l=Y(t,`required`,3,!1),u=Y(t,`invalid`,3,!1),d=Y(t,`label`,3,void 0),f=Y(t,`ariaLabel`,3,void 0),p=Y(t,`group`,15),m=gs(t,Rie),h=M(void 0),g=j(()=>f()??m[`aria-label`]),_=j(()=>!!(t.children||d())),v=j(()=>r()===`mixed`);R(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=Bie();let b;var x=P(y),S=P(x);{let e=e=>{var n=U(),i=F(n),a=e=>{var n=U();Uo(F(n),()=>t.checkIcon),W(e,n)},o=e=>{Lc(e,{name:`remove`})},s=e=>{Lc(e,{name:`check`})};K(i,e=>{t.checkIcon?e(a):B(v)?e(o,1):r()&&e(s,2)}),W(e,n)},d=j(()=>B(g)||void 0),f=j(()=>!B(g)&&B(_)?`${n}-label`:void 0);ll(S,_s(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()},get"aria-label"(){return B(d)},get"aria-labelledby"(){return B(f)},onclick:e=>{e.preventDefault(),e.stopPropagation(),s()||c()||(r(B(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return B(h)},set element(e){N(h,e,!0)},startIcon:e,$$slots:{startIcon:!0}}))}var C=L(S,2),w=e=>{var r=zie(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},o=e=>{var t=H();z(()=>G(t,d())),W(e,t)};K(i,e=>{t.children?e(a):e(o,-1)}),O(r),z(()=>J(r,`id`,`${n}-label`)),W(e,r)};K(C,e=>{B(_)&&e(w)}),O(x),O(y),z(()=>{b=rs(y,1,`sui checkbox ${t.class??``}`,`svelte-1qs7yhc`,b,{checked:r(),indeterminate:B(v),disabled:s(),readonly:c()}),J(y,`hidden`,o()),x.inert=s()}),_o(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||B(h)?.click()}),W(e,y),A()}vo([`click`]);var Hie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),Uie=V(`
`),Wie={hash:`svelte-91ytvl`,code:`.spacer.flex.svelte-91ytvl:not([hidden]) {display:block;flex:auto;}.spacer.svelte-91ytvl:not(.flex) {width:8px;height:8px;}`};function Ml(e,t){q(e,Wie);let n=Y(t,`flex`,3,!1),r=gs(t,Hie);var i=Uie();us(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[cs]:{flex:n()}}),void 0,void 0,void 0,`svelte-91ytvl`),W(e,i)}function Nl(e,t){k(t,!0);let n=Y(t,`class`,3,void 0),r=Y(t,`closeIcon`,3,void 0);{let i=e=>{var t=U(),n=F(t),i=e=>{var t=U();Uo(F(t),r),W(e,t)},a=e=>{Lc(e,{name:`close`})};K(n,e=>{r()?e(i):e(a,-1)}),W(e,t)},a=j(()=>X(`_sui.close`));ll(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return B(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}A()}var Gie=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),Kie=V(`
`,1),qie=V(`
`),Jie=V(` `,1),Yie=V(``),Xie=V(`
`),Zie={hash:`svelte-i5bh32`,code:`.content.svelte-i5bh32 {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-i5bh32 {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-i5bh32 {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-i5bh32 {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;} +@media (max-height: 300px) {.content.x-small.svelte-i5bh32 {max-height:calc(100dvh - 32px);} +}.content.small.svelte-i5bh32 {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));} +@media (max-height: 400px) {.content.small.svelte-i5bh32 {max-height:calc(100dvh - 32px);} +}.content.medium.svelte-i5bh32 {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));} +@media (max-height: 600px) {.content.medium.svelte-i5bh32 {max-height:calc(100dvh - 32px);} +}.content.large.svelte-i5bh32 {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));} +@media (max-height: 800px) {.content.large.svelte-i5bh32 {max-height:calc(100dvh - 32px);} +}.content.x-large.svelte-i5bh32 {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));} +@media (max-height: 1000px) {.content.x-large.svelte-i5bh32 {max-height:calc(100dvh - 32px);} +}:is(.header.svelte-i5bh32, .footer.svelte-i5bh32) {display:flex;align-items:center;gap:4px;}.header.svelte-i5bh32 {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.svelte-i5bh32 .title:where(.svelte-i5bh32) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-i5bh32 {margin:var(--sui-dialog-footer-margin, 0 24px 24px);} +@media (width < 768px) {.footer.svelte-i5bh32 {margin:var(--sui-dialog-footer-margin, 0 16px 16px);} +}.body.svelte-i5bh32 {overflow:auto;margin:var(--sui-dialog-body-margin, 24px 24px);white-space:normal;line-height:var(--sui-line-height-compact);} +@media (width < 768px) {.body.svelte-i5bh32 {margin:var(--sui-dialog-body-margin, 16px 16px);} +}`};function Pl(e,t){let n=Co();k(t,!0),q(e,Zie);let r=Y(t,`open`,15,!1);Y(t,`value`,11,``);let i=Y(t,`ariaLabelledby`,3,void 0),a=Y(t,`role`,3,`dialog`),o=Y(t,`size`,3,`medium`),s=Y(t,`showClose`,3,!1),c=Y(t,`showOk`,3,!0),l=Y(t,`showCancel`,3,!0),u=Y(t,`okLabel`,3,``),d=Y(t,`okShortcuts`,3,void 0),f=Y(t,`okDisabled`,3,!1),p=Y(t,`cancelLabel`,3,``),m=Y(t,`cancelShortcuts`,3,void 0),h=Y(t,`cancelDisabled`,3,!1),g=Y(t,`focusInput`,3,!0),_=gs(t,Gie),v=j(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),y=j(()=>B(v)?void 0:t.title||void 0),b=M(void 0),x=M(void 0);R(()=>{if(r()&&B(x)){let e=!1;return(async()=>{if(await Zc(50),e||B(x)?.contains(document.activeElement))return;let t=g()?B(x)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):B(b)?.focus()})(),()=>{e=!0}}}),ms(sl(e,_s(()=>_,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return B(y)},get"aria-labelledby"(){return B(v)},get"aria-describedby"(){return`${n}-body`},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=Xie(),a=P(i),g=e=>{var r=qie(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.header),W(e,n)},o=e=>{var r=Kie(),i=F(r),a=I(i,!0),o=L(i,2);Ml(o,{flex:!0});var c=L(o,2);Uo(c,()=>t.headerExtra??jr);var l=L(c,2),u=e=>{Nl(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(b)?.close(`close`)}})};K(l,e=>{s()&&e(u)}),z(()=>{J(i,`id`,`${n}-title`),G(a,t.title)}),W(e,r)};K(i,e=>{t.header?e(a):e(o,-1)}),O(r),W(e,r)};K(a,e=>{(t.title||s()||t.header||t.headerExtra)&&e(g)});var _=L(a,2);Uo(P(_),()=>t.children??jr),O(_);var v=L(_,2),y=e=>{var n=Yie(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.footer??jr),W(e,n)},a=e=>{var n=Jie(),r=F(n);Uo(r,()=>t.footerExtra??jr);var i=L(r,2);Ml(i,{flex:!0});var a=L(i,2),o=e=>{{let t=j(()=>u()||X(`_sui.ok`));ll(e,{variant:`primary`,get label(){return B(t)},get keyShortcuts(){return d()},get disabled(){return f()},onclick:()=>{B(b)?.close(`ok`)}})}};K(a,e=>{c()&&e(o)});var s=L(a,2),g=e=>{{let t=j(()=>p()||X(`_sui.cancel`));ll(e,{variant:`secondary`,get label(){return B(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{B(b)?.close(`cancel`)}})}};K(s,e=>{l()&&e(g)}),W(e,n)};K(r,e=>{t.footer?e(i):e(a,-1)}),O(n),W(e,n)};K(v,e=>{(c()||l()||t.footer||t.footerExtra)&&e(y)}),O(i),ms(i,e=>N(x,e),()=>B(x)),z(()=>{rs(i,1,ts([`content`,t.class,o()]),`svelte-i5bh32`),J(_,`id`,`${n}-body`)}),W(e,i)},$$slots:{default:!0}})),e=>N(b,e,!0),()=>B(b)),A()}var Qie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Fl(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=gs(t,Qie);Pl(e,_s(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),A()}var $ie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Il(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=gs(t,$ie);Pl(e,_s(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),A()}var eae=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),tae=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);eae.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||`​`,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},nae=/(?<=^|[\s([{"'«])(?::)(?[a-zA-Z0-9_+-]{1,64})$/,Ll=/[-_]/,Rl,rae=e=>e.split(` +`).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),zl=(e,t)=>{let n=e.split(Ll);return e===t?0:e.startsWith(t)&&Ll.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},iae=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,aae=({name:e,aliases:t},n)=>{let r=zl(e,n),i=iae(t,n);return{rank:Math.min(r,i),nameRank:r}},oae=({name:e,aliases:t},n)=>{if(zl(e,n)<9)return e.split(Ll).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},sae=e=>{let t=e.toLowerCase();return t?(Rl??=rae(`😀 grinning face 😃 smiley smiling face open mouth 😄 smile smiling face open mouth eyes 😁 grin grinning face smiling eyes @@ -2010,102 +2016,104 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`

An error 🇿🇼 flag-zw zimbabwe 🏴󠁧󠁢󠁥󠁮󠁧󠁿 flag-england 🏴󠁧󠁢󠁳󠁣󠁴󠁿 flag-scotland -🏴󠁧󠁢󠁷󠁬󠁳󠁿 flag-wales`),zl.map(e=>{let{rank:n,nameRank:r}=Kie(e,t);return{entry:e,rank:n,nameRank:r,centrality:qie(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},Vl=(e,t)=>/^\s/.test(t)?e:`${e} `,Hl=e=>e.match(Uie)?.groups?.query,Ul=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=ss,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},Yie=B(`

`),Xie=B(`
`),Zie={hash:`svelte-4w35sy`,code:`.emoji-suggestions.svelte-4w35sy {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);width:280px;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;}.option.svelte-4w35sy {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-4w35sy {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-4w35sy .emoji:where(.svelte-4w35sy) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-4w35sy .name:where(.svelte-4w35sy) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function Wl(e,t){let n=mo();O(t,!0),K(e,Zie);let r=J(t,`ariaOwner`,3,void 0),i=j(void 0),a=j(Yi([])),o=j(0),s=j(void 0),c=j(void 0),l=j(void 0),u=A(()=>!!z(i)&&!!z(a).length),d=j(0),f=j(0),p=A(()=>z(d)?z(d)*5+z(f):180),m=A(()=>z(s)?Ul({anchorRect:z(s),listMaxHeight:z(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Dc()}):void 0),h=()=>z(u),g=(e=!1)=>{$a(()=>{M(l,e&&z(i)?z(i).id:void 0,!0),M(i,void 0),M(a,[],!0),M(o,0),M(s,void 0)})},_=e=>{if(!e){(z(i)||z(l))&&g();return}if(z(l)===e.id)return;let{id:n,query:r}=e;M(l,void 0),M(s,t.getAnchorRect(e),!0),z(i)?.id===n&&z(i).query===r?M(i,e,!0):(M(i,e,!0),M(a,Jie(r),!0),M(o,0))},v=e=>{let{length:t}=z(a);t&&M(o,(z(o)+e+t)%t)},y=()=>{let e=z(a)[z(o)];e&&z(i)&&t.onSelect(e,z(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!z(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};L(()=>{if(z(a),!z(c))return;z(c).matches(`:popover-open`)||z(c).showPopover?.();let e=z(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(z(c));M(d,e.getBoundingClientRect().height,!0),M(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),L(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),L(()=>{if(!r())return;let e=r();return z(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${z(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),L(()=>{z(o),z(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),xs(()=>{let e=()=>{z(i)&&M(s,t.getAnchorRect(z(i)),!0)},n=({target:e})=>{let t=e;!z(u)||z(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=H(),C=P(S),w=e=>{var t=Xie();let r;ko(t,23,()=>z(a),e=>e.emoji,(e,t,r)=>{var i=Yie(),a=N(i),s=F(a,!0),c=F(I(a,2),!0);D(i),R(()=>{q(i,`id`,`${n}-option-${z(r)}`),q(i,`aria-selected`,z(r)===z(o)),W(s,z(t).emoji),W(c,`:${z(t).name}:`)}),oo(`mouseenter`,i,()=>{M(o,z(r),!0)}),so(`mousedown`,i,e=>{e.preventDefault(),M(o,z(r),!0),y()}),U(e,i)}),D(t),_s(t,e=>M(c,e),()=>z(c)),R(e=>{q(t,`id`,n),q(t,`aria-label`,e),r=Qo(t,``,r,{top:z(m).top,bottom:z(m).bottom,left:z(m).left,"max-height":z(m).maxHeight})},[()=>Y(`_sui.emoji_suggestions`)]),U(e,t)};return G(C,e=>{z(u)&&z(m)&&e(w)}),U(e,S),k(x)}co([`mousedown`]);function Gl(e,t){O(t,!0);let n=J(t,`element`,3,void 0),r=j(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=Hl(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}};L(()=>{if(!n()||!z(r))return;let e=n(),t=()=>{z(r)?.update(i())},a=e=>{z(r)?.handleKeyDown(e)},o=()=>{z(r)?.close()};return e.addEventListener(`keydown`,a),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,o),()=>{e.removeEventListener(`keydown`,a),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,o),z(r)?.close()}}),_s(Wl(e,{getAnchorRect:e=>{let{start:t,end:r}=e;return n()?Hie(n(),t,r):void 0},onSelect:(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=Vl(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},get ariaOwner(){return n()}}),e=>M(r,e,!0),()=>z(r)),k()}var Qie=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),$ie=B(``),eae=B(`
`),tae={hash:`svelte-133vcb4`,code:`.text-input.svelte-133vcb4 {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-133vcb4:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-133vcb4 {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-133vcb4:is(:where(.svelte-133vcb4):-webkit-autofill, :where(.svelte-133vcb4):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-133vcb4 {display:inline-block;flex:auto;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}input.svelte-133vcb4:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input.svelte-133vcb4:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-133vcb4:is(:where(.svelte-133vcb4):disabled, :where(.svelte-133vcb4):read-only) {background-color:var(--sui-disabled-background-color);}input[aria-invalid=true].svelte-133vcb4 {border-color:var(--sui-error-border-color);}input.svelte-133vcb4 ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-133vcb4 ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-133vcb4 ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-133vcb4 {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-133vcb4 {opacity:0;}input.svelte-133vcb4:focus + .label:where(.svelte-133vcb4) {opacity:0;}input.svelte-133vcb4::placeholder, -.label.svelte-133vcb4 {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function Kl(e,t){let n=mo();O(t,!0),K(e,tae);let r=J(t,`value`,15),i=J(t,`element`,15),a=J(t,`role`,3,`textbox`),o=J(t,`keyShortcuts`,3,void 0),s=J(t,`dir`,3,void 0),c=J(t,`name`,3,void 0),l=J(t,`showInlineLabel`,3,!1),u=J(t,`inputmode`,3,`text`),d=J(t,`flex`,3,!1),f=J(t,`monospace`,3,!1),p=J(t,`debounce`,3,!1),m=J(t,`useEmojiAutocomplete`,3,!1),h=J(t,`hidden`,3,!1),g=J(t,`disabled`,3,!1),_=J(t,`readonly`,3,!1),v=J(t,`required`,3,!1),y=J(t,`invalid`,3,!1),b=J(t,`ariaLabel`,3,void 0),x=ys(t,Qie),S=A(()=>typeof p()==`number`?p():300),C=A(()=>b()??x[`aria-label`]),w=0;L(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},z(S))):T(t)};var te=eae();let ne;var re=N(te);us(re,()=>({...x,value:r(),type:`text`,role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":z(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-133vcb4`,!0),_s(re,e=>i(e),()=>i()),Wo(re,()=>Wc(o()));var ie=I(re,2),ae=e=>{Gl(e,{get element(){return i()}})};G(ie,e=>{m()&&!g()&&!_()&&e(ae)});var oe=I(ie,2),se=e=>{var t=$ie();let i;Kc(N(t),{children:(e,t)=>{Kr();var n=V();R(()=>W(n,z(C))),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`id`,`${n}-label`),i=Xo(t,1,`label svelte-133vcb4`,null,i,{hidden:!!r()})}),U(e,t)};G(oe,e=>{z(C)&&l()&&e(se)}),D(te),R(()=>{ne=Xo(te,1,`sui text-input ${t.class??``}`,`svelte-133vcb4`,ne,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),q(te,`hidden`,h()),re.dir=re.dir}),U(e,te),k()}var nae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),rae=B(`
`,1),iae={hash:`svelte-1wcwjkb`,code:`.input-outer.svelte-1wcwjkb {margin:12px 0 0;}`};function ql(e,t){O(t,!0),K(e,iae);let n=J(t,`open`,15,!1),r=J(t,`value`,15,``),i=J(t,`textboxAttrs`,19,()=>({})),a=ys(t,nae);Fl(e,bs(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=rae(),o=P(a);Po(o,()=>t.children??Tr);var s=I(o,2),c=N(s),l=e=>{var n=H();Po(P(n),()=>t.input),U(e,n)},u=e=>{{let n=A(()=>`aria-labelledby`in i()?void 0:t.title);Kl(e,bs({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return z(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};G(c,e=>{t.input?e(l):e(u,-1)}),D(s),U(e,a)},$$slots:{default:!0}})),k()}var aae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),oae=B(`
`),sae={hash:`svelte-sekm1e`,code:`.divider.svelte-sekm1e {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-sekm1e {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-sekm1e {margin:0 8px;width:1px;height:100%;}`};function Jl(e,t){K(e,sae);let n=J(t,`hidden`,3,!1),r=J(t,`orientation`,3,`horizontal`),i=J(t,`ariaLabel`,3,void 0),a=ys(t,aae);var o=oae();us(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-sekm1e`),U(e,o)}var cae=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},lae=(e,t)=>Math.max(0,e*t),Yl=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],uae=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},dae=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),fae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),Xl=B(`
`),pae=B(`
`),mae=B(``),hae=B(`
`),gae={hash:`svelte-1h1mk8q`,code:`.content.svelte-1h1mk8q {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {position:absolute;}.content.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) button.close {margin:8px;}dialog.open .content.svelte-1h1mk8q {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-1h1mk8q {transition-duration:300ms;}.content.right.svelte-1h1mk8q {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-1h1mk8q:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-1h1mk8q:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-1h1mk8q {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-1h1mk8q:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-1h1mk8q:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-1h1mk8q {transform:translateX(0%);}.content.vertical.small.svelte-1h1mk8q {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-1h1mk8q {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-1h1mk8q {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-1h1mk8q {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-1h1mk8q {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-1h1mk8q {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-1h1mk8q {transform:translateY(-105%);}.content.bottom.svelte-1h1mk8q {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-1h1mk8q {transform:translateY(105%);}dialog.open .content.horizontal.svelte-1h1mk8q {transform:translateY(0%);}.content.horizontal.small.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-1h1mk8q {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-1h1mk8q > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-1h1mk8q, .content.swipe-dismiss.swiping.svelte-1h1mk8q .handle:where(.svelte-1h1mk8q) {cursor:grabbing;}.handle.svelte-1h1mk8q {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-1h1mk8q::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-1h1mk8q, .footer.svelte-1h1mk8q) {display:flex;align-items:center;gap:8px;}.header.svelte-1h1mk8q {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-1h1mk8q .title:where(.svelte-1h1mk8q) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-1h1mk8q {margin:0 24px 24px;}.main.svelte-1h1mk8q {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function _ae(e,t){let n=mo();O(t,!0),K(e,gae);let r=J(t,`open`,15,!1),i=J(t,`title`,3,``),a=J(t,`ariaLabelledby`,3,void 0),o=J(t,`position`,3,`right`),s=J(t,`size`,3,`small`),c=J(t,`showClose`,3,`outside`),l=J(t,`swipeDismiss`,3,!1),u=ys(t,fae),d=j(void 0),f=A(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=j(void 0),m=j(void 0),h=j(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!z(p)||z(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&z(p).contains(c))return;let{axis:u,sign:d}=cae(o(),z(p).matches(`:dir(rtl)`));M(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),M(h,0),z(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;z(m)&&t===z(m).pointerId&&(M(h,lae((z(m).axis===`Y`?r:n)-z(m).start,z(m).sign),!0),z(m).samples=Yl(z(m).samples,{offset:z(h),time:i}))},v=e=>{if(!z(m)||!z(p)||e.pointerId!==z(m).pointerId)return;let{width:t,height:n}=z(p).getBoundingClientRect(),r=Yl(z(m).samples,{offset:z(h),time:e.timeStamp}),i=e.type===`pointerup`&&dae({offset:z(h),size:z(m).axis===`Y`?n:t,velocity:uae(r)});M(m,void 0),M(h,0),i&&z(d)?.close(`close`)};L(()=>{r()||$a(()=>{M(m,void 0),M(h,0)})});let y=A(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=A(()=>z(y)?void 0:i()||void 0);_s(sl(e,bs(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return z(b)},get"aria-labelledby"(){return z(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=hae();let u;var y=N(a),b=e=>{U(e,Xl())};G(y,e=>{l()&&o()===`bottom`&&e(b)});var x=I(y,2),S=N(x),C=e=>{Pl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(S,e=>{c()===`outside`&&e(C)}),D(x);var w=I(x,2),T=e=>{var r=H(),a=P(r),o=e=>{var n=H();Po(P(n),()=>t.header),U(e,n)},s=e=>{var r=pae(),a=N(r),o=F(a,!0),s=I(a,2);Nl(s,{flex:!0});var l=I(s,2);Po(l,()=>t.headerExtra??Tr);var u=I(l,2),f=e=>{Pl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(u,e=>{c()===`inside`&&e(f)}),D(r),R(()=>{q(a,`id`,`${n}-title`),W(o,i())}),U(e,r)};G(a,e=>{t.header?e(o):e(s,-1)}),U(e,r)};G(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=I(w,2);Po(N(ee),()=>t.children??Tr),D(ee);var te=I(ee,2),ne=e=>{var n=mae();Po(N(n),()=>t.footer??Tr),D(n),U(e,n)};G(te,e=>{t.footer&&e(ne)});var re=I(te,2),ie=e=>{U(e,Xl())};G(re,e=>{l()&&o()===`top`&&e(ie)}),D(a),_s(a,e=>M(p,e),()=>z(p)),R(()=>{Xo(a,1,Ko([`content`,t.class,s(),o(),z(f),{"swipe-dismiss":l(),swiping:!!z(m)}]),`svelte-1h1mk8q`),u=Qo(a,``,u,{transform:z(m)?`translate${z(m).axis}(${z(m).sign*z(h)}px)`:void 0,"transition-duration":z(m)?`0s`:void 0})}),so(`pointerdown`,a,g),so(`pointermove`,a,_),so(`pointerup`,a,v),oo(`pointercancel`,a,v),U(e,a)},$$slots:{default:!0}})),e=>M(d,e,!0),()=>z(d)),k()}co([`pointerdown`,`pointermove`,`pointerup`]);var vae=B(``);function Zl(e,t){O(t,!0);let n=J(t,`accept`,3,void 0),r=J(t,`multiple`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`onCancel`,3,void 0),o=j(void 0);var s={open:()=>{z(o)?.click()}},c=vae();return _s(c,e=>M(o,e),()=>z(o)),R(()=>{q(c,`accept`,n()),c.multiple=r()}),so(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),oo(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),U(e,c),k(s)}co([`change`]);var yae=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),bae=B(``),xae=B(`
`),Sae=B(`
`),Cae={hash:`svelte-hl7w1x`,code:`[role=rowgroup].svelte-hl7w1x {display:table-row-group;}[role=row].svelte-hl7w1x {display:table-row;}[role=columnheader].svelte-hl7w1x {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-hl7w1x:has(> .expander) {padding:0;}[role=columnheader].svelte-hl7w1x .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-hl7w1x {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-hl7w1x:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-hl7w1x:dir(rtl) {transform:rotate(-90deg);}`};function Ql(e,t){let n=mo();O(t,!0),K(e,Cae);let r=J(t,`expanded`,15,!0),i=J(t,`label`,3,``),a=J(t,`collapsible`,3,!1),o=ys(t,yae),s=A(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{z(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=Sae();us(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-hl7w1x`);var d=N(u),f=e=>{var a=xae();Bte(N(a),()=>`th`,!1,(e,a)=>{us(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-hl7w1x`);var o=H(),l=P(o),u=e=>{ul(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=bae(),r=N(n),i=e=>{var n=H();Po(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Dc()?`chevron_left`:`chevron_right`);Ac(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=V();R(()=>W(t,i())),U(e,t)};G(l,e=>{z(s)?e(u):e(d,-1)}),U(a,o)}),D(a),Wo(a,()=>l),U(e,a)};G(d,e=>{i()&&e(f)});var p=I(d,2),m=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)};G(p,e=>{(!z(s)||r())&&e(m)}),D(u),U(e,u),k()}var wae=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),Tae=B(`
`),Eae={hash:`svelte-1wcwpq4`,code:`.table-head.svelte-1wcwpq4, -.grid-head.svelte-1wcwpq4 {display:table-header-group;}.table-foot.svelte-1wcwpq4, -.grid-foot.svelte-1wcwpq4 {display:table-footer-group;}.table-row.svelte-1wcwpq4, -.grid-row.svelte-1wcwpq4 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-1wcwpq4, -.grid-col-header.svelte-1wcwpq4, -.table-cell.svelte-1wcwpq4, -.grid-cell.svelte-1wcwpq4 {display:table-cell;}.table-row-header.svelte-1wcwpq4, -.grid-row-header.svelte-1wcwpq4 {display:table-cell;height:var(--sui-secondary-row-height);}`};function $l(e,t){K(e,Eae);let n=ys(t,wae);var r=Tae();us(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-1wcwpq4`),Po(N(r),()=>t.children??Tr),D(r),U(e,r)}var Dae=new Set([`$$slots`,`$$events`,`$$legacy`]);function eu(e,t){let n=ys(t,Dae);$l(e,bs(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var Oae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),kae={hash:`svelte-1n3kqw5`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;} +🏴󠁧󠁢󠁷󠁬󠁳󠁿 flag-wales`),Rl.map(e=>{let{rank:n,nameRank:r}=aae(e,t);return{entry:e,rank:n,nameRank:r,centrality:oae(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},Bl=(e,t)=>/^\s/.test(t)?e:`${e} `,Vl=e=>e.match(nae)?.groups?.query,Hl=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=ss,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},cae=V(`
`),lae=V(`
`),uae={hash:`svelte-6dhkew`,code:`.emoji-suggestions.svelte-6dhkew {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);width:280px;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;}.option.svelte-6dhkew {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-6dhkew {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-6dhkew .emoji:where(.svelte-6dhkew) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-6dhkew .name:where(.svelte-6dhkew) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function Ul(e,t){let n=Co();k(t,!0),q(e,uae);let r=Y(t,`ariaOwner`,3,void 0),i=M(void 0),a=M(na([])),o=M(0),s=M(void 0),c=M(void 0),l=M(void 0),u=j(()=>!!B(i)&&!!B(a).length),d=M(0),f=M(0),p=j(()=>B(d)?B(d)*5+B(f):180),m=j(()=>B(s)?Hl({anchorRect:B(s),listMaxHeight:B(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Pc()}):void 0),h=()=>B(u),g=(e=!1)=>{co(()=>{N(l,e&&B(i)?B(i).id:void 0,!0),N(i,void 0),N(a,[],!0),N(o,0),N(s,void 0)})},_=e=>{if(!e){(B(i)||B(l))&&g();return}if(B(l)===e.id)return;let{id:n,query:r}=e;N(l,void 0),N(s,t.getAnchorRect(e),!0),B(i)?.id===n&&B(i).query===r?N(i,e,!0):(N(i,e,!0),N(a,sae(r),!0),N(o,0))},v=e=>{let{length:t}=B(a);t&&N(o,(B(o)+e+t)%t)},y=()=>{let e=B(a)[B(o)];e&&B(i)&&t.onSelect(e,B(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!B(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};R(()=>{if(B(a),!B(c))return;B(c).matches(`:popover-open`)||B(c).showPopover?.();let e=B(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(B(c));N(d,e.getBoundingClientRect().height,!0),N(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),R(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),R(()=>{if(!r())return;let e=r();return B(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${B(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),R(()=>{B(o),B(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),vs(()=>{let e=()=>{B(i)&&N(s,t.getAnchorRect(B(i)),!0)},n=({target:e})=>{let t=e;!B(u)||B(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=U(),C=F(S),w=e=>{var t=lae();let r;Ro(t,23,()=>B(a),e=>e.emoji,(e,t,r)=>{var i=cae(),a=P(i),s=I(a,!0),c=I(L(a,2),!0);O(i),z(()=>{J(i,`id`,`${n}-option-${B(r)}`),J(i,`aria-selected`,B(r)===B(o)),G(s,B(t).emoji),G(c,`:${B(t).name}:`)}),go(`mouseenter`,i,()=>{N(o,B(r),!0)}),_o(`mousedown`,i,e=>{e.preventDefault(),N(o,B(r),!0),y()}),W(e,i)}),O(t),ms(t,e=>N(c,e),()=>B(c)),z(e=>{J(t,`id`,n),J(t,`aria-label`,e),r=as(t,``,r,{top:B(m).top,bottom:B(m).bottom,left:B(m).left,"max-height":B(m).maxHeight})},[()=>X(`_sui.emoji_suggestions`)]),W(e,t)};return K(C,e=>{B(u)&&B(m)&&e(w)}),W(e,S),A(x)}vo([`mousedown`]);function Wl(e,t){k(t,!0);let n=Y(t,`element`,3,void 0),r=M(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=Vl(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}},a=e=>{let{start:t,end:r}=e;return n()?tae(n(),t,r):void 0},o=(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=Bl(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},s=e=>{B(r)?.handleKeyDown(e)};R(()=>{if(!n()||!B(r))return;let e=n(),t=()=>{B(r)?.update(i())},a=()=>{B(r)?.close()};return e.addEventListener(`keydown`,s),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,a),()=>{e.removeEventListener(`keydown`,s),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,a),B(r)?.close()}}),ms(Ul(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return n()}}),e=>N(r,e,!0),()=>B(r)),A()}var dae=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),fae=V(``),pae=V(`
`),mae={hash:`svelte-16h9hre`,code:`.text-input.svelte-16h9hre {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-16h9hre:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-16h9hre {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-16h9hre:is(:where(.svelte-16h9hre):-webkit-autofill, :where(.svelte-16h9hre):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-16h9hre {display:inline-block;flex:auto;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}input.svelte-16h9hre:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input.svelte-16h9hre:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-16h9hre:is(:where(.svelte-16h9hre):disabled, :where(.svelte-16h9hre):read-only) {background-color:var(--sui-disabled-background-color);}input[aria-invalid=true].svelte-16h9hre {border-color:var(--sui-error-border-color);}input.svelte-16h9hre ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-16h9hre ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-16h9hre ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-16h9hre {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-16h9hre {opacity:0;}input.svelte-16h9hre:focus + .label:where(.svelte-16h9hre) {opacity:0;}input.svelte-16h9hre::placeholder, +.label.svelte-16h9hre {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function Gl(e,t){let n=Co();k(t,!0),q(e,mae);let r=Y(t,`value`,15),i=Y(t,`element`,15),a=Y(t,`role`,3,`textbox`),o=Y(t,`keyShortcuts`,3,void 0),s=Y(t,`dir`,3,void 0),c=Y(t,`name`,3,void 0),l=Y(t,`showInlineLabel`,3,!1),u=Y(t,`inputmode`,3,`text`),d=Y(t,`flex`,3,!1),f=Y(t,`monospace`,3,!1),p=Y(t,`debounce`,3,!1),m=Y(t,`useEmojiAutocomplete`,3,!1),h=Y(t,`hidden`,3,!1),g=Y(t,`disabled`,3,!1),_=Y(t,`readonly`,3,!1),v=Y(t,`required`,3,!1),y=Y(t,`invalid`,3,!1),b=Y(t,`ariaLabel`,3,void 0),x=gs(t,dae),S=j(()=>typeof p()==`number`?p():300),C=j(()=>b()??x[`aria-label`]),w=0;R(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},B(S))):T(t)};var E=pae();let te;var ne=P(E);us(ne,()=>({type:`text`,...x,value:r(),role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":B(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-16h9hre`,!0),ms(ne,e=>i(e),()=>i()),$o(ne,()=>Tre(o()));var re=L(ne,2),ie=e=>{Wl(e,{get element(){return i()}})};K(re,e=>{m()&&!g()&&!_()&&e(ie)});var ae=L(re,2),oe=e=>{var t=fae();let i;Xc(P(t),{children:(e,t)=>{$r();var n=H();z(()=>G(n,B(C))),W(e,n)},$$slots:{default:!0}}),O(t),z(()=>{J(t,`id`,`${n}-label`),i=rs(t,1,`label svelte-16h9hre`,null,i,{hidden:!!r()})}),W(e,t)};K(ae,e=>{B(C)&&l()&&e(oe)}),O(E),z(()=>{te=rs(E,1,`sui text-input ${t.class??``}`,`svelte-16h9hre`,te,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),J(E,`hidden`,h()),ne.dir=ne.dir}),W(e,E),A()}var hae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),gae=V(`
`,1),_ae={hash:`svelte-116nsvd`,code:`.input-outer.svelte-116nsvd {margin:12px 0 0;}`};function Kl(e,t){k(t,!0),q(e,_ae);let n=Y(t,`open`,15,!1),r=Y(t,`value`,15,``),i=Y(t,`textboxAttrs`,19,()=>({})),a=gs(t,hae);Pl(e,_s(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=gae(),o=F(a);Uo(o,()=>t.children??jr);var s=L(o,2),c=P(s),l=e=>{var n=U();Uo(F(n),()=>t.input),W(e,n)},u=e=>{{let n=j(()=>`aria-labelledby`in i()?void 0:t.title);Gl(e,_s({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return B(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};K(c,e=>{t.input?e(l):e(u,-1)}),O(s),W(e,a)},$$slots:{default:!0}})),A()}var vae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),yae=V(`
`),bae={hash:`svelte-1almmfc`,code:`.divider.svelte-1almmfc {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-1almmfc {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-1almmfc {margin:0 8px;width:1px;height:100%;}`};function ql(e,t){q(e,bae);let n=Y(t,`hidden`,3,!1),r=Y(t,`orientation`,3,`horizontal`),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,vae);var o=yae();us(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1almmfc`),W(e,o)}var xae=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},Sae=(e,t)=>Math.max(0,e*t),Cae=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],wae=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},Tae=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),Eae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),Dae=V(`
`),Oae=V(`
`),kae=V(``),Aae=V(`
`),jae={hash:`svelte-1aqkku8`,code:`.content.svelte-1aqkku8 {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {position:absolute;}.content.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) button.close {margin:8px;}dialog.open .content.svelte-1aqkku8 {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-1aqkku8 {transition-duration:300ms;}.content.right.svelte-1aqkku8 {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-1aqkku8:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-1aqkku8:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-1aqkku8 {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-1aqkku8:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-1aqkku8:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-1aqkku8 {transform:translateX(0%);}.content.vertical.small.svelte-1aqkku8 {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-1aqkku8 {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-1aqkku8 {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-1aqkku8 {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-1aqkku8 {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-1aqkku8 {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-1aqkku8 {transform:translateY(-105%);}.content.bottom.svelte-1aqkku8 {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-1aqkku8 {transform:translateY(105%);}dialog.open .content.horizontal.svelte-1aqkku8 {transform:translateY(0%);}.content.horizontal.small.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-1aqkku8 {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-1aqkku8 > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-1aqkku8, .content.swipe-dismiss.swiping.svelte-1aqkku8 .handle:where(.svelte-1aqkku8) {cursor:grabbing;}.handle.svelte-1aqkku8 {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-1aqkku8::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-1aqkku8, .footer.svelte-1aqkku8) {display:flex;align-items:center;gap:8px;}.header.svelte-1aqkku8 {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-1aqkku8 .title:where(.svelte-1aqkku8) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-1aqkku8 {margin:0 24px 24px;}.main.svelte-1aqkku8 {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function Mae(e,t){let n=Co();k(t,!0),q(e,jae);let r=Y(t,`open`,15,!1),i=Y(t,`title`,3,``),a=Y(t,`ariaLabelledby`,3,void 0),o=Y(t,`position`,3,`right`),s=Y(t,`size`,3,`small`),c=Y(t,`showClose`,3,`outside`),l=Y(t,`swipeDismiss`,3,!1),u=gs(t,Eae),d=M(void 0),f=j(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=M(void 0),m=M(void 0),h=M(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!B(p)||B(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&B(p).contains(c))return;let{axis:u,sign:d}=xae(o(),B(p).matches(`:dir(rtl)`));N(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),N(h,0),B(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;B(m)&&t===B(m).pointerId&&(N(h,Sae((B(m).axis===`Y`?r:n)-B(m).start,B(m).sign),!0),B(m).samples=Cae(B(m).samples,{offset:B(h),time:i}))},v=e=>{if(!B(m)||!B(p)||e.pointerId!==B(m).pointerId)return;let{width:t,height:n}=B(p).getBoundingClientRect(),r=Cae(B(m).samples,{offset:B(h),time:e.timeStamp}),i=e.type===`pointerup`&&Tae({offset:B(h),size:B(m).axis===`Y`?n:t,velocity:wae(r)});N(m,void 0),N(h,0),i&&B(d)?.close(`close`)};R(()=>{r()||co(()=>{N(m,void 0),N(h,0)})});let y=j(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=j(()=>B(y)?void 0:i()||void 0);ms(sl(e,_s(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return B(b)},get"aria-labelledby"(){return B(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=Aae();let u;var y=P(a),b=e=>{W(e,Dae())};K(y,e=>{l()&&o()===`bottom`&&e(b)});var x=L(y,2),S=P(x),C=e=>{Nl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(d)?.close(`close`)}})};K(S,e=>{c()===`outside`&&e(C)}),O(x);var w=L(x,2),T=e=>{var r=U(),a=F(r),o=e=>{var n=U();Uo(F(n),()=>t.header),W(e,n)},s=e=>{var r=Oae(),a=P(r),o=I(a,!0),s=L(a,2);Ml(s,{flex:!0});var l=L(s,2);Uo(l,()=>t.headerExtra??jr);var u=L(l,2),f=e=>{Nl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(d)?.close(`close`)}})};K(u,e=>{c()===`inside`&&e(f)}),O(r),z(()=>{J(a,`id`,`${n}-title`),G(o,i())}),W(e,r)};K(a,e=>{t.header?e(o):e(s,-1)}),W(e,r)};K(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=L(w,2);Uo(P(ee),()=>t.children??jr),O(ee);var E=L(ee,2),te=e=>{var n=kae();Uo(P(n),()=>t.footer??jr),O(n),W(e,n)};K(E,e=>{t.footer&&e(te)});var ne=L(E,2),re=e=>{W(e,Dae())};K(ne,e=>{l()&&o()===`top`&&e(re)}),O(a),ms(a,e=>N(p,e),()=>B(p)),z(()=>{rs(a,1,ts([`content`,t.class,s(),o(),B(f),{"swipe-dismiss":l(),swiping:!!B(m)}]),`svelte-1aqkku8`),u=as(a,``,u,{transform:B(m)?`translate${B(m).axis}(${B(m).sign*B(h)}px)`:void 0,"transition-duration":B(m)?`0s`:void 0})}),_o(`pointerdown`,a,g),_o(`pointermove`,a,_),_o(`pointerup`,a,v),go(`pointercancel`,a,v),W(e,a)},$$slots:{default:!0}})),e=>N(d,e,!0),()=>B(d)),A()}vo([`pointerdown`,`pointermove`,`pointerup`]);var Nae=V(``);function Jl(e,t){k(t,!0);let n=Y(t,`accept`,3,void 0),r=Y(t,`multiple`,3,!1),i=Y(t,`onSelect`,3,void 0),a=Y(t,`onCancel`,3,void 0),o=M(void 0);var s={open:()=>{B(o)?.click()}},c=Nae();return ms(c,e=>N(o,e),()=>B(o)),z(()=>{J(c,`accept`,n()),c.multiple=r()}),_o(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),go(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),W(e,c),A(s)}vo([`change`]);var Pae=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),Fae=V(``),Iae=V(`
`),Lae=V(`
`),Rae={hash:`svelte-1rk1blz`,code:`[role=rowgroup].svelte-1rk1blz {display:table-row-group;}[role=row].svelte-1rk1blz {display:table-row;}[role=columnheader].svelte-1rk1blz {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-1rk1blz:has(> .expander) {padding:0;}[role=columnheader].svelte-1rk1blz .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-1rk1blz {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-1rk1blz:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-1rk1blz:dir(rtl) {transform:rotate(-90deg);}`};function Yl(e,t){let n=Co();k(t,!0),q(e,Rae);let r=Y(t,`expanded`,15,!0),i=Y(t,`label`,3,``),a=Y(t,`collapsible`,3,!1),o=gs(t,Pae),s=j(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{B(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=Lae();us(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>X(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-1rk1blz`);var d=P(u),f=e=>{var a=Iae();Rte(P(a),()=>`th`,!1,(e,a)=>{us(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-1rk1blz`);var o=U(),l=F(o),u=e=>{ll(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=Fae(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=H();z(()=>G(t,i())),W(e,t)};K(l,e=>{B(s)?e(u):e(d,-1)}),W(a,o)}),O(a),$o(a,()=>l),W(e,a)};K(d,e=>{i()&&e(f)});var p=L(d,2),m=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(p,e=>{(!B(s)||r())&&e(m)}),O(u),W(e,u),A()}var zae=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),Bae=V(`
`),Vae={hash:`svelte-777mc6`,code:`.table-head.svelte-777mc6, +.grid-head.svelte-777mc6 {display:table-header-group;}.table-foot.svelte-777mc6, +.grid-foot.svelte-777mc6 {display:table-footer-group;}.table-row.svelte-777mc6, +.grid-row.svelte-777mc6 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-777mc6, +.grid-col-header.svelte-777mc6, +.table-cell.svelte-777mc6, +.grid-cell.svelte-777mc6 {display:table-cell;}.table-row-header.svelte-777mc6, +.grid-row-header.svelte-777mc6 {display:table-cell;height:var(--sui-secondary-row-height);}`};function Xl(e,t){q(e,Vae);let n=gs(t,zae);var r=Bae();us(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-777mc6`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var Hae=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zl(e,t){let n=gs(t,Hae);Xl(e,_s(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var Uae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),Wae={hash:`svelte-mv7bmv`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;} @media (hover: none) {.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0.4;} -}`};function tu(e,t){O(t,!0),K(e,kae);let n=J(t,`sortOrder`,3,void 0),r=ys(t,Oae),i=e=>{let r=e=>{e.stopPropagation(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=H(),o=P(a),s=e=>{$l(e,bs(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=H();Po(P(r),()=>t.children??Tr),U(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=A(()=>t.class?`sortable ${t.class}`:`sortable`),o=A(()=>n()===`none`?void 0:n());$l(e,bs(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return z(a)},get"aria-sort"(){return z(o)},children:(e,r)=>{{let r=e=>{{let t=A(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);Ac(e,{get class(){return`sort-icon ${n()??``}`},get name(){return z(t)}})}};ul(e,{class:`sort-button`,[eo()]:i,endIcon:r,children:(e,n)=>{var r=H();Po(P(r),()=>t.children??Tr),U(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};G(o,e=>{n()===void 0?e(s):e(c,-1)}),U(e,a),k()}var Aae=new Set([`$$slots`,`$$events`,`$$legacy`]);function jae(e,t){O(t,!0);let n=ys(t,Aae);ii(`sui:grid-unselectable-rows`,!0);{let t=A(()=>Y(`_sui.role_descriptions.grid_head`));$l(e,bs(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return z(t)}}))}k()}var Mae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function nu(e,t){O(t,!0);let n=J(t,`selected`,3,!1),r=ys(t,Mae),i=ri(`sui:grid-unselectable-rows`)===!0,a=A(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=H(),c=P(s),l=e=>{$l(e,bs(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[eo()]:o}))},u=e=>{$l(e,bs(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};G(c,e=>{i?e(l):e(u,-1)}),U(e,s),k()}var Nae=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),Pae=B(`
`),Fae={hash:`svelte-1qlphqk`,code:`.grid.svelte-1qlphqk {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-1qlphqk {border-collapse:collapse;}.grid.data.svelte-1qlphqk :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Iae(e,t){O(t,!0),K(e,Fae);let n=J(t,`element`,15),r=J(t,`multiple`,3,!1),i=J(t,`clickToSelect`,3,!0),a=J(t,`ariaLabel`,3,void 0),o=ys(t,Nae);ii(`sui:grid-unselectable-rows`,!1);var s=Pae(),c=e=>{t.onChange?.(e)};us(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-1qlphqk`),Po(N(s),()=>t.children??Tr),D(s),_s(s,e=>n(e),()=>n()),Wo(s,()=>Dl({clickToSelect:i()})),U(e,s),k()}var Lae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),Rae=B(`
`),zae={hash:`svelte-rj6sjy`,code:`[role=listbox].svelte-rj6sjy {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-rj6sjy [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-rj6sjy {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-rj6sjy {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-rj6sjy .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-rj6sjy .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-rj6sjy .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-rj6sjy .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-rj6sjy:focus-visible, [role=listbox].svelte-rj6sjy:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-rj6sjy [role=separator] {display:none;}.inner.svelte-rj6sjy {display:contents;}`};function ru(e,t){O(t,!0),K(e,zae);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`multiple`,3,!1),c=J(t,`searchTerms`,3,``),l=J(t,`ariaLabel`,3,void 0),u=ys(t,Lae),d=j(!1);var f=Rae(),p=e=>{let{detail:{matched:n,total:r}}=e;M(d,n!==r),t.onFilter?.(e)};us(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[is]:{filtered:z(d)}}),void 0,void 0,void 0,`svelte-rj6sjy`);var m=N(f);Po(N(m),()=>t.children??Tr),D(m),D(f),Wo(f,()=>Dl(()=>({searchTerms:c()}))),R(()=>m.inert=r()),U(e,f),k()}var Bae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),Vae=B(`
`),Hae={hash:`svelte-1xpz2me`,code:`.option-group.svelte-1xpz2me:not(:first-child) {margin:12px 0 0;}.label.svelte-1xpz2me {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-1xpz2me {display:contents;}`};function iu(e,t){let n=mo();O(t,!0),K(e,Hae);let r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=ys(t,Bae);var s=Vae();us(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-1xpz2me`);var c=N(s);Kc(N(c),{children:(e,t)=>{Kr();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}}),D(c);var l=I(c,2);Po(N(l),()=>t.children??Tr),D(l),D(s),R(()=>{q(c,`id`,`${n}-label`),l.inert=i()}),U(e,s),k()}var Uae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),Wae=B(` `,1),Gae=B(`
`),Kae={hash:`svelte-18hujd0`,code:`.option.svelte-18hujd0 {display:contents;}.option.svelte-18hujd0:focus-visible {outline-width:0 !important;}.option.wrap.svelte-18hujd0 button {white-space:normal;}.option.svelte-18hujd0 button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-18hujd0 button:active {background-color:var(--sui-active-background-color);}.option.svelte-18hujd0 button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-18hujd0 button * {flex:none;}.option.svelte-18hujd0 button .label {flex:auto;}.option.svelte-18hujd0 :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-18hujd0 .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-18hujd0 .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function au(e,t){let n=mo();O(t,!0),K(e,Kae);let r=J(t,`selected`,15,!1),i=J(t,`hidden`,15,!1),a=J(t,`disabled`,3,!1),o=J(t,`value`,19,()=>t.label),s=J(t,`searchValue`,19,()=>t.label),c=J(t,`wrap`,3,!1),l=ys(t,Uae),u=iie();u&&Ss(u.register({get value(){return o()},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??Gc(o())},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let d=A(()=>!u||u.expanded);var f=H(),p=P(f),m=e=>{var u=Gae();let d;var f=N(u);{let e=e=>{var n=H();Po(P(n),()=>t.startIcon??Tr),U(e,n)},c=A(()=>t.id??n);ul(f,bs(()=>l,{role:`option`,get id(){return z(c)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return o()},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return s()},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=Wae(),a=P(i),o=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.checkIcon),U(e,n)},a=e=>{Ac(e,{class:`check`,name:`check`})};G(r,e=>{t.checkIcon?e(i):e(a,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),Po(I(a,2),()=>t.children??Tr),U(e,i)},$$slots:{startIcon:!0,default:!0}}))}D(u),R(()=>{d=Xo(u,1,`sui option ${t.class??``}`,`svelte-18hujd0`,d,{wrap:c()}),q(u,`hidden`,i())}),U(e,u)};G(p,e=>{z(d)&&e(m)}),U(e,f),k()}var qae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),Jae=B(`
`),Yae={hash:`svelte-4gwz0i`,code:`.menu.svelte-4gwz0i {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-4gwz0i [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function ou(e,t){O(t,!0),K(e,Yae);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ys(t,qae);var o=Jae(),s=e=>{t.onChange?.(e)};us(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-4gwz0i`),Po(N(o),()=>t.children??Tr),D(o),Wo(o,Dl),U(e,o),k()}var Xae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),Zae=B(``),Qae=B(`
`,1),$ae=B(`
`),eoe={hash:`svelte-gbt0hm`,code:`.menuitem.svelte-gbt0hm {position:relative;}.menuitem.svelte-gbt0hm button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-gbt0hm button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-gbt0hm button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-gbt0hm button:active {background-color:var(--sui-active-background-color);}.content.svelte-gbt0hm {flex:auto;}.icon-outer.svelte-gbt0hm {flex:none;width:24px;height:24px;}`};function su(e,t){O(t,!0),K(e,eoe);let n=J(t,`role`,3,`menuitem`),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=J(t,`labelDir`,3,void 0),s=J(t,`popupPosition`,3,`right-top`),c=ys(t,Xae),l=j(!1),u=j(!1),d,f=j(void 0),p=j(void 0),m=A(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};xs(()=>(M(p,z(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=$ae(),_=N(g);{let e=e=>{var n=H();Po(P(n),()=>t.startIcon??Tr),U(e,n)},s=e=>{var n=Qae(),r=P(n);let i;var s=N(r),c=e=>{var t=V();R(()=>W(t,a())),U(e,t)},l=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)};G(s,e=>{a()?e(c):e(l,-1)}),D(r);var u=I(r,2),d=e=>{var n=Zae(),r=N(n),i=e=>{var n=H();Po(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Dc()?`chevron_left`:`chevron_right`);Ac(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)};G(u,e=>{z(m)&&e(d)}),R(()=>{i=Xo(r,1,`content svelte-gbt0hm`,null,i,{label:!!a()}),q(r,`dir`,a()?o():void 0),r.dir=r.dir}),U(e,n)},p=e=>{var n=H();Po(P(n),()=>t.endIcon??Tr),U(e,n)},g=A(()=>z(m)?`menu`:void 0),v=A(()=>z(m)?z(l):void 0);ul(_,bs(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return z(g)},get"aria-expanded"(){return z(v)},onmouseenter:e=>{z(m)&&h(()=>{M(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{z(m)&&h(()=>{z(u)||M(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{z(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),M(l,e.detail?!0:!z(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=I(_,2),y=e=>{cl(e,{get anchor(){return z(f)},get parentDialogElement(){return z(p)},get position(){return s()},get open(){return z(l)},set open(e){M(l,e,!0)},get hovered(){return z(u)},set hovered(e){M(u,e,!0)},children:(e,n)=>{ou(e,{children:(e,n)=>{var r=H();Po(P(r),()=>t.items??Tr),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(v,e=>{z(m)&&z(f)&&z(p)&&e(y)}),D(g),R(()=>{Xo(g,1,`sui menuitem ${t.class??``}`,`svelte-gbt0hm`),q(g,`hidden`,r())}),U(e,g),k()}var toe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function noe(e,t){O(t,!0);let n=J(t,`checked`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=ys(t,toe),s=A(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);su(e,bs(()=>o,{get role(){return t.role},get class(){return`sui ${z(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=H();Po(P(n),()=>t.startIcon??Tr),U(e,n)},children:e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)},endIcon:e=>{var t=H(),r=P(t),i=e=>{Ac(e,{name:`check`})};G(r,e=>{n()&&e(i)}),U(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),k()}var roe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function cu(e,t){O(t,!0);let n=J(t,`checked`,15),r=ys(t,roe);noe(e,bs(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),k()}var ioe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function lu(e,t){O(t,!0);let n=J(t,`checked`,15),r=ys(t,ioe);noe(e,bs(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),k()}var aoe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),ooe=B(`
`),soe={hash:`svelte-1818zm6`,code:`.progressbar.svelte-1818zm6 {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-1818zm6 div:where(.svelte-1818zm6) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function coe(e,t){K(e,soe);let n=J(t,`now`,3,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`ariaLabel`,3,void 0),o=ys(t,aoe),s=A(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=ooe();us(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-1818zm6`);var l=N(c);let u;D(c),R(()=>u=Qo(l,``,u,{width:`${z(s)}%`})),U(e,c)}var loe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),uoe=B(`
`),doe={hash:`svelte-fua4o0`,code:`.radio-group.svelte-fua4o0 {display:inline-flex;}.radio-group.svelte-fua4o0:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-fua4o0 {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-fua4o0 {gap:4px;flex-direction:column;} -@media (pointer: coarse) {.radio-group.vertical.svelte-fua4o0 {gap:8px;} -}.radio-group[aria-invalid=true].svelte-fua4o0 button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-fua4o0 button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-fua4o0 button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-fua4o0 {display:contents;}`};function foe(e,t){O(t,!0),K(e,doe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`orientation`,3,`horizontal`),c=J(t,`ariaLabel`,3,void 0),l=ys(t,loe);var u=uoe(),d=e=>{t.onChange?.(e)};us(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-fua4o0`);var f=N(u);Po(N(f),()=>t.children??Tr),D(f),D(u),Wo(u,Dl),R(()=>f.inert=r()),U(e,u),k()}var poe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),moe=B(``),hoe=B(` `),goe={hash:`svelte-1vzo19m`,code:`.radio.svelte-1vzo19m {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-1vzo19m:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-1vzo19m:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-1vzo19m:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-1vzo19m:active button {background-color:var(--sui-active-background-color);}.radio.svelte-1vzo19m:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-1vzo19m button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-1vzo19m button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-1vzo19m button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-1vzo19m button[aria-checked=true]::before {opacity:1;}.radio.svelte-1vzo19m label:where(.svelte-1vzo19m) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function uu(e,t){let n=mo();O(t,!0),K(e,goe);let r=J(t,`checked`,7,!1),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`name`,3,void 0),s=J(t,`value`,3,void 0),c=J(t,`valueType`,3,void 0),l=J(t,`label`,3,void 0),u=J(t,`ariaLabel`,3,void 0),d=J(t,`group`,15),f=ys(t,poe),p=j(void 0),m=A(()=>u()??f[`aria-label`]),h=A(()=>!!(t.children||l())),g=()=>!!z(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);L(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var _=hoe();let v;var y=N(_);{let e=A(()=>z(m)||void 0),l=A(()=>!z(m)&&z(h)?`${n}-label`:void 0);ul(y,bs(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()},get"aria-label"(){return z(e)},get"aria-labelledby"(){return z(l)},onclick:e=>{e.preventDefault(),!(a()||r()||g())&&(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return z(p)},set element(e){M(p,e,!0)}}))}var b=I(y,2),x=e=>{var r=moe(),i=N(r),a=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)},o=e=>{var t=V();R(()=>W(t,l())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(b,e=>{(t.children||l())&&e(x)}),D(_),R(()=>{v=Xo(_,1,`sui radio ${t.class??``}`,`svelte-1vzo19m`,v,{disabled:a()}),q(_,`hidden`,i())}),so(`click`,_,e=>{e.target.matches(`button`)||z(p)?.click()}),U(e,_),k()}co([`click`]);var du=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},_oe=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,du(e.minSize,0,t)),r=Math.min(100,du(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},voe=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]t[r].minSize)}return i},yoe=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return voe(u,l,d,voe(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},boe=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},xoe=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=vl(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},Soe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),Coe=B(`
`),woe=B(`
`),Toe={hash:`svelte-kvcfpg`,code:`.resizable-handle.svelte-kvcfpg {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-kvcfpg:focus-visible, .resizable-handle.svelte-kvcfpg:hover, .resizable-handle.dragging.svelte-kvcfpg {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-kvcfpg:focus-visible .handle-bar:where(.svelte-kvcfpg), .resizable-handle.svelte-kvcfpg:hover .handle-bar:where(.svelte-kvcfpg), .resizable-handle.dragging.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-kvcfpg {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-kvcfpg::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-kvcfpg {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-kvcfpg::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-kvcfpg {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-kvcfpg::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function Eoe(e,t){O(t,!0),K(e,Toe);let n=J(t,`disabled`,3,!1),r=J(t,`showHandleBar`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ys(t,Soe),o=ri(`paneGroup`);if(!o)throw Error(` must be used inside a `);let s=o.registerHandle(),c=A(()=>o.direction===`horizontal`),l=A(()=>o.sizes),u=A(()=>z(l)[s]??0),d=A(()=>o.getPaneConstraints(s)),f=A(()=>o.getPaneConstraints(s+1)),p=A(()=>z(u)+(z(l)[s+1]??0)),m=A(()=>Math.max(z(d).minSize,z(p)-z(f).maxSize)),h=A(()=>Math.min(z(d).maxSize,z(p)-z(f).minSize)),g=j(void 0),_=j(!1),v=j(0),y=0,b=j(0),x=j(!1),S=0,C=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!z(_)||i!==z(b))return;e.preventDefault(),e.stopPropagation();let a=(z(c)?t:r)-z(v);if(!S)return;let u=a/S*100;z(c)&&Dc()&&(u=-u),o.resize(s,y+u-(z(l)[s]??0))},w=e=>{let{pointerId:n}=e;z(_)&&n===z(b)&&(z(g)?.releasePointerCapture(n),M(_,!1),M(v,0),M(b,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,C),document.removeEventListener(`pointerup`,w),document.removeEventListener(`pointercancel`,w))},T=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;M(_,!0),M(v,z(c)?r:i,!0),y=z(l)[s]??0,M(b,a,!0),S=o.measurePaneSpace(),z(g)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,C),document.addEventListener(`pointerup`,w),document.addEventListener(`pointercancel`,w)},ee=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=xoe({key:r,shiftKey:i,isHorizontal:z(c),rtl:Dc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(s):(r!==`Home`&&r!==`End`&&!z(x)&&(M(x,!0),t.onResizeStart?.()),o.resize(s,a.delta)))},te=()=>{z(x)&&(M(x,!1),t.onResizeEnd?.())};L(()=>()=>{document.removeEventListener(`pointermove`,C),document.removeEventListener(`pointerup`,w),document.removeEventListener(`pointercancel`,w)});var ne=woe();us(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":z(c)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":z(m),"aria-valuemax":z(h),"aria-controls":o.paneDefs[s]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:T,onkeydown:ee,onblur:te,[is]:{horizontal:z(c),vertical:!z(c),disabled:n(),dragging:z(_)}}),[()=>Math.round(z(u))],void 0,void 0,`svelte-kvcfpg`);var re=N(ne),ie=e=>{var n=H();Po(P(n),()=>t.children),U(e,n)},ae=e=>{U(e,Coe())};G(re,e=>{t.children?e(ie):r()&&e(ae,1)}),D(ne),_s(ne,e=>M(g,e),()=>z(g)),U(e,ne),k()}var Doe=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),Ooe=B(`
`),koe={hash:`svelte-sqq0n6`,code:`.resizable-pane-group.svelte-sqq0n6 {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-sqq0n6 {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-sqq0n6 {flex-direction:column;width:100%;height:100%;}`};function Aoe(e,t){O(t,!0),K(e,koe);let n=J(t,`direction`,3,`horizontal`),r=ys(t,Doe),i=Yi([]),a=j(void 0),o=Yi([]),s=Yi([]),c=0,l=()=>{if(!z(a))return 0;let e=n()===`horizontal`,t=e?z(a).clientWidth:z(a).clientHeight,r=[...z(a).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>_oe(i[e],u()),f=()=>{if(!i.length)return;let e=u(),t=i.map(t=>t.defaultSize===void 0?NaN:du(t.defaultSize,NaN,e)),n=i.map(t=>_oe(t,e));o.splice(0,o.length,...yoe(t,n))},p=(e,n)=>{let r=e,i=e+1;if(r<0||i>=o.length)return;let a=o[r],s=o[i],c=boe(n,{sizeBefore:a,sizeAfter:s,constraintsBefore:d(r),constraintsAfter:d(i)});o[r]=a+c,o[i]=s-c,t.onResize?.({sizes:o.map(e=>Number(e.toFixed(1)))})};ii(`paneGroup`,{get direction(){return n()},sizes:o,registerPane:({id:e,defaultSize:t,minSize:n,maxSize:r})=>{let a=i.length;return i.push({id:e,defaultSize:t,minSize:n,maxSize:r}),{index:a}},registerHandle:()=>{let e=c;return c+=1,e},resize:p,toggleCollapse:e=>{let{minSize:t}=d(e);if(s[e]!==void 0){let t=s[e]-o[e];s[e]=void 0,p(e,t)}else s[e]=o[e],p(e,-(o[e]-t))},getPaneConstraints:d,measurePaneSpace:l,paneDefs:i}),L(()=>{i.length&&!o.length&&f()});var m=Ooe();us(m,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-sqq0n6`),Po(N(m),()=>t.children??Tr),D(m),_s(m,e=>M(a,e),()=>z(a)),U(e,m),k()}var joe=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),Moe=B(`
`);function fu(e,t){let n=mo();O(t,!0);let r=J(t,`defaultSize`,3,void 0),i=J(t,`minSize`,3,0),a=J(t,`maxSize`,3,100),o=ys(t,joe),s=ri(`paneGroup`);if(!s)throw Error(` must be used inside a `);let{index:c}=s.registerPane({id:n,defaultSize:r(),minSize:i(),maxSize:a()}),l=A(()=>s.direction),u=A(()=>s.sizes[c]),d=A(()=>z(u)===void 0?typeof r()==`number`?`${r()}%`:r()??`0%`:`${z(u)}%`);L(()=>{z(u)!==void 0&&$a(()=>t.onResize?.({size:Number(z(u).toFixed(1))}))});var f=Moe();us(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[as]:{"flex-basis":z(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":z(l)===`horizontal`?`auto`:void 0,"overflow-y":z(l)===`vertical`?`auto`:void 0}})),Po(N(f),()=>t.children??Tr),D(f),U(e,f),k()}var Noe=B(`
`),Poe=B(` `,1),Foe={hash:`svelte-ozrfpd`,code:`.spinner.svelte-ozrfpd {height:1px;}`};function pu(e,t){O(t,!0),K(e,Foe);let n=J(t,`itemChunkSize`,3,25),r=j(Yi(n())),i=j(void 0),a=A(()=>t.items.length>z(r)),o=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.scrollHeight-t.clientHeight>1&&/^(auto|scroll)$/.test(getComputedStyle(t).overflowY))return t;return null};L(()=>{if(z(r),!z(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&z(a)&&M(r,z(r)+n())},{root:o(z(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(z(i)),()=>{e.disconnect()}});var s=Poe(),c=P(s);ko(c,19,()=>t.items.slice(0,z(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=H();Po(P(i),()=>t.renderItem,()=>z(n),()=>z(r)),U(e,i)});var l=I(c,2),u=e=>{var t=Noe();_s(t,e=>M(i,e),()=>z(i)),U(e,t)};G(l,e=>{z(a)&&e(u)}),U(e,s),k()}function Ioe(e){let t=e-1;return t*t*t+1}function mu(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=Ioe}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=Loe(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function Loe(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var Roe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),zoe=B(`
`),Boe={hash:`svelte-4cx7he`,code:`.search-bar.svelte-4cx7he {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-4cx7he:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-4cx7he > span:where(.svelte-4cx7he) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-4cx7he .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-4cx7he > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-4cx7he .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-4cx7he .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-4cx7he input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-4cx7he:dir(rtl) {--sui-textbox-text-align: right;}`};function hu(e,t){let n=mo();O(t,!0),K(e,Boe);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`readonly`,3,!1),c=J(t,`required`,3,!1),l=J(t,`invalid`,3,!1),u=ys(t,Roe),d=j(void 0);var f={focus:()=>{z(d)?.focus()}},p=zoe();let m;var h=N(p),g=N(h),_=e=>{var n=H();Po(P(n),()=>t.searchIcon),U(e,n)},v=e=>{Ac(e,{name:`search`})};G(g,e=>{t.searchIcon?e(_):e(v,-1)}),D(h);var y=I(h,2);Kl(y,bs({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return z(d)},set element(e){M(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=I(y,2),x=e=>{{let i=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.closeIcon),U(e,n)},a=e=>{Ac(e,{name:`close`})};G(r,e=>{t.closeIcon?e(i):e(a,-1)}),U(e,n)},a=A(()=>o()||s()),c=A(()=>Y(`_sui.clear`));ul(e,{iconic:!0,get disabled(){return z(a)},get"aria-label"(){return z(c)},get"aria-controls"(){return n},onclick:()=>{r(``),z(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return G(b,e=>{r()&&e(x)}),D(p),R(()=>{q(p,`role`,a()?void 0:`none`),m=Xo(p,1,`sui search-bar ${t.class??``}`,`svelte-4cx7he`,m,{flex:i(),disabled:o(),readonly:s()}),q(p,`hidden`,a()),q(p,`aria-hidden`,a())}),U(e,p),k(f)}var Voe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),Hoe=B(`
`),Uoe=B(`
`),Woe=B(`
`),Goe=B(`
`,1),Koe={hash:`svelte-iqscl7`,code:`:is(.option-host.svelte-iqscl7, .listbox-slot.svelte-iqscl7) {display:contents;}.combobox.svelte-iqscl7 {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7):not(.selected) {font-style:italic;}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7):is(:where(.svelte-iqscl7):hover, :where(.svelte-iqscl7):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-iqscl7 div[role=combobox][aria-readonly=true]:where(.svelte-iqscl7) {cursor:default;}.combobox.svelte-iqscl7 div[role=combobox][aria-readonly=true]:where(.svelte-iqscl7):is(:where(.svelte-iqscl7):hover, :where(.svelte-iqscl7):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-iqscl7 div[role=combobox][aria-invalid=true]:where(.svelte-iqscl7) {border-color:var(--sui-error-border-color);}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7) .label:where(.svelte-iqscl7) {width:100%;}.combobox.svelte-iqscl7 .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-iqscl7 > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-iqscl7 > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-iqscl7 .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-iqscl7 input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-iqscl7 {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-iqscl7 .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-iqscl7 .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-iqscl7 .no-options:where(.svelte-iqscl7) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function qoe(e,t){let n=mo();O(t,!0),K(e,Koe);let r=J(t,`value`,15),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`editable`,3,!0),u=J(t,`position`,3,`bottom-left`),d=J(t,`filterThreshold`,3,5),f=J(t,`ariaLabel`,3,void 0),p=ys(t,Voe),m=j(!1),h=j(void 0),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(void 0),x=j(``),S=j(!1),C=j(``),w=j(0),T=A(()=>!z(C)||z(w)>0),ee=A(()=>z(h)??z(g)),te=rie(),ne=()=>{let e=te.find(r());M(x,e?.label??``,!0),te.selectOnly(r())},re=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},ie=e=>{let n=hl(e);r(n.value),ne(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ae=e=>{let{target:n}=e;r(n.value),ne(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},oe=new yl,se=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||z(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=te.entries.filter(e=>!e.disabled),l=bl(c.map(e=>_l(e.label??``)),oe.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),ne(),re(u))},ce=()=>z(y)?.querySelector(`[role="listbox"]`),le=()=>{let e=ce(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};L(()=>{te.expanded=z(m)}),L(()=>{if(!z(m))return;let e=globalThis.setTimeout(le,150);return()=>{globalThis.clearTimeout(e),ce()?.removeAttribute(`aria-activedescendant`)}}),L(()=>{if(!z(y))return;let e=z(m)?z(b):z(v);e&&z(y).parentElement!==e&&e.append(z(y))}),xs(()=>{let e=te.selectedEntry;e&&(r(e.value),M(x,e.label,!0),re(e))}),L(()=>{r(),ne()});var ue=Goe(),de=P(ue);let fe;var pe=N(de),me=e=>{var t=Hoe();us(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":z(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:se,[is]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-iqscl7`);var l=N(t);Kc(N(l),{children:(e,t)=>{Kr();var n=V();R(e=>W(n,e),[()=>r()===void 0?Y(`_sui.combobox.select_an_option`):z(x)]),U(e,n)},$$slots:{default:!0}}),D(l),D(t),_s(t,e=>M(h,e),()=>z(h)),U(e,t)},he=e=>{{let t=A(()=>r()===void 0?``:String(r()));Kl(e,bs(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return z(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return z(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ae,get element(){return z(g)},set element(e){M(g,e,!0)}}))}};G(pe,e=>{l()?e(he,-1):e(me)});var ge=I(pe,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{Ac(e,{name:`expand_more`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>!l()||o()||a()?-1:0),s=A(()=>z(m)?Y(`_sui.collapse`):Y(`_sui.expand`)),c=A(()=>z(m)?`${n}-popup`:void 0);ul(ge,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return z(r)},get"aria-label"(){return z(s)},get"aria-controls"(){return z(c)},get"aria-expanded"(){return z(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&M(m,!z(m))},startIcon:e,$$slots:{startIcon:!0}})}D(de);var _e=I(de,2),ve=N(_e);ru(N(ve),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return z(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&ie(e.target)},onFilter:e=>{M(w,e.detail.matched,!0)},children:(e,n)=>{var r=H();Po(P(r),()=>t.children??Tr),U(e,r)},$$slots:{default:!0}}),D(ve),_s(ve,e=>M(y,e),()=>z(y)),D(_e),_s(_e,e=>M(v,e),()=>z(v)),cl(I(_e,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return z(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{M(S,d()!==-1&&te.count>d(),!0),M(C,``)},get content(){return z(_)},set content(e){M(_,e,!0)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{var r=Woe(),i=N(r),a=e=>{{let t=A(()=>Y(`_sui.combobox.filter_options`));hu(e,{flex:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),z(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return z(C)},set value(e){M(C,e,!0)}})}};G(i,e=>{z(S)&&e(a)});var o=I(i,2);_s(o,e=>M(b,e),()=>z(b));var s=I(o,2),c=e=>{var t=Uoe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`_sui.combobox.no_matching_options`)]),U(e,t)};G(s,e=>{z(T)||e(c)}),D(r),U(e,r)},$$slots:{default:!0}}),R(()=>{fe=Xo(de,1,`sui combobox ${t.class??``}`,`svelte-iqscl7`,fe,{editable:l()}),q(de,`hidden`,i())}),U(e,ue),k()}var Joe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function gu(e,t){O(t,!0);let n=J(t,`value`,15),r=ys(t,Joe);qoe(e,bs(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),k()}var Yoe=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},Xoe=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t0?0:e===`End`&&tt{if(t!==e&&t!==e+1)return t>e?t-1:t},$oe=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),ese=B(``),tse=B(` `),nse=B(`
`),rse={hash:`svelte-1e5oikm`,code:`.select-tags.svelte-1e5oikm {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-1e5oikm {pointer-events:none;}.select-tags.disabled.svelte-1e5oikm > :where(.svelte-1e5oikm) {opacity:0.5;}.select-tags.svelte-1e5oikm span[role=grid]:where(.svelte-1e5oikm) {display:contents;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-1e5oikm span[draggable].drag-source:where(.svelte-1e5oikm) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-1e5oikm span[draggable].drop-before:where(.svelte-1e5oikm)::before, .select-tags.svelte-1e5oikm span[draggable].drop-after:where(.svelte-1e5oikm)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-1e5oikm span[draggable].drop-before:where(.svelte-1e5oikm)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-1e5oikm span[draggable].drop-after:where(.svelte-1e5oikm)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) .label:where(.svelte-1e5oikm) {outline:none;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) span[role=gridcell]:where(.svelte-1e5oikm):not(.label) {display:contents;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) button {outline-offset:-2px;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) .icon {font-size:var(--sui-font-size-large);}`};function ise(e,t){O(t,!0),K(e,rse);let n=J(t,`values`,31,()=>Yi([])),r=J(t,`max`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=ys(t,$oe),u=A(()=>new Map(t.options.map(e=>[e.value,e]))),d=A(()=>new Set(n())),f=A(()=>t.options.some(({value:e})=>!z(d).has(e))),p=j(void 0),m=j(void 0),h=j(void 0),g=j(void 0),_=(e,r)=>{if(e===r)return;let i=Yoe(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await Xa(),(z(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=nse();let b;var x=N(y);ko(x,30,n,e=>e,(e,r,i)=>{let s=A(()=>z(u).get(r)),c=A(()=>z(s)?.label||z(s)?.value||r);var l=tse();let d;var f=N(l),p=F(f,!0),m=I(f,2),_=e=>{var i=ese(),s=N(i);{let e=e=>{Ac(e,{name:`close`})},i=A(()=>a()||o()),l=A(()=>Y(`_sui.select_tags.remove_x`,{values:{name:z(c)}}));ul(s,{iconic:!0,size:`small`,get disabled(){return z(i)},get"aria-label"(){return z(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}D(i),U(e,i)};G(m,e=>{z(s)&&e(_)}),D(l),R(()=>{q(l,`draggable`,!a()&&!o()),d=Xo(l,1,`svelte-1e5oikm`,null,d,{"drag-source":z(h)===z(i),"drop-before":z(g)===z(i)&&z(h)!==z(i)&&z(h)!==z(i)-1,"drop-after":z(g)===n().length&&z(i)===n().length-1&&z(h)!==n().length-1}),q(f,`tabindex`,a()||o()?void 0:0),W(p,z(c))}),oo(`dragstart`,l,e=>{M(h,z(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,z(c)),e.dataTransfer.effectAllowed=`move`)}),oo(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(g,Zoe({index:z(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:Dc()}),!0)}),oo(`drop`,l,async e=>{e.preventDefault();let t=z(h),n=z(g);if(M(h,void 0),M(g,void 0),t===void 0||n===void 0)return;let r=Qoe(t,n);r!==void 0&&await v(t,r)}),oo(`dragend`,l,()=>{M(h,void 0),M(g,void 0)}),so(`keydown`,f,async e=>{let t=Xoe({key:e.key,index:z(i),length:n().length,rtl:Dc()});t!==-1&&(e.preventDefault(),await v(z(i),t))}),Vo(l,()=>mu,()=>({duration:200})),U(e,l)}),D(x);var S=I(x,2),C=e=>{{let r=A(()=>a()||o());gu(e,bs(()=>l,{get disabled(){return z(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{z(m)!==void 0&&(n([...n(),z(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:z(m)}})),M(m,void 0))},get value(){return z(m)},set value(e){M(m,e,!0)},children:(e,n)=>{var r=H();ko(P(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).value,i=()=>z(t).searchValue;var a=H(),o=P(a),s=e=>{au(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=A(()=>!z(d).has(r()));G(o,e=>{z(c)&&e(s)}),U(e,a)}),U(e,r)},$$slots:{default:!0}}))}};G(S,e=>{(typeof r()!=`number`||n().lengthM(p,e),()=>z(p)),R(e=>{b=Xo(y,1,`sui select-tags ${t.class??``}`,`svelte-1e5oikm`,b,{disabled:a()||o()}),q(y,`hidden`,i()),q(x,`aria-label`,e)},[()=>Y(`_sui.select_tags.selected_options`)]),U(e,y),k()}co([`keydown`]);var ase=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},ose=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(ase(e),ase(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},sse=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),_u=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t){let{prevKey:n,nextKey:r}=vl(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},cse=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=vu(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},yu=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,lse=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a`),pse=B(` `),mse=B(`
`),hse={hash:`svelte-rj5yxm`,code:`.slider.svelte-rj5yxm {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-rj5yxm:hover .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-hover-background-color);}.slider.svelte-rj5yxm:active .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-rj5yxm .base-bar:where(.svelte-rj5yxm), .slider.readonly.svelte-rj5yxm:is(:where(.svelte-rj5yxm):hover, :where(.svelte-rj5yxm):active) .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-rj5yxm .base:where(.svelte-rj5yxm), -.slider.readonly.svelte-rj5yxm [role=slider]:where(.svelte-rj5yxm) {cursor:default;}.slider.readonly.svelte-rj5yxm:not(.invalid) .slider-bar:where(.svelte-rj5yxm) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-rj5yxm:not(.invalid) [role=slider]:where(.svelte-rj5yxm) {border-color:var(--sui-readonly-accent-color);}.base.svelte-rj5yxm {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-rj5yxm {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-rj5yxm {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-rj5yxm .slider-bar:where(.svelte-rj5yxm) {background-color:var(--sui-error-border-color);}[role=slider].svelte-rj5yxm {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-rj5yxm::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-rj5yxm:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-rj5yxm:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-rj5yxm [role=slider]:where(.svelte-rj5yxm) {border-color:var(--sui-error-border-color);}.label.svelte-rj5yxm {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-rj5yxm:dir(ltr) {transform:translateX(-50%);}.label.svelte-rj5yxm:dir(rtl) {transform:translateX(50%);}`};function gse(e,t){O(t,!0),K(e,hse);let n=J(t,`value`,15,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`sliderLabel`,3,``),o=J(t,`ariaLabelledby`,3,void 0),s=J(t,`values`,15,void 0),c=J(t,`sliderLabels`,3,void 0),l=J(t,`step`,3,1),u=J(t,`optionLabels`,19,()=>[]),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`invalid`,3,!1),h=ys(t,dse),g=A(()=>Array.isArray(s())),_=j(void 0),v=j(0),y=j(Yi([])),b=j(Yi([])),x=e=>{if(u().length!==z(b).length||e===void 0)return;let t=z(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=j(0),C=j(0),w=Yi([0,0]),T=j(!1),ee=j(0),te=j(0),ne=(e,r)=>{let i=s();(z(g)?i[e]:n())!==r&&(z(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},re=e=>{let t=_u(z(y),sse(e,z(v),Dc()));z(g)&&yu({valueIndex:z(te),targetPosition:z(y)[t],sliderPositions:w})||ne(z(te),z(b)[t])},ie=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=z(g)?s()[t]:n(),d=Dc(),m=cse({key:r,rtl:d,currentIndex:lse({valueList:z(b),value:u,decreasing:r===`PageDown`||vu(r,d)===-1}),length:z(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),!(z(g)&&yu({valueIndex:t,targetPosition:z(y)[m],sliderPositions:w}))&&ne(t,z(b)[m]))},ae=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!z(T)||n!==z(ee))return;e.preventDefault(),e.stopPropagation();let r=t-z(C),i=z(S)+r;re(i)},oe=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!z(T)||t!==z(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=z(_).getBoundingClientRect(),n=e.clientX-t.left;re(n)}r.releasePointerCapture(t),M(T,!1),M(S,0),M(C,0),M(ee,0),M(te,0),document.removeEventListener(`pointermove`,ae),document.removeEventListener(`pointerup`,oe),document.removeEventListener(`pointercancel`,oe)},se=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),M(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=z(_).getBoundingClientRect();M(S,n-s.left),M(C,r,!0),M(ee,i,!0),M(te,t??(z(g)?use(w,sse(z(S),z(v),Dc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ae),document.addEventListener(`pointerup`,oe),document.addEventListener(`pointercancel`,oe)},ce=e=>z(y)[_u(z(b),e)]??0,le=()=>{if(z(g)){let[e,t]=s();w[0]=ce(e),w[1]=ce(t)}else w[0]=ce(n())},ue=()=>{z(_)&&(M(v,z(_).clientWidth,!0),(e=>{M(b,e.valueList,!0),M(y,e.positionList,!0)})(ose({min:r(),max:i(),step:l(),barWidth:z(v)})),le())};xs(()=>{let e=new ResizeObserver(()=>ue()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(z(_)),t.addEventListener(`change`,ue),ue(),()=>{e.disconnect(),t.removeEventListener(`change`,ue),document.removeEventListener(`pointermove`,ae),document.removeEventListener(`pointerup`,oe),document.removeEventListener(`pointercancel`,oe)}}),L(()=>{n(),s(),le()});var de=mse();oo(`click`,Zi.body,()=>{M(T,!1)}),us(de,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[is]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-rj5yxm`);var fe=N(de),pe=I(N(fe),2);let me;var he=I(pe,2);let ge;var _e=I(he,2),ve=e=>{var t=fse();let n;R(e=>{q(t,`tabindex`,f()?-1:0),q(t,`aria-label`,c()?.[1]||void 0),q(t,`aria-hidden`,d()),q(t,`aria-disabled`,f()),q(t,`aria-readonly`,p()),q(t,`aria-invalid`,m()),q(t,`aria-valuemin`,r()),q(t,`aria-valuemax`,i()),q(t,`aria-valuenow`,s()?.[1]),q(t,`aria-valuetext`,e),n=Qo(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),so(`pointerdown`,t,e=>se(e,1)),so(`keydown`,t,e=>ie(e,1)),U(e,t)};G(_e,e=>{z(g)&&e(ve)});var ye=I(_e,2),be=e=>{var t=H();ko(P(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=pse();let i;var a=F(r,!0);R(()=>{i=Qo(r,``,i,{"inset-inline-start":`${z(v)/(u().length-1)*z(n)}px`}),W(a,z(t))}),U(e,r)}),U(e,t)};G(ye,e=>{u().length&&e(be)}),D(fe),_s(fe,e=>M(_,e),()=>z(_)),D(de),R(e=>{me=Qo(pe,``,me,{"inset-inline-start":`${z(g)?w[0]:0}px`,width:`${z(g)?w[1]-w[0]:w[0]}px`}),q(he,`tabindex`,f()?-1:0),q(he,`aria-label`,(z(g)?c()?.[0]:a())||void 0),q(he,`aria-labelledby`,z(g)?void 0:o()),q(he,`aria-hidden`,d()),q(he,`aria-disabled`,f()),q(he,`aria-readonly`,p()),q(he,`aria-invalid`,m()),q(he,`aria-valuemin`,r()),q(he,`aria-valuemax`,i()),q(he,`aria-valuenow`,z(g)?s()?.[0]:n()),q(he,`aria-valuetext`,e),ge=Qo(he,``,ge,{"inset-inline-start":`${w[0]}px`})},[()=>x(z(g)?s()?.[0]:n())]),so(`pointerdown`,fe,e=>se(e)),so(`pointerdown`,he,e=>se(e,0)),so(`keydown`,he,e=>ie(e,0)),U(e,de),k()}co([`pointerdown`,`keydown`]);var _se=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),vse=B(``),yse={hash:`svelte-1cm7zsk`,code:`button.svelte-1cm7zsk {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1cm7zsk:focus-visible {outline:0;}button.svelte-1cm7zsk:focus-visible span:where(.svelte-1cm7zsk) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1cm7zsk {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk), button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk), button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before, button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1cm7zsk {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1cm7zsk::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function bu(e,t){O(t,!0),K(e,yse);let n=J(t,`checked`,15,!1),r=J(t,`label`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`ariaLabel`,3,void 0),u=ys(t,_se);var d=vse(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};us(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1cm7zsk`);var p=I(N(d),2),m=e=>{var t=V();R(()=>W(t,r())),U(e,t)},h=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)};G(p,e=>{r()?e(m):e(h,-1)}),D(d),U(e,d),k()}var bse=new Set([`$$slots`,`$$events`,`$$legacy`]);function xu(e,t){let n=ys(t,bse);$l(e,bs(()=>n,{role:`cell`,kind:`table-cell`}))}var xse=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sse(e,t){let n=ys(t,xse);$l(e,bs(()=>n,{role:`row`,kind:`table-row`}))}var Cse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),wse=B(`
`),Tse={hash:`svelte-t6lb2u`,code:`.table.svelte-t6lb2u {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-t6lb2u {border-collapse:collapse;}.table.data.svelte-t6lb2u :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Ese(e,t){K(e,Tse);let n=J(t,`ariaLabel`,3,void 0),r=ys(t,Cse);var i=wse();us(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-t6lb2u`),Po(N(i),()=>t.children??Tr),D(i),U(e,i)}var Dse=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),Ose=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),kse=B(`
`),Ase={hash:`svelte-bk1fk2`,code:`.tab-list.svelte-bk1fk2 {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 .indicator:where(.svelte-bk1fk2) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-bk1fk2 {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-bk1fk2 button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-bk1fk2 .indicator:where(.svelte-bk1fk2) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-bk1fk2 button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-bk1fk2 {display:contents;}.indicator.svelte-bk1fk2 {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function jse(e,t){O(t,!0),K(e,Ase);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`name`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=ys(t,Ose),c=j(void 0),l=j(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=z(c)?.querySelector(`[role="tab"][aria-selected="true"]`);M(l,e?Dse(e):void 0,!0)})};xs(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(z(c)),t.observe(z(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=kse(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};us(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-bk1fk2`);var m=N(d);Po(N(m),()=>t.children??Tr),D(m);var h=I(m,2);D(d),_s(d,e=>M(c,e),()=>z(c)),Wo(d,Dl),R(()=>{m.inert=r(),Qo(h,z(l))}),U(e,d),k()}var Mse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Nse=B(`
`),Pse={hash:`svelte-uhed84`,code:`.tab-panel.svelte-uhed84 {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-uhed84, .tab-panel.svelte-uhed84:not([aria-hidden]) {display:none;}`};function Fse(e,t){K(e,Pse);let n=ys(t,Mse);var r=Nse();us(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-uhed84`),Po(N(r),()=>t.children??Tr),D(r),U(e,r)}var Ise=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function Lse(e,t){let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`selected`,3,!1),a=ys(t,Ise);ul(e,bs(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=H();Po(P(n),()=>t.startIcon??Tr),U(e,n)},children:e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)},endIcon:e=>{var n=H();Po(P(n),()=>t.endIcon??Tr),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var Su=[],Rse=()=>(Su.splice(0,Su.length,...Su.filter(e=>e.isConnected&&e.matches(`:modal`))),Su.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),Cu=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},wu=e=>{let t=Rse();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},zse=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},Tu,Eu=0,Du=e=>{let{target:t,newState:n}=e;Tu&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!Su.includes(t)&&(Su.push(t),wu(Tu),Cu(Tu))},Ou=e=>{let{target:t}=e;if(!Tu||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=Su.indexOf(t);n>-1&&Su.splice(n,1),t.contains(Tu)&&wu(Tu)&&!Tu.matches(`:popover-open`)&&Cu(Tu)},Bse=()=>(Eu+=1,Tu||(Tu=document.createElement(`div`),Tu.setAttribute(`role`,`none`),Tu.className=`sui toast-base enabled`,Tu.popover=`manual`,Su.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,Du,!0),document.addEventListener(`beforetoggle`,Ou,!0),document.addEventListener(`close`,Ou,!0)),wu(Tu),Tu),Vse=()=>{--Eu,!(Eu>0||!Tu)&&(document.removeEventListener(`toggle`,Du,!0),document.removeEventListener(`beforetoggle`,Ou,!0),document.removeEventListener(`close`,Ou,!0),Tu.remove(),Tu=void 0,Su.length=0)},Hse=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Use=B(`
`),Wse={hash:`svelte-28ad9u`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-28ad9u {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;} -@starting-style {.toast.svelte-28ad9u {opacity:0;} -}.toast.svelte-28ad9u {pointer-events:auto;}.toast[aria-hidden=true].svelte-28ad9u {display:block;opacity:0;pointer-events:none;} -@supports (interpolate-size: allow-keywords) {.toast.svelte-28ad9u {interpolate-size:allow-keywords;} - @starting-style {.toast.svelte-28ad9u {margin-block:0;height:0;} - }.toast[aria-hidden=true].svelte-28ad9u {margin-block:0;height:0;} -}.toast.svelte-28ad9u:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function ku(e,t){O(t,!0),K(e,Wse);let n=J(t,`show`,15,!1),r=J(t,`id`,3,void 0),i=J(t,`duration`,3,5e3),a=J(t,`position`,7,`auto`),o=ys(t,Hse),s=j(void 0),c=j(void 0),l=j(!1),u=j(!1);xs(()=>(M(s,Bse(),!0),()=>{z(c)?.remove(),Vse()})),xs(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),L(()=>{if(!z(s)||!z(c))return;if(!z(u)){z(c).remove(),M(l,!1),!z(s).querySelector(`.toast`)&&z(s).matches(`:popover-open`)&&z(s).hidePopover();return}wu(z(s));let e=zse(z(s),a());a().startsWith(`top-`)?e.prepend(z(c)):e.append(z(c)),Cu(z(s))}),L(()=>{if(n()){M(u,!0);return}let e=globalThis.setTimeout(()=>{M(u,!1)},250);return()=>{globalThis.clearTimeout(e)}}),L(()=>{if(r(),n(),i(),z(l),!n()||!i()||z(l))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var d=Use(),f=()=>{M(l,!0)},p=()=>{M(l,!1)},m=()=>{M(l,!0)},h=e=>{M(l,!!e.relatedTarget&&!!z(c)?.contains(e.relatedTarget),!0)};us(d,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:f,onpointerleave:p,onfocusin:m,onfocusout:h}),void 0,void 0,void 0,`svelte-28ad9u`);var g=N(d),_=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)};G(g,e=>{z(u)&&e(_)}),D(d),_s(d,e=>M(c,e),()=>z(c)),U(e,d),k()}var Au="```",Gse=(e,t)=>t?`${Au}${e}\n${t}\n${Au}`:`${Au}${e}\n${Au}`,Kse=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?[^\s`]+)?\n(?:(?.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function ju(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Mu(e,...t){throw ju(e,...t)}function Nu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qse(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var Pu=qse();function Jse(){return Pu&&`documentMode`in document?document.documentMode:null}var Yse=Jse();function Xse(e){return Pu&&e.test(navigator.platform)}function Fu(e){return Pu&&e.test(navigator.userAgent)}var Iu=Xse(/Mac|iPod|iPhone|iPad/),Lu=Fu(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Zse(){return!(!Pu||!(`InputEvent`in window)||Yse)&&`getTargetRanges`in new window.InputEvent(`input`)}var Ru=Zse();function Qse(){return Pu&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var zu=Qse(),Bu=Fu(/Android/),Vu=Fu(/Version\/[\d.]+.*Safari/)&&!Bu,Hu=Fu(/^(?=.*Chrome).*/i),Uu=Pu&&Bu&&Hu,Wu=Fu(/AppleWebKit\/[\d.]+/)&&Iu&&!Hu;function $se(){return 2047}var ece=$se(),Gu=Vu||zu||Wu?`\xA0`:`​`,Ku=` +}`};function Ql(e,t){k(t,!0),q(e,Wae);let n=Y(t,`sortOrder`,3,void 0),r=gs(t,Uae),i=e=>{let r=e=>{e.stopPropagation(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=U(),o=F(a),s=e=>{Xl(e,_s(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=j(()=>t.class?`sortable ${t.class}`:`sortable`),o=j(()=>n()===`none`?void 0:n());Xl(e,_s(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return B(a)},get"aria-sort"(){return B(o)},children:(e,r)=>{{let r=e=>{{let t=j(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);Lc(e,{get class(){return`sort-icon ${n()??``}`},get name(){return B(t)}})}};ll(e,{class:`sort-button`,[lo()]:i,endIcon:r,children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};K(o,e=>{n()===void 0?e(s):e(c,-1)}),W(e,a),A()}var Gae=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kae(e,t){k(t,!0);let n=gs(t,Gae);di(`sui:grid-unselectable-rows`,!0);{let t=j(()=>X(`_sui.role_descriptions.grid_head`));Xl(e,_s(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return B(t)}}))}A()}var qae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function $l(e,t){k(t,!0);let n=Y(t,`selected`,3,!1),r=gs(t,qae),i=ui(`sui:grid-unselectable-rows`)===!0,a=j(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=U(),c=F(s),l=e=>{Xl(e,_s(()=>B(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[lo()]:o}))},u=e=>{Xl(e,_s(()=>B(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};K(c,e=>{i?e(l):e(u,-1)}),W(e,s),A()}var Jae=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),Yae=V(`
`),Xae={hash:`svelte-o5vcva`,code:`.grid.svelte-o5vcva {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-o5vcva {border-collapse:collapse;}.grid.data.svelte-o5vcva :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Zae(e,t){k(t,!0),q(e,Xae);let n=Y(t,`element`,15),r=Y(t,`multiple`,3,!1),i=Y(t,`clickToSelect`,3,!0),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,Jae);di(`sui:grid-unselectable-rows`,!1);var s=Yae(),c=e=>{t.onChange?.(e)};us(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-o5vcva`),Uo(P(s),()=>t.children??jr),O(s),ms(s,e=>n(e),()=>n()),$o(s,()=>El({clickToSelect:i()})),W(e,s),A()}var Qae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),$ae=V(`
`),eoe={hash:`svelte-1gip2n8`,code:`[role=listbox].svelte-1gip2n8 {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-1gip2n8 [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-1gip2n8 {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-1gip2n8 {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-1gip2n8 .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-1gip2n8 .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-1gip2n8 .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-1gip2n8 .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-1gip2n8:focus-visible, [role=listbox].svelte-1gip2n8:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-1gip2n8 [role=separator] {display:none;}.inner.svelte-1gip2n8 {display:contents;}`};function eu(e,t){k(t,!0),q(e,eoe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`multiple`,3,!1),c=Y(t,`searchTerms`,3,``),l=Y(t,`ariaLabel`,3,void 0),u=gs(t,Qae),d=M(!1);var f=$ae(),p=e=>{let{detail:{matched:n,total:r}}=e;N(d,n!==r),t.onFilter?.(e)};us(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[cs]:{filtered:B(d)}}),void 0,void 0,void 0,`svelte-1gip2n8`);var m=P(f);Uo(P(m),()=>t.children??jr),O(m),O(f),$o(f,()=>El(()=>({searchTerms:c()}))),z(()=>m.inert=r()),W(e,f),A()}var toe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),noe=V(`
`),roe={hash:`svelte-vkzbak`,code:`.option-group.svelte-vkzbak:not(:first-child) {margin:12px 0 0;}.label.svelte-vkzbak {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-vkzbak {display:contents;}`};function tu(e,t){let n=Co();k(t,!0),q(e,roe);let r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=gs(t,toe);var s=noe();us(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>X(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-vkzbak`);var c=P(s);Xc(P(c),{children:(e,t)=>{$r();var n=H();z(()=>G(n,a())),W(e,n)},$$slots:{default:!0}}),O(c);var l=L(c,2);Uo(P(l),()=>t.children??jr),O(l),O(s),z(()=>{J(c,`id`,`${n}-label`),l.inert=i()}),W(e,s),A()}var ioe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),aoe=V(` `,1),ooe=V(`
`),soe={hash:`svelte-16etwr2`,code:`.option.svelte-16etwr2 {display:contents;}.option.svelte-16etwr2:focus-visible {outline-width:0 !important;}.option.wrap.svelte-16etwr2 button {white-space:normal;}.option.svelte-16etwr2 button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-16etwr2 button:active {background-color:var(--sui-active-background-color);}.option.svelte-16etwr2 button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-16etwr2 button * {flex:none;}.option.svelte-16etwr2 button .label {flex:auto;}.option.svelte-16etwr2 :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-16etwr2 .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-16etwr2 .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function nu(e,t){let n=Co();k(t,!0),q(e,soe);let r=Y(t,`selected`,15,!1),i=Y(t,`hidden`,15,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`value`,3,void 0),s=Y(t,`searchValue`,3,void 0),c=Y(t,`wrap`,3,!1),l=gs(t,ioe),u=j(()=>o()===void 0?t.label:o()),d=j(()=>s()===void 0?t.label:s()),f=_ie();f&&ys(f.register({get value(){return B(u)},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??Yc(B(u))},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let p=j(()=>!f||f.expanded);var m=U(),h=F(m),g=e=>{var o=ooe();let s;var f=P(o);{let e=e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},o=j(()=>t.id??n);ll(f,_s(()=>l,{role:`option`,get id(){return B(o)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return B(u)},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return B(d)},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=aoe(),a=F(i),o=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.checkIcon),W(e,n)},a=e=>{Lc(e,{class:`check`,name:`check`})};K(r,e=>{t.checkIcon?e(i):e(a,-1)}),W(e,n)};K(a,e=>{r()&&e(o)}),Uo(L(a,2),()=>t.children??jr),W(e,i)},$$slots:{startIcon:!0,default:!0}}))}O(o),z(()=>{s=rs(o,1,`sui option ${t.class??``}`,`svelte-16etwr2`,s,{wrap:c()}),J(o,`hidden`,i())}),W(e,o)};K(h,e=>{B(p)&&e(g)}),W(e,m),A()}var coe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),loe=V(`
`),uoe={hash:`svelte-1j927nc`,code:`.menu.svelte-1j927nc {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-1j927nc [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function ru(e,t){k(t,!0),q(e,uoe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,coe);var o=loe(),s=e=>{t.onChange?.(e)};us(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-1j927nc`),Uo(P(o),()=>t.children??jr),O(o),$o(o,El),W(e,o),A()}var doe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),foe=V(``),poe=V(`
`,1),moe=V(`
`),hoe={hash:`svelte-1bqx3r4`,code:`.menuitem.svelte-1bqx3r4 {position:relative;}.menuitem.svelte-1bqx3r4 button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-1bqx3r4 button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-1bqx3r4 button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-1bqx3r4 button:active {background-color:var(--sui-active-background-color);}.content.svelte-1bqx3r4 {flex:auto;}.icon-outer.svelte-1bqx3r4 {flex:none;width:24px;height:24px;}`};function iu(e,t){k(t,!0),q(e,hoe);let n=Y(t,`role`,3,`menuitem`),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=Y(t,`labelDir`,3,void 0),s=Y(t,`popupPosition`,3,`right-top`),c=gs(t,doe),l=M(!1),u=M(!1),d,f=M(void 0),p=M(void 0),m=j(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};vs(()=>(N(p,B(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=moe(),_=P(g);{let e=e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},s=e=>{var n=poe(),r=F(n);let i;var s=P(r),c=e=>{var t=H();z(()=>G(t,a())),W(e,t)},l=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(s,e=>{a()?e(c):e(l,-1)}),O(r);var u=L(r,2),d=e=>{var n=foe(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)};K(u,e=>{B(m)&&e(d)}),z(()=>{i=rs(r,1,`content svelte-1bqx3r4`,null,i,{label:!!a()}),J(r,`dir`,a()?o():void 0),r.dir=r.dir}),W(e,n)},p=e=>{var n=U();Uo(F(n),()=>t.endIcon??jr),W(e,n)},g=j(()=>B(m)?`menu`:void 0),v=j(()=>B(m)?B(l):void 0);ll(_,_s(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return B(g)},get"aria-expanded"(){return B(v)},onmouseenter:e=>{B(m)&&h(()=>{N(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{B(m)&&h(()=>{B(u)||N(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{B(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),N(l,e.detail?!0:!B(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return B(f)},set element(e){N(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=L(_,2),y=e=>{cl(e,{get anchor(){return B(f)},get parentDialogElement(){return B(p)},get position(){return s()},get open(){return B(l)},set open(e){N(l,e,!0)},get hovered(){return B(u)},set hovered(e){N(u,e,!0)},children:(e,n)=>{ru(e,{children:(e,n)=>{var r=U();Uo(F(r),()=>t.items??jr),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(v,e=>{B(m)&&B(f)&&B(p)&&e(y)}),O(g),z(()=>{rs(g,1,`sui menuitem ${t.class??``}`,`svelte-1bqx3r4`),J(g,`hidden`,r())}),W(e,g),A()}var goe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function au(e,t){k(t,!0);let n=Y(t,`checked`,15),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=gs(t,goe),s=j(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);iu(e,_s(()=>o,{get role(){return t.role},get class(){return`sui ${B(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var t=U(),r=F(t),i=e=>{Lc(e,{name:`check`})};K(r,e=>{n()&&e(i)}),W(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),A()}var _oe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function ou(e,t){k(t,!0);let n=Y(t,`checked`,15),r=gs(t,_oe);au(e,_s(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),A()}var voe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function su(e,t){k(t,!0);let n=Y(t,`checked`,15),r=gs(t,voe);au(e,_s(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),A()}var yoe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),boe=V(`
`),xoe={hash:`svelte-1t6ns2s`,code:`.progressbar.svelte-1t6ns2s {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-1t6ns2s div:where(.svelte-1t6ns2s) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function Soe(e,t){q(e,xoe);let n=Y(t,`now`,3,0),r=Y(t,`min`,3,0),i=Y(t,`max`,3,100),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,yoe),s=j(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=boe();us(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-1t6ns2s`);var l=P(c);let u;O(c),z(()=>u=as(l,``,u,{width:`${B(s)}%`})),W(e,c)}var Coe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),woe=V(`
`),Toe={hash:`svelte-1v5wx8a`,code:`.radio-group.svelte-1v5wx8a {display:inline-flex;}.radio-group.svelte-1v5wx8a:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-1v5wx8a {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-1v5wx8a {gap:4px;flex-direction:column;} +@media (pointer: coarse) {.radio-group.vertical.svelte-1v5wx8a {gap:8px;} +}.radio-group[aria-invalid=true].svelte-1v5wx8a button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-1v5wx8a button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-1v5wx8a button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-1v5wx8a {display:contents;}`};function cu(e,t){k(t,!0),q(e,Toe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`orientation`,3,`horizontal`),c=Y(t,`ariaLabel`,3,void 0),l=gs(t,Coe);var u=woe(),d=e=>{t.onChange?.(e)};us(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-1v5wx8a`);var f=P(u);Uo(P(f),()=>t.children??jr),O(f),O(u),$o(u,El),z(()=>f.inert=r()),W(e,u),A()}var Eoe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),Doe=V(``),Ooe=V(` `),koe={hash:`svelte-1p416ls`,code:`.radio.svelte-1p416ls {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-1p416ls:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-1p416ls:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-1p416ls:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-1p416ls:active button {background-color:var(--sui-active-background-color);}.radio.svelte-1p416ls:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-1p416ls button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-1p416ls button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-1p416ls button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-1p416ls button[aria-checked=true]::before {opacity:1;}.radio.svelte-1p416ls label:where(.svelte-1p416ls) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function lu(e,t){let n=Co();k(t,!0),q(e,koe);let r=Y(t,`checked`,7,!1),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`name`,3,void 0),s=Y(t,`value`,3,void 0),c=Y(t,`valueType`,3,void 0),l=Y(t,`label`,3,void 0),u=Y(t,`ariaLabel`,3,void 0),d=Y(t,`group`,15),f=gs(t,Eoe),p=M(void 0),m=j(()=>u()??f[`aria-label`]),h=j(()=>!!(t.children||l())),g=()=>!!B(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);R(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var _=Ooe();let v;var y=P(_);{let e=j(()=>B(m)||void 0),l=j(()=>!B(m)&&B(h)?`${n}-label`:void 0);ll(y,_s(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()},get"aria-label"(){return B(e)},get"aria-labelledby"(){return B(l)},onclick:e=>{e.preventDefault(),a()||r()||g()||(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return B(p)},set element(e){N(p,e,!0)}}))}var b=L(y,2),x=e=>{var r=Doe(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},o=e=>{var t=H();z(()=>G(t,l())),W(e,t)};K(i,e=>{t.children?e(a):e(o,-1)}),O(r),z(()=>J(r,`id`,`${n}-label`)),W(e,r)};K(b,e=>{(t.children||l())&&e(x)}),O(_),z(()=>{v=rs(_,1,`sui radio ${t.class??``}`,`svelte-1p416ls`,v,{disabled:a()}),J(_,`hidden`,i())}),_o(`click`,_,e=>{e.target.matches(`button`)||B(p)?.click()}),W(e,_),A()}vo([`click`]);var uu=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},du=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,uu(e.minSize,0,t)),r=Math.min(100,uu(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},fu=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]t[r].minSize)}return i},Aoe=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return fu(u,l,d,fu(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},joe=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},Moe=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=_l(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},Noe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),Poe=V(`
`),Foe=V(`
`),Ioe={hash:`svelte-isbt3i`,code:`.resizable-handle.svelte-isbt3i {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-isbt3i:focus-visible, .resizable-handle.svelte-isbt3i:hover, .resizable-handle.dragging.svelte-isbt3i {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-isbt3i:focus-visible .handle-bar:where(.svelte-isbt3i), .resizable-handle.svelte-isbt3i:hover .handle-bar:where(.svelte-isbt3i), .resizable-handle.dragging.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-isbt3i {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-isbt3i::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-isbt3i {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-isbt3i::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-isbt3i {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-isbt3i::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function pu(e,t){k(t,!0),q(e,Ioe);let n=Y(t,`disabled`,3,!1),r=Y(t,`showHandleBar`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,Noe),o=ui(`paneGroup`);if(!o)throw Error(` must be used inside a `);let s=M(void 0),c=o.registerHandle(()=>B(s)),l=j(()=>c.index);ys(()=>{c.unregister()});let u=j(()=>o.direction===`horizontal`),d=j(()=>o.sizes),f=j(()=>B(d)[B(l)]??0),p=j(()=>o.getPaneConstraints(B(l))),m=j(()=>o.getPaneConstraints(B(l)+1)),h=j(()=>B(f)+(B(d)[B(l)+1]??0)),g=j(()=>Math.max(B(p).minSize,B(h)-B(m).maxSize)),_=j(()=>Math.min(B(p).maxSize,B(h)-B(m).minSize)),v=M(!1),y=M(0),b=0,x=M(0),S=M(!1),C=0,w=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!B(v)||i!==B(x))return;e.preventDefault(),e.stopPropagation();let a=(B(u)?t:r)-B(y);if(!C)return;let s=a/C*100;B(u)&&Pc()&&(s=-s),o.resize(B(l),b+s-(B(d)[B(l)]??0))},T=e=>{let{pointerId:n}=e;B(v)&&n===B(x)&&(B(s)?.releasePointerCapture(n),N(v,!1),N(y,0),N(x,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T))},ee=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;N(v,!0),N(y,B(u)?r:i,!0),b=B(d)[B(l)]??0,N(x,a,!0),C=o.measurePaneSpace(),B(s)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,w),document.addEventListener(`pointerup`,T),document.addEventListener(`pointercancel`,T)},E=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=Moe({key:r,shiftKey:i,isHorizontal:B(u),rtl:Pc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(B(l)):(r!==`Home`&&r!==`End`&&!B(S)&&(N(S,!0),t.onResizeStart?.()),o.resize(B(l),a.delta)))},te=()=>{B(S)&&(N(S,!1),t.onResizeEnd?.())};R(()=>()=>{document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T)});var ne=Foe();us(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":B(u)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":B(g),"aria-valuemax":B(_),"aria-controls":o.paneDefs[B(l)]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:ee,onkeydown:E,onblur:te,[cs]:{horizontal:B(u),vertical:!B(u),disabled:n(),dragging:B(v)}}),[()=>Math.round(B(f))],void 0,void 0,`svelte-isbt3i`);var re=P(ne),ie=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},ae=e=>{W(e,Poe())};K(re,e=>{t.children?e(ie):r()&&e(ae,1)}),O(ne),ms(ne,e=>N(s,e),()=>B(s)),W(e,ne),A()}var Loe=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),Roe=V(`
`),zoe={hash:`svelte-8hr7aw`,code:`.resizable-pane-group.svelte-8hr7aw {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-8hr7aw {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-8hr7aw {flex-direction:column;width:100%;height:100%;}`};function mu(e,t){k(t,!0),q(e,zoe);let n=Y(t,`direction`,3,`horizontal`),r=gs(t,Loe),i=M([]),a=M([]),o=M(void 0),s=na([]),c=na([]),l=()=>{if(!B(o))return 0;let e=n()===`horizontal`,t=e?B(o).clientWidth:B(o).clientHeight,r=[...B(o).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>du(B(i)[e],u()),f=``,p=()=>{if(!B(i).length)return;let e=u(),t=B(i).map(t=>t.defaultSize===void 0?NaN:uu(t.defaultSize,NaN,e)),n=B(i).map(t=>du(t,e));s.splice(0,s.length,...Aoe(t,n)),f=s.map(e=>Number(e.toFixed(1))).join()},m=()=>{let e=s.map(e=>Number(e.toFixed(1))),n=e.join();n!==f&&(f=n,t.onResize?.({sizes:e}))},h=(e,t)=>{let n=e,r=e+1;if(n<0||r>=s.length)return;let i=s[n],a=s[r],o=joe(t,{sizeBefore:i,sizeAfter:a,constraintsBefore:d(n),constraintsAfter:d(r)});s[n]=i+o,s[r]=a-o,m()},g=e=>{let{minSize:t}=d(e);if(c[e]!==void 0&&Math.abs(s[e]-t)<.1){let t=c[e]-s[e];c[e]=void 0,h(e,t)}else c[e]=s[e],h(e,-(s[e]-t))},_=(e,t,n)=>{let r=t;return[...e,...s.map((e,t)=>t)].forEach(e=>{if(Math.abs(r)<.001||e===n||s[e]===void 0)return;let{minSize:t,maxSize:i}=d(e),a=Math.min(Math.max(s[e]+r,t),i);r-=a-s[e],s[e]=a}),r},v=()=>{if(!B(o)||!s.length)return;let e=[...B(o).querySelectorAll(`:scope > .resizable-pane`)].map(({id:e})=>e),t=t=>{let n=e.indexOf(t.id);return n===-1?1/0:n},n=B(i).toSorted((e,n)=>t(e)-t(n)),r=n.map(e=>s[B(i).indexOf(e)]);n.some((e,t)=>e!==B(i)[t])&&(N(i,n),s.splice(0,s.length,...r),c.length=0),s.forEach((e,t)=>{if(!Number.isNaN(e))return;let n=u(),r=B(i)[t],{minSize:a,maxSize:o}=du(r,n),c=r.defaultSize===void 0?NaN:uu(r.defaultSize,NaN,n),l=Math.min(Math.max(Number.isNaN(c)?100/s.length:c,a),o);s[t]=0,s[t]=l+_([t-1,t+1],-l,t)});let l=[...B(o).querySelectorAll(`:scope > .resizable-handle`)],d=e=>{let t=l.indexOf(e());return t===-1?1/0:t},f=B(a).toSorted((e,t)=>d(e)-d(t));f.some((e,t)=>e!==B(a)[t])&&(N(a,f),c.length=0),s.some(e=>Number.isNaN(e))||m()};di(`paneGroup`,{get direction(){return n()},sizes:s,registerPane:e=>(N(i,[...B(i),e]),s.length&&s.push(NaN),{get index(){return B(i).indexOf(e)},unregister:()=>{let t=B(i).indexOf(e);if(t!==-1&&(N(i,B(i).toSpliced(t,1)),s.length)){let[e]=s.splice(t,1);c.length=0,s.length&&!Number.isNaN(e)&&_([t-1,t],e)}}}),registerHandle:e=>(N(a,[...B(a),e]),{get index(){return B(a).indexOf(e)},unregister:()=>{N(a,B(a).filter(t=>t!==e)),c.length=0}}),resize:h,toggleCollapse:g,getPaneConstraints:d,measurePaneSpace:l,get paneDefs(){return B(i)}}),R(()=>{B(i).length&&!s.length&&p()}),R(()=>{if(!B(o))return;let e=new MutationObserver(()=>v());return e.observe(B(o),{childList:!0}),()=>{e.disconnect()}});var y=Roe();us(y,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-8hr7aw`),Uo(P(y),()=>t.children??jr),O(y),ms(y,e=>N(o,e),()=>B(o)),W(e,y),A()}var Boe=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),Voe=V(`
`);function hu(e,t){let n=Co();k(t,!0);let r=Y(t,`defaultSize`,3,void 0),i=Y(t,`minSize`,3,0),a=Y(t,`maxSize`,3,100),o=gs(t,Boe),s=ui(`paneGroup`);if(!s)throw Error(` must be used inside a `);let c=s.registerPane({id:n,get defaultSize(){return r()},get minSize(){return i()},get maxSize(){return a()}}),l=j(()=>s.direction),u=j(()=>s.sizes[c.index]),d=j(()=>B(u)!==void 0&&!Number.isNaN(B(u))?`${B(u)}%`:typeof r()==`number`?`${r()}%`:r()??`0%`);ys(()=>{c.unregister()}),R(()=>{B(u)!==void 0&&!Number.isNaN(B(u))&&co(()=>t.onResize?.({size:Number(B(u).toFixed(1))}))});var f=Voe();us(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[ls]:{"flex-basis":B(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":B(l)===`horizontal`?`auto`:void 0,"overflow-y":B(l)===`vertical`?`auto`:void 0}})),Uo(P(f),()=>t.children??jr),O(f),W(e,f),A()}var Hoe=V(`
`),Uoe=V(` `,1),Woe={hash:`svelte-pmsr8z`,code:`.spinner.svelte-pmsr8z {height:1px;}`};function gu(e,t){k(t,!0),q(e,Woe);let n=Y(t,`itemChunkSize`,3,25),r=M(na(n())),i=M(void 0),a=j(()=>t.items.length>B(r)),o=null,s=!1,c=e=>{if(s)return o;let t=null;o=null;for(let n=e.parentElement;n;n=n.parentElement)if(/^(auto|scroll)$/.test(getComputedStyle(n).overflowY)&&(t??=n,n.scrollHeight-n.clientHeight>1)){o=n;break}return s=o===t,o};R(()=>{if(B(r),!B(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&B(a)&&N(r,B(r)+n())},{root:c(B(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(B(i)),()=>{e.disconnect()}});var l=Uoe(),u=F(l);Ro(u,19,()=>t.items.slice(0,B(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=U();Uo(F(i),()=>t.renderItem,()=>B(n),()=>B(r)),W(e,i)});var d=L(u,2),f=e=>{var t=Hoe();ms(t,e=>N(i,e),()=>B(i)),W(e,t)};K(d,e=>{B(a)&&e(f)}),W(e,l),A()}function Goe(e){let t=e-1;return t*t*t+1}function _u(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=Goe}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=Koe(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function Koe(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var qoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),Joe=V(`
`),Yoe={hash:`svelte-5ubm3c`,code:`.search-bar.svelte-5ubm3c {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-5ubm3c:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-5ubm3c > span:where(.svelte-5ubm3c) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-5ubm3c .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-5ubm3c > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-5ubm3c .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-5ubm3c .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-5ubm3c input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-5ubm3c:dir(rtl) {--sui-textbox-text-align: right;}`};function vu(e,t){let n=Co();k(t,!0),q(e,Yoe);let r=Y(t,`value`,15),i=Y(t,`flex`,3,!1),a=Y(t,`hidden`,3,!1),o=Y(t,`disabled`,3,!1),s=Y(t,`readonly`,3,!1),c=Y(t,`required`,3,!1),l=Y(t,`invalid`,3,!1),u=gs(t,qoe),d=M(void 0);var f={focus:()=>{B(d)?.focus()}},p=Joe();let m;var h=P(p),g=P(h),_=e=>{var n=U();Uo(F(n),()=>t.searchIcon),W(e,n)},v=e=>{Lc(e,{name:`search`})};K(g,e=>{t.searchIcon?e(_):e(v,-1)}),O(h);var y=L(h,2);Gl(y,_s({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return B(d)},set element(e){N(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=L(y,2),x=e=>{{let i=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.closeIcon),W(e,n)},a=e=>{Lc(e,{name:`close`})};K(r,e=>{t.closeIcon?e(i):e(a,-1)}),W(e,n)},a=j(()=>o()||s()),c=j(()=>X(`_sui.clear`));ll(e,{iconic:!0,get disabled(){return B(a)},get"aria-label"(){return B(c)},get"aria-controls"(){return n},onclick:()=>{r(``),B(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return K(b,e=>{r()&&e(x)}),O(p),z(()=>{J(p,`role`,a()?void 0:`none`),m=rs(p,1,`sui search-bar ${t.class??``}`,`svelte-5ubm3c`,m,{flex:i(),disabled:o(),readonly:s()}),J(p,`hidden`,a()),J(p,`aria-hidden`,a())}),W(e,p),A(f)}var Xoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),Zoe=V(`
`),Qoe=V(`
`),$oe=V(`
`),ese=V(`
`,1),tse={hash:`svelte-5gd2qh`,code:`:is(.option-host.svelte-5gd2qh, .listbox-slot.svelte-5gd2qh) {display:contents;}.combobox.svelte-5gd2qh {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh):not(.selected) {font-style:italic;}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh):is(:where(.svelte-5gd2qh):hover, :where(.svelte-5gd2qh):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-5gd2qh div[role=combobox][aria-readonly=true]:where(.svelte-5gd2qh) {cursor:default;}.combobox.svelte-5gd2qh div[role=combobox][aria-readonly=true]:where(.svelte-5gd2qh):is(:where(.svelte-5gd2qh):hover, :where(.svelte-5gd2qh):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-5gd2qh div[role=combobox][aria-invalid=true]:where(.svelte-5gd2qh) {border-color:var(--sui-error-border-color);}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh) .label:where(.svelte-5gd2qh) {width:100%;}.combobox.svelte-5gd2qh .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-5gd2qh > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-5gd2qh > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-5gd2qh .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-5gd2qh input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-5gd2qh {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-5gd2qh .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-5gd2qh .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-5gd2qh .no-options:where(.svelte-5gd2qh) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function nse(e,t){let n=Co();k(t,!0),q(e,tse);let r=Y(t,`value`,15),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=Y(t,`editable`,3,!0),u=Y(t,`position`,3,`bottom-left`),d=Y(t,`filterThreshold`,3,5),f=Y(t,`ariaLabel`,3,void 0),p=gs(t,Xoe),m=M(!1),h=M(void 0),g=M(void 0),_=M(void 0),v=M(void 0),y=M(void 0),b=M(void 0),x=M(``),S=M(!1),C=M(``),w=M(0),T=j(()=>!B(C)||B(w)>0),ee=j(()=>B(h)??B(g)),E=gie(),te=()=>{let e=E.find(r());N(x,e?.label??``,!0),E.selectOnly(r())},ne=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},re=e=>{let n=ml(e);r(n.value),te(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ie=e=>{let{target:n}=e;r(n.value),te(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},ae=new vl,oe=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||B(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=E.entries.filter(e=>!e.disabled),l=yl(c.map(e=>gl(e.label??``)),ae.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),te(),ne(u))},se=()=>B(y)?.querySelector(`[role="listbox"]`),ce=()=>{let e=se(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};R(()=>{E.expanded=B(m)}),R(()=>{if(!B(m))return;let e=globalThis.setTimeout(ce,150);return()=>{globalThis.clearTimeout(e),se()?.removeAttribute(`aria-activedescendant`)}}),R(()=>{if(!B(y))return;let e=B(m)?B(b):B(v);e&&B(y).parentElement!==e&&e.append(B(y))}),vs(()=>{let e=E.selectedEntry;e&&(r(e.value),N(x,e.label,!0),ne(e))}),R(()=>{r(),te()});var le=ese(),ue=F(le);let de;var fe=P(ue),pe=e=>{var t=Zoe();us(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":B(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:oe,[cs]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-5gd2qh`);var l=P(t);Xc(P(l),{children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>r()===void 0?X(`_sui.combobox.select_an_option`):B(x)]),W(e,n)},$$slots:{default:!0}}),O(l),O(t),ms(t,e=>N(h,e),()=>B(h)),W(e,t)},me=e=>{{let t=j(()=>r()===void 0?``:String(r()));Gl(e,_s(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return B(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return B(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ie,get element(){return B(g)},set element(e){N(g,e,!0)}}))}};K(fe,e=>{l()?e(me,-1):e(pe)});var he=L(fe,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_more`})};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>!l()||o()||a()?-1:0),s=j(()=>B(m)?X(`_sui.collapse`):X(`_sui.expand`)),c=j(()=>B(m)?`${n}-popup`:void 0);ll(he,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return B(r)},get"aria-label"(){return B(s)},get"aria-controls"(){return B(c)},get"aria-expanded"(){return B(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&N(m,!B(m))},startIcon:e,$$slots:{startIcon:!0}})}O(ue);var ge=L(ue,2),_e=P(ge);eu(P(_e),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return B(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&re(e.target)},onFilter:e=>{N(w,e.detail.matched,!0)},children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}}),O(_e),ms(_e,e=>N(y,e),()=>B(y)),O(ge),ms(ge,e=>N(v,e),()=>B(v)),cl(L(ge,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return B(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{N(S,d()!==-1&&E.count>d(),!0),N(C,``)},get content(){return B(_)},set content(e){N(_,e,!0)},get open(){return B(m)},set open(e){N(m,e,!0)},children:(e,t)=>{var r=$oe(),i=P(r),a=e=>{{let t=j(()=>X(`_sui.combobox.filter_options`));vu(e,{flex:!0,get"aria-label"(){return B(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),B(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return B(C)},set value(e){N(C,e,!0)}})}};K(i,e=>{B(S)&&e(a)});var o=L(i,2);ms(o,e=>N(b,e),()=>B(b));var s=L(o,2),c=e=>{var t=Qoe(),n=I(t,!0);z(e=>G(n,e),[()=>X(`_sui.combobox.no_matching_options`)]),W(e,t)};K(s,e=>{B(T)||e(c)}),O(r),W(e,r)},$$slots:{default:!0}}),z(()=>{de=rs(ue,1,`sui combobox ${t.class??``}`,`svelte-5gd2qh`,de,{editable:l()}),J(ue,`hidden`,i())}),W(e,le),A()}var rse=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function yu(e,t){k(t,!0);let n=Y(t,`value`,15),r=gs(t,rse);nse(e,_s(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),A()}var ise=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},ase=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t0?0:e===`End`&&tt{if(t!==e&&t!==e+1)return t>e?t-1:t},cse=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),lse=V(``),use=V(` `),dse=V(`
`),fse={hash:`svelte-c0or8s`,code:`.select-tags.svelte-c0or8s {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-c0or8s {pointer-events:none;}.select-tags.disabled.svelte-c0or8s > :where(.svelte-c0or8s) {opacity:0.5;}.select-tags.svelte-c0or8s span[role=grid]:where(.svelte-c0or8s) {display:contents;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-c0or8s span[draggable].drag-source:where(.svelte-c0or8s) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-c0or8s span[draggable].drop-before:where(.svelte-c0or8s)::before, .select-tags.svelte-c0or8s span[draggable].drop-after:where(.svelte-c0or8s)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-c0or8s span[draggable].drop-before:where(.svelte-c0or8s)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-c0or8s span[draggable].drop-after:where(.svelte-c0or8s)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) .label:where(.svelte-c0or8s) {outline:none;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) span[role=gridcell]:where(.svelte-c0or8s):not(.label) {display:contents;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) button {outline-offset:-2px;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) .icon {font-size:var(--sui-font-size-large);}`};function pse(e,t){k(t,!0),q(e,fse);let n=Y(t,`values`,31,()=>na([])),r=Y(t,`max`,3,void 0),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=gs(t,cse),u=j(()=>new Map(t.options.map(e=>[e.value,e]))),d=j(()=>new Set(n())),f=j(()=>t.options.some(({value:e})=>!B(d).has(e))),p=M(void 0),m=M(void 0),h=M(void 0),g=M(void 0),_=(e,r)=>{if(e===r)return;let i=ise(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await ao(),(B(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=dse();let b;var x=P(y);Ro(x,30,n,e=>e,(e,r,i)=>{let s=j(()=>B(u).get(r)),c=j(()=>B(s)?.label||B(s)?.value||r);var l=use();let d;var f=P(l),p=I(f,!0),m=L(f,2),_=e=>{var i=lse(),s=P(i);{let e=e=>{Lc(e,{name:`close`})},i=j(()=>a()||o()),l=j(()=>X(`_sui.select_tags.remove_x`,{values:{name:B(c)}}));ll(s,{iconic:!0,size:`small`,get disabled(){return B(i)},get"aria-label"(){return B(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}O(i),W(e,i)};K(m,e=>{B(s)&&e(_)}),O(l),z(()=>{J(l,`draggable`,!a()&&!o()),d=rs(l,1,`svelte-c0or8s`,null,d,{"drag-source":B(h)===B(i),"drop-before":B(g)===B(i)&&B(h)!==B(i)&&B(h)!==B(i)-1,"drop-after":B(g)===n().length&&B(i)===n().length-1&&B(h)!==n().length-1}),J(f,`tabindex`,a()||o()?void 0:0),G(p,B(c))}),go(`dragstart`,l,e=>{N(h,B(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,B(c)),e.dataTransfer.effectAllowed=`move`)}),go(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),N(g,ose({index:B(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:Pc()}),!0)}),go(`drop`,l,async e=>{e.preventDefault();let t=B(h),n=B(g);if(N(h,void 0),N(g,void 0),t===void 0||n===void 0)return;let r=sse(t,n);r!==void 0&&await v(t,r)}),go(`dragend`,l,()=>{N(h,void 0),N(g,void 0)}),_o(`keydown`,f,async e=>{let t=ase({key:e.key,index:B(i),length:n().length,rtl:Pc()});t!==-1&&(e.preventDefault(),await v(B(i),t))}),Xo(l,()=>_u,()=>({duration:200})),W(e,l)}),O(x);var S=L(x,2),C=e=>{{let r=j(()=>a()||o());yu(e,_s(()=>l,{get disabled(){return B(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{B(m)!==void 0&&(n([...n(),B(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:B(m)}})),N(m,void 0))},get value(){return B(m)},set value(e){N(m,e,!0)},children:(e,n)=>{var r=U();Ro(F(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>B(t).label,r=()=>B(t).value,i=()=>B(t).searchValue;var a=U(),o=F(a),s=e=>{nu(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=j(()=>!B(d).has(r()));K(o,e=>{B(c)&&e(s)}),W(e,a)}),W(e,r)},$$slots:{default:!0}}))}};K(S,e=>{(typeof r()!=`number`||n().lengthN(p,e),()=>B(p)),z(e=>{b=rs(y,1,`sui select-tags ${t.class??``}`,`svelte-c0or8s`,b,{disabled:a()||o()}),J(y,`hidden`,i()),J(x,`aria-label`,e)},[()=>X(`_sui.select_tags.selected_options`)]),W(e,y),A()}vo([`keydown`]);var bu=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},mse=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(bu(e),bu(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},xu=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),Su=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t){let{prevKey:n,nextKey:r}=_l(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},hse=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=Cu(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},wu=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,gse=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a`),bse=V(` `),xse=V(`
`),Sse={hash:`svelte-6vjmsg`,code:`.slider.svelte-6vjmsg {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-6vjmsg:hover .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-hover-background-color);}.slider.svelte-6vjmsg:active .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-6vjmsg .base-bar:where(.svelte-6vjmsg), .slider.readonly.svelte-6vjmsg:is(:where(.svelte-6vjmsg):hover, :where(.svelte-6vjmsg):active) .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-6vjmsg .base:where(.svelte-6vjmsg), +.slider.readonly.svelte-6vjmsg [role=slider]:where(.svelte-6vjmsg) {cursor:default;}.slider.readonly.svelte-6vjmsg:not(.invalid) .slider-bar:where(.svelte-6vjmsg) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-6vjmsg:not(.invalid) [role=slider]:where(.svelte-6vjmsg) {border-color:var(--sui-readonly-accent-color);}.base.svelte-6vjmsg {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-6vjmsg {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-6vjmsg {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-6vjmsg .slider-bar:where(.svelte-6vjmsg) {background-color:var(--sui-error-border-color);}[role=slider].svelte-6vjmsg {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-6vjmsg::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-6vjmsg:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-6vjmsg:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-6vjmsg [role=slider]:where(.svelte-6vjmsg) {border-color:var(--sui-error-border-color);}.label.svelte-6vjmsg {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-6vjmsg:dir(ltr) {transform:translateX(-50%);}.label.svelte-6vjmsg:dir(rtl) {transform:translateX(50%);}`};function Cse(e,t){k(t,!0),q(e,Sse);let n=Y(t,`value`,15,0),r=Y(t,`min`,3,0),i=Y(t,`max`,3,100),a=Y(t,`sliderLabel`,3,``),o=Y(t,`ariaLabelledby`,3,void 0),s=Y(t,`values`,15,void 0),c=Y(t,`sliderLabels`,3,void 0),l=Y(t,`step`,3,1),u=Y(t,`optionLabels`,19,()=>[]),d=Y(t,`hidden`,3,!1),f=Y(t,`disabled`,3,!1),p=Y(t,`readonly`,3,!1),m=Y(t,`invalid`,3,!1),h=gs(t,vse),g=j(()=>Array.isArray(s())),_=M(void 0),v=M(0),y=M(na([])),b=M(na([])),x=e=>{if(u().length!==B(b).length||e===void 0)return;let t=B(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=M(0),C=M(0),w=na([0,0]),T=M(!1),ee=M(0),E=M(0),te=(e,r)=>{let i=s();(B(g)?i[e]:n())!==r&&(B(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},ne=e=>{let t=Su(B(y),xu(e,B(v),Pc()));B(g)&&wu({valueIndex:B(E),targetPosition:B(y)[t],sliderPositions:w})||te(B(E),B(b)[t])},re=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=B(g)?s()[t]:n(),d=Pc(),m=hse({key:r,rtl:d,currentIndex:gse({valueList:B(b),value:u,decreasing:r===`PageDown`||Cu(r,d)===-1}),length:B(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),B(g)&&wu({valueIndex:t,targetPosition:B(y)[m],sliderPositions:w})||te(t,B(b)[m]))},ie=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!B(T)||n!==B(ee))return;e.preventDefault(),e.stopPropagation();let r=t-B(C),i=B(S)+r;ne(i)},ae=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!B(T)||t!==B(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=B(_).getBoundingClientRect(),n=e.clientX-t.left;ne(n)}r.releasePointerCapture(t),N(T,!1),N(S,0),N(C,0),N(ee,0),N(E,0),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)},oe=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),N(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=B(_).getBoundingClientRect();N(S,n-s.left),N(C,r,!0),N(ee,i,!0),N(E,t??(B(g)?_se(w,xu(B(S),B(v),Pc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ie),document.addEventListener(`pointerup`,ae),document.addEventListener(`pointercancel`,ae)},se=e=>B(y)[Su(B(b),e)]??0,ce=()=>{if(B(g)){let[e,t]=s();w[0]=se(e),w[1]=se(t)}else w[0]=se(n())},le=()=>{B(_)&&(N(v,B(_).clientWidth,!0),(e=>{N(b,e.valueList,!0),N(y,e.positionList,!0)})(mse({min:r(),max:i(),step:l(),barWidth:B(v)})),ce())};vs(()=>{let e=new ResizeObserver(()=>le()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(B(_)),t.addEventListener(`change`,le),le(),()=>{e.disconnect(),t.removeEventListener(`change`,le),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)}}),R(()=>{n(),s(),ce()}),R(()=>{r(),i(),l(),co(le)});var ue=xse();go(`click`,ia.body,()=>{N(T,!1)}),us(ue,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[cs]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-6vjmsg`);var de=P(ue),fe=L(P(de),2);let pe;var me=L(fe,2);let he;var ge=L(me,2),_e=e=>{var t=yse();let n;z(e=>{J(t,`tabindex`,f()?-1:0),J(t,`aria-label`,c()?.[1]||void 0),J(t,`aria-hidden`,d()),J(t,`aria-disabled`,f()),J(t,`aria-readonly`,p()),J(t,`aria-invalid`,m()),J(t,`aria-valuemin`,r()),J(t,`aria-valuemax`,i()),J(t,`aria-valuenow`,s()?.[1]),J(t,`aria-valuetext`,e),n=as(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),_o(`pointerdown`,t,e=>oe(e,1)),_o(`keydown`,t,e=>re(e,1)),W(e,t)};K(ge,e=>{B(g)&&e(_e)});var ve=L(ge,2),ye=e=>{var t=U();Ro(F(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=bse();let i;var a=I(r,!0);z(()=>{i=as(r,``,i,{"inset-inline-start":`${B(v)/(u().length-1)*B(n)}px`}),G(a,B(t))}),W(e,r)}),W(e,t)};K(ve,e=>{u().length&&e(ye)}),O(de),ms(de,e=>N(_,e),()=>B(_)),O(ue),z(e=>{pe=as(fe,``,pe,{"inset-inline-start":`${B(g)?w[0]:0}px`,width:`${B(g)?w[1]-w[0]:w[0]}px`}),J(me,`tabindex`,f()?-1:0),J(me,`aria-label`,(B(g)?c()?.[0]:a())||void 0),J(me,`aria-labelledby`,B(g)?void 0:o()),J(me,`aria-hidden`,d()),J(me,`aria-disabled`,f()),J(me,`aria-readonly`,p()),J(me,`aria-invalid`,m()),J(me,`aria-valuemin`,r()),J(me,`aria-valuemax`,i()),J(me,`aria-valuenow`,B(g)?s()?.[0]:n()),J(me,`aria-valuetext`,e),he=as(me,``,he,{"inset-inline-start":`${w[0]}px`})},[()=>x(B(g)?s()?.[0]:n())]),_o(`pointerdown`,de,e=>oe(e)),_o(`pointerdown`,me,e=>oe(e,0)),_o(`keydown`,me,e=>re(e,0)),W(e,ue),A()}vo([`pointerdown`,`keydown`]);var wse=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),Tse=V(``),Ese={hash:`svelte-1kefyv2`,code:`button.svelte-1kefyv2 {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1kefyv2:focus-visible {outline:0;}button.svelte-1kefyv2:focus-visible span:where(.svelte-1kefyv2) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1kefyv2 {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2), button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2), button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before, button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1kefyv2 {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1kefyv2::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function Tu(e,t){k(t,!0),q(e,Ese);let n=Y(t,`checked`,15,!1),r=Y(t,`label`,3,void 0),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=Y(t,`ariaLabel`,3,void 0),u=gs(t,wse);var d=Tse(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};us(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1kefyv2`);var p=L(P(d),2),m=e=>{var t=H();z(()=>G(t,r())),W(e,t)},h=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(p,e=>{r()?e(m):e(h,-1)}),O(d),W(e,d),A()}var Dse=new Set([`$$slots`,`$$events`,`$$legacy`]);function Eu(e,t){let n=gs(t,Dse);Xl(e,_s(()=>n,{role:`cell`,kind:`table-cell`}))}var Ose=new Set([`$$slots`,`$$events`,`$$legacy`]);function kse(e,t){let n=gs(t,Ose);Xl(e,_s(()=>n,{role:`row`,kind:`table-row`}))}var Ase=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),jse=V(`
`),Mse={hash:`svelte-1hmxz0`,code:`.table.svelte-1hmxz0 {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-1hmxz0 {border-collapse:collapse;}.table.data.svelte-1hmxz0 :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Nse(e,t){q(e,Mse);let n=Y(t,`ariaLabel`,3,void 0),r=gs(t,Ase);var i=jse();us(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1hmxz0`),Uo(P(i),()=>t.children??jr),O(i),W(e,i)}var Pse=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),Fse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),Ise=V(`
`),Lse={hash:`svelte-1eozzeg`,code:`.tab-list.svelte-1eozzeg {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-1eozzeg {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-1eozzeg button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-1eozzeg .indicator:where(.svelte-1eozzeg) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-1eozzeg {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-1eozzeg button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-1eozzeg .indicator:where(.svelte-1eozzeg) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-1eozzeg button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-1eozzeg {display:contents;}.indicator.svelte-1eozzeg {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function Rse(e,t){k(t,!0),q(e,Lse);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`name`,3,void 0),o=Y(t,`ariaLabel`,3,void 0),s=gs(t,Fse),c=M(void 0),l=M(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=B(c)?.querySelector(`[role="tab"][aria-selected="true"]`);N(l,e?Pse(e):void 0,!0)})};vs(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(B(c)),t.observe(B(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=Ise(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};us(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-1eozzeg`);var m=P(d);Uo(P(m),()=>t.children??jr),O(m);var h=L(m,2);O(d),ms(d,e=>N(c,e),()=>B(c)),$o(d,El),z(()=>{m.inert=r(),as(h,B(l))}),W(e,d),A()}var zse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Bse=V(`
`),Vse={hash:`svelte-129mcam`,code:`.tab-panel.svelte-129mcam {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-129mcam, .tab-panel.svelte-129mcam:not([aria-hidden]) {display:none;}`};function Hse(e,t){q(e,Vse);let n=gs(t,zse);var r=Bse();us(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-129mcam`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var Use=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function Wse(e,t){let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`selected`,3,!1),a=gs(t,Use);ll(e,_s(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var n=U();Uo(F(n),()=>t.endIcon??jr),W(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var Du=[],Gse=()=>(Du.splice(0,Du.length,...Du.filter(e=>e.isConnected&&e.matches(`:modal`))),Du.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),Ou=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},ku=e=>{let t=Gse();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},Kse=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},Au,ju=0,Mu=e=>{let{target:t,newState:n}=e;Au&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!Du.includes(t)&&(Du.push(t),ku(Au),Ou(Au))},Nu=e=>{let{target:t}=e;if(!Au||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=Du.indexOf(t);n>-1&&Du.splice(n,1),t.contains(Au)&&ku(Au)&&!Au.matches(`:popover-open`)&&Ou(Au)},qse=()=>(ju+=1,Au||(Au=document.createElement(`div`),Au.setAttribute(`role`,`none`),Au.className=`sui toast-base enabled`,Au.popover=`manual`,Du.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,Mu,!0),document.addEventListener(`beforetoggle`,Nu,!0),document.addEventListener(`close`,Nu,!0)),ku(Au),Au),Jse=()=>{--ju,ju>0||!Au||(document.removeEventListener(`toggle`,Mu,!0),document.removeEventListener(`beforetoggle`,Nu,!0),document.removeEventListener(`close`,Nu,!0),Au.remove(),Au=void 0,Du.length=0)},Yse=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Xse=V(`
`),Zse={hash:`svelte-1eyhuzs`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-1eyhuzs {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;} +@starting-style {.toast.svelte-1eyhuzs {opacity:0;} +}.toast.svelte-1eyhuzs {pointer-events:auto;}.toast[aria-hidden=true].svelte-1eyhuzs {display:block;opacity:0;pointer-events:none;} +@supports (interpolate-size: allow-keywords) {.toast.svelte-1eyhuzs {interpolate-size:allow-keywords;} + @starting-style {.toast.svelte-1eyhuzs {margin-block:0;height:0;} + }.toast[aria-hidden=true].svelte-1eyhuzs {margin-block:0;height:0;} +}.toast.svelte-1eyhuzs:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function Pu(e,t){k(t,!0),q(e,Zse);let n=Y(t,`show`,15,!1),r=Y(t,`id`,3,void 0),i=Y(t,`duration`,3,5e3),a=Y(t,`position`,7,`auto`),o=gs(t,Yse),s=M(void 0),c=M(void 0),l=M(!1),u=M(!1),d=j(()=>B(l)||B(u)),f=M(!1);vs(()=>(N(s,qse(),!0),()=>{B(c)?.remove(),Jse()})),vs(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),R(()=>{if(!B(s)||!B(c))return;if(!B(f)){B(c).remove(),N(l,!1),N(u,!1),!B(s).querySelector(`.toast`)&&B(s).matches(`:popover-open`)&&B(s).hidePopover();return}ku(B(s));let e=Kse(B(s),a());a().startsWith(`top-`)?e.prepend(B(c)):e.append(B(c)),Ou(B(s))}),R(()=>{if(n()){N(f,!0);return}let e=globalThis.setTimeout(()=>{N(f,!1)},250);return()=>{globalThis.clearTimeout(e)}}),R(()=>{if(r(),n(),i(),B(d),!n()||!i()||B(d))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var p=Xse(),m=()=>{N(l,!0)},h=()=>{N(l,!1)},g=()=>{N(u,!0)},_=e=>{N(u,!!e.relatedTarget&&!!B(c)?.contains(e.relatedTarget),!0)};us(p,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:m,onpointerleave:h,onfocusin:g,onfocusout:_}),void 0,void 0,void 0,`svelte-1eyhuzs`);var v=P(p),y=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(v,e=>{B(f)&&e(y)}),O(p),ms(p,e=>N(c,e),()=>B(c)),W(e,p),A()}var Fu="```",Qse=(e,t)=>t?`${Fu}${e}\n${t}\n${Fu}`:`${Fu}${e}\n${Fu}`,$se=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?[^\s`]+)?\n(?:(?.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function Iu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Lu(e,...t){throw Iu(e,...t)}function Ru(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ece(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var zu=ece();function tce(){return zu&&`documentMode`in document?document.documentMode:null}var nce=tce();function rce(e){return zu&&e.test(navigator.platform)}function Bu(e){return zu&&e.test(navigator.userAgent)}var Vu=rce(/Mac|iPod|iPhone|iPad/),Hu=Bu(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function ice(){return!(!zu||!(`InputEvent`in window)||nce)&&`getTargetRanges`in new window.InputEvent(`input`)}var Uu=ice();function ace(){return zu&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Wu=ace(),Gu=Bu(/Android/),Ku=Bu(/Version\/[\d.]+.*Safari/)&&!Gu,qu=Bu(/^(?=.*Chrome).*/i),Ju=zu&&Gu&&qu,Yu=Bu(/AppleWebKit\/[\d.]+/)&&Vu&&!qu;function oce(){return 2047}var sce=oce(),Xu=Ku||Wu||Yu?`\xA0`:`​`,Zu=` -`,qu=Lu?`\xA0`:Gu,Ju=`֑-߿יִ-﷽ﹰ-ﻼ`,Yu=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;function Xu(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var tce=Xu(Yu,Ju),nce=Xu(Ju,Yu),Zu={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Qu={directionless:1,unmergeable:2},$u={center:2,end:6,justify:4,left:1,right:3,start:5};function ed(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var td=ed($u),nd={normal:0,segmented:2,token:1},rd=ed(nd),rce=Symbol.for(`@lexical/ctrlOrOtherKey`),id=`$config`;function ad(){return Pv()._blockCursorElement}function od(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var ice=Wu||zu||Vu;function sd(){let e=bv().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function cd(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var ld=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&Mu(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Mu(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Mu(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=ud(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=ud(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function ud(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var dd=class e extends ld{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;od(t);)e=t,t=t.nextSibling;cd(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===ad()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;od(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===ad()&&(t=t.previousSibling);return cd(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(sd(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(sd(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&od(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&ice;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=bv().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),n.insertBefore(i,r),e){let e=bv().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=ad(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;en){o+=1;break}}return[e.getParentOrThrow(),o]}};function fd(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&Mu(225),n.reverse()}function ace(){let e;try{e=`0.52.0+prod.esm`}catch{}return e??`"+source"`}var pd=ace(),md=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},hd=null;function gd(e,t=1e3){return e instanceof _d?e.clone():e.sizethis._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===hd?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==hd&&n!==void 0||(this._size++,n===hd&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,hd),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==hd&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===hd||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},vd=!1;function oce(e,t,...n){let r=vd,i;try{vd=e,i=t()}finally{vd=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||Mu(421),i}function sce(){return vd}function yd(e){let t=e.exportJSON(vd),n=e.constructor;return t.type!==n.getType()&&Mu(130,n.name),$(e)&&!Array.isArray(t.children)&&Mu(59,n.name),t}function bd(e,t,n,r,i,a){if($(e)){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(($(o)||ny(o)&&o.__slots!==null)&&bd(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of ny(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&ry(e)&&e.__slotHost===t&&(($(e)||ny(e)&&e.__slots!==null)&&bd(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var xd=!1,Sd=0;function cce(e){Sd=e.timeStamp}function Cd(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&T_(e,n)!==void 0}function lce(e,t,n){let r=hv(iv(n)),i=r&&Cv(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&z_(t,s,a,o,!1)}function uce(e,t,n){if(Z(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return m_(t)&&n.isAttached()}function dce(e,t,n){for(let r=e;r&&!hue(r);r=X_(r)){let e=T_(r,t);if(e!==void 0){let t=S_(e,n);if(t)return vg(t)||!Ov(r)?void 0:[r,t]}}}function wd(e,t,n){xd=!0;let r=performance.now()-Sd>100;try{mg(e,()=>{let i=Q()||function(e){return e.read(`latest`,()=>{let e=Q();return e===null?null:e.clone()})}(e),a=new Map,o=e._editorState,s=e._blockCursorElement,c=!1,l=``;for(let n=0;n0){let t=0;for(let i=0;i0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let u=n.takeRecords();if(u.length>0){for(let t=0;t{wd(e,t,n)})}function Dd(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Od(e,t){return Dd(e,t,e.defaultValue)}function kd(e){return typeof e==`object`&&!!e}function Ad(e,t){let n=Fd(e,t).getter;return kd(n)&&n.getterTable!==void 0||Mu(405,t),Pd(n.getterTable)}function jd(e,t){let n=Fd(e,t).setter;return kd(n)&&n.setterTable!==void 0||Mu(406,t),Pd(n.setterTable)}function Md(e,t,n){let{meta:r}=Fd(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Pd(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:Mu(407,t,String(n))}function Nd(e,t){let n=Fd(e,t),{setter:r}=n;kd(r)&&r.setterTable!==void 0||Mu(408,t);let i=String(n.defaultValue);return Hd(r.setterTable,i)||Mu(409,t,i),r.setterTable[i]}function Pd(e){return Object.assign(Object.create(null),e)}function Fd(e,t){let n=e.get(t);return n===void 0&&Mu(410,t),n}function Id(e,t,n,r,i){i!==void 0&&fce.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Rd(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var fce=new WeakSet,Ld=new WeakSet;function pce(e){return typeof e==`object`&&e&&Ld.add(e),e}function Rd(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Ld.has(e)){Object.freeze(e);for(let t of Object.values(e))Rd(t)}}function zd(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Bd(e,t){return n=>t(n)||Vd(e,n)}function Vd(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Vd(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Od(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function Hd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ud(e=``){return Id(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var mce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Wd(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&mce.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Id(t=>{let n=o(t);return r&&s(n)?i!==void 0&&na?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function Gd(e=!1){return Id(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Kd(e,...t){let n=pce(t.length===0?e[0]:t[0]),r=new Set(e);return Id(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function qd(e,t={}){let{defaultAsNull:n}=t;return Id(t=>{if(t==null)return null;let r=e(t);return n&&Od(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,zd(e),Bd(e,e=>e==null))}function Jd(e,t={}){let{omitDefault:n}=t;return Id(t=>{if(t===void 0)return;let r=e(t);return n&&Od(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,zd(e),Bd(e,e=>e===void 0))}function Yd(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Xd(e,t){let n=e=>typeof e==`string`&&Hd(t,e);return Id(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Vd(e,t))}function hce(e){return Id(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;rArray.isArray(e))}function Zd(e,t){return $d(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}})}function Qd(e,t){return $d(0,e,t)}function $d(e,t,n){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var gce=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;schema;constructor(e,t){this.key=e;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||yce).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Dd(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function ef(e,t){return new gce(e,t)}function tf(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function nf(e,t,n){let r;if(Yh(),typeof n==`function`){let i=e.getLatest(),a=tf(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return af(i).updateFromKnown(t,r),i}function _ce(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Xv(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var rf=new Set([`__proto__`,`constructor`,`prototype`]),vce=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return sf(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(rf.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=sf(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(rf.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function af(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new vce(t,function(e){return e.__state?e.__state.sharedNodeState:a_(Pv(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function of(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&af(e).updateFromJSON(r),n}function sf(e){if(e)for(let t in e)return e}function yce(e){return e}function cf(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function lf(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function uf(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function df(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&cf(n,e,t)||t&&cf(n,t,e)||e&&lf(n,e,t)||t&&lf(n,t,e))}(c,l))}function ff(e,t){let n=e.mergeWithSibling(t),r=Qh()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function pf(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(df(t,r)){r=ff(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(df(r,n)){r=ff(r,n);break}break}n.remove()}}else r.remove()}function mf(e){return hf(e.anchor),hf(e.focus),e}function hf(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),X(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!$(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var gf=Symbol.for(`@lexical/CachedTextSize`);function _f(e,t){return Nf.read(()=>{let n=0,r=e;for(let e=0;e0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${xce}))`),U_(e,`class`),U_(e,`style`)}function Gf(e,t){let n=e.style;t===0?Uf(n,``):t===1?Uf(n,`left`):t===2?Uf(n,`center`):t===3?Uf(n,`right`):t===4?Uf(n,`justify`):t===5?Uf(n,`start`):t===6&&Uf(n,`end`),U_(e,`style`)}function Kf(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(bg(e))return null;let n=e.getParent();return n===null||cv(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function qf(e){let t=bv().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function Jf(e,t,n){t||e.contentEditable===`false`?gue(n,bf):n.removeAttribute(`contenteditable`)}function Yf(e,t,n){let r=Sf,i=Ef();Sf=``;let a=``,o=vg(e);for(let[r,i]of n){let n=qf(r);Jf(t,o,n),t.appendChild(n),Sf=``;let s=Ef();ep(i,Iv(e,n,bf)),Df(s),Zf(e,r,t,n),a+=Sf}return Df(i),Sf=r,a}function Xf(e){return ny(e)&&e.__slots!==null?e.__slots:ty}function Zf(e,t,n,r){let i=Rf.$getSlotTargetElement(e,t,n,bf);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function Qf(e){let t=Ff.get(e);return t===void 0?null:t.parentElement}function $f(e,t,n){let r=Xf(e),i=Xf(t);for(let[e,t]of r)if(!i.has(e)){let e=Qf(t);Vf(t,null),e!==null&&e.remove()}let a=Sf,o=Ef(),s=``,c=null,l=vg(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:Qf(i);Sf=``;let u=Ef();if(o===null){o=qf(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),ep(a,Iv(t,o,bf))}else i===a?np(a,o):(i!==void 0&&Vf(i,o),ep(a,Iv(t,o,bf)));if(Df(u),Jf(n,l,o),Zf(t,e,n,o),s+=Sf,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Df(o),Sf=a,s}function ep(e,t){let n=Pf.get(e);if(n===void 0&&Mu(60),t!==null){let r=Mf.get(e);if(r!==void 0){let i=Ff.get(e);if(i!==void 0){let a=ry(r)?r.__slotHost:null,o=ry(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),np(e,t.element)}}}let r=Rf.$createDOM(n,bf);if(function(e,t,n){let r=n._keyToDOMMap;w_(t,n,e),r.set(e,t)}(e,r,bf),X(n)?r.setAttribute(`data-lexical-text`,`true`):vg(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),Vv(r,{captureSelection:!0})),$(n)){let e=n.__indent,t=n.__size;Kf(r,n),e!==0&&Wf(r,e);let i=Xf(n),a=i.size>0?Yf(n,r,i):``;if(t===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,Sf+=a,i.size>0&&(r.__lexicalSlotTextLength=a.length);else{let e=Sf,o=t-1;if(tp($v(n,Pf),n,0,o,Iv(n,r,bf)),a!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=a+t,Sf=e+a+t}i.size>0&&(r.__lexicalSlotTextLength=a.length)}let o=n.__format;o!==0&&Gf(r,o),n.isInline()||(wce(0,n,r),Cce(n,r))}else{let t=n.getTextContent();if(vg(n)){let t=n.decorate(bf,yf);t!==null&&Ece(e,t),r.contentEditable=`false`;let i=Xf(n);i.size>0&&Yf(n,r,i)}Sf+=t}return t!==null&&t.insertChild(r),Rf.$decorateDOM(n,null,r,bf),vf(n),G_(Lf,xf,kf,n,`created`),r}function tp(e,t,n,r,i){let a=Sf,o=Ef();Sf=``,Cf=null,wf=null,Tf=null;let s=n;for(;s<=r;++s){let t=Ef();ep(e[s],i);let n=Pf.get(e[s]);n!==null&&X(n)?Cf===null&&(Cf=n.getFormat(),wf=n.getStyle(),Tf=n.__key):$(n)&&s0||Xf(n).size>0)?$f(n,r,a):``;if(i){let e=Sf;if(function(e,t,n){var r;Cf=null,wf=null,Tf=null,function(e,t,n){let r=Sf,i=e.__size,a=t.__size;Sf=``;let o=n.element,s=bf._keyToDOMMap.get(t.__key);s===void 0&&Mu(351,t.__key);let c=a-i;if(!zf&&Math.abs(c)<=1&&i>=bce&&e.__first===t.__first&&(c!==0||!bf._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=If.get(e.__key);if(!zf&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,Sf=r+m,Tce(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&Mu(353),Sf=r+e,Tce(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Pf.get(t);if(e===void 0)break;let r=zf||jf.has(t)||Af.has(t),i=Ef();if(r)np(t,o);else{let n,r;if($(e)){r=Ff.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&Mu(354,e.getType()),n=i}else n=e.getTextContent();Sf+=n,r!==void 0&&Of(r)}X(e)?Cf===null&&(Cf=e.getFormat(),wf=e.getStyle(),Tf=e.__key):$(e)&&no,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:bf.getElementByKey(t);tp(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Hf(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=Sf,s.__lexicalFirstTextKey=Tf,Sf=r+Sf}(e,t,Iv(t,n,bf)),cv(t)||(r=t,Cf==null||Cf===r.__textFormat||Bf||r.setTextFormat(Cf),function(e){wf==null||wf===e.__textStyle||Bf||e.setTextStyle(wf)}(t))}(n,r,a),r.isInline()||(bg(r)||wce(0,r,a),Cce(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,Sf=e+s+t,a.__lexicalSlotTextLength=s.length}else(Xf(r).size>0||Xf(n).size>0)&&(a.__lexicalSlotTextLength=0)}else{let e=a.__lexicalTextContent;typeof e!=`string`&&Mu(356,n.getType()),Sf+=e,Of(a)}if((zf||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Kf(a,r),bg(r)&&!zf))for(let e of r.getChildren())$(e)&&Kf(Y_(bf,e.getKey()),e)}else{let t=r.getTextContent();if(vg(r)){let t=r.decorate(bf,yf);t!==null&&Ece(e,t),i&&(Xf(r).size>0||Xf(n).size>0)&&$f(n,r,a)}Sf+=t}if(!Bf&&bg(r)){let e=r.getLatest();if(e.__cachedText!==Sf){let t=e.getWritable();t.__cachedText=Sf,r=t}}return Rf.$decorateDOM(r,n,a,bf),vf(r),a}function Ece(e,t){let n=bf._pendingDecorators,r=bf._decorators;if(n===null){if(r[e]===t)return;n=D_(bf)}n[e]=t}function rp(e){let t=e.nextSibling;return t!==null&&t===bf._blockCursorElement&&(t=t.nextSibling),t}function Dce(e,t){let n=new Set;for(let r=t;r{for(let n of t){let t=Pf.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Af.keys()),t(jf),e}();let o=new Map;return Lf=o,np(`root`,null),bf=void 0,xf=void 0,Af=void 0,jf=void 0,Mf=void 0,Nf=void 0,Pf=void 0,yf=void 0,Ff=void 0,If=void 0,Lf=void 0,Rf=Qg,o}function ip(e){let t=Ff.get(e);return t===void 0&&Mu(75,e),t}function kce(e){return()=>{}}function ap(e){return{type:e}}var op=ap(`SELECTION_CHANGE_COMMAND`),Ace=ap(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),sp=ap(`CLICK_COMMAND`),jce=ap(`BEFORE_INPUT_COMMAND`),Mce=ap(`INPUT_COMMAND`),Nce=ap(`COMPOSITION_START_COMMAND`),Pce=ap(`COMPOSITION_END_COMMAND`),cp=ap(`DELETE_CHARACTER_COMMAND`),lp=ap(`INSERT_LINE_BREAK_COMMAND`),up=ap(`INSERT_PARAGRAPH_COMMAND`),dp=ap(`CONTROLLED_TEXT_INSERTION_COMMAND`),fp=ap(`PASTE_COMMAND`),pp=ap(`REMOVE_TEXT_COMMAND`),mp=ap(`DELETE_WORD_COMMAND`),hp=ap(`DELETE_LINE_COMMAND`),gp=ap(`FORMAT_TEXT_COMMAND`),Fce=ap(`SET_TEXT_FORMAT_COMMAND`),_p=ap(`UNDO_COMMAND`),vp=ap(`REDO_COMMAND`),yp=ap(`KEYDOWN_COMMAND`),bp=ap(`KEY_ARROW_RIGHT_COMMAND`),xp=ap(`MOVE_TO_END`),Sp=ap(`KEY_ARROW_LEFT_COMMAND`),Cp=ap(`MOVE_TO_START`),wp=ap(`KEY_ARROW_UP_COMMAND`),Tp=ap(`KEY_ARROW_DOWN_COMMAND`),Ep=ap(`KEY_ENTER_COMMAND`),Ice=ap(`KEY_SPACE_COMMAND`),Dp=ap(`KEY_BACKSPACE_COMMAND`),Op=ap(`KEY_ESCAPE_COMMAND`),kp=ap(`KEY_DELETE_COMMAND`),Ap=ap(`KEY_TAB_COMMAND`),jp=ap(`INSERT_TAB_COMMAND`),Mp=ap(`INDENT_CONTENT_COMMAND`),Np=ap(`OUTDENT_CONTENT_COMMAND`),Pp=ap(`DROP_COMMAND`),Fp=ap(`FORMAT_ELEMENT_COMMAND`),Ip=ap(`DRAGSTART_COMMAND`),Lp=ap(`DRAGOVER_COMMAND`),Lce=ap(`DRAGEND_COMMAND`),Rp=ap(`COPY_COMMAND`),zp=ap(`CUT_COMMAND`),Bp=ap(`SELECT_ALL_COMMAND`),Rce=ap(`CLEAR_EDITOR_COMMAND`),zce=ap(`CLEAR_HISTORY_COMMAND`),Vp=ap(`CAN_REDO_COMMAND`),Hp=ap(`CAN_UNDO_COMMAND`),Up=ap(`FOCUS_COMMAND`),Bce=ap(`BLUR_COMMAND`),Vce=ap(`KEY_MODIFIER_COMMAND`);function Wp(e,t){return{...t,[rce]:e}}var Gp=Wp(`metaKey`,{ctrlKey:!Iu,metaKey:Iu}),Kp=Wp(`altKey`,{altKey:Iu,ctrlKey:!Iu}),qp=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Jp(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Hce=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||Mu(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of qp){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Jp(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Jp(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Jp(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of qp)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function Uce(e){let t=new Hce;for(let n of e)t.add(n);return t}function Wce(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Yp(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}var Xp=Object.freeze({}),Zp,Qp=new WeakMap,$p=new WeakMap,Gce=Wce(e=>(e.addEventListener(`selectionchange`,ym),()=>e.removeEventListener(`selectionchange`,ym)));function em(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=Qh(),u;if(a!==void 0)u=a;else{let e=hv(iv(l));u=e===null?null:Cv(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!X(c)||(!i&&(!Ru||l._inputState.lastBeforeInputInsertTextTimeStamp1||(i||!Ru)&&p!==null&&!c.isComposing()&&d!==Lv(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=f_(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(X(t)||$(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function tm(e,t){return m_(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function nm(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Cv(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,tm(r,i)&&tm(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}mg(t,()=>{if(!n)return void j_(null);if(!c_(t,r,a))return;let c=Q();if(s.postDeleteSelectionToRestore&&Z(c)&&c.isCollapsed()){let e=c.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(c=s.postDeleteSelectionToRestore.clone(),j_(c))}if(s.postDeleteSelectionToRestore=null,Z(c)){let n=c.anchor,l=n.getNode();if(c.isCollapsed()){e.type===`Range`&&r===a&&(c.dirty=!0);let i=iv(t).event,o=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:p,timeStamp:m}=s.collapsedSelectionFormat,h=k_(),g=!1===t.isComposing()&&h.getTextContent()===``;if(o{let n=Q(),r=hv(iv(t)),i=Eh();if(r){if(Z(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!bg(t)&&k_().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=Cv(r,t._rootElement).anchorNode;(Ov(n)||m_(n))&&j_(Th(i,r,t,e))}}if(Lu&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e{Hv(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function am(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function om(e){let{lastKeyCode:t}=Qh()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?` -`:t===`Tab`?` `:null;if(!n)return;let r=Q();if(!Z(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!X(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===` -`){if(zu)return;if(Og(e))e.selectEnd();else if(!e){let e=Qv(i,xh),t=e&&e.getNextSibling();$(t)&&t.selectStart()}}else n===` `?Ym(e)&&e.selectEnd():X(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function sm(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function cm(e){Iu&&!zu&&Hu&&(sm(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>sm(e),0))}function lm(e,t){let n=Ev(e);if(Ov(n)&&Hv(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Tv(r.ownerDocument);return i!==null&&r.contains(i)&&Hv(i,t)}function Jce(e){let t=e.inputType,n=am(e),r=Qh(),i=r._inputState,a=Q();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(sm(i),e.preventDefault(),Z(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Eh();if(!Z(e))return!0;j_(e.clone())}if(Z(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t{mg(r,()=>{b_(null)})},30),Z(a)){let e=a.anchor.getNode();e.markDirty(),X(e)||Mu(142),im(a,e)}}else{if(b_(null),zu&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Uu&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!vg($le(a.anchor,!0))),!u){J_(r,cp,!0);let e=Q();Uu&&Z(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Z(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),J_(r,t===`historyUndo`?_p:vp)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&R_(!1,r,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||bg(a.anchor.getNode())||n===null||a.applyDOMRange(n),i.unprocessedBeforeInputData=null;let s=a.anchor,c=a.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===` -`)e.preventDefault(),J_(r,lp,!1);else if(o===Ku)e.preventDefault(),J_(r,up);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&em(a,n,o,e.timeStamp,!0)?(e.preventDefault(),J_(r,dp,o),om(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:J_(r,dp,e),om((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;b_(null),t||J_(r,dp,e),um(n);break}case`insertLineBreak`:b_(null),i.isInsertLineBreak=!1,J_(r,lp,!1);break;case`insertParagraph`:b_(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,J_(r,lp,!1)):J_(r,up);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:J_(r,fp,e);break;case`deleteByComposition`:(function(e,t){return e!==t||$(e)||$(t)||!f_(e)||!f_(t)})(l,u)&&J_(r,pp,e);break;case`deleteByDrag`:ev(`skip-selection-focus`),J_(r,pp,e);break;case`deleteByCut`:J_(r,pp,e);break;case`deleteContent`:J_(r,cp,!1);break;case`deleteWordBackward`:J_(r,mp,!0);break;case`deleteWordForward`:J_(r,mp,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:J_(r,hp,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:J_(r,hp,!1);break;case`formatStrikeThrough`:J_(r,gp,`strikethrough`);break;case`formatBold`:J_(r,gp,`bold`);break;case`formatItalic`:J_(r,gp,`italic`);break;case`formatUnderline`:J_(r,gp,`underline`);break;case`historyUndo`:J_(r,_p);break;case`historyRedo`:J_(r,vp)}return!0}function Yce(e,t){e.stopPropagation();let n=t._inputState;sm(n),mg(t,()=>{lm(e,t)||t.dispatchCommand(Mce,e)},{event:e}),n.unprocessedBeforeInputData=null}function Xce(e){let t=Qh(),n=t._inputState,r=Q(),i=e.data,a=am(e),o=!1;if(i!=null&&Z(r)){let s=hv(iv(t)),c=s===null?null:Cv(s,t._rootElement),l=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();l&&(n.hadOrphanedCompositionEvents=!0);let u=r.anchor.getNode(),d=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&X(u)&&p_(u);if(!l&&!d&&em(r,a,i,e.timeStamp,!1,c)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=dm(t,i);if(n.compositionPhase=`idle`,e)return ev(`composition-end`),M_(),!0}let a=r.anchor.getNode();if(s===null||c===null)return!0;let l=r.isBackward(),u=l?r.anchor.offset:r.focus.offset,d=l?r.focus.offset:r.anchor.offset;Ru&&!r.isCollapsed()&&X(a)&&c.anchorNode!==null&&a.getTextContent().slice(0,u)+i+a.getTextContent().slice(u+d)===L_(c.anchorNode)||J_(t,dp,i);let f=i.length;Lu&&f>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),Uu&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,b_(null))}}return o||(R_(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(dm(t,i||void 0),ev(`composition-end`),n.compositionPhase=`idle`)),M_(),!0}function Zce(e,t){J_(t,Nce,e)}function Qce(e){let t=Qh(),n=t._inputState,r=Q();if(Z(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(b_(i.key),ev(`composition-start`),e.timeStamp{dm(t,n.compositionEndData)}),n.compositionPhase=`idle`,n.compositionEndData=``,r)return!0}let r=t._keyDownShortcuts;r===null&&(r=Uce(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{J_(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),J_(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!zu||r.isShiftKeyDown),J_(n,Ep,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:Gp,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Z(r)||(e.preventDefault(),J_(n,t,e))}});return[e(`ArrowRight`,hm,bp),e(`ArrowLeft`,hm,Sp),e(`ArrowUp`,gm,wp),e(`ArrowDown`,gm,Tp),n({...fm,shiftKey:!0},!0),n({...fm,shiftKey:!1},!1),e(` `,fm,Ice),{key:`Backspace`,modifiers:hm,onMatch:(e,t)=>{J_(t,Dp,e)&&cm(t._inputState)}},e(`Escape`,fm,Op),e(`Delete`,{},kp),t(`Backspace`,Kp,mp,!0),t(`Delete`,Kp,mp,!1),t(`b`,Gp,gp,`bold`),t(`u`,Gp,gp,`underline`),t(`i`,Gp,gp,`italic`),e(`Tab`,hm,Ap),t(`z`,Gp,_p,void 0),t(`z`,{...Gp,shiftKey:!0},vp,void 0),...Iu?[{key:`o`,modifiers:pm,onMatch:(e,t)=>{e.preventDefault(),J_(t,lp,!0)}},e(`ArrowLeft`,{metaKey:!0,...hm},Cp),e(`ArrowRight`,{metaKey:!0,...hm},xp),t(`h`,pm,cp,!0),t(`d`,pm,cp,!1),t(`Backspace`,mm,hp,!0),t(`Delete`,mm,hp,!1),t(`k`,pm,hp,!1)]:[e(`Home`,hm,Cp),e(`End`,hm,xp),t(`y`,pm,vp,void 0)],{key:`a`,modifiers:Gp,onMatch:(e,t)=>{e.preventDefault(),J_(t,Bp,e)&&cm(t._inputState)}},r(`c`,Rp),r(`x`,zp)]}()),t._keyDownShortcuts=r);let i=r.match(e);return i&&i.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Vce,e),!0}function _m(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var vm=new Map;function ym(e){let t=tue(e.target);if(t===null)return;let n=Z_(e.target),r=null,i=null,a=n===null?void 0:$p.get(n);if(n!==null){if(a!==void 0){let e=a.editors,n=a.hasShadowEditor;if(n===void 0){n=!1;for(let t of e)if(t._rootElement!==null&&gv(t._rootElement.getRootNode())){n=!0;break}a.hasShadowEditor=n}if(n){let n=null,a=null;for(let o of e){let e=o._rootElement;if(e===null)continue;let s=Cv(t,e).anchorNode;if(s!==null&&u_(s)===o){if(gv(e.getRootNode())){r=o,i=s;break}n===null&&(n=o,a=s)}}r===null&&n!==null&&(r=n,i=a)}else{let e=t.anchorNode;e===null||Ov(e)&&e.shadowRoot!==null||(r=u_(e),r!==null&&(i=e))}}if(r===null){let e=Tv(n);r=e===null?null:u_(e)}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let e of a.editors)e._inputState.isSelectionChangeFromMouseDown=!1;mg(r,()=>{let n=Eh(),a=i??Cv(t,r._rootElement).anchorNode;(Ov(a)||m_(a))&&j_(Th(n,t,r,e))})}let o=F_(r),s=o[o.length-1],c=s._key,l=vm.get(c),u=l||s;u!==r&&nm(t,u,!1),nm(t,r,!0),r===s?l&&vm.delete(c):vm.set(c,r)}function bm(e){e._lexicalHandled=!0}function xm(e){return!0===e._lexicalHandled}var Sm=kce();function Cm(e,t,n){Yh();let r=e.__key,i=e.getParent();if(i===null)return void(iy(e)!==null&&Mu(367,r,String(iy(e))));let a=function(e){let t=Q();if(!Z(t)||!$(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return nv(i,e)&&n.set(e.__key,0,`element`),nv(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Z(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Ah(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Ah(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ih(a)&&t&&e.isSelected()&&e.selectPrevious();if(Z(a)&&t&&!o&&Dh(a,i)){let t=e.getIndexWithinParent();v_(e),Oh(a,i,t,-1)}else v_(e);n||cv(i)||i.canBeEmpty()||!i.isEmpty()||Cm(i,t),t&&a&&bg(i)&&i.isEmpty()&&i.selectEnd()}function wm(e){return e}var Tm=Symbol.for(`ephemeral`);function Em(e){return e[Tm]||!1}var Dm={configurable:!0,enumerable:!1,value:void 0,writable:!0},Om=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Yv(this);return e===void 0&&Mu(64,this.name),e}static clone(e){Mu(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||ey(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Dm),Object.defineProperty(this,gf,Dm),__(this,e)}getType(){return this.__type}isInline(){Mu(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=S_(e);if(t===null)break;e=t.__parent===null?iy(t):t.__parent}return!1}isSelected(e){let t=e||Q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(X(this))return n;if(Z(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(vg(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:S_(e)}getParentOrThrow(){let e=this.getParent();return e===null&&Mu(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(cv(t)||iy(e)!==null)return $(e)||e===this&&vg(e)||Mu(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&Mu(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:S_(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:S_(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Vy(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?Ry(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&Mu(279),!1)))}isParentOf(e){return nv(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=$(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&Mu(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=Qh()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Em(this))return this;let e=S_(this.__key);return e===null&&Mu(113),e}getWritable(){if(Em(this))return this;Yh();let e=Zh(),t=Qh(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return y_(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&Mu(113);let c=pue(s);return r.set(n,c),o.set(n,c),y_(c),c}getTextContent(){return my(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Mu(70)}updateDOM(e,t,n){Mu(71)}getDOMSlot(e){return new ld(e)}exportDOM(e){return{element:Fv(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=Kv(Gv(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return $(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i=n&&a<=r&&Number.isInteger(a)?a:t}var ile=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jm(t.indent,0,0,1/0),e.__textFormat=Am(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function ale(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var ole=e=>{let t=Ad(e,`mode`),n=Md(e,`detail`,0),r=Md(e,`format`,0),i=jd(e,`mode`),a=Nd(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:Am(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:Am(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:ale}},sle=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jm(t.indent,0,0,1/0),e.__textFormat=Am(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},cle=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),lle=e=>{let t=Ad(e,`mode`),n=Md(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:Am(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}};function Mm(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Nm(e,t,n=``){if(t===n)return;let r=Mm(n),i=Mm(t);for(let t in i)delete r[t],ule(e,t,i[t]);for(let t in r)e.removeProperty(t)}var dle=Yd()({detail:Zd(Xd(Wd(),Qu),{field:`__detail`}),format:Zd(Xd(Wd(),Zu),{field:`__format`}),mode:Zd(Kd([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:rd,setterTable:nd}),style:Zd(Ud(),{field:`__style`}),text:Zd(Ud(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function Pm(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function Fm(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Im(e,t,n,r,i){let a=r.classList,o=W_(i,`base`);o!==void 0&&a.add(...o),o=W_(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Zu){let r=Zu[e];if(o=W_(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}U_(r,`class`)}function Lm(e,t,n){let r=n.isComposing(),i=e+(r?Gu:``),a=Pv(),o=Fv(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(bv().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Lu){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i({conversion:hle,priority:0}),b:()=>({conversion:ple,priority:0}),code:()=>({conversion:Wm,priority:0}),em:()=>({conversion:Wm,priority:0}),i:()=>({conversion:Wm,priority:0}),mark:()=>({conversion:Wm,priority:0}),s:()=>({conversion:Wm,priority:0}),span:()=>({conversion:fle,priority:0}),strong:()=>({conversion:Wm,priority:0}),sub:()=>({conversion:Wm,priority:0}),sup:()=>({conversion:Wm,priority:0}),u:()=>({conversion:Wm,priority:0})},json:dle})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return rd[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===x_()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Zu[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return g_(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Pm(0,n),i=Fm(0,n),a=r===null?i:r,o=bv().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=bv().createElement(i),o.appendChild(s)),Rm(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Nm(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Pm(0,i),s=Pm(0,a),c=Fm(0,i),l=Fm(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??Mu(48);let i=bv().createElement(l);return Rm(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??Mu(49)),Lm(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Im(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(Nm(t.style,p,f),U_(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return Ov(t)||Mu(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=zm(t,`b`)),this.hasFormat(`italic`)&&(t=zm(t,`i`)),this.hasFormat(`strikethrough`)&&(t=zm(t,`s`)),this.hasFormat(`underline`)&&(t=zm(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Zu[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Qu[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=g_(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=nd[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Yh();let n=e,r=t,i=Q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Z(i))return Sh(o,n,o,r,`text`,`text`);{let e=x_();e!==i.anchor.key&&e!==i.focus.key||b_(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=Q();if(r&&Z(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Yh();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=x_(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;tt&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=Q();if(Z(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Gm(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=uf(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e=S&&(g.set(e.getKey(),b-S,`text`),b=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&y_(t),n!==null&&y_(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Z(v)&&Oh(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Mu(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;x_()===r&&b_(n);let o=Q();if(Z(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Cle(i,t,n,e,a),s!==null&&s.key===r&&Cle(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function fle(e){return{forChild:Km(e.style),node:null}}function ple(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Km(t.style,n?void 0:`bold`),node:null}}var Hm=new WeakMap;function mle(e){if(!Ov(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function hle(e){let t=e;e.parentElement===null&&Mu(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=Hm.get(n))===void 0&&!mle(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Um(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Gm(n)}}function Um(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,Ov(n)){let e=n.style.display;if(e===``&&!jv(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(m_(n))return n;if(n.nodeName===`BR`)return null}}var gle={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Wm(e){let t=gle[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Km(e.style,t),node:null}}function Gm(e=``){return uv(new Vm(e))}function X(e){return e instanceof Vm}function Km(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((X(e)||Bm(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}var _le=Yd()({detail:Qd(Wd(2),{getter:{field:`__detail`},setter:null}),mode:Qd(Kd([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:Qd(Ud(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),qm=class extends Vm{$config(){return this.config(`tab`,{extends:Vm,generated:lle,json:_le})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=W_(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||Mu(286),this}setDetail(e){return e!==2&&Mu(127),this}setMode(e){return e!==`normal`&&Mu(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Jm(){return uv(new qm)}function Ym(e){return e instanceof qm}var vle=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offsete&&(r=e)}else if(!$(t)){let e=t.getNextSibling();if(X(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Qm(e,t){if($(t)){let n=t.getLastDescendant();$(n)||X(n)?Zm(e,n):Zm(e,t)}else Zm(e,t)}function $m(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Gm();if(o.setFormat(n),o.setStyle(r),Xg(a))a.splice(0,0,[o]);else if(a!==null){let e=cv(i)?Yg().append(o):o;a.insertBefore(e)}else if(cv(i)){let e=i.getLastChild();$(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(Yg().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function eh(e,t,n,r){let i=e.anchor.getNode();X(i)||Mu(398);let a=e.anchor.offset,o=Gm(t);o.setFormat(n),o.setStyle(r);let s=i.getParentOrThrow();if(a===0)s.isInline()&&!i.__prev?s.insertBefore(o):i.insertBefore(o,!1);else if(a===i.getTextContentSize())s.isInline()&&!i.__next?s.insertAfter(o):i.insertAfter(o,!1);else{let[e]=i.splitText(a);e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var th=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ih(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>iy(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(X(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;eiy(e)===null);if((Q()||Eh())===this&&e[0]){let t=Ty(e[0],`next`);Pg(Fy(t,t))}for(let t of e)t.remove();nh()}};function nh(){let e=k_();if(e.getChildrenSize()===0&&sy(Q())===null){let t=Yg();e.append(t),t.select()}}function Z(e){return e instanceof rh}var rh=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Z(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(wy(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;$(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Cy(e.focus)&&$(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=ky(e.focus.origin,`previous`);wy(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=jy(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!$(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Bg(e.anchor),r=Bg(e.anchor.getFlipped()),i=e=>Sy(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Hg(Ig(this),`next`));return Jh()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=ch(this),c=``,l=!0;for(let u=0;u($(e)||vg(e))&&!e.isInline())){$(i)||Mu(211,r.constructor.name,r.getType());let[t,n]=Ih(this,!0);($(t)?t:i).splice(n,0,e),a.selectEnd();return}if($(i)&&iy(i)!==null){let[,t]=Ih(this),n=Fh(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}if(i===null){let t=Lh(e),n=t.getLastDescendant(),r=Mg(this.anchor,`next`);for(let e of t.getChildren())r=Kg(e,r);n!==null&&n.selectEnd();return}if($(i)&&!i.isParentRequired()&&!cv(i.getParentOrThrow())){let[,t]=Ih(this),n=Fh(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=Lh(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&$(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Nv(e)&&!cv(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return Og(t)&&Og(t.getPreviousSibling())}(n),u=$(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=Qv(r,Nv));let d=c[c.length-1],f=c[0];var p=f;l||!$(p)||!Nv(p)||p.isEmpty()||!$(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||($(i)||Mu(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&Mu(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||Mu(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=Qv(s,Nv),h=s.selectEnd();u&&($(m)&&(u.canMergeWhenEmpty()||Nv(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),$(i)&&i.isEmpty()&&i.remove();let g=$(i)?i.getLastChild():null;Og(g)&&m!==i&&g.remove();let _=Bg(Mg(h.anchor,`next`));Ng(h.anchor,_),Ng(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&cv(e)){let t=Yg();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Ih(this),n=Qv(this.anchor.getNode(),Nv);if(n!==null&&iy(n)!==null)return null;$(n)||Mu(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=Dg();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=ch(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(X(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(X(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),X(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(Rh(this,e,t,n))return;let r=e===`move`,i=Qh(),a=hv(iv(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!$(c)||c.isInline()||c.canBeEmpty()||mv(o,i,s);let l=Y_(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=X(c)?Lv(c,l,i):null),this.dirty){let e=Y_(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=X(n)?Lv(n,e,i):null}t&&u&&jh(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&X(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=Ty(c,t?`previous`:`next`).getNodeAtCaret();if(X(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?Lv(e,n,i):null;if(r){let e=t?r.length:0;jh(a,r,e,r,e)}}}}if(dh(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=xv(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=bg(o)?o:ov(o);this.applyDOMRange(n),this.dirty=!0,r||(fh(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||uh(this))}n===`lineboundary`&&Rh(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&$(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if($(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=$(n)?n.getNextSibling():null;if(!($(n)&&n.isEmpty()&&$(e)&&e.isShadowRoot()))return}let r=Mg(t,e?`previous`:`next`),i=Ny(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if($(e)&&pv(e)){let t=e.getParent();e.remove();let n=A_(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(wy(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if($(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Bg(t);Fg(this,Fy(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Cy(t)){if($(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(vg(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&$(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=wh();e.add(t.origin.getKey()),j_(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=A_(n,e);r!==null&&r.selectStart()}}return}if(Og(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return ly(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Fg(this,Fy(!t.origin.isEmpty()&&n.isEmpty()?Lg(Ty(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(iy(e)!==null)return;if($(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(ph(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if($(n)){if(n.collapseAtStart(e))return!0;if(cv(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void mh(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void mh(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e0&&(m===p.getTextContentSize()||p_(p)||([p]=p.splitText(m)),p.setFormat(g));for(let e=l+1;e{for(let[t,r]of n)e=g_(e,t,r?Zu[t]:0);return e})}function oh(e,t,n=null){let r=n===null&&Z(e)?g_(e.format,t,null):n;ah(e,e=>g_(e,t,r))}function sh(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ch(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[sh(n),sh(r)]}function lh(e){let t=k_();!t.isEmpty()&&qg(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function uh(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function dh(e,t,n,r,i){let a=r===`character`?Cv(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&tnv(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=$(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function ph(e,t,n){if(Rh(e,`extend`,t,n))return;let r=Qh(),i=hv(iv(r));if(!i||typeof i.modify!=`function`)return;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!$(c)||c.isInline()||c.canBeEmpty()||mv(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&X(t)?Lv(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return;let g=m.offset;if(jh(i,h,g,h,g),dh(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return;let _=xv(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&m_(v)&&u_(v)===r){let e=N_(v);if(vg(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&X(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=Ty(u,t?`previous`:`next`).getNodeAtCaret();if(X(n)){let r=t?n.getTextContentSize()-1:1;e.focus.set(n.__key,r,`text`),e.dirty=!0;return}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return void(r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0))}let[b,x,S,C]=t?[v,y,d,f]:[d,f,v,y],w=bg(u)?u:ov(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:C,startContainer:b,startOffset:x}),e.dirty=!0,!fh(e,t,w)&&t&&uh(e),n===`lineboundary`&&Rh(e,`extend`,t,n,`decorators`)}function ble(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var xle=ble();function mh(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;en||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function hh(e,t,n,r){let i,a=t,o=!1;if(Ov(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),T_(e,r)!==void 0||Hv(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=N_(d),X(i))a=Dy(i,s?`next`:`previous`);else{let c=N_(e);if(c===null)return null;if($(c)){let o=r.getElementByKey(c.getKey());o===null&&Mu(214);let l=Iv(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),$(c)||Mu(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if($(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=$(u)?u:u.getParentOrThrow()),a=0}X(u)?(i=u,c=null,a=Dy(u,s?`next`:`previous`)):u!==c&&s&&!f&&($(c)||Mu(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=ay(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&N_(e)===c){let n=Iv(c,s,r);n.element===s?t===0&&vg(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if($(c))return[Xm(c.__key,a,`element`),o]}}else i=N_(e);return X(i)?[Xm(i.__key,Dy(i,a,`clamp`),`text`),o]:null}function gh(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&$(a)&&a.isInline()){let t=a.getPreviousSibling();X(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else $(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):X(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&$(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&$(a)&&a.isInline()&&!a.canInsertTextAfter()&&a.getTextContentSize()>1){let t=a.getNextSibling();X(t)&&e.set(t.__key,0,`text`)}}}function _h(e){let t=S_(e.key);return t===null?null:oy(t)}function vh(e,t,n){let r=_h(e),i=_h(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;let a=n(r,i);if(r!==null)return $(r)?t.set(r.getKey(),a?r.getChildrenSize():0,`element`):t.set(r.getKey(),a?r.getTextContentSize():0,`text`),!0;let o=ay(i);if(o===null)return!1;let s=o.getParent();if(s===null)return!1;let c=o.getIndexWithinParent();return t.set(s.getKey(),a?c+1:c,`element`),!0}function yh(e){let t=vh(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(n!==null&&r!==null){let e=ay(n),t=ay(r);if(e!==null&&e.is(t)){for(let t of cy(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return e===null||t===null||e.isBefore(t)}if(n!==null){let e=ay(n),r=S_(t.key);return e===null||r===null||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=ay(r),a=S_(e.key);return i!==null&&a!==null&&!i.is(a)&&!i.isParentOf(a)&&a.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function bh(e,t,n,r,i,a){if(e===null||n===null||!c_(i,e,n))return null;let o=hh(e,t,Z(a)?a.anchor:null,i);if(o===null)return null;let s=hh(n,r,Z(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=N_(e),r=N_(n);if(vg(t)&&vg(r))return null}let f=i._slotsUsed&&vh(c,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);gh(e,n,r),gh(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function xh(e){return $(e)&&!e.isInline()}function Sh(e,t,n,r,i,a){let o=Zh(),s=new rh(Xm(e,t,i),Xm(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Ch(){return new rh(Xm(`root`,0,`element`),Xm(`root`,0,`element`),0,``)}function wh(){return new th(new Set)}function Sle(e,t){return Th(null,e,t,null)}function Th(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!xd&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(Z(e)&&!c)return e.clone();{if(t===null)return null;let r=Cv(t,n._rootElement);if(l=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(s||o===void 0)&&Z(e)&&!c_(n,l,u))return e.clone()}let p=bh(l,d,u,f,n,e);if(p===null)return null;let[m,h,g]=p,_=0,v=``;if(Z(e)){let t=e.anchor;if(m.key===t.key)_=e.format,v=e.style;else{let e=m.getNode();X(e)?(_=e.getFormat(),v=e.getStyle()):$(e)&&(_=e.getTextFormat(),v=e.getTextStyle())}}let y=new rh(m,h,_,v);return g&&(y.dirty=!0),y}function Q(){return Zh()._selection}function Eh(){return Qh()._editorState._selection}function Dh(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function Oh(e,t,n,r=1){if(!Dh(e,t))return;let i=e.anchor,a=e.focus,o=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n0||n0||n=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}}else{if($(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if($(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(X(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}}function Ah(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,X(i)?s=`text`:$(i)&&(s=`element`)):(a=r.__key,X(r)?(o=r.getTextContentSize(),s=`text`):$(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Cle(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function jh(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function wle(e,t,n){let r=Y_(e,t.getKey());if($(t)){let i=Iv(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Tle(e,t,n,r,i,a){let o=a.getRootNode(),s=h_(o)||gv(o)?Tv(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&s_(s,s))return;let c=Cv(r,a),l;if(!Z(t))return void(e!==null&&c_(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=wle(n,f,u.offset),[g,_]=wle(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=X(f)?Lv(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Z(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=X(p)?Lv(p,g,n):null),x!==null&&S!==null){if(b&&(e===null||C||Z(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,h,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===_&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:u_(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(jh(r,x,h,S,_),Lu&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=wv(a);if(e===null||!a.contains(e)){let e=Tv(a.ownerDocument),t=e===null?null:u_(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===wv(a)){let e=Z(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!Ov(r))return r||null;let i=T_(r,e),a=i===void 0?null:S_(i);return a===null||$(a)?r:Iv(a,r,e).element}(n,x,h):(l===void 0&&(l=Sv(r,a)),l);if(e!==null){let t;if(m_(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=Ov(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!m_(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=Z_(n),a=rv(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom0){let{left:e,right:i}=t,o=Ov(r)?r:X_(r);for(;o!==null&&n.contains(o);){let t=eue(a,o,e,i);e-=t,i-=t,o=o===n?null:X_(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=iv(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(su&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=X_(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,_)}}function Mh(e){let t=Q()||Eh();t===null&&(t=k_().selectEnd()),t.insertNodes(e)}function Nh(e,t){for(let n of e.split(/(\r?\n|\t)/))n===` +`,Qu=Hu?`\xA0`:Xu,cce=`֑-߿יִ-﷽ﹰ-ﻼ`,lce=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;function uce(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var dce=uce(lce,cce),fce=uce(cce,lce),$u={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},pce={directionless:1,unmergeable:2},ed={center:2,end:6,justify:4,left:1,right:3,start:5};function mce(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var hce=mce(ed),td={normal:0,segmented:2,token:1},gce=mce(td),_ce=Symbol.for(`@lexical/ctrlOrOtherKey`),nd=`$config`;function vce(e){return()=>{}}function rd(e){return{type:e}}var id=rd(`SELECTION_CHANGE_COMMAND`),ad=rd(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),od=rd(`CLICK_COMMAND`),sd=rd(`BEFORE_INPUT_COMMAND`),cd=rd(`INPUT_COMMAND`),ld=rd(`COMPOSITION_START_COMMAND`),ud=rd(`COMPOSITION_END_COMMAND`),dd=rd(`DELETE_CHARACTER_COMMAND`),fd=rd(`INSERT_LINE_BREAK_COMMAND`),pd=rd(`INSERT_PARAGRAPH_COMMAND`),md=rd(`CONTROLLED_TEXT_INSERTION_COMMAND`),hd=rd(`PASTE_COMMAND`),gd=rd(`REMOVE_TEXT_COMMAND`),_d=rd(`DELETE_WORD_COMMAND`),vd=rd(`DELETE_LINE_COMMAND`),yd=rd(`FORMAT_TEXT_COMMAND`),yce=rd(`SET_TEXT_FORMAT_COMMAND`),bd=rd(`UNDO_COMMAND`),xd=rd(`REDO_COMMAND`),Sd=rd(`KEYDOWN_COMMAND`),Cd=rd(`KEY_ARROW_RIGHT_COMMAND`),wd=rd(`MOVE_TO_END`),Td=rd(`KEY_ARROW_LEFT_COMMAND`),Ed=rd(`MOVE_TO_START`),Dd=rd(`KEY_ARROW_UP_COMMAND`),Od=rd(`KEY_ARROW_DOWN_COMMAND`),kd=rd(`KEY_ENTER_COMMAND`),Ad=rd(`KEY_SPACE_COMMAND`),jd=rd(`KEY_BACKSPACE_COMMAND`),Md=rd(`KEY_ESCAPE_COMMAND`),Nd=rd(`KEY_DELETE_COMMAND`),Pd=rd(`KEY_TAB_COMMAND`),Fd=rd(`INSERT_TAB_COMMAND`),Id=rd(`INDENT_CONTENT_COMMAND`),Ld=rd(`OUTDENT_CONTENT_COMMAND`),Rd=rd(`DROP_COMMAND`),zd=rd(`FORMAT_ELEMENT_COMMAND`),Bd=rd(`DRAGSTART_COMMAND`),Vd=rd(`DRAGOVER_COMMAND`),bce=rd(`DRAGEND_COMMAND`),Hd=rd(`COPY_COMMAND`),Ud=rd(`CUT_COMMAND`),Wd=rd(`SELECT_ALL_COMMAND`),xce=rd(`CLEAR_EDITOR_COMMAND`),Sce=rd(`CLEAR_HISTORY_COMMAND`),Gd=rd(`CAN_REDO_COMMAND`),Kd=rd(`CAN_UNDO_COMMAND`),qd=rd(`FOCUS_COMMAND`),Cce=rd(`BLUR_COMMAND`),wce=rd(`KEY_MODIFIER_COMMAND`);function Jd(e,t){return{...t,[_ce]:e}}var Yd=Jd(`metaKey`,{ctrlKey:!Vu,metaKey:Vu}),Xd=Jd(`altKey`,{altKey:Vu,ctrlKey:!Vu}),Zd=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Qd(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Tce=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||Lu(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of Zd){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Qd(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Qd(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Qd(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of Zd)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function Ece(e){let t=new Tce;for(let n of e)t.add(n);return t}function Dce(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Oce(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"+source"`}var $d=Oce(),ef=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},tf=null;function nf(e,t=1e3){return e instanceof rf?e.clone():e.sizethis._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===tf?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==tf&&n!==void 0||(this._size++,n===tf&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,tf),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==tf&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===tf||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},af=!1;function kce(e,t,...n){let r=af,i;try{af=e,i=t()}finally{af=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||Lu(421),i}function Ace(){return af}function of(e){let t=e.exportJSON(af),n=e.constructor;return t.type!==n.getType()&&Lu(130,n.name),Z(e)&&!Array.isArray(t.children)&&Lu(59,n.name),t}function sf(){return Lg()._blockCursorElement}function cf(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var jce=Yu||Wu||Ku;function lf(){let e=Cg().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function uf(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var df=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&Lu(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Lu(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Lu(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=ff(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=ff(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function ff(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var pf=class e extends df{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;cf(t);)e=t,t=t.nextSibling;uf(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===sf()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;cf(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===sf()&&(t=t.previousSibling);return uf(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(lf(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(lf(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&cf(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&jce;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=Cg().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=Cg().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=sf(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;en){o+=1;break}}return[e.getParentOrThrow(),o]}};function mf(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&Lu(225),n.reverse()}var hf=!1,gf=0;function Mce(){gf=performance.now()}function _f(e){return jg(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function Nce(e,t,n){let r=vg(sg(n)),i=r&&Eg(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Vh(t,s,a,o,!1)}function Pce(e,t,n){if(Q(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return hh(t)&&n.isAttached()}function Fce(e,t,n){for(let r=e;r&&!Jg(r);r=$h(r)){let e=Dh(r,t);if(e!==void 0){let t=wh(e,n);if(t)return Sm(t)||!jg(r)?void 0:[r,t]}}}function vf(e,t,n,r){hf=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-gf>100;try{fv(e,()=>{let a=$()||function(e){return e.read(`latest`,()=>{let e=$();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Fce(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?Fm(m)&&m.isAttached()&&m.markDirty():i&&Fm(m)&&hh(d)&&Pce(a,d,m)&&Nce(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=Dh(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&jg(t)&&t.hasAttribute(`data-lexical-slot`)||Jg(t)))){if(Hu){let e=(jg(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||uf(e)||_f(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||Dh(n,e)||_f(n)||n.remove();n.takeRecords(),a!==null&&(l&&Nh(a),Hu&&Xh(e)&&a.insertRawText(u))})}finally{hf=!1}}function yf(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&vf(e,i,r,t)}}function bf(e){(function(e){sg(e).addEventListener(`textInput`,Mce,!0)})(e),e._observer=new MutationObserver((t,n)=>{vf(e,t,n)})}function xf(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Sf(e,t){return xf(e,t,e.defaultValue)}function Cf(e){return typeof e==`object`&&!!e}function wf(e,t){let n=kf(e,t).getter;return Cf(n)&&n.getterTable!==void 0||Lu(405,t),Of(n.getterTable)}function Tf(e,t){let n=kf(e,t).setter;return Cf(n)&&n.setterTable!==void 0||Lu(406,t),Of(n.setterTable)}function Ef(e,t,n){let{meta:r}=kf(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Of(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:Lu(407,t,String(n))}function Df(e,t){let n=kf(e,t),{setter:r}=n;Cf(r)&&r.setterTable!==void 0||Lu(408,t);let i=String(n.defaultValue);return If(r.setterTable,i)||Lu(409,t,i),r.setterTable[i]}function Of(e){return Object.assign(Object.create(null),e)}function kf(e,t){let n=e.get(t);return n===void 0&&Lu(410,t),n}function Af(e,t,n,r,i){i!==void 0&&Ice.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Mf(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Ice=new WeakSet,jf=new WeakSet;function Lce(e){return typeof e==`object`&&e&&jf.add(e),e}function Mf(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!jf.has(e)){Object.freeze(e);for(let t of Object.values(e))Mf(t)}}function Nf(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Pf(e,t){return n=>t(n)||Ff(e,n)}function Ff(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Ff(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Sf(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function If(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lf(e=``){return Af(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var Rce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Rf(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&Rce.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Af(t=>{let n=o(t);return r&&s(n)?i!==void 0&&na?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function zf(e=!1){return Af(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Bf(e,...t){let n=Lce(t.length===0?e[0]:t[0]),r=new Set(e);return Af(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function Vf(e,t={}){let{defaultAsNull:n}=t;return Af(t=>{if(t==null)return null;let r=e(t);return n&&Sf(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Nf(e),Pf(e,e=>e==null))}function Hf(e,t={}){let{omitDefault:n}=t;return Af(t=>{if(t===void 0)return;let r=e(t);return n&&Sf(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Nf(e),Pf(e,e=>e===void 0))}function Uf(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Wf(e,t){let n=e=>typeof e==`string`&&If(t,e);return Af(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Ff(e,t))}function zce(e){return Af(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;rArray.isArray(e))}function Gf(e,t){return qf(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function Kf(e,t){return qf(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function qf(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Jf=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Hce).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>xf(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Yf(e,t){return new Jf(e,t)}function Xf(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Zf(e,t,n){let r;if(q_(),typeof n==`function`){let i=e.getLatest(),a=Xf(i,t);if(r=Qf(t,n(a)),t.isEqual(a,r))return i}else r=Qf(t,n);let i=e.getWritable();return ep(i).updateFromKnown(t,r),i}function Qf(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function Bce(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of m_(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var $f=new Set([`__proto__`,`constructor`,`prototype`]),Vce=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return np(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if($f.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=np(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if($f.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function ep(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Vce(t,function(e){return e.__state?e.__state.sharedNodeState:Mle(Lg(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function tp(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&ep(e).updateFromJSON(r),n}function np(e){if(e)for(let t in e)return e}function Hce(e){return e}function rp(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ip(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ap(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function op(e){return!Tm(e)&&e.getTextContent!==bm.prototype.getTextContent}var sp=Symbol.for(`@lexical/CachedTextSize`);function cp(e,t){return wp.read(()=>{let n=0,r=e;for(let e=0;e0)n+=i.getTextContentSize();else{let e=i[sp];e===void 0&&Lu(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:dp})}function lp(e){Z(e)||Vp(e).size>0||e[sp]===void 0&&(e[sp]=Fm(e)?e.__text.length:e.getTextContentSize())}var Uce=4,up,dp,fp,pp=``,mp=null,hp=null,gp=null;function _p(){return{firstTextKey:gp,format:mp,style:hp}}function vp(e){e.firstTextKey!==null&&(mp=e.format,hp=e.style,gp=e.firstTextKey)}function yp(e){if(gp!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&Lu(348),t===null)return;let n=Tp.get(t);Fm(n)&&(mp=n.getFormat(),hp=n.getStyle(),gp=t)}var bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap=!1,jp=!1;function Mp(e,t){let n=Cp.get(e),r=Tp.has(e);if(t!==null){let n=tm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(dp._keyToDOMMap.delete(e),Z(n)){let e=__(n,Cp);Np(e,0,e.length-1,null)}if(n!==void 0){for(let e of Vp(n).values()){let t=Up(e);Mp(e,null),t!==null&&t.remove()}qh(Op,fp,bp,n,`destroyed`)}}}function Np(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Mp(t,r)}}function Pp(e,t){e.setProperty(`text-align`,t)}var Wce=`40px`;function Fp(e,t){let n=up.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Wce}))`),Gh(e,`class`),Gh(e,`style`)}function Ip(e,t){let n=e.style;t===0?Pp(n,``):t===1?Pp(n,`left`):t===2?Pp(n,`center`):t===3?Pp(n,`right`):t===4?Pp(n,`justify`):t===5?Pp(n,`start`):t===6&&Pp(n,`end`),Gh(e,`style`)}function Lp(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Tm(e))return null;let n=e.getParent();return n===null||dg(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Rp(e){let t=Cg().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function zp(e,t,n){t||e.contentEditable===`false`?Qle(n,dp):n.removeAttribute(`contenteditable`)}function Bp(e,t,n){let r=pp,i=_p();pp=``;let a=``,o=Sm(e);for(let[r,i]of n){let n=Rp(r);zp(t,o,n),t.appendChild(n),pp=``;let s=_p();Gp(i,zg(e,n,dp)),vp(s),Hp(e,r,t,n),a+=pp}return vp(i),pp=r,a}function Vp(e){return Zy(e)&&e.__slots!==null?e.__slots:Xy}function Hp(e,t,n,r){let i=kp.$getSlotTargetElement(e,t,n,dp);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function Up(e){let t=Ep.get(e);return t===void 0?null:t.parentElement}function Wp(e,t,n){let r=Vp(e),i=Vp(t);for(let[e,t]of r)if(!i.has(e)){let e=Up(t);Mp(t,null),e!==null&&e.remove()}let a=pp,o=_p(),s=``,c=null,l=Sm(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:Up(i);pp=``;let u=_p();if(o===null){o=Rp(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),Gp(a,zg(t,o,dp))}else i===a?Zp(a,o):(i!==void 0&&Mp(i,o),Gp(a,zg(t,o,dp)));if(vp(u),zp(n,l,o),Hp(t,e,n,o),s+=pp,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return vp(o),pp=a,s}function Gp(e,t){let n=Tp.get(e);if(n===void 0&&Lu(60),t!==null){let r=Cp.get(e);if(r!==void 0){let i=Ep.get(e);if(i!==void 0){let a=Qy(r)?r.__slotHost:null,o=Qy(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),Zp(e,t.element)}}}let r=kp.$createDOM(n,dp);if(function(e,t,n){let r=n._keyToDOMMap;Eh(t,n,e),r.set(e,t)}(e,r,dp),Fm(n)?r.setAttribute(`data-lexical-text`,`true`):Sm(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),qg(r,{captureSelection:!0})),Z(n)){let e=pp,t=n.__indent,i=n.__size;Lp(r,n),t!==0&&Fp(r,t);let a=Vp(n),o=a.size>0?Bp(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,pp+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(Kp(__(n,Tp),n,0,t,zg(n,r,dp)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,pp=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(op(n)){let t=n.getTextContent();r.__lexicalTextContent=t,pp=e+t}let s=n.__format;s!==0&&Ip(r,s),n.isInline()||(Yp(0,n,r),Jp(n,r))}else{let t=n.getTextContent();if(Sm(n)){let t=n.decorate(dp,up);t!==null&&Qp(e,t),r.contentEditable=`false`;let i=Vp(n);i.size>0&&Bp(n,r,i)}pp+=t}return t!==null&&t.insertChild(r),kp.$decorateDOM(n,null,r,dp),lp(n),qh(Op,fp,bp,n,`created`),r}function Kp(e,t,n,r,i){let a=pp,o=_p();pp=``,mp=null,hp=null,gp=null;let s=n;for(;s<=r;++s){let t=_p();Gp(e[s],i);let n=Tp.get(e[s]);n!==null&&Fm(n)?mp===null&&(mp=n.getFormat(),hp=n.getStyle(),gp=n.__key):Z(n)&&s0||Vp(n).size>0)?Wp(n,r,a):``;if(i){let e=pp;if(function(e,t,n){var r;mp=null,hp=null,gp=null,function(e,t,n){let r=pp,i=e.__size,a=t.__size;pp=``;let o=n.element,s=dp._keyToDOMMap.get(t.__key);s===void 0&&Lu(351,t.__key);let c=a-i;if(!Ap&&Math.abs(c)<=1&&i>=Uce&&e.__first===t.__first&&(c!==0||!dp._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Dp.get(e.__key);if(!Ap&&!op(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,pp=r+m,Xp(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&Lu(353),pp=r+e,Xp(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Tp.get(t);if(e===void 0)break;let r=Ap||Sp.has(t)||xp.has(t),i=_p();if(r)Zp(t,o);else{let n,r;if(Z(e)){r=Ep.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&Lu(354,e.getType()),n=i}else n=e.getTextContent();pp+=n,r!==void 0&&yp(r)}Fm(e)?mp===null&&(mp=e.getFormat(),hp=e.getStyle(),gp=e.__key):Z(e)&&no,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:dp.getElementByKey(t);Kp(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Np(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=pp,s.__lexicalFirstTextKey=gp,pp=r+pp}(e,t,zg(t,n,dp)),dg(t)||(r=t,mp==null||mp===r.__textFormat||jp||r.setTextFormat(mp),function(e){hp==null||hp===e.__textStyle||jp||e.setTextStyle(hp)}(t))}(n,r,a),r.isInline()||(Tm(r)||Yp(0,r,a),Jp(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,pp=e+s+t,a.__lexicalSlotTextLength=s.length}else(Vp(r).size>0||Vp(n).size>0)&&(a.__lexicalSlotTextLength=0);if(op(r)){let t=r.getTextContent();a.__lexicalTextContent=t,pp=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&Lu(356,n.getType()),pp+=e,yp(a)}if((Ap||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Lp(a,r),Tm(r)&&!Ap))for(let e of r.getChildren())Z(e)&&Lp(Qh(dp,e.getKey()),e)}else{let t=r.getTextContent();if(Sm(r)){let t=r.decorate(dp,up);t!==null&&Qp(e,t),i&&(Vp(r).size>0||Vp(n).size>0)&&Wp(n,r,a)}pp+=t}if(!jp&&Tm(r)){let e=r.getLatest();if(e.__cachedText!==pp){let t=e.getWritable();t.__cachedText=pp,r=t}}return kp.$decorateDOM(r,n,a,dp),lp(r),a}function Qp(e,t){let n=dp._pendingDecorators,r=dp._decorators;if(n===null){if(r[e]===t)return;n=kh(dp)}n[e]=t}function $p(e){let t=e.nextSibling;return t!==null&&t===dp._blockCursorElement&&(t=t.nextSibling),t}function em(e,t){let n=new Set;for(let r=t;r{for(let n of t){let t=Tp.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(xp.keys()),t(Sp),e}();let o=new Map;return Op=o,Zp(`root`,null),dp=void 0,fp=void 0,xp=void 0,Sp=void 0,Cp=void 0,wp=void 0,Tp=void 0,up=void 0,Ep=void 0,Dp=void 0,Op=void 0,kp=j_,o}function tm(e){let t=Ep.get(e);return t===void 0&&Lu(75,e),t}function nm(e,t,n){q_();let r=e.__key,i=e.getParent();if(i===null)return void($y(e)!==null&&Lu(367,r,String($y(e))));let a=function(e){let t=$();if(!Q(t)||!Z(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return ag(i,e)&&n.set(e.__key,0,`element`),ag(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Q(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Ay(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Ay(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ty(a)&&t&&e.isSelected()&&e.selectPrevious();Ky(e.getWritable(),t&&!o&&Q(a)?a:null),n||dg(i)||i.canBeEmpty()||!i.isEmpty()||nm(i,t),t&&a&&Tm(i)&&i.isEmpty()&&i.selectEnd()}function rm(e){return e}var im=Symbol.for(`ephemeral`);function am(e){return e[im]||!1}var om={configurable:!0,enumerable:!1,value:void 0,writable:!0},sm=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=u_(this);return e===void 0&&Lu(64,this.name),e}static clone(e){Lu(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||v_(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",om),Object.defineProperty(this,sp,om),yh(this,e)}getType(){return this.__type}isInline(){Lu(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=wh(e);if(t===null)break;e=t.__parent===null?$y(t):t.__parent}return!1}isSelected(e){let t=e||$();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(Fm(this))return n;if(Q(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Sm(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:wh(e)}getParentOrThrow(){let e=this.getParent();return e===null&&Lu(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(dg(t)||$y(e)!==null)return Z(e)||e===this&&Sm(e)||Lu(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&Lu(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:wh(e)}getPreviousSiblings(){return Yy(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:wh(e)}getNextSiblings(){return Yy(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=kb(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?fde(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&Lu(279),!1)))}isParentOf(e){return ag(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&Z(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=X_()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(am(this))return this;let e=wh(this.__key);return e===null&&Lu(442,this.__key,this.__type),e}getWritable(){if(am(this))return this;q_();let e=Y_(),t=X_(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return bh(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&Lu(442,n,this.__type);let c=Ug(s);return r.set(n,c),o.set(n,c),bh(c),c}getTextContent(){return Xue(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Lu(70)}updateDOM(e,t,n){Lu(71)}getDOMSlot(e){return new df(e)}exportDOM(e){return{element:Rg(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=$g(Qg(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return Z(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i=n&&a<=r&&Number.isInteger(a)?a:t}var qce=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=hm(t.indent,0,0,1/0),e.__textFormat=mm(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Jce(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Yce=e=>{let t=wf(e,`mode`),n=Ef(e,`detail`,0),r=Ef(e,`format`,0),i=Tf(e,`mode`),a=Df(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:mm(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:mm(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Jce}},Xce=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=hm(t.indent,0,0,1/0),e.__textFormat=mm(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Zce=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Qce=e=>{let t=wf(e,`mode`),n=Ef(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:mm(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},gm=new WeakMap;function _m(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!oue(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function $ce(e){for(let{ownNodeConfig:t}of m_(e))if(t&&t.children!==void 0)return t.children}function ele(e){let t=gm.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of m_(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=new Set,n=o_(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of m_(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof Jf?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&_m(e,r.inline)!==void 0&&_m(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=o_(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=$ce(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),gm.set(e,t)}return t}function tle(e){let{derivedNames:t,...n}=ele(e);return Object.freeze({...n,derived:new Set(t)})}var vm;function ym(e){return vm!==void 0&&vm.has(e)}function nle(){return{...hce,0:``}}function rle(){return{...ed,"":0}}var ile=nle(),ale=rle(),ole=Uf()({direction:Gf(Bf([null,`ltr`,`rtl`]),{field:`__dir`}),format:Gf(Bf([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:ile,setter:`setFormat`,setterTable:ale}),indent:Gf(Rf(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:Kf(Rf(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:Kf(Lf(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function sle(e){if(dg(e)&&!ym(X_())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var bm=class extends sm{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:sle,extends:sm,generated:qce,json:ole})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Lu(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return hce[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return Yy(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&ib(this).length===0}isDirty(){let e=X_()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of ib(this)){let n=ab(this,t);if(Z(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(Fm(t)&&e.push(t),Z(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Z(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Z(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return Z(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:wh(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&Lu(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:wh(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&Lu(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Xue(this),t=this.getChildren(),n=t.length;for(let r=0;re.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&ed[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){am(this)&&Lu(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Lu(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e(Uy(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,Gy(t);let n=e.__key;Wy(i,t,d,c&&c.getWritable()),e.__key===a&&Lu(76),o.push(n),d=t}if(i.__size=u,s.length){let e=$();if(Q(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])cle(r,t,n)&&Ay(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||dg(this)||this.remove()}}return i}getDOMSlot(e){return new pf(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(dg(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(Fm(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=zg(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=Dh(s,t))&&Jg(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}Jp(this,e,n)})}};function Z(e){return e instanceof bm}function cle(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var xm=class extends sm{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Lu(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Sm(e){return e instanceof xm}function Cm(e){let t=e.getLatest().__cachedText;return t===null||!K_()&&X_()._dirtyType!==0?null:t}var wm=class extends bm{__cachedText;$config(){return this.config(`root`,{extends:bm})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){Lu(51)}getTextContent(){let e=Cm(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=Cm(this);return e===null?super.getTextContentSize():e.length}remove(){Lu(52)}replace(e){Lu(53)}insertBefore(e){Lu(54)}insertAfter(e){Lu(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)Z(e)||Sm(e)||Lu(282);return super.splice(e,t,n)}static importJSON(e){return jh().updateFromJSON(e)}collapseAtStart(){return!0}};function Tm(e){return e instanceof wm}function Em(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Dm(e,t,n=``){if(t===n)return;let r=Em(n),i=Em(t);for(let t in i)delete r[t],lle(e,t,i[t]);for(let t in r)e.removeProperty(t)}var ule=Uf()({detail:Gf(Wf(Rf(),pce),{field:`__detail`}),format:Gf(Wf(Rf(),$u),{field:`__format`}),mode:Gf(Bf([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:gce,setterTable:td}),style:Gf(Lf(),{field:`__style`}),text:Gf(Lf(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function Om(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function km(e,t){return 1&t?`strong`:2&t?`em`:`span`}function dle(e,t,n,r,i){let a=r.classList,o=Kh(i,`base`);o!==void 0&&a.add(...o),o=Kh(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in $u){let r=$u[e];if(o=Kh(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}Gh(r,`class`)}function fle(e,t,n){let r=n.isComposing(),i=e+(r?Xu:``),a=Lg(),o=Rg(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Cg().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Hu||qu){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i({conversion:vle,priority:0}),b:()=>({conversion:hle,priority:0}),code:()=>({conversion:Nm,priority:0}),em:()=>({conversion:Nm,priority:0}),i:()=>({conversion:Nm,priority:0}),mark:()=>({conversion:Nm,priority:0}),s:()=>({conversion:Nm,priority:0}),span:()=>({conversion:mle,priority:0}),strong:()=>({conversion:Nm,priority:0}),sub:()=>({conversion:Nm,priority:0}),sup:()=>({conversion:Nm,priority:0}),u:()=>({conversion:Nm,priority:0})},json:ule})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return gce[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Sh()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=$u[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return vh(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Om(0,n),i=km(0,n),a=r===null?i:r,o=Cg().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Cg().createElement(i),o.appendChild(s)),ple(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Dm(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Om(0,i),s=Om(0,a),c=km(0,i),l=km(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??Lu(48);let i=Cg().createElement(l);return ple(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??Lu(49)),fle(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&dle(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(Dm(t.style,p,f),Gh(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return jg(t)||Lu(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Am(t,`b`)),this.hasFormat(`italic`)&&(t=Am(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Am(t,`s`)),this.hasFormat(`underline`)&&(t=Am(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?$u[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?pce[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=vh(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=td[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){q_();let n=e,r=t,i=$(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Q(i))return xy(o,n,o,r,`text`,`text`);{let e=Sh();e!==i.anchor.key&&e!==i.focus.key||xh(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=$();if(r&&Q(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){q_();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Sh(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;tt&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=$();if(Q(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Pm(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ap(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e=S&&(g.set(e.getKey(),b-S,`text`),b=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&bh(t),n!==null&&bh(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Q(v)&&ky(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Lu(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Sh()===r&&xh(n);let o=$();if(Q(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&jy(i,t,n,e,a),s!==null&&s.key===r&&jy(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function mle(e){return{forChild:Im(e.style),node:null}}function hle(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Im(t.style,n?void 0:`bold`),node:null}}var gle=new WeakMap;function _le(e){if(!jg(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function vle(e){let t=e;e.parentElement===null&&Lu(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=gle.get(n))===void 0&&!_le(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=yle(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Pm(n)}}function yle(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,jg(n)){let e=n.style.display;if(e===``&&!Pg(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(hh(n))return n;if(n.nodeName===`BR`)return null}}var ble={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Nm(e){let t=ble[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Im(e.style,t),node:null}}function Pm(e=``){return pg(new Mm(e))}function Fm(e){return e instanceof Mm}function Im(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((Fm(e)||jm(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function Lm(e,t){let{type:n,key:r,offset:i}=e,a=hg(e.key);return n===`text`?(Fm(a)||Lu(266,a.getType(),r),vb(a,t,i)):(Z(a)||Lu(267,a.getType(),r),qm(a,e.offset,t))}function Rm(e,t){let{origin:n,direction:r}=t,i=r===`next`;mb(t)?e.set(n.getKey(),t.offset,`text`):hb(t)?Fm(n)?e.set(n.getKey(),yb(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(gb(t)&&Z(n)||Lu(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function zm(e){let t=$(),n=Q(t)?t:Sy();return Bm(n,e),Nh(n),n}function Bm(e,t){Rm(e.anchor,t.anchor),Rm(e.focus,t.focus)}function Vm(e){let{anchor:t,focus:n}=e,r=Lm(t,`next`),i=Lm(n,`next`),a=Db(r,i)<=0?`next`:`previous`;return Tb(Sb(r,a),Sb(i,a))}function Hm(e){let{direction:t,origin:n}=e,r=_b(n,ub(t)).getNodeAtCaret();return r?_b(r,t):bb(n.getParentOrThrow(),t)}function xle(e,t=`root`){let n=[e];for(let r=gb(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Hm(r));return n}function Sle(e){return!!e&&e.origin.isAttached()}function Cle(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Km(e,r),o=a.anchor.origin;for(;o!==null&&!dg(o);)o=o.getParent();let s=Z(o)?o.getFirstChild():null,c=xle(a.anchor,n),l=xle(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(gb(e))u.add(e.origin.getKey());else if(hb(e)){let{origin:t}=e;Z(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),Ile(e)}for(let e of f)!e.canBeEmpty()&&!dg(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Hm(_b(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=Pm(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=vb(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=Um(c),m=Um(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&kb(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(dg(i))return;t&&!n.has(i.__key)||!Ig(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&ib(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;bb(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(gb(e)){let t=e.origin;if(Ig(t))return t}else{let t=e.getParentAtCaret();if(t&&Ig(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(ug);if(e&&t&&!Tm(t)&&e.isEmpty()&&u.has(e.getKey())&&ib(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!Tm(n)&&n.isEmpty();){let e=n.getParent();if(e&&Tm(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}Mh(o,s)!==null||o===null||o.isAttached()||Mh(jh(),null);let g=Um([p,m,...c,...l]);if(g)return wb(Sb(g,e.direction));Lu(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Um(e){let t=e.find(Sle);return t&&Wm(t)}function Wm(e){let t=function(e){let t=e;for(;gb(t);){let e=xb(t);if(!gb(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Fm(t.origin))return mb(t)?t:vb(t.origin,n,n);let r=t.getAdjacentCaret();return hb(r)&&Fm(r.origin)?vb(r.origin,n,ub(n)):t}function Gm(e){return mb(e)&&e.offset!==yb(e.origin,e.direction)}function Km(e,t){return e.direction===t?e:Tb(Sb(e.focus,t),Sb(e.anchor,t))}function qm(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?bb(e,n):_b(a,n)}function Jm(e,t=`root`){let n=0,r=e,i=xb(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=xb(r)}return i&&[i,n]}function wle(e){let{origin:t,offset:n,direction:r}=e;if(n===yb(t,r))return e.getSiblingCaret();if(n===yb(t,ub(r)))return Hm(e.getSiblingCaret());let[i]=t.splitText(n);return Fm(i)||Lu(281),Sb(_b(i,`next`),r)}function Ym(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Tle(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&Oy(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==$()&&ky(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Ele(e,t){return!0}function Dle(e,{$copyElementNode:t=fg,$splitTextPointCaretNext:n=wle,rootMode:r=`shadowRoot`,$shouldSplit:i=Ele,removeEmptyDestination:a=!1}={}){if(mb(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(gb(e)){let e=Hm(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=Yy((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function Xm(e,t,n){let r=Sb(t,`next`);mb(r)&&(r.offset===0?r=_b(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=_b(r.origin,`next`))),r.origin.is(e)&&(hb(r)||Lu(342,e.getKey(),e.getType()),r=Hm(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Dle(e,n))r=e;return mb(r)&&Lu(283),r.insert(e.isInline()?Qm().append(e):e),Sb(_b(e.getLatest(),`next`),t.direction)}function Ole(e,t){let n=Km(Q(t)?Vm(t):t,`next`),r=tb(n.anchor.origin),i=tb(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Wm(bb(e,`next`)),o=Sb(Wm(bb(e,`previous`)),`next`);return Db(n.anchor,a)<=0&&Db(n.focus,o)>=0}var Zm=class extends bm{$config(){return this.config(`paragraph`,{children:`inline`,extends:bm,generated:Xce,importDOM:{p:()=>({conversion:kle,priority:0})}})}createDOM(e){let t=Cg().createElement(`p`),n=Kh(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(Fm),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Q(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(Ole(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=Qm();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>Fm(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function kle(e){let t=Qm();if(Kg(t,e),Wg(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in ed&&t.setFormat(n)}return Gg(t,e),{node:t}}function Qm(){return pg(new Zm)}function $m(e){return e instanceof Zm}var Ale=Uf()({detail:Kf(Rf(2),{getter:{field:`__detail`},setter:null}),mode:Kf(Bf([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:Kf(Lf(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),eh=class extends Mm{$config(){return this.config(`tab`,{extends:Mm,generated:Qce,json:Ale})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=Kh(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||Lu(286),this}setDetail(e){return e!==2&&Lu(127),this}setMode(e){return e!==`normal`&&Lu(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function th(){return pg(new eh)}function nh(e){return e instanceof eh}var rh=null;function ih(e){rh=e}var ah=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),jle=1;function Mle(e,t){let n=oh(e,t);return n===void 0&&Lu(30,t),n}function oh(e,t){return e._nodes.get(t)}var Nle=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function sh(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return gh(t)||yg(t)?Og(t):null})():t;if(!jg(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Oh(n),i=n.nodeName;return cm(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&fh(n)==null)}function ch(e){let t=e===null?null:kg(e);return Mg(t)&&sh(t)}function lh(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return dh(t)===e&&e.read(`latest`,()=>!sh(t))}function uh(e){return e instanceof P_}function dh(e){let t=e;for(;t!=null;){let e=fh(t);if(uh(e))return e;t=$h(t)}return null}function fh(e){return e?e.__lexicalEditor:null}function Ple(e){return dce.test(e)?`rtl`:fce.test(e)?`ltr`:null}function ph(e){return nh(e)||e.isToken()}function mh(e){return ph(e)||e.isSegmented()}function hh(e){return Mg(e)&&e.nodeType===3}function gh(e){return Mg(e)&&e.nodeType===9}function _h(e){let t=e;for(;t!=null;){if(hh(t))return t;t=t.firstChild}return null}function vh(e,t,n){let r=$u[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~$u.superscript:t===`superscript`?i&=~$u.subscript:t===`lowercase`?(i&=~$u.uppercase,i&=~$u.capitalize):t===`uppercase`?(i&=~$u.lowercase,i&=~$u.capitalize):t===`capitalize`&&(i&=~$u.lowercase,i&=~$u.uppercase),i}function Fle(e){return Fm(e)||E_(e)||Sm(e)}function yh(e,t){let n=function(){let e=rh;return rh=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);q_(),J_();let r=X_(),i=Y_(),a=``+jle++;i._nodeMap.set(a,e),Z(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Ile(e){Gy(e.getParent()===null?e:e.getWritable())}function bh(e){J_(),am(e)&&Lu(323,e.__key,e.__type);let t=e.__parent===null?Qy(e)?e.__slotHost:null:e.__parent,n=Y_(),r=X_(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Qy(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),Z(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function xh(e){q_();let t=X_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=wh(n);e!==null&&e.getWritable()}if(e!==null){let t=wh(e);t!==null&&t.getWritable()}}}function Sh(){return K_()?null:X_()._compositionKey}function Ch(e){return!Wu&&(Ku||Yu)&&e.__text===``&&e.__key===X_()._compositionKey}function wh(e,t){let n=(t||Y_())._nodeMap.get(e);return n===void 0?null:n}function Th(e,t){let n=Dh(e,X_());return n===void 0?null:wh(n,t)}function Eh(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Dh(e,t){return e[`__lexicalKey_${t._key}`]}function Oh(e,t){let n=e;for(;n!=null;){let e=Th(n,t);if(e!==null)return e;n=$h(n)}return null}function kh(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Ah(e){return e.read(()=>jh().getTextContent())}function Lle(e,t){let n=Hg(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=wh(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function jh(){return Y_()._nodeMap.get(`root`)}function Mh(e,t){if(!(dg(e)&&e.isAttached()&&(Tm(e)?e.getChildrenSize()===0:e.isEmpty())&&(Tm(e)||t!==null&&Ig(t))))return null;let n=Qm();return e.append(n),n}function Nh(e){q_();let t=Y_();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Q(e)&&X_()._slotsUsed&&_y(e)),t._selection=e}function Ph(e){q_(),yf(X_(),e)}function Fh(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Dh(n,t);if(e!==void 0)return e;n=$h(n)}return null}(e,X_());return t===null?null:wh(t)}function Ih(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Lh(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Rle=0;function Rh(){return zu?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Rle).toString(36)}`}function zh(e){return hh(e)?e.nodeValue:null}function Bh(e,t,n){let r=vg(sg(t));if(r===null)return;let i=Eg(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=zh(a),r=Oh(a);if(t!==null&&Fm(r)){if((t===Xu||t===Qu)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Vh(r,t,o,s,e)}}}function Vh(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Wu&&(Ku||Yu);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Xu)||s&&t===a.getTextContent()||(c=t.slice(0,-Xu.length)),i&&!s)){let e=Qu,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=$();if(c===``){if(o&&!i&&s)return void Hh(a,``,t);if(xh(null),Ku||Wu||Yu)a.remove();else{let e=X_();Hh(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=Dy(),d=a.getTextContentSize(),f=Sh(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||Q(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Q(t)||n===null||r===null)return void Hh(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Pm(a.getTextContent());a.replace(e),a=e}Hh(a,c,t)}}}function Hh(e,t,n){if(e.setTextContent(t),Q(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=yb(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Uh(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(Tm(e))return t;t=e}return null}function Wh(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(fm(e),!Tm(t))return e;let u=Uh(n.getNode());return Z(u)&&u.isShadowRoot()&&u.is(Uh(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function zle(e){let t=jh();if(Q(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(Tm(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),Wh(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(Z(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),Wh(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),Wh(e,a),e)}{let e=t.select(0,t.getChildrenSize());return Nh(Wh(e,t)),e}}function Gh(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function Kh(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=jb(i);return n[t]=e,e}return i}function qh(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&Lu(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Jh(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Yh(e,t){let n=e.offset;if(e.type===`element`)return Jh(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Jh(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Xh(e){let t=sg(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function Zh(e,t,...n){return cv(e,t,n[0],e)}function Qh(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&Lu(75,t),n}function $h(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return yg(n)?n.host:null}function eg(e){return gh(e)?e:jg(e)?e.ownerDocument:null}function tg(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function Ble(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+tg(o.scrollPaddingLeft,i)*l,p=d+(i-tg(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(mp&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function ng(e){return X_()._updateTags.has(e)}function rg(e){q_(),X_()._updateTags.add(e)}function ig(e){q_(),X_()._deferred.push(e)}function ag(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function og(e){let t=eg(e);return t?t.defaultView:null}function sg(e){let t=e._window;return t===null&&Lu(78),t}function cg(e){return Z(e)&&e.isInline()||Sm(e)&&e.isInline()}function lg(e){let t=e.getLatest();for(;t!==null;){if($y(t)!==null&&Z(t))return t;let e=t.getParentOrThrow();if(dg(e))return e;t=e}return t}function ug(e){return Z(e)&&e.isShadowRoot()}function dg(e){return Tm(e)||ug(e)}function fg(e,t=!1){let n=e.constructor.clone(e,ah);return yh(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function pg(e){let t=X_(),n=e.getType(),r=oh(t,n);r===void 0&&Lu(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||Lu(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||Lu(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Lu(203,e.constructor.name,n,r.name,r.getType()),t}return e}function mg(e,t){!Tm(e.getParent())||Z(t)||Sm(t)||Lu(99)}function hg(e){let t=wh(e);return t===null&&Lu(63,e),t}function gg(e){if(!e||e.isInline())return!1;if(Sm(e))return!0;if(Z(e)){if(e.isShadowRoot()){let t=e.getParent();return!(Z(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function _g(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function vg(e){return zu?(e||window).getSelection():null}function Vle(e){let t=og(e);return t?t.getSelection():null}function yg(e){return Ng(e)&&`host`in e}var Hle=[];function bg(e){let t=e.getRootNode();if(t===e||!yg(t))return Hle;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!yg(e))break;n.push(e),r=e.host}return n}function*xg(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(gh(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Sg(e){return e===null?document:e.ownerDocument}function Cg(){let e=$_();return Sg(e===null?null:e._rootElement)}function wg(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=bg(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Tg(e,t){let n=wg(e,t);if(n!==null){let e=Ule(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Eg(e,t){let n=wg(e,t);return n===null?e:Wle(n,Gle(e))}function Ule(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Wle(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Gle(e){return e.direction}function Dg(e){let t=e.getRootNode();return gh(t)||yg(t)?t.activeElement:null}function Og(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function kg(e){let t=e.target;if(t!==null&&jg(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function Ag(e){return jg(e)&&e.tagName===`A`}function Kle(e){return jg(e)&&e.tagName===`TR`}function jg(e){return Mg(e)&&e.nodeType===1}function Mg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Ng(e){return Mg(e)&&e.nodeType===11}var qle=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Pg(e){return!(!jg(e)||!e.style.display.startsWith(`inline`))||qle.test(e.nodeName)}var Jle=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Fg(e){return(!jg(e)||!e.style.display.startsWith(`inline`))&&Jle.test(e.nodeName)}function Ig(e){if(Sm(e)&&!e.isInline())return!0;if(!Z(e)||dg(e))return!1;let t=e.getFirstChild(),n=t===null||E_(t)||Fm(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Lg(){return X_()}function Rg(e=Lg()){return e._config.dom||j_}function zg(e,t,n=Lg()){let r=Rg(n).$getDOMSlot(e,t,n);return Z(e)&&(Yle(r)||Lu(344,e.getKey(),e.getType())),r}function Yle(e){return e instanceof pf}function Bg(e,t,n=Lg()){return _h(zg(e,t,n).element)}var Vg=new WeakMap,Xle=new Map;function Hg(e){if(!e._readOnly&&e.isEmpty())return Xle;e._readOnly||Lu(192);let t=Vg.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Vg.set(e,t)),t}function Ug(e){let t=e.constructor.clone(e,ah);return t.afterCloneFrom(e),t}function Zle(e){return(t=Ug(e))[im]=!0,t;var t}function Wg(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function Gg(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Kg(e,t){let n=t.style.textAlign;return n&&n in ed?e.setFormat(n):e}function qg(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Jg(e){return!0===e.__lexicalUnmanaged}function Qle(e,t=Lg()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Yg(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(jg(n)&&n.hasAttribute(`data-lexical-slot`)||Dh(n,t)!==void 0)return!1;n=$h(n)}return!1}function Xg(e,t){return If(e,t)&&e[t]!==sm[t]}var Zg=new WeakMap;function Qg(e){let t=Zg.get(e);return t===void 0?function(e){let t=e.prototype!=null&&nd in e.prototype?e.prototype[nd]():void 0,n=function(e){if(!(e===sm||e.prototype instanceof sm)){let t=``,n=``;try{t=e.getType()}catch{}try{P_.version&&(n=JSON.parse(P_.version))}catch{}Lu(290,e.name,t,n)}return e===xm||e===bm||e===sm}(e),r=!n&&Xg(e,`getType`)?e.getType:void 0,i=r&&!(e_ in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:If(e.prototype,nd),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Zg.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=a_(e);for(let[i,a]of r){let r=rue(e,i,a);if(r===null)continue;if(Cf(r)){let t=r.field;if(t===`__proto__`&&Lu(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])If(t,String(r))||Lu(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&Lu(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?$le:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of a_(e).fieldsDerivedFirst){let a=nue(e,r,i);if(a===null)continue;if(Cf(a)){let o=a.field;o===`__proto__`&&Lu(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&Lu(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&Lu(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?tue:[...n.values()]}(e),i=a_(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of m_(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n{ih(t);let r=new e;return n!==ah&&r.afterCloneFrom(t),r}),Xg(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=h_(e);return n.updateFromJSON===sm.prototype.updateFromJSON?function(e,t){return l_(e.__state||t.$!==void 0?tp(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!Xg(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;If(t,`getTextContent`)&&!If(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=sm.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of m_(e)){let e=t.prototype;if(If(e,`afterCloneFrom`))continue;let r=lue(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?$g(Qg(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?eue:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function o_(e){let{fieldsDerivedFirst:t,flatStates:n}=a_(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var tue=[];function nue(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?i_(t):r;return Cf(i)?t_(e,t,i,i_(t)):i}function rue(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?r_(t):r;return Cf(i)?t_(e,t,i,r_(t)):i}function s_(e){return e}function c_(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function iue(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&c_(i,r)}}function aue(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function l_(e,t){let{flatStates:n,generated:r,setters:i}=$g(Qg(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;ee)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r!n.has(e))}function*m_(e){for(let t=e;t&&(t===sm||cm(t.prototype));){let e=u_(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||v_(t)}}function h_(e){let t=Lg();q_();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:pg(r)}var g_=(e,t)=>{let n=e;for(;n!=null&&!Tm(n);){if(t(n))return n;n=n.getParent()}return null};function __(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?wh(r):t.get(r);e??Lu(174),n.push(r),r=e.__next}return n}function v_(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function y_(e){return new S_(nf(e._nodeMap),null,e._slotsUsed)}function b_(){return new S_(new Map([[`root`,new wm]]),null,!1)}function x_(e){let t=e.constructor,n=of(e);if(Z(e)){let t=n.children,r=e.getChildren();for(let e=0;e0){let i={};for(let n of r){let r=ab(e,n);r===null&&Lu(366,t.name,n),i[n]=x_(r)}n.$slots=i}return n}function uue(e){return e instanceof S_}var S_=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return iv(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return kce(typeof e==`boolean`&&e,()=>iv(null,this,()=>({root:x_(jh())})))}},C_=class extends bm{$config(){return this.config(`artificial`,{extends:bm})}createDOM(e){return Cg().createElement(`div`)}},w_=class extends sm{$config(){return this.config(`linebreak`,{extends:sm,generated:Zce,importDOM:{br:e=>D_(e)||O_(e)?null:{conversion:due,priority:0}}})}getTextContent(){return` +`}createDOM(){return Cg().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function due(e){return{node:T_()}}function T_(){return pg(new w_)}function E_(e){return e instanceof w_}function D_(e){let t=e.parentElement;if(t!==null&&Fg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&k_(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&k_(n))return!0}}return!1}function O_(e){let t=e.parentElement;if(t!==null&&Fg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&k_(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&k_(r))return!0}return!1}function k_(e){return hh(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function fue(e){console.warn(e)}function A_(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=b_(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&Dv(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Eh(n,e,`root`))}function pue(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of m_(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var j_={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=oh(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>Z(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>Z(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function M_(e){let t=e||{},n=$_(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=b_(),s=t.namespace||(i===null?Rh():i._config.namespace),c=t.editorState,l=[wm,Mm,w_,eh,Zm,C_,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e`;try{r=JSON.parse($d)}catch{}Lu(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}u_(n);let a=n.getType(),o=pue(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Bce(l[e]),transforms:o})}}let h=new P_(o,i,m,{disableEvents:a,dom:{...j_,...e&&e.dom},namespace:s,theme:r},u||console.error,d||fue,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(sd,wue,0),e.registerCommand(cd,Eue,0),e.registerCommand(ld,Oue,0),e.registerCommand(ud,kue,0),e.registerCommand(Sd,Nue,0)}(h),h}function mue(e,t){let n=e.get(t);e.delete(t),n&&n()}function N_(e,t,n){return e.set(t,n),mue.bind(null,e,t)}var P_=class{static version=$d;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new rf,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Rh(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return N_(this._listeners.update,e)}registerEditableListener(e){return N_(this._listeners.editable,e)}registerDecoratorListener(e){return N_(this._listeners.decorator,e)}registerTextContentListener(e){return N_(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return pv(N_(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&Lu(35);let r=this._commands;r.has(e)||r.set(e,[new ef,new ef,new ef,new ef,new ef]);let i=r.get(e);i===void 0&&Lu(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&Lu(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Hg(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return Lle(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return Zh(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Kh(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,A_(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=_v.get(e);if(t===void 0)return void Kv();let n=vv.get(t);if(n===void 0)return void Kv();_v.delete(e);let r=fh(e);uh(r)?(function(e){if(e._parentEditor!==null){let t=Lh(e),n=t[t.length-1]._key;Wv.get(n)===e&&Wv.delete(n)}else Wv.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Lu(198);let i=Hv(e);for(let e=0;e{Fue(i)||(Pue(i),n===`blur`&&(Dv(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):Zh(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,fv(t,()=>{let o=vg(sg(t));if(a.type!==`mousedown`){let r=c&&o&&Q($())&&Ty(Dy(),o,t,new Event(`selectionchange`));return r&&Nh(r),kv(t,n,c&&o?Eg(o,e).focusNode:null)}let l=wy(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Uv(t,o,new Event(`selectionchange`),r),kv(t,a,Eg(o,e).focusNode);let n=$();Q(n)&&n.isCollapsed()&&!n.is(Dy())&&wv(t,n)}})};i.push(hv(n,{pointercancel:c,pointermove:c,pointerup:c},!0),mv(sg(t),`blur`,s),t.registerEditableListener(s),hv(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||Yg(kg(e),t)?null:e}}),mv(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Wu&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return pv(mv(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),mv(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=Tv&&Math.abs(r.clientY-n.y)<=Tv&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(Ev(e,t,n)||(Og(n.ownerDocument)===n&&n.blur(),Dv(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),av(this);ov(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=y_(e),r._selection=e._selection?e._selection.clone():null),yf(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),av(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,fv(this,()=>{if(a&&this._updateTags.add(a),n&&(Ru(38),jh().append(Qm())),e._parsed)for(let[e,t]of r._nodeMap.entries())Z(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=b_(),i=I_,a=R_,o=L_,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,I_=r,R_=!1,L_=t,ih(null);try{let i=t._nodes;rv(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,I_=i,R_=a,L_=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(U_.has(this)||av(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):dv(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),fv(this,()=>{let r=$(),i=jh();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Nh(r.clone()),rg(`focus`),ig(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=vg(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ov(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Z_()))}toJSON(){return{editorState:this._editorState.toJSON(Ace())}}};function F_(e,t,n,r,i,a){if(Z(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=Z(e);e.__parent!==t||s&&a.has(o)||((s||Zy(e)&&e.__slots!==null)&&F_(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of Zy(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Qy(e)&&e.__slotHost===t&&((Z(e)||Zy(e)&&e.__slots!==null)&&F_(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var I_=null,L_=null,R_=!1,z_=!1,B_=!1,V_=new Set,H_=new Set,U_=new Set,W_=0,G_={characterData:!0,childList:!0,subtree:!0};function K_(){return R_||I_!==null&&I_._readOnly}function q_(){R_&&Lu(13)}function J_(){W_>99&&Lu(14)}function Y_(){return I_===null&&Lu(195,Q_()),I_}function hue(e){Y_()!==null&&L_===null&&(L_=e),L_!==e&&Ru(378)}function X_(){return L_===null&&Lu(337,Q_()),L_}function Z_(){X_()._dirtyType=2}function Q_(){let e=0,t=new Set,n=P_.version;if(typeof window<`u`)for(let r of xg(document)){let i=fh(r);if(uh(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function $_(){return L_}function ev(e,t,n){let r=t.__type,i=Mle(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;ee.dispatchCommand(id),void 0,!0)}return!1}finally{H_.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&lv(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=I_,u=R_,d=L_,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){L_=e,I_=n,R_=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Gce(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),z_)throw t;A_(e,null,r,n),bf(e),e._dirtyType=2,z_=!0,av(e,a),z_=!1;return}finally{p.observe(r,G_),e._updating=f,I_=l,R_=u,L_=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=kh(e)),delete r[a])}(e,n);let b=i?null:vg(sg(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){L_=e,I_=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&_g(t,e,r),Hue(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Q(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Dg(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())gg(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&gg(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=zg(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Cg().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=jb(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&_g(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,G_),L_=d,I_=l}}let x=U_.has(e);U_.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e{V_.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Iu(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;dv(e,t,r)}}(e)})(e,t),n&&e._onWarn(Iu(436))}finally{B_=n}}function ov(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function sv(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function cv(e,t,n,r){let i=Lh(e),a;if(!B_)for(let e=0;e{i=cv(e,t,n,r)}),i}let i=Y_()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(fv(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{cv(a,t,n,r)}),!1}function lv(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);Fm(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&dm(r),r!==void 0&&tv(r,a)&&ev(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){W_++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&tv(c,a)&&ev(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,W_++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),uv(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(Z(t)&&F_(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Zy(t)&&t.__slots!==null&&F_(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=X_(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Q(i)){e._slotsUsed&&_y(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||Lu(19)}else ty(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),av(e);return}finally{I_=d,R_=f,L_=p,e._updating=m,W_=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,av(e)):u&&Nle(()=>{av(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function fv(e,t,n){L_===e&&n===void 0?K_()?dv(e,t,n):t():dv(e,t,n)}function pv(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function mv(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function hv(e,t,n){return pv(...Object.entries(t).map(([t,r])=>mv(e,t,r,n)))}var gv=30,_v=new WeakMap,vv=new WeakMap,vue=Dce(e=>(e.addEventListener(`selectionchange`,Gv),()=>e.removeEventListener(`selectionchange`,Gv)));function yv(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=X_(),u;if(a!==void 0)u=a;else{let e=vg(sg(l));u=e===null?null:Eg(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!Fm(c)||(!i&&(!Uu||l._inputState.lastBeforeInputInsertTextTimeStamp1||(i||!Uu)&&p!==null&&!c.isComposing()&&d!==Bg(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=ph(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(Fm(t)||Z(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function bv(e,t){return hh(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function xv(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Eg(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,bv(r,i)&&bv(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}fv(t,()=>{if(!n)return void Nh(null);if(!lh(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||kv(t,c,a);let l=Ov.has(c),u=$();if(s.postDeleteSelectionToRestore&&Q(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),Nh(u))}if(s.postDeleteSelectionToRestore=null,Q(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),wv(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=sce,v=!1;for(let e=0;e{let n=$(),r=vg(sg(t)),i=Dy();if(r){if(Q(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!Tm(t)&&jh().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Wu&&t._inputState.lastPointerType!==`mouse`){let n=Eg(r,t._rootElement).anchorNode;(jg(n)||hh(n))&&Nh(Ty(i,r,t,e))}}if(Hu&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e{Yg(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var Ov=new WeakSet;function kv(e,t,n=null){let r=$(),i=r&&r.clone();(function(e,t,n){let r=Dy(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&Oh(n);Sm(o)&&(i?a&&o.isInline()&&o.selectPrevious():Q(r)&&Nh(r.clone()));let s=$(),c=s||(a?Sy():Q(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!Q(c)||a&&!c.isCollapsed()||!gh(u)&&!yg(u))return;let{anchor:d,focus:f}=c;if(!i&&Q(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&Oh(h),_=(e,t)=>Z(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=Z(g)&&!g.isInline()&&(Tm(g)?g_(f.getNode(),by):g);for(let e of y?bb(y,`next`):[])v.push(_b(e.origin,`previous`),e);let b=sg(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!Sm(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(ml)){S=n;continue}let y=b.getComputedStyle($h(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),ee=T&&e.getElementByKey(T.getKey()),E=ee?ee.getClientRects():[],te=E[C?0:E.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||E_(T)||te&&(C===y?2*te.right>u+h:2*te.leftMv(e),0))}function Pv(e,t){let n=kg(e);if(jg(n)&&Yg(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Og(r.ownerDocument);return i!==null&&r.contains(i)&&(Yg(i,t)||sh(r,i))}function Cue(e,t){let n=e.inputType;n===`deleteCompositionText`||Hu&&Xh(t)||n!==`insertCompositionText`&&fv(t,()=>{Pv(e,t)||Zh(t,sd,e)},{event:e})}function wue(e){let t=e.inputType,n=Av(e),r=X_(),i=r._inputState,a=$();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Mv(i),e.preventDefault(),Q(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Dy();if(!Q(e))return!0;Nh(e.clone())}if(Q(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t{fv(r,()=>{xh(null)})},gv),Q(a)){let e=a.anchor.getNode();e.markDirty(),Fm(e)||Lu(142),Cv(a,e)}}else{if(xh(null),Wu&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Ju&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!Sm(Yh(a.anchor,!0))),!u){Zh(r,dd,!0);let e=$();Ju&&Q(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Q(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),Zh(r,t===`historyUndo`?bd:xd)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&Bh(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!Tm(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&my(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=qv(e,i,o),{anchor:r,focus:u}=a,d=!gy(my(r),c)||!gy(my(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===` +`)e.preventDefault(),Zh(r,fd,!1);else if(o===Zu)e.preventDefault(),Zh(r,pd);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&yv(a,n,o,e.timeStamp,!0)?(e.preventDefault(),Zh(r,md,o),jv(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:Zh(r,md,e),jv((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;xh(null),t||Zh(r,md,e),Fv(n);break}case`insertLineBreak`:xh(null),i.isInsertLineBreak=!1,Zh(r,fd,!1);break;case`insertParagraph`:xh(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,Zh(r,fd,!1)):Zh(r,pd);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:Zh(r,hd,e);break;case`deleteByComposition`:(function(e,t){return e!==t||Z(e)||Z(t)||!ph(e)||!ph(t)})(u,d)&&Zh(r,gd,e);break;case`deleteByDrag`:rg(`skip-selection-focus`),Zh(r,gd,e);break;case`deleteByCut`:Zh(r,gd,e);break;case`deleteContent`:Zh(r,dd,!1);break;case`deleteWordBackward`:Zh(r,_d,!0);break;case`deleteWordForward`:Zh(r,_d,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:Zh(r,vd,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:Zh(r,s?dd:vd,!1);break;case`formatStrikeThrough`:Zh(r,yd,`strikethrough`);break;case`formatBold`:Zh(r,yd,`bold`);break;case`formatItalic`:Zh(r,yd,`italic`);break;case`formatUnderline`:Zh(r,yd,`underline`);break;case`historyUndo`:Zh(r,bd);break;case`historyRedo`:Zh(r,xd)}return!0}function Tue(e,t){e.stopPropagation();let n=t._inputState;Mv(n),fv(t,()=>{Pv(e,t)||t.dispatchCommand(cd,e)},{event:e}),n.unprocessedBeforeInputData=null}function Eue(e){let t=X_(),n=t._inputState,r=$(),i=e.data,a=Av(e),o=!1,s=!1;if(i!=null&&Q(r)){let c=vg(sg(t)),l=c===null?null:Eg(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&Fm(d)&&mh(d);if(!u&&!f&&yv(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Iv(t,i);if(n.compositionPhase=`idle`,e)return rg(`composition-end`),Ph(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;Uu&&!r.isCollapsed()&&Fm(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===zh(l.anchorNode)||(Zh(t,md,i),s=e.inputType===`insertText`);let p=i.length;Hu&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),Ju&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,xh(null))}}return o||(Bh(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Iv(t,i||void 0),rg(`composition-end`),n.compositionPhase=`idle`)),Ph(s),!0}function Due(e,t){Zh(t,ld,e)}function Oue(e){let t=X_(),n=t._inputState,r=$();if(Q(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(xh(i.key),rg(`composition-start`),e.timeStamp({key:e,modifiers:t,onMatch:(e,t)=>{Zh(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),Zh(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!Wu||r.isShiftKeyDown),Zh(n,kd,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:Yd,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Q(r)||ch(e)||(e.preventDefault(),Zh(n,t,e))}});return[e(`ArrowRight`,Bv,Cd),e(`ArrowLeft`,Bv,Td),e(`ArrowUp`,Vv,Dd),e(`ArrowDown`,Vv,Od),n({...Lv,shiftKey:!0},!0),n({...Lv,shiftKey:!1},!1),e(` `,Lv,Ad),{key:`Backspace`,modifiers:Bv,onMatch:(e,t)=>{Zh(t,jd,e)&&Nv(t._inputState)}},e(`Escape`,Lv,Md),e(`Delete`,{},Nd),t(`Backspace`,Xd,_d,!0),t(`Delete`,Xd,_d,!1),t(`b`,Yd,yd,`bold`),t(`u`,Yd,yd,`underline`),t(`i`,Yd,yd,`italic`),e(`Tab`,Bv,Pd),t(`z`,Yd,bd,void 0),t(`z`,{...Yd,shiftKey:!0},xd,void 0),...Vu?[{key:`o`,modifiers:Rv,onMatch:(e,t)=>{e.preventDefault(),Zh(t,fd,!0)}},e(`ArrowLeft`,{metaKey:!0,...Bv},Ed),e(`ArrowRight`,{metaKey:!0,...Bv},wd),t(`h`,Rv,dd,!0),t(`d`,Rv,dd,!1),t(`Backspace`,zv,vd,!0),t(`Delete`,zv,vd,!1),t(`k`,Rv,vd,!1)]:[e(`Home`,Bv,Ed),e(`End`,Bv,wd),t(`y`,Rv,xd,void 0)],{key:`a`,modifiers:Yd,onMatch:(e,t)=>{e.preventDefault(),Zh(t,Wd,e)&&Nv(t._inputState)}},r(`c`,Hd),r(`x`,Ud)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(wce,e),!0}function Hv(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function Uv(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=Eg(t,e._rootElement).anchorNode;(jg(i)||hh(i))&&Nh(Ty(Dy(),t,e,n))}var Wv=new Map;function Gv(e){let t=e.target;if(jg(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=Vle(t);if(n===null)return;let r=eg(t),i=null,a=r===null?void 0:vv.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&yg(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=Eg(n,e).anchorNode;if(a!==null&&dh(a)===r){if(yg(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||jg(e)&&e.shadowRoot!==null||(i=dh(e))}}if(i===null){let e=Og(r);i=e===null?null:dh(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&fv(i,()=>Uv(i,n,e,a));let o=Lh(i),s=o[o.length-1],c=s._key,l=Wv.get(c),u=l||s;u!==i&&xv(n,u,!1),xv(n,i,!0),i===s?l&&Wv.delete(c):Wv.set(c,i)}function Pue(e){e._lexicalHandled=!0}function Fue(e){return!0===e._lexicalHandled}var Kv=vce(),Iue=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offsete&&(r=e)}else if(!Z(t)){let e=t.getNextSibling();if(Fm(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Lue(e,t){if(Z(t)){let n=t.getLastDescendant();Z(n)||Fm(n)?Jv(e,n):Jv(e,t)}else Jv(e,t)}function Yv(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Pm();if(o.setFormat(n),o.setStyle(r),$m(a))a.splice(0,0,[o]);else if(a!==null){let e=dg(i)?Qm().append(o):o;a.insertBefore(e)}else if(dg(i)){let e=i.getLastChild();Z(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(Qm().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function Xv(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(Fm(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(Sh()===null)return e.anchor.type===`element`&&Yv(e.anchor,e.focus,r,i),void Zv(e,t,r,i)}e.anchor.type===`element`&&Yv(e.anchor,e.focus,r,i);let a=e.anchor.getNode();Fm(a)||Lu(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(mh(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(Sh()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),X_()._inputState.composedSegmentedKey=a.getKey();else{let t=Pm(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=$()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&$()!==e&&Nh(e)}(t!==``||n)&&Xv(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=_b(a,l).getNodeAtCaret(),d;Fm(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!mh(u)?d=u:(d=Pm().setFormat(r).setStyle(i),_b((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),Xv(e,t,n);return}let l=Pm(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void Zv(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function Zv(e,t,n,r){let i=e.anchor.getNode();Fm(i)||Lu(398);let a=e.anchor.offset,o=Pm(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))_b(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var Qv=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ty(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>$y(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(Fm(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e$y(e)===null);if(($()||Dy())===this&&e[0]){let t=_b(e[0],`next`);zm(Tb(t,t))}for(let t of e)t.remove();$v()}};function $v(){let e=jh();if(e.getChildrenSize()===0&&nb($())===null){let t=Qm();e.append(t),t.select()}}function Q(e){return e instanceof ey}var ey=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Q(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if(gb(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;Z(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),hb(e.focus)&&Z(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=bb(e.focus.origin,`previous`);gb(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xb(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!Z(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Wm(e.anchor),r=Wm(e.anchor.getFlipped()),i=e=>mb(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Km(Vm(this),`next`));return K_()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=Vm(this).getTextSlices(),n=``,r=!0;for(let i=0;i(Z(e)||Sm(e))&&!e.isInline())){Z(i)||Lu(211,r.constructor.name,r.getType());let[t,n]=Ry(this,!0);(Z(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=By(e),n=t.getLastDescendant(),r=Lm(this.anchor,`next`);for(let e of t.getChildren())r=Xm(e,r);n!==null&&n.selectEnd();return}if(Z(i)&&($y(i)!==null||!i.isParentRequired()&&!dg(i.getParentOrThrow()))){let[,t]=Ry(this),n=Ly(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=By(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&Z(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Ig(e)&&!dg(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return E_(t)&&E_(t.getPreviousSibling())}(n),u=Z(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=g_(r,Ig));let d=c[c.length-1],f=c[0];var p=f;l||!Z(p)||!Ig(p)||p.isEmpty()||!Z(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(Z(i)||Lu(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&Lu(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||Lu(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=g_(s,Ig),h=s.selectEnd();u&&(Z(m)&&(u.canMergeWhenEmpty()||Ig(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),Z(i)&&i.isEmpty()&&i.remove();let g=Z(i)?i.getLastChild():null;E_(g)&&m!==i&&g.remove();let _=Wm(Lm(h.anchor,`next`));Rm(h.anchor,_),Rm(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&dg(e)){let t=Qm();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Ry(this),n=g_(this.anchor.getNode(),Ig);if(n!==null&&$y(n)!==null)return null;Z(n)||Lu(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=T_();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=Vm(this).getTextSlices(),r=[];for(let t of e){let e=Ym(n,t),i=e?Tle(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&Fm(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(Vy(this,e,t,n))return;let r=e===`move`,i=X_(),a=vg(sg(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!Z(c)||c.isInline()||c.canBeEmpty()||_g(o,i,s);let l=Qh(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=Fm(c)?Bg(c,l,i):null),this.dirty){let e=Qh(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=Fm(n)?Bg(n,e,i):null}t&&u&&My(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&Fm(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=_b(c,t?`previous`:`next`).getNodeAtCaret();if(Fm(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?Bg(e,n,i):null;if(r){let e=t?r.length:0;My(a,r,e,r,e)}}}}if(sy(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=wg(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=Tm(o)?o:lg(o);this.applyDOMRange(n),this.dirty=!0,r||(cy(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||oy(this))}n===`lineboundary`&&Vy(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&Z(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(Z(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=Z(n)?n.getNextSibling():null;if(!(Z(n)&&n.isEmpty()&&Z(e)&&e.isShadowRoot()))return}let r=Lm(t,e?`previous`:`next`),i=Cb(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(Z(e)&&gg(e)){let t=e.getParent();e.remove();let n=Mh(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(gb(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Wm(t);Bm(this,Tb(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(hb(t)){if(Z(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Sm(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=Cy();e.add(t.origin.getKey()),Nh(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=Mh(n,e);r!==null&&r.selectStart()}}return}if(E_(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return ib(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Bm(this,Tb(!t.origin.isEmpty()&&n.isEmpty()?Hm(_b(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if($y(e)!==null)return;if(Z(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(ly(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(Z(n)){if(n.collapseAtStart(e))return!0;if(dg(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void dy(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void dy(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e{for(let[t,r]of n)e=vh(e,t,r?$u[t]:0);return e})}function iy(e,t,n=null){let r=n===null&&Q(e)?vh(e.format,t,null):n;ry(e,e=>vh(e,t,r))}function ay(e){let t=jh();!t.isEmpty()&&Ole(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function oy(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function sy(e,t,n,r,i){let a=r===`character`?Eg(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&tag(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=Z(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function ly(e,t,n){if(Vy(e,`extend`,t,n))return!1;let r=X_(),i=vg(sg(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!Z(c)||c.isInline()||c.canBeEmpty()||_g(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&Fm(t)?Bg(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(My(i,h,g,h,g),sy(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=wg(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&hh(v)&&dh(v)===r){let e=Fh(v);if(Sm(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&Fm(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=_b(u,t?`previous`:`next`).getNodeAtCaret();if(Fm(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&Oh(v),x=b?tb(u):null,S=b?tb(b):null;if(b&&!gy(S,x)&&uy(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,ee]=t?[v,y,d,f]:[d,f,v,y],E=Tm(u)?u:lg(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:ee,startContainer:C,startOffset:w}),e.dirty=!0,!cy(e,t,E)&&t&&oy(e),!1}function uy(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=eb(e);n!==null;){let e=tb(n);if(gy(e,t))return e!==null||n.isAttached()?n:null;n=e&&eb(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!Z(t))return t!==null&&function(e,t,n){Z(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(Fm(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!Z(i)||dg(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function zue(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var Bue=zue();function dy(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;en||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function fy(e,t,n,r){let i,a=t,o=!1;if(jg(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Dh(e,r)!==void 0||Yg(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Fh(d),Fm(i))a=yb(i,s?`next`:`previous`);else{let c=Fh(e);if(c===null)return null;if(Z(c)){let o=r.getElementByKey(c.getKey());o===null&&Lu(214);let l=zg(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),Z(c)||Lu(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(Z(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=Z(u)?u:u.getParentOrThrow()),a=0}Fm(u)?(i=u,c=null,a=yb(u,s?`next`:`previous`)):u!==c&&s&&!f&&(Z(c)||Lu(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=eb(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Fh(e)===c){let n=zg(c,s,r);n.element===s?t===0&&Sm(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(Z(c))return[qv(c.__key,a,`element`),o]}}else i=Fh(e);return Fm(i)?[qv(i.__key,yb(i,a,`clamp`),`text`),o]:null}function py(e,t,n){let r=e.getNode();if(Ch(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=_b(r,a).getNodeAtCaret();if(i===t||!Z(o)||!o.isInline()||i&&n){if(i&&!t)Fm(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(Z(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=_b(t,a).getNodeAtCaret();Fm(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function my(e){let t=wh(e.key);return t===null?null:tb(t)}function hy(e,t,n){let r=my(e),i=my(t);return!gy(r,i)&&uy(t,wh(e.key),r,i,`selection`,n)}function gy(e,t){return e===null?t===null:e.is(t)}function _y(e){let t=hy(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=ude(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=ude(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return dde(e,t);case`ancestor`:return e.type===`child`&&$y(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&$y(n.a)===null?1:-1;case`branch`:{let e=$y(n.a)&&n.a.getKey(),t=$y(n.b)&&n.b.getKey();if(e&&t){for(let r of rb(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(Lm(e.anchor,`next`),Lm(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function vy(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function yy(e,t,n,r,i,a){if(e===null||n===null||!lh(i,e,n))return null;let o=fy(e,t,Q(a)?a.anchor:null,i);if(o===null)return null;let s=fy(n,r,Q(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Fh(e),r=Fh(n);if(Sm(t)&&Sm(r))return null}let f=i._slotsUsed&&hy(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?vy(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>vy(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);py(e,n,r),py(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function by(e){return Z(e)&&!e.isInline()}function xy(e,t,n,r,i,a){let o=Y_(),s=new ey(qv(e,t,i),qv(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Sy(){return new ey(qv(`root`,0,`element`),qv(`root`,0,`element`),0,``)}function Cy(){return new Qv(new Set)}function wy(e,t){return Ty(null,e,t,null)}var Vue=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function Ty(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&kg(c),u=c&&(c.ctrlKey||c.metaKey||Vue.has(c.key))&&Mg(l)&&dh(l)===n,d=!hf&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(Q(e)&&!d)return e.clone();{if(t===null)return null;let r=Eg(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&Q(e)&&!lh(n,f,p))return e.clone()}let g=yy(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=Q(e)?e:null,x=new ey(_,v,b?b.format:0,b?b.style:``);return b&&Ey(x,b.anchor.key),x.dirty=y,x}function Ey(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;Fm(r)?(i=r.getFormat(),a=r.getStyle()):Z(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function $(){return Y_()._selection}function Dy(){return X_()._editorState._selection}function Oy(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function ky(e,t,n,r=1){if(Oy(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n=t,r=e.getChildAtIndex(n?t-1:i.offset);Fm(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function Ay(e,t,n,r,i){let a=r||i;if(Fm(a)||Z(a)){let t=Fm(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function jy(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function My(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Ny(e,t,n){let r=Qh(e,t.getKey());if(Z(t)){let i=zg(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Hue(e,t,n,r,i,a){let o=a.getRootNode(),s=gh(o)||yg(o)?Og(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&sh(s,s))return;let c=Eg(r,a),l;if(!Q(t))return void(e!==null&&lh(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Ny(n,f,u.offset),[g,_]=Ny(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=Fm(f)?Bg(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Q(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=Fm(p)?Bg(p,g,n):null),x===null||S===null)return;let w=b&&Fm(p)&&Ch(p)&&hh(S)&&S.nodeValue===Xu?Xu.length:_;if(b&&(e===null||C||Q(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:dh(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(My(r,x,h,S,w),Hu&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Dg(a);if(e===null||!a.contains(e)){let e=Og(a.ownerDocument),t=e===null?null:dh(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Dg(a)){let e=Q(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!jg(r))return r||null;let i=Dh(r,e),a=i===void 0?null:wh(i);return a===null||Z(a)?r:zg(a,r,e).element}(n,x,h):(l===void 0&&(l=Tg(r,a)),l);if(e!==null){let t;if(hh(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=jg(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!hh(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=eg(n),a=og(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom0){let{left:e,right:i}=t,o=jg(r)?r:$h(r);for(;o!==null&&n.contains(o);){let t=Ble(a,o,e,i);e-=t,i-=t,o=o===n?null:$h(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=sg(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(su&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=$h(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function Py(e){let t=$()||Dy();t===null&&(t=jh().selectEnd()),t.insertNodes(e)}function Fy(e,t){for(let n of e.split(/(\r?\n|\t)/))n===` `||n===`\r -`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Ph(e){let t=[];return Nh(e,{linebreak:()=>t.push(Dg()),tab:()=>t.push(Jm()),text:e=>t.push(Gm(e))}),t}function Ele(){let e=Q();return e===null?``:e.getTextContent()}function Fh(e){let t=[];for(let n of e)Og(n)||(!$(n)&&!vg(n)||n.isInline()?t.push(n):$(n)&&t.push(...Fh(n.getChildren())));return t}function Ih(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=Q();Z(r)&&(n=r),Z(n)||Mu(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Nv(a)&&iy(a)===null;){let e=a;if([a,o]=Dle(a,o,t),e.is(a))break}return[a,o]}function Dle(e,t,n=!1){let r=e.getParent();if(!r){let e=Yg();return k_().append(e),e.select(),[k_(),0]}if(X(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!$(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new rh(Xm(e.__key,t,`element`),Xm(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function Ole(e){return Og(e)||av(e)||X(e)||e.isParentRequired()}function Lh(e){let t=Yg(),n=null;for(let r=0;r99&&Mu(14)}function Zh(){return zh===null&&Mu(195,eg()),zh}function kle(e){Zh()!==null&&Bh===null&&(Bh=e),Bh!==e&&Nu(378)}function Qh(){return Bh===null&&Mu(337,eg()),Bh}function $h(){Qh()._dirtyType=2}function eg(){let e=0,t=new Set,n=t_.version;if(typeof window<`u`)for(let r of vv(document)){let i=d_(r);if(l_(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function tg(){return Bh}function ng(e,t,n){let r=t.__type,i=a_(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;ee.dispatchCommand(op),void 0,!0)}return!1}finally{Gh.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&dg(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=zh,u=Vh,d=Bh,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Bh=e,zh=n,Vh=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Oce(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Hh)throw t;Zg(e,null,r,n),Ed(e),e._dirtyType=2,Hh=!0,sg(e,a),Hh=!1;return}finally{p.observe(r,qh),e._updating=f,zh=l,Vh=u,Bh=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=D_(e)),delete r[a])}(e,n);let b=i?null:hv(iv(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Bh=e,zh=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&mv(t,e,r),Tle(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Z(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(wv(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())pv(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&pv(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=Iv(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=bv().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Uy(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&mv(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,qh),Bh=d,zh=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e{Wh.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(ju(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;pg(e,t,r)}}(e)})(e,t),n&&e._onWarn(ju(436))}finally{Uh=n}}function cg(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function lg(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function ug(e,t,n,r){let i=F_(e),a;if(!Uh)for(let e=0;e{i=ug(e,t,n,r)}),i}let i=Zh()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(mg(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{ug(a,t,n,r)}),!1}function dg(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);X(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&pf(r),r!==void 0&&rg(r,a)&&ng(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Kh++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&rg(c,a)&&ng(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Kh++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),fg(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||($(t)&&bd(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(ny(t)&&t.__slots!==null&&bd(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=Qh(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Z(i)){e._slotsUsed&&yh(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||Mu(19)}else ih(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),sg(e);return}finally{zh=d,Vh=f,Bh=p,e._updating=m,Kh=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,sg(e)):u&&Jle(()=>{sg(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null)))}function mg(e,t,n){Bh===e&&n===void 0?Jh()?pg(e,t,n):t():pg(e,t,n)}function Mle(){return{...td,0:``}}function Nle(){return{...$u,"":0}}var Ple=Mle(),Fle=Nle(),Ile=Yd()({direction:Zd(Kd([null,`ltr`,`rtl`]),{field:`__dir`}),format:Zd(Kd([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:Ple,setter:`setFormat`,setterTable:Fle}),indent:Zd(Wd(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:Qd(Wd(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:Qd(Ud(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function Lle(e){if(cv(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var hg=class extends Om{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:Lle,extends:Om,generated:ile,json:Ile})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Mu(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return td[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&ly(this).length===0}isDirty(){let e=Qh()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of ly(this)){let n=uy(this,t);if($(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(X(t)&&e.push(t),$(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;$(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;$(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return $(e)&&e.getLastDescendant()||e||null}let r=t[e];return $(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:S_(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&Mu(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:S_(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&Mu(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=my(this),t=this.getChildren(),n=t.length;for(let r=0;re.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&$u[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){Em(this)&&Mu(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Mu(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(cv(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(X(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=Iv(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function $(e){return e instanceof hg}function gg(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var _g=class extends Om{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Mu(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function vg(e){return e instanceof _g}var yg=class extends hg{__cachedText;$config(){return this.config(`root`,{extends:hg})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){Mu(51)}getTextContent(){let e=this.__cachedText;return e===null||!Jh()&&Qh()._dirtyType!==0?super.getTextContent():e}remove(){Mu(52)}replace(e){Mu(53)}insertBefore(e){Mu(54)}insertAfter(e){Mu(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)$(e)||vg(e)||Mu(282);return super.splice(e,t,n)}static importJSON(e){return k_().updateFromJSON(e)}collapseAtStart(){return!0}};function bg(e){return e instanceof yg}function xg(e){return new wg(gd(e._nodeMap),null,e._slotsUsed)}function Sg(){return new wg(new Map([[`root`,new yg]]),null,!1)}function Cg(e){let t=e.constructor,n=yd(e);if($(e)){let t=n.children,r=e.getChildren();for(let e=0;e0){let i={};for(let n of r){let r=uy(e,n);r===null&&Mu(366,t.name,n),i[n]=Cg(r)}n.$slots=i}return n}function Rle(e){return e instanceof wg}var wg=class e{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return og(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return oce(typeof e==`boolean`&&e,()=>og(null,this,()=>({root:Cg(k_())})))}},Tg=class extends hg{$config(){return this.config(`artificial`,{extends:hg})}createDOM(e){return bv().createElement(`div`)}},Eg=class extends Om{$config(){return this.config(`linebreak`,{extends:Om,generated:cle,importDOM:{br:e=>kg(e)||Ag(e)?null:{conversion:zle,priority:0}}})}getTextContent(){return` -`}createDOM(){return bv().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function zle(e){return{node:Dg()}}function Dg(){return uv(new Eg)}function Og(e){return e instanceof Eg}function kg(e){let t=e.parentElement;if(t!==null&&Mv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&jg(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&jg(n))return!0}}return!1}function Ag(e){let t=e.parentElement;if(t!==null&&Mv(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&jg(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&jg(r))return!0}return!1}function jg(e){return m_(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Mg(e,t){let{type:n,key:r,offset:i}=e,a=fv(e.key);return n===`text`?(X(a)||Mu(266,a.getType(),r),Ey(a,t,i)):($(a)||Mu(267,a.getType(),r),Ug(a,e.offset,t))}function Ng(e,t){let{origin:n,direction:r}=t,i=r===`next`;Sy(t)?e.set(n.getKey(),t.offset,`text`):Cy(t)?X(n)?e.set(n.getKey(),Dy(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(wy(t)&&$(n)||Mu(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Pg(e){let t=Q(),n=Z(t)?t:Ch();return Fg(n,e),j_(n),n}function Fg(e,t){Ng(e.anchor,t.anchor),Ng(e.focus,t.focus)}function Ig(e){let{anchor:t,focus:n}=e,r=Mg(t,`next`),i=Mg(n,`next`),a=Ly(r,i)<=0?`next`:`previous`;return Fy(My(r,a),My(i,a))}function Lg(e){let{direction:t,origin:n}=e,r=Ty(n,vy(t)).getNodeAtCaret();return r?Ty(r,t):ky(n.getParentOrThrow(),t)}function Rg(e,t=`root`){let n=[e];for(let r=wy(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Lg(r));return n}function zg(e){return!!e&&e.origin.isAttached()}function Ble(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Hg(e,r),o=a.anchor.origin;for(;o!==null&&!cv(o);)o=o.getParent();let s=$(o)?o.getFirstChild():null,c=Rg(a.anchor,n),l=Rg(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(wy(e))u.add(e.origin.getKey());else if(Cy(e)){let{origin:t}=e;$(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),v_(e)}for(let e of f)!e.canBeEmpty()&&!cv(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Lg(Ty(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=Gm(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Ey(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p,m;for(let e of c)if(zg(e)){p=Bg(e);break}for(let e of l)if(zg(e)){m=Bg(e);break}let h=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c=0;for(;c{let n;for(let r=c;rn.has(e.getKey())&&Nv(e));return d&&ly(d).length>0?null:u&&d?[u,d]:null}(p,m,u);if(h){let[e,t]=h;ky(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(wy(e)){let t=e.origin;if(Nv(t))return t}else{let t=e.getParentAtCaret();if(t&&Nv(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(sv);if(e&&t&&!bg(t)&&e.isEmpty()&&u.has(e.getKey())&&ly(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!bg(n)&&n.isEmpty();){let e=n.getParent();if(e&&bg(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}A_(o,s)!==null||o===null||o.isAttached()||A_(k_(),null);let g=[p,m,...c,...l].find(zg);if(g)return Py(My(Bg(g),e.direction));Mu(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Bg(e){let t=function(e){let t=e;for(;wy(t);){let e=jy(t);if(!wy(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(X(t.origin))return Sy(t)?t:Ey(t.origin,n,n);let r=t.getAdjacentCaret();return Cy(r)&&X(r.origin)?Ey(r.origin,n,vy(n)):t}function Vg(e){return Sy(e)&&e.offset!==Dy(e.origin,e.direction)}function Hg(e,t){return e.direction===t?e:Fy(My(e.focus,t),My(e.anchor,t))}function Ug(e,t,n){let r=ky(e,`next`);for(let e=0;e0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}return o}function Kg(e,t,n){let r=My(t,`next`);Sy(r)&&(r.offset===0?r=Ty(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Ty(r.origin,`next`))),r.origin.is(e)&&(Cy(r)||Mu(342,e.getKey(),e.getType()),r=Lg(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Gg(e,n))r=e;return Sy(r)&&Mu(283),r.insert(e.isInline()?Yg().append(e):e),My(Ty(e.getLatest(),`next`),t.direction)}function qg(e,t){let n=Hg(Z(t)?Ig(t):t,`next`),r=oy(n.anchor.origin),i=oy(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Bg(ky(e,`next`)),o=My(Bg(ky(e,`previous`)),`next`);return Ly(n.anchor,a)<=0&&Ly(n.focus,o)>=0}var Jg=class extends hg{$config(){return this.config(`paragraph`,{extends:hg,generated:sle,importDOM:{p:()=>({conversion:Ule,priority:0})}})}createDOM(e){let t=bv().createElement(`p`),n=W_(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ov(t)){this.isEmpty()&&t.append(bv().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(X),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Z(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(qg(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=Yg();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>X(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Ule(e){let t=Yg();if(Bv(t,e),Rv(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in $u&&t.setFormat(n)}return zv(t,e),{node:t}}function Yg(){return uv(new Jg)}function Xg(e){return e instanceof Jg}function Wle(e){console.warn(e)}function Zg(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=Sg(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),w_(n,e,`root`))}function Gle(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Xv(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var Qg={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=o_(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>$(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>$(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function $g(e){let t=e||{},n=tg(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Sg(),s=t.namespace||(i===null?I_():i._config.namespace),c=t.editorState,l=[yg,Vm,Eg,qm,Jg,Tg,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e`;try{r=JSON.parse(pd)}catch{}Mu(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Yv(n);let a=n.getType(),o=Gle(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:_ce(l[e]),transforms:o})}}let h=new t_(o,i,m,{disableEvents:a,dom:{...Qg,...e&&e.dom},namespace:s,theme:r},u||console.error,d||Wle,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(jce,Jce,0),e.registerCommand(Mce,Xce,0),e.registerCommand(Nce,Qce,0),e.registerCommand(Pce,$ce,0),e.registerCommand(yp,nle,0)}(h),h}function Kle(e,t){let n=e.get(t);e.delete(t),n&&n()}function e_(e,t,n){return e.set(t,n),Kle.bind(null,e,t)}var t_=class{static version=pd;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new _d,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=I_(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return e_(this._listeners.update,e)}registerEditableListener(e){return e_(this._listeners.editable,e)}registerDecoratorListener(e){return e_(this._listeners.decorator,e)}registerTextContentListener(e){return e_(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Ky(e_(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&Mu(35);let r=this._commands;r.has(e)||r.set(e,[new md,new md,new md,new md,new md]);let i=r.get(e);i===void 0&&Mu(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&Mu(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=fue(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=fue(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=S_(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return J_(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=W_(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Zg(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=Qp.get(e);if(t===void 0)return void Sm();let n=$p.get(t);if(n===void 0)return void Sm();Qp.delete(e);let r=d_(e);l_(r)?(function(e){if(e._parentEditor!==null){let t=F_(e),n=t[t.length-1]._key;vm.get(n)===e&&vm.delete(n)}else vm.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Mu(198);let i=_m(e);for(let e=0;efunction(e,t){let n=e.inputType;n===`deleteCompositionText`||Lu&&q_(t)||n!==`insertCompositionText`&&mg(t,()=>{lm(e,t)||J_(t,jce,e)},{event:e})}(e,t)]),zu&&e.push([`keyup`,(e,t)=>function(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}(e,t)]),Zp=e,e}();for(let n=0;n{xm(e)||(bm(e),(t.isEditable()||r===`click`)&&o(e,t))}:e=>{if(xm(e))return;bm(e);let n=t.isEditable();switch(r){case`cut`:return n&&J_(t,zp,e);case`copy`:return J_(t,Rp,e);case`paste`:return n&&J_(t,fp,e);case`dragstart`:return n&&J_(t,Ip,e);case`dragover`:return n&&J_(t,Lp,e);case`dragend`:return n&&J_(t,Lce,e);case`focus`:return n&&J_(t,Up,e);case`blur`:return t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1,n&&J_(t,Bce,e);case`drop`:return n&&J_(t,Pp,e)}};i.push(Yp(e,r,s))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),sg(this);cg(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=xg(e),r._selection=e._selection?e._selection.clone():null),Td(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),sg(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,mg(this,()=>{if(a&&this._updateTags.add(a),n&&(Nu(38),k_().append(Yg())),e._parsed)for(let[e,t]of r._nodeMap.entries())$(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=Sg(),i=zh,a=Vh,o=Bh,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,zh=r,Vh=!1,Bh=t,r_(null);try{let i=t._nodes;ag(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,zh=i,Vh=a,Bh=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&sg(this),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):pg(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),mg(this,()=>{let r=Q(),i=k_();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||j_(r.clone()),ev(`focus`),tv(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=hv(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,cg(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>$h()))}toJSON(){return{editorState:this._editorState.toJSON(sce())}}},n_=null;function r_(e){n_=e}var i_=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),qle=1;function a_(e,t){let n=o_(e,t);return n===void 0&&Mu(30,t),n}function o_(e,t){return e._nodes.get(t)}var Jle=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function s_(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return h_(t)||gv(t)?Tv(t):null})():t;if(!Ov(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=E_(n),i=n.nodeName;return km(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&d_(n)==null)}function c_(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return u_(t)===e&&e.read(`latest`,()=>!s_(t))}function l_(e){return e instanceof t_}function u_(e){let t=e;for(;t!=null;){let e=d_(t);if(l_(e))return e;t=X_(t)}return null}function d_(e){return e?e.__lexicalEditor:null}function Yle(e){return tce.test(e)?`rtl`:nce.test(e)?`ltr`:null}function f_(e){return Ym(e)||e.isToken()}function p_(e){return f_(e)||e.isSegmented()}function m_(e){return kv(e)&&e.nodeType===3}function h_(e){return kv(e)&&e.nodeType===9}function Xle(e){let t=e;for(;t!=null;){if(m_(t))return t;t=t.firstChild}return null}function g_(e,t,n){let r=Zu[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Zu.superscript:t===`superscript`?i&=~Zu.subscript:t===`lowercase`?(i&=~Zu.uppercase,i&=~Zu.capitalize):t===`uppercase`?(i&=~Zu.lowercase,i&=~Zu.capitalize):t===`capitalize`&&(i&=~Zu.lowercase,i&=~Zu.uppercase),i}function Zle(e){return X(e)||Og(e)||vg(e)}function __(e,t){let n=function(){let e=n_;return n_=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Yh(),Xh();let r=Qh(),i=Zh(),a=``+qle++;i._nodeMap.set(a,e),$(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function v_(e){iy(e)!==null&&Mu(380,e.__key,String(iy(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function y_(e){Xh(),Em(e)&&Mu(323,e.__key,e.__type);let t=e.__parent===null?ry(e)?e.__slotHost:null:e.__parent,n=Zh(),r=Qh(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?ry(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),$(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function b_(e){Yh();let t=Qh(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=S_(n);e!==null&&e.getWritable()}if(e!==null){let t=S_(e);t!==null&&t.getWritable()}}}function x_(){return Jh()?null:Qh()._compositionKey}function S_(e,t){let n=(t||Zh())._nodeMap.get(e);return n===void 0?null:n}function C_(e,t){let n=T_(e,Qh());return n===void 0?null:S_(n,t)}function w_(e,t,n){e[`__lexicalKey_${t._key}`]=n}function T_(e,t){return e[`__lexicalKey_${t._key}`]}function E_(e,t){let n=e;for(;n!=null;){let e=C_(n,t);if(e!==null)return e;n=X_(n)}return null}function D_(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function O_(e){return e.read(()=>k_().getTextContent())}function k_(){return Zh()._nodeMap.get(`root`)}function A_(e,t){if(!(cv(e)&&e.isAttached()&&(bg(e)?e.getChildrenSize()===0:e.isEmpty())&&(bg(e)||t!==null&&Nv(t))))return null;let n=Yg();return e.append(n),n}function j_(e){Yh();let t=Zh();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Z(e)&&Qh()._slotsUsed&&yh(e)),t._selection=e}function M_(){Yh(),Td(Qh())}function N_(e){let t=function(e,t){let n=e;for(;n!=null;){let e=T_(n,t);if(e!==void 0)return e;n=X_(n)}return null}(e,Qh());return t===null?null:S_(t)}function P_(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function F_(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function I_(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function L_(e){return m_(e)?e.nodeValue:null}function R_(e,t,n){let r=hv(iv(t));if(r===null)return;let i=Cv(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=L_(a),r=E_(a);if(t!==null&&X(r)){if((t===Gu||t===qu)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&z_(r,t,o,s,e)}}}function z_(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing();if(a.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(Gu)&&(s=t.slice(0,-Gu.length)),i)){let e=qu,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){let t=Q();if(s===``){if(b_(null),Vu||zu||Wu)a.remove();else{let e=Qh();B_(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let i=a.getParent(),c=Eh(),l=a.getTextContentSize(),u=x_(),d=a.getKey();if(a.isToken()&&!o||u!==null&&d===u&&!o||Z(c)&&(i!==null&&!i.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===e.__key&&c.anchor.offset===0&&!a.canInsertTextBefore()&&!o||c.focus.key===e.__key&&c.focus.offset===l&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Z(t)||n===null||r===null)return void B_(a,s,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Gm(a.getTextContent());a.replace(e),a=e}B_(a,s,t)}}}function B_(e,t,n){if(e.setTextContent(t),Z(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Dy(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function V_(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(bg(e))return t;t=e}return null}function H_(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(mf(e),!bg(t))return e;let u=V_(n.getNode());return $(u)&&u.isShadowRoot()&&u.is(V_(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function Qle(e){let t=k_();if(Z(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(bg(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),H_(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?($(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),H_(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),H_(e,a),e)}{let e=t.select(0,t.getChildrenSize());return j_(H_(e,t)),e}}function U_(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function W_(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Uy(i);return n[t]=e,e}return i}function G_(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&Mu(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function K_(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function $le(e,t){let n=e.offset;if(e.type===`element`)return K_(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?K_(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function q_(e){let t=iv(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function J_(e,t,...n){return ug(e,t,n[0],e)}function Y_(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&Mu(75,t),n}function X_(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return gv(n)?n.host:null}function Z_(e){return h_(e)?e:Ov(e)?e.ownerDocument:null}function Q_(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function eue(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+Q_(o.scrollPaddingLeft,i)*l,p=d+(i-Q_(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(mp&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function $_(e){return Qh()._updateTags.has(e)}function ev(e){Yh(),Qh()._updateTags.add(e)}function tv(e){Yh(),Qh()._deferred.push(e)}function nv(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function rv(e){let t=Z_(e);return t?t.defaultView:null}function iv(e){let t=e._window;return t===null&&Mu(78),t}function av(e){return $(e)&&e.isInline()||vg(e)&&e.isInline()}function ov(e){let t=e.getLatest();for(;t!==null;){if(iy(t)!==null&&$(t))return t;let e=t.getParentOrThrow();if(cv(e))return e;t=e}return t}function sv(e){return $(e)&&e.isShadowRoot()}function cv(e){return bg(e)||sv(e)}function lv(e,t=!1){let n=e.constructor.clone(e,i_);return __(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function uv(e){let t=Qh(),n=e.getType(),r=o_(t,n);r===void 0&&Mu(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||Mu(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||Mu(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Mu(203,e.constructor.name,n,r.name,r.getType()),t}return e}function dv(e,t){!bg(e.getParent())||$(t)||vg(t)||Mu(99)}function fv(e){let t=S_(e);return t===null&&Mu(63,e),t}function pv(e){if(!e||e.isInline())return!1;if(vg(e))return!0;if($(e)){if(e.isShadowRoot()){let t=e.getParent();return!($(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function mv(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function hv(e){return Pu?(e||window).getSelection():null}function tue(e){let t=rv(e);return t?t.getSelection():null}function gv(e){return Av(e)&&`host`in e}var nue=[];function _v(e){let t=e.getRootNode();if(t===e||!gv(t))return nue;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!gv(e))break;n.push(e),r=e.host}return n}function*vv(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(h_(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function yv(e){return e===null?document:e.ownerDocument}function bv(){let e=tg();return yv(e===null?null:e._rootElement)}function xv(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=_v(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Sv(e,t){let n=xv(e,t);if(n!==null){let e=rue(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Cv(e,t){let n=xv(e,t);return n===null?e:iue(n,aue(e))}function rue(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function iue(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function aue(e){return e.direction}function wv(e){let t=e.getRootNode();return h_(t)||gv(t)?t.activeElement:null}function Tv(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Ev(e){let t=e.target;if(t!==null&&Ov(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function Dv(e){return Ov(e)&&e.tagName===`A`}function oue(e){return Ov(e)&&e.tagName===`TR`}function Ov(e){return kv(e)&&e.nodeType===1}function kv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Av(e){return kv(e)&&e.nodeType===11}var sue=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function jv(e){return!(!Ov(e)||!e.style.display.startsWith(`inline`))||sue.test(e.nodeName)}var cue=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Mv(e){return(!Ov(e)||!e.style.display.startsWith(`inline`))&&cue.test(e.nodeName)}function Nv(e){if(vg(e)&&!e.isInline())return!0;if(!$(e)||cv(e))return!1;let t=e.getFirstChild(),n=t===null||Og(t)||X(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Pv(){return Qh()}function Fv(e=Pv()){return e._config.dom||Qg}function Iv(e,t,n=Pv()){let r=Fv(n).$getDOMSlot(e,t,n);return $(e)&&(lue(r)||Mu(344,e.getKey(),e.getType())),r}function lue(e){return e instanceof dd}function Lv(e,t,n=Pv()){return Xle(Iv(e,t,n).element)}var uue=new WeakMap,due=new Map;function fue(e){if(!e._readOnly&&e.isEmpty())return due;e._readOnly||Mu(192);let t=uue.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),uue.set(e,t)),t}function pue(e){let t=e.constructor.clone(e,i_);return t.afterCloneFrom(e),t}function mue(e){return(t=pue(e))[Tm]=!0,t;var t}function Rv(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function zv(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Bv(e,t){let n=t.style.textAlign;return n&&n in $u?e.setFormat(n):e}function Vv(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function hue(e){return!0===e.__lexicalUnmanaged}function gue(e,t=Pv()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Hv(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(Ov(n)&&n.hasAttribute(`data-lexical-slot`)||T_(n,t)!==void 0)return!1;n=X_(n)}return!1}function Uv(e,t){return Hd(e,t)&&e[t]!==Om[t]}var Wv=new WeakMap;function Gv(e){let t=Wv.get(e);return t===void 0?function(e){let t=e.prototype!=null&&id in e.prototype?e.prototype[id]():void 0,n=function(e){if(!(e===Om||e.prototype instanceof Om)){let t=``,n=``;try{t=e.getType()}catch{}try{t_.version&&(n=JSON.parse(t_.version))}catch{}Mu(290,e.name,t,n)}return e===_g||e===hg||e===Om}(e),r=!n&&Uv(e,`getType`)?e.getType:void 0,i=r&&!(_ue in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Hd(e.prototype,id),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Wv.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=qv(e);for(let[i,a]of r){let r=Eue(e,i,a);if(r===null)continue;if(kd(r)){let t=r.field;if(t===`__proto__`&&Mu(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])Hd(t,String(r))||Mu(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&Mu(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?vue:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of qv(e).fieldsDerivedFirst){let a=Tue(e,r,i);if(a===null)continue;if(kd(a)){let o=a.field;o===`__proto__`&&Mu(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&Mu(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&Mu(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?wue:[...n.values()]}(e),i=qv(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Xv(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n{r_(t);let r=new e;return n!==i_&&r.afterCloneFrom(t),r}),Uv(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Zv(e);return n.updateFromJSON===Om.prototype.updateFromJSON?function(e,t){return Aue(e.__state||t.$!==void 0?of(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!Uv(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Xv(e)){let e=t.prototype;if(Hd(e,`afterCloneFrom`))continue;let r=Pue(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?Kv(Gv(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Cue:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}var wue=[];function Tue(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?Sue(t):r;return kd(i)?yue(e,t,i,Sue(t)):i}function Eue(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?xue(t):r;return kd(i)?yue(e,t,i,xue(t)):i}function Due(e){return e}function Jv(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function Oue(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&Jv(i,r)}}function kue(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function Aue(e,t){let{flatStates:n,generated:r,setters:i}=Kv(Gv(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;ee)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r!n.has(e))}function*Xv(e){for(let t=e;t&&(t===Om||km(t.prototype));){let e=Yv(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||ey(t)}}function Zv(e){let t=Pv();Yh();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:uv(r)}var Qv=(e,t)=>{let n=e;for(;n!=null&&!bg(n);){if(t(n))return n;n=n.getParent()}return null};function $v(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?S_(r):t.get(r);e??Mu(174),n.push(r),r=e.__next}return n}function ey(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var ty=new Map;function ny(e){return $(e)||vg(e)}function ry(e){return $(e)||vg(e)}function iy(e){let t=e.getLatest();return ry(t)?t.__slotHost:null}function ay(e){let t=iy(e);if(t===null)return null;let n=S_(t);return $(n)||vg(n)||Mu(370),n}function Fue(e){let t=ay(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of cy(t))if(r===n)return e;return null}function oy(e){let t=e.getLatest();for(;t!==null;){if(iy(t)!==null)return t;t=t.getParent()}return null}function sy(e){if(e===null)return null;let t=Z(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:oy(t)}function cy(e){let t=e.getLatest();return ny(t)&&t.__slots!==null?t.__slots:ty}function ly(e){return Array.from(cy(e).keys())}function uy(e,t){let n=cy(e).get(t);return n===void 0?null:S_(n)}var Iue=[`__proto__`,`constructor`,`prototype`],dy=Symbol(`slotMapOwner`);function fy(e){let t=e.__slots;return t!==null&&t[dy]===e||(t=new Map(t),t[dy]=e,e.__slots=t),t}var py=new WeakMap,Lue=[];function Rue(e){for(let{ownNodeConfig:t}of Xv(e)){let e=t&&t.slots;if(e)return e}return Lue}function my(e){let t=``;for(let n of ly(e)){let r=uy(e,n);r!==null&&(t+=r.getTextContent())}return t}function hy(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?et):1:i===void 0?-1:r-i}function zue(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||Mu(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!$(n)&&!vg(n)||n.isInline())&&Mu(374,n.__key);let i=e.getWritable(),a=fy(i),o=a.get(t);o!==void 0&&Bue(o);let s=n.getWritable(),c=ay(s);if(c!==null){let e=Fue(s);e!==null&&fy(c.getWritable()).delete(e),s.__slotHost=null}return v_(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=py.get(e);if(t===void 0){let n=Rue(e),r=new Map;for(let t of n)Iue.includes(t)&&Mu(371,e.name,t),r.has(t)&&Mu(372,e.name,t),r.set(t,r.size);t=r,py.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&hy(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>hy(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),Qh()._slotsUsed=!0,Zh()._slotsUsed=!0,i}function Bue(e){let t=S_(e);if(t===null)return;let n=t.getWritable();ry(n)||Mu(377,e),n.__slotHost=null,n.remove()}var Vue={next:`previous`,previous:`next`},gy=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Iy({hasNext:Cy,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Ty(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ty(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&Mu(263,Array.from(o).join(` `))}else i.insert(e);i=Ty(e,this.direction)}for(let e of o.values())e.remove();return this}},_y=class e extends gy{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ky(e,this.direction)}getParentCaret(e=`root`){return Ty(yy(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=vy(this.direction);return Ty(this.getNodeAtCaret(),e)||ky(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Hue={root:bg,shadowRoot:cv};function vy(e){return Vue[e]}function yy(e,t=`root`){return e===null||Hue[t](e)?null:iy(e)===null?e:null}var by=class e extends gy{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ty(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return $(this.origin)?ky(this.origin,this.direction):null}getParentCaret(e=`root`){return Ty(yy(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=vy(this.direction);return Ty(this.getNodeAtCaret(),e)||ky(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof xy)&&this.direction===t.direction&&this.origin.is(t.origin)}},xy=class e extends gy{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ey(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Ty(yy(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ey(this.origin,vy(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof by||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Ty(this.origin,this.direction)}};function Sy(e){return e instanceof xy}function Cy(e){return e instanceof by}function wy(e){return e instanceof _y}var Uue={next:class extends xy{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends xy{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Wue={next:class extends by{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends by{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Gue={next:class extends _y{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends _y{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Ty(e,t){return e?new Wue[t](e):null}function Ey(e,t,n){return e?new Uue[t](e,Dy(e,n)):null}function Dy(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Nu(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Oy(e,t){return new que(e,t)}function ky(e,t){return $(e)?new Gue[t](e):null}function Ay(e){return e&&e.getChildCaret()||e}function jy(e){return e&&Ay(e.getAdjacentCaret())}var Kue=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return Sy(t)?function(e,t){let{direction:n,origin:r}=e;return Oy(e,Dy(r,t===`focus`?vy(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Oy(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=Sy(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Sy(n),i=t=>t.isSameNodeCaret(n)?null:jy(t)||t.getParentCaret(e);return Iy({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},que=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n0&&e.classList.add(...n)}function Gy(e,...t){let n=Uy(...t);n.length>0&&e.classList.remove(...n)}function Ky(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Xue(e,t,n){return Ky(...Object.entries(t).map(([t,r])=>Yp(e,t,r,n)))}function qy(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function Jy(e){let t=e.parentNode;if(t==null)throw Error(`Should never happen`);return[t,Array.from(t.childNodes).indexOf(e)]}function Zue(e,t,n,r,i){let a=t.getKey(),o=r.getKey(),s=yv(e.getRootElement()).createRange(),c=e.getElementByKey(a),l=e.getElementByKey(o),u=n,d=i;if(X(t)&&(c=qy(c)),X(r)&&(l=qy(l)),t===void 0||r===void 0||c===null||l===null)return null;c.nodeName===`BR`&&([c,u]=Jy(c)),l.nodeName===`BR`&&([l,d]=Jy(l));let f=c.firstChild;c===l&&f!=null&&f.nodeName===`BR`&&u===0&&d===0&&(d=1);try{s.setStart(c,u),s.setEnd(l,d)}catch{return null}return!s.collapsed||u===d&&a===o||(s.setStart(l,d),s.setEnd(c,u)),s}function Yy(e){let t=Pv().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Xy(e){let t=bg(e)?e:e.getParent();return t&&Yy(t)}function Zy(e){let t=Xy(e);return t!==null&&t.direction===`rtl`}function Qy(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!p_(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=ch(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=mue(t)),t.__text=p)}}return t}function Que(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function $y(e,t,n){let r=Mg(e,n);if(Vg(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function $ue(e,t,n=Que){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=Qv(t.getNode(),Nv);a=Qv(n.getNode(),Nv);let c=e.isBackward()?`previous`:`next`;i=$(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!$(r)||!r.isEmpty())&&$y(e,t,n)}(n,a,vy(c)),$(s)&&o.set(s.getKey(),s),$(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if($(t)&&Nv(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=Qv(t,Nv);$(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(ay(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function eb(e){let t=tb(e);return t!==null&&t.writingMode===`vertical-rl`}function tb(e){let t=e.anchor.getNode();return $(t)?Yy(t):Xy(t)}function nb(e,t){let n=eb(e)?!t:t;rb(e)&&(n=!n);let r=Mg(e.focus,n?`previous`:`next`);if(Vg(r))return!1;if(Sy(r)&&!Ym(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(X(e)&&!Ym(e))return!0}for(let e of Ny(r)){if(wy(e))return!e.origin.isInline();if(!$(e.origin)){if(vg(e.origin))return!0;break}}return!1}function ede(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function rb(e){let t=tb(e);return t!==null&&t.direction===`rtl`}function ib(e,t,n){let r=rb(e),i;i=eb(e)||r?!n:n,ede(e,t,i,`character`)}function tde(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function nde(e,t){return Array.from(rde(e,t))}function rde(e,t){return ide(`next`,e,t)}function ab(e,t){let n=Wg(Ty(e,t));return n&&n[0]}function ide(e,t,n){let r=k_(),i=t||r,a=$(i)?ky(i,e):Ty(i,e),o=ade(i),s=n?jy(Ay(Ty(n,e)))||ab(n,e):ab(i,e),c=o;return Iy({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;wy(e)&&c++;let t=Wg(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function ade(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??ay(n))t++;return t}function ob(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function ode(e){let t=Qv(e,e=>$(e)&&!e.isInline());return $(t)||tde(4,e.__key),t}function sb(e){let t=Q()||Eh(),n;if(Z(t))n=Mg(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=Ty(r,`next`))}n||=ky(k_(),`previous`).getFlipped().insert(Yg())}let r=Kg(e,n,Vg(i=n)||Wg(Sy(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=jy(r);return Pg(Py(wy(a)?Bg(a):r)),e.getLatest()}function cb(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function lb(e){let t=null;if(cb(e,DragEvent)?t=e.dataTransfer:cb(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function ub(e){let t=Q();if(!Z(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t$(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function sde(e,t){ky(e,`next`).insert(t)}function db(e,t){return fb(e,t,null)}function fb(e,t,n){let r=!1;for(let i of mb(e))t(i)?n!==null&&n(i):(r=!0,$(i)&&fb(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function pb(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if($(e))for(let t of mb(e))r.push(t);return n}function mb(e){return cde(ky(e,`previous`))}function cde(e){return Iy({hasNext:Cy,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function lde(e){Lg(Ty(e,`next`)).splice(1,e.getChildren())}function hb(e,t){let n=Q();if(Z(n)&&n.isCollapsed()){let r=Qv(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&ude(n.anchor,r))return r.insertBefore(Yg()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function gb(e,t){let n=Q();if(Z(n)&&n.isCollapsed()){let r=Qv(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&dde(n.anchor,r))return r.insertAfter(Yg()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function ude(e,t){return $y(e,t,`previous`)}function dde(e,t){return $y(e,t,`next`)}function fde(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var _b={tag:`history-merge`};function pde(){let e=k_();e.isEmpty()&&e.append(Yg())}var mde={config:{setOptions:_b,updateOptions:_b},init:({$initialEditorState:e=pde})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Rle(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[yg,Vm,Eg,qm,Jg]};function vb(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function hde(){let e;try{e=`0.52.0+prod.esm`}catch{}return e??`"+source"`}var gde=hde(),_de=new Set([`__proto__`,`constructor`,`prototype`]);function yb(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!_de.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=yb(n[e],r[e]));return e}return t}function bb(e){return e.id===0}function xb(e){return e.id===2}var vde=new Set,yde=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Hy;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;xb(t)||vb(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&vb(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&vb(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&vb(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&vb(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&vb(311),this._signal}getInitResult(){this.extension.init===void 0&&vb(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||vb(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||vb(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&vb(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&vb(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||vb(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||vde}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||vb(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Sb=Symbol.for(`@lexical/extension/LexicalBuilder`);function bde(...e){return Eb.fromExtensions(e).buildEditor()}function Cb(){}function xde(e){throw e}function wb(e){return Array.isArray(e)?e:[e]}var Tb=gde,Eb=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Tb,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[wb(mde)];for(let e of t)n.push(wb(e));return new e(n)}static maybeFromEditor(t){let n=t[Sb];return n&&(n.PACKAGE_VERSION!==Tb&&vb(292,n.PACKAGE_VERSION,Tb),n instanceof e||vb(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&vb(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign($g({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[Sb]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=Cb;function t(){try{e()}finally{e=Cb}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Ky(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&vb(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&vb(296);let[t]=wb(e);typeof t.name!=`string`&&vb(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&vb(298,t.name),!n){n=new yde(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&vb(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&vb(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=wb(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(xb(i))return;let a=n.extension.name;var o;bb(i)||vb(300,a,r||`[unknown]`),bb(o=i)||vb(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||vb(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())bb(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&vb(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Ky(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of fde(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&vb(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&yb(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=xde,e}};function Db(e,t){let n=Eb.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var Sde=Symbol.for(`preact-signals`);function Ob(){if(Nb>1)Nb--;else{var e,t=!1;for((function(){var e=Ib;for(Ib=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Mb!==void 0;){var n=Mb;for(Mb=void 0,Pb++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Vb(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Pb=0,Nb--,t)throw e}}function Cde(e){if(Nb>0)return e();Fb=++wde,Nb++;try{return e()}finally{Ob()}}var kb,Ab=void 0;function jb(e){var t=Ab,n=kb;Ab=void 0,kb=void 0;try{return e()}finally{Ab=t,kb=n}}var Mb=void 0,Nb=0,Pb=0,wde=0,Fb=0,Ib=void 0,Lb=0;function Rb(e){if(Ab!==void 0){var t=e.n;if(t===void 0||t.t!==Ab)return t={i:0,S:e,p:Ab.s,n:void 0,t:Ab,e:void 0,x:void 0,r:t},Ab.s!==void 0&&(Ab.s.n=t),Ab.s=t,e.n=t,32&Ab.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ab.s,t.n=void 0,Ab.s.n=t,Ab.s=t),t}}function zb(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}zb.prototype.brand=Sde,zb.prototype.h=function(){return!0},zb.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?jb(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},zb.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&jb(function(){var e;(e=t.Z)==null||e.call(t)}))}},zb.prototype.subscribe=function(e){var t=this;return Jb(function(){var n=t.value;jb(function(){return e(n)})},{name:`sub`})},zb.prototype.valueOf=function(){return this.value},zb.prototype.toString=function(){return this.value+``},zb.prototype.toJSON=function(){return this.value},zb.prototype.peek=function(){var e=this;return jb(function(){return e.value})},Object.defineProperty(zb.prototype,"value",{get:function(){var e=Rb(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Pb>100)throw Error(`Cycle detected`);(function(e){Nb!==0&&Pb===0&&e.l!==Fb&&(e.l=Fb,Ib={S:e,v:e.v,i:e.i,o:Ib})})(this),this.v=e,this.i++,Lb++,Nb++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ob()}}}});function Bb(e,t){return new zb(e,t)}function Vb(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Hb(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ub(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Wb(e,t){zb.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Lb-1,this.f=4}Wb.prototype=new zb,Wb.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Lb))return!0;if(this.g=Lb,this.f|=1,this.i>0&&!Vb(this))return this.f&=-2,!0;var e=Ab;try{Hb(this),Ab=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Ab=e,Ub(this),this.f&=-2,!0},Wb.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}zb.prototype.S.call(this,e)},Wb.prototype.U=function(e){if(this.t!==void 0&&(zb.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Wb.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Wb.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=Rb(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Tde(e,t){return new Wb(e,t)}function Gb(e){var t=e.m;if(e.m=void 0,typeof t==`function`){Nb++;var n=Ab;Ab=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Kb(e),t}finally{Ab=n,Ob()}}}function Kb(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Gb(e)}function Ede(e){if(Ab!==this)throw Error(`Out-of-order effect`);Ub(this),Ab=e,this.f&=-2,8&this.f&&Kb(this),Ob()}function qb(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,kb&&kb.push(this)}qb.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},qb.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Gb(this),Hb(this),Nb++;var e=Ab;return Ab=this,Ede.bind(this,e)},qb.prototype.N=function(){2&this.f||(this.f|=2,this.u=Mb,Mb=this)},qb.prototype.d=function(){this.f|=8,1&this.f||Kb(this)},qb.prototype.dispose=function(){this.d()};function Jb(e,t){var n=new qb(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Yb(e,t){let n;return Bb(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Xb={build:e=>Yb(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},Dde=new Set,Zb={build(e,t,n){let r=n.getDependency(Xb).output,i=Bb({watchedNodeKeys:new Map}),a=Yb(()=>{},()=>Jb(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if(Q())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=S_(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=Tde(()=>(a.value||Dde).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[Xb],name:`@lexical/extension/NodeSelection`},Ode=ap(`INSERT_HORIZONTAL_RULE_COMMAND`),Qb=class extends _g{$config(){return this.config(`horizontalrule`,{extends:_g,importDOM:{hr:()=>({conversion:kde,priority:0})}})}exportDOM(){return{element:bv().createElement(`hr`)}}createDOM(e){let t=bv().createElement(`hr`);return Wy(t,e.theme.hr),t}getTextContent(){return` -`}isInline(){return!1}updateDOM(){return!1}};function kde(){return{node:$b()}}function $b(){return Zv(Qb)}function ex(e){return e instanceof Qb}var Ade={dependencies:[Xb,Zb],name:`@lexical/extension/HorizontalRule`,nodes:()=>[Qb],register(e,t,n){let{watchNodeKey:r}=n.getDependency(Zb).output,i=Bb({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return Ky(e.registerCommand(Ode,e=>{let t=Q();return Z(t)?(t.focus.getNode()!==null&&sb($b()),!0):!1},0),e.registerCommand(sp,e=>{if(kv(e.target)){let t=C_(e.target);if(ex(t))return function(e,t=!1){let n=Q(),r=e.isSelected(),i=e.getKey(),a;t&&ih(n)?a=n:(a=wh(),j_(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(Qb,(t,n)=>{Cde(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:Bb(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),Jb(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(Jb(()=>{let e=t.value;e&&(n.value?Wy(e,a):Gy(e,a))}));return Ky(...e)}))}};function jde(e){return Db(Pv(),e)}function tx(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var nx;function rx(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function ix(e){return nx&&nx.editor===e?nx:void 0}function ax(e,t){let n=ix(t);return n&&n[e]}function Mde(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(rx(e,n))]}return t}function ox(e,t){let n=t;for(let r of e){let[e,i]=Mde(n,r),a=e.key;if(n===t&&rx(n,e)===i)continue;let o=n===t||n===void 0?Nde(t):n;o[a]=i,n=o}return n}function Nde(e){return Object.create(e||null)}function sx(e,t){return[e,t]}function cx(e,t,n,r=Pv()){let i=nx,a=ix(r);try{return nx={...a,editor:r,[e]:t},n()}finally{nx=i}}function lx(e,t=()=>{}){return(n,r=Pv())=>i=>{let a=ix(r),o=a&&a[e],s=ox(n,o||t(r));return s&&s!==o?cx(e,s,i,r):i()}}function ux(e,t,n,r){return Object.assign(ef(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var Pde=(e,t,n)=>{dx(e),n()};function dx(e){if(!h_(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>_x(e,[...t,n]);return{[gx]:n,attr:(e,t,n)=>i(bx(e,t,n)),classAll:(...e)=>i(yx(e)),classAny:(...e)=>i(function(e){let t=vx(e);return t.length===0?()=>!1:e=>{if(!Ov(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>Ov(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!Ov(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}tx(362,JSON.stringify(e))}(e,t,n))}}function vx(e){let t=[];for(let n of e)n&&t.push(n);return t}function yx(e){let t=vx(e);return t.length===0?()=>!0:e=>{if(!Ov(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function bx(e,t,n){if(!0===t)return t=>Ov(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>Ov(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!Ov(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}tx(361,JSON.stringify(e))}function xx(e){return{[gx]:e}}var Vde=xx({kind:`text`,predicate:m_,tags:new Set}),Hde=xx({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function Sx(){return _x(new Set,[])}function Cx(){return Hde}function wx(...e){e.length>0||tx(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return _x(t,[])}function Tx(){return Vde}var Ex={any:Sx,comment:Cx,tag:wx,text:Tx},Dx=/[A-Za-z0-9_-]/,Ude=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&Dx.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||tx(364,String(this.pos+1),t,this.source)}};function Wde(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(Dx.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(bx(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(bx(t,r))}}}return r.length>0&&n.push(yx(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function Gde(e){let t=new Ude(e,0),n=[];for(;n.push(Wde(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return _x(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return _x(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function Ox(e,t,n){return ux(hx,e,t,n)}var kx=Ox(`textFormat`,()=>0),Ax=Ox(`textStyle`,()=>({}));function Kde(e){if(!Ov(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function qde(e){if(m_(e))return!0;if(!Ov(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!Mv(e)&&jv(e)}var Jde=Ox(`whitespaceConfig`,()=>({isInline:qde,preservesWhitespace:Kde})),jx=Ox(`importOverlays`,()=>[]),Yde=class{constructor(e){this.record=e}get(e){return rx(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(rx(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function Mx(e){let t=Db(e,mx);return t?t.output.defaults:void 0}function Xde(e,t=Pv()){return rx(function(e){return ax(hx,e)||Mx(e)}(t),e)}var Nx=lx(hx,Mx);function Px(e){return xh(e)||vg(e)&&!e.isInline()}function Fx(e,t){if(!Ov(t))return e;let n=t.style.textAlign;if(!Rx(n))return e;for(let t of e)xh(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function Ix(e,t,n){e.length===1&&Og(e[0])&&(e=[]);let r=Yg();if(Ov(n)){let e=n.style.textAlign;Rx(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var Zde={$accepts:Px,$packageRun:Ix,name:`BlockSchema`},Qde={$accepts:Px,$packageRun:Ix,name:`RootSchema`},Lx=Ex,$de=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function Rx(e){return $de.has(e)}var efe={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},tfe={CODE:16,MARK:128},nfe=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),rfe={$import:(e,t)=>{let n=e.get(kx),r=efe[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=Zu.lowercase,n|=Zu.uppercase|Zu.capitalize):o===`uppercase`?(t|=Zu.uppercase,n|=Zu.lowercase|Zu.capitalize):o===`capitalize`?(t|=Zu.capitalize,n|=Zu.lowercase|Zu.uppercase):o===`none`&&(n|=Zu.lowercase|Zu.uppercase|Zu.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=tfe[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[sx(kx,s)]})},match:Lx.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function zx(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(m_(r))return r;if(r.nodeName===`BR`)return null}}function Bx(e,t){return t!==0&&X(e)?e.setFormat(t):e}function Vx(e,t){if(X(e)){let n=function(e){let t=``;for(let n in e)nfe.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var ife={$import:(e,t)=>{let n=e.get(kx),r=e.get(Ax),i=e.get(Jde);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=Ph(t.textContent||``);for(let t of e)Bx(t,n),Vx(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=zx(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=zx(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=Gm(a);return Bx(o,n),Vx(o,r),[o]},match:Lx.text(),name:`@lexical/html/#text`},afe={$import:()=>[],match:Lx.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},ofe={$import:(e,t)=>kg(t)||Ag(t)?[]:[Dg()],match:Lx.tag(`br`),name:`@lexical/html/br`},sfe=[afe,{$import:(e,t)=>{let n=Yg();if(Bv(n,t),Rv(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&Rx(e)&&n.setFormat(e)}return zv(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Lx.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>Pv().hasNode(Qb)?[$b()]:n(),match:Lx.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>Mv(t)?Fx(e.$importChildren(t,{schema:Zde}),t):n(),match:Lx.any(),name:`@lexical/html/transparent-block`},ife,ofe,rfe];function cfe(e,t){let n=[],r=0,i=0;for(;r{let c=function(e){let t=e[gx];return t===void 0&&tx(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,cfe(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function Ux(e,t){return m_(t)?e.textIndices:t.nodeType===8?e.commentIndices:Ov(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:lfe}var lfe=Object.freeze([]);function Wx(e){let t=[];for(let n of e)if(ufe(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function ufe(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function Gx(e){let t=Wx(e);return{__type:`CompiledOverlayRules`,dispatch:Hx(t),rules:t}}var dfe=Object.freeze({});function ffe(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>Kx(e,t,n);return n&&n.context?Nx(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>qx(e,t,n),captures:t,get:t=>Xde(t,e.editor),session:e.session}}function Kx(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=qx(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function qx(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=Ux(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=Ux(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return Jx(e,t);let r=0,i=0,a=()=>{for(;r{let o=ax(hx,e)||r,s=a&&a.context?ox(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new Yde(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),cx(hx,c,()=>function(e,t,n,r){return Kx({dispatch:e,editor:t,overlays:r.get(jx).map(e=>e.dispatch),session:r},h_(n)?n.body:n,{schema:Qde})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[Pde],rules:[{$import:(e,t)=>e.$importChildren(t),match:Ex.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>Hy(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:mx},Xx={dependencies:[[Yx,{rules:sfe}]],name:`@lexical/html/CoreImport`},Zx={any:Sx,comment:Cx,css:Gde,tag:wx,text:Tx},Qx=new Set([`STYLE`,`SCRIPT`]);function $x(e,t){dx(t);let n=h_(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Qx.has(t.nodeName)){let n=nS(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof Tg&&t.insertAfter(Dg());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function pfe(e,t=null,n=Pv()){return Bde([sx(Ide,!0)],n)(()=>{let r=k_(),i=zde(n),a=sy(t),o=e.append.bind(e);for(let e of($(a)?a:r).getChildren())tS(n,e,o,t,i);return e})}function eS(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&tx(338),kle(e),pfe(bv().createElement(`div`),t,e).innerHTML}function tS(e,t,n,r=null,i=Fv(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&X(t)&&(s=Qy(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=bv().createDocumentFragment(),p=d?d():$(s)?s.getChildren():[],m=a&&ih(r)&&$(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=tS(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((Ov(c)||Av(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(Og(t)&&Ov(e)&&Mv(e)&&n!==null&&n.nodeName===`BR`){let t=bv().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Av(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function nS(e,t,n,r,i=new Map,a){let o=[];if(Qx.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!cv(s))&&(s!=null&&xh(s)||r);for(let e=0;e{let e=new Tg;return n.push(e),e}:Yg)),s==null){if(f.length>0)for(let e of f)o.push(e);else Mv(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&jv(e.nextSibling)&&jv(e.previousSibling)}(e)&&o.push(Dg())}else $(s)&&s.append(...f);return o}function mfe(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Bb(i===void 0?e[r]:i)}return n}function hfe(e){return()=>{}}function rS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function iS(e,t){let n=e;for(let r=Ty(e,t);r&&(wS(r.origin)||Ym(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function aS(e){return iS(e,`previous`)}function oS(e){return iS(e,`next`)}function gfe(e){let t=aS(e),n=oS(e),r=t;for(;r!==null;){if(wS(r)){let e=Yle(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if($(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function _fe(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(wS(e)||Ym(e)||Og(e)||rS(167),i=e,Og(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];wS(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(tt.push(Dg()),tab:()=>t.push(Jm()),text:e=>t.push(CS(e))}),t}function sS(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var bfe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function cS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!bfe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var xfe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=cS(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=cS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function Sfe(e,t){e.__highlightType=t.__highlightType}var Cfe=e=>{let t=Ad(e,`mode`),n=Md(e,`detail`,0),r=Md(e,`format`,0),i=jd(e,`mode`),a=Nd(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:cS(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:cS(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:Sfe}},wfe=Yd()({language:Qd(Jd(qd(Ud())),{getter:{field:`__language`}}),theme:Qd(Jd(Ud()),{getter:{field:`__theme`}})});function lS(e,t){for(let n of e.childNodes)if(Ov(n)&&n.tagName===t||lS(n,t))return!0;return!1}var uS=`data-language`,dS=`data-highlight-language`,fS=`data-theme`,Tfe=hfe(),pS=class extends hg{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{extends:hg,generated:xfe,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||lS(e,`BR`))?{conversion:gS,priority:1}:null,div:()=>({conversion:Efe,priority:1}),pre:()=>({conversion:gS,priority:0}),table:e=>yS(e)?{conversion:Dfe,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&yS(n)?{conversion:_S,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&yS(t)?{conversion:_S,priority:3}:null}},json:wfe})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=bv().createElement(`code`);Wy(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(uS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(dS,n));let r=this.getTheme();r&&t.setAttribute(fS,r);let i=this.getStyle();return i&&Nm(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(uS,r):i&&t.removeAttribute(uS);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(dS,r):t.removeAttribute(dS):a&&r&&t.setAttribute(dS,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(fS,o):s&&t.removeAttribute(fS);let c=this.__style,l=e.__style;return c!==l&&Nm(t.style,c,l),!1}exportDOM(e){let t=bv().createElement(`pre`);Wy(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(uS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(dS,n));let r=this.getTheme();r&&t.setAttribute(fS,r);let i=this.getStyle();return i&&Nm(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!Db(Pv(),`@lexical/code`)){Tfe();let t=bS(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(X(i)){let e=aS(i),t=[];for(;;)if(Ym(e))t.push(Jm()),e=e.getNextSibling();else{if(!wS(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;ne.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function mS(e,t){return Zv(pS).setLanguage(e).setTheme(t)}function hS(e){return e instanceof pS}function gS(e){return{node:mS(e.getAttribute(uS),e.getAttribute(fS))}}function Efe(e){let t=e,n=vS(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(vS(t))return!0;t=t.parentElement}return!1}(t)?{node:n?mS():null}:{node:null}}function Dfe(){return{node:mS()}}function _S(){return{node:null}}function vS(e){return e.style.fontFamily.match(`monospace`)!==null}function yS(e){return e.classList.contains(`js-file-line-container`)}function bS(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(hS(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(Og(t)&&Og(t.getPreviousSibling())){let t=Yg();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var Ofe=Yd()({highlightType:Qd(Jd(qd(Ud())),{getter:{field:`__highlightType`}})}),xS=class extends Vm{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:Vm,generated:Cfe,json:Ofe})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return Wy(t,SS(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=SS(n.theme,e.__highlightType),a=SS(n.theme,this.__highlightType);return i!==a&&(i&&Gy(t,i),a&&Wy(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return mS()}};function SS(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function CS(e=``,t){return uv(new xS(e,t))}function wS(e){return e instanceof xS}var TS=`data-language`,ES=`data-theme`;function DS(e){return e.style.fontFamily.match(`monospace`)!==null}function OS(e){let t=e.parentElement;for(;t!==null;){if(DS(t))return!0;t=t.parentElement}return!1}var kfe=Gx([{$import:(e,t)=>e.$importChildren(t),match:Zx.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),Afe={$import:(e,t)=>[mS(t.getAttribute(TS),t.getAttribute(ES)).splice(0,0,e.$importChildren(t))],match:Zx.tag(`pre`),name:`@lexical/code/pre`},jfe={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[mS(t.getAttribute(TS),t.getAttribute(ES)).splice(0,0,e.$importChildren(t))]:n()},match:Zx.tag(`code`),name:`@lexical/code/code-multiline`};function kS(e){if(!Ov(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function AS(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(Ov(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(m_(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function jS(e){for(let t of Array.from(e.children))if(Ov(t)&&kS(t)){if(AS(t)!==null)return!0;let e=t.nextElementSibling;if(e&&kS(e))return!0}else if(jS(t))return!0;return!1}var Mfe=Gx([{$import:(e,t,n)=>{if(!kS(t)||OS(t))return n();let r=AS(t);return r===null||r.length===0?n():[mS().splice(0,0,Ph(r.join(` -`)))]},match:Zx.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!kS(t)||OS(t))return n();let r=t.previousElementSibling;if(r&&kS(r))return[];let i=[],a=t;for(;a&&kS(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[mS().splice(0,0,Ph(i.join(` -`)))]},match:Zx.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),Nfe={$import:(e,t,n)=>DS(t)?[mS().splice(0,0,e.$importChildren(t))]:OS(t)?e.$importChildren(t):n(),match:Zx.tag(`div`),name:`@lexical/code/div`},Pfe={dependencies:[Xx,[Yx,{preprocess:[(e,t,n)=>{jS(h_(e)?e.body:e)&&t.session.update(jx,e=>[...e,Mfe]),n()}],rules:[{$import:(e,t)=>[mS().splice(0,0,e.$importChildren(t,{rules:kfe}))],match:Zx.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:Zx.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},jfe,Afe,Nfe]}]],name:`@lexical/code`,nodes:()=>[pS,xS],register:e=>Ky(e.registerCommand(Ep,e=>{let t=Q();return!(!Z(t)||!bS(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(qm,e=>{e.getFormat()!==0&&hS(e.getParent())&&e.setFormat(0)}))};function MS(e){if(!Z(e))return!1;let t=e.anchor.getNode(),n=hS(t)?t:t.getParent(),r=e.focus.getNode(),i=hS(r)?r:r.getParent();return hS(n)&&n.is(i)}function NS(e){let t=e.getNodes(),n=[];if(t.length===1&&hS(t[0]))return n;let r=[];for(let e=0;e0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=Xm(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function PS(e,t){let n=Q();if(!Z(n)||!MS(n))return!1;let r=NS(n),i=r.length;if(i===0&&n.isCollapsed())return e===Mp?n.insertNodes([Jm()]):function(e,t){let n=e.anchor.getNode();if(!wS(n)&&!Ym(n))return;let r=aS(n);Ym(r)?r.remove():t!==void 0&&wS(r)&&sS(r,t,e)}(n,t),!0;if(i===0&&e===Mp&&n.getTextContent()===` -`){let e=Jm(),t=Dg(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),Pg(Hg(Fy(Ey(e,`next`,0),Bg(Ty(t,`next`))),r)),!0}for(let a=0;a0){let r=i[0];if(a===0&&(r=aS(r)),e===Mp){let e=Jm();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=Xm(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else Ym(r)?r.remove():t!==void 0&&wS(r)&&sS(r,t,n)}}return!0}function FS(e,t){let n=Q();if(!Z(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===wp;if(!MS(n)||!wS(s)&&!Ym(s)||!wS(c)&&!Ym(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=aS(s),d=oS(c)):(u=aS(c),d=oS(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;ee.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===wp?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function IS(e,t){let n=Q();if(!Z(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===Cp;if(!MS(n)||!wS(a)&&!Ym(a)||!wS(o)&&!Ym(o))return!1;let c=o,l=gfe(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=_fe(c,i.offset);if(e!==null){let{node:t,offset:r}=e;Og(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else vfe(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function Ffe(e,t,n){return Ky(...n?[e.registerCommand(Tp,e=>!e.altKey&&gb(hS,e),1),e.registerCommand(bp,e=>gb(hS,e),1),e.registerCommand(wp,e=>!e.altKey&&hb(hS,e),1),e.registerCommand(Sp,e=>hb(hS,e),1)]:[],e.registerCommand(Ap,t=>{let n=function(e){let t=Q();if(!Z(t)||!MS(t))return null;let n=e?Np:Mp,r=e?Np:jp,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=NS(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&rS(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=aS(s[0]),d=oS(s[0]),f=Xm(u.getKey(),0,`text`),p=Xm(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(jp,()=>!!MS(Q())&&(Mh([Jm()]),!0),1),e.registerCommand(Mp,()=>PS(Mp),1),e.registerCommand(Np,()=>PS(Np,t),1),e.registerCommand(wp,e=>{let t=Q();if(!Z(t))return!1;let{anchor:n}=t,r=n.getNode();if(!MS(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&hS(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):FS(wp,e)},1),e.registerCommand(Tp,e=>{let t=Q();if(!Z(t))return!1;let{anchor:n}=t,r=n.getNode();return!!MS(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&hS(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):FS(Tp,e))},1),e.registerCommand(Cp,e=>IS(Cp,e),1),e.registerCommand(xp,e=>IS(xp,e),1))}var Ife=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function LS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Ife.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function RS(e,t,n,r,i){let a=LS(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Lfe(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Rfe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=RS(t.indent,0,0,1/0),e.__textFormat=LS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Lfe}};function zfe(e,t){e.__isUnlinked=t.__isUnlinked}var Bfe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=RS(t.indent,0,0,1/0),e.__textFormat=LS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:zfe}},zS=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Vfe=Yd()({rel:Zd(qd(Ud(),{defaultAsNull:!0}),{field:`__rel`}),target:Zd(qd(Ud(),{defaultAsNull:!0}),{field:`__target`}),title:Zd(qd(Ud(),{defaultAsNull:!0}),{field:`__title`}),url:Zd(Ud(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),BS=class extends hg{__url;__target;__rel;__title;$config(){return this.config(`link`,{extends:hg,generated:Rfe,importDOM:{a:()=>({conversion:Hfe,priority:1})},json:Vfe})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=bv().createElement(`a`);return this.updateLinkDOM(null,t,e),Wy(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Dv(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=KS(e);try{let t=new URL(KS(e));if(!zS.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!zS.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=lv(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Z(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Hfe(e){let t=null;if(Dv(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=VS(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function VS(e=``,t){return uv(new BS(e,t))}function HS(e){return e instanceof BS}var Ufe=Yd()({isUnlinked:Zd(Gd(),{field:`__isUnlinked`})}),Wfe=class extends BS{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:BS,generated:Bfe,json:Ufe})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?bv().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function US(e){return e instanceof Wfe}var WS=ap(`TOGGLE_LINK_COMMAND`);function GS(e,t){if(e.type===`element`){let n=e.getNode();return $(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Gfe(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=Q();if(o===null||!Z(o)&&!ih(o))return;if(ih(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=Qv(e,e=>!US(e)&&HS(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=Qv(e,e=>!US(e)&&HS(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=VS(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=Qv(e,e=>!US(e)&&HS(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=Qv(t,e=>!US(e)&&HS(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||$(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=lv(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=Qv(e,HS);if(t!==null)return l(t)}(function(e){let t=Q();if(!Z(t))return e();let n=mf(t),r=n.isBackward(),i=GS(n.anchor,r?-1:0),a=GS(n.focus,r?0:-1);if(e(),i||a){let e=Q();if(Z(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}j_(mf(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=Qv(t,HS);if(o){l(o);continue}if($(t)){if(!t.isInline())continue;if(HS(t)){if(!(US(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();HS(s)&&s.is(e)?s.append(t):(e=VS(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var Kfe=/^\+?[0-9\s()-]{5,}$/;function KS(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Kfe.test(e)?`tel:${e}`:`https://${e}`}function qS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function qfe(e){let t=1,n=e.getParent();for(;n!=null;){if(oC(n)){let e=n.getParent();if(fC(e)){t++,n=e.getParent();continue}qS(40)}return t}return t}function Jfe(e){let t=e.getParent();fC(t)||qS(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),fC(r)&&(n=r);return n}function JS(e){return oC(e)&&fC(e.getFirstChild())}function YS(e,t){return t.getValue()}function Yfe(e,t){return oC(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function XS(e,t){return fC(e)?lv(e).setListType(t):dC(t)}function Xfe(e){let t=Q();if(t!==null){let n=t.getNodes();if(Z(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(cv(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=Yg();i.append(e),n=e.select().getNodes()}}else if(Yfe(i,n)){if(cv(a)){let t=dC(e);i.replace(t);let n=aC();$(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(oC(i)){let t=i.getParentOrThrow();if(ay(t)===null){let n=XS(t,e);ZS(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t0&&e.append(...i),t.remove()}function Zfe(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())oC(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),fC(r.getFirstChild())||n++)}function Qfe(e){let t=new Set;if(JS(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(JS(r)&&JS(i)){let n=i.getFirstChild();if(fC(n)){n.append(e);let i=r.getFirstChild();fC(i)&&n.getListType()===i.getListType()&&(ZS(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(JS(r)){let t=r.getFirstChild();if(fC(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(JS(i)){let t=i.getFirstChild();fC(t)&&t.append(e)}else if(fC(n)){let t=lv(e),a=lv(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function eC(e){if(JS(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(fC(n?n.getParent():void 0)&&oC(n)&&fC(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=lv(e),i=lv(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=lv(e),o=lv(t);a.append(o),ZS(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function $fe(e=!1){let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(oC(n)&&n.getChildrenSize()===0)r=n;else if(X(n)){let e=n.getParent();oC(e)&&e.getChildren().every(e=>X(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Jfe(r),a=r.getParent();fC(a)||qS(40);let o=a.getParent(),s;if(cv(o))s=Yg(),i.insertAfter(s);else{if(!oC(o))return!1;s=lv(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?YS(0,r):1,n=lv(a).setStart(t);if(oC(s)){let e=lv(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!oC(e)&&!fC(e))break;t=e}t.remove()}(r),!0}var epe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function tC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!epe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function tpe(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var npe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`),i=Md(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=tC(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=tC(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=tC(t.start,1),e},afterCloneFrom:tpe}};function rpe(e,t){e.__checked=t.__checked,e.__value=t.__value}var ipe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=tC(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=tC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=tC(t.value,1),e},afterCloneFrom:rpe}},ape=Yd()({checked:Qd(Jd(Gd()),{setter:{field:`__checked`}}),indent:Wd(0,{clamp:!0,integer:!0,max:128,min:0}),value:Zd(Wd(1),{field:`__value`})}),nC=class extends hg{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(fC(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();fC(n)||qS(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of Ty(e,t)){if(!oC(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),cv(t)||(Kg(n,Lg(Ty(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:hg,generated:ipe,importDOM:wm({li:()=>({conversion:ope,priority:0})}),json:ape})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=bv().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!fC(n)||n.getListType()!==`check`||fC(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=fC(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>fC(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...Uy(a)),u.length>0&&Gy(e,...u);let d=[];if(i!==void 0&&d.push(...Uy(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...Uy(a)),d.length>0&&Wy(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&Nm(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=Mm(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in Mm(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),JS(this)?{after(e){if(Ov(e)){let t=e.previousElementSibling;if(Ov(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;ti.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&JS(t)&&JS(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&($S(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=lv(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(JS(this))return!1;let t=this.getParentOrThrow();if(oC(t.getParentOrThrow()))return eC(this),!0;let n=Yg().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=lv(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return fC(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;oC(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&qS(117),(e=Math.floor(e))>=0||qS(199);let t=e,n=this.getIndent();for(;n!==t;)n0&&t.children[0].tagName===`INPUT`)return rC(t.children[0])}let t=e.getAttribute(`aria-checked`),n=aC(t===`true`||t!==`false`&&void 0);return Bv(n,e),{after:iC.bind(null,n),node:zv(n,e)}}function rC(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=aC(e.hasAttribute(`checked`));return{after:iC.bind(null,t),node:t}}function iC(e,t){let n=t[0];return t.length===1&&Xg(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function aC(e){return uv(new nC(void 0,e))}function oC(e){return e instanceof nC}var sC={ol:`number`,ul:`bullet`},spe=Yd()({listType:Qd(Xd(Kd([`number`,`bullet`,`check`]),sC),{getter:{field:`__listType`}}),start:Zd(Wd(1),{field:`__start`}),tag:Qd(Kd([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),cC=class extends hg{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();fC(t)&&e.getListType()===t.getListType()&&$S(e,t)})(e),Zfe(e)},extends:hg,generated:npe,importDOM:wm({ol:()=>({conversion:uC,priority:0}),ul:()=>({conversion:uC,priority:0})}),json:spe})}constructor(e=`number`,t=1,n){super(n);let r=sC[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=bv().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,lC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(lC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(Ov(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e1?r.push(...e):i.push(...e)}}i.length>0&&Gy(e,...i),r.length>0&&Wy(e,...r)}function uC(e){let t;if(function(e){return Ov(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=dC(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(Ov(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?dC(`check`):dC(`bullet`);return zv(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t1&&e.forEach(e=>{fC(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function dC(e=`number`,t=1){return uv(new cC(e,t))}function fC(e){return e instanceof cC}var pC=ap(`INSERT_UNORDERED_LIST_COMMAND`),mC=ap(`INSERT_ORDERED_LIST_COMMAND`);function hC(e,t,n=null){let r=yv(n),i=n?_v(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=X_(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(gv(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>te.bottom?t-e.bottom:0,o=t=>et.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(ne}).createHTML(e):e}var vC=(e,t)=>{if(!Z(t))return t.insertRawText(e),!0;t!==Q()&&j_(t);let n=e=>{let t=Q();Z(t)&&e(t)};return Nh(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([Jm()])),text:e=>n(t=>t.insertText(e))}),!0},yC={"application/x-lexical-editor":[(e,t,n)=>{try{let n=Pv(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return EC(n,gpe(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=Pv();return EC(n,$x(n,new DOMParser().parseFromString(cpe(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[vC],"text/uri-list":[vC]};function lpe(e,t,n,r){if(!e)return!1;let i=a=>!!e[a]&&e[a](t,n,i.bind(null,a-1),r);return i(e.length-1)}function bC(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?tn):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&lpe(e.$importMimeType[i],a,n,t))return!0}return!1}var upe={$importMimeType:yC,$insertDataTransfer:(e,t)=>bC({$importMimeType:yC,priority:_C},e,t),priority:_C},dpe={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>bC(t,e,n),priority:t.priority}),config:{$importMimeType:yC,priority:_C},mergeConfig(e,t){let n=Hy(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function xC(e,t=Q()){return t??gC(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?``:eS(e,t)}function SC(e,t=Q()){return t??gC(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(hpe(e,t))}function CC(e,t,n){(function(){let e=jde(dpe.name);return e?e.output:upe})().$insertDataTransfer(e,t)}var wC=`application/x-lexical-drag`;function fpe(e,t){let n={editorKey:t.getKey()};e.setData(wC,JSON.stringify(n))}function TC(e){let t=e;if(Sy(t)){if(t.offset===0)t=Lg(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(wy(t))t=Lg(Ty(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=Ty(e,`next`)}}}function ppe(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(wC);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=hC(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=E_(n.node);if(r===null)return null;if(X(r))return Ey(r,`next`,n.offset);if($(r))return Ug(r,n.offset,`next`);let i=r.getParent();return i===null?null:Ug(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=Q();if(o){if(!Z(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Hg(Ig(t),`next`),i=TC(e);return Ly(TC(n),i)<=0&&Ly(i,TC(r))<=0}(a,s))return e.preventDefault(),!0}let c=Bg(a),l=Sy(c)?Gg(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Z(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||gC(438),n(r,Pg(Py(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of vv(t)){let t=d_(n);if(l_(t)&&t.getKey()===e&&Ov(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function mpe(e,t){return ppe(e,t,CC)}function EC(e,t,n){e.dispatchCommand(Ace,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Z(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Mg(t,`previous`);if(r){if(Sy(r))n=r.origin;else{let e=Fy(r,ky(k_(),`next`).getFlipped());for(let t of e){if(X(t.origin)){n=t.origin;break}if($(t.origin)&&!t.origin.isInline())break}}}if(n&&X(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function DC(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=$(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&X(o)&&(o=Qy(t,o,`clone`));let s=yd(o),c=$(o)?o.getChildren():[],l=s.children||[];X(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&ih(t)&&$(n)?null:t;for(let r=0;r0){let n={};for(let r of t){let t=uy(o,r);t===null&&gC(366,o.constructor.name,r);let i=[];DC(e,null,t,i),(i.length!==1||$(t)&&t.excludeFromCopy(`clone`))&&gC(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e{e.update(()=>{r(AC(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=hv(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Rp,r=>(cb(r,ClipboardEvent)&&(o(),OC!==null&&(i.clearTimeout(OC),OC=null),t(AC(e,r,n))),!0),4);OC=i.setTimeout(()=>{o(),OC=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function AC(e,t,n){if(n===void 0){let t=hv(e._window),r=Q();if(!r||r.isCollapsed()||!t)return!1;let i=Cv(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!c_(e,a,o))return!1;n=jC(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(MC(r,n),!0)}var _pe=[[`text/html`,xC],[`application/x-lexical-editor`,SC]];function jC(e=Q()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=ype(i,t);e!==null&&(n[r]=e)}return n}(vpe(),e)}function MC(e,t){for(let[n]of _pe)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function vpe(e=Pv()){let t=Db(e,bpe.name);return t?t.output:NC}var NC={"application/x-lexical-editor":[(e,t)=>e?SC(Pv(),e):t()],"text/html":[(e,t)=>e?xC(Pv(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function ype(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var bpe={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:NC},mergeConfig(e,t){let n=Hy(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},xpe={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},PC=Symbol.for(`@lexical/dragon/WindowState`);function Spe(e,t,n){let r=function(e){let t=e[PC];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[PC]=t),t}(e);if(r.installs.size===0){let t=Tpe.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return Cpe.bind(null,e,r,t,n)}function Cpe(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[PC])}function FC(e){return e&&e.ownerDocument.defaultView}function wpe(e){let t=Yb(()=>FC(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=FC(e)}));return Jb(()=>{let n=t.value;if(n)return Spe(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function Tpe(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[PC];if(t===void 0)return null;let n=d_(Tv(e.document));return l_(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=Q();if(Z(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(X(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),X(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=xpe[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var Epe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function IC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Epe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function LC(e,t,n,r,i){let a=IC(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Dpe(e,t){e.__tag=t.__tag}var Ope=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=LC(t.indent,0,0,1/0),e.__textFormat=IC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Dpe}},kpe=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=LC(t.indent,0,0,1/0),e.__textFormat=IC(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},RC=ap(`DRAG_DROP_PASTE_FILE`),zC=ef(`shadowRoot`,{parse:Gd()}),BC=class extends hg{$config(){return this.config(`quote`,{extends:hg,generated:kpe,importDOM:{blockquote:()=>({conversion:jpe,priority:0})},stateConfigs:[{flat:!0,stateConfig:zC}]})}isShadowRoot(){return tf(this,zC)}setIsShadowRoot(e){return nf(this,zC,e)}createDOM(e){let t=bv().createElement(`blockquote`);return Wy(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ov(t)){this.isEmpty()&&t.append(bv().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return VC().updateFromJSON(e)}insertNewAfter(e,t){let n=Yg();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=Yg();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function VC(e){let t=uv(new BC);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function HC(e){return e instanceof BC}var Ape=Yd()({tag:Zd(Kd([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),UC=class extends hg{__tag;$config(){return this.config(`heading`,{extends:hg,generated:Ope,importDOM:{h1:()=>({conversion:GC,priority:0}),h2:()=>({conversion:GC,priority:0}),h3:()=>({conversion:GC,priority:0}),h4:()=>({conversion:GC,priority:0}),h5:()=>({conversion:GC,priority:0}),h6:()=>({conversion:GC,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&WC(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>WC(e)?{conversion:()=>({node:KC(`h1`)}),priority:3}:null},json:Ape})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=bv().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];Wy(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ov(t)){this.isEmpty()&&t.append(bv().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?Yg():KC(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=Yg();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Yg();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function WC(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function GC(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=KC(t),Rv(e,n),Bv(n,e),zv(n,e)),{node:n}}function jpe(e){let t=VC();return Bv(t,e),Rv(e,t),zv(t,e),{node:t}}function KC(e=`h1`){return uv(new UC(e))}function qC(e){return e instanceof UC}function JC(e){return vg(E_(e))}function YC(e){let t=e.focus;return t.key===`root`&&t.offset===k_().getChildrenSize()}function XC(e){let t=e.focus;return t.key===`root`&&t.offset===0}function ZC(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?YC(e):XC(e)))return!1;let r=e.focus.offset;return pv(k_().getChildAtIndex(n?r-1:r))}function QC(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(X(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&X(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Mpe={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function $C(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=Mg(e.focus,t),r=Qv(n.origin,sv);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!nv(i,r))return!1;let a=Fy(n,Ty(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=Fy(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!Cy(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of Ny(Ty(r,t))){if(!e.origin.is(c.getParent())){if(pv(e.origin)){let e=Ty(c,t);return Pg(Fy(e,e)),!0}break}if(!sv(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=Mg(e.anchor,t).getNodeAtCaret();return!(!sv(n)||n.isInline()||(Pg(Py(Bg(ky(n,t)))),0))}(e,t)}function ew(e){return vg(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function tw(e){let t=wh();t.add(e),j_(t)}function nw(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=Mg(n,i);if(n.type===`element`&&$(r)&&cv(r)){let e=a.getNodeAtCaret();return!(e===null||!ew(e)||(tw(e.__key),0))}let o=Qv($(r)?r:r.getParentOrThrow(),e=>$(e)&&!e.isInline()&&cv(e.getParent()));if(o===null)return!1;let s=Ty(o,i).getNodeAtCaret();if(s===null||!ew(s))return!1;if(o.getTextContentSize()===0)return tw(s.__key),!0;let c=Pv().getRootElement();if(c===null)return!1;let l=hv(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return rw(l,u,d,f,p),!1;let g=E_(m);return rw(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!nv(g,o))&&(tw(s.__key),!0)}function rw(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function iw(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=Qv($(n)?n:n.getParentOrThrow(),e=>$(e)&&!e.isInline());if(r===null)return!1;let i=Pv(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if($(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=Ty(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!$(c)){if(t){let e=r.getFirstDescendant();X(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(X(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=hv(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=hC(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(X(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function aw(e,t){let n=Ty(e,t),r=n.getAdjacentCaret();r!==null&&$(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Pg(Py(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function ow(e,t){let n=e.getNodes().map(e=>Ty(e,`next`)).sort(Ly),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;eTy(e,`next`)).sort(Ly),a=(t?i[0]:i[i.length-1]).origin,o=Qv(a,e=>e!==a&&$(e)&&!e.isInline())??k_(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function Npe(e,t){return e.length>0&&!t}function Ppe(e,t=Bb(Mpe),n=Bb(Npe)){return Ky(e.registerCommand(sp,n=>{let r=Q();if(ih(r)){let t=n.target;if(Ov(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Z(r)&&QC(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(cp,e=>{let t=Q();return Z(t)?(t.deleteCharacter(e),!0):!!ih(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(mp,e=>{let t=Q();return!!Z(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(hp,e=>{let t=Q();return!!Z(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(dp,t=>{let n=Q();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)CC(r,n,e);else if(Z(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(pp,()=>{let e=Q();return!!Z(e)&&(e.removeText(),!0)},0),e.registerCommand(gp,e=>{let t=Q();return!(!Z(t)&&!ih(t)||(oh(t,e),0))},0),e.registerCommand(Fce,e=>{let t=Q();return!(!Z(t)&&!ih(t)||(yle(t,e),0))},0),e.registerCommand(Fp,e=>{let t=Q();if(!Z(t)&&!ih(t))return!1;let n=t.getNodes();for(let t of n){let n=Qv(t,e=>$(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(lp,e=>{let t=Q();return!!Z(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(up,()=>{let e=Q();return!!Z(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(jp,()=>{let e=Jm(),t=Q();return Z(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Mh([e]),!0},0),e.registerCommand(Mp,()=>ub(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Np,()=>ub(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(wp,e=>{let t=Q();if(ih(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!ow(t,`previous`))return e.preventDefault(),aw(n[0],`previous`),!0;t=Q()}}return Z(t)&&(XC(t)||!e.shiftKey&&$C(t,`previous`)||!e.shiftKey&&nw(t,!0)||!e.shiftKey&&iw(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(Tp,e=>{let t=Q();if(ih(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!ow(t,`next`))return e.preventDefault(),aw(n[0],`next`),!0;t=Q()}}return Z(t)&&(YC(t)||!e.shiftKey&&$C(t,`next`)||!e.shiftKey&&nw(t,!1)||!e.shiftKey&&iw(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(Sp,e=>{let n=Q();if(ih(n)){let t=n.getNodes();if(t.length>0){let r=Zy(t[0])?`next`:`previous`;if(!e.shiftKey||!ow(n,r))return e.preventDefault(),aw(t[0],r),!0;n=Q()}}if(!Z(n))return!1;let r=Zy(n.anchor.getNode())?`next`:`previous`;if(ZC(n,r)||!e.shiftKey&&$C(n,r))return e.preventDefault(),!0;if(e.shiftKey||QC(n,`arrow`,`start`,t.peek()),nb(n,!0)){let t=e.shiftKey;return e.preventDefault(),ib(n,t,!0),!0}return!1},0),e.registerCommand(bp,e=>{let n=Q();if(ih(n)){let t=n.getNodes();if(t.length>0){let r=Zy(t[0])?`previous`:`next`;if(!e.shiftKey||!ow(n,r))return e.preventDefault(),aw(t[0],r),!0;n=Q()}}if(!Z(n))return!1;let r=Zy(n.anchor.getNode())?`previous`:`next`;if(ZC(n,r)||!e.shiftKey&&$C(n,r))return e.preventDefault(),!0;if(e.shiftKey||QC(n,`arrow`,`end`,t.peek()),nb(n,!1)){let t=e.shiftKey;return e.preventDefault(),ib(n,t,!1),!0}return!1},0),e.registerCommand(Dp,t=>{let n=Q();if(!ih(n)&&JC(t.target))return!1;if(Z(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(bg(n))return!1;let r=ode(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Np);if(zu&&Ru)return!1}else if(!ih(n))return!1;return t.preventDefault(),e.dispatchCommand(cp,!0)},0),e.registerCommand(kp,t=>{let n=Q();return!(!ih(n)&&JC(t.target))&&!(!Z(n)&&!ih(n))&&(t.preventDefault(),e.dispatchCommand(cp,!1))},0),e.registerCommand(Ep,n=>{let r=Q();if(ih(r)){let e=r.getNodes();e.length===1&&vg(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Z(r))return!1;if(QC(r,`enter`,`both`,t.peek()),n!==null){if((zu||Vu||Wu)&&Ru)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(lp,!1)}return e.dispatchCommand(up)},0),e.registerCommand(Op,()=>!!Z(Q())&&(e.blur(),!0),0),e.registerCommand(Pp,t=>{let[,n]=lb(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=hC(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=E_(t);if(n!==null){let t=Ch();if(X(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}j_(mf(t))}}return e.dispatchCommand(RC,n),t.preventDefault(),!0}return mpe(t,e)},0),e.registerCommand(Ip,t=>{let[n]=lb(t),r=Q();return!(n&&!Z(r)||(Z(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(MC(t.dataTransfer,jC(r)),fpe(t.dataTransfer,e)),0))},0),e.registerCommand(Lp,t=>{let[n]=lb(t),r=Q();if(n&&!Z(r))return!1;let i=t.clientX,a=t.clientY,o=hC(i,a,e.getRootElement());return o!==null&&vg(E_(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Bp,()=>{let e=Q();return Qle(Z(e)&&oy(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Rp,t=>(kC(e,cb(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(zp,t=>(async function(e,t){t.update(()=>{let e=Q();Z(e)&&!e.isCollapsed()&&lh(e)},{discrete:!0,tag:`cut`}),await kC(t,cb(e,ClipboardEvent)?e:null),t.update(()=>{let e=Q();Z(e)?e.removeText():ih(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(fp,t=>{let[,r,i]=lb(t);return!(!n.peek()(r,i)||!e.dispatchCommand(RC,r))||(!kv(t.target)||!s_(t.target))&&Q()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=Q(),r=cb(e,InputEvent)||cb(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&CC(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Ice,()=>{let e=Q();return Z(e)&&QC(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Ap,()=>{let e=Q();return Z(e)&&QC(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(xp,e=>{let t=Q();if(ih(t))return sw(t,!1,e);if(!Z(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!$(r))return!1;let i=r.getFirstChild();if(!vg(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Cp,e=>{let t=Q();if(ih(t))return sw(t,!0,e);if(!Z(t))return!1;let{anchor:n,focus:r}=t,i=Qv(r.getNode(),e=>$(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!vg(a)||!a.isInline()||Qv(n.getNode(),e=>$(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function cw(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function lw(e){let t=cw(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var uw=/[!-/:-@[-`{-~\s]/,dw=/\s/,fw=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Fpe=/^\s{0,3}$/;function pw(e){if(!Xg(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&X(t)&&Fpe.test(t.getTextContent())}function mw(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}var hw=/^(\s*)(\d{1,})\.\s/,gw=/^(\s*)[-*+]\s/,Ipe=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,_w=/^(#{1,6})\s/,vw=/^>\s/,yw=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,bw=/^[ \t]*`{3,}$/,Lpe=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Rpe=/^(?:\|)(.+)(?:\|)\s?$/;function zpe(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n0&&(n===t||n===t-1&&/\s/.test(e[n]))}var xw=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Sw=/^<\/[a-z_][\w-]*\s*>/i,Cw=e=>RegExp(`(?:${e.source})$`,e.flags),ww=ef(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),Tw=ef(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Ew=ef(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),Dw=ef(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function Ow(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function kw(e){let t=Dg(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!X(r))return null;let i=r.getTextContent(),a=Ow(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(Og(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&nf(t,Dw,n),t}function Aw(e){return HC(e)}function jw(e,t){let n=0;for(;n(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function Nw(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var Pw=null,Fw=!1,Iw=e=>(t,n,r,i)=>{if(qC(t)||!i&&Aw(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=aC(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==ww.parse(c)?void 0:c,u=Pw,d=a;if(u!==null){if(Fw)for(;d!==null&&pw(d);)d=d.getPreviousSibling();fC(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=Nw(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(fC(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(fC(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=dC(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!fC(r)||r.getListType()===t)return;let i=r.getParent();if(!oC(i))return;let a=dC(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=aC();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&fC(p)&&nf(p,ww,l),u!==null&&function(e,t,n,r){for(let n=e.length;n{let i=[],a=e.getChildren(),o=0;for(let s of a)if(oC(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(fC(e)){let a=Lw(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=tf(e,ww),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(` -`)},Vpe=Mw(e=>KC(`h`+e[1].length)),Rw={dependencies:[UC],export:(e,t)=>{if(!qC(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:_w,replace:(e,t,n,r)=>!(!r&&Aw(e))&&Vpe(e,t,n,r),triggerOnEnter:!0,type:`element`},zw={dependencies:[BC],export:(e,t)=>{if(!HC(e))return null;let n=t(e).split(` +`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Iy(e){let t=[];return Fy(e,{linebreak:()=>t.push(T_()),tab:()=>t.push(th()),text:e=>t.push(Pm(e))}),t}function Uue(){let e=$();return e===null?``:e.getTextContent()}function Ly(e){let t=[];for(let n of e)E_(n)||(!Z(n)&&!Sm(n)||n.isInline()?t.push(n):Z(n)&&t.push(...Ly(n.getChildren())));return t}function Ry(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=$();Q(r)&&(n=r),Q(n)||Lu(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Ig(a)&&$y(a)===null;){let e=a;if([a,o]=Wue(a,o,t),e.is(a))break}return[a,o]}function Wue(e,t,n=!1){let r=e.getParent();if(!r){let e=Qm();return jh().append(e),e.select(),[jh(),0]}if(Fm(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!Z(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new ey(qv(e.__key,t,`element`),qv(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function zy(e){return E_(e)||cg(e)||Fm(e)||e.isParentRequired()}function By(e){let t=Qm(),n=null;for(let r=0;re.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),Gy(e),t&&n&&r!==-1&&ky(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function qy(e,t,n,r){q_();let i=t===`next`;mg(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=$(),c=r&&Q(s)?s:null,l=Ky(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||Oy(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(Wy(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(ky(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function Jy(e,t,n){q_();let{origin:r,direction:i}=e,a=i===`next`,o=eb(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(Z(s))return a?s.select(0,0):s.select();if(Fm(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function Yy(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var Xy=new Map;function Zy(e){return Z(e)||Sm(e)}function Qy(e){return Z(e)||Sm(e)}function $y(e){let t=e.getLatest();return Qy(t)?t.__slotHost:null}function eb(e){let t=$y(e);if(t===null)return null;let n=wh(t);return Z(n)||Sm(n)||Lu(370),n}function Gue(e){let t=eb(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of rb(t))if(r===n)return e;return null}function tb(e){let t=e.getLatest();for(;t!==null;){if($y(t)!==null)return t;t=t.getParent()}return null}function nb(e){if(e===null)return null;let t=Q(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:tb(t)}function rb(e){let t=e.getLatest();return Zy(t)&&t.__slots!==null?t.__slots:Xy}function ib(e){return Array.from(rb(e).keys())}function ab(e,t){let n=rb(e).get(t);return n===void 0?null:wh(n)}var Kue=[`__proto__`,`constructor`,`prototype`],ob=Symbol(`slotMapOwner`);function sb(e){let t=e.__slots;return t!==null&&t[ob]===e||(t=new Map(t),t[ob]=e,e.__slots=t),t}var que=new WeakMap,Jue=[];function Yue(e){for(let{ownNodeConfig:t}of m_(e)){let e=t&&t.slots;if(e)return e}return Jue}function Xue(e){let t=``;for(let n of rb(e).values()){let e=wh(n);e!==null&&(t+=e.getTextContent())}return t}function Zue(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?et):1:i===void 0?-1:r-i}function Que(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||Lu(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!Z(n)&&!Sm(n)||n.isInline())&&Lu(374,n.__key);let i=e.getWritable(),a=sb(i),o=a.get(t);o!==void 0&&$ue(o);let s=n.getWritable(),c=eb(s);if(c!==null){let e=Gue(s);e!==null&&sb(c.getWritable()).delete(e),s.__slotHost=null}return Gy(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=que.get(e);if(t===void 0){let n=Yue(e),r=new Map;for(let t of n)Kue.includes(t)&&Lu(371,e.name,t),r.has(t)&&Lu(372,e.name,t),r.set(t,r.size);t=r,que.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Zue(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Zue(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),X_()._slotsUsed=!0,Y_()._slotsUsed=!0,i}function $ue(e){let t=wh(e);if(t===null)return;let n=t.getWritable();Qy(n)||Lu(377,e),n.__slotHost=null,n.remove()}var ede={next:`previous`,previous:`next`},cb=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Eb({hasNext:hb,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return _b(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _b(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&Lu(263,Array.from(o).join(` `))}else i.insert(e);i=_b(e,this.direction)}for(let e of o.values())e.remove();return this}},lb=class e extends cb{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:bb(e,this.direction)}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ub(this.direction);return _b(this.getNodeAtCaret(),e)||bb(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},tde={root:Tm,shadowRoot:dg};function ub(e){return ede[e]}function db(e,t=`root`){return e===null||tde[t](e)?null:$y(e)===null?e:null}var fb=class e extends cb{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:_b(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Z(this.origin)?bb(this.origin,this.direction):null}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ub(this.direction);return _b(this.getNodeAtCaret(),e)||bb(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof pb)&&this.direction===t.direction&&this.origin.is(t.origin)}},pb=class e extends cb{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:vb(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){return vb(this.origin,ub(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof fb||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return _b(this.origin,this.direction)}};function mb(e){return e instanceof pb}function hb(e){return e instanceof fb}function gb(e){return e instanceof lb}var nde={next:class extends pb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends pb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rde={next:class extends fb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends fb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ide={next:class extends lb{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lb{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function _b(e,t){return e?new rde[t](e):null}function vb(e,t,n){return e?new nde[t](e,yb(e,n)):null}function yb(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Ru(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function ade(e,t){return new cde(e,t)}function bb(e,t){return Z(e)?new ide[t](e):null}function ode(e){return e&&e.getChildCaret()||e}function xb(e){return e&&ode(e.getAdjacentCaret())}var sde=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return mb(e)&&mb(t)&&e.isSameNodeCaret(t)?[ade(e,t.offset-e.offset),null]:[mb(e)?lde(e,`anchor`):null,mb(t)?lde(t,`focus`):null]}iterNodeCarets(e=`root`){let t=mb(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=mb(n),i=t=>t.isSameNodeCaret(n)?null:xb(t)||t.getParentCaret(e);return Eb({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},cde=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n0&&e.classList.add(...n)}function Nb(e,...t){let n=jb(...t);n.length>0&&e.classList.remove(...n)}function gde(e,t,n){let r=e.getElementByKey(t.getKey());if(r===null||Fm(t))return[_h(r),n];let i=r.parentNode;return i&&r.nodeName===`BR`?[i,Array.from(i.childNodes).indexOf(r)]:e.read(`latest`,()=>Ny(e,t,n))}function _de(e,t,n,r,i){let a=Sg(e.getRootElement()).createRange(),[o,s]=gde(e,t,n),[c,l]=gde(e,r,i),u=l;if(o===null||c===null)return null;let d=o.firstChild;o===c&&d!=null&&d.nodeName===`BR`&&s===0&&u===0&&(u=1);try{a.setStart(o,s),a.setEnd(c,u)}catch{return null}return!a.collapsed||s===u&&t.is(r)||(a.setStart(c,u),a.setEnd(o,s)),a}function vde(e){let t=Lg().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function yde(e){let t=Tm(e)?e:e.getParent();return t&&vde(t)}function Pb(e){let t=yde(e);return t!==null&&t.direction===`rtl`}function bde(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!mh(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!Q(e)||i.type!==`element`&&a.type!==`element`?void 0:Ym(Vm(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=Zle(t)),t.__text=l)}return t}function xde(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Fb(e,t,n){let r=Lm(e,n);if(Gm(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function Sde(e,t,n=xde){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=g_(t.getNode(),Ig);a=g_(n.getNode(),Ig);let c=e.isBackward()?`previous`:`next`;i=Z(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!Z(r)||!r.isEmpty())&&Fb(e,t,n)}(n,a,ub(c)),Z(s)&&o.set(s.getKey(),s),Z(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(Z(t)&&Ig(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=g_(t,Ig);Z(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(eb(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function Cde(e){let t=wde(e);return t!==null&&t.writingMode===`vertical-rl`}function wde(e){let t=e.anchor.getNode();return Z(t)?vde(t):yde(t)}function Tde(e,t){let n=Cde(e)?!t:t;Dde(e)&&(n=!n);let r=Lm(e.focus,n?`previous`:`next`);if(Gm(r))return!1;if(mb(r)&&!nh(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(Fm(e)&&!nh(e))return!0}for(let e of Cb(r)){if(gb(e))return!e.origin.isInline();if(!Z(e.origin)){if(Sm(e.origin))return!0;break}}return!1}function Ede(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Dde(e){let t=wde(e);return t!==null&&t.direction===`rtl`}function Ode(e,t,n){let r=Dde(e),i;i=Cde(e)||r?!n:n,Ede(e,t,i,`character`)}function kde(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Ade(e,t){return Array.from(jde(e,t))}function jde(e,t){return Nde(`next`,e,t)}function Mde(e,t){let n=Jm(_b(e,t));return n&&n[0]}function Nde(e,t,n){let r=jh(),i=t||r,a=Z(i)?bb(i,e):_b(i,e),o=Pde(i),s=n?xb(ode(_b(n,e)))||Mde(n,e):Mde(i,e),c=o;return Eb({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;gb(e)&&c++;let t=Jm(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function Pde(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??eb(n))t++;return t}function Ib(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Fde(e){let t=g_(e,e=>Z(e)&&!e.isInline());return Z(t)||kde(4,e.__key),t}function Lb(e){let t=$()||Dy(),n;if(Q(t))n=Lm(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=_b(r,`next`))}n||=bb(jh(),`previous`).getFlipped().insert(Qm())}let r=Xm(e,n,Gm(i=n)||Jm(mb(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=xb(r);return zm(wb(gb(a)?Wm(a):r)),e.getLatest()}function Rb(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function zb(e){let t=null;if(Rb(e,DragEvent)?t=e.dataTransfer:Rb(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function Ide(e){let t=$();if(!Q(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;tZ(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function Lde(e,t){bb(e,`next`).insert(t)}function Rde(e,t){return zde(e,t,null)}function zde(e,t,n){let r=!1;for(let i of Bde(e))t(i)?n!==null&&n(i):(r=!0,Z(i)&&zde(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function Bb(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if(Z(e))for(let t of Bde(e))r.push(t);return n}function Bde(e){return Vde(bb(e,`previous`))}function Vde(e){return Eb({hasNext:hb,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function Hde(e){Hm(_b(e,`next`)).splice(1,e.getChildren())}function Ude(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=g_(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&Gde(n.anchor,r))return r.insertBefore(Qm()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function Wde(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=g_(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&Kde(n.anchor,r))return r.insertAfter(Qm()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function Gde(e,t){return Fb(e,t,`previous`)}function Kde(e,t){return Fb(e,t,`next`)}function qde(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var Jde={tag:`history-merge`};function Yde(){let e=jh();e.isEmpty()&&e.append(Qm())}var Xde={config:{setOptions:Jde,updateOptions:Jde},init:({$initialEditorState:e=Yde})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(uue(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[wm,Mm,w_,eh,Zm]};function Vb(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Zde(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"+source"`}var Qde=Zde(),$de=new Set([`__proto__`,`constructor`,`prototype`]);function efe(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!$de.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=efe(n[e],r[e]));return e}return t}function Hb(e){return e.id===0}function tfe(e){return e.id===2}var nfe=new Set,rfe=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Ab;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;tfe(t)||Vb(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&Vb(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&Vb(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&Vb(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&Vb(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&Vb(311),this._signal}getInitResult(){this.extension.init===void 0&&Vb(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||Vb(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||Vb(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Vb(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Vb(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||Vb(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||nfe}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||Vb(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},ife=Symbol.for(`@lexical/extension/LexicalBuilder`);function afe(...e){return cfe.fromExtensions(e).buildEditor()}function ofe(){}function sfe(e){throw e}function Ub(e){return Array.isArray(e)?e:[e]}var Wb=Qde,cfe=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Wb,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Ub(Xde)];for(let e of t)n.push(Ub(e));return new e(n)}static maybeFromEditor(t){let n=t[ife];return n&&(n.PACKAGE_VERSION!==Wb&&Vb(292,n.PACKAGE_VERSION,Wb),n instanceof e||Vb(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Vb(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(M_({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[ife]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=ofe;function t(){try{e()}finally{e=ofe}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=pv(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Vb(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Vb(296);let[t]=Ub(e);typeof t.name!=`string`&&Vb(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Vb(298,t.name),!n){n=new rfe(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Vb(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Vb(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Ub(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(tfe(i))return;let a=n.extension.name;var o;Hb(i)||Vb(300,a,r||`[unknown]`),Hb(o=i)||Vb(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||Vb(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Hb(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Vb(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return pv(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of qde(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Vb(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&efe(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=sfe,e}};function Gb(e,t){let n=cfe.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var lfe=Symbol.for(`preact-signals`);function Kb(){if(Zb>1)Zb--;else{var e,t=!1;for((function(){var e=ex;for(ex=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Xb!==void 0;){var n=Xb;for(Xb=void 0,Qb++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&pfe(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Qb=0,Zb--,t)throw e}}function ufe(e){if(Zb>0)return e();$b=++dfe,Zb++;try{return e()}finally{Kb()}}var qb,Jb=void 0;function Yb(e){var t=Jb,n=qb;Jb=void 0,qb=void 0;try{return e()}finally{Jb=t,qb=n}}var Xb=void 0,Zb=0,Qb=0,dfe=0,$b=0,ex=void 0,tx=0;function ffe(e){if(Jb!==void 0){var t=e.n;if(t===void 0||t.t!==Jb)return t={i:0,S:e,p:Jb.s,n:void 0,t:Jb,e:void 0,x:void 0,r:t},Jb.s!==void 0&&(Jb.s.n=t),Jb.s=t,e.n=t,32&Jb.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Jb.s,t.n=void 0,Jb.s.n=t,Jb.s=t),t}}function nx(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}nx.prototype.brand=lfe,nx.prototype.h=function(){return!0},nx.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?Yb(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},nx.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Yb(function(){var e;(e=t.Z)==null||e.call(t)}))}},nx.prototype.subscribe=function(e){var t=this;return sx(function(){var n=t.value;Yb(function(){return e(n)})},{name:`sub`})},nx.prototype.valueOf=function(){return this.value},nx.prototype.toString=function(){return this.value+``},nx.prototype.toJSON=function(){return this.value},nx.prototype.peek=function(){var e=this;return Yb(function(){return e.value})},Object.defineProperty(nx.prototype,"value",{get:function(){var e=ffe(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Qb>100)throw Error(`Cycle detected`);(function(e){Zb!==0&&Qb===0&&e.l!==$b&&(e.l=$b,ex={S:e,v:e.v,i:e.i,o:ex})})(this),this.v=e,this.i++,tx++,Zb++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kb()}}}});function rx(e,t){return new nx(e,t)}function pfe(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function mfe(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function hfe(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function ix(e,t){nx.call(this,void 0,t),this.x=e,this.s=void 0,this.g=tx-1,this.f=4}ix.prototype=new nx,ix.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===tx))return!0;if(this.g=tx,this.f|=1,this.i>0&&!pfe(this))return this.f&=-2,!0;var e=Jb;try{mfe(this),Jb=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Jb=e,hfe(this),this.f&=-2,!0},ix.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}nx.prototype.S.call(this,e)},ix.prototype.U=function(e){if(this.t!==void 0&&(nx.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ix.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(ix.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=ffe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function gfe(e,t){return new ix(e,t)}function _fe(e){var t=e.j;if(e.j=void 0,typeof t==`function`){Zb++;var n=Jb;Jb=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ax(e),t}finally{Jb=n,Kb()}}}function ax(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,_fe(e)}function vfe(e){if(Jb!==this)throw Error(`Out-of-order effect`);hfe(this),Jb=e,this.f&=-2;try{8&this.f&&ax(this)}finally{Kb()}}function ox(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,qb&&qb.push(this)}ox.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},ox.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,_fe(this),mfe(this),Zb++;var e=Jb;return Jb=this,vfe.bind(this,e)},ox.prototype.N=function(){2&this.f||(this.f|=2,this.u=Xb,Xb=this)},ox.prototype.d=function(){this.f|=8,1&this.f||ax(this)},ox.prototype.dispose=function(){this.d()};function sx(e,t){var n=new ox(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function cx(e,t){let n;return rx(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var lx={build:e=>cx(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},yfe=new Set,bfe={build(e,t,n){let r=n.getDependency(lx).output,i=rx({watchedNodeKeys:new Map}),a=cx(()=>{},()=>sx(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if($())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=wh(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=gfe(()=>(a.value||yfe).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[lx],name:`@lexical/extension/NodeSelection`},xfe=rd(`INSERT_HORIZONTAL_RULE_COMMAND`),ux=class extends xm{$config(){return this.config(`horizontalrule`,{extends:xm,importDOM:{hr:()=>({conversion:Sfe,priority:0})}})}exportDOM(){return{element:Cg().createElement(`hr`)}}createDOM(e){let t=Cg().createElement(`hr`);return Mb(t,e.theme.hr),t}getTextContent(){return` +`}isInline(){return!1}updateDOM(){return!1}};function Sfe(){return{node:dx()}}function dx(){return h_(ux)}function fx(e){return e instanceof ux}var Cfe={dependencies:[lx,bfe],name:`@lexical/extension/HorizontalRule`,nodes:()=>[ux],register(e,t,n){let{watchNodeKey:r}=n.getDependency(bfe).output,i=rx({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return pv(e.registerCommand(xfe,e=>{let t=$();return Q(t)?(t.focus.getNode()!==null&&Lb(dx()),!0):!1},0),e.registerCommand(od,e=>{if(Mg(e.target)){let t=Th(e.target);if(fx(t))return function(e,t=!1){let n=$(),r=e.isSelected(),i=e.getKey(),a;t&&ty(n)?a=n:(a=Cy(),Nh(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(ux,(t,n)=>{ufe(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:rx(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),sx(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(sx(()=>{let e=t.value;e&&(n.value?Mb(e,a):Nb(e,a))}));return pv(...e)}))}};function wfe(e){return Gb(Lg(),e)}function px(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Tfe=(e,t,n)=>{mx(e),n()};function mx(e){if(!gh(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n{}){return(n,r=Lg())=>i=>{let a=_x(r),o=a&&a[e],s=yx(n,o||t(r));return s&&s!==o?xx(e,s,i,r):i()}}function Ofe(e,t,n,r){return Object.assign(Yf(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var kfe=`@lexical/html/DOM`,Afe=Symbol.for(`@lexical/html/DOMExportContext`),Cx=`@lexical/html/DOMImport`,wx=Symbol.for(`@lexical/html/DOMImportContext`);function jfe(e,t,n){return Ofe(Afe,e,t,n)}var Mfe=jfe(`isExport`,Boolean);function Nfe(e){let t=Gb(e,kfe);return t?t.output.defaults:void 0}function Pfe(e){let t=Gb(e,kfe);return t?t.output.runtime:void 0}function Ffe(e=Lg()){let t=Pfe(e);return t?t.getSessionConfig():Rg(e)}var Ife=Sx(Afe,Nfe),Tx=Symbol.for(`@lexical/html/SelectorImpl`);function Ex(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?jg:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>Ex(e,[...t,n]);return{[Tx]:n,attr:(e,t,n)=>i(kx(e,t,n)),classAll:(...e)=>i(Ox(e)),classAny:(...e)=>i(function(e){let t=Dx(e);return t.length===0?()=>!1:e=>{if(!jg(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>jg(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!jg(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}px(362,JSON.stringify(e))}(e,t,n))}}function Dx(e){let t=[];for(let n of e)n&&t.push(n);return t}function Ox(e){let t=Dx(e);return t.length===0?()=>!0:e=>{if(!jg(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function kx(e,t,n){if(!0===t)return t=>jg(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>jg(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!jg(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}px(361,JSON.stringify(e))}function Ax(e){return{[Tx]:e}}var Lfe=Ax({kind:`text`,predicate:hh,tags:new Set}),Rfe=Ax({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function jx(){return Ex(new Set,[])}function Mx(){return Rfe}function Nx(...e){e.length>0||px(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Ex(t,[])}function Px(){return Lfe}var Fx={any:jx,comment:Mx,tag:Nx,text:Px},Ix=/[A-Za-z0-9_-]/,zfe=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&Ix.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||px(364,String(this.pos+1),t,this.source)}};function Bfe(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(Ix.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(kx(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(kx(t,r))}}}return r.length>0&&n.push(Ox(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function Vfe(e){let t=new zfe(e,0),n=[];for(;n.push(Bfe(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return Ex(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return Ex(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function Lx(e,t,n){return Ofe(wx,e,t,n)}var Rx=Lx(`textFormat`,()=>0),zx=Lx(`textStyle`,()=>({}));function Hfe(e){if(!jg(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Ufe(e){if(hh(e))return!0;if(!jg(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!Fg(e)&&Pg(e)}var Wfe=Lx(`whitespaceConfig`,()=>({isInline:Ufe,preservesWhitespace:Hfe})),Bx=Lx(`importOverlays`,()=>[]),Gfe=class{constructor(e){this.record=e}get(e){return gx(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(gx(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function Vx(e){let t=Gb(e,Cx);return t?t.output.defaults:void 0}function Kfe(e,t=Lg()){return gx(function(e){return vx(wx,e)||Vx(e)}(t),e)}var Hx=Sx(wx,Vx);function Ux(e){return by(e)||Sm(e)&&!e.isInline()}function Wx(e,t){if(!jg(t))return e;let n=t.style.textAlign;if(!qx(n))return e;for(let t of e)by(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function Gx(e,t,n){e.length===1&&E_(e[0])&&(e=[]);let r=Qm();if(jg(n)){let e=n.style.textAlign;qx(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var qfe={$accepts:Ux,$packageRun:Gx,name:`BlockSchema`},Jfe={$accepts:Ux,$packageRun:Gx,name:`RootSchema`},Kx=Fx,Yfe=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function qx(e){return Yfe.has(e)}var Xfe={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},Zfe={CODE:16,MARK:128},Qfe=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),$fe={$import:(e,t)=>{let n=e.get(Rx),r=Xfe[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=$u.lowercase,n|=$u.uppercase|$u.capitalize):o===`uppercase`?(t|=$u.uppercase,n|=$u.lowercase|$u.capitalize):o===`capitalize`?(t|=$u.capitalize,n|=$u.lowercase|$u.uppercase):o===`none`&&(n|=$u.lowercase|$u.uppercase|$u.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=Zfe[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[bx(Rx,s)]})},match:Kx.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function Jx(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(hh(r))return r;if(r.nodeName===`BR`)return null}}function Yx(e,t){return t!==0&&Fm(e)?e.setFormat(t):e}function Xx(e,t){if(Fm(e)){let n=function(e){let t=``;for(let n in e)Qfe.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var epe={$import:(e,t)=>{let n=e.get(Rx),r=e.get(zx),i=e.get(Wfe);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=Iy(t.textContent||``);for(let t of e)Yx(t,n),Xx(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=Jx(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=Jx(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=Pm(a);return Yx(o,n),Xx(o,r),[o]},match:Kx.text(),name:`@lexical/html/#text`},tpe={$import:()=>[],match:Kx.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},npe={$import:(e,t)=>D_(t)||O_(t)?[]:[T_()],match:Kx.tag(`br`),name:`@lexical/html/br`},rpe=[tpe,{$import:(e,t)=>{let n=Qm();if(Kg(n,t),Wg(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&qx(e)&&n.setFormat(e)}return Gg(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Kx.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>Lg().hasNode(ux)?[dx()]:n(),match:Kx.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>Fg(t)?Wx(e.$importChildren(t,{schema:qfe}),t):n(),match:Kx.any(),name:`@lexical/html/transparent-block`},epe,npe,$fe];function ipe(e,t){let n=[],r=0,i=0;for(;r{let c=function(e){let t=e[Tx];return t===void 0&&px(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,ipe(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function Qx(e,t){return hh(t)?e.textIndices:t.nodeType===8?e.commentIndices:jg(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:ape}var ape=Object.freeze([]);function $x(e){let t=[];for(let n of e)if(ope(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function ope(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function spe(e){let t=$x(e);return{__type:`CompiledOverlayRules`,dispatch:Zx(t),rules:t}}var cpe=Object.freeze({});function lpe(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>upe(e,t,n);return n&&n.context?Hx(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>eS(e,t,n),captures:t,get:t=>Kfe(t,e.editor),session:e.session}}function upe(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=eS(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function eS(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=Qx(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=Qx(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return dpe(e,t);let r=0,i=0,a=()=>{for(;r{let o=vx(wx,e)||r,s=a&&a.context?yx(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new Gfe(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),xx(wx,c,()=>function(e,t,n,r){return upe({dispatch:e,editor:t,overlays:r.get(Bx).map(e=>e.dispatch),session:r},gh(n)?n.body:n,{schema:Jfe})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[Tfe],rules:[{$import:(e,t)=>e.$importChildren(t),match:Fx.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>Ab(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:Cx},fpe={dependencies:[[tS,{rules:rpe}]],name:`@lexical/html/CoreImport`},nS={any:jx,comment:Mx,css:Vfe,tag:Nx,text:Px},ppe=new Set([`STYLE`,`SCRIPT`]);function mpe(e,t){mx(t);let n=gh(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!ppe.has(t.nodeName)){let n=rS(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof C_&&t.insertAfter(T_());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function hpe(e,t=null,n=Lg()){return Ife([bx(Mfe,!0)],n)(()=>{let r=jh(),i=Ffe(n),a=nb(t),o=e.append.bind(e);for(let e of(Z(a)?a:r).getChildren())_pe(n,e,o,t,i);return e})}function gpe(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&px(338),hue(e),hpe(Cg().createElement(`div`),t,e).innerHTML}function _pe(e,t,n,r=null,i=Rg(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&Fm(t)&&(s=bde(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Cg().createDocumentFragment(),p=d?d():Z(s)?s.getChildren():[],m=a&&ty(r)&&Z(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=_pe(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((jg(c)||Ng(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(E_(t)&&jg(e)&&Fg(e)&&n!==null&&n.nodeName===`BR`){let t=Cg().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Ng(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function rS(e,t,n,r,i=new Map,a){let o=[];if(ppe.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!dg(s))&&(s!=null&&by(s)||r);for(let e=0;e{let e=new C_;return n.push(e),e}:Qm)),s==null){if(f.length>0)for(let e of f)o.push(e);else Fg(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&Pg(e.nextSibling)&&Pg(e.previousSibling)}(e)&&o.push(T_())}else Z(s)&&s.append(...f);return o}function vpe(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=rx(i===void 0?e[r]:i)}return n}function ype(e){return()=>{}}function iS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function aS(e,t){let n=e;for(let r=_b(e,t);r&&(ES(r.origin)||nh(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function oS(e){return aS(e,`previous`)}function sS(e){return aS(e,`next`)}function bpe(e){let t=oS(e),n=sS(e),r=t;for(;r!==null;){if(ES(r)){let e=Ple(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(Z(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function xpe(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(ES(e)||nh(e)||E_(e)||iS(167),i=e,E_(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];ES(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(tt.push(T_()),tab:()=>t.push(th()),text:e=>t.push(TS(e))}),t}function lS(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var Cpe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function uS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Cpe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var wpe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=uS(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=uS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function Tpe(e,t){e.__highlightType=t.__highlightType}var Epe=e=>{let t=wf(e,`mode`),n=Ef(e,`detail`,0),r=Ef(e,`format`,0),i=Tf(e,`mode`),a=Df(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:uS(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:uS(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:Tpe}},Dpe=Uf()({language:Kf(Hf(Vf(Lf())),{getter:{field:`__language`}}),theme:Kf(Hf(Lf()),{getter:{field:`__theme`}})});function dS(e,t){for(let n of e.childNodes)if(jg(n)&&n.tagName===t||dS(n,t))return!0;return!1}var fS=`data-language`,pS=`data-highlight-language`,mS=`data-theme`,Ope=ype(),hS=class extends bm{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{children:`inline`,extends:bm,generated:wpe,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||dS(e,`BR`))?{conversion:vS,priority:1}:null,div:()=>({conversion:kpe,priority:1}),pre:()=>({conversion:vS,priority:0}),table:e=>xS(e)?{conversion:Ape,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&xS(n)?{conversion:yS,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&xS(t)?{conversion:yS,priority:3}:null}},json:Dpe})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=Cg().createElement(`code`);Mb(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(fS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pS,n));let r=this.getTheme();r&&t.setAttribute(mS,r);let i=this.getStyle();return i&&Dm(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(fS,r):i&&t.removeAttribute(fS);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(pS,r):t.removeAttribute(pS):a&&r&&t.setAttribute(pS,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(mS,o):s&&t.removeAttribute(mS);let c=this.__style,l=e.__style;return c!==l&&Dm(t.style,c,l),!1}exportDOM(e){let t=Cg().createElement(`pre`);Mb(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(fS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pS,n));let r=this.getTheme();r&&t.setAttribute(mS,r);let i=this.getStyle();return i&&Dm(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!Gb(Lg(),`@lexical/code`)){Ope();let t=SS(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(Fm(i)){let e=oS(i),t=[];for(;;)if(nh(e))t.push(th()),e=e.getNextSibling();else{if(!ES(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;ne.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function gS(e,t){return h_(hS).setLanguage(e).setTheme(t)}function _S(e){return e instanceof hS}function vS(e){return{node:gS(e.getAttribute(fS),e.getAttribute(mS))}}function kpe(e){let t=e,n=bS(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(bS(t))return!0;t=t.parentElement}return!1}(t)?{node:n?gS():null}:{node:null}}function Ape(){return{node:gS()}}function yS(){return{node:null}}function bS(e){return e.style.fontFamily.match(`monospace`)!==null}function xS(e){return e.classList.contains(`js-file-line-container`)}function SS(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(_S(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(E_(t)&&E_(t.getPreviousSibling())){let t=Qm();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var jpe=Uf()({highlightType:Kf(Hf(Vf(Lf())),{getter:{field:`__highlightType`}})}),CS=class extends Mm{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:Mm,generated:Epe,json:jpe})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return Mb(t,wS(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=wS(n.theme,e.__highlightType),a=wS(n.theme,this.__highlightType);return i!==a&&(i&&Nb(t,i),a&&Mb(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return gS()}};function wS(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function TS(e=``,t){return pg(new CS(e,t))}function ES(e){return e instanceof CS}var DS=`data-language`,OS=`data-theme`;function kS(e){let t=[],n=!1;for(let r=0;r0&&(a||n)&&t.push(` +`),t.push(i.getTextContent()),n=a}return cS(t.join(``))}function AS(e){return e.style.fontFamily.match(`monospace`)!==null}function jS(e){let t=e.parentElement;for(;t!==null;){if(AS(t))return!0;t=t.parentElement}return!1}var Mpe=spe([{$import:(e,t)=>e.$importChildren(t),match:nS.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),Npe={$import:(e,t)=>[gS(t.getAttribute(DS),t.getAttribute(OS)).splice(0,0,kS(e.$importChildren(t)))],match:nS.tag(`pre`),name:`@lexical/code/pre`},Ppe={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[gS(t.getAttribute(DS),t.getAttribute(OS)).splice(0,0,kS(e.$importChildren(t)))]:n()},match:nS.tag(`code`),name:`@lexical/code/code-multiline`};function MS(e){if(!jg(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function NS(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(jg(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(hh(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function PS(e){for(let t of Array.from(e.children))if(jg(t)&&MS(t)){if(NS(t)!==null)return!0;let e=t.nextElementSibling;if(e&&MS(e))return!0}else if(PS(t))return!0;return!1}var Fpe=spe([{$import:(e,t,n)=>{if(!MS(t)||jS(t))return n();let r=NS(t);return r===null||r.length===0?n():[gS().splice(0,0,cS(r.join(` +`)))]},match:nS.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!MS(t)||jS(t))return n();let r=t.previousElementSibling;if(r&&MS(r))return[];let i=[],a=t;for(;a&&MS(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[gS().splice(0,0,cS(i.join(` +`)))]},match:nS.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),Ipe={$import:(e,t,n)=>AS(t)?[gS().splice(0,0,kS(e.$importChildren(t)))]:n(),match:nS.tag(`div`),name:`@lexical/code/div`},Lpe={dependencies:[fpe,[tS,{preprocess:[(e,t,n)=>{PS(gh(e)?e.body:e)&&t.session.update(Bx,e=>[...e,Fpe]),n()}],rules:[{$import:(e,t)=>[gS().splice(0,0,kS(e.$importChildren(t,{rules:Mpe})))],match:nS.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:nS.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},Ppe,Npe,Ipe]}]],name:`@lexical/code`,nodes:()=>[hS,CS],register:e=>pv(e.registerCommand(kd,e=>{let t=$();return!(!Q(t)||!SS(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(eh,e=>{e.getFormat()!==0&&_S(e.getParent())&&e.setFormat(0)}))};function FS(e){if(!Q(e))return!1;let t=e.anchor.getNode(),n=_S(t)?t:t.getParent(),r=e.focus.getNode(),i=_S(r)?r:r.getParent();return _S(n)&&n.is(i)}function IS(e){let t=e.getNodes(),n=[];if(t.length===1&&_S(t[0]))return n;let r=[];for(let e=0;e0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=qv(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function LS(e,t){let n=$();if(!Q(n)||!FS(n))return!1;let r=IS(n),i=r.length;if(i===0&&n.isCollapsed())return e===Id?n.insertNodes([th()]):function(e,t){let n=e.anchor.getNode();if(!ES(n)&&!nh(n))return;let r=oS(n);nh(r)?r.remove():t!==void 0&&ES(r)&&lS(r,t,e)}(n,t),!0;if(i===0&&e===Id&&n.getTextContent()===` +`){let e=th(),t=T_(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),zm(Km(Tb(vb(e,`next`,0),Wm(_b(t,`next`))),r)),!0}for(let a=0;a0){let r=i[0];if(a===0&&(r=oS(r)),e===Id){let e=th();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=qv(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else nh(r)?r.remove():t!==void 0&&ES(r)&&lS(r,t,n)}}return!0}function RS(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===Dd;if(!FS(n)||!ES(s)&&!nh(s)||!ES(c)&&!nh(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=oS(s),d=sS(c)):(u=oS(c),d=sS(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;ee.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===Dd?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function zS(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===Ed;if(!FS(n)||!ES(a)&&!nh(a)||!ES(o)&&!nh(o))return!1;let c=o,l=bpe(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=xpe(c,i.offset);if(e!==null){let{node:t,offset:r}=e;E_(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else Spe(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function Rpe(e,t,n){return pv(...n?[e.registerCommand(Od,e=>!e.altKey&&Wde(_S,e),1),e.registerCommand(Cd,e=>Wde(_S,e),1),e.registerCommand(Dd,e=>!e.altKey&&Ude(_S,e),1),e.registerCommand(Td,e=>Ude(_S,e),1)]:[],e.registerCommand(Pd,t=>{let n=function(e){let t=$();if(!Q(t)||!FS(t))return null;let n=e?Ld:Id,r=e?Ld:Fd,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=IS(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&iS(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=oS(s[0]),d=sS(s[0]),f=qv(u.getKey(),0,`text`),p=qv(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(Fd,()=>!!FS($())&&(Py([th()]),!0),1),e.registerCommand(Id,()=>LS(Id),1),e.registerCommand(Ld,()=>LS(Ld,t),1),e.registerCommand(Dd,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();if(!FS(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&_S(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):RS(Dd,e)},1),e.registerCommand(Od,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();return!!FS(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&_S(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):RS(Od,e))},1),e.registerCommand(Ed,e=>zS(Ed,e),1),e.registerCommand(wd,e=>zS(wd,e),1))}var zpe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function BS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!zpe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function VS(e,t,n,r,i){let a=BS(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Bpe(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Vpe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=VS(t.indent,0,0,1/0),e.__textFormat=BS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Bpe}};function Hpe(e,t){e.__isUnlinked=t.__isUnlinked}var Upe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=VS(t.indent,0,0,1/0),e.__textFormat=BS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:Hpe}},HS=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Wpe=Uf()({rel:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__rel`}),target:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__target`}),title:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__title`}),url:Gf(Lf(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),US=class extends bm{__url;__target;__rel;__title;$config(){return this.config(`link`,{children:`inline`,extends:bm,generated:Vpe,importDOM:{a:()=>({conversion:Gpe,priority:1})},inline:!0,json:Wpe,mergeAdjacent:{by:[`url`,`target`,`rel`,`title`]}})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=Cg().createElement(`a`);return this.updateLinkDOM(null,t,e),Mb(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Ag(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=YS(e);try{let t=new URL(YS(e));if(!HS.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!HS.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=fg(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Q(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Gpe(e){let t=null;if(Ag(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=WS(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function WS(e=``,t){return pg(new US(e,t))}function GS(e){return e instanceof US}var Kpe=Uf()({isUnlinked:Gf(zf(),{field:`__isUnlinked`})}),qpe=class extends US{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:US,generated:Upe,json:Kpe,mergeAdjacent:!1})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Cg().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function KS(e){return e instanceof qpe}var qS=rd(`TOGGLE_LINK_COMMAND`);function JS(e,t){if(e.type===`element`){let n=e.getNode();return Z(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Jpe(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=$();if(o===null||!Q(o)&&!ty(o))return;if(ty(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=g_(e,e=>!KS(e)&&GS(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=g_(e,e=>!KS(e)&&GS(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=WS(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=g_(e,e=>!KS(e)&&GS(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=g_(t,e=>!KS(e)&&GS(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||Z(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===0&&r.length>0)return;if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=fg(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=g_(e,GS);if(t!==null)return l(t)}(function(e){let t=$();if(!Q(t))return e();let n=fm(t),r=n.isBackward(),i=JS(n.anchor,r?-1:0),a=JS(n.focus,r?0:-1);if(e(),i||a){let e=$();if(Q(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}Nh(fm(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=g_(t,GS);if(o){l(o);continue}if(Z(t)){if(!t.isInline())continue;if(GS(t)){if(!(KS(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();GS(s)&&s.is(e)?s.append(t):(e=WS(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var Ype=/^\+?[0-9\s()-]{5,}$/;function YS(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Ype.test(e)?`tel:${e}`:`https://${e}`}function XS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Xpe(e){let t=1,n=e.getParent();for(;n!=null;){if(_C(n)){let e=n.getParent();if(fC(e)){t++,n=e.getParent();continue}XS(40)}return t}return t}function Zpe(e){let t=e.getParent();fC(t)||XS(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),fC(r)&&(n=r);return n}function ZS(e){return _C(e)&&fC(e.getFirstChild())}function QS(e,t){return t.getValue()}function Qpe(e,t){return _C(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function $S(e,t){return fC(e)?fg(e).setListType(t):dC(t)}function $pe(e){let t=$();if(t!==null){let n=t.getNodes();if(Q(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(dg(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=Qm();i.append(e),n=e.select().getNodes()}}else if(Qpe(i,n)){if(dg(a)){let t=dC(e);i.replace(t);let n=gC();Z(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(_C(i)){let t=i.getParentOrThrow();if(eb(t)===null){let n=$S(t,e);eC(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t0&&e.append(...r),t.remove()}function iC(e,t,n=!1){if(e&&t&&ZS(e)&&ZS(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(rC(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();bm.prototype.remove.call(t)}}function eme(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())_C(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),fC(r.getFirstChild())||n++)}function tme(e){let t=new Set;if(ZS(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(ZS(r)&&ZS(i)){let n=i.getFirstChild();if(fC(n)){n.append(e);let i=r.getFirstChild();fC(i)&&n.getListType()===i.getListType()&&(eC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(ZS(r)){let t=r.getFirstChild();if(fC(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(ZS(i)){let t=i.getFirstChild();fC(t)&&t.append(e)}else if(fC(n)){let t=fg(e),a=fg(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function aC(e){if(ZS(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(fC(n?n.getParent():void 0)&&_C(n)&&fC(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=fg(e),i=fg(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=fg(e),o=fg(t);a.append(o),eC(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function nme(e=!1){let t=$();if(!Q(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(_C(n)&&n.getChildrenSize()===0)r=n;else if(Fm(n)){let e=n.getParent();_C(e)&&e.getChildren().every(e=>Fm(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Zpe(r),a=r.getParent();fC(a)||XS(40);let o=a.getParent(),s;if(dg(o))s=Qm(),i.insertAfter(s);else{if(!_C(o))return!1;s=fg(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?QS(0,r):1,n=fg(a).setStart(t);if(_C(s)){let e=fg(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!_C(e)&&!fC(e))break;t=e}t.remove()}(r),!0}var rme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function oC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!rme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function ime(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var ame=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`),i=Ef(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=oC(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=oC(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=oC(t.start,1),e},afterCloneFrom:ime}};function ome(e,t){e.__checked=t.__checked,e.__value=t.__value}var sme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=oC(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=oC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=oC(t.value,1),e},afterCloneFrom:ome}},sC={ol:`number`,ul:`bullet`},cme=Uf()({listType:Kf(Wf(Bf([`number`,`bullet`,`check`]),sC),{getter:{field:`__listType`}}),start:Gf(Rf(1),{field:`__start`}),tag:Kf(Bf([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),cC=class extends bm{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&ym(Lg())&&tle(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();fC(t)&&e.getListType()===t.getListType()&&nC(e,t)}(e),eme(e)},children:[pC],extends:bm,generated:ame,importDOM:rm({ol:()=>({conversion:uC,priority:0}),ul:()=>({conversion:uC,priority:0})}),json:cme,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=sC[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Cg().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,lC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(lC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(jg(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){iC(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)_C(e)&&!fC(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e1?r.push(...e):i.push(...e)}}i.length>0&&Nb(e,...i),r.length>0&&Mb(e,...r)}function uC(e){let t;if(function(e){return jg(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=dC(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(jg(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?dC(`check`):dC(`bullet`);return Gg(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t1&&e.forEach(e=>{fC(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function dC(e=`number`,t=1){return pg(new cC(e,t))}function fC(e){return e instanceof cC}var lme=Uf()({checked:Kf(Hf(zf()),{setter:{field:`__checked`}}),indent:Kf(Rf(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:Gf(Rf(1),{derived:!0,field:`__value`})}),pC=class extends bm{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(fC(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();fC(n)||XS(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of _b(e,t)){if(!_C(n))break;r.push(n)}}let i=ym(Lg()),a=i?function(e,t){let n=$();if(!Q(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,cC],extends:bm,generated:sme,importDOM:rm({li:()=>({conversion:ume,priority:0})}),json:lme})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=Cg().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!fC(n)||n.getListType()!==`check`||fC(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=fC(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>fC(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...jb(a)),u.length>0&&Nb(e,...u);let d=[];if(i!==void 0&&d.push(...jb(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...jb(a)),d.length>0&&Mb(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&Dm(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=Em(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in Em(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),ZS(this)?{after(e){if(jg(e)){let t=e.previousElementSibling;if(jg(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;ti.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&ZS(t)&&ZS(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(nC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=fg(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(ZS(this))return!1;let t=this.getParentOrThrow();if(_C(t.getParentOrThrow()))return aC(this),!0;let n=Qm().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=fg(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return fC(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_C(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&XS(117),(e=Math.floor(e))>=0||XS(199);let t=e,n=this.getIndent();for(;n!==t;)n0&&t.children[0].tagName===`INPUT`)return mC(t.children[0])}let t=e.getAttribute(`aria-checked`),n=gC(t===`true`||t!==`false`&&void 0);return Kg(n,e),{after:hC.bind(null,n),node:Gg(n,e)}}function mC(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=gC(e.hasAttribute(`checked`));return{after:hC.bind(null,t),node:t}}function hC(e,t){let n=t[0];return t.length===1&&$m(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function gC(e){return pg(new pC(void 0,e))}function _C(e){return e instanceof pC}var vC=rd(`INSERT_UNORDERED_LIST_COMMAND`),yC=rd(`INSERT_ORDERED_LIST_COMMAND`);function bC(e,t,n=null){let r=Sg(n),i=n?bg(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=$h(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(yg(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>te.bottom?t-e.bottom:0,o=t=>et.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(ne}).createHTML(e):e}var CC=(e,t)=>{if(!Q(t))return t.insertRawText(e),!0;t!==$()&&Nh(t);let n=e=>{let t=$();Q(t)&&e(t)};return Fy(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([th()])),text:e=>n(t=>t.insertText(e))}),!0},wC={"application/x-lexical-editor":[(e,t,n)=>{try{let n=Lg(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return jC(n,yme(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=Lg();return jC(n,mpe(n,new DOMParser().parseFromString(dme(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[CC],"text/uri-list":[CC]};function fme(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function TC(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?tn):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&fme(e.$importMimeType[i],a,n,t))return!0}return!1}var pme={$importMimeType:wC,$insertDataTransfer:(e,t)=>TC({$importMimeType:wC,priority:SC},e,t),priority:SC},mme={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>TC(t,e,n),priority:t.priority}),config:{$importMimeType:wC,priority:SC},mergeConfig(e,t){let n=Ab(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function EC(e,t=$()){return t??xC(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?``:gpe(e,t)}function DC(e,t=$()){return t??xC(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(vme(e,t))}function OC(e,t,n){(function(){let e=wfe(mme.name);return e?e.output:pme})().$insertDataTransfer(e,t)}var kC=`application/x-lexical-drag`;function hme(e,t){let n={editorKey:t.getKey()};e.setData(kC,JSON.stringify(n))}function AC(e){let t=e;if(mb(t)){if(t.offset===0)t=Hm(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(gb(t))t=Hm(_b(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=_b(e,`next`)}}}function gme(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(kC);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=bC(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Oh(n.node);if(r===null)return null;if(Fm(r))return vb(r,`next`,n.offset);let i=r.getParent();if(Z(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=zg(r,e,t);return n.node===a.element||i?qm(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&qm(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=$();if(o){if(!Q(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Km(Vm(t),`next`),i=AC(e);return Db(AC(n),i)<=0&&Db(i,AC(r))<=0}(a,s))return e.preventDefault(),!0}let c=Wm(a),l=mb(c)?Dle(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Q(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||xC(438),n(r,zm(wb(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of xg(t)){let t=fh(n);if(uh(t)&&t.getKey()===e&&jg(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function _me(e,t){return gme(e,t,OC)}function jC(e,t,n){e.dispatchCommand(ad,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Q(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Lm(t,`previous`);if(r){if(mb(r))n=r.origin;else{let e=Tb(r,bb(jh(),`next`).getFlipped());for(let t of e){if(Fm(t.origin)){n=t.origin;break}if(Z(t.origin)&&!t.origin.isInline())break}}}if(n&&Fm(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function MC(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=Z(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&Fm(o)&&(o=bde(t,o,`clone`));let s=of(o),c=Z(o)?o.getChildren():[],l=s.children||[];Fm(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&ty(t)&&Z(n)?null:t;for(let r=0;r0){let n={};for(let r of t){let t=ab(o,r);t===null&&xC(366,o.constructor.name,r);let i=[];MC(e,null,t,i),(i.length!==1||Z(t)&&t.excludeFromCopy(`clone`))&&xC(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e{e.update(()=>{r(FC(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=vg(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Hd,r=>(Rb(r,ClipboardEvent)&&(o(),NC!==null&&(i.clearTimeout(NC),NC=null),t(FC(e,r,n))),!0),4);NC=i.setTimeout(()=>{o(),NC=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function FC(e,t,n){if(n===void 0){let t=vg(e._window),r=$();if(!r||r.isCollapsed()||!t)return!1;let i=Eg(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!lh(e,a,o))return!1;n=IC(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(LC(r,n),!0)}var bme=[[`text/html`,EC],[`application/x-lexical-editor`,DC]];function IC(e=$()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Cme(i,t);e!==null&&(n[r]=e)}return n}(xme(),e)}function LC(e,t){for(let[n]of bme)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function xme(e=Lg()){let t=Gb(e,wme.name);return t?t.output:Sme}var Sme={"application/x-lexical-editor":[(e,t)=>e?DC(Lg(),e):t()],"text/html":[(e,t)=>e?EC(Lg(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Cme(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var wme={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:Sme},mergeConfig(e,t){let n=Ab(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},Tme={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},RC=Symbol.for(`@lexical/dragon/WindowState`);function Eme(e,t,n){let r=function(e){let t=e[RC];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[RC]=t),t}(e);if(r.installs.size===0){let t=Ame.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return Dme.bind(null,e,r,t,n)}function Dme(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[RC])}function Ome(e){return e&&e.ownerDocument.defaultView}function kme(e){let t=cx(()=>Ome(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=Ome(e)}));return sx(()=>{let n=t.value;if(n)return Eme(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function Ame(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[RC];if(t===void 0)return null;let n=fh(Og(e.document));return uh(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=$();if(Q(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(Fm(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),Fm(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=Tme[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var jme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function zC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!jme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Mme(e,t,n,r,i){let a=zC(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Nme(e,t){e.__tag=t.__tag}var Pme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Mme(t.indent,0,0,1/0),e.__textFormat=zC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Nme}},Fme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Mme(t.indent,0,0,1/0),e.__textFormat=zC(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ime=rd(`DRAG_DROP_PASTE_FILE`),BC=Yf(`shadowRoot`,{parse:zf()}),VC=class extends bm{$config(){return this.config(`quote`,{children:`inline`,extends:bm,generated:Fme,importDOM:{blockquote:()=>({conversion:zme,priority:0})},stateConfigs:[{flat:!0,stateConfig:BC}]})}isShadowRoot(){return Xf(this,BC)}setIsShadowRoot(e){return Zf(this,BC,e)}createDOM(e){let t=Cg().createElement(`blockquote`);return Mb(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return HC().updateFromJSON(e)}insertNewAfter(e,t){let n=Qm();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=Qm();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function HC(e){let t=pg(new VC);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function UC(e){return e instanceof VC}var Lme=Uf()({tag:Gf(Bf([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),WC=class extends bm{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:bm,generated:Pme,importDOM:{h1:()=>({conversion:GC,priority:0}),h2:()=>({conversion:GC,priority:0}),h3:()=>({conversion:GC,priority:0}),h4:()=>({conversion:GC,priority:0}),h5:()=>({conversion:GC,priority:0}),h6:()=>({conversion:GC,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Rme(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Rme(e)?{conversion:()=>({node:KC(`h1`)}),priority:3}:null},json:Lme})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Cg().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];Mb(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&Kde(e.anchor,this),r=e&&Gde(e.anchor,this),i=n||!e?Qm():KC(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=Qm();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Qm();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function Rme(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function GC(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=KC(t),Wg(e,n),Kg(n,e),Gg(n,e)),{node:n}}function zme(e){let t=HC();return Kg(t,e),Wg(e,t),Gg(t,e),{node:t}}function KC(e=`h1`){return pg(new WC(e))}function qC(e){return e instanceof WC}function Bme(e){return Sm(Oh(e))&&!(jg(e)&&e.hasAttribute(`data-lexical-slot`))}function Vme(e){let t=e.focus;return t.key===`root`&&t.offset===jh().getChildrenSize()}function Hme(e){let t=e.focus;return t.key===`root`&&t.offset===0}function Ume(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?Vme(e):Hme(e)))return!1;let r=e.focus.offset;return gg(jh().getChildAtIndex(n?r-1:r))}function JC(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(Fm(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&Fm(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Wme={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function YC(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=Lm(e.focus,t),r=g_(n.origin,ug);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!ag(i,r))return!1;let a=Tb(n,_b(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=Tb(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!hb(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of Cb(_b(r,t))){if(!e.origin.is(c.getParent())){if(gg(e.origin)){let e=_b(c,t);return zm(Tb(e,e)),!0}break}if(!ug(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=Lm(e.anchor,t).getNodeAtCaret();return!(!ug(n)||n.isInline()||(zm(wb(Wm(bb(n,t)))),0))}(e,t)}function Gme(e){return Sm(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function XC(e){let t=Cy();t.add(e),Nh(t)}function Kme(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=Lm(n,i);if(n.type===`element`&&Z(r)&&dg(r)){let e=a.getNodeAtCaret();return!(e===null||!Gme(e)||(XC(e.__key),0))}let o=g_(Z(r)?r:r.getParentOrThrow(),e=>Z(e)&&!e.isInline()&&dg(e.getParent()));if(o===null)return!1;let s=_b(o,i).getNodeAtCaret();if(s===null||!Gme(s))return!1;if(o.getTextContentSize()===0)return XC(s.__key),!0;let c=Lg().getRootElement();if(c===null)return!1;let l=vg(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return qme(l,u,d,f,p),!1;let g=Oh(m);return qme(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!ag(g,o))&&(XC(s.__key),!0)}function qme(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function Jme(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=g_(Z(n)?n:n.getParentOrThrow(),e=>Z(e)&&!e.isInline());if(r===null)return!1;let i=Lg(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(Z(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=_b(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!Z(c)){if(t){let e=r.getFirstDescendant();Fm(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(Fm(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=vg(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=bC(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(Fm(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function ZC(e,t){let n=_b(e,t),r=n.getAdjacentCaret();r!==null&&Z(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?zm(wb(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function QC(e,t){let n=e.getNodes().map(e=>_b(e,`next`)).sort(Db),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e_b(e,`next`)).sort(Db),a=(t?i[0]:i[i.length-1]).origin,o=g_(a,e=>e!==a&&Z(e)&&!e.isInline())??jh(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function Yme(e,t){return e.length>0&&!t}function Xme(e,t=rx(Wme),n=rx(Yme)){return pv(e.registerCommand(od,n=>{let r=$();if(ty(r)){let t=n.target;if(jg(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Q(r)&&JC(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(dd,e=>{let t=$();return Q(t)?(t.deleteCharacter(e),!0):!!ty(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(_d,e=>{let t=$();return!!Q(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(vd,e=>{let t=$();return!!Q(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(md,t=>{let n=$();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)OC(r,n,e);else if(Q(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(gd,()=>{let e=$();return!!Q(e)&&(e.removeText(),!0)},0),e.registerCommand(yd,e=>{let t=$();return!(!Q(t)&&!ty(t)||(iy(t,e),0))},0),e.registerCommand(yce,e=>{let t=$();return!(!Q(t)&&!ty(t)||(Rue(t,e),0))},0),e.registerCommand(zd,e=>{let t=$();if(!Q(t)&&!ty(t))return!1;let n=t.getNodes();for(let t of n){let n=g_(t,e=>Z(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(fd,e=>{let t=$();return!!Q(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(pd,()=>{let e=$();return!!Q(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(Fd,()=>{let e=th(),t=$();return Q(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Py([e]),!0},0),e.registerCommand(Id,()=>Ide(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Ld,()=>Ide(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(Dd,e=>{let t=$();if(ty(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!QC(t,`previous`))return e.preventDefault(),ZC(n[0],`previous`),!0;t=$()}}return Q(t)&&(Hme(t)||!e.shiftKey&&YC(t,`previous`)||!e.shiftKey&&Kme(t,!0)||!e.shiftKey&&Jme(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(Od,e=>{let t=$();if(ty(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!QC(t,`next`))return e.preventDefault(),ZC(n[0],`next`),!0;t=$()}}return Q(t)&&(Vme(t)||!e.shiftKey&&YC(t,`next`)||!e.shiftKey&&Kme(t,!1)||!e.shiftKey&&Jme(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(Td,e=>{let n=$();if(ty(n)){let t=n.getNodes();if(t.length>0){let r=Pb(t[0])?`next`:`previous`;if(!e.shiftKey||!QC(n,r))return e.preventDefault(),ZC(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=Pb(n.anchor.getNode())?`next`:`previous`;if(Ume(n,r)||!e.shiftKey&&YC(n,r))return e.preventDefault(),!0;if(e.shiftKey||JC(n,`arrow`,`start`,t.peek()),Tde(n,!0)){let t=e.shiftKey;return e.preventDefault(),Ode(n,t,!0),!0}return!1},0),e.registerCommand(Cd,e=>{let n=$();if(ty(n)){let t=n.getNodes();if(t.length>0){let r=Pb(t[0])?`previous`:`next`;if(!e.shiftKey||!QC(n,r))return e.preventDefault(),ZC(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=Pb(n.anchor.getNode())?`previous`:`next`;if(Ume(n,r)||!e.shiftKey&&YC(n,r))return e.preventDefault(),!0;if(e.shiftKey||JC(n,`arrow`,`end`,t.peek()),Tde(n,!1)){let t=e.shiftKey;return e.preventDefault(),Ode(n,t,!1),!0}return!1},0),e.registerCommand(jd,t=>{let n=$();if(!ty(n)&&Bme(t.target))return!1;if(Q(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(Tm(n))return!1;let r=Fde(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Ld);if(Wu&&Uu)return!1}else if(!ty(n))return!1;return t.preventDefault(),e.dispatchCommand(dd,!0)},0),e.registerCommand(Nd,t=>{let n=$();return!(!ty(n)&&Bme(t.target))&&!(!Q(n)&&!ty(n))&&(t.preventDefault(),e.dispatchCommand(dd,!1))},0),e.registerCommand(kd,n=>{let r=$();if(ty(r)){let e=r.getNodes();e.length===1&&Sm(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Q(r))return!1;if(JC(r,`enter`,`both`,t.peek()),n!==null){if((Wu||Ku||Yu)&&Uu)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(fd,!1)}return e.dispatchCommand(pd)},0),e.registerCommand(Md,()=>!!Q($())&&(e.blur(),!0),0),e.registerCommand(Rd,t=>{let[,n]=zb(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=bC(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=Oh(t);if(n!==null){let t=Sy();if(Fm(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}Nh(fm(t))}}return!(!e.dispatchCommand(Ime,n)&&Wu&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return _me(t,e)},0),e.registerCommand(Bd,t=>{let[n]=zb(t),r=$();return!(n&&!Q(r)||(Q(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(LC(t.dataTransfer,IC(r)),hme(t.dataTransfer,e)),0))},0),e.registerCommand(Vd,t=>{let[n]=zb(t),r=$();if(n&&!Q(r))return!1;let i=t.clientX,a=t.clientY,o=bC(i,a,e.getRootElement());return o!==null&&Sm(Oh(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Wd,()=>{let e=$();return zle(Q(e)&&tb(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Hd,t=>!ch(t)&&(PC(e,Rb(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Ud,t=>!ch(t)&&(async function(e,t){t.update(()=>{let e=$();Q(e)&&!e.isCollapsed()&&ay(e)},{discrete:!0,tag:`cut`}),await PC(t,Rb(e,ClipboardEvent)?e:null),t.update(()=>{let e=$();Q(e)?e.removeText():ty(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(hd,t=>{let[,r,i]=zb(t);return!(!n.peek()(r,i)||!e.dispatchCommand(Ime,r))||!ch(t)&&$()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=$(),r=Rb(e,InputEvent)||Rb(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&OC(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Ad,()=>{let e=$();return Q(e)&&JC(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Pd,()=>{let e=$();return Q(e)&&JC(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(wd,e=>{let t=$();if(ty(t))return $C(t,!1,e);if(!Q(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!Z(r))return!1;let i=r.getFirstChild();if(!Sm(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Ed,e=>{let t=$();if(ty(t))return $C(t,!0,e);if(!Q(t))return!1;let{anchor:n,focus:r}=t,i=g_(r.getNode(),e=>Z(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!Sm(a)||!a.isInline()||g_(n.getNode(),e=>Z(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function ew(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function tw(e){let t=ew(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var nw=/[!-/:-@[-`{-~\s]/,rw=/\s/,iw=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Zme=/^\s{0,3}$/;function aw(e){if(!$m(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&Fm(t)&&Zme.test(t.getTextContent())}function ow(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function sw(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function cw(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function lw(e,t,n,r,i){if(!uw(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!uw(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&iw.test(e)}return!0}function uw(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!rw.test(o)&&(!iw.test(o)||s===void 0||rw.test(s)||iw.test(s))}var dw=/^(\s*)(\d{1,})\.\s/,fw=/^(\s*)[-*+]\s/,Qme=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,pw=/^(#{1,6})\s/,mw=/^>\s/,hw=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,gw=/^[ \t]*`{3,}$/,$me=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,ehe=/^(?:\|)(.+)(?:\|)\s?$/;function the(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n0&&(n===t||n===t-1&&/\s/.test(e[n]))}var _w=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,vw=/^<\/[a-z_][\w-]*\s*>/i,yw=e=>RegExp(`(?:${e.source})$`,e.flags),bw=Yf(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),xw=Yf(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Sw=Yf(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),Cw=Yf(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function ww(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function Tw(e){let t=T_(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!Fm(r))return null;let i=r.getTextContent(),a=ww(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(E_(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&Zf(t,Cw,n),t}function Ew(e){return UC(e)}function Dw(e,t){let n=0;for(;n(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function kw(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var Aw=null,jw=!1,Mw=e=>(t,n,r,i)=>{if(qC(t)||!i&&Ew(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=gC(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==bw.parse(c)?void 0:c,u=Aw,d=a;if(u!==null){if(jw)for(;d!==null&&aw(d);)d=d.getPreviousSibling();fC(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=kw(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(fC(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(fC(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=dC(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!fC(r)||r.getListType()===t)return;let i=r.getParent();if(!_C(i))return;let a=dC(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=gC();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&fC(p)&&Zf(p,bw,l),u!==null&&function(e,t,n,r){for(let n=e.length;n{let i=[],a=e.getChildren(),o=0;for(let s of a)if(_C(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(fC(e)){let a=Nw(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Xf(e,bw),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(` +`)},rhe=Ow(e=>KC(`h`+e[1].length)),Pw={dependencies:[WC],export:(e,t)=>{if(!qC(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:pw,replace:(e,t,n,r)=>!(!r&&Ew(e))&&rhe(e,t,n,r),triggerOnEnter:!0,type:`element`},Fw={dependencies:[VC],export:(e,t)=>{if(!UC(e))return null;let n=t(e).split(` `),r=[];for(let e of n)r.push(`> `+e);return r.join(` -`)},regExp:vw,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(HC(n))return n.splice(n.getChildrenSize(),0,[kw(n),...t]),void e.remove()}let i=VC();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},Bw={dependencies:[pS],export:e=>{if(!hS(e))return null;let t=e.getTextContent(),n=tf(e,Tw);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?tf(e,Ew):``;return n+r+(i?` `+i:``)+(t?` +`)},regExp:mw,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(UC(n))return n.splice(n.getChildrenSize(),0,[Tw(n),...t]),void e.remove()}let i=HC();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},Iw={dependencies:[hS],export:e=>{if(!_S(e))return null;let t=e.getTextContent(),n=Xf(e,xw);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?Xf(e,Sw):``;return n+r+(i?` `+i:``)+(t?` `+t:``)+` -`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,Bw.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=mS(l),s=jw(i[0],u)):(o=mS(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=mS(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>jw(e,u)).join(` -`)}nf(o,Tw,c);let t=Gm(s);o.append(t),e.append(o)}else if(t){if(!a&&Aw(e))return!1;Mw(e=>mS(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},Vw={dependencies:[cC,nC],export:(e,t,n)=>fC(e)?Lw(e,t,0,n):null,regExp:gw,replace:Iw(`bullet`),triggerOnEnter:!0,type:`element`},Hw={dependencies:[cC,nC],export:(e,t,n)=>fC(e)?Lw(e,t,0,n):null,regExp:hw,replace:Iw(`number`),triggerOnEnter:!0,type:`element`},Uw={format:[`code`],tag:"`",type:`text-format`},Hpe={format:[`highlight`],tag:`==`,type:`text-format`},Ww={format:[`bold`,`italic`],tag:`***`,type:`text-format`},Gw={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},Kw={format:[`bold`],tag:`**`,type:`text-format`},qw={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},Jw={format:[`strikethrough`],tag:`~~`,type:`text-format`},Yw={format:[`italic`],tag:`*`,type:`text-format`},Xw={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function Zw(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&`)}var Qw={dependencies:[BS],export:(e,t,n)=>{if(!HS(e)||US(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=Zw(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=Zw(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,` `).replace(/\n/g,` `)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{if(Qv(e,HS))return;let[,n,r,i,a,o,s]=t,c=mw(r??i??``),l=a??o??s,u=VS(c,{title:l==null?void 0:mw(l)}),d=n.split(`[`).length-1,f=n.split(`]`).length-1,p=n,m=``;if(df){let e=n.split(`[`);m=`[`+e[0],p=e.slice(1).join(`[`)}let h=e.getFormat(),g=Gm(p);return g.setFormat(h),u.append(g),e.replace(u),m&&u.insertBefore(Gm(m).setFormat(h)),g},trigger:`)`,type:`text-match`},Upe=[Rw,zw,Vw,Hw],Wpe=[Bw],Gpe=[Uw,Ww,Gw,Kw,qw,Hpe,Yw,Xw,Jw],Kpe=[Qw];function qpe(...e){return e.flat()}var $w=qpe(Upe,Wpe,Gpe,Kpe);function Jpe(e,t=!1){let n=e.split(` -`),r=0,i=[];for(let e=0;e=r){r=0,i.push(o);continue}i.push(a)}}return i.join(` -`)}function Ype(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>eT(e,n,r,void 0,void 0,i));if(t!=null)return t}return $(e)?eT(e,n,r,void 0,void 0,i):vg(e)?e.getTextContent():null}function eT(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>eT(e,t,n,r,[...i,...r],a),(e,n)=>tT(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}Og(e)?o.push(Xpe(e)):X(e)?o.push(tT(e,e.getTextContent(),t,r,i,a)):$(e)?o.push(eT(e,t,n,r,i,a)):vg(e)&&o.push(e.getTextContent())}return o.join(``)}function Xpe(e){return tf(e,Dw)+` -`}function tT(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([*_`~\\])/g,`\\$1`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=nT(e,!0),g=nT(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!iT(e,n)||_.has(n)||(_.add(n),iT(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;tt;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function nT(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return X(n)?n:null}function rT(e,t){return X(e)&&e.hasFormat(t)}function iT(e,t){return!(!rT(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function aT(e,t,n,r,i){if(!oT(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!oT(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&fw.test(e)}return!0}function oT(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!dw.test(o)&&(!fw.test(o)||s===void 0||dw.test(s)||fw.test(s))}function sT(e){return X(e)&&!e.hasFormat(`code`)}function cT(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=function(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e0?function(e,t,n){let r={},i=0,a=null;for(;ic;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndexa.endIndex)&&(a=f);for(let e=r+1;e0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent().match(e.importRegExp);if(!t)continue;let s=t.index||0,c=e.getEndIndex?e.getEndIndex(n,t):s+t[0].length;!1!==c&&(r===void 0||i===void 0||si||c<=r))&&(r=s,i=c,a=e,o=t)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);sT(i.nodeAfter)&&cT(i.nodeAfter,t,n),sT(i.nodeBefore)&&cT(i.nodeBefore,t,n),sT(i.transformedNode)&&cT(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;sT(r.nodeAfter)&&cT(r.nodeAfter,t,n),sT(r.nodeBefore)&&cT(r.nodeBefore,t,n),sT(r.transformedNode)&&cT(r.transformedNode,t,n)}let a=mw(e.getTextContent());e.setTextContent(a)}function Zpe(e,t,n,r=!1){let i=lw(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(` -`),s=o.length;(function(e){let n=Pw,c=Fw;Pw=[],Fw=e;try{return(()=>{for(let e=0;e1)e.remove();else if($(e))for(let t of e.getAllTextNodes())eme(t)}function Qpe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d0){let e=s.getPreviousSibling();if(!a&&(Xg(e)||HC(e)||fC(e))){let t=e;if(fC(e)){let n=e.getLastDescendant();t=n==null?null:Qv(n,oC)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[kw(t),...s.getChildren()]),s.remove())}}}function eme(e){if(Ym(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(Gm(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(Jm()),a=e+1;a=r;i--){let t=i-r;if(pT(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function fT(e){let t=e.getNode(),n=0;if(X(t))n=e.offset;else if($(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function pT(e,t,n,r,i){for(let a=0;ae.triggerOnEnter),i=cw(n.textFormat,({tag:e})=>e[e.length-1]),a=cw(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||tme(173,n.getType())}}return Ky(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read(Q),d=c.read(Q);if(!Z(d)||!Z(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(X(m)&&r.has(f)&&(l||p===1||!(s.read(()=>fT(u.anchor))>c.read(()=>fT(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!sT(m))return;let e=m.getParent();e===null||hS(e)||((e,t,r)=>!!(lT(e,t,r,n.element)||uT(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t1&&!pT(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!uw.test(c))continue;let l=e,u=l,d=dT(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!Og(f);)if(X(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=dT(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!uw.test(m)||!t.format.includes(`code`)&&nme(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=Q(),y=Ch();j_(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,Zu[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Z(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&ev(`history-push`)})}}),e.registerCommand(Ep,e=>{if(e!==null&&e.shiftKey)return!1;let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!X(a)||!sT(a))return!1;let o=a.getParent();return o!==null&&!hS(o)&&!(i!==a.getTextContent().length||!uT(o,a,i,n.multilineElement,!0)&&!lT(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function mT(e,t=$w,n,r=!1,i=!1){let a=r?e:Jpe(e,i),o=n||k_();o.clear(),Zpe(a,o,t,r),Q()!==null&&o.selectStart()}function hT(e=$w,t,n=!1){return function(e,t=!1){let n=lw(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||k_()).getChildren();for(let e=0;e0&&!pw(c)&&!pw(s[e-1])?` +`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,Iw.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=gS(l),s=Dw(i[0],u)):(o=gS(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=gS(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>Dw(e,u)).join(` +`)}Zf(o,xw,c);let t=Pm(s);o.append(t),e.append(o)}else if(t){if(!a&&Ew(e))return!1;Ow(e=>gS(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},Lw={dependencies:[cC,pC],export:(e,t,n)=>fC(e)?Nw(e,t,0,n):null,regExp:fw,replace:Mw(`bullet`),triggerOnEnter:!0,type:`element`},Rw={dependencies:[cC,pC],export:(e,t,n)=>fC(e)?Nw(e,t,0,n):null,regExp:dw,replace:Mw(`number`),triggerOnEnter:!0,type:`element`},zw={format:[`code`],tag:"`",type:`text-format`},ihe={format:[`highlight`],tag:`==`,type:`text-format`},Bw={format:[`bold`,`italic`],tag:`***`,type:`text-format`},Vw={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},Hw={format:[`bold`],tag:`**`,type:`text-format`},Uw={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},Ww={format:[`strikethrough`],tag:`~~`,type:`text-format`},Gw={format:[`italic`],tag:`*`,type:`text-format`},Kw={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function qw(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&`)}var Jw={dependencies:[US],export:(e,t,n)=>{if(!GS(e)||KS(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=qw(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=qw(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,` `).replace(/\n/g,` `)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{let n=t.input||``,r=t.index||0;if(g_(e,GS)||sw(n,r)||sw(n,r+t[1].length+1))return;let[,i,a,o,s,c,l]=t,u=ow(a??o??``),d=s??c??l,f=WS(u,{title:d==null?void 0:ow(d)}),p=function(e){let t=cw(e),n=0,r=e.replace(/\\.|[[\]]/g,(e,r)=>{for(;n=t[n].endIndex;)n++;return n=t[n].startIndex||e[0]===`\\`?` `.repeat(e.length):e}),i=[],a=!1;for(let e=0;e=r){r=0,i.push(o);continue}i.push(a)}}return i.join(` +`)}function uhe(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>Zw(e,n,r,void 0,void 0,i));if(t!=null)return t}return Z(e)?Zw(e,n,r,void 0,void 0,i):Sm(e)?e.getTextContent():null}function Zw(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>Zw(e,t,n,r,[...i,...r],a),(e,n)=>Qw(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}E_(e)?o.push(dhe(e)):Fm(e)?o.push(Qw(e,e.getTextContent(),t,r,i,a)):Z(e)?o.push(Zw(e,t,n,r,i,a)):Sm(e)&&o.push(e.getTextContent())}return o.join(``)}function dhe(e){return Xf(e,Cw)+` +`}function Qw(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([[\]*_`~\\]|<(?=\S|$)|&(?=#|$))/g,e=>/[*_`~\\]/.test(e)?`\\${e}`:`&#${e.charCodeAt(0)};`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=$w(e,!0),g=$w(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!tT(e,n)||_.has(n)||(_.add(n),tT(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;tt;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function $w(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return Fm(n)?n:null}function eT(e,t){return Fm(e)&&e.hasFormat(t)}function tT(e,t){return!(!eT(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function fhe(e,t){let n=new RegExp(t.source,t.flags.replace(/[gy]/g,``)+`g`),r;for(;(r=n.exec(e))!==null;){if(!sw(e,r.index))return r;n.lastIndex=r.index+1}return null}function nT(e){return Fm(e)&&!e.hasFormat(`code`)}function rT(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=cw(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e0?function(e,t,n){let r={},i=0,a=null;for(;ic;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndexa.endIndex)&&(a=f);for(let e=r+1;e0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent(),s=Jw.importRegExp!==void 0&&e.importRegExp.source===Jw.importRegExp.source?fhe(t,e.importRegExp):t.match(e.importRegExp);if(!s)continue;let c=s.index||0,l=e.getEndIndex?e.getEndIndex(n,s):c+s[0].length;!1!==l&&(r===void 0||i===void 0||ci||l<=r))&&(r=c,i=l,a=e,o=s)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);nT(i.nodeAfter)&&rT(i.nodeAfter,t,n),nT(i.nodeBefore)&&rT(i.nodeBefore,t,n),nT(i.transformedNode)&&rT(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{matchedNode:a,nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;nT(r.nodeAfter)&&rT(r.nodeAfter,t,n),nT(r.nodeBefore)&&rT(r.nodeBefore,t,n),nT(r.transformedNode)?rT(r.transformedNode,t,n):r.transformedNode===void 0&&nT(r.matchedNode)&&r.matchedNode.getParent()!==null&&r.matchedNode.setTextContent(ow(r.matchedNode.getTextContent()))}if(!r&&!i){let t=ow(e.getTextContent());e.setTextContent(t)}}function iT(e,t,n,r=!1){let i=tw(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(` +`),s=o.length;(function(e){let n=Aw,c=jw;Aw=[],jw=e;try{return(()=>{for(let e=0;e1)e.remove();else if(Z(e))for(let t of e.getAllTextNodes())hhe(t)}function phe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d0){let e=s.getPreviousSibling();if(!a&&($m(e)||UC(e)||fC(e))){let t=e;if(fC(e)){let n=e.getLastDescendant();t=n==null?null:g_(n,_C)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[Tw(t),...s.getChildren()]),s.remove())}}}function hhe(e){if(nh(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(Pm(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(th()),a=e+1;a=r;i--){let t=i-r;if(lT(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function cT(e){let t=e.getNode(),n=0;if(Fm(t))n=e.offset;else if(Z(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function lT(e,t,n,r,i){for(let a=0;ae.triggerOnEnter),i=ew(n.textFormat,({tag:e})=>e[e.length-1]),a=ew(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||ghe(173,n.getType())}}return pv(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read($),d=c.read($);if(!Q(d)||!Q(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(Fm(m)&&r.has(f)&&(l||p===1||!(s.read(()=>cT(u.anchor))>c.read(()=>cT(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!nT(m))return;let e=m.getParent();e===null||_S(e)||((e,t,r)=>!!(aT(e,t,r,n.element)||oT(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t1&&!lT(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!nw.test(c))continue;let l=e,u=l,d=sT(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!E_(f);)if(Fm(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=sT(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!nw.test(m)||!t.format.includes(`code`)&&_he(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=$(),y=Sy();Nh(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,$u[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Q(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&rg(`history-push`)})}}),e.registerCommand(kd,e=>{if(e!==null&&e.shiftKey)return!1;let t=$();if(!Q(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!Fm(a)||!nT(a))return!1;let o=a.getParent();return o!==null&&!_S(o)&&!(i!==a.getTextContent().length||!oT(o,a,i,n.multilineElement,!0)&&!aT(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function uT(e,t=Yw,n,r=!1,i=!1){let a=r?e:Xw(e,i),o=n||jh();o.clear(),iT(a,o,t,r),$()!==null&&o.selectStart()}function yhe(e,t=Yw,n=!1,r=!1){let i=n?e:Xw(e,r),a=new C_;return iT(i,a,t,n),a.getChildren()}function dT(e=Yw,t,n=!1){return function(e,t=!1){let n=tw(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||jh()).getChildren();for(let e=0;e0&&!aw(c)&&!aw(s[e-1])?` ${l}`:l)}return o.join(` -`)}}(e,n)(t)}var ime=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,gT={...Bw,export:(e,t)=>{let n=Bw.export?.(e,t)??null,[r]=n?.split(` +`)}}(e,n)(t)}var bhe=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,fT={...Iw,export:(e,t)=>{let n=Iw.export?.(e,t)??null,[r]=n?.split(` `,1)??[];if(!n||!r.includes(``))return n;let i=n.slice(r.length,n.lastIndexOf(` -`)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(ime),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=Bw.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${Bw.regExpStart.source}(?=[^\`]*$)`)},_T=e=>X(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),vT=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(_T))return e;let r=e=>_T(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},yT=e=>{if(!Xg(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&X(t)&&/^\s{0,3}$/.test(t.getTextContent())},ame=e=>{let t=e.getParent();if(!yT(t)||!bg(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!yT(n)?` -`:``,r&&!(e=>{let t=e?.getFirstChild();return yT(e)&&!(X(t)&&t.hasFormat(`code`))})(r)?` -`:``]},bT={dependencies:[],export:(e,t,n)=>{if(!X(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=vT(e),[a,o]=_T(e)?ame(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=Gm(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},xT={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},ome=/^(?:\*\*|__|~~|\*|_)/,ST=e=>X(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,sme=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>X(e)&&/\S/.test(ST(e)))||/^\s/.test(ST(t[0]))||/\s$/.test(ST(t.at(-1))))return[];let n=Object.keys(xT).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||Og(e))return!0;if(!X(e))return!1;let r=t(ST(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},cme=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match(ome)??[],i=n.findIndex(e=>xT[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length{let r=HS(e)?sme(e):[],i,a=Qw.export?.(e,e=>{let n=t(e),a=r.length?cme(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},lme={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},wT={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},TT=[`bold`,`italic`,`strikethrough`,`code`],ET=[...TT,`link`],DT=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],ume={"heading-1":[UC],"heading-2":[UC],"heading-3":[UC],"heading-4":[UC],"heading-5":[UC],"heading-6":[UC],"bulleted-list":[cC,nC],"numbered-list":[cC,nC],blockquote:[BC],"code-block":[pS,xS],link:[BS]},dme={"heading-1":[Rw],"heading-2":[Rw],"heading-3":[Rw],"heading-4":[Rw],"heading-5":[Rw],"heading-6":[Rw],"bulleted-list":[Vw],"numbered-list":[Hw],blockquote:[zw],"code-block":[gT],code:[Uw,bT],bold:[Kw,qw,Ww,Gw],italic:[Xw,Yw,Ww,Gw],strikethrough:[Jw],link:[CT]},fme=[`*`,`__`,`***`,`___`],OT=ap(`OPEN_LINK_EDITOR_COMMAND`),kT=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}];function pme(e,t,n){let r=n(),i=0,a=r,o=0,s=null;return(c,l,u,d,f,p)=>{let m=n();if(p.has(`composition-start`)&&(a=r,o=i,s=c),p.has(`historic`))return i=0,r=m,2;p.has(`composition-end`)&&s&&(r=a,i=o,c=s);let h=p.has(`paste`)||p.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Z(a)&&Z(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||bg(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&X(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!X(l)||!X(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(c,l,d,f,e.isComposing()),g=(()=>{let n=u===null||u.editor===e,a=p.has(`history-push`);if(!a&&n&&p.has(`history-merge`))return 0;if(h===1)return 2;if(c===null)return 1;let o=l._selection;if(!(d.size>0||f.size>0))return o===null?2:0;let s=typeof t==`number`?t:t.peek();return!1===a&&h!==0&&h===i&&mr.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],c,l)?0:1})();return r=m,i=h,g}}function AT(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function jT(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function mme(e,t,n,r=Date.now,i,a=null){let o=pme(e,n,r),s=()=>{i&&i(t)};return s(),Ky(e.registerCommand(_p,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=AT(o,a);t!==null&&(r.push(t),e.dispatchCommand(Vp,!0))}i.length===0&&e.dispatchCommand(Hp,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(vp,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=AT(o,a);t!==null&&(i.push(t),e.dispatchCommand(Hp,!0))}r.length===0&&e.dispatchCommand(Vp,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Rce,()=>(jT(t,i),!1),0),e.registerCommand(zce,()=>(jT(t,i),e.dispatchCommand(Vp,!1),e.dispatchCommand(Hp,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Vp,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Hp,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function hme(){return{current:null,redoStack:[],undoStack:[]}}var MT=/^(\d+(?:\.\d+)?)px$/,gme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function NT(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!gme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function PT(e,t,n,r,i){let a=NT(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function _me(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var vme=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=PT(t.indent,0,0,1/0),e.__textFormat=NT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>NT(e,0)):[]),e.__frozenColumnCount=NT(t.frozenColumnCount,0),e.__frozenRowCount=NT(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:_me}};function yme(e,t){e.__height=t.__height}var bme=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=PT(t.indent,0,0,1/0),e.__textFormat=NT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:NT(s,0),e},afterCloneFrom:yme}};function xme(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var Sme=e=>{let t=Ad(e,`format`),n=jd(e,`format`),r=Nd(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=PT(t.indent,0,0,1/0),e.__textFormat=NT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=PT(t.colSpan,1,1,1/0),e.setHeaderStyles(NT(t.headerState,0)),e.__rowSpan=PT(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||NT(l,0)===0?void 0:NT(l,0),e},afterCloneFrom:xme}},FT={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Cme=Yd()({backgroundColor:Zd(qd(Ud(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Zd(Wd(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:Qd(Wd(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Zd(Wd(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:Qd(Kd([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Zd(Jd(Wd(),{omitDefault:!0}),{field:`__width`})}),IT=class extends hg{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{extends:hg,generated:Sme,importDOM:{td:()=>({conversion:RT,priority:0}),th:()=>({conversion:RT,priority:0})},json:Cme})}constructor(e=FT.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=bv().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),LT(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Wy(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(Ov(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=FT.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return LT(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==FT.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function LT(e){return e===`middle`||e===`bottom`}function RT(e){let t=e,n=e.nodeName.toLowerCase(),r;MT.test(t.style.width)&&(r=parseFloat(t.style.width));let i=FT.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=FT.COLUMN;else if(e===`row`)i=FT.ROW;else{let e=t.parentElement,n=Ov(e)&&e.nodeName.toLowerCase()===`tr`&&Ov(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=FT.ROW),r&&(i|=FT.COLUMN),i===FT.NO_STATUS&&(i=FT.ROW)}}let a=zT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;LT(s)&&(a.__verticalAlign=s),zv(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();Og(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(av(i)||X(i)||Og(i)){if(X(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=Yg().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(Yg()),t},node:a}}function zT(e=FT.NO_STATUS,t=1,n){return uv(new IT(e,t,n))}function BT(e){return e instanceof IT}var wme=ap(`INSERT_TABLE_COMMAND`);function VT(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Tme=Yd()({height:Zd(Jd(Wd()),{field:`__height`})}),HT=class extends hg{__height;$config(){return this.config(`tablerow`,{extends:hg,generated:bme,importDOM:{tr:()=>({conversion:Eme,priority:0})},json:Tme})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=bv().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),Wy(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function Eme(e){let t=e,n;return MT.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>pb(e,BT),node:zv(UT(n),t)}}function UT(e){return uv(new HT(e))}function WT(e){return e instanceof HT}function GT(e,t,n=!0){let r=FE();for(let i=0;iIE(e));if(IE(t))return t;throw Error(`Expected table cell to be inside of table.`)}var KT=(e,t)=>e===FT.BOTH||e===t?t:FT.NO_STATUS;function Ome(e=!0){let t=Q();Z(t)||oE(t)||VT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=eE(n),[a,,o]=eE(r),[,s,c]=QT(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?qT(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):qT(uu+a.__colSpan?i:a,!0):JT(u1&&(r+=i.cell.__colSpan-1)}n===null?XT(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&YT(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function Ame(){let e=Q();Z(e)||oE(e)||VT(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=eE(t),[a]=eE(n),[o,s,c]=QT(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(rd){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){WT(m)||VT(387);let r=null;for(let n=0;n1&&(n+=i.__colSpan-1)}r===null?XT(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);WT(t)||VT(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];YT(e)}else{let{cell:e}=o[l-1][0];YT(e)}}function jme(){let e=Q();Z(e)||oE(e)||VT(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=eE(t),[a]=eE(n),[o,s,c]=QT(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;ep){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;YT(e)}else{let{cell:e}=de.is(t.cell))){o.add(s);let e=t.startRow,c=t.startColumn,l=t.cell.__rowSpan||1,u=t.cell.__colSpan||1;n=Math.min(n,e),r=Math.max(r,e+l-1),i=Math.min(i,c),a=Math.max(a,c+u-1)}}if(n===1/0||i===1/0)return null;let s=r-n+1,c=a-i+1,l=t[n][i];if(!l.cell)return null;let u=l.cell;u.setColSpan(c),u.setRowSpan(s);let d=new Set([u.getKey()]);for(let e=n;e<=r;e++)for(let n=i;n<=a;n++){let r=t[e][n];if(!r.cell)continue;let i=r.cell,a=i.getKey();d.has(a)||(d.add(a),ZT(i)||(ZT(u)&&u.clear(),u.append(...i.getChildren())),i.remove())}return u.getChildrenSize()===0&&u.append(Yg()),u}function ZT(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!Xg(t)||!t.isEmpty())}function Nme(e){let[t,n,r]=eE(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;let[o,s]=QT(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&FT.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e{let n=f;for(let e=0;n!==0&&elv(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(Yg());if(i>1){for(let e=1;e1){let e;for(let t=1;t1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)XT(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function QT(e,t,n){let[r,i,a]=$T(e,t,n);return i===null&&VT(207),a===null&&VT(208),[r,i,a]}function $T(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e=s.length);t++){let n=o(e+t);for(let e=0;e=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function nE(e){let[t,,n]=eE(e),r=n.getChildren().filter(WT),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;eBT(e));if(!(BT(o)&&BT(l)&&WT(s)&&IE(c)))return!1;let[u,d,f]=QT(c,o,l),[p]=$T(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=tE(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(Nme(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=$T(c.getWritable(),null,null),T=v-m+g;for(let e=0;e{X(e)&&Yg().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=$T(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function iE(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=Qv(n,BT);BT(r)||VT(238,t,n.getKey(),n.getType());let i=r.getParent();WT(i)||VT(239,t);let a=i.getParent();return IE(a)||VT(240,t),[n,r,i,a]});return i.is(c)||VT(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var aE=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=S_(this.tableKey),t=S_(this.anchor.key),n=S_(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return oE(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,Xm(this.anchor.key,this.anchor.offset,this.anchor.type),Xm(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(` +`)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(bhe),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=Iw.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${Iw.regExpStart.source}(?=[^\`]*$)`)},pT=e=>Fm(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),mT=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(pT))return e;let r=e=>pT(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},hT=e=>{if(!$m(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&Fm(t)&&/^\s{0,3}$/.test(t.getTextContent())},xhe=e=>{let t=e.getParent();if(!hT(t)||!Tm(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!hT(n)?` +`:``,r&&!(e=>{let t=e?.getFirstChild();return hT(e)&&!(Fm(t)&&t.hasFormat(`code`))})(r)?` +`:``]},gT={dependencies:[],export:(e,t,n)=>{if(!Fm(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=mT(e),[a,o]=pT(e)?xhe(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=Pm(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},_T={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},She=/^(?:\*\*|__|~~|\*|_)/,vT=e=>Fm(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,Che=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>Fm(e)&&/\S/.test(vT(e)))||/^\s/.test(vT(t[0]))||/\s$/.test(vT(t.at(-1))))return[];let n=Object.keys(_T).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||E_(e))return!0;if(!Fm(e))return!1;let r=t(vT(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},whe=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match(She)??[],i=n.findIndex(e=>_T[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length{let r=GS(e)?Che(e):[],i,a=Jw.export?.(e,e=>{let n=t(e),a=r.length?whe(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},The={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},bT={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},xT=[`bold`,`italic`,`strikethrough`,`code`],ST=[...xT,`link`],CT=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],Ehe={"heading-1":[WC],"heading-2":[WC],"heading-3":[WC],"heading-4":[WC],"heading-5":[WC],"heading-6":[WC],"bulleted-list":[cC,pC],"numbered-list":[cC,pC],blockquote:[VC],"code-block":[hS,CS],link:[US]},Dhe={"heading-1":[Pw],"heading-2":[Pw],"heading-3":[Pw],"heading-4":[Pw],"heading-5":[Pw],"heading-6":[Pw],"bulleted-list":[Lw],"numbered-list":[Rw],blockquote:[Fw],"code-block":[fT],code:[zw,gT],bold:[Hw,Uw,Bw,Vw],italic:[Kw,Gw,Bw,Vw],strikethrough:[Ww],link:[yT]},Ohe=[`*`,`__`,`***`,`___`],wT=rd(`OPEN_LINK_EDITOR_COMMAND`),TT=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}];function ET(e){return JSON.stringify([e.exportJSON(),Z(e)?e.getChildrenKeys():null])}function khe(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(`composition-end`);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Q(a)&&Q(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||Tm(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Fm(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!Fm(l)||!Fm(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(`history-push`),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>ET(e))===n.read(()=>ET(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&hr.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function DT(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function OT(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function Ahe(e,t,n,r=Date.now,i,a=null){let o=khe(e,n,r),s=()=>{i&&i(t)};return s(),pv(e.registerCommand(bd,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=DT(o,a);t!==null&&(r.push(t),e.dispatchCommand(Gd,!0))}i.length===0&&e.dispatchCommand(Kd,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(xd,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=DT(o,a);t!==null&&(i.push(t),e.dispatchCommand(Kd,!0))}r.length===0&&e.dispatchCommand(Gd,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(xce,()=>(OT(t,i),!1),0),e.registerCommand(Sce,()=>(OT(t,i),e.dispatchCommand(Gd,!1),e.dispatchCommand(Kd,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Gd,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Kd,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function jhe(){return{current:null,redoStack:[],undoStack:[]}}var kT=/^(\d+(?:\.\d+)?)px$/,Mhe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function AT(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Mhe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function jT(e,t,n,r,i){let a=AT(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Nhe(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var Phe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>AT(e,0)):[]),e.__frozenColumnCount=AT(t.frozenColumnCount,0),e.__frozenRowCount=AT(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:Nhe}};function Fhe(e,t){e.__height=t.__height}var Ihe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:AT(s,0),e},afterCloneFrom:Fhe}};function Lhe(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var Rhe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=jT(t.colSpan,1,1,1/0),e.setHeaderStyles(AT(t.headerState,0)),e.__rowSpan=jT(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||AT(l,0)===0?void 0:AT(l,0),e},afterCloneFrom:Lhe}},MT={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},zhe=Uf()({backgroundColor:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Gf(Rf(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:Kf(Rf(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Gf(Rf(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:Kf(Bf([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Gf(Hf(Rf(),{omitDefault:!0}),{field:`__width`})}),NT=class extends bm{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{children:`block`,extends:bm,generated:Rhe,importDOM:{td:()=>({conversion:FT,priority:0}),th:()=>({conversion:FT,priority:0})},json:zhe})}constructor(e=MT.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=Cg().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),PT(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Mb(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(jg(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=MT.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return PT(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==MT.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function PT(e){return e===`middle`||e===`bottom`}function FT(e){let t=e,n=e.nodeName.toLowerCase(),r;kT.test(t.style.width)&&(r=parseFloat(t.style.width));let i=MT.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=MT.COLUMN;else if(e===`row`)i=MT.ROW;else{let e=t.parentElement,n=jg(e)&&e.nodeName.toLowerCase()===`tr`&&jg(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=MT.ROW),r&&(i|=MT.COLUMN),i===MT.NO_STATUS&&(i=MT.ROW)}}let a=IT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;PT(s)&&(a.__verticalAlign=s),Gg(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();E_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(cg(i)||Fm(i)||E_(i)){if(Fm(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=Qm().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(Qm()),t},node:a}}function IT(e=MT.NO_STATUS,t=1,n){return pg(new NT(e,t,n))}function LT(e){return e instanceof NT}var Bhe=rd(`INSERT_TABLE_COMMAND`);function RT(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Vhe=Uf()({height:Gf(Hf(Rf()),{field:`__height`})}),zT=class extends bm{__height;$config(){return this.config(`tablerow`,{extends:bm,generated:Ihe,importDOM:{tr:()=>({conversion:Hhe,priority:0})},json:Vhe})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=Cg().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),Mb(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function Hhe(e){let t=e,n;return kT.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>Bb(e,LT),node:Gg(BT(n),t)}}function BT(e){return pg(new zT(e))}function VT(e){return e instanceof zT}function HT(e,t,n=!0){let r=KE();for(let i=0;iqE(e));if(qE(t))return t;throw Error(`Expected table cell to be inside of table.`)}var UT=(e,t)=>e===MT.BOTH||e===t?t:MT.NO_STATUS;function Whe(e=!0){let t=$();Q(t)||iE(t)||RT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=QT(n),[a,,o]=QT(r),[,s,c]=YT(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?WT(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):WT(uu+a.__colSpan?i:a,!0):GT(u1&&(r+=i.cell.__colSpan-1)}n===null?qT(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&KT(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function Khe(){let e=$();Q(e)||iE(e)||RT(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=QT(t),[a]=QT(n);ZT(i);let[o,s,c]=YT(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(rd){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){VT(m)||RT(387);let r=null;for(let n=0;n1&&(n+=i.__colSpan-1)}r===null?qT(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);VT(t)||RT(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];KT(e)}else{let{cell:e}=o[l-1][0];KT(e)}}function qhe(){let e=$();Q(e)||iE(e)||RT(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=QT(t),[a]=QT(n);ZT(i);let[o,s,c]=YT(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;ep){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;KT(e)}else{let{cell:e}=de.is(n.cell))){s.add(t);let e=n.startRow,c=n.startColumn,l=n.cell.__rowSpan||1,u=n.cell.__colSpan||1;r=Math.min(r,e),i=Math.max(i,e+l-1),a=Math.min(a,c),o=Math.max(o,c+u-1)}}if(r===1/0||a===1/0)return null;let c=i-r+1,l=o-a+1,u=n[r][a];if(!u.cell)return null;let d=u.cell;d.setColSpan(l),d.setRowSpan(c);let f=new Set([d.getKey()]);for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=n[e][t];if(!r.cell)continue;let i=r.cell,a=i.getKey();f.has(a)||(f.add(a),JT(i)||(JT(d)&&d.clear(),d.append(...i.getChildren())),i.remove())}return d.getChildrenSize()===0&&d.append(Qm()),d}function JT(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!$m(t)||!t.isEmpty())}function Yhe(e){let[t,n,r]=QT(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;ZT(r);let[o,s]=YT(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&MT.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e{let n=f;for(let e=0;n!==0&&efg(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(Qm());if(i>1){for(let e=1;e1){let e;for(let t=1;t1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)qT(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function YT(e,t,n){let[r,i,a]=XT(e,t,n);return i===null&&RT(207),a===null&&RT(208),[r,i,a]}function XT(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e=s.length);t++){let n=o(e+t);for(let e=0;eMath.max(e,t.length),0),r=e.getChildren(),i=!1;for(let e=0;et?1+e:e,0);if(o>=n)continue;let s=a.getLastChild(),c=LT(s)?s.getHeaderStyles()&MT.ROW:MT.NO_STATUS;for(let e=o;e=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function eE(e){let[t,,n]=QT(e),r=n.getChildren().filter(VT),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;eLT(e));if(!(LT(o)&<(l)&&VT(s)&&qE(c)))return!1;ZT(c);let[u,d,f]=YT(c,o,l),[p]=XT(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=$T(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(Yhe(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=XT(c.getWritable(),null,null),T=v-m+g;for(let e=0;e{Fm(e)&&Qm().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=XT(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function nE(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=g_(n,LT);LT(r)||RT(238,t,n.getKey(),n.getType());let i=r.getParent();VT(i)||RT(239,t);let a=i.getParent();return qE(a)||RT(240,t),[n,r,i,a]});return i.is(c)||RT(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var rE=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=wh(this.tableKey),t=wh(this.anchor.key),n=wh(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return iE(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,qv(this.anchor.key,this.anchor.offset,this.anchor.type),qv(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(` `)?e.slice(0,-1):e).split(` -`).map(e=>e.split(` `)),n=FE();for(let e of t){let t=UT();for(let n of e){let e=zT(FT.NO_STATUS),r=Yg();n&&r.append(Gm(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=iE(this);rE(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(BT).forEach(e=>{let n=e.getFirstChild();Xg(n)&&(t|=n.getTextFormat())});let n=Zu[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();$(t)||VT(151),mf(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=iE(this),n=nE(e);n===null&&VT(153);let r=nE(t);r===null&&VT(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=iE(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??VT(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??VT(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=QT(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=tE(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();WT(r)||VT(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||Pme(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return Jh()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>BT(e)),t=``;for(let n=0;n0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&$(r)&&n.push(r.getChildren())}}function cE(e,t=Pv()){let n=S_(e);IE(n)||VT(231,e);let r=mE(n,t.getElementByKey(e));return r===null&&VT(232,e),{tableElement:r,tableNode:n}}var Fme=class{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=S_(t);IE(r)?e.push([r,n]):this.removeObserver(t)}return e}},Ime=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return cE(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;ne.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=yE(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();bE(t,yE(n,r),null),e&&Q()!==null&&(j_(null),t.dispatchCommand(op))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();Gy(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Wy(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&VT(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),bE(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=hv(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=kE(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=sE(r,t,e),j_(this.tableSelection),n.dispatchCommand(op),bE(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?S_(this.anchorCellNodeKey):null;return BT(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&VT(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?S_(this.focusCellNodeKey):null;return BT(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&VT(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=kE(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=sE(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=Q();oE(t)||VT(236);let n=Ch(),r=n.anchor,i=n.focus,a=t.getNodes().filter(BT);a.length>0||VT(237);let o=a[0].getFirstChild(),s=Xg(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),j_(t),this.editor.dispatchCommand(op)}$clearText(){let{editor:e}=this,t=S_(this.tableNodeKey);if(!IE(t))throw Error(`Expected TableNode.`);let n=Q();oE(n)||VT(253);let r=n.getNodes().filter(BT),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&WT(i)&&WT(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),bg(n)&&n.isEmpty()&&e.dispatchCommand(up)}else r.forEach(e=>{if($(e)){let t=e.getFirstChild(),n=Xg(t)?lv(t):Yg(),r=Gm();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),bE(e,this.table,null),j_(null),e.dispatchCommand(op)}},lE=`__lexicalTableSelection`;function uE(e){let t=fv(e);return IE(t)||VT(386,e),t}var dE=40;function fE(e,t,n){let r=e=>Math.max(1,Math.ceil(Math.min(dE,e)/dE*18));return e<=t+dE?-r(t+dE-e):e>=n-dE?r(e-(n-dE)):0}function pE(e){return Ov(e)&&e.nodeName===`TABLE`}function mE(e,t){if(!t)return t;let n=pE(t)?t:t.querySelector(`table`);return pE(n)||VT(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function hE(e){return e._window}function gE(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;BT(n)&&(r=n)}return null}var Lme=[[Tp,`down`],[wp,`up`],[Sp,`backward`],[bp,`forward`]],Rme=[mp,hp,cp],zme=[Dp,kp];function Bme(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;return r===null?void 0:Yp(r,`pointerdown`,r=>{let i=Ev(r);if(r.button!==0||!kv(i)||!n.contains(i))return;let a=u_(i)===e?function(e){let t=vE(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&lE in n&&n[lE])return{cellElement:t,tableElement:n,tableObserver:n[lE]};n=n.parentNode}return null}(i):null;e.update(()=>{if(oE(Q())){for(let[e]of t.observers.values())e.$clearHighlight(!1);j_(null),e.dispatchCommand(op)}if(!a)return;let{tableObserver:n,tableElement:i,cellElement:o}=a;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;i.pointerType=t.pointerType;let s=uE(i.tableNodeKey),c=Eh(),l=Z(c)||oE(c)?TE(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(Lu&&t.shiftKey&&(Z(c)||oE(c))&&(CE(c,s)||u)){let e=c.anchor.getNode(),r=gE(s,c.anchor.getNode());if(r){let e=OE(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),DE(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),DE(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f=t.clientX,p=t.clientY,m=null,h=null,g=e=>e.pointerId===c,_=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,m!==null&&(o.cancelAnimationFrame(m),m=null),h!==null&&(h(),h=null)},v=(e,t)=>{let n=r.getRootNode();if(!h_(n)&&!gv(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=Ume(r,i);if(e)return e}return null},y=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(op))}},b=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},x=(e,t,n)=>{let r,i;if(e===null)r=0,i=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();r=n===`x`?t.left:t.top,i=n===`x`?t.right:t.bottom}let a=fE(t,r,i);if(a===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?a:0,n===`x`?0:a),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=a,e.scrollLeft!==t}let s=e.scrollTop;return e.scrollTop+=a,e.scrollTop!==s},S=()=>{if(m=null,!i.isSelecting)return;let e=b(`x`),t=b(`y`),n=e!==null&&x(e,f,`x`),r=x(t,p,`y`);if(n||r){let[n,r]=((e,t)=>{let n=f,r=p;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(e,t),i=v(n,r);i&&y(i,!1),m=o.requestAnimationFrame(S)}},C=()=>{m!==null||s&&!i.isPointerDrag||!(()=>{let e=b(`x`);if(e!==null){let t=e.getBoundingClientRect();if(fE(f,t.left,t.right)!==0)return!0}let t=b(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return fE(p,n,r)!==0})()||(m=o.requestAnimationFrame(S))},w=e=>{g(e)&&_()};h=Xue(o,{lostpointercapture:w,pointercancel:w,pointermove:e=>{if(!g(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return void _();let t=Ev(e);if(!kv(t))return;var n,a;f=e.clientX,p=e.clientY,!i.isPointerDrag&&(n=f,a=p,!(Math.abs(n-l)<=10&&Math.abs(a-u)<=10))&&(i.isPointerDrag=!0);let o=null,s=!(Lu||r.contains(t));o=s?Ume(r,t):v(e.clientX,e.clientY),o&&y(o,s),C()},pointerup:e=>{g(e)&&_()}},i.listenerOptions)})(n)})(e,r,o,i,n,t)})})})}function Vme(e,t,n,r,i){let a=n.getRootElement(),o=hE(n);a!==null&&o!==null||VT(246);let s=new Ime(n,e.getKey()),c=mE(e,t);(function(e,t){_E(e)!==null&&VT(205),e[lE]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){_E(e)===t&&delete e[lE]}(c,s)),s.listenersToRemove.add(Yp(c,`mousedown`,e=>{let t=Ev(e);e.detail>=3&&kv(t)&&vE(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of Lme)s.listenersToRemove.add(n.registerCommand(t,t=>Xme(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(Op,t=>{let n=Q();if(oE(n)){let r=gE(e,n.focus.getNode());if(r!==null)return DE(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=Q();return!!CE(t,e)&&!!oE(t)&&(s.$clearText(),!0)};for(let e of Rme)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=Q();if(!oE(n)&&!Z(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!CE(n,e)&&!!oE(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of zme)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(zp,e=>{let t=Q();if(t){if(!oE(t)&&!Z(t))return!1;kC(n,cb(e,ClipboardEvent)?e:null,jC(t));let r=u(e);return Z(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(Yp(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=Q();return a.contains(d.activeElement)&&oE(t)&&CE(t,e)})&&(t.preventDefault(),n.dispatchCommand(fp,t))})),s.listenersToRemove.add(Yp(d,`copy`,t=>{if(t.defaultPrevented)return;let r=Ev(t);r===a||kv(r)&&a.contains(r)||n.read(`latest`,()=>{let t=Q();return a.contains(wv(a))&&oE(t)&&CE(t,e)})&&(t.preventDefault(),n.dispatchCommand(Rp,t))})),s.listenersToRemove.add(n.registerCommand(gp,t=>{let n=Q();return!!CE(n,e)&&!!oE(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(Fp,t=>{let n=Q();if(!oE(n)||!CE(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!BT(r)||!BT(i))return!1;let[a,o,s]=QT(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=tE(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e{let r=Q();if(!CE(r,e))return!1;if(oE(r))return s.$clearHighlight(),!1;if(Z(r)){if(!BT(Qv(r.anchor.getNode(),e=>BT(e))))return!1;if(typeof t==`string`){let i=Qme(n,r,e);if(i)return Zme(i,e,[Gm(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(Ap,t=>{let n=Q();if(!Z(n)||!n.isCollapsed()||!CE(n,e))return!1;let r=TE(n.anchor.getNode());return!(r===null||!e.is(EE(r))||(DE(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if($(i))return i.selectEnd();let a=Qv(e,WT);a===null&&VT(247);for(let e=a[n]();WT(e);e=e[n]()){let t=e[r]();if($(t))return t.selectEnd()}let o=Qv(a,IE);o===null&&VT(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(Up,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(up,()=>{let t=Q();if(!Z(t)||!t.isCollapsed()||!CE(t,e))return!1;let r=Qme(n,t,e);return!!r&&(Zme(r,e),!0)},3)),s}function Hme(e,t,n){let r=Q(),i=t.isSelected();if(!(oE(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=yE(t,a),oE(r)&&r.tableKey===t.getKey()){let e=S_(r.anchor.key),t=S_(r.focus.key);if(BT(e)&&BT(t)){let r=OE(n,e),i=OE(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),xE(t.table,t=>{let n=t.elem;t.highlighted=!1,Yme(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),xE(t.table,t=>{t.highlighted=!0,Jme(e,t)})}(e,n)}function _E(e){return e[lE]||null}function vE(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function Ume(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function yE(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=mE(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function bE(e,t,n){let r=new Set(n?n.getNodes():[]);xE(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,Jme(e,t)):(t.highlighted=!1,Yme(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function xE(e,t){let{domRows:n}=e;for(let e=0;e{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():wE(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):wE(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():wE(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():wE(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function Gme(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function Kme(e,t,n){let r=Gme(e,t);if(r)return r;let i=Gme(e,n);return i?SE(i):[`minColumn`,`minRow`]}function SE([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function qme(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&VT(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&VT(250,n,String(o)),s}function CE(e,t){if(Z(e)||oE(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function wE(e,t){t?e.selectStart():e.selectEnd()}function Jme(e,t){let n=t.elem,r=e._config.theme;BT(E_(n))||VT(131),Wy(n,r.tableCellSelected)}function Yme(e,t){let n=t.elem;BT(E_(n))||VT(131);let r=e._config.theme;Gy(n,r.tableCellSelected)}function TE(e){let t=Qv(e,BT);return BT(t)?t:null}function EE(e){let t=Qv(e,IE);return IE(t)?t:null}function Xme(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=Q();if(!CE(o,r)){if(Z(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if($(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!IE(n)&&(DE(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=Qv(e,e=>IE(e));if(BT(i)&&(i=Qv(i,IE)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&$(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&$(a)&&(c=a.getLastChild()||a,s=X(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,X(c)?`text`:`element`),j_(l),DE(t),!0}if(cv(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&gE(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=eE(e),[a]=eE(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=Qv(e,e=>$(e)&&!e.isInline());if(BT(r)&&(r=Qv(r,IE)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(IE(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=eE(e),[s]=eE(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),DE(t),j_(c),!0}}}}return n===`down`&&NE(e)&&function(e,t){if(!Z(e))return!1;let n=Mg(e.focus,`next`),r=ky(t,`next`);return Vy(n.origin,r.origin)!==null&&Ly(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Z(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=Mg(n.focus,i?`previous`:`next`);if(Vg(s))return!1;let c=s;for(let e of Ny(s).iterNodeCarets(`shadowRoot`)){if(!Cy(e)||!$(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!BT(l))return!1;let u=l,d=function(e){for(let t of Ny(e).iterNodeCarets(`root`)){let{origin:n}=t;if(BT(n)){if(wy(t))return ky(n,e.direction)}else if(!WT(n))break}return null}(Ty(u,c.direction)),f=Qv(u,IE);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=vE(p);if(!p||!m)return!1;if(o.table=she(e,f),d){if(r===`extend`){let t=vE(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=Bg(d);Ng(n.anchor,e),Ng(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=jy(e);return wy(t)?Bg(t):e}(Ty(f,s.direction));Ng(n.anchor,e),Ng(n.focus,e)}return DE(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=Qv(s.getNode(),BT),u=Qv(c.getNode(),BT);if(!BT(l)||!l.is(u))return!1;let d=EE(l);if(d!==r&&d!=null){let r=mE(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=yE(d,r),Xme(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=hv(hE(e));if(t===null||t.rangeCount===0)return!1;let n=Sv(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){DE(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return Wme(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(oE(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=Qv(a.getNode(),BT),u=Qv(s.getNode(),BT),[d]=o.getNodes();IE(d)||VT(251);let f=mE(d,e.getElementByKey(d.getKey()));if(!BT(l)||!BT(u)||!IE(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=yE(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),DE(t),t.shiftKey){let[e,t,a]=QT(r,l,u);return function(e,t,n,r,i){let a=tE(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=SE(Kme(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=tE(e,t,n),i=Kme(r,t,n);return[qme(e,r,i),qme(e,r,SE(i))]}(t,n,h),v=OE(e,g.cell),y=OE(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function DE(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Zme(e,t,n){let r=Yg();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Qme(e,t,n){let r=n.getParent();if(!r)return;let i=hv(hE(e));if(!i)return;let a=Cv(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=mE(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=Qv(t.anchor.getNode(),e=>BT(e));if(!c)return;let l=Qv(c,e=>IE(e));if(!IE(l)||!l.is(n))return;let[u,d]=QT(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function OE(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function kE(e,t,n){return gE(e,E_(t,n))}function AE(e){return Ov(e)&&e.nodeName===`DIV`}var $me=Yd()({colWidths:Qd(Jd(hce(Wd())),{getter:{field:`__colWidths`}}),frozenColumnCount:Qd(Wd(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:Qd(Wd(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:Qd(Gd(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function ehe(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=bv().createElement(`colgroup`),Vv(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e{};let i=()=>{n.scrollLeft!==t.scrollLeft&&(n.scrollLeft=t.scrollLeft)},a=()=>{t.scrollLeft!==n.scrollLeft&&(t.scrollLeft=n.scrollLeft)};t.addEventListener(`scroll`,i,{passive:!0}),n.addEventListener(`scroll`,a,{passive:!0});let o=null;return typeof ResizeObserver<`u`&&(o=new ResizeObserver(()=>{jE(t,n)}),o.observe(t),o.observe(r)),jE(t,n),()=>{t.removeEventListener(`scroll`,i),n.removeEventListener(`scroll`,a),o&&o.disconnect()}}function jE(e,t){if(nhe.has(t))return;let n=t.firstElementChild;if(!n||!Ov(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function ihe(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!AE(t))return null;let n=t.querySelector(`:scope > table`);if(!pE(n))return null;let r=t.nextElementSibling;return AE(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var ME=new WeakSet;function NE(e=Pv()){return ME.has(e)}function ahe(e=Pv()){let t=Db(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function ohe(e,t){t?ME.add(e):ME.delete(e)}var PE=class extends hg{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:hg,generated:vme,importDOM:{table:()=>({conversion:che,priority:1})},json:$me})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=pE(e)?e:e.querySelector(`table`);return pE(t)||VT(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=bv().createElement(`table`);if(this.__style&&Nm(n.style,this.__style),this.getColWidths()){let e=bv().createElement(`colgroup`);n.appendChild(e),Vv(e)}if(Wy(n,e.theme.table),this.updateTableElement(null,n,e),NE(t)){let r=ahe(t),i=function(e,t,n){let r=bv().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?Wy(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=bv(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?Wy(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=bv().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),Vv(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(Wy(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(Gy(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(Wy(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(Gy(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&Nm(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(Wy(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(Gy(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||ehe(t,this.getColumnCount(),this.getColWidths()),the(t,n,this.getFormatType())}updateDOM(e,t,n){let r=mE(this,t);if(t===r===NE())return!0;if(AE(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==ahe())return!0;let i=r.parentElement;AE(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&ehe(mE(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!pE(n)&&Ov(n)?n.querySelector(`table`):n;if(Ov(n)&&pE(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!pE(n)&&Ov(n)&&(n=n.querySelector(`table`)),!pE(n))return null;the(n,e._config,this.getFormatType());let[r]=$T(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=bv().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t{BT(e)&&(t+=e.getColSpan())}),t}};function she(e,t){let n=e.getElementByKey(t.getKey());return n===null&&VT(230),yE(t,n)}function che(e){let t=FE();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!MT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return zv(t,e),{after:e=>pb(e,WT),node:t}}function FE(){return uv(new PE)}function IE(e){return e instanceof PE}function lhe(e){WT(e.getParent())?e.isEmpty()&&e.append(Yg()):e.remove()}function uhe(e){IE(e.getParent())?db(e,BT):e.remove()}function dhe(e){db(e,WT);let[t]=$T(e,null,null),n=t.reduce((e,t)=>Math.max(e,t.length),0),r=e.getChildren();for(let e=0;et?1+e:e,0);if(a===n)continue;let o=i.getLastChild(),s=BT(o)?o.getHeaderStyles()&FT.ROW:FT.NO_STATUS;for(let e=a;e0){let e=i[i.length-1];t=[...i,...Array(a-i.length).fill(e)]}e.setColWidths(t)}}function fhe(e){if(e.detail<3||!kv(e.target))return!1;let t=E_(e.target);if(t===null)return!1;let n=Qv(t,e=>$(e)&&!e.isInline());return n!==null&&!!BT(n.getParent())&&(n.select(0),!0)}function phe(){let e=Q();if(!Z(e))return!1;let t=EE(e.anchor.getNode());if(t===null)return!1;let n=k_();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=$T(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(j_(sE(t,i.cell,o.cell)),!0)}function mhe(e){return e.registerNodeTransform(IT,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=eE(e),[n]=QT(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();WT(a)||VT(175);let o=[];for(let e=0;e1||s.getRowSpan()>1){BT(s)||VT(176);let e=zT(s.__headerState);t===null?sde(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function hhe(e,t=!0){let n=new Fme,r=!1,i=(r,i,a)=>{let o=mE(r,a),s=Vme(r,o,e,t,n);n.observers.set(i,[s,o])};return Ky(Bme(e,n),e.registerCommand(op,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=Q(),r=Eh(),i=e.getAndClearNextFocus();if(i!==null&&IE(S_(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||VT(335,t);let[o]=a;if(oE(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Z(r)&&Z(n)&&n.isCollapsed()){let e=S_(a);if(IE(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=TE(t);if(i!==null&&WT(r)){let t=r.getFirstChild();if(BT(t)&&e.is(Qv(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return oE(n)&&function(e,t){let n=hE(e),r=Eh();if(!t.is(r))return;let i=uE(t.tableKey),a=hv(n),o=a&&Cv(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=E_(o.focusNode),r=n&&!i.isParentOf(n),s=E_(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=Sle(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),j_(n))}}}(t,n),Z(n)&&function(e,t){let n=Eh(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=TE(a),c=TE(o),l=s?EE(s):null,u=c?EE(c):null,d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=QT(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),j_(t)}else if(m){let t=e.clone(),[n]=QT(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),j_(t)}else if(f){if(!s.is(c))return void j_(sE(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Z(n)&&n.isCollapsed()){let e=S_(n.anchor.key),t=e&&TE(e),{pointerStartCell:r}=i,a=r&&E_(r.elem);a!==null&&!a.is(c)&&t&&l.is(EE(t))&&!t.is(c)&&(j_(sE(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())Hme(t,n,r)})(n,e)}))}),e.registerMutationListener(PE,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=cE(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function ghe(e,t){e.hasNodes([PE])||VT(255);let{hasNestedTables:n=Bb(!1)}=t??{};return Ky(e.registerCommand(wme,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=Q()||Eh();if(!i||!Z(i)||!r&&EE(i.anchor.getNode()))return!1;let a=GT(Number(e),Number(t),n);sb(a);let o=a.getFirstDescendant();return X(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(Ace,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>IE(e)||nde(e).some(e=>IE(e.node)))){if(oE(r)){let e=``,t=!1;for(let r of n){let n=$(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=` -`),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=oE(r),a=Z(r);return!!(a&&Qv(r.anchor.getNode(),e=>BT(e))!==null&&Qv(r.focus.getNode(),e=>BT(e))!==null||i)&&(n.length===1&&IE(n[0])?rE(n[0],r):!(a&&t.peek()&&!function(e){return!(!oE(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Z(e)||!BT(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(Bp,phe,1),e.registerCommand(sp,fhe,0),e.registerNodeTransform(PE,dhe),e.registerNodeTransform(HT,uhe),e.registerNodeTransform(IT,lhe))}var _he={build:(e,t,n)=>mfe(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[Xx,[Yx,{rules:[{$import:(e,t)=>{let n=FE();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!MT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,pb(e.$importChildren(t),WT))]},match:Zx.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[UT(MT.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,pb(e.$importChildren(t),BT))],match:Zx.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=MT.test(t.style.width)?parseFloat(t.style.width):void 0,i=FT.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=FT.COLUMN;else if(e===`row`)i=FT.ROW;else{let e=t.parentElement,n=oue(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=FT.ROW),r&&(i|=FT.COLUMN),i===FT.NO_STATUS&&(i=FT.ROW)}}let a=zT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(kx),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(Ax),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(sx(kx,l)),f!==u&&p.push(sx(Ax,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();Og(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)av(i)||X(i)||Og(i)?n===null?(n=Yg().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(Yg()),t}(e.$importChildren(t,{context:p})),h=n?m:Fx(m,t);return[a.splice(0,0,h)]},match:Zx.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[PE,HT,IT],register(e,t,n){let r=n.getOutput(),i=!1;return Ky(Jb(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=NE(e);a!==t&&ohe(e,t),a===t&&i===n||e.update($h),i=n}),ghe(e,r),Jb(()=>hhe(e,r.hasTabHandler.value)),Jb(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return Ky(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(PE,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&Ov(a)?ihe(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?jE(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:rhe(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),Jb(()=>r.hasCellMerge.value?void 0:mhe(e)),Jb(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(IT,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},LE=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),RE=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},zE=e=>e.replace(/^\/+|\/+$/g,``),vhe,yhe=e=>(vhe??=new DOMParser,vhe.parseFromString(e,`text/html`).body.textContent),BE=e=>!/\s/.test(e)&&URL.canParse(e),VE=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,HE=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],UE=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},WE=e=>{try{return JSON.parse(e)}catch{return null}},GE=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?WE(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(WE)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,WE(t)])}},bhe=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],xhe=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],She=`sveltia-ui`,Che=`shiki`,KE,whe,The=!0,Ehe=(e,t)=>`4.5.0/${e}/${t}`,Dhe=()=>(KE===void 0&&(KE=typeof indexedDB>`u`?null:new UE(She,Che)),KE),Ohe=async e=>(whe??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.5.0/`));t.length&&await e.deleteEntries(t)})(),whe),khe=async(e,t)=>{let n=The?Dhe():null;if(n)try{return await Ohe(n),await n.get(Ehe(e,t))}catch{return}},Ahe=async(e,t,n)=>{let r=The?Dhe():null;if(r)try{await r.set(Ehe(e,t),n)}catch{}},jhe=`https://unpkg.com/@shikijs`,Mhe=`https://unpkg.com/@sveltia/ui`,Nhe=()=>`${Mhe}@0.87.4/dist/shiki-engine.js`,Phe=e=>`${jhe}/langs@4.5.0/dist/${e}.mjs`,Fhe=e=>`${jhe}/themes@4.5.0/dist/${e}.mjs`,Ihe={loadEngine:async()=>import(Nhe()),loadLanguage:async e=>import(Phe(e)),loadTheme:async e=>import(Fhe(e))},Lhe=()=>Ihe,qE=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},Rhe=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},zhe=e=>Rhe(()=>{let t=qE();e.update(()=>{k_().getChildren().forEach(e=>{hS(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:HE(e,[`history-merge`])})}),Bhe=[``,`plain`,`plaintext`,`text`,`txt`],Vhe=/^diff-([\w-]+)/i,JE=null,YE=null,XE=!1,ZE=e=>Vhe.exec(e)?.[1]??null,QE=e=>Bhe.includes(e??``),Hhe=()=>!!YE,Uhe=()=>XE,$E=e=>{if(!YE)return!1;let t=ZE(e)??e;return JE.isSpecialLang(t)?!0:YE.getLoadedLanguages().includes(t)},Whe=(e,t)=>{e.update(()=>{let e=S_(t);if(!hS(e))return;let n=e.getLanguage();n&&$E(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:HE(e,[`history-merge`])})},eD=new Map,Ghe=(e,t,n,r)=>{let i=eD.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}eD.delete(e),n.forEach((e,t)=>Whe(e,t))})(),targets:n},eD.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},Khe=(e,t)=>{if(!(YE||XE))return Ghe(`engine`,async()=>{try{JE=await Lhe().loadEngine(),YE=JE.createHighlighterCoreSync({engine:JE.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{XE=!0}},e,t)},qhe=async(e,t,n)=>{let r=await khe(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await Ahe(e,t,a),a},Jhe=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return Ghe(`${e}/${t}`,async()=>{let n=await qhe(e,t,()=>Lhe()[i](t));n&&await YE[i](n)},n,r)},Yhe=e=>bhe.find(({id:t,aliases:n})=>t===e||n?.includes(e)),tD=e=>Yhe(e)?.id??e,Xhe=(e,t,n)=>{let r=ZE(e)??e;if(!YE||$E(r))return;let i=Yhe(r);if(i)return Jhe(`lang`,i.id,t,n)},nD=e=>YE?JE.isSpecialTheme(e)||YE.getLoadedThemes().includes(e):!1,Zhe=(e,t,n)=>{if(YE&&!nD(e)&&xhe.some(({id:t})=>t===e))return Jhe(`theme`,e,t,n)},Qhe=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(Dg()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(CS(e[r],t[r])),i=i.slice(1))}let a=JE.stringifyTokenStyle(e.htmlStyle||JE.getTokenStyleObject(e));Nh(i,{linebreak:()=>n.push(Dg()),tab:()=>n.push(Jm()),text:e=>{let t=CS(e);t.setStyle(a),n.push(t)}})})}),n},$he=(e,t)=>{let n=ZE(t),{tokens:r}=YE.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return Qhe(r,!!n)},ege=(e,t)=>{if(!YE||QE(e)||!$E(e))return;let n=t??qE();return nD(n)?n:void 0},tge=(e,t,{theme:n}={})=>{let r=tD(ZE(t)??t),i=ege(r,n);if(i!==void 0)return YE.codeToHtml(e,{lang:r,theme:i})},nge=(e,t,{theme:n}={})=>{let r=tD(t),i=ege(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=YE.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},rge={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},ige=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],age=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],oge=[`html`,`head`,`body`],sge=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],cge=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],rD=e=>{let t=rge[e.localName]??[],n=cge.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},iD=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return Ov(r.element)&&rD(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return Ov(i)&&(rD(i),i.querySelectorAll(`:scope > br`).forEach(rD)),r===e?void 0:r}}},lge=(e,t)=>{let n=t.getParent();return n instanceof IT&&n.getChildrenSize()===1&&!t.getFormatType()?{element:document.createDocumentFragment()}:t.isEmpty()&&t.getNextSiblings().every(e=>Xg(e)&&e.isEmpty())?{element:null}:iD(e,t)},aD=(e,t)=>{let n=document.createTextNode(t.getTextContent());return ige.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},uge=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!Ov(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!QE(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?Ov(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:` -`:e.textContent).join(``),e.replaceChildren(n)}}),dge=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,fge=new Map([[Vm,aD],[qm,aD],[xS,aD],[Jg,lge],[UC,iD],[BC,iD],[cC,iD],[nC,iD],[BS,iD],[Qb,iD],[pS,uge],[PE,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return Ov(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(dge)].forEach(rD)),r===e?void 0:r}}}]]),pge=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=` -`);return n},mge=e=>{let t=e.querySelector(`:scope > code`),n=mS((t?sge(t):void 0)??e.getAttribute(`data-language`)),r=pge(e).replace(/\n$/,``);return r&&n.append(Gm(r)),{node:n,after:()=>[]}},oD=new WeakMap,hge=new WeakMap,gge=e=>{let t=hge.get(e);return t||(t=e.importDOM?.()??{},hge.set(e,t)),t},_ge=new WeakMap,vge=(e,t)=>{let n=_ge.get(t);return n===void 0&&(n=oD.get(e)?.find(({node:e})=>!!gge(e)[t.localName]?.(t))??null,_ge.set(t,n)),n??void 0},yge=e=>{let t=vge(Pv(),e);return!!t&&!!t.node.prototype.isInline?.()},sD=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,Ov(n)){if(yge(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!jv(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,Ov(n)&&yge(n))return n;r=t?n.firstChild:n.lastChild}if(m_(n))return n;if(n.nodeName===`BR`)return null}},bge=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},xge=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=sD(e,!1),r=!0;for(;n;n=sD(n,!1)){if(!m_(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=sD(e,!0),r=!0;for(;n;n=sD(n,!0))if(!m_(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?Gm(t):null}},Sge={"#text":e=>bge(e)?null:{conversion:e=>xge(e),priority:1}},Cge={pre:()=>({conversion:mge,priority:2})},wge=e=>{let t=oD.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(gge(e))).filter(e=>!r.has(e)))},Tge=(e,t)=>{let n=wge(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return vge(e,o)?!1:!oge.includes(s)&&!age.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},Ege=e=>eS(e),cD=`[ \\t\\uE005]`;`${cD}${cD}${cD}${cD}${cD}`;var lD=new RegExp([String.raw`(?=<)(?\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|`,String.raw`||`,String.raw`<\?.*?\?>`,String.raw`]*>`,String.raw``].join(`|`),`)`].join(``)),Dge=[/([-*_])(?:[ \t]*\1){2,}[ \t]*$/,/(?:=+|-{2,})[ \t]*$/,/(?:#{1,6}|[-+*]|\d{1,9}[.)])(?=[ \t]|$)/,/>|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),Oge=RegExp(`^ {0,3}(?:${Dge})`),uD=ef(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),kge=e=>tf(e,uD)||void 0,Age=e=>{if(tf(e,uD))return e.getTextContent()},dD={dependencies:[],export:()=>null,importRegExp:Oge,regExp:/(?!)/,replace:e=>{nf(e,uD,e.getTextContent())},type:`text-match`},jge={dependencies:[],export:()=>null,importRegExp:RegExp(`(?<=^).+|${lD.source}`),regExp:/(?!)/,replace:dD.replace,type:`text-match`},fD=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},pD=(e,t)=>{let n=e.split(` +`).map(e=>e.split(` `)),n=KE();for(let e of t){let t=BT();for(let n of e){let e=IT(MT.NO_STATUS),r=Qm();n&&r.append(Pm(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=nE(this);tE(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(LT).forEach(e=>{let n=e.getFirstChild();$m(n)&&(t|=n.getTextFormat())});let n=$u[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();Z(t)||RT(151),fm(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=nE(this),n=eE(e);n===null&&RT(153);let r=eE(t);r===null&&RT(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=nE(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??RT(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??RT(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=YT(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=$T(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();VT(r)||RT(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||Xhe(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return K_()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>LT(e)),t=``;for(let n=0;n0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&Z(r)&&n.push(r.getChildren())}}function oE(e,t=Lg()){let n=wh(e);qE(n)||RT(231,e);let r=fE(n,t.getElementByKey(e));return r===null&&RT(232,e),{tableElement:r,tableNode:n}}var Zhe=class{observers;nextFocus;shouldCheckSelectionForTable;touchTapCellKey;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null,this.touchTapCellKey=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=wh(t);qE(r)?e.push([r,n]):this.removeObserver(t)}return e}},Qhe=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return oE(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;ne.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=vE(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();yE(t,vE(n,r),null),e&&$()!==null&&(Nh(null),t.dispatchCommand(id))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();Nb(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Mb(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&RT(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),yE(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=vg(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=IE(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=aE(r,t,e),Nh(this.tableSelection),n.dispatchCommand(id),yE(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?wh(this.anchorCellNodeKey):null;return LT(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&RT(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?wh(this.focusCellNodeKey):null;return LT(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&RT(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=IE(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=aE(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=$();iE(t)||RT(236);let n=Sy(),r=n.anchor,i=n.focus,a=t.getNodes().filter(LT);a.length>0||RT(237);let o=a[0].getFirstChild(),s=$m(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),Nh(t),this.editor.dispatchCommand(id)}$clearText(){let{editor:e}=this,t=wh(this.tableNodeKey);if(!qE(t))throw Error(`Expected TableNode.`);let n=$();iE(n)||RT(253);let r=n.getNodes().filter(LT),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&VT(i)&&VT(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),Tm(n)&&n.isEmpty()&&e.dispatchCommand(pd)}else r.forEach(e=>{if(Z(e)){let t=e.getFirstChild(),n=$m(t)?fg(t):Qm(),r=Pm();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),yE(e,this.table,null),Nh(null),e.dispatchCommand(id)}},sE=`__lexicalTableSelection`;function cE(e){let t=hg(e);return qE(t)||RT(386,e),t}var lE=40;function uE(e,t,n,r=1e3/60){let i=e=>Math.max(1,Math.round(Math.max(1,Math.ceil(Math.min(lE,e)/lE*18))*r*60/1e3));return e<=t+lE?-i(t+lE-e):e>=n-lE?i(e-(n-lE)):0}function dE(e){return jg(e)&&e.nodeName===`TABLE`}function fE(e,t){if(!t)return t;let n=dE(t)?t:t.querySelector(`table`);return dE(n)||RT(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function pE(e){return e._window}function mE(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;LT(n)&&(r=n)}return null}var $he=[[Od,`down`],[Dd,`up`],[Td,`backward`],[Cd,`forward`]],ege=[_d,vd,dd],tge=[jd,Nd];function nge(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;if(r===null)return;let i=()=>{t.touchTapCellKey=null};return pv(mv(r,`pointerdown`,r=>{t.touchTapCellKey=null;let i=kg(r);if(r.button!==0||!Mg(i)||!n.contains(i))return;let a=function(e){let t=gE(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&sE in n&&n[sE])return{cellElement:t,tableElement:n,tableObserver:n[sE]};n=n.parentNode}return null}(i),o=a!==null&&a.tableObserver.editor===e?a:null;e.update(()=>{if(iE($())){for(let[e]of t.observers.values())e.$clearHighlight(!1);Nh(null),e.dispatchCommand(id)}if(!o)return;let{tableObserver:n,tableElement:i,cellElement:a}=o;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;if(i.pointerType=t.pointerType,t.pointerType===`touch`&&!t.shiftKey&&!i.isSelecting){let e=Oh(n.elem);a.touchTapCellKey=e?e.getKey():null}let s=cE(i.tableNodeKey),c=Dy(),l=Q(c)||iE(c)?kE(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(Hu&&t.shiftKey&&(Q(c)||iE(c))&&(TE(c,s)||u)){let e=c.anchor.getNode(),r=mE(s,c.anchor.getNode());if(r){let e=FE(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),ME(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),ME(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f,p=t.clientX,m=t.clientY,h=null,g=null,_=e=>e.pointerId===c,v=(e,t)=>!(Math.abs(e-l)<=10&&Math.abs(t-u)<=10),y=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,h!==null&&(o.cancelAnimationFrame(h),h=null),g!==null&&(g(),g=null)},b=(e,t)=>{let n=r.getRootNode();if(!gh(n)&&!yg(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=_E(r,i);if(e)return e}return null},x=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(id))}},S=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},C=(e,t,n,r)=>{let i,a;if(e===null)i=0,a=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();i=n===`x`?t.left:t.top,a=n===`x`?t.right:t.bottom}let s=uE(t,i,a,r);if(s===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?s:0,n===`x`?0:s),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=s,e.scrollLeft!==t}let c=e.scrollTop;return e.scrollTop+=s,e.scrollTop!==c},w=e=>{if(h=null,!i.isSelecting)return;let t=e>f?Math.min(e-f,100):1e3/60;f=e;let n=S(`x`),r=S(`y`),a=n!==null&&C(n,p,`x`,t),s=C(r,m,`y`,t);if(a||s){let[e,t]=((e,t)=>{let n=p,r=m;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(n,r),i=b(e,t);i&&x(i,!1),h=o.requestAnimationFrame(w)}},T=()=>{h!==null||s&&!i.isPointerDrag||!(()=>{let e=S(`x`);if(e!==null){let t=e.getBoundingClientRect();if(uE(p,t.left,t.right)!==0)return!0}let t=S(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return uE(m,n,r)!==0})()||(f=1/0,h=o.requestAnimationFrame(w))},ee=e=>{_(e)&&(a.touchTapCellKey=null,y())};g=hv(o,{lostpointercapture:ee,pointercancel:ee,pointermove:e=>{if(!_(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return a.touchTapCellKey=null,void y();let t=kg(e);if(!Mg(t))return;p=e.clientX,m=e.clientY,!i.isPointerDrag&&v(p,m)&&(i.isPointerDrag=!0,a.touchTapCellKey=null);let n=null,o=!(Hu||r.contains(t));n=o?_E(r,t):b(e.clientX,e.clientY),n&&x(n,o),T()},pointerup:e=>{_(e)&&(v(e.clientX,e.clientY)&&(a.touchTapCellKey=null),y())}},i.listenerOptions)})(n)})(e,r,a,i,n,t)})}),hv(r,{blur:i,keydown:i},{capture:!0}),i)})}function rge(e,t,n,r,i){let a=n.getRootElement(),o=pE(n);a!==null&&o!==null||RT(246);let s=new Qhe(n,e.getKey()),c=fE(e,t);(function(e,t){hE(e)!==null&&RT(205),e[sE]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){hE(e)===t&&delete e[sE]}(c,s)),s.listenersToRemove.add(mv(c,`mousedown`,e=>{let t=kg(e);e.detail>=3&&Mg(t)&&gE(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of $he)s.listenersToRemove.add(n.registerCommand(t,t=>jE(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(Md,t=>{let n=$();if(iE(n)){let r=mE(e,n.focus.getNode());if(r!==null)return ME(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=$();return!!TE(t,e)&&!!iE(t)&&(s.$clearText(),!0)};for(let e of ege)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=$();if(!iE(n)&&!Q(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!TE(n,e)&&!!iE(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of tge)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(Ud,e=>{let t=$();if(t){if(!iE(t)&&!Q(t))return!1;PC(n,Rb(e,ClipboardEvent)?e:null,IC(t));let r=u(e);return Q(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(mv(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=$();return a.contains(d.activeElement)&&iE(t)&&TE(t,e)})&&(t.preventDefault(),n.dispatchCommand(hd,t))})),s.listenersToRemove.add(mv(d,`copy`,t=>{if(t.defaultPrevented)return;let r=kg(t);r===a||Mg(r)&&a.contains(r)||n.read(`latest`,()=>{let t=$();return a.contains(Dg(a))&&iE(t)&&TE(t,e)})&&(t.preventDefault(),n.dispatchCommand(Hd,t))})),s.listenersToRemove.add(n.registerCommand(yd,t=>{let n=$();return!!TE(n,e)&&!!iE(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(zd,t=>{let n=$();if(!iE(n)||!TE(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!LT(r)||!LT(i))return!1;let[a,o,s]=YT(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=$T(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e{let r=$();if(!TE(r,e))return!1;if(iE(r))return s.$clearHighlight(),!1;if(Q(r)){if(!LT(g_(r.anchor.getNode(),e=>LT(e))))return!1;if(typeof t==`string`){let i=PE(n,r,e);if(i)return NE(i,e,[Pm(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(Pd,t=>{let n=$();if(!Q(n)||!n.isCollapsed()||!TE(n,e))return!1;let r=kE(n.anchor.getNode());return!(r===null||!e.is(AE(r))||(ME(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if(Z(i))return i.selectEnd();let a=g_(e,VT);a===null&&RT(247);for(let e=a[n]();VT(e);e=e[n]()){let t=e[r]();if(Z(t))return t.selectEnd()}let o=g_(a,qE);o===null&&RT(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(qd,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(pd,()=>{let t=$();if(!Q(t)||!t.isCollapsed()||!TE(t,e))return!1;let r=PE(n,t,e);return!!r&&(NE(r,e),!0)},3)),s}function ige(e,t,n){let r=$(),i=t.isSelected();if(!(iE(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=vE(t,a),iE(r)&&r.tableKey===t.getKey()){let e=wh(r.anchor.key),t=wh(r.focus.key);if(LT(e)&<(t)){let r=FE(n,e),i=FE(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),bE(t.table,t=>{let n=t.elem;t.highlighted=!1,OE(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),bE(t.table,t=>{t.highlighted=!0,DE(e,t)})}(e,n)}function hE(e){return e[sE]||null}function gE(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function _E(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function vE(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=fE(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function yE(e,t,n){let r=new Set(n?n.getNodes():[]);bE(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,DE(e,t)):(t.highlighted=!1,OE(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function bE(e,t){let{domRows:n}=e;for(let e=0;e{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():EE(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):EE(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():EE(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():EE(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function xE(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function SE(e,t,n){let r=xE(e,t);if(r)return r;let i=xE(e,n);return i?CE(i):[`minColumn`,`minRow`]}function CE([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function wE(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&RT(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&RT(250,n,String(o)),s}function TE(e,t){if(Q(e)||iE(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function EE(e,t){t?e.selectStart():e.selectEnd()}function DE(e,t){let n=t.elem,r=e._config.theme;LT(Oh(n))||RT(131),Mb(n,r.tableCellSelected)}function OE(e,t){let n=t.elem;LT(Oh(n))||RT(131);let r=e._config.theme;Nb(n,r.tableCellSelected)}function kE(e){let t=g_(e,LT);return LT(t)?t:null}function AE(e){let t=g_(e,qE);return qE(t)?t:null}function jE(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=$();if(!TE(o,r)){if(Q(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if(Z(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!qE(n)&&(ME(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=g_(e,e=>qE(e));if(LT(i)&&(i=g_(i,qE)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&Z(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&Z(a)&&(c=a.getLastChild()||a,s=Fm(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,Fm(c)?`text`:`element`),Nh(l),ME(t),!0}if(dg(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&mE(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=QT(e),[a]=QT(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=g_(e,e=>Z(e)&&!e.isInline());if(LT(r)&&(r=g_(r,qE)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(qE(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=QT(e),[s]=QT(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),ME(t),Nh(c),!0}}}}return n===`down`&&UE(e)&&function(e,t){if(!Q(e))return!1;let n=Lm(e.focus,`next`),r=bb(t,`next`);return kb(n.origin,r.origin)!==null&&Db(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Q(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=Lm(n.focus,i?`previous`:`next`);if(Gm(s))return!1;let c=s;for(let e of Cb(s).iterNodeCarets(`shadowRoot`)){if(!hb(e)||!Z(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!LT(l))return!1;let u=l,d=function(e){for(let t of Cb(e).iterNodeCarets(`root`)){let{origin:n}=t;if(LT(n)){if(gb(t))return bb(n,e.direction)}else if(!VT(n))break}return null}(_b(u,c.direction)),f=g_(u,qE);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=gE(p);if(!p||!m)return!1;if(o.table=uge(e,f),d){if(r===`extend`){let t=gE(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=Wm(d);Rm(n.anchor,e),Rm(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=xb(e);return gb(t)?Wm(t):e}(_b(f,s.direction));Rm(n.anchor,e),Rm(n.focus,e)}return ME(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=g_(s.getNode(),LT),u=g_(c.getNode(),LT);if(!LT(l)||!l.is(u))return!1;let d=AE(l);if(d!==r&&d!=null){let r=fE(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=vE(d,r),jE(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=vg(pE(e));if(t===null||t.rangeCount===0)return!1;let n=Tg(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){ME(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return age(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(iE(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=g_(a.getNode(),LT),u=g_(s.getNode(),LT),[d]=o.getNodes();qE(d)||RT(251);let f=fE(d,e.getElementByKey(d.getKey()));if(!LT(l)||!LT(u)||!qE(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=vE(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),ME(t),t.shiftKey){let[e,t,a]=YT(r,l,u);return function(e,t,n,r,i){let a=$T(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=CE(SE(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=$T(e,t,n),i=SE(r,t,n);return[wE(e,r,i),wE(e,r,CE(i))]}(t,n,h),v=FE(e,g.cell),y=FE(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function ME(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function NE(e,t,n){let r=Qm();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function PE(e,t,n){let r=n.getParent();if(!r)return;let i=vg(pE(e));if(!i)return;let a=Eg(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=fE(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=g_(t.anchor.getNode(),e=>LT(e));if(!c)return;let l=g_(c,e=>qE(e));if(!qE(l)||!l.is(n))return;let[u,d]=YT(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function FE(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function IE(e,t,n){return mE(e,Oh(t,n))}function LE(e){return jg(e)&&e.nodeName===`DIV`}var oge=Uf()({colWidths:Kf(Hf(zce(Rf())),{getter:{field:`__colWidths`}}),frozenColumnCount:Kf(Rf(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:Kf(Rf(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:Kf(zf(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function RE(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=Cg().createElement(`colgroup`),qg(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e{};let i=t.scrollLeft,a=n.scrollLeft,o=()=>{t.scrollLeft!==i&&(n.scrollLeft=i=t.scrollLeft,a=n.scrollLeft)},s=()=>{n.scrollLeft!==a&&(t.scrollLeft=a=n.scrollLeft,i=t.scrollLeft)};t.addEventListener(`scroll`,o,{passive:!0}),n.addEventListener(`scroll`,s,{passive:!0});let c=null;return typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{VE(t,n)}),c.observe(t),c.observe(r)),VE(t,n),()=>{t.removeEventListener(`scroll`,o),n.removeEventListener(`scroll`,s),c&&c.disconnect()}}function VE(e,t){if(BE.has(t))return;let n=t.firstElementChild;if(!n||!jg(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function cge(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!LE(t))return null;let n=t.querySelector(`:scope > table`);if(!dE(n))return null;let r=t.nextElementSibling;return LE(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var HE=new WeakSet;function UE(e=Lg()){return HE.has(e)}function WE(e=Lg()){let t=Gb(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function lge(e,t){t?HE.add(e):HE.delete(e)}var GE=class extends bm{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:bm,generated:Phe,importDOM:{table:()=>({conversion:dge,priority:1})},json:oge})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=dE(e)?e:e.querySelector(`table`);return dE(t)||RT(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=Cg().createElement(`table`);if(this.__style&&Dm(n.style,this.__style),this.getColWidths()){let e=Cg().createElement(`colgroup`);n.appendChild(e),qg(e)}if(Mb(n,e.theme.table),this.updateTableElement(null,n,e),UE(t)){let r=WE(t),i=function(e,t,n){let r=Cg().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?Mb(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=Cg(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?Mb(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=Cg().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),qg(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(Mb(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(Nb(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(Mb(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(Nb(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&Dm(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(Mb(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(Nb(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||RE(t,this.getColumnCount(),this.getColWidths()),zE(t,n,this.getFormatType())}updateDOM(e,t,n){let r=fE(this,t);if(t===r===UE())return!0;if(LE(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==WE())return!0;let i=r.parentElement;LE(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&RE(fE(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!dE(n)&&jg(n)?n.querySelector(`table`):n;if(jg(n)&&dE(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!dE(n)&&jg(n)&&(n=n.querySelector(`table`)),!dE(n))return null;zE(n,e._config,this.getFormatType());let[r]=XT(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=Cg().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t{LT(e)&&(t+=e.getColSpan())}),t}};function uge(e,t){let n=e.getElementByKey(t.getKey());return n===null&&RT(230),vE(t,n)}function dge(e){let t=KE();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!kT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return Gg(t,e),{after:e=>Bb(e,VT),node:t}}function KE(){return pg(new GE)}function qE(e){return e instanceof GE}function fge(e){VT(e.getParent())?e.isEmpty()&&e.append(Qm()):e.remove()}function pge(e){qE(e.getParent())?Rde(e,LT):e.remove()}function mge(e){Rde(e,VT),ZT(e);let t=e.getColWidths(),n=e.getColumnCount();if(t&&t.length!==n){let r;if(n0){let e=t[t.length-1];r=[...t,...Array(n-t.length).fill(e)]}e.setColWidths(r)}}function hge(e){if(e.detail<3||!Mg(e.target))return!1;let t=Oh(e.target);if(t===null)return!1;let n=g_(t,e=>Z(e)&&!e.isInline());return n!==null&&!!LT(n.getParent())&&(fm(n.select(0)),!0)}function gge(){let e=$();if(!Q(e))return!1;let t=AE(e.anchor.getNode());if(t===null)return!1;let n=jh();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=XT(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(Nh(aE(t,i.cell,o.cell)),!0)}function _ge(e){return e.registerNodeTransform(NT,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=QT(e),[n]=YT(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();VT(a)||RT(175);let o=[];for(let e=0;e1||s.getRowSpan()>1){LT(s)||RT(176);let e=IT(s.__headerState);t===null?Lde(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function vge(e,t=!0){let n=new Zhe,r=!1,i=(r,i,a)=>{let o=fE(r,a),s=rge(r,o,e,t,n);n.observers.set(i,[s,o])};return pv(nge(e,n),e.registerCommand(id,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=$(),r=Dy(),i=e.getAndClearNextFocus();if(i!==null&&qE(wh(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||RT(335,t);let[o]=a;if(iE(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Q(r)&&Q(n)&&n.isCollapsed()){let e=wh(a);if(qE(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=kE(t);if(i!==null&&VT(r)){let t=r.getFirstChild();if(LT(t)&&e.is(g_(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return iE(n)&&function(e,t){let n=pE(e),r=Dy();if(!t.is(r))return;let i=cE(t.tableKey),a=vg(n),o=a&&Eg(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=Oh(o.focusNode),r=n&&!i.isParentOf(n),s=Oh(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=wy(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),Nh(n))}}}(t,n),Q(n)&&function(e,t){let n=Dy(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=kE(a),c=kE(o),l=s?AE(s):null,u=c?AE(c):null;if(t.touchTapCellKey!==null&&!e.dirty&&!e.isCollapsed()&&Q(n)&&n.isCollapsed()&&(!s||!s.is(c))){let e=wh(n.anchor.key),a=e&&e.getParent();if(Z(e)&&e.isEmpty()&<(a)&&a.getKey()===t.touchTapCellKey&&a.getChildren().every(e=>Z(e)&&e.isEmpty())&&(r.is(n.anchor)||i.is(n.anchor)))return void Nh(n.clone())}let d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=YT(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),Nh(t)}else if(m){let t=e.clone(),[n]=YT(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),Nh(t)}else if(f){if(!s.is(c))return void Nh(aE(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Q(n)&&n.isCollapsed()){let e=wh(n.anchor.key),t=e&&kE(e),{pointerStartCell:r}=i,a=r&&Oh(r.elem);a!==null&&!a.is(c)&&t&&l.is(AE(t))&&!t.is(c)&&(Nh(aE(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())ige(t,n,r)})(n,e)}))}),e.registerMutationListener(GE,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=oE(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function yge(e,t){e.hasNodes([GE])||RT(255);let{hasNestedTables:n=rx(!1)}=t??{};return pv(e.registerCommand(Bhe,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=$()||Dy();if(!i||!Q(i)||!r&&AE(i.anchor.getNode()))return!1;let a=HT(Number(e),Number(t),n);Lb(a);let o=a.getFirstDescendant();return Fm(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(ad,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>qE(e)||Ade(e).some(e=>qE(e.node)))){if(iE(r)){let e=``,t=!1;for(let r of n){let n=Z(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=` +`),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=iE(r),a=Q(r);return!!(a&&g_(r.anchor.getNode(),e=>LT(e))!==null&&g_(r.focus.getNode(),e=>LT(e))!==null||i)&&(n.length===1&&qE(n[0])?tE(n[0],r):!(a&&t.peek()&&!function(e){return!(!iE(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Q(e)||!LT(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(Wd,gge,1),e.registerCommand(od,hge,0),e.registerNodeTransform(GE,mge),e.registerNodeTransform(zT,pge),e.registerNodeTransform(NT,fge))}var bge={build:(e,t,n)=>vpe(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[fpe,[tS,{rules:[{$import:(e,t)=>{let n=KE();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!kT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,Bb(e.$importChildren(t),VT))]},match:nS.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[BT(kT.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,Bb(e.$importChildren(t),LT))],match:nS.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=kT.test(t.style.width)?parseFloat(t.style.width):void 0,i=MT.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=MT.COLUMN;else if(e===`row`)i=MT.ROW;else{let e=t.parentElement,n=Kle(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=MT.ROW),r&&(i|=MT.COLUMN),i===MT.NO_STATUS&&(i=MT.ROW)}}let a=IT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(Rx),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(zx),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(bx(Rx,l)),f!==u&&p.push(bx(zx,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();E_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)cg(i)||Fm(i)||E_(i)?n===null?(n=Qm().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(Qm()),t}(e.$importChildren(t,{context:p})),h=n?m:Wx(m,t);return[a.splice(0,0,h)]},match:nS.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[GE,zT,NT],register(e,t,n){let r=n.getOutput(),i=!1;return pv(sx(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=UE(e);a!==t&&lge(e,t),a===t&&i===n||e.update(Z_),i=n}),yge(e,r),sx(()=>vge(e,r.hasTabHandler.value)),sx(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return pv(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(GE,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&jg(a)?cge(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?VE(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:sge(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),sx(()=>r.hasCellMerge.value?void 0:_ge(e)),sx(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(NT,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},JE=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),YE=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},XE=e=>e.replace(/^\/+|\/+$/g,``),ZE,xge=e=>(ZE??=new DOMParser,ZE.parseFromString(e,`text/html`).body.textContent),QE=e=>!/\s/.test(e)&&URL.canParse(e),$E=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,eD=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],tD=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},nD=e=>{try{return JSON.parse(e)}catch{return null}},rD=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?nD(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(nD)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,nD(t)])}},iD=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],Sge=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],Cge=`sveltia-ui`,wge=`shiki`,aD,oD,sD=!0,cD=(e,t)=>`4.6.0/${e}/${t}`,lD=()=>(aD===void 0&&(aD=typeof indexedDB>`u`?null:new tD(Cge,wge)),aD),Tge=async e=>(oD??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.6.0/`));t.length&&await e.deleteEntries(t)})(),oD),Ege=async(e,t)=>{let n=sD?lD():null;if(n)try{return await Tge(n),await n.get(cD(e,t))}catch{return}},Dge=async(e,t,n)=>{let r=sD?lD():null;if(r)try{await r.set(cD(e,t),n)}catch{}},uD=`https://unpkg.com/@shikijs`,Oge=`https://unpkg.com/@sveltia/ui`,kge=()=>`${Oge}@0.89.0/dist/shiki-engine.js`,Age=e=>`${uD}/langs@4.6.0/dist/${e}.mjs`,jge=e=>`${uD}/themes@4.6.0/dist/${e}.mjs`,Mge={loadEngine:async()=>import(kge()),loadLanguage:async e=>import(Age(e)),loadTheme:async e=>import(jge(e))},dD=()=>Mge,fD=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},pD=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},Nge=e=>pD(()=>{let t=fD();e.update(()=>{jh().getChildren().forEach(e=>{_S(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:eD(e,[`history-merge`])})}),Pge=[``,`plain`,`plaintext`,`text`,`txt`],Fge=/^diff-([\w-]+)/i,mD=null,hD=null,gD=!1,_D=e=>Fge.exec(e)?.[1]??null,vD=e=>Pge.includes(e??``),yD=()=>!!hD,Ige=()=>gD,bD=e=>{if(!hD)return!1;let t=_D(e)??e;return mD.isSpecialLang(t)?!0:hD.getLoadedLanguages().includes(t)},Lge=(e,t)=>{e.update(()=>{let e=wh(t);if(!_S(e))return;let n=e.getLanguage();n&&bD(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:eD(e,[`history-merge`])})},xD=new Map,SD=(e,t,n,r)=>{let i=xD.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}xD.delete(e),n.forEach((e,t)=>Lge(e,t))})(),targets:n},xD.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},CD=(e,t)=>{if(!(hD||gD))return SD(`engine`,async()=>{try{mD=await dD().loadEngine(),hD=mD.createHighlighterCoreSync({engine:mD.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{gD=!0}},e,t)},Rge=async(e,t,n)=>{let r=await Ege(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await Dge(e,t,a),a},wD=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return SD(`${e}/${t}`,async()=>{let n=await Rge(e,t,()=>dD()[i](t));n&&await hD[i](n)},n,r)},TD=e=>iD.find(({id:t,aliases:n})=>t===e||n?.includes(e)),ED=e=>TD(e)?.id??e,DD=(e,t,n)=>{let r=_D(e)??e;if(!hD||bD(r))return;let i=TD(r);if(i)return wD(`lang`,i.id,t,n)},OD=e=>hD?mD.isSpecialTheme(e)||hD.getLoadedThemes().includes(e):!1,kD=(e,t,n)=>{if(hD&&!OD(e)&&Sge.some(({id:t})=>t===e))return wD(`theme`,e,t,n)},zge=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(T_()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(TS(e[r],t[r])),i=i.slice(1))}let a=mD.stringifyTokenStyle(e.htmlStyle||mD.getTokenStyleObject(e));Fy(i,{linebreak:()=>n.push(T_()),tab:()=>n.push(th()),text:e=>{let t=TS(e);t.setStyle(a),n.push(t)}})})}),n},Bge=(e,t)=>{let n=_D(t),{tokens:r}=hD.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return zge(r,!!n)},AD=(e,t)=>{if(!hD||vD(e)||!bD(e))return;let n=t??fD();return OD(n)?n:void 0},Vge=(e,t,{theme:n}={})=>{let r=ED(_D(t)??t),i=AD(r,n);if(i!==void 0)return hD.codeToHtml(e,{lang:r,theme:i})},Hge=(e,t,{theme:n}={})=>{let r=ED(t),i=AD(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=hD.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},Uge={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},Wge=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],Gge=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],Kge=[`html`,`head`,`body`],jD=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],qge=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],MD=e=>{let t=Uge[e.localName]??[],n=qge.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},ND=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return jg(r.element)&&MD(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return jg(i)&&(MD(i),i.querySelectorAll(`:scope > br`).forEach(MD)),r===e?void 0:r}}},Jge=(e,t)=>{let n=t.getParent();return n instanceof NT&&n.getChildrenSize()===1&&!t.getFormatType()?{element:document.createDocumentFragment()}:t.isEmpty()&&t.getNextSiblings().every(e=>$m(e)&&e.isEmpty())?{element:null}:ND(e,t)},PD=(e,t)=>{let n=document.createTextNode(t.getTextContent());return Wge.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},Yge=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!jg(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!vD(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?jg(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:` +`:e.textContent).join(``),e.replaceChildren(n)}}),Xge=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,Zge=new Map([[Mm,PD],[eh,PD],[CS,PD],[Zm,Jge],[WC,ND],[VC,ND],[cC,ND],[pC,ND],[US,ND],[ux,ND],[hS,Yge],[GE,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return jg(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(Xge)].forEach(MD)),r===e?void 0:r}}}]]),Qge=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=` +`);return n},$ge=e=>{let t=e.querySelector(`:scope > code`),n=gS((t?jD(t):void 0)??e.getAttribute(`data-language`)),r=Qge(e).replace(/\n$/,``);return r&&n.append(Pm(r)),{node:n,after:()=>[]}},FD=new WeakMap,ID=new WeakMap,LD=e=>{let t=ID.get(e);return t||(t=e.importDOM?.()??{},ID.set(e,t)),t},RD=new WeakMap,zD=(e,t)=>{let n=RD.get(t);return n===void 0&&(n=FD.get(e)?.find(({node:e})=>!!LD(e)[t.localName]?.(t))??null,RD.set(t,n)),n??void 0},BD=e=>{let t=zD(Lg(),e);return!!t&&!!t.node.prototype.isInline?.()},VD=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,jg(n)){if(BD(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!Pg(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,jg(n)&&BD(n))return n;r=t?n.firstChild:n.lastChild}if(hh(n))return n;if(n.nodeName===`BR`)return null}},e_e=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},t_e=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=VD(e,!1),r=!0;for(;n;n=VD(n,!1)){if(!hh(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=VD(e,!0),r=!0;for(;n;n=VD(n,!0))if(!hh(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?Pm(t):null}},n_e={"#text":e=>e_e(e)?null:{conversion:e=>t_e(e),priority:1}},r_e={pre:()=>({conversion:$ge,priority:2})},i_e=e=>{let t=FD.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(LD(e))).filter(e=>!r.has(e)))},a_e=(e,t)=>{let n=i_e(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return zD(e,o)?!1:!Kge.includes(s)&&!Gge.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},HD=e=>gpe(e),UD=`[ \\t\\uE005]`;`${UD}${UD}${UD}${UD}${UD}`;var o_e=String.raw`(?=<)(?\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|`,String.raw`||`,String.raw`<\?.*?\?>`,String.raw`]*>`,String.raw``].join(`|`),`)`].join(``)),c_e=`(?:${[`javascript`,`vbscript`,`data`].map(e=>e.replace(/[a-z]/g,e=>`[${e}${e.toUpperCase()}]`)).join(`|`)})`,l_e=new RegExp([o_e,`(?:`,[String.raw`<(?!${c_e}:)[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\s<>]*>`,String.raw`<[\w.!#$%&'*+/=?^\x60{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?`+String.raw`(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>`].join(`|`),`)`].join(``)),u_e=/(?|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),f_e=String.raw`\[(?:[^\\[\]]|\\.)+\]:`,p_e=RegExp(`^ {0,3}(?:${d_e}|${f_e})`),WD=Yf(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),m_e=e=>Xf(e,WD)||void 0,h_e=e=>{if(Xf(e,WD))return e.getTextContent()},GD={dependencies:[],export:()=>null,importRegExp:p_e,regExp:/(?!)/,replace:e=>{Zf(e,WD,e.getTextContent())},type:`text-match`},g_e={dependencies:[],export:()=>null,importRegExp:new RegExp([`^(?=[*_~=]).+`,`(?<=^).+`,s_e.source,l_e.source,u_e.source].join(`|`)),regExp:/(?!)/,replace:GD.replace,type:`text-match`},KD=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},qD=(e,t)=>{let n=e.split(` `),r=[],i=0,a=e=>{if(e>i){let a=i>0?` `:``,o=e{a(e),r.push(n.slice(e,t+1).join(` +`)}${o}`);r.push(s.slice(a.length,s.length-o.length))}};return KD(n).forEach(({start:e,end:t})=>{a(e),r.push(n.slice(e,t+1).join(` `)),i=t+1}),a(n.length),r.join(` -`)},mD=(e,t)=>{let n=e.split(` -`),r=new Set(fD(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(` -`)},Mge=/^ {0,3}(=+|-+)[ \t]*$/,Nge=/^ {0,3}#{1,6}(?:[ \t]|$)/,Pge=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`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.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],Fge=RegExp(`<(?:${Pge.map(([e])=>e).join(`|`)})`,`i`),Ige=Pge.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),Lge=new RegExp(lD,`g`),Rge=RegExp(`^ {0,3}(?!\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|)[ \\t]*$`,`i`),zge=new RegExp([Nge.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${Fge.source}`,`^(?: {4}|\\t)`,`^ {0,3}([-*_])(?:[ \\t]*\\1){2,}[ \\t]*$`,Mge.source].join(`|`),`i`),Bge=new RegExp(zge.source.replace(`|^(?: {4}|\\t)`,``),`i`),hD=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?e.split(` -`).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),Uge=e=>Vge.some(([,t])=>e.search(t)!==-1),Wge=e=>pD(e,e=>{let t=e,n;for(;t!==n;)n=t,t=Vge.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(Uge(n))return e;let r=Hge(n);return r.some(({text:e})=>/^[*_~]+$/.test(e))||r.slice(1).some(({indent:e,text:t})=>Bge.test(`${e}${t}`))?e:r.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(` -`)}),t);return t.replace(/(?<=^|[\s\p{P}\p{S}])(?{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;e{if(!/[\\`][*_~]*$/.test(e))return e;let t=yD(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${gD}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${gD}${e.slice(n)}`},qge=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,Jge=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(qge,(t,n)=>`*_~`.includes(e[n])?`${_D}.`:`.${_D}`):e,Yge=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,Xge=e=>/[^\0-\x7F]/.test(e)?e.replace(Yge,(t,n)=>`*_~`.includes(e[n-1])?`.${_D}`:`${_D}.`):e,Zge=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return yD(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?Gge.repeat(o.length):o.replaceAll(` `,vD)}`,n=i-a}),t+e.slice(n)},Qge=e=>{let t,n=!1;return e.split(` -`).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=Ige.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&Rge.test(e))t=null;else return n=!r,e.includes(` `)?e.replace(Lge,e=>e.replaceAll(` `,vD)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,vD)}`}).join(` -`)},$ge=e=>mD(e.includes(`<`)?pD(e,Qge):e,e=>Zge(Xge(Jge(Kge(e))))),bD=e=>e.replace(RegExp(`\\.${_D}|${_D}\\.`,`g`),``).replaceAll(gD,``).replaceAll(``,``).replaceAll(vD,` `).replaceAll(Gge,` `),e_e=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(` -`);return fD(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(` -`)},t_e=e=>!!e.trim()&&!zge.test(e),n_e=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?pD(e,e=>{let t=[];return e.split(` -`).forEach(e=>{let[,n]=e.match(Mge)??[],r=t.length;for(;r>0&&t_e(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!Nge.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(` -`)}):e,r_e=e=>/^>$/m.test(e)?mD(e,e=>e===`>`?`> `:e):e,i_e=e=>/^> $/m.test(e)?mD(e,e=>e===`> `?`>`:e):e,a_e={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||QE(n)||!Hhe()?yfe(e.getTextContent()):$he(e,n)}},o_e=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;ewS(e)&&wS(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||Ym(e)&&Ym(t)||Og(e)&&Og(t),c_e=(e,t)=>{let n=0;for(;n{let n=S_(e);if(!hS(n)||!n.isAttached())return;let r=Q();if(!Z(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&Og(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e=c){t.select(c,c);return}c-=e}else if(Og(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},u_e=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||QE(o),l=!1;c||!o||Uhe()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):Hhe()?(nD(s)||(Zhe(s,e,i),l=!0),$E(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!Xhe(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(Khe(e,i),l=!0),!l&&(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),tv(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=S_(i);hS(e)&&e.markDirty()},{tag:HE(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,tv(()=>{n.didTransform=!1,a.clear()})),l_e(i,()=>{let e=S_(i);if(!hS(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=c_e(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},d_e=(e,t,n,r)=>{let i=r.getParent();hS(i)?u_e(e,t,n,i):wS(r)&&r.replace(Gm(r.__text))},f_e=(e,t=a_e)=>{if(!e.hasNodes([pS,xS]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(pS,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=S_(n);t!==null&&o_e(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(pS,u_e.bind(null,e,t,r)),e.registerNodeTransform(Vm,d_e.bind(null,e,t,r)),e.registerNodeTransform(xS,d_e.bind(null,e,t,r)),Ffe(e)),Ky(...n)},p_e=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),xD=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),m_e=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return xD(i[r-1])&&xD(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}).replace(/ /g,` `),h_e=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>X(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return xD(o)||xD(s)},SD=``,g_e={dependencies:[],export:(e,t,n)=>{if(!X(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n(vT(e),SD).replace(SD,``)}${r}`;let i=Age(e),a=n(vT(e),i===void 0?r:SD);if(h_e(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(SD,()=>i);a=m_e(a);let o=e.getParent(),s=e.getPreviousSibling();return!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!Og(s)?a:p_e(a)},regExp:/(?!)/,type:`text-match`},__e=/\s/,CD=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,v_e=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},y_e=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||__e.test(o)?!1:!CD.test(o)||s===void 0||__e.test(s)||CD.test(s)},b_e=(e,t,n,r)=>{if(!y_e(e,t,n,r))return!1;if(e[t]!==`_`||!y_e(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&CD.test(i)},x_e=(e,t,n)=>{let r=[],i=0,a=0;for(;a{let n={},r=[],i=0;for(;is&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},C_e=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=yD(t),[a]=i;if(!a)return;let o=S_e(x_e(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>tl.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},w_e=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=C_e(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},T_e={dependencies:[Qb],export:e=>ex(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=$b();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},E_e=()=>{let e=Q();return Z(e)?Qv(e.anchor.getNode(),e=>$(e)&&!e.isInline())?.getFormatType()??``:``},D_e=e=>{let t=Q()??Eh();t&&!Q()&&j_(t.clone());let n=Z(t)?t.anchor.getNode():null;return Xg(n)&&n.isEmpty()&&bg(n.getParent())?n.replace(e):sb(e)},O_e=()=>{let e=D_e($b()),t=e.getNextSibling();return $(t)?t.selectStart():e.insertAfter(Yg()).selectStart(),e},k_e=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},A_e=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(` -`)},j_e=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},M_e=e=>e?Qv(e,BT):null,wD=()=>{let e=Q();return!Z(e)&&!oE(e)?null:M_e(e.focus.getNode())?.getKey()??null},N_e=(e,t)=>{let n=Q()??Eh();return(Z(n)||oE(n))&&EE(n.anchor.getNode())?!1:(D_e(GT(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},P_e=e=>{!e.getNextSibling()&&bg(e.getParent())&&e.insertAfter(Yg())},F_e=e=>{e.getChildren().forEach((e,t)=>{if(!WT(e))return;let n=t===0?FT.ROW:FT.NO_STATUS;e.getChildren().forEach(e=>{BT(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},I_e=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();$(t)?t.selectEnd():$(n)?n.selectStart():e.insertAfter(Yg()).selectStart()},L_e=e=>e===`delete-row`||e===`delete-column`,R_e=(e,t)=>{let n=Q(),[r,i]=[n.anchor,n.focus].map(e=>M_e(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},z_e=(e,t,{rtl:n=!1}={})=>{let r=S_(t);if(!BT(r))return!1;let i=EE(r),a=Q()??Eh();return(Z(a)||oE(a))&&EE(a.anchor.getNode())?.is(i)&&EE(a.focus.getNode())?.is(i)?Q()||j_(a.clone()):r.selectStart(),e===`delete-table`||L_e(e)&&R_e(i,e)?(I_e(i),i.remove()):e===`delete-row`?Ame():e===`delete-column`?jme():e===`insert-row-above`||e===`insert-row-below`?Ome(e===`insert-row-below`):kme(e===`insert-column-right`!==n),!0},TD=/^(?:\|)(.+)(?:\|)\s?$/,B_e=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,V_e=e=>{let t=e.getFirstChild();return WT(t)?t.getChildrenSize():0},ED=(e,t)=>{e=e.trim().replace(/\\n/g,` -`).replace(/\\\|/g,`|`);let n=zT(FT.NO_STATUS);return mT(e,t,n),n},DD=(e,t)=>{let[,n]=e.match(TD)??[];return n?n.split(/(?<=(?ED(e,t)):null},H_e=(e=[])=>{let t=[...e,...$w.map(e=>e===Qw?CT:e),bT,jge,dD],n=[...t,g_e];return{dependencies:[PE,HT,IT],export:e=>{if(!IE(e))return null;let t=[];return e.getChildren().forEach(e=>{let r=[];if(!WT(e))return;let i=!1;e.getChildren().forEach(e=>{BT(e)&&(r.push(hT(n,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),e.__headerState===FT.ROW&&(i=!0))}),t.push(`| ${r.join(` | `)} |`),i&&t.push(`| ${r.map(()=>`---`).join(` | `)} |`)}),t.join(` -`)},regExp:TD,replace:(e,n,[r])=>{if(B_e.test(r)){let t=e.getPreviousSibling();if(!t||!IE(t))return;let n=t.getChildren(),r=n[n.length-1];if(!r||!WT(r))return;r.getChildren().forEach(e=>{BT(e)&&e.setHeaderStyles(FT.ROW,FT.ROW)}),e.remove();return}let i=DD(r,t);if(!i)return;let a=[i],o=e.getPreviousSibling(),s=i.length;for(;o&&Xg(o)&&o.getChildrenSize()===1;){let e=o.getFirstChild();if(!X(e))break;let n=DD(e.getTextContent(),t);if(!n)break;s=Math.max(s,n.length),a.unshift(n);let r=o.getPreviousSibling();o.remove(),o=r}let c=FE();a.forEach(e=>{let n=UT();c.append(n);for(let r=0;r{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(W_e);return!n||!t.contains(n)},K_e=()=>{let e=Q();if(!Z(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=k_();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if($(i))i.selectStart();else if($(r))r.selectEnd();else{let e=Yg();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},OD=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(E_(t))})},kD=(e,t)=>{OD(e,t,e=>{vg(e)&&(e.selectNext(),K_e())})},q_e=(e,t)=>{OD(e,t,e=>{$(e)&&e.selectEnd()})},J_e=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(G_e(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),kD(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),kD(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),q_e(e,s),!0):!1},Y_e=[`http`,`https`,`mailto`,`sms`,`tel`],AD=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||Y_e.includes(n.toLowerCase())},X_e=e=>e instanceof hg?e:ob(e,hg),Z_e=()=>{let e=Q();if(!Z(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:wD(),alignment:``};let t=e.anchor.getNode(),n=null,r=TT.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=X_e(t),HS(n)&&(r.push(`link`),n=n.getParent()),oC(n)&&(n=ob(n,cC)));let i=(()=>{if(!n)return`paragraph`;if(qC(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(fC(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(HC(n))return`blockquote`;if(hS(n)||wS(n))return`code-block`;let e=n.getType();return DT.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:wD(),alignment:E_e()}},Q_e=e=>i_e(hT([...e.filter(({tag:e})=>!fme.includes(e)),g_e]).replace(/\n+$/,``)),jD=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?Ege(e):Q_e(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:Z_e()}})),i},$_e=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=$g({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();k_().append(e.isInline()?Yg().append(e):e),a=jD(i,[n])},{discrete:!0})}catch{}return a.trim()},MD=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},eve=(e,t)=>MD(e.registerCommand(cp,e=>{let t=Q();if(!e||!Z(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=hS(r)?r:ob(r,pS);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(Ep,t=>Z(Q())?(t?.preventDefault(),e.dispatchCommand(up,void 0)):!1,2),e.registerNodeTransform(yg,e=>{let n=e.getChildren();if(n.length===1&&hS(n[0]))return;let[r]=n;if(n.length===1&&$(r)){let e=mS(t);r.replace(e,!0)}else if(n.length===0){let n=mS(t);e.append(n),n.selectStart()}})),tve=e=>MD(e.registerNodeTransform(BS,e=>{AD(e.getURL())||lde(e)}),e.registerCommand(WS,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!AD(t)||Gfe(t===null?null:e),!0},2),e.registerCommand(fp,t=>{let n=Q();if(!Z(n)||!cb(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!BE(r)||!AD(r)?!1:(n.isCollapsed()&&Mh([Gm(r)]),!n.getNodes().some(e=>$(e)||X(e)&&!e.isSimpleText())&&(e.dispatchCommand(WS,r),t.preventDefault(),!0))},1)),nve=[[`bulleted-list`,pC,`bullet`],[`numbered-list`,mC,`number`]],rve=(e,t=[])=>{let n=nve.filter(([e])=>t.includes(e));return MD(...n.map(([,t,n])=>e.registerCommand(t,()=>(Xfe(n),!0),2)),n.length?e.registerCommand(up,()=>$fe(),2):void 0)},ive=(e,t,n)=>{let r=0,i=!0,a,o=!1;return MD(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await qc(100),!(l!==r||o)&&e.update(()=>{a=jD(e,t,i?void 0:a,n),i=!1})})()}))},ave=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=Q();if(!Z(n))return;let r=X_e(n.anchor.getNode());oC(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(Np,void 0)):(t.preventDefault(),e.dispatchCommand(Mp,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),ove=e=>{let t=e=>e===void 0?e:bD(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},ND=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),sve=e=>Array.isArray(e)?`index`in e?ove(e):e.every(e=>typeof e==`string`)?e.map(e=>bD(e)):e:e,cve=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>bD(e))})),r&&(c.importRegExp=ND(r,!1)),t===`element`&&i&&(c.regExp=ND(i,!0)),a&&(c.regExpStart=ND(a,!0)),o instanceof RegExp?c.regExpEnd=ND(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:ND(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(sve))),{...e,...c}},lve=({enabledButtons:e=[],components:t=[],useMarkdownShortcuts:n,isCodeEditor:r=!1,defaultLanguage:i=`plain`,format:a=`markdown`})=>{let o=e.includes(`code-block`)||r,s=e.includes(`table`)&&!r,c=e.includes(`horizontal-rule`)&&!r,l=Jue({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...o?[Pfe]:[],...s?[Yue(_he,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...c?[Ade]:[]],$initialEditorState:null,nodes:[...t.map(({node:e})=>e),...new Set(Object.entries(ume).filter(([t])=>e.includes(t)).flatMap(([,e])=>e)),...r?[pS,xS]:[Qb,PE,IT,HT]],theme:lme,html:a===`html`?{export:fge,import:{...Sge,...o?Cge:{}}}:void 0,onError:e=>{console.error(e)}}),u=t.map(({transformer:e})=>cve(e)),d=[...u,...r?[]:[jge],...new Set(Object.entries(dme).filter(([t])=>e.includes(t)).flatMap(([,e])=>e)),...r?[gT]:[T_e,H_e(u.filter(({type:e})=>e===`text-match`)),dD]],f=bde(l);oD.set(f,t);let p=MD(Ppe(f),wpe(f),mme(f,hme(),1e3,void 0,void 0,U_e),r?eve(f,i):void 0,n?rme(f,d):void 0,o?f_e(f,{...a_e,defaultLanguage:i,defaultTheme:qE()}):void 0,o?zhe(f):void 0,e.includes(`link`)?tve(f):void 0,s?f.registerNodeTransform(PE,e=>{P_e(e),a===`markdown`&&F_e(e)}):void 0,rve(f,e),ive(f,d,a),ave(f));return{editor:f,enabledTransformers:d,dispose:()=>{p(),f.dispose()}}},PD=async e=>{QE(e)||(await Khe(),await Promise.all([Xhe(tD(e)),Zhe(qE())]))},FD=new WeakMap,ID=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(FD.get(e)??0)+1;FD.set(e,a);let o=()=>FD.get(e)!==a;try{await Promise.all(t.map(async e=>PD(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},uve=()=>{k_().getAllTextNodes().forEach(e=>{let t=e.getTextContent(),n=bD(kge(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),HS(r)){let e=r.getURL(),t=r.getTitle();bD(e)!==e&&r.setURL(bD(e)),t&&bD(t)!==t&&r.setTitle(bD(t))}})},dve=async(e,t,n)=>{let r=n.some(e=>`regExpStart`in e&&e.regExpStart===gT.regExpStart),i=n.some(e=>`regExp`in e&&e.regExp===Rw.regExp),a=r?e_e(t):t,o=i?n_e(a):a;return ID(e,{languages:[...o.matchAll(/^`{3,}[ \t]*(?[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e),$import:()=>{let e=Wge(o),t=$ge(e);mT(r_e(t),w_e(n)),(t!==e||lD.test(t))&&uve()},$export:()=>Q_e(n),formatName:`Markdown`})},fve=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return ID(e,{languages:[...n.querySelectorAll(`pre > code`)].map(sge).filter(e=>e!==void 0),$import:()=>{let t=Tge(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=k_(),i=null;r.clear(),$x(e,n).forEach(e=>{($(e)||vg(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=Yg(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(Yg()),Q()!==null&&r.selectStart()},$export:()=>Ege(e),formatName:`HTML`})},LD=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})}),pve=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),mve=B(`
`),hve={hash:`svelte-cpk1dw`,code:`.lexical-root.svelte-cpk1dw {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);}.lexical-root.svelte-cpk1dw:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-cpk1dw {padding:0;}.lexical-root.code.svelte-cpk1dw .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-cpk1dw:focus-visible {outline:0;}.lexical-root[aria-invalid=true].svelte-cpk1dw {border-color:var(--sui-error-border-color);}.lexical-root.svelte-cpk1dw :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-cpk1dw :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-cpk1dw strong.italic {font-style:italic;}.lexical-root.svelte-cpk1dw .strikethrough {text-decoration:line-through;}.lexical-root.svelte-cpk1dw li.nested {list-style-type:none;}.lexical-root.svelte-cpk1dw .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-cpk1dw .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-cpk1dw .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-cpk1dw .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-cpk1dw [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-cpk1dw :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-cpk1dw .table-wrapper {overflow-x:auto;}.lexical-root.svelte-cpk1dw .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-cpk1dw .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-cpk1dw :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-cpk1dw th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-cpk1dw :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-cpk1dw .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-cpk1dw hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-cpk1dw hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-cpk1dw hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function RD(e,t){O(t,!0),K(e,hve);let n=J(t,`dir`,3,void 0),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=ys(t,pve),l=ri(`editorStore`),u=j(void 0),d=A(()=>!(i()||a()));L(()=>{l.editor?.setEditable(z(d))}),L(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>k_().getDirection())!==t&&e.update(()=>{k_().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&J_e(l.editor,e)},h=e=>!!e&&!e.contains(z(u)??null),g=({target:e})=>{let t=e;z(u)?.contains(t)?$a(()=>{l.componentHasFocus=t!==z(u)}):t instanceof Element&&h(t.closest(`dialog`))||$a(()=>{l.componentHasFocus=!1})},_=({relatedTarget:e})=>{e||queueMicrotask(()=>{document.activeElement===document.body&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})};xs(()=>{let{editor:e,enabledTransformers:t,dispose:n}=lve(l.config);l.editor=e,l.enabledTransformers=t,z(u)?.addEventListener(`Update`,f),z(u)?.addEventListener(`click`,p),z(u)?.addEventListener(`mousedown`,m),document.addEventListener(`focusin`,g),document.addEventListener(`focusout`,_);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0)});return()=>{r(),z(u)?.removeEventListener(`Update`,f),z(u)?.removeEventListener(`click`,p),z(u)?.removeEventListener(`mousedown`,m),document.removeEventListener(`focusin`,g),document.removeEventListener(`focusout`,_),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),L(()=>{l.editor&&z(u)&&(l.editor.setRootElement(z(u)),l.initialized=!0)});var v=mve();us(v,()=>({...c,role:`textbox`,"aria-multiline":`true`,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:z(d),hidden:r(),[is]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-cpk1dw`),_s(v,e=>M(u,e),()=>z(u)),U(e,v),k()}var zD=()=>{let e=el(`editor`),t=j(!1),n=j(void 0),r=j(Yi([])),i=j(Yi({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=j(``),o=j(Yi({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=j(!0),c=j(void 0),l=j(0),u=j(!1),d=j(!1),f=j(!1),p=j(!1),m=j(0),h,g=0,_=!1,v=e=>{M(d,e,!0),e&&(M(s,!1),M(f,!0))},y=async()=>{if(!z(n)||!z(t))return;let e=z(a);g+=1;let o=g;_=!0;try{let t=z(i).format===`html`?await fve(z(n),z(a)||``):await dve(z(n),z(a)||``,z(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),M(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return z(n)},set editor(e){M(n,e,!0)},set enabledTransformers(e){M(r,e,!0)},get enabledTransformers(){return z(r)},get initialized(){return z(t)},set initialized(e){M(t,e,!0)},get config(){return z(i)},set config(e){M(i,e,!0),M(s,e.modes[0]===`rich-text`||e.isCodeEditor,!0)},get inputValue(){return z(a)},set inputValue(e){let t=z(a)!==e;t&&M(a,e,!0),z(s)&&(t||z(n)?.getEditorState().isEmpty())&&y()},get selection(){return z(o)},set selection(e){M(o,e,!0)},get controlId(){return z(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return z(c)},set textArea(e){M(c,e,!0)},get toolbarHeight(){return z(l)},set toolbarHeight(e){M(l,e,!0)},get componentHasFocus(){return z(u)},set componentHasFocus(e){M(u,e,!0)},get useRichText(){return z(s)},set useRichText(e){M(s,e,!0)},get hasConverterError(){return z(d)},set hasConverterError(e){v(e)},get showConverterError(){return z(f)},set showConverterError(e){M(f,e,!0)},get pending(){return z(p)||z(m)>0},set pending(e){M(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{M(m,z(m)+1);let e=!1;return()=>{e||(e=!0,M(m,z(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},gve=B(` `,1);function _ve(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=bhe.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=ri(`editorStore`),a=j(`plain`),o=A(()=>r.find(({key:e,aliases:t})=>e===z(a)||t.includes(z(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?k_().getChildren()[0]:e?S_(e):null;return hS(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||z(o)===e)return;let n=i.startOperation();try{await LD(t),await PD(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),M(a,e,!0))},{tag:HE(t)})}finally{n()}};L(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&M(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=A(()=>Y(`_sui.text_editor.language`));gu(e,{get disabled(){return n()},get ariaLabel(){return z(t)},get value(){return z(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=gve(),i=P(n);{let e=A(()=>Y(`_sui.text_editor.plain_text`));au(i,{get label(){return z(e)},value:`plain`,dir:`ltr`})}ko(I(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).label;{let t=A(()=>n()===z(o));au(e,{get label(){return r()},get value(){return n()},get selected(){return z(t)},dir:`ltr`})}}),U(e,n)},$$slots:{default:!0}})}k()}var vve=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),yve=B(`
`),bve={hash:`svelte-13z6f1m`,code:`[role=toolbar].svelte-13z6f1m {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-13z6f1m {--toolbar-size: var(--sui-primary-toolbar-size);} -@media (width < 768px) {[role=toolbar].secondary.svelte-13z6f1m {padding-inline:0;} -}[role=toolbar][aria-orientation=horizontal].svelte-13z6f1m {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-13z6f1m {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-13z6f1m button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-13z6f1m h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-13z6f1m h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-13z6f1m h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-13z6f1m .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-13z6f1m .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-13z6f1m {display:contents;}`};function BD(e,t){K(e,bve);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`variant`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=ys(t,vve);var c=yve();us(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-13z6f1m`);var l=N(c);Po(N(l),()=>t.children??Tr),D(l),D(c),R(()=>l.inert=r()),U(e,c)}var xve=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),Sve=B(`
`),Cve={hash:`svelte-1ph2lw`,code:`.wrapper.svelte-1ph2lw {display:contents;}.wrapper.svelte-1ph2lw [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-1ph2lw [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-1ph2lw .sui.menu-button {padding:0 4px;}.wrapper.svelte-1ph2lw .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-1ph2lw .sui.button-group {gap:4px;}`};function wve(e,t){O(t,!0),K(e,Cve);let n=J(t,`disabled`,3,!1),r=ys(t,xve),i=ri(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=Sve();BD(N(o),bs(()=>r,{get disabled(){return n()},[eo()]:a,children:(e,n)=>{var r=H();Po(P(r),()=>t.children??Tr),U(e,r)},$$slots:{default:!0}})),D(o),U(e,o),k()}function Tve(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1);{let t=A(()=>n()||r()),i=A(()=>Y(`_sui.text_editor.code_editor`));wve(e,{get disabled(){return z(t)},get ariaLabel(){return z(i)},children:(e,t)=>{{let t=A(()=>n()||r());_ve(e,{get disabled(){return z(t)}})}},$$slots:{default:!0}})}k()}var Eve=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),Dve=B(`
`,1),Ove={hash:`svelte-14lqdrw`,code:`.code-editor.svelte-14lqdrw {margin:var(--sui-focus-ring-width);border-radius:var(--sui-textbox-border-radius);width:calc(100% - var(--sui-focus-ring-width) * 2);transition:all 200ms;}.code-editor.svelte-14lqdrw:focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.code-editor.flex.svelte-14lqdrw:not([hidden]) {display:block;}.code-editor.svelte-14lqdrw {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-14lqdrw > * {--sui-text-editor-inner-toolbar-top: calc( +`)},JD=(e,t)=>{let n=e.split(` +`),r=new Set(KD(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(` +`)},YD=/^ {0,3}(=+|-+)[ \t]*$/,XD=/^ {0,3}#{1,6}(?:[ \t]|$)/,__e=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,v_e=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`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.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],y_e=RegExp(`<(?:${v_e.map(([e])=>e).join(`|`)})`,`i`),b_e=v_e.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),x_e=new RegExp(s_e,`g`),S_e=RegExp(`^ {0,3}(?!\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|)[ \\t]*$`,`i`),C_e=new RegExp([XD.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${y_e.source}`,`^(?: {4}|\\t)`,__e.source,YD.source].join(`|`),`i`),w_e=new RegExp([XD.source,__e.source].join(`|`)),T_e=new RegExp(C_e.source.replace(`|^(?: {4}|\\t)`,``),`i`),ZD=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?e.split(` +`).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),O_e=e=>E_e.some(([,t])=>e.search(t)!==-1),QD=e=>{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;ee.replace(/(?<=^|[\s\p{P}\p{S}])(?{if(!e.includes(`[`))return e;let t=QD(e);return e.replace(k_e,(e,n,r,i,a,o)=>t.some(({start:e,end:t})=>o>=e&&oQD(e).some(({start:t,end:n})=>e.slice(t,n).includes(` +`))||/(?qD(e,e=>{let t=A_e(e),n;for(;t!==n;)n=t,t=E_e.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(O_e(n))return e;let r=j_e(n);if(M_e(r))return e;let i=D_e(r);return i.some(({text:e})=>/^[*_~]+$/.test(e))||i.slice(1).some(({indent:e,text:t})=>T_e.test(`${e}${t}`))?e:i.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(` +`)}),t);return t}),$D=``,eO=``,tO=``,P_e=``,F_e=e=>{if(!/[\\`][*_~]*$/.test(e))return e;let t=QD(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${$D}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${$D}${e.slice(n)}`},I_e=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,L_e=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(I_e,(t,n)=>`*_~`.includes(e[n])?`${eO}.`:`.${eO}`):e,R_e=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,z_e=e=>/[^\0-\x7F]/.test(e)?e.replace(R_e,(t,n)=>`*_~`.includes(e[n-1])?`.${eO}`:`${eO}.`):e,B_e=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return QD(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?P_e.repeat(o.length):o.replaceAll(` `,tO)}`,n=i-a}),t+e.slice(n)},V_e=e=>{let t,n=!1;return e.split(` +`).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=b_e.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&S_e.test(e))t=null;else return n=!r&&!w_e.test(e)&&!(n&&YD.test(e)),e.includes(` `)?e.replace(x_e,e=>e.replaceAll(` `,tO)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,tO)}`}).join(` +`)},H_e=e=>JD(e.includes(`<`)?qD(e,V_e):e,e=>B_e(z_e(L_e(F_e(e))))),nO=e=>e.replace(RegExp(`\\.${eO}|${eO}\\.`,`g`),``).replaceAll($D,``).replaceAll(``,``).replaceAll(tO,` `).replaceAll(P_e,` `),U_e=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(` +`);return KD(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(` +`)},W_e=e=>!!e.trim()&&!C_e.test(e),G_e=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?qD(e,e=>{let t=[];return e.split(` +`).forEach(e=>{let[,n]=e.match(YD)??[],r=t.length;for(;r>0&&W_e(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!XD.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(` +`)}):e,K_e=e=>/^>$/m.test(e)?JD(e,e=>e===`>`?`> `:e):e,q_e=e=>/^> $/m.test(e)?JD(e,e=>e===`> `?`>`:e):e,J_e={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||vD(n)||!yD()?cS(e.getTextContent()):Bge(e,n)}},Y_e=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;eES(e)&&ES(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||nh(e)&&nh(t)||E_(e)&&E_(t),Z_e=(e,t)=>{let n=0;for(;n{let n=wh(e);if(!_S(n)||!n.isAttached())return;let r=$();if(!Q(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&E_(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e=c){t.select(c,c);return}c-=e}else if(E_(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},$_e=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||vD(o),l=!1;c||!o||Ige()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):yD()?(OD(s)||(kD(s,e,i),l=!0),bD(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!DD(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(CD(e,i),l=!0),l||(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),ig(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=wh(i);_S(e)&&e.markDirty()},{tag:eD(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,ig(()=>{n.didTransform=!1,a.clear()})),Q_e(i,()=>{let e=wh(i);if(!_S(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=Z_e(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},eve=(e,t,n,r)=>{let i=r.getParent();_S(i)?$_e(e,t,n,i):ES(r)&&r.replace(Pm(r.__text))},tve=(e,t=J_e)=>{if(!e.hasNodes([hS,CS]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(hS,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=wh(n);t!==null&&Y_e(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(hS,$_e.bind(null,e,t,r)),e.registerNodeTransform(Mm,eve.bind(null,e,t,r)),e.registerNodeTransform(CS,eve.bind(null,e,t,r)),Rpe(e)),pv(...n)},nve=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),rO=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),rve=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return rO(i[r-1])&&rO(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}),ive={38:`&`,60:`<`,91:`[`,93:`]`},ave=/^[\w.!#$%&'*+/=?^`{|}~-]{1,64}@[A-Za-z\d]/,ove=(e,{isInLink:t,isAtLineEnd:n})=>e.replace(/&#(38|60|91|93);/g,(e,r,i,a)=>{let o=ive[r],s=a.slice(i+e.length,i+e.length+70);return!s&&!n||o===`<`&&(/^[A-Za-z/!?]/.test(s)||ave.test(s))||o===`&`&&/^#(?:\d{1,7}|[xX][\dA-Fa-f]{1,6});/.test(s)||o===`[`&&(t||s.startsWith(`^`))||o===`]`&&(t||/^[(:[]/.test(s))?`\\${o}`:o}),sve=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>Fm(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return rO(o)||rO(s)},iO=``,cve={dependencies:[],export:(e,t,n)=>{if(!Fm(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n(mT(e),iO).replace(iO,``)}${r}`;let i=h_e(e),a=n(mT(e),i===void 0?r:iO);if(sve(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(iO,()=>i);let o=e.getParent(),s=e.getPreviousSibling(),c=e.getNextSibling();return a=ove(rve(a),{isInLink:!!o?.isInline(),isAtLineEnd:!c||E_(c)}),!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!E_(s)?a:nve(a)},regExp:/(?!)/,type:`text-match`},lve=/\s/,aO=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,uve=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},dve=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||lve.test(o)?!1:!aO.test(o)||s===void 0||lve.test(s)||aO.test(s)},fve=(e,t,n,r)=>{if(!dve(e,t,n,r))return!1;if(e[t]!==`_`||!dve(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&aO.test(i)},pve=(e,t,n)=>{let r=[],i=0,a=0;for(;a{let n={},r=[],i=0;for(;is&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},hve=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=QD(t),[a]=i;if(!a)return;let o=mve(pve(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>tl.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},gve=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=hve(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},_ve={dependencies:[ux],export:e=>fx(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=dx();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.isAttached()&&i.selectNext()},type:`element`},vve=()=>{let e=$();return Q(e)?g_(e.anchor.getNode(),e=>Z(e)&&!e.isInline())?.getFormatType()??``:``},yve=e=>{let t=$()??Dy();t&&!$()&&Nh(t.clone());let n=Q(t)?t.anchor.getNode():null;return $m(n)&&n.isEmpty()&&Tm(n.getParent())?n.replace(e):Lb(e)},bve=()=>{let e=yve(dx()),t=e.getNextSibling();return Z(t)?t.selectStart():e.insertAfter(Qm()).selectStart(),e},xve=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},Sve=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(` +`)},Cve=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},wve=e=>e?g_(e,LT):null,oO=()=>{let e=$();return!Q(e)&&!iE(e)?null:wve(e.focus.getNode())?.getKey()??null},Tve=(e,t)=>{let n=$()??Dy();return(Q(n)||iE(n))&&AE(n.anchor.getNode())?!1:(yve(HT(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},Eve=e=>{!e.getNextSibling()&&Tm(e.getParent())&&e.insertAfter(Qm())},Dve=e=>{e.getChildren().forEach((e,t)=>{if(!VT(e))return;let n=t===0?MT.ROW:MT.NO_STATUS;e.getChildren().forEach(e=>{LT(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},Ove=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();Z(t)?t.selectEnd():Z(n)?n.selectStart():e.insertAfter(Qm()).selectStart()},kve=e=>e===`delete-row`||e===`delete-column`,Ave=(e,t)=>{let n=$(),[r,i]=[n.anchor,n.focus].map(e=>wve(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},jve=(e,t,{rtl:n=!1}={})=>{let r=wh(t);if(!LT(r))return!1;let i=AE(r),a=$()??Dy();return(Q(a)||iE(a))&&AE(a.anchor.getNode())?.is(i)&&AE(a.focus.getNode())?.is(i)?$()||Nh(a.clone()):r.selectStart(),e===`delete-table`||kve(e)&&Ave(i,e)?(Ove(i),i.remove()):e===`delete-row`?Khe():e===`delete-column`?qhe():e===`insert-row-above`||e===`insert-row-below`?Whe(e===`insert-row-below`):Ghe(e===`insert-column-right`!==n),!0},Mve=/^(?:\|)(.+)(?:\|)\s?$/,Nve=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,Pve={left:`:---`,center:`:---:`,right:`---:`},Fve=e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:n?`left`:r?`right`:``},Ive=e=>{let t=e.getFirstChild();return VT(t)?t.getChildrenSize():0},Lve=(e,t)=>{e=e.trim().replace(/\\n/g,` +`).replace(/\\\|/g,`|`);let n=IT(MT.NO_STATUS);return uT(e,t,n),n},Rve=(e,t)=>{let[,n]=e.match(Mve)??[];return n?n.split(/(?<=(?Lve(e,t)):null},zve=(e=[])=>{let t=[...e,...Yw.map(e=>e===Jw?yT:e),gT,g_e,GD],n=[...t,cve];return{dependencies:[GE,zT,NT],export:e=>{if(!qE(e))return null;let t=[];return e.getChildren().forEach(e=>{let r=[],i=[];if(!VT(e))return;let a=!1;e.getChildren().forEach(e=>{LT(e)&&(r.push(dT(n,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),i.push(e),e.__headerState===MT.ROW&&(a=!0))}),t.push(`| ${r.join(` | `)} |`),a&&t.push(`| ${i.map(e=>Pve[e.getFormatType()]??`---`).join(` | `)} |`)}),t.join(` +`)},regExp:Mve,replace:(e,n,[r])=>{if(Nve.test(r)){let t=e.getPreviousSibling();if(!t||!qE(t))return;let n=t.getChildren(),i=n[n.length-1];if(!i||!VT(i))return;let a=r.trim().slice(1,-1).split(`|`).map(Fve);i.getChildren().forEach((e,t)=>{LT(e)&&(e.setHeaderStyles(MT.ROW,MT.ROW),e.setFormat(a[t]??``))}),e.remove();return}let i=Rve(r,t);if(!i)return;let a=[i],o=e.getPreviousSibling(),s=i.length;for(;o&&$m(o)&&o.getChildrenSize()===1;){let e=o.getFirstChild();if(!Fm(e))break;let n=Rve(e.getTextContent(),t);if(!n)break;s=Math.max(s,n.length),a.unshift(n);let r=o.getPreviousSibling();o.remove(),o=r}let c=KE();a.forEach(e=>{let n=BT();c.append(n);for(let r=0;r{e.getChildren().forEach((e,n)=>{e.setFormat(t[n].getFormatType())})}),l.append(...c.getChildren()),e.remove()}else e.replace(c);c.selectEnd()},type:`element`}},Bve=200,Vve=`input, textarea, select, button, a[href], label, summary, video[controls], audio[controls], [tabindex], [draggable="true"], [contenteditable]:not([contenteditable="false"])`,Hve=e=>{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(Vve);return!n||!t.contains(n)},Uve=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=jh();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if(Z(i))i.selectStart();else if(Z(r))r.selectEnd();else{let e=Qm();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},Wve=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(Oh(t))})},Gve=(e,t)=>{Wve(e,t,e=>{Sm(e)&&(e.selectNext(),Uve())})},Kve=(e,t)=>{Wve(e,t,e=>{Z(e)&&e.selectEnd()})},qve=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(Hve(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),Gve(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),Gve(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),Kve(e,s),!0):!1},Jve=[`http`,`https`,`mailto`,`sms`,`tel`],sO=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||Jve.includes(n.toLowerCase())},Yve=e=>e instanceof bm?e:Ib(e,bm),Xve=()=>{let e=$();if(!Q(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:oO(),alignment:``};let t=e.anchor.getNode(),n=null,r=xT.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=Yve(t),GS(n)&&(r.push(`link`),n=n.getParent()),_C(n)&&(n=Ib(n,cC)));let i=(()=>{if(!n)return`paragraph`;if(qC(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(fC(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(UC(n))return`blockquote`;if(_S(n)||ES(n))return`code-block`;let e=n.getType();return CT.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:oO(),alignment:vve()}},Zve=e=>q_e(dT([...e.filter(({tag:e})=>!Ohe.includes(e)),cve]).replace(/\n+$/,``)),Qve=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?HD(e):Zve(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:Xve()}})),i},$ve=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=M_({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();jh().append(e.isInline()?Qm().append(e):e),a=Qve(i,[n])},{discrete:!0})}catch{}return a.trim()},cO=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},eye=(e,t)=>cO(e.registerCommand(dd,e=>{let t=$();if(!e||!Q(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=_S(r)?r:Ib(r,hS);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(kd,t=>Q($())?(t?.preventDefault(),e.dispatchCommand(pd,void 0)):!1,2),e.registerNodeTransform(wm,e=>{let n=e.getChildren();if(n.length===1&&_S(n[0]))return;let[r]=n;if(n.length===1&&Z(r)){let e=gS(t);r.replace(e,!0)}else if(n.length===0){let n=gS(t);e.append(n),n.selectStart()}})),tye=({transformer:e})=>e.type===`text-match`,nye=e=>e.multiline!==!1||e.isCodeEditor?e:{...e,modes:e.format===`html`?[`rich-text`]:e.modes,enabledButtons:(e.enabledButtons??[]).filter(e=>ST.includes(e)),components:(e.components??[]).filter(tye)},rye=e=>Z(e)&&!e.isInline()?e.getChildren().flatMap(rye):e.isInline()?[e]:[],iye=e=>{let t=e.getChildren(),[n]=t;if(!n||t.length===1&&$m(n))return;let r=$m(n)?n:Qm();r!==n&&n.insertBefore(r);let i=r.getTextContent().at(-1)??``;t.filter(e=>e!==r).forEach(e=>{let t=rye(e),n=t.map(e=>e.getTextContent()).join(``);t.length&&r.getChildrenSize()&&!/\s/.test(i+n.charAt(0))&&r.append(Pm(` `)),r.append(...t),i=n.at(-1)??i,e.remove()})},aye=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(!t||!n||/\s$/.test(t.getTextContent())||/^\s/.test(n.getTextContent())){e.remove();return}let r=Pm(` `),i=GS(t)&&GS(n)&&t.getURL()===n.getURL()&&t.getTitle()===n.getTitle()&&t.getTarget()===n.getTarget()&&t.getRel()===n.getRel(),a=Z(t)?t.getLastDescendant():t,o=Z(n)?n.getFirstDescendant():n;Fm(a)&&Fm(o)&&(xT.forEach(e=>{a.hasFormat(e)&&o.hasFormat(e)&&r.toggleFormat(e)}),a.getStyle()===o.getStyle()&&r.setStyle(a.getStyle())),i?(t.append(r,...n.getChildren()),n.remove(),e.remove()):e.replace(r)},oye=e=>cO(e.registerCommand(kd,e=>(e?.preventDefault(),!0),3),e.registerCommand(pd,()=>!0,3),e.registerCommand(fd,()=>!0,3),e.registerNodeTransform(w_,aye),e.registerNodeTransform(wm,iye)),sye=e=>cO(e.registerNodeTransform(US,e=>{sO(e.getURL())||Hde(e)}),e.registerCommand(qS,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!sO(t)||Jpe(t===null?null:e),!0},2),e.registerCommand(hd,t=>{let n=$();if(!Q(n)||!Rb(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!QE(r)||!sO(r)?!1:(n.isCollapsed()&&Py([Pm(r)]),!n.getNodes().some(e=>Z(e)||Fm(e)&&!e.isSimpleText())&&(e.dispatchCommand(qS,r),t.preventDefault(),!0))},1)),cye=[[`bulleted-list`,vC,`bullet`],[`numbered-list`,yC,`number`]],lye=(e,t=[])=>{let n=cye.filter(([e])=>t.includes(e));return cO(...n.map(([,t,n])=>e.registerCommand(t,()=>($pe(n),!0),2)),n.length?e.registerCommand(pd,()=>nme(),2):void 0)},uye=(e,t,n)=>{let r=0,i=!0,a,o=!1;return cO(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await Zc(100),l!==r||o||e.update(()=>{a=Qve(e,t,i?void 0:a,n),i=!1})})()}))},dye=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=$();if(!Q(n))return;let r=Yve(n.anchor.getNode());_C(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(Ld,void 0)):(t.preventDefault(),e.dispatchCommand(Id,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),fye=e=>{let t=e=>e===void 0?e:nO(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},lO=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),pye=e=>Array.isArray(e)?`index`in e?fye(e):e.every(e=>typeof e==`string`)?e.map(e=>nO(e)):e:e,mye=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>nO(e))})),r&&(c.importRegExp=lO(r,!1)),t===`element`&&i&&(c.regExp=lO(i,!0)),a&&(c.regExpStart=lO(a,!0)),o instanceof RegExp?c.regExpEnd=lO(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:lO(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(pye))),{...e,...c}},uO=async e=>{vD(e)||(await CD(),await Promise.all([DD(ED(e)),kD(fD())]))},hye=e=>{e.flatMap(e=>Z(e)?e.getAllTextNodes():e).filter(e=>Fm(e)).forEach(e=>{let t=e.getTextContent(),n=nO(m_e(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),GS(r)){let e=r.getURL(),t=r.getTitle();nO(e)!==e&&r.setURL(nO(e)),t&&nO(t)!==t&&r.setTitle(nO(t))}})},gye=(e,t)=>{let n=t.some(e=>`regExpStart`in e&&e.regExpStart===fT.regExpStart),r=t.some(e=>`regExp`in e&&e.regExp===Pw.regExp),i=n?U_e(e):e,a=r?G_e(i):i;return{markdown:a,languages:[...a.matchAll(/^`{3,}[ \t]*(?[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e)}},_ye=(e,t,{toRoot:n=!1}={})=>{let r=N_e(e),i=H_e(r),a=K_e(i),o=gve(t),s;return n?(uT(a,o),s=jh().getChildren()):s=yhe(a,o),(i!==r||/[\\&]/.test(i))&&hye(s),s},vye=async(e,t,n)=>{let{markdown:r,languages:i}=gye(t,n);await Promise.allSettled(i.map(e=>uO(e))),e.isEditable()&&e.update(()=>{let e=$()?.clone();if(!e)return;let i;try{i=_ye(r,n)}catch(e){console.error(e)}Nh(e),i?e.insertNodes(i):e.insertRawText(t)},{tag:`paste`})},yye=1e3,bye=()=>Uc()?`Meta+Shift+V Meta+Alt+Shift+V`:`Ctrl+Shift+V`,xye=(e,t)=>{let n=bye(),r=!1,i=0;return cO(()=>{clearTimeout(i)},e.registerCommand(Sd,e=>(r=qc(e,n),clearTimeout(i),r&&(i=window.setTimeout(()=>{r=!1},yye)),!1),2),e.registerCommand(hd,n=>{if(!r)return!1;r=!1;let i=Rb(n,ClipboardEvent),a=(i?n.clipboardData:Rb(n,InputEvent)?n.dataTransfer:null)?.getData(`text/plain`);return!a||i&&QE(a.trim())?!1:(n.preventDefault(),vye(e,a,t),!0)},2))},Sye=e=>{let{enabledButtons:t=[],components:n=[],useMarkdownShortcuts:r,isCodeEditor:i=!1,defaultLanguage:a=`plain`,format:o=`markdown`,multiline:s=!0}=nye(e),c=t.includes(`code-block`)||i,l=t.includes(`table`)&&!i,u=t.includes(`horizontal-rule`)&&!i,d=!i&&s,f=mde({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...c?[Lpe]:[],...l?[hde(bge,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...u?[Cfe]:[]],$initialEditorState:null,nodes:[...n.map(({node:e})=>e),...new Set(Object.entries(Ehe).filter(([e])=>t.includes(e)).flatMap(([,e])=>e)),...i?[hS,CS]:[],...d?[ux,GE,NT,zT]:[]],theme:The,html:o===`html`?{export:Zge,import:{...n_e,...c?r_e:{}}}:void 0,onError:e=>{console.error(e)}}),p=n.map(({transformer:e})=>mye(e)),m=[...p,...i?[]:[g_e],...new Set(Object.entries(Dhe).filter(([e])=>t.includes(e)).flatMap(([,e])=>e)),...i?[fT]:[],...d?[_ve,zve(p.filter(({type:e})=>e===`text-match`))]:[],...i?[]:[GD]],h=afe(f);FD.set(h,n);let g=cO(Xme(h),kme(h),Ahe(h,jhe(),1e3,void 0,void 0,Bve),i?eye(h,a):void 0,s||i?void 0:oye(h),r?vhe(h,m):void 0,c?tve(h,{...J_e,defaultLanguage:a,defaultTheme:fD()}):void 0,c?Nge(h):void 0,t.includes(`link`)?sye(h):void 0,l?h.registerNodeTransform(GE,e=>{Eve(e),o===`markdown`&&Dve(e)}):void 0,lye(h,t),uye(h,m,o),dye(h),i?void 0:xye(h,m));return{editor:h,enabledTransformers:m,dispose:()=>{g(),h.dispose()}}},dO=new WeakMap,Cye=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(dO.get(e)??0)+1;dO.set(e,a);let o=()=>dO.get(e)!==a;try{await Promise.all(t.map(async e=>uO(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},wye=async(e,t,n)=>{let{markdown:r,languages:i}=gye(t,n);return Cye(e,{languages:i,$import:()=>{_ye(r,n,{toRoot:!0})},$export:()=>Zve(n),formatName:`Markdown`})},Tye=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return Cye(e,{languages:[...n.querySelectorAll(`pre > code`)].map(jD).filter(e=>e!==void 0),$import:()=>{let t=a_e(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=jh(),i=null;r.clear(),mpe(e,n).forEach(e=>{(Z(e)||Sm(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=Qm(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(Qm()),$()!==null&&r.selectStart()},$export:()=>HD(e),formatName:`HTML`})},fO=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})}),Eye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),Dye=V(`
`),Oye={hash:`svelte-amjery`,code:`.lexical-root.svelte-amjery {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);transition-duration:200ms;transition-property:outline-color, border-color, color, background-color;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.lexical-root.svelte-amjery:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-amjery {padding:0;}.lexical-root.code.svelte-amjery .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-amjery:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.lexical-root[aria-invalid=true].svelte-amjery {border-color:var(--sui-error-border-color);}.lexical-root.svelte-amjery :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-amjery :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-amjery strong.italic {font-style:italic;}.lexical-root.svelte-amjery .strikethrough {text-decoration:line-through;}.lexical-root.svelte-amjery li.nested {list-style-type:none;}.lexical-root.svelte-amjery .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-amjery .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-amjery .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-amjery .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-amjery [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-amjery :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-amjery .table-wrapper {overflow-x:auto;}.lexical-root.svelte-amjery .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-amjery .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-amjery :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-amjery th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-amjery :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-amjery .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-amjery hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-amjery hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-amjery hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function kye(e,t){k(t,!0),q(e,Oye);let n=Y(t,`dir`,3,void 0),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`required`,3,!1),s=Y(t,`invalid`,3,!1),c=gs(t,Eye),l=ui(`editorStore`),u=M(void 0),d=j(()=>!(i()||a()));R(()=>{l.editor?.setEditable(B(d))}),R(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>jh().getDirection())!==t&&e.update(()=>{jh().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&qve(l.editor,e)},h=e=>!!e&&!e.contains(B(u)??null),g=({target:e})=>{let t=e;B(u)?.contains(t)?co(()=>{l.componentHasFocus=t!==B(u)}):t instanceof Element&&h(t.closest(`dialog`))||co(()=>{l.componentHasFocus=!1})},_=({relatedTarget:e})=>{e||queueMicrotask(()=>{document.activeElement===document.body&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})};vs(()=>{let{editor:e,enabledTransformers:t,dispose:n}=Sye(l.config);l.editor=e,l.enabledTransformers=t,B(u)?.addEventListener(`Update`,f),B(u)?.addEventListener(`click`,p),B(u)?.addEventListener(`mousedown`,m),document.addEventListener(`focusin`,g),document.addEventListener(`focusout`,_);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0)});return()=>{r(),B(u)?.removeEventListener(`Update`,f),B(u)?.removeEventListener(`click`,p),B(u)?.removeEventListener(`mousedown`,m),document.removeEventListener(`focusin`,g),document.removeEventListener(`focusout`,_),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),R(()=>{l.editor&&B(u)&&(l.editor.setRootElement(B(u)),l.initialized=!0)});var v=Dye();us(v,()=>({...c,role:`textbox`,"aria-multiline":l.config.multiline!==!1,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:B(d),hidden:r(),[cs]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-amjery`),ms(v,e=>N(u,e),()=>B(u)),W(e,v),A()}var Aye=()=>{let e=rl(`editor`),t=M(!1),n=M(void 0),r=M(na([])),i=M(na({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=M(``),o=M(na({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=M(!0),c=M(void 0),l=M(0),u=M(!1),d=M(!1),f=M(!1),p=M(!1),m=M(0),h,g=0,_=!1,v=e=>{N(d,e,!0),e&&(N(s,!1),N(f,!0))},y=async()=>{if(!B(n)||!B(t))return;let e=B(a);g+=1;let o=g;_=!0;try{let t=B(i).format===`html`?await Tye(B(n),B(a)||``):await wye(B(n),B(a)||``,B(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),N(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return B(n)},set editor(e){N(n,e,!0)},set enabledTransformers(e){N(r,e,!0)},get enabledTransformers(){return B(r)},get initialized(){return B(t)},set initialized(e){N(t,e,!0)},get config(){return B(i)},set config(e){N(i,nye(e),!0),N(s,B(i).modes[0]===`rich-text`||B(i).isCodeEditor,!0)},get inputValue(){return B(a)},set inputValue(e){let t=B(a)!==e;t&&N(a,e,!0),B(s)&&(t||B(n)?.getEditorState().isEmpty())&&y()},get selection(){return B(o)},set selection(e){N(o,e,!0)},get controlId(){return B(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return B(c)},set textArea(e){N(c,e,!0)},get toolbarHeight(){return B(l)},set toolbarHeight(e){N(l,e,!0)},get componentHasFocus(){return B(u)},set componentHasFocus(e){N(u,e,!0)},get useRichText(){return B(s)},set useRichText(e){N(s,e,!0)},get hasConverterError(){return B(d)},set hasConverterError(e){v(e)},get showConverterError(){return B(f)},set showConverterError(e){N(f,e,!0)},get pending(){return B(p)||B(m)>0},set pending(e){N(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{N(m,B(m)+1);let e=!1;return()=>{e||(e=!0,N(m,B(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},jye=V(` `,1);function Mye(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=iD.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=ui(`editorStore`),a=M(`plain`),o=j(()=>r.find(({key:e,aliases:t})=>e===B(a)||t.includes(B(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?jh().getChildren()[0]:e?wh(e):null;return _S(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||B(o)===e)return;let n=i.startOperation();try{await fO(t),await uO(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),N(a,e,!0))},{tag:eD(t)})}finally{n()}};R(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&N(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=j(()=>X(`_sui.text_editor.language`));yu(e,{get disabled(){return n()},get ariaLabel(){return B(t)},get value(){return B(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=jye(),i=F(n);{let e=j(()=>X(`_sui.text_editor.plain_text`));nu(i,{get label(){return B(e)},value:`plain`,dir:`ltr`})}Ro(L(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).label;{let t=j(()=>n()===B(o));nu(e,{get label(){return r()},get value(){return n()},get selected(){return B(t)},dir:`ltr`})}}),W(e,n)},$$slots:{default:!0}})}A()}var Nye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),Pye=V(`
`),Fye={hash:`svelte-1yg30ts`,code:`[role=toolbar].svelte-1yg30ts {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-1yg30ts {--toolbar-size: var(--sui-primary-toolbar-size);} +@media (width < 768px) {[role=toolbar].secondary.svelte-1yg30ts {padding-inline:0;} +}[role=toolbar][aria-orientation=horizontal].svelte-1yg30ts {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-1yg30ts {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-1yg30ts button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-1yg30ts h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-1yg30ts h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-1yg30ts h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-1yg30ts .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-1yg30ts .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-1yg30ts {display:contents;}`};function pO(e,t){q(e,Fye);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`variant`,3,void 0),o=Y(t,`ariaLabel`,3,void 0),s=gs(t,Nye);var c=Pye();us(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-1yg30ts`);var l=P(c);Uo(P(l),()=>t.children??jr),O(l),O(c),z(()=>l.inert=r()),W(e,c)}var Iye=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),Lye=V(`
`),Rye={hash:`svelte-9hp1oe`,code:`.wrapper.svelte-9hp1oe {display:contents;}.wrapper.svelte-9hp1oe [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-9hp1oe [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-9hp1oe .sui.menu-button {padding:0 4px;}.wrapper.svelte-9hp1oe .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-9hp1oe .sui.button-group {gap:4px;}`};function zye(e,t){k(t,!0),q(e,Rye);let n=Y(t,`disabled`,3,!1),r=gs(t,Iye),i=ui(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=Lye();pO(P(o),_s(()=>r,{get disabled(){return n()},[lo()]:a,children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}})),O(o),W(e,o),A()}function Bye(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=Y(t,`readonly`,3,!1);{let t=j(()=>n()||r()),i=j(()=>X(`_sui.text_editor.code_editor`));zye(e,{get disabled(){return B(t)},get ariaLabel(){return B(i)},children:(e,t)=>{{let t=j(()=>n()||r());Mye(e,{get disabled(){return B(t)}})}},$$slots:{default:!0}})}A()}var Vye=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),Hye=V(`
`,1),Uye={hash:`svelte-1eh5cd2`,code:`.code-editor.svelte-1eh5cd2 {margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.code-editor.flex.svelte-1eh5cd2:not([hidden]) {display:block;}.code-editor.svelte-1eh5cd2 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-1eh5cd2 > * {--sui-text-editor-inner-toolbar-top: calc( var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height) - );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function kve(e,t){O(t,!0),K(e,Ove);let n=J(t,`code`,15,``),r=J(t,`lang`,15,`plain`),i=J(t,`pending`,15,!1),a=J(t,`showLanguageSwitcher`,3,!1),o=J(t,`flex`,3,!1),s=J(t,`hidden`,3,!1),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=J(t,`ariaLabelledby`,3,void 0),m=J(t,`ariaDescribedby`,3,void 0),h=J(t,`aria-label`,3,void 0),g=J(t,`aria-labelledby`,3,void 0),_=J(t,`aria-describedby`,3,void 0),v=ys(t,Eve),y=A(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=zD();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},ii(`editorStore`,b),L(()=>{i(b.pending)}),L(()=>()=>{i(!1)}),L(()=>{b.initialized&&(n(),r(),$a(()=>{b.inputValue=Gse(r(),n())}))}),L(()=>{b.initialized&&(b.inputValue,$a(()=>{let{lang:e,code:t}=Kse(b.inputValue);r()!==e&&r(e),n()!==t&&n(t)}))});var x=Dve(),S=P(x);us(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[is]:{flex:o()},[as]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-14lqdrw`);var C=N(S),w=e=>{Tve(e,{get disabled(){return c()},get readonly(){return l()}})};G(C,e=>{a()&&e(w)}),RD(I(C,2),bs(()=>z(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),D(S);var T=I(S,2),ee=e=>{ku(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{Pc(e,{status:`error`,children:(e,t)=>{Kr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(T,e=>{b.showConverterError&&e(ee)}),U(e,x),k()}var Ave=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),jve=B(` `),Mve=B(``),Nve=B(``),Pve=B(`
`),Fve={hash:`svelte-2z97ez`,code:`.text-area.svelte-2z97ez {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-2z97ez {display:none;}.text-area.flex.svelte-2z97ez:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-2z97ez, .clone.svelte-2z97ez) {grid-area:1/1/2/2;display:block;margin:0;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);width:100%;min-height:8em;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)).resizing.svelte-2z97ez {transition-duration:0ms;}.svelte-2z97ez:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.svelte-2z97ez:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)):is(:where(.svelte-2z97ez):disabled, :where(.svelte-2z97ez):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-2z97ez {resize:vertical;}textarea.auto-resize.svelte-2z97ez {overflow:hidden;resize:none;}textarea[aria-invalid=true].svelte-2z97ez {border-color:var(--sui-error-border-color);}.clone.svelte-2z97ez {overflow:hidden;visibility:hidden;}.clone.svelte-2z97ez:not(.auto-resize) {position:absolute;inset:0;min-height:0;scroll-behavior:auto;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) {visibility:visible;pointer-events:none;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .bold:where(.svelte-2z97ez) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .underline:where(.svelte-2z97ez) {text-decoration-line:underline;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .strikethrough:where(.svelte-2z97ez) {text-decoration-line:line-through;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .underline.strikethrough:where(.svelte-2z97ez) {text-decoration-line:underline line-through;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-2z97ez:focus-within .clone:where(.svelte-2z97ez) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-2z97ez:is(.disabled:where(.svelte-2z97ez), .readonly:where(.svelte-2z97ez)) .clone:where(.svelte-2z97ez) {background-color:var(--sui-disabled-background-color);}textarea.svelte-2z97ez, -.clone.svelte-2z97ez {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function VD(e,t){O(t,!0),K(e,Fve);let n=J(t,`value`,15,``),r=J(t,`element`,15),i=J(t,`flex`,3,!1),a=J(t,`dir`,3,void 0),o=J(t,`name`,3,void 0),s=J(t,`autoResize`,3,!1),c=J(t,`useEmojiAutocomplete`,3,!1),l=J(t,`highlight`,3,void 0),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`required`,3,!1),m=J(t,`invalid`,3,!1),h=ys(t,Ave),g=A(()=>`${n()}\n`),_=A(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:` -`}]);return t.map(({content:e})=>e).join(``)===z(g)?t:void 0}),v=j(void 0);L(()=>{if(!r()||!z(v)||s())return;let e=r(),t=z(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=Pve();let b;var x=N(y);Bee(x),us(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[is]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-2z97ez`),_s(x,e=>r(e),()=>r());var S=I(x,2),C=e=>{var t=Mve();let n;ko(t,21,()=>z(_),Eo,(e,t)=>{var n=jve();let r,i;var a=F(n,!0);R(()=>{r=Xo(n,1,`svelte-2z97ez`,null,r,{bold:z(t).bold,underline:z(t).underline,strikethrough:z(t).strikethrough}),i=Qo(n,``,i,{color:z(t).color}),W(a,z(t).content)}),U(e,n)}),D(t),_s(t,e=>M(v,e),()=>z(v)),R(()=>{n=Xo(t,1,`clone svelte-2z97ez`,null,n,{"auto-resize":s()}),q(t,`dir`,a()),t.dir=t.dir}),U(e,t)},w=e=>{var t=Nve(),n=F(t,!0);R(()=>{q(t,`dir`,a()),W(n,z(g)),t.dir=t.dir}),U(e,t)};G(S,e=>{z(_)?e(C):s()&&e(w,1)});var T=I(S,2),ee=e=>{Gl(e,{get element(){return r()}})};G(T,e=>{c()&&!d()&&!f()&&e(ee)}),D(y),R(()=>{b=Xo(y,1,`sui text-area ${t.class??``}`,`svelte-2z97ez`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!z(_)}),q(y,`hidden`,u()),x.dir=x.dir}),Zte(x,n),U(e,y),k()}function Ive(e,t){O(t,!0);let n=ri(`editorStore`),r=j(void 0),i=()=>{let e=Q();if(!Z(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!X(t)||!t.isSimpleText()||hS(t.getParent()))return;let{offset:n}=e.anchor,r=Hl(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=S_(a);if(!X(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=Vl(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>z(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(Tp,t(()=>z(r)?.moveSelection(1)),4),e.registerCommand(wp,t(()=>z(r)?.moveSelection(-1)),4),e.registerCommand(Ep,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(Ap,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(Op,t(()=>z(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),z(r)?.update(t)})]};L(()=>{if(!n.editor||!z(r))return;let e=s();return()=>{e.forEach(e=>e()),z(r)?.close()}}),L(()=>{n.useRichText||z(r)?.close()});{let t=A(()=>n.editor?.getRootElement()??void 0);_s(Wl(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return z(t)}}),e=>M(r,e,!0),()=>z(r))}k()}var Lve=B(` `,1),Rve=B(` `,1),zve=B(``),Bve={hash:`svelte-1jd1td2`,code:`.floating-link-editor.svelte-1jd1td2 {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:4px;width:min(400px, 100vw - 16px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.floating-link-editor.svelte-1jd1td2 .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-1jd1td2 .sui.button {flex:none;margin:0 !important;}.url.svelte-1jd1td2 {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function Vve(e,t){let n=mo();O(t,!0),K(e,Bve);let r=ri(`editorStore`),i=j(void 0),a=j(!1),o=j(void 0),s=j(void 0),c=j(``),l=j(!1),u=!1,d=A(()=>r.config.format===`html`),f=j(void 0),p=j(0),m=j(void 0),h=j(void 0),g=A(()=>!!z(s)),_=A(()=>!!z(c).trim()&&AD(z(c))),v=A(()=>z(g)||!!z(i)&&z(a)&&z(o)!==z(i).key),y=A(()=>z(f)?Ul({anchorRect:z(f),listMaxHeight:z(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Dc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=()=>{let e=Q();if(!Z(e))return null;let t=Qv(e.anchor.getNode(),HS);return t&&Qv(e.focus.getNode(),HS)===t?t:null},x=e=>{let t;if(z(s)&&`selection`in z(s)){let{selection:n}=z(s);e.getEditorState().read(()=>{let[r,i]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(t=Zue(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())})}else{let n=z(s)&&`linkKey`in z(s)?z(s).linkKey:z(i)?.key;t=n?e.getElementByKey(n)?.getBoundingClientRect():void 0}if(!t||!(t.top||t.bottom||t.left||t.width||t.height))return;let{top:n,bottom:r,left:a,right:o}=t;return{top:n,bottom:r,left:a,right:o}},S=()=>{let{editor:e}=r;M(f,e&&z(v)?x(e):void 0)},C=async(e,t,n=!1)=>{M(s,e),M(c,t,!0),M(l,n,!0),u=n,M(o,void 0),await Xa(),S(),await Xa(),z(h)?.focus(),z(h)?.select()},w=()=>{M(s,void 0),M(c,``),M(l,!1)},T=async()=>{r.editor&&await LD(r.editor)},ee=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=b();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=Q()??Eh();if(Z(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=BE(n)&&AD(n)?n:``)}}),e?(C(e,t,n),!0):!1},te=async()=>{let{editor:e}=r,t=z(s),n=z(c).trim(),i=z(d)&&z(l)!==u?z(l)?`_blank`:null:void 0;e&&t&&z(_)&&(w(),`linkKey`in t?e.update(()=>{let e=S_(t.linkKey);HS(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{j_(t.selection.clone())}),e.dispatchCommand(WS,i?{url:n,target:i}:n)),await T())},ne=async()=>{w(),await T()},re=async()=>{let e=z(i)?.key;e&&(r.editor?.update(()=>{let t=S_(e);HS(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await T())},ie=e=>{e.isComposing||(Vc(e,`Enter`)?(e.preventDefault(),z(_)&&te()):Vc(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),ne()))};L(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(OT,ee,2),n=e.registerCommand(Op,e=>!z(v)||z(g)||!z(i)?!1:(e?.preventDefault(),M(o,z(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=b();M(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),z(s)&&(`linkKey`in z(s)?!HS(S_(z(s).linkKey)):[z(s).selection.anchor,z(s).selection.focus].some(({key:e})=>!S_(e)?.isAttached()))&&w()}),z(o)&&z(i)?.key!==z(o)&&M(o,void 0),S()}),c=e.registerEditableListener(e=>{e||w()});return()=>{t(),n(),a(),c()}}),L(()=>{r.useRichText||(w(),M(i,void 0))}),L(()=>{z(v),S()}),L(()=>{z(g),z(m)&&(z(m).matches(`:popover-open`)||z(m).showPopover?.(),M(p,z(m).getBoundingClientRect().height,!0))}),xs(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!z(m)?.contains(t))},t=({target:t})=>{$a(()=>{M(a,e(t),!0),z(g)&&!z(m)?.contains(t)&&w()})},n=({relatedTarget:e})=>{e||$a(()=>{M(a,!1)})};return window.addEventListener(`scroll`,S,{capture:!0,passive:!0}),window.addEventListener(`resize`,S,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,S,{capture:!0}),window.removeEventListener(`resize`,S),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var ae=H(),oe=P(ae),se=e=>{var t=zve();let r;var a=N(t),o=e=>{var t=Lve(),r=P(t);{let e=A(()=>!!z(c).trim()&&!AD(z(c))),t=A(()=>Y(`_sui.text_editor.url`));Kl(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{ie(e)},get element(){return z(h)},set element(e){M(h,e,!0)},get value(){return z(c)},set value(e){M(c,e,!0)}})}var i=I(r,2),a=e=>{{let t=e=>{Ac(e,{name:`open_in_new`})},n=A(()=>Y(`_sui.text_editor.open_in_new_tab`));ul(e,{iconic:!0,variant:`ghost`,get pressed(){return z(l)},get"aria-label"(){return z(n)},onclick:()=>{M(l,!z(l))},startIcon:t,$$slots:{startIcon:!0}})}};G(i,e=>{z(d)&&e(a)});var o=I(i,2);{let e=e=>{Ac(e,{name:`check`})},t=A(()=>!z(_)),n=A(()=>z(s)&&`linkKey`in z(s)?Y(`_sui.update`):Y(`_sui.insert`));ul(o,{iconic:!0,variant:`ghost`,get disabled(){return z(t)},get"aria-label"(){return z(n)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var u=I(o,2);{let e=e=>{Ac(e,{name:`close`})},t=A(()=>Y(`_sui.cancel`));ul(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)},u=e=>{var t=Rve(),n=P(t),r=F(n,!0),a=I(n,2);{let e=e=>{Ac(e,{name:`edit`})},t=A(()=>Y(`_sui.text_editor.edit_link`));ul(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{z(i)&&C({linkKey:z(i).key},z(i).url,z(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=I(a,2);{let e=e=>{Ac(e,{name:`link_off`})},t=A(()=>Y(`_sui.text_editor.remove_link`));ul(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{re()},startIcon:e,$$slots:{startIcon:!0}})}R(e=>{q(n,`href`,e),W(r,z(i).url),n.dir=n.dir},[()=>AD(z(i).url)?z(i).url:void 0]),U(e,t)};G(a,e=>{z(g)?e(o):z(i)&&e(u,1)}),D(t),_s(t,e=>M(m,e),()=>z(m)),R(e=>{q(t,`aria-label`,e),r=Qo(t,``,r,{top:z(y).top,bottom:z(y).bottom,left:z(y).left})},[()=>Y(`_sui.text_editor.link`)]),so(`mousedown`,t,e=>{e.target===e.currentTarget&&e.preventDefault()}),U(e,t)};G(oe,e=>{z(v)&&z(y)&&e(se)}),U(e,ae),k()}co([`mousedown`]);var Hve=60,HD=async(e,t=0)=>e.closest(`dialog`)?.open&&t{window.requestAnimationFrame(e)}),HD(e,t+1)):new Promise(e=>{window.setTimeout(e)}),Uve=B(` `,1);function UD(e,t){O(t,!0);let n=ri(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&j_e(a);i.update(()=>{z_e(e,t.cellKey,{rtl:o})}),await HD(r),await LD(i)};{let t=A(()=>Y(`_sui.text_editor.table_options`));ou(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();ko(P(n),17,()=>r,Eo,(e,t,n)=>{var r=Uve(),a=P(r),o=e=>{Jl(e,{})};G(a,e=>{n>0&&e(o)}),ko(I(a,2),17,()=>z(t),([e,t])=>e,(e,t)=>{var n=A(()=>Or(z(t),2));let r=()=>z(n)[0],a=()=>z(n)[1];{let t=A(()=>Y(`_sui.text_editor.${a()}`));su(e,{get label(){return z(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),U(e,r)}),U(e,n)},$$slots:{default:!0}})}k()}var Wve=B(`
`),Gve={hash:`svelte-fu9xvh`,code:`.table-cell-menu-button.svelte-fu9xvh {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-fu9xvh {translate:0 0;}.table-cell-menu-button[hidden].svelte-fu9xvh {display:none;}.table-cell-menu-button.svelte-fu9xvh .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function Kve(e,t){O(t,!0),K(e,Gve);let n=ri(`editorStore`),r=j(null),i=j(!1),a=j(void 0),o=j(void 0),s=A(()=>!!z(r)&&z(i)&&!!z(a)&&n.useRichText),c=A(()=>z(a)?`top: ${z(a).top}px; left: ${z(a).left}px`:void 0),l=()=>z(o)?.parentElement,u=()=>{let e=l(),t=z(r)?n.editor?.getElementByKey(z(r)):void 0;if(!z(i)||!e||!t){M(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=j_e(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?M(a,void 0):M(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();M(i,!!e?.contains(document.activeElement)||!!z(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};L(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{M(r,e.read(wD),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),xs(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=Wve();let m;var h=N(p),g=e=>{let t=A(()=>z(r));{let r=e=>{Ac(e,{name:`expand_more`})},i=e=>{UD(e,{get cellKey(){return z(t)}})},o=A(()=>z(a)?.popupPosition),s=A(()=>Y(`_sui.text_editor.show_table_options`));Al(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return z(o)},get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};G(h,e=>{z(s)&&z(r)&&e(g)}),D(p),_s(p,e=>M(o,e),()=>z(o)),R(()=>{m=Xo(p,1,`table-cell-menu-button svelte-fu9xvh`,null,m,{rtl:z(a)?.rtl}),q(p,`hidden`,!z(s)),Qo(p,z(c))}),U(e,p),k()}var qve={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},Jve=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,Yve=/^[ \t]*(?:```|~~~)/,Xve=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(` + );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function Wye(e,t){k(t,!0),q(e,Uye);let n=Y(t,`code`,15,``),r=Y(t,`lang`,15,`plain`),i=Y(t,`pending`,15,!1),a=Y(t,`showLanguageSwitcher`,3,!1),o=Y(t,`flex`,3,!1),s=Y(t,`hidden`,3,!1),c=Y(t,`disabled`,3,!1),l=Y(t,`readonly`,3,!1),u=Y(t,`required`,3,!1),d=Y(t,`invalid`,3,!1),f=Y(t,`ariaLabel`,3,void 0),p=Y(t,`ariaLabelledby`,3,void 0),m=Y(t,`ariaDescribedby`,3,void 0),h=Y(t,`aria-label`,3,void 0),g=Y(t,`aria-labelledby`,3,void 0),_=Y(t,`aria-describedby`,3,void 0),v=gs(t,Vye),y=j(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=Aye();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},di(`editorStore`,b),R(()=>{i(b.pending)}),R(()=>()=>{i(!1)}),R(()=>{b.initialized&&(n(),r(),co(()=>{b.inputValue=Qse(r(),n())}))}),R(()=>{b.initialized&&(b.inputValue,co(()=>{let{lang:e,code:t}=$se(b.inputValue);r()!==e&&r(e),n()!==t&&n(t)}))});var x=Hye(),S=F(x);us(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[cs]:{flex:o()},[ls]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1eh5cd2`);var C=P(S),w=e=>{Bye(e,{get disabled(){return c()},get readonly(){return l()}})};K(C,e=>{a()&&e(w)}),kye(L(C,2),_s(()=>B(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),O(S);var T=L(S,2),ee=e=>{Pu(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`_sui.text_editor.converter_error`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(T,e=>{b.showConverterError&&e(ee)}),W(e,x),A()}var Gye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),Kye=V(` `),qye=V(``),Jye=V(``),Yye=V(`
`),Xye={hash:`svelte-4njyy1`,code:`.text-area.svelte-4njyy1 {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-4njyy1 {display:none;}.text-area.flex.svelte-4njyy1:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-4njyy1, .clone.svelte-4njyy1) {grid-area:1/1/2/2;display:block;margin:0;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);width:100%;min-height:8em;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)).resizing.svelte-4njyy1 {transition-duration:0ms;}.svelte-4njyy1:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.svelte-4njyy1:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)):is(:where(.svelte-4njyy1):disabled, :where(.svelte-4njyy1):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-4njyy1 {resize:vertical;}textarea.auto-resize.svelte-4njyy1 {overflow:hidden;resize:none;}textarea[aria-invalid=true].svelte-4njyy1 {border-color:var(--sui-error-border-color);}.clone.svelte-4njyy1 {overflow:hidden;visibility:hidden;scroll-behavior:auto;}.clone.svelte-4njyy1:not(.auto-resize) {position:absolute;inset:0;min-height:0;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) {visibility:visible;pointer-events:none;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .bold:where(.svelte-4njyy1) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .underline:where(.svelte-4njyy1) {text-decoration-line:underline;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .strikethrough:where(.svelte-4njyy1) {text-decoration-line:line-through;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .underline.strikethrough:where(.svelte-4njyy1) {text-decoration-line:underline line-through;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-4njyy1:focus-within .clone:where(.svelte-4njyy1) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-4njyy1:is(.disabled:where(.svelte-4njyy1), .readonly:where(.svelte-4njyy1)) .clone:where(.svelte-4njyy1) {background-color:var(--sui-disabled-background-color);}textarea.svelte-4njyy1, +.clone.svelte-4njyy1 {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function mO(e,t){k(t,!0),q(e,Xye);let n=Y(t,`value`,15,``),r=Y(t,`element`,15),i=Y(t,`flex`,3,!1),a=Y(t,`dir`,3,void 0),o=Y(t,`name`,3,void 0),s=Y(t,`autoResize`,3,!1),c=Y(t,`useEmojiAutocomplete`,3,!1),l=Y(t,`highlight`,3,void 0),u=Y(t,`hidden`,3,!1),d=Y(t,`disabled`,3,!1),f=Y(t,`readonly`,3,!1),p=Y(t,`required`,3,!1),m=Y(t,`invalid`,3,!1),h=gs(t,Gye),g=j(()=>`${n()}\n`),_=j(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:` +`}]);return t.map(({content:e})=>e).join(``)===B(g)?t:void 0}),v=M(void 0);R(()=>{if(!r()||!B(v))return;let e=r(),t=B(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=Yye();let b;var x=P(y);Bee(x),us(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[cs]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-4njyy1`),ms(x,e=>r(e),()=>r());var S=L(x,2),C=e=>{var t=qye();let n;Ro(t,21,()=>B(_),Fo,(e,t)=>{var n=Kye();let r,i;var a=I(n,!0);z(()=>{r=rs(n,1,`svelte-4njyy1`,null,r,{bold:B(t).bold,underline:B(t).underline,strikethrough:B(t).strikethrough}),i=as(n,``,i,{color:B(t).color}),G(a,B(t).content)}),W(e,n)}),O(t),ms(t,e=>N(v,e),()=>B(v)),z(()=>{n=rs(t,1,`clone svelte-4njyy1`,null,n,{"auto-resize":s()}),J(t,`dir`,a()),t.dir=t.dir}),W(e,t)},w=e=>{var t=Jye(),n=I(t,!0);z(()=>{J(t,`dir`,a()),G(n,B(g)),t.dir=t.dir}),W(e,t)};K(S,e=>{B(_)?e(C):s()&&e(w,1)});var T=L(S,2),ee=e=>{Wl(e,{get element(){return r()}})};K(T,e=>{c()&&!d()&&!f()&&e(ee)}),O(y),z(()=>{b=rs(y,1,`sui text-area ${t.class??``}`,`svelte-4njyy1`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!B(_)}),J(y,`hidden`,u()),x.dir=x.dir}),sne(x,n),W(e,y),A()}function Zye(e,t){k(t,!0);let n=ui(`editorStore`),r=M(void 0),i=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!Fm(t)||!t.isSimpleText()||_S(t.getParent()))return;let{offset:n}=e.anchor,r=Vl(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=wh(a);if(!Fm(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=Bl(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>B(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(Od,t(()=>B(r)?.moveSelection(1)),4),e.registerCommand(Dd,t(()=>B(r)?.moveSelection(-1)),4),e.registerCommand(kd,t(()=>B(r)?.selectHighlighted()),4),e.registerCommand(Pd,t(()=>B(r)?.selectHighlighted()),4),e.registerCommand(Md,t(()=>B(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),B(r)?.update(t)})]};R(()=>{if(!n.editor||!B(r))return;let e=s();return()=>{e.forEach(e=>e()),B(r)?.close()}}),R(()=>{n.useRichText||B(r)?.close()});{let t=j(()=>n.editor?.getRootElement()??void 0);ms(Ul(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return B(t)}}),e=>N(r,e,!0),()=>B(r))}A()}var Qye=V(` `,1),$ye=V(` `,1),ebe=V(``),tbe={hash:`svelte-118qqx8`,code:`.floating-link-editor.svelte-118qqx8 {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:4px;width:min(400px, 100vw - 16px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.floating-link-editor.svelte-118qqx8 .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-118qqx8 .sui.button {flex:none;margin:0 !important;}.url.svelte-118qqx8 {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function nbe(e,t){let n=Co();k(t,!0),q(e,tbe);let r=ui(`editorStore`),i=M(void 0),a=M(!1),o=M(void 0),s=M(void 0),c=M(``),l=M(!1),u=!1,d=j(()=>r.config.format===`html`),f=M(void 0),p=M(0),m=M(void 0),h=M(void 0),g=j(()=>!!B(s)),_=j(()=>!!B(c).trim()&&sO(B(c))),v=j(()=>B(g)||!!B(i)&&B(a)&&B(o)!==B(i).key),y=j(()=>B(f)?Hl({anchorRect:B(f),listMaxHeight:B(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Pc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=()=>{let e=$();if(!Q(e))return null;let t=g_(e.anchor.getNode(),GS);return t&&g_(e.focus.getNode(),GS)===t?t:null},x=e=>{let t;if(B(s)&&`selection`in B(s)){let{selection:n}=B(s);e.getEditorState().read(()=>{let[r,i]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(t=_de(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())})}else{let n=B(s)&&`linkKey`in B(s)?B(s).linkKey:B(i)?.key;t=n?e.getElementByKey(n)?.getBoundingClientRect():void 0}if(!t||!(t.top||t.bottom||t.left||t.width||t.height))return;let{top:n,bottom:r,left:a,right:o}=t;return{top:n,bottom:r,left:a,right:o}},S=()=>{let{editor:e}=r;N(f,e&&B(v)?x(e):void 0)},C=async(e,t,n=!1)=>{N(s,e),N(c,t,!0),N(l,n,!0),u=n,N(o,void 0),await ao(),S(),await ao(),B(h)?.focus(),B(h)?.select()},w=()=>{N(s,void 0),N(c,``),N(l,!1)},T=async()=>{r.editor&&await fO(r.editor)},ee=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=b();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=$()??Dy();if(Q(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=QE(n)&&sO(n)?n:``)}}),e?(C(e,t,n),!0):!1},E=async()=>{let{editor:e}=r,t=B(s),n=B(c).trim(),i=B(d)&&B(l)!==u?B(l)?`_blank`:null:void 0;e&&t&&B(_)&&(w(),`linkKey`in t?e.update(()=>{let e=wh(t.linkKey);GS(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{Nh(t.selection.clone())}),e.dispatchCommand(qS,i?{url:n,target:i}:n)),await T())},te=async()=>{w(),await T()},ne=async()=>{let e=B(i)?.key;e&&(r.editor?.update(()=>{let t=wh(e);GS(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await T())},re=e=>{e.isComposing||(qc(e,`Enter`)?(e.preventDefault(),B(_)&&E()):qc(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),te()))};R(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(wT,ee,2),n=e.registerCommand(Md,e=>!B(v)||B(g)||!B(i)?!1:(e?.preventDefault(),N(o,B(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=b();N(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),B(s)&&(`linkKey`in B(s)?!GS(wh(B(s).linkKey)):[B(s).selection.anchor,B(s).selection.focus].some(({key:e})=>!wh(e)?.isAttached()))&&w()}),B(o)&&B(i)?.key!==B(o)&&N(o,void 0),S()}),c=e.registerEditableListener(e=>{e||w()});return()=>{t(),n(),a(),c()}}),R(()=>{r.useRichText||(w(),N(i,void 0))}),R(()=>{B(v),S()}),R(()=>{B(g),B(m)&&(B(m).matches(`:popover-open`)||B(m).showPopover?.(),N(p,B(m).getBoundingClientRect().height,!0))}),vs(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!B(m)?.contains(t))},t=({target:t})=>{co(()=>{N(a,e(t),!0),B(g)&&!B(m)?.contains(t)&&w()})},n=({relatedTarget:e})=>{e||co(()=>{N(a,!1)})};return window.addEventListener(`scroll`,S,{capture:!0,passive:!0}),window.addEventListener(`resize`,S,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,S,{capture:!0}),window.removeEventListener(`resize`,S),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var ie=U(),ae=F(ie),oe=e=>{var t=ebe();let r;var a=P(t),o=e=>{var t=Qye(),r=F(t);{let e=j(()=>!!B(c).trim()&&!sO(B(c))),t=j(()=>X(`_sui.text_editor.url`));Gl(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{re(e)},get element(){return B(h)},set element(e){N(h,e,!0)},get value(){return B(c)},set value(e){N(c,e,!0)}})}var i=L(r,2),a=e=>{{let t=e=>{Lc(e,{name:`open_in_new`})},n=j(()=>X(`_sui.text_editor.open_in_new_tab`));ll(e,{iconic:!0,variant:`ghost`,get pressed(){return B(l)},get"aria-label"(){return B(n)},onclick:()=>{N(l,!B(l))},startIcon:t,$$slots:{startIcon:!0}})}};K(i,e=>{B(d)&&e(a)});var o=L(i,2);{let e=e=>{Lc(e,{name:`check`})},t=j(()=>!B(_)),n=j(()=>B(s)&&`linkKey`in B(s)?X(`_sui.update`):X(`_sui.insert`));ll(o,{iconic:!0,variant:`ghost`,get disabled(){return B(t)},get"aria-label"(){return B(n)},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}var u=L(o,2);{let e=e=>{Lc(e,{name:`close`})},t=j(()=>X(`_sui.cancel`));ll(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}W(e,t)},u=e=>{var t=$ye(),n=F(t),r=I(n,!0),a=L(n,2);{let e=e=>{Lc(e,{name:`edit`})},t=j(()=>X(`_sui.text_editor.edit_link`));ll(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{B(i)&&C({linkKey:B(i).key},B(i).url,B(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=L(a,2);{let e=e=>{Lc(e,{name:`link_off`})},t=j(()=>X(`_sui.text_editor.remove_link`));ll(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}z(e=>{J(n,`href`,e),G(r,B(i).url),n.dir=n.dir},[()=>sO(B(i).url)?B(i).url:void 0]),W(e,t)};K(a,e=>{B(g)?e(o):B(i)&&e(u,1)}),O(t),ms(t,e=>N(m,e),()=>B(m)),z(e=>{J(t,`aria-label`,e),r=as(t,``,r,{top:B(y).top,bottom:B(y).bottom,left:B(y).left})},[()=>X(`_sui.text_editor.link`)]),_o(`mousedown`,t,e=>{e.target===e.currentTarget&&e.preventDefault()}),W(e,t)};K(ae,e=>{B(v)&&B(y)&&e(oe)}),W(e,ie),A()}vo([`mousedown`]);var rbe=60,hO=async(e,t=0)=>e.closest(`dialog`)?.open&&t{window.requestAnimationFrame(e)}),hO(e,t+1)):new Promise(e=>{window.setTimeout(e)}),ibe=V(` `,1);function abe(e,t){k(t,!0);let n=ui(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&Cve(a);i.update(()=>{jve(e,t.cellKey,{rtl:o})}),await hO(r),await fO(i)};{let t=j(()=>X(`_sui.text_editor.table_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>r,Fo,(e,t,n)=>{var r=ibe(),a=F(r),o=e=>{ql(e,{})};K(a,e=>{n>0&&e(o)}),Ro(L(a,2),17,()=>B(t),([e,t])=>e,(e,t)=>{var n=j(()=>Pr(B(t),2));let r=()=>B(n)[0],a=()=>B(n)[1];{let t=j(()=>X(`_sui.text_editor.${a()}`));iu(e,{get label(){return B(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),W(e,r)}),W(e,n)},$$slots:{default:!0}})}A()}var obe=V(`
`),sbe={hash:`svelte-11ok6r3`,code:`.table-cell-menu-button.svelte-11ok6r3 {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-11ok6r3 {translate:0 0;}.table-cell-menu-button[hidden].svelte-11ok6r3 {display:none;}.table-cell-menu-button.svelte-11ok6r3 .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function cbe(e,t){k(t,!0),q(e,sbe);let n=ui(`editorStore`),r=M(null),i=M(!1),a=M(void 0),o=M(void 0),s=j(()=>!!B(r)&&B(i)&&!!B(a)&&n.useRichText),c=j(()=>B(a)?`top: ${B(a).top}px; left: ${B(a).left}px`:void 0),l=()=>B(o)?.parentElement,u=()=>{let e=l(),t=B(r)?n.editor?.getElementByKey(B(r)):void 0;if(!B(i)||!e||!t){N(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=Cve(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?N(a,void 0):N(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();N(i,!!e?.contains(document.activeElement)||!!B(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};R(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{N(r,e.read(oO),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),vs(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=obe();let m;var h=P(p),g=e=>{let t=j(()=>B(r));{let r=e=>{Lc(e,{name:`expand_more`})},i=e=>{abe(e,{get cellKey(){return B(t)}})},o=j(()=>B(a)?.popupPosition),s=j(()=>X(`_sui.text_editor.show_table_options`));kl(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return B(o)},get"aria-label"(){return B(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};K(h,e=>{B(s)&&B(r)&&e(g)}),O(p),ms(p,e=>N(o,e),()=>B(o)),z(()=>{m=rs(p,1,`table-cell-menu-button svelte-11ok6r3`,null,m,{rtl:B(a)?.rtl}),J(p,`hidden`,!B(s)),as(p,B(c))}),W(e,p),A()}var lbe={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},ube=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,dbe=/^[ \t]*(?:```|~~~)/,fbe=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(` `,t-1)+1,i=n>t&&e[n-1]===` `?n-1:n,a=e.indexOf(` -`,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},WD=({value:e,start:t})=>e.slice(0,t).split(` -`).length-1,GD=(e,t)=>{let n;for(let r=0;r=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},Zve=e=>{let t=e.value.split(` -`),n=WD(e),r=t[n];if(GD(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},Qve=({value:e,start:t,end:n},r)=>{let i=qve[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(` +`,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},pbe=({value:e,start:t})=>e.slice(0,t).split(` +`).length-1,mbe=(e,t)=>{let n;for(let r=0;r=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},hbe=e=>{let t=e.value.split(` +`),n=pbe(e),r=t[n];if(mbe(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},gbe=({value:e,start:t,end:n},r)=>{let i=lbe[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(` `).map(e=>e.trim()?`${i}${e}${i}`:e).join(` -`)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},KD=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(` -`),o=GD(a,WD(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(` +`)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},_be=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(` +`),o=mbe(a,pbe(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(` `).length+ +!!e,c=s+a.slice(e,n+1).join(` `).length,l=a.slice(e+1,n).join(` -`),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=KD({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=Xve(e),l=n.slice(s,c).split(` +`),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=_be({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=fbe(e),l=n.slice(s,c).split(` `);if(t===`code-block`)return{start:s,end:c,text:`\`\`\`\n${l.join(` -`)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(Jve)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(` +`)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(ube)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(` `).length+ +!!t,u=c+n.length,d=c+e.length,g=u+p+o.length-n.length,_=e=>g+Math.max(e-u,0);return r>=c&&r<=d&&(m=_(r)),i>=c&&i<=d&&(h=_(i)),p+=o.length-n.length,`${o}${a}`});return i>c&&(h=i+p),{start:s,end:c,text:g.join(` -`),selectionStart:m,selectionEnd:Math.max(m,h)}},$ve=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},qD=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(` +`),selectionStart:m,selectionEnd:Math.max(m,h)}},vbe=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},gO=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(` `)?``:a.endsWith(` `)?` @@ -2117,17 +2125,21 @@ ${l}`:l)}return o.join(` `)?` `:` -`}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},JD=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),eye=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},YD=({readOnly:e,disabled:t})=>!e&&!t,XD=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!YD(e))return;let o=await eye(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},ZD=async(e,t)=>{e&&await XD(e,t(JD(e)))},QD=(e,t,n)=>{let r=r=>{YD(e)&&Vc(r,Ic()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},tye=async(e,t)=>{let n=$_e(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await XD(e,qD(JD(e),n,{block:r}))},$D=e=>Array.isArray(e)&&e.every(E),eO=e=>[...new Set(e)],nye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),rye=B(`
`),iye={hash:`svelte-zsbmsy`,code:`.button-group.svelte-zsbmsy {flex:none;display:inline-flex;align-items:center;}`};function aye(e,t){K(e,iye);let n=J(t,`ariaLabel`,3,void 0),r=ys(t,nye);var i=rye();us(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-zsbmsy`),Po(N(i),()=>t.children??Tr),D(i),U(e,i)}function oye(e,t){O(t,!0);let n=ri(`editorStore`),r=A(()=>n.selection.alignment??``),i=A(()=>kT.find(({type:e})=>e===z(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(Fp,e),await HD(t),await LD(r))};{let t=e=>{Ac(e,{get name(){return z(i)}})},o=e=>{{let t=A(()=>Y(`_sui.text_editor.alignment_options`));ou(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var i=H();wo(P(i),()=>n.selection,e=>{var t=H();ko(P(t),17,()=>kT,e=>e.type,(e,t)=>{{let n=e=>{Ac(e,{get name(){return z(t).icon}})},i=A(()=>Y(`_sui.text_editor.${z(t).labelKey}`)),o=A(()=>z(r)===z(t).type);lu(e,{get label(){return z(i)},get checked(){return z(o)},onclick:e=>{a(z(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,t)}),U(e,i)},$$slots:{default:!0}})}},s=A(()=>Y(`_sui.text_editor.show_alignment_options`));Al(e,{get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}k()}function sye(e,t){O(t,!0);let n=ri(`editorStore`),r=A(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await LD(e),e.dispatchCommand(gp,t.type)):ZD(r,e=>Qve(e,t.type))};L(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return QD(e,r,()=>{a()})});{let i=e=>{Ac(e,{get name(){return wT[t.type].icon}})},o=A(()=>Y(`_sui.text_editor.${wT[t.type].labelKey}`));ul(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},get pressed(){return z(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}k()}function cye(e,t){O(t,!0);let n=ri(`editorStore`),{labelKey:r,icon:i}=wT[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{O_e()}),await LD(e)):await ZD(t,e=>qD(e,`***`,{block:!0}))};{let t=e=>{Ac(e,{get name(){return i}})},o=A(()=>Y(`_sui.text_editor.${r}`));ul(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}k()}var lye=({transformer:e})=>e.type===`text-match`,tO=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&tye(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();Mh(e.isInline()?[e]:[e,Yg()])})};function uye(e,t){O(t,!0);let n=ri(`editorStore`),r=A(()=>t.component.label),i=A(()=>t.component.icon);{let a=e=>{var t=H(),n=P(t),r=e=>{Ac(e,{get name(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},o=A(()=>!!z(i)),s=A(()=>z(i)?void 0:z(r));ul(e,{get iconic(){return z(o)},get label(){return z(s)},get title(){return z(r)},get"aria-label"(){return z(r)},get"aria-controls"(){return n.controlId},onclick:()=>{tO(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}k()}var dye=B(`
`),fye=B(`
`),pye=B(`
`,1),mye=B(` `,1);function hye(e,t){let n=mo();O(t,!0);let r=`link`,i=ri(`editorStore`),a=A(()=>i.selection.inlineTypes.includes(r)),o=j(!1),s=j(!1),c=j(``),l=j(``),u=j(!1),d=A(()=>i.config.format===`html`&&i.useRichText),f=A(()=>!!z(c).trim()&&AD(z(c))),p=e=>{M(c,BE(e)&&AD(e)?e:``,!0),M(s,!!e),M(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Ele().trim())});else if(e){let{value:t,start:n,end:r}=JD(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(OT,void 0)||m()},g=e=>{Vc(e,`Enter`)&&z(f)&&M(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():ZD(t,e=>$ve(e,{url:z(c).trim(),text:z(s)?void 0:z(l)}))),M(c,``),M(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=Q()??Eh()?.clone();Z(t)||(t=Ch()),z(s)||(M(l,z(l).trim(),!0),M(l,z(l)||z(c),!0),Mh([Gm(z(l))])),j_(t),e(void 0)})}),await LD(i.editor),i.editor.dispatchCommand(WS,z(d)&&z(u)?{url:z(c),target:`_blank`}:z(c))}else i.editor&&await LD(i.editor);M(c,``),M(l,``),M(u,!1)}},v=()=>i.editor?.registerCommand(yp,e=>(Vc(e,Ic()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);L(()=>{let{textArea:e}=i;if(e)return QD(e,`K`,()=>{h()})}),L(()=>{if(i.editor)return v()});var y=mye(),b=P(y);{let e=e=>{Ac(e,{get name(){return wT[r].icon}})},t=A(()=>Y(`_sui.text_editor.${wT[r].labelKey}`)),n=A(()=>z(a)&&i.useRichText);ul(b,{iconic:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},get pressed(){return z(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=I(b,2);{let e=A(()=>Y(`_sui.text_editor.insert_link`)),t=A(()=>!z(f)),r=A(()=>Y(`_sui.insert`));Fl(x,{get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{var r=pye(),i=P(r),a=N(i),o=F(a,!0),f=I(a,2);{let e=A(()=>!!z(c).trim()&&!AD(z(c))),t=A(()=>Y(`_sui.text_editor.url`));Kl(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{g(e)},get value(){return z(c)},set value(e){M(c,e,!0)}})}D(i);var p=I(i,2),m=e=>{var t=dye(),r=N(t),i=F(r,!0),a=I(r,2);{let e=A(()=>Y(`_sui.text_editor.text`));Kl(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return z(e)},onkeydown:e=>{g(e)},get value(){return z(l)},set value(e){M(l,e,!0)}})}D(t),R(e=>{q(r,`for`,`${n}-text`),W(i,e)},[()=>Y(`_sui.text_editor.text`)]),U(e,t)};G(p,e=>{z(s)||e(m)});var h=I(p,2),_=e=>{var t=fye(),n=N(t);{let e=A(()=>Y(`_sui.text_editor.open_in_new_tab`));Ml(n,{get label(){return z(e)},get checked(){return z(u)},set checked(e){M(u,e,!0)}})}D(t),U(e,t)};G(h,e=>{z(d)&&e(_)}),R(e=>{q(a,`for`,`${n}-url`),W(o,e)},[()=>Y(`_sui.text_editor.url`)]),U(e,r)},$$slots:{default:!0}})}U(e,y),k()}function gye(e,t){O(t,!0);let n=ri(`editorStore`);{let r=e=>{Ac(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{ou(e,{children:(e,r)=>{var i=H();ko(P(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=A(()=>z(t));su(e,{get label(){return z(r).label},onclick:()=>{tO(n,z(t))},startIcon:e=>{var t=H(),n=P(t),i=e=>{Ac(e,{get name(){return z(r).icon}})};G(n,e=>{z(r).icon&&e(i)}),U(e,t)},$$slots:{startIcon:!0}})}),U(e,i)},$$slots:{default:!0}})},a=A(()=>Y(`_sui.insert`));Al(e,{get label(){return z(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}k()}var _ye=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,nO=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},vye=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,rO=new Map,yye=e=>{let t=e||``,n=rO.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}rO.set(t,n)}return n},bye=(e,t)=>{let n=yye(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},iO=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},aO=e=>Number(e||0),oO=(e,t)=>typeof t==`number`&&aO(e)<=t,sO=(e,t)=>typeof t==`number`&&aO(e)>=t,xye=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?sO(e,i):oO(e,r)))return;let a=nO(t),o=Number((aO(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o{if(t&&(iO(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&aO(e)r},Cye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),wye=B(`
`),Tye=B(``),Eye=B(`
`),Dye={hash:`svelte-g2cauy`,code:`.number-input.svelte-g2cauy {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-g2cauy {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-g2cauy:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-g2cauy:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-g2cauy:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-g2cauy input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-g2cauy .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-g2cauy {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-g2cauy button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-g2cauy button .icon {font-size:16px;}.number-input.svelte-g2cauy:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-g2cauy:dir(rtl) .buttons:where(.svelte-g2cauy) {right:auto;left:2px;}.number-input.svelte-g2cauy:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function cO(e,t){let n=mo();O(t,!0),K(e,Dye);let r=J(t,`value`,15),i=J(t,`invalid`,15,!1),a=J(t,`flex`,3,!1),o=J(t,`min`,3,void 0),s=J(t,`max`,3,void 0),c=J(t,`step`,3,1),l=J(t,`fractional`,3,void 0),u=J(t,`inputmode`,3,void 0),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`required`,3,!1),h=ys(t,Cye),g=j(!1),_=j(``),v=A(()=>c()!==-1),y=A(()=>_ye(c())),b=A(()=>l()??(!z(v)||nO(z(y))>0)),x=A(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(z(v)||!e&&!t))return e&&t?Y(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?Y(`_sui.number_input.min`,{values:{min:o()}}):Y(`_sui.number_input.max`,{values:{max:s()}})}),S=A(()=>[h[`aria-describedby`],z(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=A(()=>bye(z(_),t.lang??Oc.current)),w=A(()=>oO(z(C),o())),T=A(()=>sO(z(C),s()));L(()=>{let e=r();$a(()=>{iO(z(C))!==e&&M(_,String(e??``),!0)})}),L(()=>{r(iO(z(C)))}),L(()=>{z(g)&&i(Sye(z(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=xye(z(C),{step:z(y),direction:e,min:o(),max:s()});t!==void 0&&M(_,t,!0)},te=()=>{ee(-1)},ne=()=>{ee(1)};var re=Eye();let ie;var ae=N(re),oe=e=>{var r=wye(),i=N(r);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.increaseIcon),U(e,n)},a=e=>{Ac(e,{name:`expand_less`})};G(r,e=>{t.increaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(T)),a=A(()=>Y(`_sui.number_input.increase`));ul(i,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(a)},get"aria-controls"(){return n},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}var a=I(i,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.decreaseIcon),U(e,n)},a=e=>{Ac(e,{name:`expand_more`})};G(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(w)),i=A(()=>Y(`_sui.number_input.decrease`));ul(a,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}D(r),U(e,r)},se=e=>{var t=Tye(),r=F(t,!0);R(()=>{q(t,`id`,`${n}-range`),W(r,z(x))}),U(e,t)};G(ae,e=>{z(v)?e(oe):z(x)&&e(se,1)});var ce=I(ae,2);{let e=A(()=>z(v)?`spinbutton`:`textbox`),c=A(()=>z(v)&&Number.isFinite(r())?r():void 0),l=A(()=>z(v)?o():void 0),y=A(()=>z(v)?s():void 0),x=A(()=>u()??vye({fractional:z(b),min:o()}));Kl(ce,bs({dir:`ltr`},()=>h,{get role(){return z(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return z(c)},get"aria-valuemin"(){return z(l)},get"aria-valuemax"(){return z(y)},get inputmode(){return z(x)},get"aria-describedby"(){return z(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=z(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),te()),n===`ArrowUp`&&c&&(e.preventDefault(),ne()),z(g)||M(g,!0),t.onkeydown?.(e)},oninput:e=>{z(g)||M(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return z(_)},set value(e){M(_,e,!0)}}))}D(re),R(()=>{ie=Xo(re,1,`sui number-input ${t.class??``}`,`svelte-g2cauy`,ie,{flex:a(),disabled:f(),readonly:p(),stepper:z(v)}),q(re,`hidden`,d())}),U(e,re),k()}var Oye=B(`
`),kye=B(` `,1),Aye={hash:`svelte-avqlty`,code:`.table-size.svelte-avqlty {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function jye(e,t){let n=mo();O(t,!0),K(e,Aye);let r=J(t,`disabled`,3,!1),i=ri(`editorStore`),a=j(!1),o=j(Yi(3)),s=j(Yi(3)),c=A(()=>k_e(z(o))),l=A(()=>k_e(z(s))),u=A(()=>!!z(c)&&!!z(l)),d=()=>{z(c)||M(o,3,!0),z(l)||M(s,3,!0),M(a,!0)},f=e=>{Vc(e,`Enter`)&&z(u)&&M(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{N_e(e,t)}),await LD(n))},m=async({rows:e,columns:t})=>{let n=A_e(e,t);await ZD(i.textArea,e=>{let t=qD(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&z(c)&&z(l)){let e={rows:z(c),columns:z(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await LD(i.editor):i.textArea?.focus()};var g=kye(),_=P(g);{let e=e=>{Ac(e,{get name(){return wT.table.icon}})},t=A(()=>Y(`_sui.text_editor.${wT.table.labelKey}`));ul(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=I(_,2);{let e=A(()=>Y(`_sui.text_editor.insert_table`)),t=A(()=>!z(u)),r=A(()=>Y(`_sui.insert`));Fl(v,{size:`x-small`,get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{var r=Oye(),i=N(r),a=F(i,!0),u=I(i,2);{let e=A(()=>!z(c)),t=A(()=>Y(`_sui.text_editor.rows`));cO(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(o)},set value(e){M(o,e,!0)}})}var d=I(u,2),p=F(d,!0),m=I(d,2);{let e=A(()=>!z(l)),t=A(()=>Y(`_sui.text_editor.columns`));cO(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(s)},set value(e){M(s,e,!0)}})}D(r),R((e,t)=>{q(i,`for`,`${n}-rows`),W(a,e),q(d,`for`,`${n}-columns`),W(p,t)},[()=>Y(`_sui.text_editor.rows`),()=>Y(`_sui.text_editor.columns`)]),U(e,r)},$$slots:{default:!0}})}U(e,g),k()}function Mye(e,t){O(t,!0);let n={paragraph:Yg,blockquote:VC,"code-block":mS},r={"bulleted-list":pC,"numbered-list":mC},i=ri(`editorStore`),a=A(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){ZD(i.textArea,e=>KD(e,t.type));return}if(!i.editor)return;await LD(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>KC(`h${e}`):n[t.type];a&&i.editor.update(()=>{$ue(Q(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=H();wo(P(s),()=>z(a),e=>{{let n=e=>{Ac(e,{get name(){return wT[t.type].icon}})},r=A(()=>Y(`_sui.text_editor.${wT[t.type].labelKey}`));cu(e,{get label(){return z(r)},get checked(){return z(a)},onclick:()=>{z(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,s),k()}var lO=B(` `,1),Nye=B(` `,1),uO=B(` `,1);function Pye(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1),i=ri(`editorStore`),a=A(()=>eO([`paragraph`,...i.config.enabledButtons.filter(e=>DT.includes(e))])),o=A(()=>i.config.format===`html`),s=A(()=>i.useRichText||!z(o)),c=A(()=>i.config.enabledButtons.includes(`table`)),l=A(()=>z(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=A(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=A(()=>i.useRichText?i.selection.tableCellKey??null:null),f=A(()=>!!z(d)&&!z(o)),p=A(()=>z(f)?i.config.components.filter(lye):i.config.components),m=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=A(()=>z(c)||!z(f)&&z(u)||z(p).length>0),_=A(()=>z(s)&&!z(f)),v=A(()=>eO(i.config.enabledButtons.filter(e=>ET.includes(e))));{let t=A(()=>n()||r()||i.componentHasFocus),p=A(()=>Y(`_sui.text_editor.text_editor`));wve(e,{get disabled(){return z(t)},get ariaLabel(){return z(p)},children:(e,t)=>{var n=uO(),r=P(n),p=e=>{{let t=e=>{{let t=A(()=>wT[i.selection.blockType]?.icon??`format_paragraph`);Ac(e,{get name(){return z(t)}})}},n=e=>{{let t=A(()=>Y(`_sui.text_editor.text_style_options`));ou(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();ko(P(n),16,()=>z(a),e=>e,(e,t)=>{Mye(e,{get type(){return t}})}),U(e,n)},$$slots:{default:!0}})}},r=A(()=>Y(`_sui.text_editor.show_text_style_options`));Al(e,{get"aria-label"(){return z(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};G(r,e=>{z(_)&&z(a).length>1&&e(p)});var y=I(r,2),b=e=>{var t=lO(),n=P(t);Jl(n,{orientation:`vertical`}),_ve(I(n,2),{}),U(e,t)},x=e=>{var t=uO(),n=P(t),r=e=>{var t=lO(),n=P(t),r=e=>{Jl(e,{orientation:`vertical`})};G(n,e=>{z(_)&&z(a).length>1&&e(r)});var o=I(n,2);{let e=e=>{Ac(e,{name:`table_edit`})},t=e=>{UD(e,{get cellKey(){return z(d)}})},n=A(()=>Y(`_sui.text_editor.show_table_options`));Al(o,{get"aria-label"(){return z(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}U(e,t)};G(n,e=>{z(c)&&z(d)&&e(r)});var o=I(n,2),s=e=>{var t=lO(),n=P(t);Jl(n,{orientation:`vertical`}),aye(I(n,2),{children:(e,t)=>{var n=H();ko(P(n),16,()=>z(v),e=>e,(e,t)=>{var n=H(),r=P(n),i=e=>{hye(e,{})},a=e=>{sye(e,{get type(){return t}})};G(r,e=>{t===`link`?e(i):e(a,-1)}),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(o,e=>{z(v).length&&e(s)});var p=I(o,2),y=e=>{var t=lO(),n=P(t);Jl(n,{orientation:`vertical`}),oye(I(n,2),{}),U(e,t)};G(p,e=>{z(l)&&e(y)});var b=I(p,2),x=e=>{var t=Nye(),n=P(t);Jl(n,{orientation:`vertical`});var r=I(n,2),i=e=>{{let t=A(()=>!!z(d));jye(e,{get disabled(){return z(t)}})}};G(r,e=>{z(c)&&e(i)});var a=I(r,2),o=e=>{cye(e,{})};G(a,e=>{z(u)&&!z(f)&&e(o)});var s=I(a,2);ko(s,17,()=>z(m),e=>e.id,(e,t)=>{uye(e,{get component(){return z(t)}})});var l=I(s,2),p=e=>{gye(e,{get components(){return z(h)}})};G(l,e=>{z(h).length&&e(p)}),U(e,t)};G(b,e=>{z(g)&&e(x)}),U(e,t)};G(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):z(s)&&e(x,1)});var S=I(y,2);Nl(S,{flex:!0});var C=I(S,2),w=e=>{{let t=e=>{{let t=A(()=>z(o)?`html`:`markdown`);Ac(e,{get name(){return z(t)}})}},n=A(()=>!i.useRichText),r=A(()=>Y(`_sui.text_editor.${z(o)?`edit_in_html`:`edit_in_markdown`}`));ul(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};G(C,e=>{i.config.modes.length>1&&e(w)}),U(e,n)},$$slots:{default:!0}})}k()}var Fye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`pending`,`format`,`flex`,`dir`,`modes`,`buttons`,`components`,`useMarkdownShortcuts`,`useEmojiAutocomplete`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),Iye=B(`
`,1),Lye={hash:`svelte-1pvwc2y`,code:`.text-editor.svelte-1pvwc2y {position:relative;margin:var(--sui-focus-ring-width);border-radius:var(--sui-textbox-border-radius);width:calc(100% - var(--sui-focus-ring-width) * 2);transition:all 200ms;}.text-editor.svelte-1pvwc2y:focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.text-editor.flex.svelte-1pvwc2y:not([hidden]) {display:block;}.text-editor.svelte-1pvwc2y .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-1pvwc2y .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;}.text-editor.svelte-1pvwc2y {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-1pvwc2y > * {--sui-text-editor-inner-toolbar-top: calc( +`}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},_O=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),ybe=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},bbe=({readOnly:e,disabled:t})=>!e&&!t,xbe=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!bbe(e))return;let o=await ybe(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},vO=async(e,t)=>{e&&await xbe(e,t(_O(e)))},Sbe=(e,t,n)=>{let r=r=>{bbe(e)&&qc(r,Uc()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},Cbe=async(e,t)=>{let n=$ve(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await xbe(e,gO(_O(e),n,{block:r}))},yO=/[ \t]*(?:\r?\n[ \t]*)+/g,wbe=({value:e,caret:t})=>{let n=e.slice(0,t).replace(yO,` `);return{value:n+e.slice(t).replace(yO,` `),caret:n.length}},Tbe=e=>{let t=e=>{let{inputType:t}=e;if(t===`insertLineBreak`||t===`insertParagraph`){e.preventDefault();return}let n=e.data||e.dataTransfer?.getData(`text/plain`)||``;(t===`insertFromPaste`||t===`insertReplacementText`)&&n.includes(` +`)&&typeof document.execCommand==`function`&&(e.preventDefault(),document.execCommand(`insertText`,!1,n.replace(yO,` `)))},n=()=>{let{value:t,selectionStart:n}=e;if(!t.includes(` +`))return;let r=wbe({value:t,caret:n});e.value=r.value,e.setSelectionRange(r.caret,r.caret)};return e.addEventListener(`beforeinput`,t),e.addEventListener(`input`,n,{capture:!0}),()=>{e.removeEventListener(`beforeinput`,t),e.removeEventListener(`input`,n,{capture:!0})}},Ebe=e=>Array.isArray(e)&&e.every(D),bO=e=>[...new Set(e)],Dbe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),Obe=V(`
`),kbe={hash:`svelte-dhf2js`,code:`.button-group.svelte-dhf2js {flex:none;display:inline-flex;align-items:center;}`};function Abe(e,t){q(e,kbe);let n=Y(t,`ariaLabel`,3,void 0),r=gs(t,Dbe);var i=Obe();us(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-dhf2js`),Uo(P(i),()=>t.children??jr),O(i),W(e,i)}function jbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>n.selection.alignment??``),i=j(()=>TT.find(({type:e})=>e===B(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(zd,e),await hO(t),await fO(r))};{let t=e=>{Lc(e,{get name(){return B(i)}})},o=e=>{{let t=j(()=>X(`_sui.text_editor.alignment_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var i=U();No(F(i),()=>n.selection,e=>{var t=U();Ro(F(t),17,()=>TT,e=>e.type,(e,t)=>{{let n=e=>{Lc(e,{get name(){return B(t).icon}})},i=j(()=>X(`_sui.text_editor.${B(t).labelKey}`)),o=j(()=>B(r)===B(t).type);su(e,{get label(){return B(i)},get checked(){return B(o)},onclick:e=>{a(B(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,t)}),W(e,i)},$$slots:{default:!0}})}},s=j(()=>X(`_sui.text_editor.show_alignment_options`));kl(e,{get"aria-label"(){return B(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}A()}function Mbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await fO(e),e.dispatchCommand(yd,t.type)):vO(r,e=>gbe(e,t.type))};R(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return Sbe(e,r,()=>{a()})});{let i=e=>{Lc(e,{get name(){return bT[t.type].icon}})},o=j(()=>X(`_sui.text_editor.${bT[t.type].labelKey}`));ll(e,{iconic:!0,get"aria-label"(){return B(o)},get"aria-controls"(){return n.controlId},get pressed(){return B(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}A()}function Nbe(e,t){k(t,!0);let n=ui(`editorStore`),{labelKey:r,icon:i}=bT[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{bve()}),await fO(e)):await vO(t,e=>gO(e,`***`,{block:!0}))};{let t=e=>{Lc(e,{get name(){return i}})},o=j(()=>X(`_sui.text_editor.${r}`));ll(e,{iconic:!0,get"aria-label"(){return B(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}A()}var Pbe=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&Cbe(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();Py(e.isInline()?[e]:[e,Qm()])})};function Fbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>t.component.label),i=j(()=>t.component.icon);{let a=e=>{var t=U(),n=F(t),r=e=>{Lc(e,{get name(){return B(i)}})};K(n,e=>{B(i)&&e(r)}),W(e,t)},o=j(()=>!!B(i)),s=j(()=>B(i)?void 0:B(r));ll(e,{get iconic(){return B(o)},get label(){return B(s)},get title(){return B(r)},get"aria-label"(){return B(r)},get"aria-controls"(){return n.controlId},onclick:()=>{Pbe(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}A()}var Ibe=V(`
`),Lbe=V(`
`),Rbe=V(`
`,1),zbe=V(` `,1);function Bbe(e,t){let n=Co();k(t,!0);let r=`link`,i=ui(`editorStore`),a=j(()=>i.selection.inlineTypes.includes(r)),o=M(!1),s=M(!1),c=M(``),l=M(``),u=M(!1),d=j(()=>i.config.format===`html`&&i.useRichText),f=j(()=>!!B(c).trim()&&sO(B(c))),p=e=>{N(c,QE(e)&&sO(e)?e:``,!0),N(s,!!e),N(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Uue().trim())});else if(e){let{value:t,start:n,end:r}=_O(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(wT,void 0)||m()},g=e=>{qc(e,`Enter`)&&B(f)&&N(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():vO(t,e=>vbe(e,{url:B(c).trim(),text:B(s)?void 0:B(l)}))),N(c,``),N(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=$()??Dy()?.clone();Q(t)||(t=Sy()),B(s)||(N(l,B(l).trim(),!0),N(l,B(l)||B(c),!0),Py([Pm(B(l))])),Nh(t),e(void 0)})}),await fO(i.editor),i.editor.dispatchCommand(qS,B(d)&&B(u)?{url:B(c),target:`_blank`}:B(c))}else i.editor&&await fO(i.editor);N(c,``),N(l,``),N(u,!1)}},v=()=>i.editor?.registerCommand(Sd,e=>(qc(e,Uc()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);R(()=>{let{textArea:e}=i;if(e)return Sbe(e,`K`,()=>{h()})}),R(()=>{if(i.editor)return v()});var y=zbe(),b=F(y);{let e=e=>{Lc(e,{get name(){return bT[r].icon}})},t=j(()=>X(`_sui.text_editor.${bT[r].labelKey}`)),n=j(()=>B(a)&&i.useRichText);ll(b,{iconic:!0,get"aria-label"(){return B(t)},get"aria-controls"(){return i.controlId},get pressed(){return B(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=L(b,2);{let e=j(()=>X(`_sui.text_editor.insert_link`)),t=j(()=>!B(f)),r=j(()=>X(`_sui.insert`));Pl(x,{get title(){return B(e)},get okDisabled(){return B(t)},get okLabel(){return B(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return B(o)},set open(e){N(o,e,!0)},children:(e,t)=>{var r=Rbe(),i=F(r),a=P(i),o=I(a,!0),f=L(a,2);{let e=j(()=>!!B(c).trim()&&!sO(B(c))),t=j(()=>X(`_sui.text_editor.url`));Gl(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{g(e)},get value(){return B(c)},set value(e){N(c,e,!0)}})}O(i);var p=L(i,2),m=e=>{var t=Ibe(),r=P(t),i=I(r,!0),a=L(r,2);{let e=j(()=>X(`_sui.text_editor.text`));Gl(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return B(e)},onkeydown:e=>{g(e)},get value(){return B(l)},set value(e){N(l,e,!0)}})}O(t),z(e=>{J(r,`for`,`${n}-text`),G(i,e)},[()=>X(`_sui.text_editor.text`)]),W(e,t)};K(p,e=>{B(s)||e(m)});var h=L(p,2),_=e=>{var t=Lbe(),n=P(t);{let e=j(()=>X(`_sui.text_editor.open_in_new_tab`));jl(n,{get label(){return B(e)},get checked(){return B(u)},set checked(e){N(u,e,!0)}})}O(t),W(e,t)};K(h,e=>{B(d)&&e(_)}),z(e=>{J(a,`for`,`${n}-url`),G(o,e)},[()=>X(`_sui.text_editor.url`)]),W(e,r)},$$slots:{default:!0}})}W(e,y),A()}function Vbe(e,t){k(t,!0);let n=ui(`editorStore`);{let r=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{ru(e,{children:(e,r)=>{var i=U();Ro(F(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=j(()=>B(t));iu(e,{get label(){return B(r).label},onclick:()=>{Pbe(n,B(t))},startIcon:e=>{var t=U(),n=F(t),i=e=>{Lc(e,{get name(){return B(r).icon}})};K(n,e=>{B(r).icon&&e(i)}),W(e,t)},$$slots:{startIcon:!0}})}),W(e,i)},$$slots:{default:!0}})},a=j(()=>X(`_sui.insert`));kl(e,{get label(){return B(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}A()}var Hbe=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,Ube=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},Wbe=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,Gbe=new Map,Kbe=e=>{let t=e||``,n=Gbe.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}Gbe.set(t,n)}return n},qbe=(e,t)=>{let n=Kbe(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},xO=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},SO=e=>Number(e||0),Jbe=(e,t)=>typeof t==`number`&&SO(e)<=t,Ybe=(e,t)=>typeof t==`number`&&SO(e)>=t,Xbe=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?Ybe(e,i):Jbe(e,r)))return;let a=Ube(t),o=Number((SO(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o{if(t&&(xO(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&SO(e)r},Qbe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),$be=V(`
`),exe=V(``),txe=V(`
`),nxe={hash:`svelte-9rabgg`,code:`.number-input.svelte-9rabgg {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-9rabgg {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-9rabgg:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-9rabgg:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-9rabgg:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-9rabgg input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-9rabgg .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-9rabgg {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-9rabgg button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-9rabgg button .icon {font-size:16px;}.number-input.svelte-9rabgg:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-9rabgg:dir(rtl) .buttons:where(.svelte-9rabgg) {right:auto;left:2px;}.number-input.svelte-9rabgg:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function CO(e,t){let n=Co();k(t,!0),q(e,nxe);let r=Y(t,`value`,15),i=Y(t,`invalid`,15,!1),a=Y(t,`flex`,3,!1),o=Y(t,`min`,3,void 0),s=Y(t,`max`,3,void 0),c=Y(t,`step`,3,1),l=Y(t,`fractional`,3,void 0),u=Y(t,`inputmode`,3,void 0),d=Y(t,`hidden`,3,!1),f=Y(t,`disabled`,3,!1),p=Y(t,`readonly`,3,!1),m=Y(t,`required`,3,!1),h=gs(t,Qbe),g=M(!1),_=M(``),v=j(()=>c()!==-1),y=j(()=>Hbe(c())),b=j(()=>l()??(!B(v)||Ube(B(y))>0)),x=j(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(B(v)||!e&&!t))return e&&t?X(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?X(`_sui.number_input.min`,{values:{min:o()}}):X(`_sui.number_input.max`,{values:{max:s()}})}),S=j(()=>[h[`aria-describedby`],B(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=j(()=>qbe(B(_),t.lang??Fc.current)),w=j(()=>Jbe(B(C),o())),T=j(()=>Ybe(B(C),s()));R(()=>{let e=r();co(()=>{xO(B(C))!==e&&N(_,String(e??``),!0)})}),R(()=>{r(xO(B(C)))}),R(()=>{B(g)&&i(Zbe(B(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=Xbe(B(C),{step:B(y),direction:e,min:o(),max:s()});t!==void 0&&N(_,t,!0)},E=()=>{ee(-1)},te=()=>{ee(1)};var ne=txe();let re;var ie=P(ne),ae=e=>{var r=$be(),i=P(r);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.increaseIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_less`})};K(r,e=>{t.increaseIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>f()||p()||Number.isNaN(Number(B(C)))||B(T)),a=j(()=>X(`_sui.number_input.increase`));ll(i,{iconic:!0,get disabled(){return B(r)},get"aria-label"(){return B(a)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var a=L(i,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.decreaseIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_more`})};K(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>f()||p()||Number.isNaN(Number(B(C)))||B(w)),i=j(()=>X(`_sui.number_input.decrease`));ll(a,{iconic:!0,get disabled(){return B(r)},get"aria-label"(){return B(i)},get"aria-controls"(){return n},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}O(r),W(e,r)},oe=e=>{var t=exe(),r=I(t,!0);z(()=>{J(t,`id`,`${n}-range`),G(r,B(x))}),W(e,t)};K(ie,e=>{B(v)?e(ae):B(x)&&e(oe,1)});var se=L(ie,2);{let e=j(()=>B(v)?`spinbutton`:`textbox`),c=j(()=>B(v)&&Number.isFinite(r())?r():void 0),l=j(()=>B(v)?o():void 0),y=j(()=>B(v)?s():void 0),x=j(()=>u()??Wbe({fractional:B(b),min:o()}));Gl(se,_s({dir:`ltr`},()=>h,{get role(){return B(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return B(c)},get"aria-valuemin"(){return B(l)},get"aria-valuemax"(){return B(y)},get inputmode(){return B(x)},get"aria-describedby"(){return B(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=B(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),E()),n===`ArrowUp`&&c&&(e.preventDefault(),te()),B(g)||N(g,!0),t.onkeydown?.(e)},oninput:e=>{B(g)||N(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return B(_)},set value(e){N(_,e,!0)}}))}O(ne),z(()=>{re=rs(ne,1,`sui number-input ${t.class??``}`,`svelte-9rabgg`,re,{flex:a(),disabled:f(),readonly:p(),stepper:B(v)}),J(ne,`hidden`,d())}),W(e,ne),A()}var rxe=V(`
`),ixe=V(` `,1),axe={hash:`svelte-17ruwh8`,code:`.table-size.svelte-17ruwh8 {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function oxe(e,t){let n=Co();k(t,!0),q(e,axe);let r=Y(t,`disabled`,3,!1),i=ui(`editorStore`),a=M(!1),o=M(na(3)),s=M(na(3)),c=j(()=>xve(B(o))),l=j(()=>xve(B(s))),u=j(()=>!!B(c)&&!!B(l)),d=()=>{B(c)||N(o,3,!0),B(l)||N(s,3,!0),N(a,!0)},f=e=>{qc(e,`Enter`)&&B(u)&&N(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{Tve(e,t)}),await fO(n))},m=async({rows:e,columns:t})=>{let n=Sve(e,t);await vO(i.textArea,e=>{let t=gO(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&B(c)&&B(l)){let e={rows:B(c),columns:B(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await fO(i.editor):i.textArea?.focus()};var g=ixe(),_=F(g);{let e=e=>{Lc(e,{get name(){return bT.table.icon}})},t=j(()=>X(`_sui.text_editor.${bT.table.labelKey}`));ll(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return B(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=L(_,2);{let e=j(()=>X(`_sui.text_editor.insert_table`)),t=j(()=>!B(u)),r=j(()=>X(`_sui.insert`));Pl(v,{size:`x-small`,get title(){return B(e)},get okDisabled(){return B(t)},get okLabel(){return B(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return B(a)},set open(e){N(a,e,!0)},children:(e,t)=>{var r=rxe(),i=P(r),a=I(i,!0),u=L(i,2);{let e=j(()=>!B(c)),t=j(()=>X(`_sui.text_editor.rows`));CO(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{f(e)},get value(){return B(o)},set value(e){N(o,e,!0)}})}var d=L(u,2),p=I(d,!0),m=L(d,2);{let e=j(()=>!B(l)),t=j(()=>X(`_sui.text_editor.columns`));CO(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{f(e)},get value(){return B(s)},set value(e){N(s,e,!0)}})}O(r),z((e,t)=>{J(i,`for`,`${n}-rows`),G(a,e),J(d,`for`,`${n}-columns`),G(p,t)},[()=>X(`_sui.text_editor.rows`),()=>X(`_sui.text_editor.columns`)]),W(e,r)},$$slots:{default:!0}})}W(e,g),A()}function sxe(e,t){k(t,!0);let n={paragraph:Qm,blockquote:HC,"code-block":gS},r={"bulleted-list":vC,"numbered-list":yC},i=ui(`editorStore`),a=j(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){vO(i.textArea,e=>_be(e,t.type));return}if(!i.editor)return;await fO(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>KC(`h${e}`):n[t.type];a&&i.editor.update(()=>{Sde($(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=U();No(F(s),()=>B(a),e=>{{let n=e=>{Lc(e,{get name(){return bT[t.type].icon}})},r=j(()=>X(`_sui.text_editor.${bT[t.type].labelKey}`));ou(e,{get label(){return B(r)},get checked(){return B(a)},onclick:()=>{B(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,s),A()}var wO=V(` `,1),cxe=V(` `,1),lxe=V(` `,1);function uxe(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=Y(t,`readonly`,3,!1),i=ui(`editorStore`),a=j(()=>bO([`paragraph`,...i.config.enabledButtons.filter(e=>CT.includes(e))])),o=j(()=>i.config.format===`html`),s=j(()=>i.useRichText||!B(o)),c=j(()=>i.config.enabledButtons.includes(`table`)),l=j(()=>B(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=j(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=j(()=>i.useRichText?i.selection.tableCellKey??null:null),f=j(()=>!!B(d)&&!B(o)),p=j(()=>B(f)?i.config.components.filter(tye):i.config.components),m=j(()=>B(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=j(()=>B(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=j(()=>B(c)||!B(f)&&B(u)||B(p).length>0),_=j(()=>B(s)&&!B(f)),v=j(()=>bO(i.config.enabledButtons.filter(e=>ST.includes(e))));{let t=j(()=>n()||r()||i.componentHasFocus),p=j(()=>X(`_sui.text_editor.text_editor`));zye(e,{get disabled(){return B(t)},get ariaLabel(){return B(p)},children:(e,t)=>{var n=lxe(),r=F(n),p=e=>{{let t=e=>{{let t=j(()=>bT[i.selection.blockType]?.icon??`format_paragraph`);Lc(e,{get name(){return B(t)}})}},n=e=>{{let t=j(()=>X(`_sui.text_editor.text_style_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),16,()=>B(a),e=>e,(e,t)=>{sxe(e,{get type(){return t}})}),W(e,n)},$$slots:{default:!0}})}},r=j(()=>X(`_sui.text_editor.show_text_style_options`));kl(e,{get"aria-label"(){return B(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};K(r,e=>{B(_)&&B(a).length>1&&e(p)});var y=L(r,2),b=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),Mye(L(n,2),{}),W(e,t)},x=e=>{var t=lxe(),n=F(t),r=e=>{var t=wO(),n=F(t),r=e=>{ql(e,{orientation:`vertical`})};K(n,e=>{B(_)&&B(a).length>1&&e(r)});var o=L(n,2);{let e=e=>{Lc(e,{name:`table_edit`})},t=e=>{abe(e,{get cellKey(){return B(d)}})},n=j(()=>X(`_sui.text_editor.show_table_options`));kl(o,{get"aria-label"(){return B(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}W(e,t)};K(n,e=>{B(c)&&B(d)&&e(r)});var o=L(n,2),s=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),Abe(L(n,2),{children:(e,t)=>{var n=U();Ro(F(n),16,()=>B(v),e=>e,(e,t)=>{var n=U(),r=F(n),i=e=>{Bbe(e,{})},a=e=>{Mbe(e,{get type(){return t}})};K(r,e=>{t===`link`?e(i):e(a,-1)}),W(e,n)}),W(e,n)},$$slots:{default:!0}}),W(e,t)};K(o,e=>{B(v).length&&e(s)});var p=L(o,2),y=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),jbe(L(n,2),{}),W(e,t)};K(p,e=>{B(l)&&e(y)});var b=L(p,2),x=e=>{var t=cxe(),n=F(t);ql(n,{orientation:`vertical`});var r=L(n,2),i=e=>{{let t=j(()=>!!B(d));oxe(e,{get disabled(){return B(t)}})}};K(r,e=>{B(c)&&e(i)});var a=L(r,2),o=e=>{Nbe(e,{})};K(a,e=>{B(u)&&!B(f)&&e(o)});var s=L(a,2);Ro(s,17,()=>B(m),e=>e.id,(e,t)=>{Fbe(e,{get component(){return B(t)}})});var l=L(s,2),p=e=>{Vbe(e,{get components(){return B(h)}})};K(l,e=>{B(h).length&&e(p)}),W(e,t)};K(b,e=>{B(g)&&e(x)}),W(e,t)};K(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):B(s)&&e(x,1)});var S=L(y,2);Ml(S,{flex:!0});var C=L(S,2),w=e=>{{let t=e=>{{let t=j(()=>B(o)?`html`:`markdown`);Lc(e,{get name(){return B(t)}})}},n=j(()=>!i.useRichText),r=j(()=>X(`_sui.text_editor.${B(o)?`edit_in_html`:`edit_in_markdown`}`));ll(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return B(n)},get"aria-label"(){return B(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};K(C,e=>{i.config.modes.length>1&&e(w)}),W(e,n)},$$slots:{default:!0}})}A()}var dxe=new Set(`$$slots.$$events.$$legacy.value.pending.format.flex.dir.modes.buttons.components.multiline.minimal.useMarkdownShortcuts.useEmojiAutocomplete.hidden.disabled.readonly.required.invalid.ariaLabel.ariaLabelledby.ariaDescribedby.aria-label.aria-labelledby.aria-describedby.children`.split(`.`)),fxe=V(`
`,1),pxe={hash:`svelte-lbovw0`,code:`.text-editor.svelte-lbovw0 {position:relative;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.text-editor.flex.svelte-lbovw0:not([hidden]) {display:block;}.text-editor.svelte-lbovw0:is(.single-line:where(.svelte-lbovw0), .minimal:where(.svelte-lbovw0)) > .lexical-root, .text-editor.svelte-lbovw0:is(.single-line:where(.svelte-lbovw0), .minimal:where(.svelte-lbovw0)) > .text-area > :is(textarea, .clone) {min-height:0;}.text-editor.minimal.svelte-lbovw0 > .lexical-root, +.text-editor.minimal.svelte-lbovw0 > .text-area > :is(textarea, .clone) {max-height:240px;}.text-editor.minimal.svelte-lbovw0 > .lexical-root, +.text-editor.minimal.svelte-lbovw0 > .text-area > textarea {overflow:auto;}.text-editor.minimal.svelte-lbovw0 > .lexical-root {--sui-text-editor-inner-toolbar-top: 0px;}.text-editor.minimal.svelte-lbovw0 > .text-area > :is(textarea, .clone) {scrollbar-gutter:stable;}.text-editor.svelte-lbovw0 .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-lbovw0 .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.text-editor.svelte-lbovw0 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-lbovw0 > * {--sui-text-editor-inner-toolbar-top: calc( var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height) - );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function Rye(e,t){O(t,!0),K(e,Lye);let n=J(t,`value`,15,``),r=J(t,`pending`,15,!1),i=J(t,`format`,3,`markdown`),a=J(t,`flex`,3,!1),o=J(t,`dir`,3,void 0),s=J(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=J(t,`buttons`,19,()=>[...ET,...DT]),l=J(t,`components`,19,()=>[]),u=J(t,`useMarkdownShortcuts`,3,!0),d=J(t,`useEmojiAutocomplete`,3,!0),f=J(t,`hidden`,3,!1),p=J(t,`disabled`,3,!1),m=J(t,`readonly`,3,!1),h=J(t,`required`,3,!1),g=J(t,`invalid`,3,!1),_=J(t,`ariaLabel`,3,void 0),v=J(t,`ariaLabelledby`,3,void 0),y=J(t,`ariaDescribedby`,3,void 0),b=J(t,`aria-label`,3,void 0),x=J(t,`aria-labelledby`,3,void 0),S=J(t,`aria-describedby`,3,void 0),C=ys(t,Fye),w=A(()=>({"aria-label":_()??b(),"aria-labelledby":v()??x(),"aria-describedby":y()??S()})),T=zD();T.config={...T.config,modes:s(),enabledButtons:c(),components:l(),useMarkdownShortcuts:u(),useEmojiAutocomplete:d(),format:i()},ii(`editorStore`,T);let ee=i()===`html`?`html`:`markdown`,te=2e4,ne=j(Yi(qE())),re=j(0),ie=A(()=>!T.useRichText&&!f()),ae=A(()=>o()===`auto`&&T.useRichText?void 0:o()),oe=A(()=>!z(ie)||ee!==`markdown`||T.inputValue.length>te?``:[...new Set([...T.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),se=e=>{if(z(re),!(!z(ie)||e.length>te))return nge(e,ee,{theme:z(ne)})};L(()=>Rhe(async()=>{let e=qE();z(ie)&&await PD(ee),e===qE()&&M(ne,e,!0)})),L(()=>{if(!z(ie))return;let e=z(oe)?z(oe).split(`,`):[];z(ne),$a(()=>{PD(ee).then(async()=>{M(re,z(re)+1),await Promise.all(e.map(e=>PD(e))),M(re,z(re)+1)})})}),L(()=>{let{textArea:e,useRichText:t}=T;if(!e||t)return;let n=()=>{T.selection={blockNodeKey:null,blockType:document.activeElement===e?Zve(JD(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return $a(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),L(()=>{r(T.pending)}),L(()=>()=>{r(!1)}),L(()=>{if(!T.initialized)return;let e=n();$a(()=>{T.inputValue=e})}),L(()=>{if(!T.initialized)return;let e=T.inputValue;$a(()=>{n()!==e&&n(e)})});var ce=Iye(),le=P(ce);us(le,()=>({...C,role:`none`,class:`sui text-editor`,hidden:f(),[is]:{flex:a()},[as]:{"--sui-text-editor-toolbar-height":`${T.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1pvwc2y`);var ue=N(le);Pye(ue,{get disabled(){return p()},get readonly(){return m()}});var de=I(ue,2);{let e=A(()=>!T.useRichText||f());RD(de,bs(()=>z(w),{get dir(){return o()},get hidden(){return z(e)},get disabled(){return p()},get readonly(){return m()},get required(){return h()},get invalid(){return g()}}))}var fe=I(de,2);{let e=A(()=>T.useRichText||f());VD(fe,bs(()=>z(w),{get id(){return`${T.editorId??``}-plain-text`},autoResize:!0,get useEmojiAutocomplete(){return d()},highlight:se,get flex(){return a()},get dir(){return z(ae)},get hidden(){return z(e)},get disabled(){return p()},get readonly(){return m()},get required(){return h()},get invalid(){return g()},get element(){return T.textArea},set element(e){T.textArea=e},get value(){return T.inputValue},set value(e){T.inputValue=e}}))}var pe=I(fe,2),me=e=>{Ive(e,{})};G(pe,e=>{T.config.useEmojiAutocomplete&&!p()&&!m()&&e(me)});var he=I(pe,2),ge=e=>{Vve(e,{})},_e=A(()=>T.config.enabledButtons.includes(`link`)&&!p()&&!m());G(he,e=>{z(_e)&&e(ge)});var ve=I(he,2),ye=e=>{Kve(e,{})},be=A(()=>T.config.enabledButtons.includes(`table`)&&!p()&&!m());G(ve,e=>{z(be)&&e(ye)}),D(le);var xe=I(le,2),Se=e=>{ku(e,{get show(){return T.showConverterError},set show(e){T.showConverterError=e},children:(e,t)=>{Pc(e,{status:`error`,children:(e,t)=>{Kr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(xe,e=>{T.showConverterError&&e(Se)}),U(e,ce),k()}var zye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),Bye=B(``),Vye={hash:`svelte-dnys5w`,code:`.color-input.svelte-dnys5w {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-dnys5w:is(:where(.svelte-dnys5w):hover, :where(.svelte-dnys5w):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-dnys5w:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-dnys5w {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-dnys5w {border-color:var(--sui-error-border-color);}.color-input.svelte-dnys5w::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-dnys5w::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-dnys5w::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function Hye(e,t){O(t,!0),K(e,Vye);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=J(t,`ariaLabel`,3,void 0),l=ys(t,zye),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=Bye();us(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-dnys5w`,!0),_s(f,e=>r(e),()=>r()),U(e,f),k()}var Uye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),Wye=B(``),Gye={hash:`svelte-1gi6blb`,code:`.date-time-input.svelte-1gi6blb {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-transform:var(--sui-date-time-input-text-transform, uppercase);letter-spacing:var(--sui-textbox-letter-spacing, normal);font-variant-numeric:tabular-nums;transition:all 200ms;}.date-time-input.svelte-1gi6blb:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input.svelte-1gi6blb:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-1gi6blb:is(:where(.svelte-1gi6blb):disabled, :where(.svelte-1gi6blb):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input[aria-invalid=true].svelte-1gi6blb {border-color:var(--sui-error-border-color);}.date-time-input.svelte-1gi6blb::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-1gi6blb:is(:where(.svelte-1gi6blb):disabled, :where(.svelte-1gi6blb):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function Kye(e,t){O(t,!0),K(e,Gye);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`type`,3,`date`),a=J(t,`min`,3,void 0),o=J(t,`max`,3,void 0),s=J(t,`step`,3,void 0),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=ys(t,Uye),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=Wye();us(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-1gi6blb`,!0),_s(h,e=>r(e),()=>r()),U(e,h),k()}var qye=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),Jye=B(`
`),Yye={hash:`svelte-18xfqn2`,code:`.password-input.svelte-18xfqn2, -.secret-input.svelte-18xfqn2 {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-18xfqn2:not([hidden]), -.secret-input.flex.svelte-18xfqn2:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-18xfqn2 .text-input, -.secret-input.svelte-18xfqn2 .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-18xfqn2 input, -.secret-input.svelte-18xfqn2 input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-18xfqn2 button, -.secret-input.svelte-18xfqn2 button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-18xfqn2 button:last-child, -.secret-input.svelte-18xfqn2 button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-18xfqn2 button .icon, -.secret-input.svelte-18xfqn2 button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-18xfqn2 input {-webkit-text-security:none;}.secret-input.svelte-18xfqn2 input {-webkit-text-security:disc;}.password-input.svelte-18xfqn2:dir(rtl), -.secret-input.svelte-18xfqn2:dir(rtl) {--sui-textbox-text-align: right;}`};function Xye(e,t){let n=mo();O(t,!0),K(e,Yye);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`monospace`,3,!0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=ys(t,qye),f=j(void 0),p=j(!1),m=A(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});L(()=>{t.mask===`type`&&z(f)?.setAttribute(`type`,z(p)?`text`:`password`)});var h=Jye();let g;var _=N(h);Kl(_,bs({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get element(){return z(f)},set element(e){M(f,e,!0)},get value(){return r()},set value(e){r(e)}}));var v=I(_,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Po(P(n),()=>t.visibilityIcon),U(e,n)},a=e=>{{let t=A(()=>z(p)?`visibility_off`:`visibility`);Ac(e,{get name(){return z(t)}})}};G(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>s()||c()),i=A(()=>Y(z(p)?z(m).hide:z(m).show));ul(v,{iconic:!0,get disabled(){return z(r)},get pressed(){return z(p)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{M(p,!z(p))},startIcon:e,$$slots:{startIcon:!0}})}D(h),R(()=>{g=Xo(h,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-18xfqn2`,g,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&z(p)}),q(h,`hidden`,o())}),U(e,h),k()}var Zye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function dO(e,t){O(t,!0);let n=J(t,`value`,15),r=ys(t,Zye);Xye(e,bs(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),k()}var Qye=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),$ye=B(``),ebe=B(``),tbe=B(`
`),nbe=B(`
`),rbe={hash:`svelte-fhtxf0`,code:`[role=treeitem].svelte-fhtxf0 {display:block;}[role=treeitem][hidden].svelte-fhtxf0 {display:none;}[role=treeitem].svelte-fhtxf0:focus-visible {outline-color:transparent;}[role=treeitem].svelte-fhtxf0:focus-visible > .row:where(.svelte-fhtxf0) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):is(:where(.svelte-fhtxf0):hover, :where(.svelte-fhtxf0):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):is(:where(.svelte-fhtxf0):hover, :where(.svelte-fhtxf0):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):dir(rtl) {transform:rotate(-90deg);}.row.svelte-fhtxf0 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-fhtxf0 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-fhtxf0 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-fhtxf0 {display:block;}.group[hidden].svelte-fhtxf0 {display:none;}`};function fO(e,t){let n=mo();O(t,!0),K(e,rbe);let r=J(t,`selected`,15,!1),i=J(t,`expanded`,15,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`label`,3,``),c=J(t,`value`,19,s),l=J(t,`valueType`,19,()=>Gc(c())),u=ys(t,Qye),d=(ri(`sui:tree-item-level`)??0)+1;ii(`sui:tree-item-level`,d);let f=e=>{r(e.detail.selected),t.onChange?.(e)},p=e=>{i(e.detail.expanded),t.onExpand?.(e)},m=e=>{t.onSelect?.(e)},h=e=>{let t=[[`Change`,f],[`Expand`,p],[`Select`,m]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var g=nbe();us(g,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":d,"aria-labelledby":`${n}-label`,"data-label":s(),"data-value":c(),"data-type":l()}),void 0,void 0,void 0,`svelte-fhtxf0`);var _=N(g);let v;var y=N(_),b=e=>{var n=$ye(),r=N(n),i=e=>{var n=H();Po(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Dc()?`chevron_left`:`chevron_right`);Ac(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},x=e=>{U(e,ebe())};G(y,e=>{t.items?e(b):e(x,-1)});var S=I(y,2);Po(S,()=>t.startIcon??Tr);var C=I(S,2),w=N(C),T=e=>{var t=V();R(()=>W(t,s())),U(e,t)},ee=e=>{var n=H();Po(P(n),()=>t.children??Tr),U(e,n)};G(w,e=>{s()?e(T):e(ee,-1)}),D(C),Po(I(C,2),()=>t.endIcon??Tr),D(_);var te=I(_,2),ne=e=>{var n=tbe();Po(N(n),()=>t.items),D(n),R(()=>q(n,`hidden`,!i())),U(e,n)};G(te,e=>{t.items&&e(ne)}),D(g),Wo(g,()=>h),R(()=>{v=Qo(_,``,v,{"--sui-tree-item-level":d}),q(C,`id`,`${n}-label`)}),U(e,g),k()}var pO=`[role="treeitem"]`,ibe=class{#e=new yl;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=el(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=xl(this,e=>this.onClick(e)),this._onKeyDown=xl(this,e=>this.onKeyDown(e)),this._onFocusIn=xl(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),Sl(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(pO)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||e.push(r),this.isParent(r)&&!this.isExpanded(r))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${pO}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(pO)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){pl(e)}setTabStop(e){this.parent.querySelectorAll(`${pO}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:hl(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:hl(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=bl(n.map(e=>_l(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(pO);t&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(pO);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(pO)??this.currentItem??o[0],l=o.indexOf(c),{prevKey:u,nextKey:d}=vl(`horizontal`,Dc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(c));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),c.click();else if(t===` `)e.preventDefault(),s?this.selectItem(c,{additive:!i,range:i}):this.selectItem(c);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?l+1:l-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===d){if(e.preventDefault(),!this.isParent(c))return;if(!this.isExpanded(c)){this.expandItem(c,!0);return}let t=this.getChildItems(c).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===u){if(e.preventDefault(),this.isParent(c)&&this.isExpanded(c)){this.expandItem(c,!1);return}let t=this.getParentItem(c);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(c)):t.length===1&&t.trim()&&this.typeAhead(t,c)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},abe=e=>t=>{let n=new ibe(t,e);return()=>{n.destroy()}},obe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),sbe=B(`
`),cbe={hash:`svelte-l14zys`,code:`[role=tree].svelte-l14zys {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-l14zys {display:contents;}`};function mO(e,t){O(t,!0),K(e,cbe);let n=J(t,`element`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`multiple`,3,!1),s=J(t,`clickToSelect`,3,!0),c=J(t,`selectionFollowsFocus`,3,void 0),l=J(t,`expandOnSelect`,3,!0),u=J(t,`ariaLabel`,3,void 0),d=ys(t,obe);var f=sbe(),p=e=>{t.onChange?.(e)};us(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-l14zys`);var m=N(f);Po(N(m),()=>t.children??Tr),D(m),D(f),_s(f,e=>n(e),()=>n()),Wo(f,()=>abe({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),R(()=>m.inert=i()),U(e,f),k()}var lbe=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],ube=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&lbe.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,dbe={hash:`svelte-ytafm9`,code:` + );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function mxe(e,t){k(t,!0),q(e,pxe);let n=Y(t,`value`,15,``),r=Y(t,`pending`,15,!1),i=Y(t,`format`,3,`markdown`),a=Y(t,`flex`,3,!1),o=Y(t,`dir`,3,void 0),s=Y(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=Y(t,`buttons`,19,()=>[...ST,...CT]),l=Y(t,`components`,19,()=>[]),u=Y(t,`multiline`,3,!0),d=Y(t,`minimal`,3,!1),f=Y(t,`useMarkdownShortcuts`,3,!0),p=Y(t,`useEmojiAutocomplete`,3,!0),m=Y(t,`hidden`,3,!1),h=Y(t,`disabled`,3,!1),g=Y(t,`readonly`,3,!1),_=Y(t,`required`,3,!1),v=Y(t,`invalid`,3,!1),y=Y(t,`ariaLabel`,3,void 0),b=Y(t,`ariaLabelledby`,3,void 0),x=Y(t,`ariaDescribedby`,3,void 0),S=Y(t,`aria-label`,3,void 0),C=Y(t,`aria-labelledby`,3,void 0),w=Y(t,`aria-describedby`,3,void 0),T=gs(t,dxe),ee=j(()=>({"aria-label":y()??S(),"aria-labelledby":b()??C(),"aria-describedby":x()??w()})),E=Aye();E.config={...E.config,modes:s(),enabledButtons:c(),components:l(),multiline:u(),useMarkdownShortcuts:f(),useEmojiAutocomplete:p(),format:i()},di(`editorStore`,E);let te=i()===`html`?`html`:`markdown`,ne=2e4,re=M(na(fD())),ie=M(0),ae=j(()=>!E.useRichText&&!m()),oe=j(()=>o()===`auto`&&E.useRichText?void 0:o()),se=j(()=>!B(ae)||te!==`markdown`||E.inputValue.length>ne?``:[...new Set([...E.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),ce=e=>{if(B(ie),!(!B(ae)||e.length>ne))return Hge(e,te,{theme:B(re)})};R(()=>pD(async()=>{let e=fD();B(ae)&&await uO(te),e===fD()&&N(re,e,!0)})),R(()=>{if(!B(ae))return;let e=B(se)?B(se).split(`,`):[];B(re),co(()=>{uO(te).then(async()=>{N(ie,B(ie)+1),await Promise.all(e.map(e=>uO(e))),N(ie,B(ie)+1)})})}),R(()=>{let{textArea:e,useRichText:t}=E;if(!e||t)return;let n=()=>{E.selection={blockNodeKey:null,blockType:document.activeElement===e?hbe(_O(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return co(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),R(()=>{let{textArea:e}=E;if(e&&!u())return Tbe(e)}),R(()=>{r(E.pending)}),R(()=>()=>{r(!1)}),R(()=>{if(!E.initialized)return;let e=n();co(()=>{E.inputValue=e})}),R(()=>{if(!E.initialized)return;let e=E.inputValue;co(()=>{n()!==e&&n(e)})});var le=fxe(),ue=F(le);us(ue,()=>({...T,role:`none`,class:`sui text-editor`,hidden:m(),[cs]:{flex:a(),"single-line":!u(),minimal:d()},[ls]:{"--sui-text-editor-toolbar-height":`${E.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-lbovw0`);var de=P(ue);uxe(de,{get disabled(){return h()},get readonly(){return g()}});var fe=L(de,2);{let e=j(()=>!E.useRichText||m());kye(fe,_s(()=>B(ee),{get dir(){return o()},get hidden(){return B(e)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()}}))}var pe=L(fe,2);{let e=j(()=>u()?void 0:1),t=j(()=>u()?void 0:!1),n=j(()=>E.useRichText||m());mO(pe,_s(()=>B(ee),{get id(){return`${E.editorId??``}-plain-text`},autoResize:!0,get rows(){return B(e)},get"aria-multiline"(){return B(t)},get useEmojiAutocomplete(){return p()},highlight:ce,get flex(){return a()},get dir(){return B(oe)},get hidden(){return B(n)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()},get element(){return E.textArea},set element(e){E.textArea=e},get value(){return E.inputValue},set value(e){E.inputValue=e}}))}var me=L(pe,2),he=e=>{Zye(e,{})};K(me,e=>{E.config.useEmojiAutocomplete&&!h()&&!g()&&e(he)});var ge=L(me,2),_e=e=>{nbe(e,{})},ve=j(()=>E.config.enabledButtons.includes(`link`)&&!h()&&!g());K(ge,e=>{B(ve)&&e(_e)});var ye=L(ge,2),be=e=>{cbe(e,{})},xe=j(()=>E.config.enabledButtons.includes(`table`)&&!h()&&!g());K(ye,e=>{B(xe)&&e(be)}),O(ue);var Se=L(ue,2),Ce=e=>{Pu(e,{get show(){return E.showConverterError},set show(e){E.showConverterError=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`_sui.text_editor.converter_error`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(Se,e=>{E.showConverterError&&e(Ce)}),W(e,le),A()}var hxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),gxe=V(``),_xe={hash:`svelte-1ck6cim`,code:`.color-input.svelte-1ck6cim {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-1ck6cim:is(:where(.svelte-1ck6cim):hover, :where(.svelte-1ck6cim):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-1ck6cim:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-1ck6cim {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-1ck6cim {border-color:var(--sui-error-border-color);}.color-input.svelte-1ck6cim::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-1ck6cim::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-1ck6cim::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function vxe(e,t){k(t,!0),q(e,_xe);let n=Y(t,`value`,15),r=Y(t,`element`,15),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`required`,3,!1),s=Y(t,`invalid`,3,!1),c=Y(t,`ariaLabel`,3,void 0),l=gs(t,hxe),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=gxe();us(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-1ck6cim`,!0),ms(f,e=>r(e),()=>r()),W(e,f),A()}var yxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),bxe=V(``),xxe={hash:`svelte-cdw0d9`,code:`.date-time-input.svelte-cdw0d9 {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-transform:var(--sui-date-time-input-text-transform, uppercase);letter-spacing:var(--sui-textbox-letter-spacing, normal);font-variant-numeric:tabular-nums;transition:all 200ms;}.date-time-input.svelte-cdw0d9:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input.svelte-cdw0d9:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-cdw0d9:is(:where(.svelte-cdw0d9):disabled, :where(.svelte-cdw0d9):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input[aria-invalid=true].svelte-cdw0d9 {border-color:var(--sui-error-border-color);}.date-time-input.svelte-cdw0d9::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-cdw0d9:is(:where(.svelte-cdw0d9):disabled, :where(.svelte-cdw0d9):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function Sxe(e,t){k(t,!0),q(e,xxe);let n=Y(t,`value`,15),r=Y(t,`element`,15),i=Y(t,`type`,3,`date`),a=Y(t,`min`,3,void 0),o=Y(t,`max`,3,void 0),s=Y(t,`step`,3,void 0),c=Y(t,`disabled`,3,!1),l=Y(t,`readonly`,3,!1),u=Y(t,`required`,3,!1),d=Y(t,`invalid`,3,!1),f=Y(t,`ariaLabel`,3,void 0),p=gs(t,yxe),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=bxe();us(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-cdw0d9`,!0),ms(h,e=>r(e),()=>r()),W(e,h),A()}var Cxe=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),wxe=V(`
`),Txe={hash:`svelte-1cqpw8k`,code:`.password-input.svelte-1cqpw8k, +.secret-input.svelte-1cqpw8k {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-1cqpw8k:not([hidden]), +.secret-input.flex.svelte-1cqpw8k:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-1cqpw8k .text-input, +.secret-input.svelte-1cqpw8k .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-1cqpw8k input, +.secret-input.svelte-1cqpw8k input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-1cqpw8k button, +.secret-input.svelte-1cqpw8k button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-1cqpw8k button:last-child, +.secret-input.svelte-1cqpw8k button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-1cqpw8k button .icon, +.secret-input.svelte-1cqpw8k button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-1cqpw8k input {-webkit-text-security:none;}.secret-input.svelte-1cqpw8k input {-webkit-text-security:disc;}.password-input.svelte-1cqpw8k:dir(rtl), +.secret-input.svelte-1cqpw8k:dir(rtl) {--sui-textbox-text-align: right;}`};function Exe(e,t){let n=Co();k(t,!0),q(e,Txe);let r=Y(t,`value`,15),i=Y(t,`flex`,3,!1),a=Y(t,`monospace`,3,!0),o=Y(t,`hidden`,3,!1),s=Y(t,`disabled`,3,!1),c=Y(t,`readonly`,3,!1),l=Y(t,`required`,3,!1),u=Y(t,`invalid`,3,!1),d=gs(t,Cxe),f=M(!1),p=j(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});var m=wxe();let h;var g=P(m);Gl(g,_s({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:B(f)?`text`:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get value(){return r()},set value(e){r(e)}}));var _=L(g,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.visibilityIcon),W(e,n)},a=e=>{{let t=j(()=>B(f)?`visibility_off`:`visibility`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>s()||c()),i=j(()=>X(B(f)?B(p).hide:B(p).show));ll(_,{iconic:!0,get disabled(){return B(r)},get pressed(){return B(f)},get"aria-label"(){return B(i)},get"aria-controls"(){return n},onclick:()=>{N(f,!B(f))},startIcon:e,$$slots:{startIcon:!0}})}O(m),z(()=>{h=rs(m,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-1cqpw8k`,h,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&B(f)}),J(m,`hidden`,o())}),W(e,m),A()}var Dxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function Oxe(e,t){k(t,!0);let n=Y(t,`value`,15),r=gs(t,Dxe);Exe(e,_s(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),A()}var kxe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),Axe=V(``),jxe=V(``),Mxe=V(`
`),Nxe=V(`
`),Pxe={hash:`svelte-wso092`,code:`[role=treeitem].svelte-wso092 {display:block;}[role=treeitem][hidden].svelte-wso092 {display:none;}[role=treeitem].svelte-wso092:focus-visible {outline-color:transparent;}[role=treeitem].svelte-wso092:focus-visible > .row:where(.svelte-wso092) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-wso092 > .row:where(.svelte-wso092) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):is(:where(.svelte-wso092):hover, :where(.svelte-wso092):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-wso092 > .row:where(.svelte-wso092):is(:where(.svelte-wso092):hover, :where(.svelte-wso092):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):dir(rtl) {transform:rotate(-90deg);}.row.svelte-wso092 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-wso092 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-wso092 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-wso092 {display:block;}.group[hidden].svelte-wso092 {display:none;}`};function TO(e,t){let n=Co();k(t,!0),q(e,Pxe);let r=Y(t,`selected`,15,!1),i=Y(t,`expanded`,15,!1),a=Y(t,`hidden`,3,!1),o=Y(t,`disabled`,3,!1),s=Y(t,`label`,3,``),c=Y(t,`value`,3,void 0),l=Y(t,`valueType`,3,void 0),u=gs(t,kxe),d=j(()=>c()===void 0?s():c()),f=j(()=>l()===void 0?Yc(B(d)):l()),p=(ui(`sui:tree-item-level`)??0)+1;di(`sui:tree-item-level`,p);let m=e=>{r(e.detail.selected),t.onChange?.(e)},h=e=>{i(e.detail.expanded),t.onExpand?.(e)},g=e=>{t.onSelect?.(e)},_=e=>{let t=[[`Change`,m],[`Expand`,h],[`Select`,g]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var v=Nxe();us(v,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":p,"aria-labelledby":`${n}-label`,"data-label":s(),"data-value":B(d),"data-type":B(f)}),void 0,void 0,void 0,`svelte-wso092`);var y=P(v);let b;var x=P(y),S=e=>{var n=Axe(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)},C=e=>{W(e,jxe())};K(x,e=>{t.items?e(S):e(C,-1)});var w=L(x,2);Uo(w,()=>t.startIcon??jr);var T=L(w,2),ee=P(T),E=e=>{var t=H();z(()=>G(t,s())),W(e,t)},te=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(ee,e=>{s()?e(E):e(te,-1)}),O(T),Uo(L(T,2),()=>t.endIcon??jr),O(y);var ne=L(y,2),re=e=>{var n=Mxe();Uo(P(n),()=>t.items),O(n),z(()=>J(n,`hidden`,!i())),W(e,n)};K(ne,e=>{t.items&&e(re)}),O(v),$o(v,()=>_),z(()=>{b=as(y,``,b,{"--sui-tree-item-level":p}),J(T,`id`,`${n}-label`)}),W(e,v),A()}var EO=`[role="treeitem"]`,Fxe=class{#e=new vl;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=rl(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=bl(this,e=>this.onClick(e)),this._onKeyDown=bl(this,e=>this.onKeyDown(e)),this._onFocusIn=bl(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),xl(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`aria-hidden`,`aria-disabled`,`aria-expanded`]}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(EO)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||(e.push(r),this.isParent(r)&&!this.isExpanded(r)))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${EO}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(EO)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){fl(e)}setTabStop(e){this.parent.querySelectorAll(`${EO}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=yl(n.map(e=>gl(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(EO);t&&!t.matches(`[aria-disabled="true"]`)&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(EO);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(EO),l=(c&&o.includes(c)?c:void 0)??this.currentItem??o[0],u=o.indexOf(l),{prevKey:d,nextKey:f}=_l(`horizontal`,Pc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(l));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),l.click();else if(t===` `)e.preventDefault(),s?this.selectItem(l,{additive:!i,range:i}):this.selectItem(l);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?u+1:u-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===f){if(e.preventDefault(),!this.isParent(l))return;if(!this.isExpanded(l)){this.expandItem(l,!0);return}let t=this.getChildItems(l).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===d){if(e.preventDefault(),this.isParent(l)&&this.isExpanded(l)){this.expandItem(l,!1);return}let t=this.getParentItem(l);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(l)):t.length===1&&t.trim()&&this.typeAhead(t,l)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},Ixe=e=>t=>{let n=new Fxe(t,e);return()=>{n.destroy()}},Lxe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),Rxe=V(`
`),zxe={hash:`svelte-1jxckbi`,code:`[role=tree].svelte-1jxckbi {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-1jxckbi {display:contents;}`};function Bxe(e,t){k(t,!0),q(e,zxe);let n=Y(t,`element`,15),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`multiple`,3,!1),s=Y(t,`clickToSelect`,3,!0),c=Y(t,`selectionFollowsFocus`,3,void 0),l=Y(t,`expandOnSelect`,3,!0),u=Y(t,`ariaLabel`,3,void 0),d=gs(t,Lxe);var f=Rxe(),p=e=>{t.onChange?.(e)};us(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-1jxckbi`);var m=P(f);Uo(P(m),()=>t.children??jr),O(m),O(f),ms(f,e=>n(e),()=>n()),$o(f,()=>Ixe({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),z(()=>m.inert=i()),W(e,f),A()}var Vxe=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],Hxe=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&Vxe.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,Uxe={hash:`svelte-u1y14z`,code:` /* https://fontsource.org/fonts/source-sans-3/cdn */ @font-face {font-family:'Source Sans 3';font-style:normal;font-display:swap;font-weight:200 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.3.1/latin-wght-normal.woff2) format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, @@ -2144,7 +2156,7 @@ ${l}`:l)}return o.join(` format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }.material-symbols-outlined { - /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function fbe(e){K(e,dbe)}var pbe=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),mbe=B(` `,1),hbe=B(``),gbe=B(`
`,1),_be={hash:`svelte-1czfn2k`,code:`:root, + /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function Wxe(e){q(e,Uxe)}var Gxe=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),Kxe=V(` `,1),qxe=V(``),Jxe=V(`
`,1),Yxe={hash:`svelte-ajli7a`,code:`:root, :host {--sui-base-hue: 210;--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));--sui-error-foreground-color: hsl( var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation) var(--sui-alert-foreground-color-lightness) @@ -2220,58 +2232,58 @@ ${l}`:l)}return o.join(` @media (prefers-reduced-motion) {*, ::before, ::after {scroll-behavior:auto;transition-duration:1ms !important;} -}::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-1czfn2k {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-1czfn2k {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-1czfn2k {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-1czfn2k {display:flex;flex-direction:column;overflow:hidden;}`};function vbe(e,t){O(t,!0),K(e,_be);let n=J(t,`orientation`,3,`horizontal`),r=ys(t,pbe),i=j(!1);xs(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{M(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=gbe();Uo(`1czfn2k`,e=>{var t=mbe(),n=P(t);fbe(I(n,4),{}),R(e=>q(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),U(e,t)});var o=P(a),s=e=>{var t=hbe();Qo(t,``,{},{opacity:`0`}),U(e,t)};G(o,e=>{z(i)||e(s)});var c=I(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{ube(e.target)||e.preventDefault()};us(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-1czfn2k`),Po(N(c),()=>t.children??Tr),D(c),U(e,a),k()}var ybe=B(`
`),bbe={hash:`svelte-1wdt5mv`,code:`.empty-state.svelte-1wdt5mv {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function hO(e,t){K(e,bbe);let n=J(t,`children`,3,void 0);var r=ybe();Po(N(r),()=>n()??Tr),D(r),U(e,r)}var xbe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),Sbe=B(`
`),Cbe={hash:`svelte-l609t5`,code:`.inner.svelte-l609t5 {display:contents;}`};function gO(e,t){K(e,Cbe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ys(t,xbe);var o=Sbe();us(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-l609t5`);var s=N(o);Po(N(s),()=>t.children??Tr),D(s),D(o),R(()=>s.inert=r()),U(e,o)}var wbe=B(`
`),Tbe={hash:`svelte-1ef93sf`,code:`.placeholder.svelte-1ef93sf {height:64px;}`};function _O(e,t){O(t,!0),K(e,Tbe);let n=J(t,`eager`,3,!1),r=j(null),i=j(Yi(n()));L(()=>(z(r)&&(async()=>{await nl(z(r)),M(i,!0)})(),()=>{z(r)&&tl(z(r))}));var a=H(),o=P(a),s=e=>{var n=H();Po(P(n),()=>t.children),U(e,n)},c=e=>{var t=wbe();_s(t,e=>M(r,e),()=>z(r)),U(e,t)};G(o,e=>{z(i)?e(s):e(c,-1)}),U(e,a),k()}var Ebe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function Dbe(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};bu(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),k()}var Obe=B(`

`);function kbe(e,t){O(t,!0);let n=J(t,`currentValue`,3,!1);var r=H(),i=P(r),a=e=>{var t=Obe(),r=F(t,!0);R(e=>W(r,e),[()=>Y(`boolean.${n()}`)]),U(e,t)};G(i,e=>{typeof n()==`boolean`&&e(a)}),U(e,r),k()}var vO=e=>LE(e).replaceAll(`\\*`,`\\d+`),yO=(e,t)=>e===t||e.startsWith(`${t}.`),bO=new WeakMap,Abe=e=>{let t=bO.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=Abe(e),i=0,a=r.length;for(;ie-t).map(([e])=>e)},SO=/\.\d+$/,CO=/^(?.+)\.\d+$/,wO=new WeakMap,TO=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(CO)?.groups?.parent===t);let r=wO.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(CO)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),wO.set(e,r)),r.get(t)??[]},EO=e=>e.startsWith(`__sc_`),jbe=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],Mbe=[`difference`,`intersection`,`symmetricDifference`,`union`],Nbe=!1,Pbe=class e extends Set{#e=new Map;#t=j(0);#n=j(0);#r=Va||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}Nbe||this.#a()}#i(e){return Va===this.#r?j(e):Ui(e)}#a(){Nbe=!0;var t=e.prototype,n=Set.prototype;for(let e of jbe)t[e]=function(...t){return z(this.#t),n[e].apply(this,t)};for(let r of Mbe)t[r]=function(...t){z(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return z(this.#t),!1;r=this.#i(!0),n.set(e,r)}return z(r),t}add(e){return super.has(e)||(super.add(e),M(this.#n,super.size),Ji(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),M(r,!1)),t&&(M(this.#n,super.size),Ji(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#n,0),Ji(this.#t)}}keys(){return this.values()}values(){return z(this.#t),super.values()}entries(){return z(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return z(this.#n)}},Fbe=class extends Map{#e=new Map;#t=j(0);#n=j(0);#r=Va||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return Va===this.#r?j(e):Ui(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return z(this.#t),!1}return z(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{z(this.#t);return}}return z(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),M(this.#n,super.size),Ji(o);else if(i!==t){Ji(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||Ji(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),M(n,-1)),r&&(M(this.#n,super.size),Ji(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#n,0);for(var t of e.values())M(t,-1);Ji(this.#t),e.clear()}}#a(){z(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)z(n)}keys(){return z(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return z(this.#n),super.size}},DO=new Map,OO=new Fbe,kO=new Map,AO=new Map,jO=new Set,MO=new Map,NO=new Map,PO=new Set,{dependencies:Ibe,version:FO}={name:`@sveltia/cms`,version:`0.252.0`,description:`Sveltia CMS is a modern, lightweight, Git-based headless content management system.`,keywords:[`svelte`,`cms`,`content-management-system`],homepage:`https://sveltiacms.app/en/`,repository:{type:`git`,url:`git+https://github.com/sveltia/sveltia-cms.git`},funding:{type:`github`,url:`https://github.com/sponsors/kyoshino`},license:`MIT`,author:{name:`Kohei Yoshino`,url:`https://github.com/kyoshino`},type:`module`,scripts:{bench:`playwright test -c bench/playwright.config.js`,"bench:compare":`node bench/compare.js`,"bench:profile":`node bench/summarize-profile.js`,build:`vite build`,"build:watch":`vite build --watch`,check:`pnpm run --no-bail '/^check:.*/'`,"check:audit":`pnpm audit --ignore-registry-errors`,"check:cspell":`cspell --no-progress`,"check:eslint":`eslint .`,"check:imports":`node scripts/find-unused-imports.js`,"check:l10n":`node scripts/check-locales.js`,"check:oxlint":`oxlint .`,"check:prettier":`prettier --check .`,"check:stylelint":`stylelint '**/*.{css,scss,svelte}'`,"check:svelte":`svelte-check`,dev:`vite`,format:`prettier --write .`,prepublishOnly:`vite build`,preview:`vite preview`,test:`NODE_OPTIONS=--no-experimental-webstorage vitest run`,"test:components":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project browser`,"test:components:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project browser --coverage.include='src/lib/components/**/*.svelte' --coverage.thresholds.branches=98.4`,"test:e2e":`playwright test -c e2e/playwright.config.js`,"test:e2e:ui":`playwright test -c e2e/playwright.config.js --ui`,"test:unit":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project unit`,"test:unit:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project unit`,"test:watch":`NODE_OPTIONS=--no-experimental-webstorage vitest`},dependencies:{"@cfworker/json-schema":`^4.1.1`,"@discourse/heic":`^1.0.0`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.52.0`,"@sindresorhus/transliterate":`^2.3.1`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.87.4`,"@sveltia/utils":`^0.12.4`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,deepmerge:`^4.3.1`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.1.9`,"isomorphic-dompurify":`^4.6.0`,"isomorphic-git":`^1.44.4`,leaflet:`^1.9.4`,lexical:`^0.52.0`,marked:`^18.1.1`,"marked-bidi":`^1.0.15`,mime:`^4.1.1`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.4.299`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.4`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.38.0`,"terra-draw-leaflet-adapter":`1.0.3`,turndown:`^7.2.4`,yaml:`^2.9.1`},devDependencies:{"@playwright/test":`^1.64.1`,"@stylistic/eslint-plugin":`^5.10.0`,"@sveltejs/vite-plugin-svelte":`^7.3.1`,"@types/leaflet":`^1.9.22`,"@types/node":`^26.6.5`,"@types/qrcode":`^1.5.6`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitest/browser-playwright":`^5.0.5`,"@vitest/coverage-v8":`^5.0.5`,cspell:`^10.4.0`,eslint:`^9.39.5`,"eslint-config-airbnb-extended":`^3.3.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jsdoc":`^65.4.2`,"eslint-plugin-package-json":`^1.10.1`,"eslint-plugin-svelte":`^3.23.1`,"eslint-plugin-unused-imports":`^4.4.1`,globals:`^17.13.0`,"happy-dom":`^21.0.4`,messageformat:`^4.1.0`,oxlint:`^1.89.0`,playwright:`^1.64.1`,"postcss-html":`^2.0.0`,prettier:`^3.9.10`,"prettier-plugin-svelte":`^4.1.1`,sonda:`^0.14.0`,stylelint:`^17.16.0`,"stylelint-config-recommended":`^18.0.0`,svelte:`^5.57.2`,"svelte-check":`^4.7.7`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.3`,vite:`^8.3.5`,vitest:`^5.0.5`,"vitest-browser-svelte":`^3.1.0`},publishConfig:{directory:`package`}},{DEV:Lbe,VITE_SITE_URL:Rbe}={DEV:!1},IO=Lbe?Rbe||`http://localhost:5174`:void 0,zbe=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],LO=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),Yi(e)),RO=e=>Qr(e),zO=e=>{let t=j(e);return{get current(){return z(t)},set current(e){M(t,e)}}},BO=e=>Yi({current:e}),VO=e=>{let t=A(e);return{get current(){return z(t)}}},HO=e=>{let t;return VO(()=>{let n=e();return(0,hr.default)(n,t)||(t=n),t})},UO=e=>fa(()=>{L(e)}),WO=(e,t)=>{L(()=>(e(),$a(t)))},GO=(e,t,n)=>{L(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},KO=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return WO(e,s),WO(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},qO=zO(),JO=qO,YO={},XO=zO(),ZO=zO([]),QO=VO(()=>!!JO.current||!!ZO.current.length),$O={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},ek=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),tk=e=>Array.isArray(e.files),nk=e=>tk(e)&&e.name===`_singletons`,rk=e=>e?._type===`entry`&&!!e._file.arrayFile,Bbe=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?ek(e):n===`file`?tk(e):n===`singleton`?nk(e):ek(e)||tk(e),ik=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),ak=e=>e.filter(e=>ik(e)),ok=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],sk=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],ck=sk.filter(e=>![`boolean`,`number`].includes(e)),lk=[`file`,`image`],uk=[`richtext`,`markdown`],dk=[`text`,`string`,...uk],fk=[...lk,`relation`,`select`],Vbe=[...fk,`datetime`,`keyvalue`,`list`,`number`],pk=(e=``)=>RegExp(`\\bblob:${LE(globalThis.location.origin)}\\/${Tre.source}\\b`,e),Hbe=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,Ube=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],mk=e=>e.startsWith(`text/`)||Ube.includes(e),hk=e=>{let[,t,n,r,i]=e.match(Hbe)??[];return{dirname:t,basename:n,filename:r,extension:i}},gk=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},Wbe=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&gk(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},Gbe=async e=>(await e.text()).replace(/\r\n?/g,` -`),Kbe=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,_k=async e=>{let t=Kbe(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},qbe=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},Jbe=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=e.type.split(`/`)[1]?.split(/[+;]/)[0];n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},vk=/{{(.+?)}}/,yk=new RegExp(vk.source,`g`),Ybe=/\\\{\\\{.+?\\\}\\\}/g,bk=[`year`,`month`,`day`,`hour`,`minute`,`second`],xk=/{{(?:year|month|day|hour|minute|second)}}/,Sk=/^fields\./,Xbe=/\|\s*default\s*\(/,Ck={uuid:{length:void 0,pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`},uuid_short:{length:`short`,pattern:`[0-9a-f]{12}`},uuid_shorter:{length:`shorter`,pattern:`[0-9a-f]{8}`}},wk=e=>e.replace(Sk,``),Tk=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},Ek=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],Dk=(e,t)=>LE(e).replace(Ybe,t),Ok={slug_length:!1,slug_editor_tag:!1,yaml_quote:!1,uuid_read_only:!1,save_all_locales:!1,automatic_deployments:!1,multiple_folders_i18n_root:!1,omit_default_locale_from_filename:!1,logo_url:!1},Zbe={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. ",slug_editor_tag:"The `{{fields._slug}}` and `{{fields._slug | localize}}` slug template tags are deprecated and will be removed in Sveltia CMS 1.0. Use the `slug` collection option’s object form instead: `{{fields._slug}}` is equivalent to `slug: { editable: true }`, and `{{fields._slug | localize}}` is equivalent to `slug: { editable: true, i18n: true }`. https://sveltiacms.app/en/docs/collections/entries/slugs#making-slugs-editable",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",uuid_read_only:"The `read_only` option for the UUID field type is deprecated and will be removed in Sveltia CMS 1.0. Use the `readonly` option instead.",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n/options#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments",multiple_folders_i18n_root:"The `multiple_folders_i18n_root` i18n structure is deprecated and will be removed in Sveltia CMS 1.0. Use the `multiple_root_folders` structure instead. https://sveltiacms.app/en/docs/i18n/structures#multiple-root-folders",omit_default_locale_from_filename:"The `omit_default_locale_from_filename` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `omit_default_locale_from_file_path` option instead. https://sveltiacms.app/en/docs/i18n/structures",logo_url:"The `logo_url` option is deprecated and will be removed in a future version of Sveltia CMS. Use the `logo.src` option instead. https://sveltiacms.app/en/docs/customization#custom-logo"},kk=(e,t)=>{Ok[e]||(console.warn(t??Zbe[e]),Ok[e]=!0)},Qbe=`_index`,Ak=new WeakMap,jk=e=>{if(!ek(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??Qbe},Mk=e=>{let t=Ak.get(e);if(t&&t.locale===Oc.current)return t.indexFile;let n=jk(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={name:n,label:i.label||Y(`index_file`),icon:i.icon??`home`,extension:i.extension,format:i.format,fields:i.fields,editor:i.editor}}return Ak.set(e,{locale:Oc.current,indexFile:r}),r},Nk=(e,t)=>{let n=jk(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},Pk=(e,t)=>{let n=jk(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:Nk(e,r)},Fk=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],$be={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},Ik={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},Lk={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},Rk=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],zk=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...Rk,`raw`],Bk=[`toml`,`toml-frontmatter`],Vk={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},Hk=e=>Object.hasOwn(Vk,e)?Vk[e]:void 0,Uk=e=>typeof e==`string`&&!!e.trim(),Wk=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&BE(e.trim()),Gk=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&`).replaceAll(`"`,`"`),exe={"&":`&`,"<":`<`,">":`>`},Kk=e=>e.replace(/[&<>]/g,e=>exe[e]),qk={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},Jk=(e,t)=>_t(e.replace(``,``),qk),Yk=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>_t(lr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),Xk=e=>Yk(e.replaceAll(`\\n`,`
`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),Zk=[`index`,`_index`],txe=[...Fk,...Object.keys(Ik)],nxe=e=>{if(typeof e!=`string`||!e.trim())return;let t=zE(e.trim()),{filename:n,extension:r}=hk(t);return r!==void 0&&txe.includes(r)?n:t},Qk=zO(``),$k=e=>{let t=e;if(!ek(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:Uk(i)?i:void 0,subfolders:a!==!1}},eA=e=>!!$k(e),tA=e=>{if(!eA(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:nxe(t.index_file)}},nA=e=>eA(e)?tA(e)?.indexFileName:void 0,rA=e=>$k(e)?.subfolders===!1?void 0:tA(e)?.indexFileName,iA=(e,t)=>{let n=rA(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},aA=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&rA(e)?!0:!!zE(r)||!!zE(n??``),oA=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},sA=(e,t)=>!e||t.startsWith(`${e}/`),rxe=({collection:e,entries:t,dirPath:n})=>{if(!eA(e))return!1;let r=zE(n);return!r||t.some(({subPath:e})=>sA(r,e))},cA=({collection:e,entries:t,dirPath:n})=>{let r=$k(e);if(!r)return t;let{subfolders:i}=r,a=zE(n);return t.filter(({subPath:e})=>{if(!sA(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},lA=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},uA=(e,t,n,r)=>{if(e.has(t)){let n=e.get(t);return e.delete(t),e.set(t,n),n}let i=n();return e.set(t,i),e.size>r&&e.delete(e.keys().next().value),i},dA=(e,t,n)=>lA(e,t,()=>n().finally(()=>{e.delete(t)})),fA=(e,t,n)=>lA(e,t,()=>n().catch(n=>{throw e.delete(t),n})),pA=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},ixe=/(?:^|\/){{locale}}(?:\/|$)/,mA=e=>e.includes(`{{locale}}`),axe=e=>e.split(`{{locale}}`).length===2&&ixe.test(e),hA=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},gA=e=>hA(e)!==void 0,_A=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=hA(e)??e),e.replaceAll(`{{locale}}`,t)),vA=(e,t)=>`${e}/`.split(`{{locale}}/`).map(LE).join(t),oxe=new Map,sxe=(e,t)=>e.replace(lA(oxe,t,()=>RegExp(`^${vA(t,`(?:[^/]+\\/)?`)}`)),``),cxe={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},yA=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},bA=e=>e===`_default`?`auto`:Dc(e)?`rtl`:`ltr`,lxe=new Map,xA=(e,{displayLocale:t=yA(Oc.current??`en`),formatterOptions:n=cxe}={})=>{let r=yA(e);if(!r)return;let i=t?lA(lxe,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},uxe=new Map,SA=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return lA(uxe,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(yA(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},CA=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return _A({path:n,locale:t,omitLocale:i&&t===r})},wA=({extension:e,format:t})=>(t?AO.get(t)?.extension:void 0)||e||(t?$be[t]??`md`:`md`),TA=({extension:e,format:t})=>t||(Fk.includes(e)?`frontmatter`:Ik[e]??`yaml-frontmatter`),dxe=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?LE(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${Dk(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?${c})`},fxe=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(LE).join(`|`),h=c.filter(e=>e!==l).map(LE).join(`|`),g=`(?${m})`,_=u?`(?:(?${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?${h}))?`:`\\.${g}`,y=!!n&&mA(n),b=y?vA(n,_):n?`${LE(n)}\\/`:``,x=wA({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${LE(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,dxe({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${LE(x)}|${LE(S)})`:LE(x),`$`].join(``);return new RegExp(w)},EA=({format:e,delimiter:t})=>Uk(t)?[t,t]:Array.isArray(t)&&t.length===2?t:Lk[e]??void 0,pxe=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=wA({extension:r,format:i}),o=TA({extension:a,format:i}),s=wA({extension:t,format:n}),c=TA({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},DA=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=ek(e),f=d&&typeof i==`string`,p=t?.file?zE(t.file):f?zE(i):void 0,m=p?hk(p).extension:o,h=t?.format??s,g=wA({format:h,extension:m}),_=TA({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?zE(r):void 0,x=y?Mk(e):void 0,S=x?.name,C=y?$k(e)?.depth:void 0,w=pxe({indexFile:x,extension:o,format:s});u!==void 0&&kk(`yaml_quote`);let T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:fxe({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?CA({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:EA({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:EA({format:w.format,delimiter:v})}),T},OA=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},kA={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},mxe=[kA.MULTIPLE_FOLDERS_I18N_ROOT,kA.MULTIPLE_ROOT_FOLDERS],AA={key:`translationKey`,value:`{{slug}}`},jA=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!E(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(E(o)&&Object.assign(i,o),n){if(!n.i18n)return;E(n.i18n)&&Object.assign(i,n.i18n)}return i}},hxe=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,gxe={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:kA.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...AA},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},MA=e=>(e?.collectionFile??e?.collection)?._i18n??gxe,_xe=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&mA(n)?kA.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?kA.MULTIPLE_FILES:e===kA.SINGLE_FILE_DEFAULT_ROOT?kA.SINGLE_FILE_DEFAULT_ROOT:kA.SINGLE_FILE,vxe=(e,t)=>({i18nSingleFile:e&&t===kA.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===kA.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===kA.MULTIPLE_FILES,i18nMultiFolder:e&&t===kA.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===kA.MULTIPLE_FOLDERS_I18N_ROOT||t===kA.MULTIPLE_ROOT_FOLDERS)}),NA=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,PA=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,yxe=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,bxe=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),xxe=(e,t,n)=>e?n?gA(n.file):PA(t):!1,FA=(e,t)=>{let n=jA({cmsConfig:JO.current,collection:e,file:t}),{structure:r=kA.SINGLE_FILE,locales:i=[],default_locale:a,initial_locales:o,save_all_locales:s=!0,canonical_slug:c={key:void 0,value:void 0},omit_default_locale_from_filename:l,omit_default_locale_from_file_path:u=l??!1,omit_default_locale_from_preview_path:d=!1}=n??{};n?.save_all_locales!==void 0&&kk(`save_all_locales`),l!==void 0&&kk(`omit_default_locale_from_filename`);let{key:f=AA.key,value:p=AA.value}=c,m=i.length>0,h=m?i:[`_default`],g=yxe(m,h,a),{folder:_,file:v}=e,y=_xe(r,t,_,v),b=vxe(m,y),x=!m||s===!0&&o===void 0,S=bxe(o,h,g),C=xxe(u,b,t);return y===`multiple_folders_i18n_root`&&kk(`multiple_folders_i18n_root`),{i18nEnabled:m,saveAllLocales:x,allLocales:h,defaultLocale:g,initialLocales:S,structure:y,structureMap:b,canonicalSlug:{key:f,value:p},omitDefaultLocaleFromFilePath:C,omitDefaultLocaleFromPreviewPath:d}},IA=zO(),LA=new Map,RA=({collections:e=JO.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>Bbe(e,{visible:t,type:n})),Sxe=()=>RA({visible:!0})[0],Cxe=e=>{if(!ek(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>lk.includes(e)).map(({multiple:e,name:t})=>e?`${t}.*`:t):[]},wxe=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:DA({rawCollection:e,_i18n:t}),_thumbnailFieldNames:Cxe(e)}),zA=(e,t,n)=>({...e,_i18n:t,_type:nk(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(ik).map(t=>{let n=FA(e,t),r=DA({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),BA=()=>{let e=JO.current?.singletons;if(!Array.isArray(e))return;let t=ak(e).map(e=>({...e,file:zE(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return zA(n,FA(n),t)},VA=e=>{let t=LA.get(e);if(t)return t;if(e===`_singletons`){let t=BA();return LA.set(e,t),t}let n=RA().find(t=>t.name===e);if(!n){LA.set(e,void 0);return}let r=ek(n)?n:void 0,i=tk(n)?n:void 0;if(!r&&!i){LA.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=zE(r.folder)),typeof r.file==`string`&&(r.file=zE(r.file))):i?.files.forEach(e=>{e.file&&=zE(e.file)});let a=FA(n),o=r?wxe(r,a):zA(i,a,i.files);return LA.set(e,o),o},HA=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?Y(`files`):t&&a?a:i||r},UA=e=>e?e===`_singletons`?9999999:JO.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,WA=zO(!1),GA=zO(),KA=zO([]),qA=zO([]),Txe=pA(()=>qA.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),JA=e=>{let t=Txe(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index{let n=typeof e==`string`?VA(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},ZA=(e,t)=>{let n=VA(e);if(!n)return;let r=t?XA(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},QA=e=>e.label||e.name,$A=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({_file:e,_i18n:n})=>e.fullPath===t.locales[n.defaultLocale]?.path):[],ej=(e,t)=>{let n=KA.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(!n?.filePathMap)return;let r=new Set(Object.values(n.filePathMap));return qA.current.find(e=>Object.values(e.locales).some(({path:e})=>r.has(e)))},Exe=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=JO.current;if(e===`_singletons`)return Array.isArray(r)?ak(r).findIndex(e=>e.name===t):-1;let i=RA({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1};function Dxe(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function Oxe(e){return e}function kxe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||Oxe,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=Dxe(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c0&&(l=o(c.shift()),u=o(c[0]))}d[l]=tj(e[s],t)}),a}var Axe=``,jxe=``,Mxe=/[.\uE000\uE001]/g,Nxe=/\uE001([\uE000\uE001])|\uE000/g,nj=/[\uE000\uE001]/,Pxe=`\0`,rj=/^(?:0|[1-9]\d*)$/,Fxe=e=>!Number.isNaN(Number(e))&&!rj.test(e),Ixe=e=>Fxe(e)?`${Pxe}${e}`:e,ij=e=>E(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),aj=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=aj(t)}),e):ij(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(Pxe)?e.slice(1):e,aj(t)])):e,oj=e=>e.includes(`.`)||nj.test(e)?e.replace(Mxe,e=>e===`.`?Axe:`${jxe}${e}`):e,Lxe=e=>nj.test(e)?e.replace(Nxe,(e,t)=>t??`.`):e,sj=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,Rxe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>rj.test(e)),zxe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&rj.test(e.slice(n.length).split(`.`)[0]))},cj=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&Rxe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=oj(e),o=t===void 0?a:`${t}.${a}`;sj(i)?r(i,o):n[o]=i})};return sj(e)?r(e,t):t!==void 0&&(n[t]=e),n},Bxe=e=>Ixe(Lxe(e)),lj=e=>{let t=Object.entries(e);return t.some(([,e])=>sj(e))?lj(Object.fromEntries(t.flatMap(([e,t])=>sj(t)?Object.entries(cj(t,e)):[[e,t]]))):t.some(([e])=>nj.test(e)||e.split(`.`).some(Fxe))?aj(tj(e,{transformKey:Bxe})):tj(e)},uj=e=>e?lj(Object.fromEntries(Object.entries(e).sort(([e],[t])=>VE(e,t)))):tj(e),dj=e=>e==null||e===``||Array.isArray(e)&&!e.length||ij(e)&&!Object.keys(e).length,Vxe=e=>Array.isArray(e)&&!e.length||E(e)&&!Object.keys(e).length,fj=(e,t)=>({[e]:Array.isArray(t)?[]:{},...cj(t,e)}),pj=(e,t,{live:n=!1}={})=>{let r=xO(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Vxe(a)&&i.push([`_`,a]),uj(Object.fromEntries(i))._},Hxe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Uxe=(e,t,n)=>{let r=xO(t,`${n}.`),i=[...r,n].map(e=>Hxe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:pj(t,n)}),e.subtree},mj=(e,t)=>{Object.keys(e).forEach(n=>{yO(n,t)&&delete e[n]})},Wxe=(e,t,n)=>{mj(e,t),Object.assign(e,fj(t,n))},Gxe=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),Kxe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},qxe=e=>{let t=Kxe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},Jxe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},hj=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,gj=e=>lj(Object.fromEntries(Object.entries(cj(e)).filter(([e])=>!EO(e.split(`.`).pop())))),Yxe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},Xxe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},Zxe=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),Qxe=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),$xe=/!\[(?(?:[^\]\\!]|\\(?!!\[).|!(?!\[))*)\]\((?(?:[^"()\\!]|\\(?!!\[).|!(?!\[)|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?)(?:(?(?:[^"\\!]|\\(?!!\[).|!(?!\[))*)")?\)/,_j=RegExp(`${$xe.source}|\\[!\\[(?(?:[^\\]\\\\!]|\\\\(?!!\\[).|!(?!\\[))*)\\]\\((?(?:[^"()\\\\!]|\\\\(?!!\\[).|!(?!\\[)|\\((?:[^)!]|!(?!\\[))*\\)|"(?:[^"!]|!(?!\\[))*")*?)(?:(?(?:[^"\\\\!]|\\\\(?!!\\[).|!(?!\\[))*)")?\\)\\](?:\\((?[^()]*(?:\\([^)]*\\)[^)]*|\\([^)]*)?)\\))`),vj=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),yj=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},bj={id:`image`,label:`Image`,fields:[{name:`src`,label:`Source`,widget:`image`},{name:`alt`,label:`Alt Text`,required:!1},{name:`title`,label:`Title`,required:!1}],pattern:$xe,fromBlock:e=>{let{src:t,alt:n,title:r}=e.groups??{};return{src:t,alt:n,title:r&&Zxe(r)}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return t?`![${n}](${t}${r?` "${Qxe(r)}"`:``})`:``},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return`${Gk(n)}`},htmlSelector:`img`,fromBlockHTML:vj,toBlockHTML:yj},eSe={id:`linked-image`,label:`Image`,fields:[...bj.fields,{name:`link`,label:`Link`,required:!1}],pattern:_j,fromBlock:e=>{let{src:t,alt:n,title:r,src2:i,alt2:a,title2:o,link:s}=e.groups??{};return{src:(t||i||``).trim(),alt:(n||a||``).trim(),title:Zxe(r||o||``).trim(),link:(s||``).trim()}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=t?`![${n}](${t}${r?` "${Qxe(r)}"`:``})`:``;return a&&i?`[${a}](${i})`:a},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=`${Gk(n)}`;return i?`
${a}`:a},htmlSelector:`a:has(> img:only-child), img`,fromBlockHTML:e=>{if(e.localName===`img`)return{...vj(e),link:``};if(!e.textContent?.trim())return{...vj(e.querySelector(`img`)),link:e.getAttribute(`href`)??``}},toBlockHTML:e=>{let{link:t=``}=e,n=yj(e);if(!n||!t)return n;let r=document.createElement(`a`);return r.setAttribute(`href`,t),r.append(n),r}},tSe=()=>{let e={icon:`image`,label:Y(`editor_components.image`),fields:[{name:`src`,label:Y(`editor_components.src`),widget:`image`},{name:`alt`,label:Y(`editor_components.alt`),required:!1},{name:`title`,label:Y(`editor_components.title`),required:!1}],trigger:`button`,createMarkdown:()=>`![]()`};return[{...bj,...e},{...eSe,...e,fields:[...e.fields,{name:`link`,label:Y(`editor_components.link`),required:!1}]}]},xj=e=>{if(!e)return;if(DO.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&DO.has(t)?t:void 0},Sj=e=>{let t=xj(e);if(t){let e=DO.get(t);return{...e,id:`x-${t}`,label:e.label??t}}return tSe().find(({id:t})=>t===e)},Cj=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},wj=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},Tj=e=>{let t=JO.current;return e.multiple??Cj(e.media_libraries)??wj(e.media_library)??Cj(t?.media_libraries)??wj(t?.media_library)??!1},nSe=/^\d+$/,Ej=e=>nSe.test(e),Dj=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),Oj=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},kj=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(Dj(e)),r=Oj(Math.round(Oj(n,t)),-t);return Math.sign(e)*r+0},rSe=/^(.*?)<([^>]+)>(.*)$/,Aj=new Map,jj=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},Mj=e=>{let t=e.widget??`string`;return lk.includes(t)?Tj(e):fk.includes(t)?!!e.multiple:!1},Nj=e=>{let t=e.match(rSe);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},iSe=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=Nj(t),{widget:c=`text`}=e,l=s??i,u=Ej(o),d=o===`*`;if((u||d)&&fk.includes(c))return{field:Mj(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},Pj=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),Fj=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(Aj.has(s))return Aj.get(s);let c=VA(t),l=c&&n?XA(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){Aj.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?Mk(c):void 0,f=r?Sj(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=Nj(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=iSe({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||Aj.set(s,m),m},Ij=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(Ej(e)){let e=Fj({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(fk.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=Fj({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},Lj=e=>{let t=e.widget??`string`;return ok.includes(t)?`builtin`:kO.has(t)?`custom`:`unknown`},Rj=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,zj=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return E(i)?pj(e,t)??i:i;let a=TO(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||E(i)?pj(e,t)??i:i:[]},Bj=/\.[^.]*$/,Vj=e=>{let{keyPath:t}=e;if(!t.includes(`.`))return;let n=Fj({...e,keyPath:t.replace(Bj,``)});return n?.widget===`keyvalue`?n:void 0},Hj=(e,t,{live:n=!0}={})=>{let r=`${t}.`;return xO(e,r,{live:n}).map(t=>[Lxe(t.slice(r.length)),e[t]])},Uj=(e,t,n)=>{xO(e,`${t}.`,{live:!0}).forEach(t=>{delete e[t]}),n.length&&e[t]===null&&delete e[t],n.forEach(([n,r])=>{e[`${t}.${oj(n)}`]=r})},aSe=({content:e,referenceContent:t,keyPath:n})=>{let r=Hj(e,n),i=r.map(([e])=>e),a=Hj(t,n).map(([e])=>e).filter(e=>i.includes(e)),o=[...a,...i.filter(e=>!a.includes(e))];o.some((e,t)=>e!==i[t])&&Uj(e,n,o.map(e=>r[i.indexOf(e)]))},Wj=(e,t)=>{let n=new Map;return Object.keys(e).forEach(r=>{if(!r.includes(`.`)||!t(e,r))return;let i=r.replace(Bj,``),a=n.get(i);a?a.push(r):n.set(i,[r])}),n},oSe=({draft:e,isRealKey:t,locales:n})=>{let{collectionName:r,fileName:i,isIndexFile:a,originalValues:o,currentValues:s}=e;return(n??Object.keys(s)).some(e=>{let n=s[e],c=Wj(o[e],t);return[...Wj(n,t)].some(([e,t])=>{let o=c.get(e);return t.some((e,t)=>e!==o[t])&&!!Vj({collectionName:r,fileName:i,isIndexFile:a,keyPath:t[0],valueMap:n})})})},Gj=RegExp(`\\.__sc_\\w+$`),Kj=[`collection`,`collectionFile`,`fields`,`originalEntry`],qj=0,sSe=()=>!qj,Jj=e=>{qj+=1;let t=()=>{--qj},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},Yj=e=>{Object.keys(e?.files??{}).forEach(e=>{URL.revokeObjectURL(e)})},Xj=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!Gj.test(e))),Zj=(e,t)=>!Gj.test(t)&&e[t]!==void 0,Qj=(e,t,{relative:n=!1,dropEmptyPlaceholders:r=!1}={})=>{let i=`${t}.`;return Object.fromEntries([...Object.hasOwn(e,t)?[t]:[],...xO(e,i)].filter(t=>{if(!Zj(e,t))return!1;let n=e[t];return!(r&&(E(n)||Array.isArray(n))&&!Object.keys(n).length)}).map(t=>[n?t.slice(i.length):t,e[t]]))},$j=(e,t)=>{let n=0;return Object.keys(t).some(r=>Zj(t,r)?(n+=1,!Object.hasOwn(e,r)||!(0,hr.default)(e[r],t[r])):!1)||Object.keys(e).filter(t=>Zj(e,t)).length!==n},eM=({originalLocales:e,currentLocales:t},n)=>Object.keys(n).filter(n=>e[n]!==!1||t[n]!==!1),cSe=(e,t)=>{let{originalValues:n,currentValues:r}=e;return t.length!==eM(e,n).length||t.some(e=>{let t=n[e];return!t||$j(t,r[e])})},tM=e=>{if(!e)return!1;let{originalLocales:t,currentLocales:n,originalSlugs:r,currentSlugs:i,originalPath:a,currentPath:o}=e,s=eM(e,e.currentValues);return!(0,hr.default)(t,n)||!(0,hr.default)(r,i)||zE(a??``)!==zE(o??``)||cSe(e,s)||oSe({draft:e,isRealKey:Zj,locales:s})},nM=Symbol(`valueMapVersion`),rM=e=>e?.[nM],iM=Symbol(`subtreeVersions`),lSe=class{#e=j(0);get count(){return z(this.#e)}set count(e){M(this.#e,e,!0)}},uSe=(e,t)=>{let n=e?.[iM];if(!n)return;let r=n.get(t);return r?r.count:rM(e)},aM=(e={},{onSet:t,onDelete:n}={})=>{let r=Yi(e),i=j(0),a=new Set(Object.keys(e)),o=new Map,s=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},c=e=>{s(e).forEach(e=>{o.has(e)||o.set(e,new lSe)})},l=e=>{M(i,z(i)+1),s(e).forEach(e=>{o.get(e).count+=1})};return a.forEach(e=>{c(e)}),new Proxy(r,{get:(e,t)=>t===nM?z(i):t===iM?o:e[t],ownKeys:e=>{let t=new Set(Reflect.ownKeys(e));return[...[...a].filter(e=>t.has(e)),...[...t].filter(e=>!a.has(e))]},set:(e,n,r)=>{let i=e[n];return i!==r&&(e[n]=r,a.add(n),c(n),l(n)),t?.(e,n,r,i),!0},deleteProperty:(e,t)=>{let r=e[t];return t in e&&(delete e[t],a.delete(t),l(t)),n?.(e,t,r),!0}})},oM=new WeakMap,sM=(e,t,n=`currentValues`)=>{let r=e?.[n]?.[t];if(!r)return{};let i=rM(r);if(i===void 0)return Qr(r);let a=oM.get(r);if(a?.version===i)return a.snapshot;let o=$a(()=>Qr(r));return oM.set(r,{version:i,snapshot:o}),o},cM=e=>Object.fromEntries(Object.keys(e.currentValues??{}).map(t=>[t,sM(e,t)])),lM=(e,t,n,r=`currentValues`)=>uSe(e?.[r]?.[t],n)===void 0?sM(e,t,r):$a(()=>sM(e,t,r)),uM=`entry-draft`,dM=`data-entry-draft-root`,fM=new WeakMap,dSe=e=>e&&{...e,currentValues:cM(e)},pM=class{#e=j();get current(){return z(this.#e)}set current(e){M(this.#e,e)}#t=A(()=>tM(dSe(this.current)));get modified(){return z(this.#t)}set modified(e){M(this.#t,e)}},mM=e=>ii(uM,e),hM=()=>ri(uM),gM=e=>new Map([[uM,e]]),_M=(e,t)=>{e.setAttribute(dM,``),fM.set(e,t)},fSe=e=>{let t=e?.closest(`[${dM}]`);return t?fM.get(t):void 0},vM=e=>{queueMicrotask(e)},yM=`field-editor`,bM=e=>e===`extraValues`,xM=()=>ri(yM)??{},SM=e=>{ii(yM,e)},CM=new Set,wM=zO(!1),TM=e=>{let t=()=>{CM.delete(e),wM.current=!!CM.size};CM.add(e),wM.current=!0,e.then(t,t)},EM=async()=>{for(;CM.size;)await Promise.allSettled(CM)},DM=async e=>{await EM(),e()};function pSe(e,t){O(t,!0);let n=hM(),{valueStoreKey:r=`currentValues`}=xM(),i=J(t,`currentValue`,15),a=J(t,`required`,3,!0),o=J(t,`readonly`,3,!1),s=J(t,`invalid`,3,!1),c=j(``),l=j(``),u=j(!1),d=A(()=>Dr(t.fieldConfig.default_language,`plain`)),f=A(()=>Dr(t.fieldConfig.allow_language_selection,!0)),p=A(()=>Dr(t.fieldConfig.output_code_only,!1)),m=A(()=>Dr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),h=A(()=>lM(n.current,t.locale,t.keyPath,r)),g=A(()=>`${t.keyPath}.${z(m).code}`),_=A(()=>`${t.keyPath}.${z(m).lang}`),v=()=>{if(z(p))typeof i()==`string`?z(c)!==i()&&M(c,i(),!0):M(c,``),M(l,z(d),!0);else{let e=z(h)[z(g)],t=z(h)[z(_)]||z(d);typeof e==`string`?z(c)!==e&&M(c,e,!0):M(c,``),typeof t==`string`?z(l)!==t&&M(l,t,!0):M(l,``)}},y=()=>{if(z(p)){i()!==z(c)&&i(z(c));return}let e=n.current;if(!e)return;let a={};if((!E(z(h)[t.keyPath])||Object.keys(z(h)[t.keyPath]).length)&&(a[t.keyPath]={}),z(h)[z(g)]!==z(c)&&(a[z(g)]=z(c)),z(h)[z(_)]!==z(l)&&(a[z(_)]=z(l)),!Object.keys(a).length)return;let o=e[r][t.locale];vM(()=>{Object.assign(o,a)})};WO(()=>z(h),()=>{v()}),WO(()=>[z(c),z(l)],()=>{y()}),L(()=>{if(!z(u))return;let{promise:e,resolve:t}=Promise.withResolvers();return TM(e),async()=>{await Xa(),t()}});var b=H();Co(P(b),qc,null,e=>{var n=H();wo(P(n),()=>JSON.stringify(t.fieldConfig),e=>{kve(e,{get showLanguageSwitcher(){return z(f)},flex:!0,get readonly(){return o()},get required(){return a()},get invalid(){return s()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get code(){return z(c)},set code(e){M(c,e,!0)},get lang(){return z(l)},set lang(e){M(l,e,!0)},get pending(){return z(u)},set pending(e){M(u,e,!0)}})}),U(e,n)}),U(e,b),k()}var mSe=B(`
 
`);function hSe(e,t){O(t,!0);let n=hM(),r=A(()=>Dr(t.fieldConfig.default_language,``)),i=A(()=>Dr(t.fieldConfig.output_code_only,!1)),a=A(()=>Dr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),o=A(()=>lM(n.current,t.locale,t.keyPath)),s=A(()=>`${t.keyPath}.${z(a).code}`),c=A(()=>`${t.keyPath}.${z(a).lang}`),l=A(()=>z(i)?t.currentValue:z(o)[z(s)]),u=A(()=>z(i)?z(r):z(o)[z(c)]);var d=H(),f=P(d),p=e=>{var t=mSe(),n=F(t,!0);R(()=>{Xo(t,1,Ko(z(u)?`language-${z(u)}`:void 0)),W(n,z(l))}),U(e,t)};G(f,e=>{z(l)&&e(p)}),U(e,d),k()}var OM=/^#(?[0-9a-f]{2})(?[0-9a-f]{2})(?[0-9a-f]{2})(?[0-9a-f]{2})?$/i,kM=e=>Number.parseInt(e,16),gSe=(e,{enableAlpha:t=!1}={})=>{let{r:n,g:r,b:i,a}=e?.match(OM)?.groups??{};if(!n)return``;let o=t&&a?` / ${Math.round(kM(a)/255*100)}%`:``;return`rgb(${kM(n)} ${kM(r)} ${kM(i)}${o})`},_Se=/^#[0-9a-f]{6}$/i,vSe=e=>{if(typeof e!=`string`)return;let{r:t,g:n,b:r,a:i=`ff`}=e.match(OM)?.groups??{};if(t)return{rgb:`#${t}${n}${r}`,alpha:kM(i)}},AM=({rgb:e,alpha:t,enableAlpha:n=!1})=>_Se.test(e)?n?`${e}${t.toString(16).padStart(2,`0`)}`:e:``,ySe=({currentValue:e,rgb:t,alpha:n,enableAlpha:r=!1})=>{let i=vSe(e);if(i)return i;if((e==null||e===``)&&AM({rgb:t,alpha:n,enableAlpha:r})!==``)return{rgb:``,alpha:255}},bSe=B(` `,1),xSe=B(` `),SSe=B(`
`),CSe={hash:`svelte-udhsyb`,code:`div.svelte-udhsyb {display:flex;align-items:center;gap:8px;.value:where(.svelte-udhsyb) {display:flex;align-items:center;gap:8px;.sui.text-input {width:88px;min-width:0;}.sui.slider {padding:8px;--sui-slider-base-width: 80px;}}}`};function wSe(e,t){let n=mo();O(t,!0),K(e,CSe);let r=J(t,`currentValue`,15),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=j(``),c=j(255),l=A(()=>Dr(t.fieldConfig.allowInput,!1)),u=A(()=>Dr(t.fieldConfig.enableAlpha,!1)),d={rgb:``,alpha:255},f=()=>{let e=ySe({currentValue:r(),rgb:z(s),alpha:z(c),enableAlpha:z(u)});e&&(z(s)!==e.rgb&&M(s,e.rgb,!0),z(u)&&z(c)!==e.alpha&&M(c,e.alpha,!0)),d={rgb:z(s),alpha:z(c)}},p=()=>{if(z(s)===d.rgb&&z(c)===d.alpha)return;let e=AM({rgb:z(s),alpha:z(c),enableAlpha:z(u)});r()!==e&&r(e)};WO(()=>r(),()=>{f()}),WO(()=>[z(s),z(c)],()=>{p()});var m=SSe(),h=N(m);Hye(h,{get id(){return`${n}-picker`},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}});var g=I(h,2),_=e=>{var r=xSe(),d=N(r),f=e=>{Kl(e,{dir:`ltr`,get id(){return`${n}-input`},get invalid(){return o()},get readonly(){return a()},get required(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}})};G(d,e=>{z(l)&&e(f)});var p=I(d,2),m=e=>{var t=bSe(),n=P(t),r=I(n);{let e=A(()=>!z(s)),t=A(()=>Y(`opacity`));gse(r,{min:0,max:255,get disabled(){return z(e)},get readonly(){return a()},get sliderLabel(){return z(t)},get value(){return z(c)},set value(e){M(c,e,!0)}})}R(e=>W(n,`${e??``} `),[()=>Y(`opacity`)]),U(e,t)};G(p,e=>{z(u)&&e(m)}),D(r),U(e,r)};G(g,e=>{(z(l)||z(u))&&e(_)});var v=I(g,2),y=e=>{{let t=A(()=>Y(`clear`)),r=A(()=>!z(s)),i=A(()=>`${n}-picker ${z(l)?`${n}-input`:``}`);ul(e,{variant:`tertiary`,get label(){return z(t)},get disabled(){return z(r)},get"aria-controls"(){return z(i)},onclick:()=>{M(s,``),M(c,255)}})}};G(v,e=>{!a()&&!i()&&e(y)}),D(m),U(e,m),k()}var TSe=B(`

`),ESe={hash:`svelte-1m6xsa0`,code:`.preview.svelte-1m6xsa0 {display:inline-flex;align-items:center;gap:8px;.color:where(.svelte-1m6xsa0) {display:block;width:24px;height:24px;border-radius:24px;}}`};function DSe(e,t){O(t,!0),K(e,ESe);let n=A(()=>Dr(t.fieldConfig.enableAlpha,!1)),r=A(()=>gSe(t.currentValue,{enableAlpha:z(n)}));var i=H(),a=P(i),o=e=>{var n=TSe(),i=N(n),a=N(i);let o;var s=I(a,2),c=F(s,!0),l=F(I(s,2),!0);D(i),D(n),R(()=>{o=Qo(a,``,o,{"background-color":t.currentValue}),W(c,t.currentValue),W(l,z(r))}),U(e,n)},s=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(a,e=>{z(s)&&e(o)}),U(e,i),k()}function OSe(e,t){O(t,!0);let n=J(t,`required`,3,!0),r=J(t,`readonly`,3,!1),i=J(t,`invalid`,3,!1);{let a=A(()=>String(t.currentValue));Kl(e,{dir:`auto`,get value(){return z(a)},flex:!0,get readonly(){return r()},get required(){return n()},get invalid(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}})}k()}var jM=(e,t)=>e.replaceAll(yk,(e,n)=>String(t(n)??``)),MM=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=jM(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=jM(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=jM(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&vk.test(e))&&(c=s.map(e=>typeof e==`string`?jM(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),NM=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},PM=(e,t)=>{let n=``,r=0;for(;r=e.length){n+=e.slice(i);break}}return n},FM=e=>{let t=[];return{tags:t,literals:PM(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},IM=e=>vk.test(e),kSe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`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+)?$/,h=/\[([^\]]+)]|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,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(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,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),jSe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(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`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),MSe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),LM=u(kSe(),1),RM=u(ASe(),1),zM=u(jSe(),1),BM=u(MSe(),1),VM=new Map([[`ß`,`ss`],[`ẞ`,`Ss`],[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`À`,`A`],[`Á`,`A`],[`Â`,`A`],[`Ã`,`A`],[`Ä`,`Ae`],[`Å`,`A`],[`Æ`,`AE`],[`Ç`,`C`],[`È`,`E`],[`É`,`E`],[`Ê`,`E`],[`Ë`,`E`],[`Ə`,`A`],[`Ì`,`I`],[`Í`,`I`],[`Î`,`I`],[`Ï`,`I`],[`Ð`,`D`],[`Ñ`,`N`],[`Ò`,`O`],[`Ó`,`O`],[`Ô`,`O`],[`Õ`,`O`],[`Ö`,`Oe`],[`Ō`,`O`],[`Ő`,`O`],[`Ø`,`O`],[`Œ`,`OE`],[`Ù`,`U`],[`Ú`,`U`],[`Û`,`U`],[`Ü`,`Ue`],[`Ű`,`U`],[`Ý`,`Y`],[`Þ`,`TH`],[`ß`,`ss`],[`à`,`a`],[`á`,`a`],[`â`,`a`],[`ã`,`a`],[`ä`,`ae`],[`å`,`a`],[`æ`,`ae`],[`ç`,`c`],[`è`,`e`],[`é`,`e`],[`ê`,`e`],[`ë`,`e`],[`ə`,`a`],[`ì`,`i`],[`í`,`i`],[`î`,`i`],[`ï`,`i`],[`ð`,`d`],[`ñ`,`n`],[`ò`,`o`],[`ó`,`o`],[`ô`,`o`],[`õ`,`o`],[`ö`,`oe`],[`ō`,`o`],[`ő`,`o`],[`ø`,`o`],[`œ`,`oe`],[`ù`,`u`],[`ú`,`u`],[`û`,`u`],[`ü`,`ue`],[`ű`,`u`],[`ý`,`y`],[`þ`,`th`],[`ÿ`,`y`],[`à`,`a`],[`À`,`A`],[`á`,`a`],[`Á`,`A`],[`â`,`a`],[`Â`,`A`],[`ã`,`a`],[`Ã`,`A`],[`è`,`e`],[`È`,`E`],[`é`,`e`],[`É`,`E`],[`ê`,`e`],[`Ê`,`E`],[`ì`,`i`],[`Ì`,`I`],[`í`,`i`],[`Í`,`I`],[`ò`,`o`],[`Ò`,`O`],[`ó`,`o`],[`Ó`,`O`],[`ô`,`o`],[`Ô`,`O`],[`õ`,`o`],[`Õ`,`O`],[`ù`,`u`],[`Ù`,`U`],[`ú`,`u`],[`Ú`,`U`],[`ý`,`y`],[`Ý`,`Y`],[`ă`,`a`],[`Ă`,`A`],[`Đ`,`D`],[`đ`,`d`],[`ĩ`,`i`],[`Ĩ`,`I`],[`ũ`,`u`],[`Ũ`,`U`],[`ơ`,`o`],[`Ơ`,`O`],[`ư`,`u`],[`Ư`,`U`],[`ạ`,`a`],[`Ạ`,`A`],[`ả`,`a`],[`Ả`,`A`],[`ấ`,`a`],[`Ấ`,`A`],[`ầ`,`a`],[`Ầ`,`A`],[`ẩ`,`a`],[`Ẩ`,`A`],[`ẫ`,`a`],[`Ẫ`,`A`],[`ậ`,`a`],[`Ậ`,`A`],[`ắ`,`a`],[`Ắ`,`A`],[`ằ`,`a`],[`Ằ`,`A`],[`ẳ`,`a`],[`Ẳ`,`A`],[`ẵ`,`a`],[`Ẵ`,`A`],[`ặ`,`a`],[`Ặ`,`A`],[`ẹ`,`e`],[`Ẹ`,`E`],[`ẻ`,`e`],[`Ẻ`,`E`],[`ẽ`,`e`],[`Ẽ`,`E`],[`ế`,`e`],[`Ế`,`E`],[`ề`,`e`],[`Ề`,`E`],[`ể`,`e`],[`Ể`,`E`],[`ễ`,`e`],[`Ễ`,`E`],[`ệ`,`e`],[`Ệ`,`E`],[`ỉ`,`i`],[`Ỉ`,`I`],[`ị`,`i`],[`Ị`,`I`],[`ọ`,`o`],[`Ọ`,`O`],[`ỏ`,`o`],[`Ỏ`,`O`],[`ố`,`o`],[`Ố`,`O`],[`ồ`,`o`],[`Ồ`,`O`],[`ổ`,`o`],[`Ổ`,`O`],[`ỗ`,`o`],[`Ỗ`,`O`],[`ộ`,`o`],[`Ộ`,`O`],[`ớ`,`o`],[`Ớ`,`O`],[`ờ`,`o`],[`Ờ`,`O`],[`ở`,`o`],[`Ở`,`O`],[`ỡ`,`o`],[`Ỡ`,`O`],[`ợ`,`o`],[`Ợ`,`O`],[`ụ`,`u`],[`Ụ`,`U`],[`ủ`,`u`],[`Ủ`,`U`],[`ứ`,`u`],[`Ứ`,`U`],[`ừ`,`u`],[`Ừ`,`U`],[`ử`,`u`],[`Ử`,`U`],[`ữ`,`u`],[`Ữ`,`U`],[`ự`,`u`],[`Ự`,`U`],[`ỳ`,`y`],[`Ỳ`,`Y`],[`ỵ`,`y`],[`Ỵ`,`Y`],[`ỷ`,`y`],[`Ỷ`,`Y`],[`ỹ`,`y`],[`Ỹ`,`Y`],[`ء`,`e`],[`آ`,`a`],[`أ`,`a`],[`ؤ`,`w`],[`إ`,`a`],[`ئ`,`y`],[`ا`,`a`],[`ب`,`b`],[`ة`,`t`],[`ت`,`t`],[`ث`,`th`],[`ج`,`j`],[`ح`,`h`],[`خ`,`kh`],[`د`,`d`],[`ذ`,`dh`],[`ر`,`r`],[`ز`,`z`],[`س`,`s`],[`ش`,`sh`],[`ص`,`s`],[`ض`,`d`],[`ط`,`t`],[`ظ`,`z`],[`ع`,`e`],[`غ`,`gh`],[`ـ`,`_`],[`ف`,`f`],[`ق`,`q`],[`ك`,`k`],[`ل`,`l`],[`م`,`m`],[`ن`,`n`],[`ه`,`h`],[`و`,`w`],[`ى`,`a`],[`ي`,`y`],[`َ‎`,`a`],[`ُ`,`u`],[`ِ‎`,`i`],[`٠`,`0`],[`١`,`1`],[`٢`,`2`],[`٣`,`3`],[`٤`,`4`],[`٥`,`5`],[`٦`,`6`],[`٧`,`7`],[`٨`,`8`],[`٩`,`9`],[`چ`,`ch`],[`ک`,`k`],[`گ`,`g`],[`پ`,`p`],[`ژ`,`zh`],[`ی`,`y`],[`۰`,`0`],[`۱`,`1`],[`۲`,`2`],[`۳`,`3`],[`۴`,`4`],[`۵`,`5`],[`۶`,`6`],[`۷`,`7`],[`۸`,`8`],[`۹`,`9`],[`ټ`,`p`],[`ځ`,`z`],[`څ`,`c`],[`ډ`,`d`],[`ﺫ`,`d`],[`ﺭ`,`r`],[`ړ`,`r`],[`ﺯ`,`z`],[`ږ`,`g`],[`ښ`,`x`],[`ګ`,`g`],[`ڼ`,`n`],[`ۀ`,`e`],[`ې`,`e`],[`ۍ`,`ai`],[`ٹ`,`t`],[`ڈ`,`d`],[`ڑ`,`r`],[`ں`,`n`],[`ہ`,`h`],[`ھ`,`h`],[`ے`,`e`],[`А`,`A`],[`а`,`a`],[`Б`,`B`],[`б`,`b`],[`В`,`V`],[`в`,`v`],[`Г`,`G`],[`г`,`g`],[`Д`,`D`],[`д`,`d`],[`ъе`,`ye`],[`Ъе`,`Ye`],[`ъЕ`,`yE`],[`ЪЕ`,`YE`],[`Е`,`E`],[`е`,`e`],[`Ё`,`Yo`],[`ё`,`yo`],[`Ж`,`Zh`],[`ж`,`zh`],[`З`,`Z`],[`з`,`z`],[`И`,`I`],[`и`,`i`],[`ый`,`iy`],[`Ый`,`Iy`],[`ЫЙ`,`IY`],[`ыЙ`,`iY`],[`Й`,`Y`],[`й`,`y`],[`К`,`K`],[`к`,`k`],[`Л`,`L`],[`л`,`l`],[`М`,`M`],[`м`,`m`],[`Н`,`N`],[`н`,`n`],[`О`,`O`],[`о`,`o`],[`П`,`P`],[`п`,`p`],[`Р`,`R`],[`р`,`r`],[`С`,`S`],[`с`,`s`],[`Т`,`T`],[`т`,`t`],[`У`,`U`],[`у`,`u`],[`Ф`,`F`],[`ф`,`f`],[`Х`,`Kh`],[`х`,`kh`],[`Ц`,`Ts`],[`ц`,`ts`],[`Ч`,`Ch`],[`ч`,`ch`],[`Ш`,`Sh`],[`ш`,`sh`],[`Щ`,`Sch`],[`щ`,`sch`],[`Ъ`,``],[`ъ`,``],[`Ы`,`Y`],[`ы`,`y`],[`Ь`,``],[`ь`,``],[`Э`,`E`],[`э`,`e`],[`Ю`,`Yu`],[`ю`,`yu`],[`Я`,`Ya`],[`я`,`ya`],[`ă`,`a`],[`Ă`,`A`],[`ș`,`s`],[`Ș`,`S`],[`ț`,`t`],[`Ț`,`T`],[`ţ`,`t`],[`Ţ`,`T`],[`ş`,`s`],[`Ş`,`S`],[`ç`,`c`],[`Ç`,`C`],[`ğ`,`g`],[`Ğ`,`G`],[`ı`,`i`],[`İ`,`I`],[`ա`,`a`],[`Ա`,`A`],[`բ`,`b`],[`Բ`,`B`],[`գ`,`g`],[`Գ`,`G`],[`դ`,`d`],[`Դ`,`D`],[`ե`,`ye`],[`Ե`,`Ye`],[`զ`,`z`],[`Զ`,`Z`],[`է`,`e`],[`Է`,`E`],[`ը`,`y`],[`Ը`,`Y`],[`թ`,`t`],[`Թ`,`T`],[`ժ`,`zh`],[`Ժ`,`Zh`],[`ի`,`i`],[`Ի`,`I`],[`լ`,`l`],[`Լ`,`L`],[`խ`,`kh`],[`Խ`,`Kh`],[`ծ`,`ts`],[`Ծ`,`Ts`],[`կ`,`k`],[`Կ`,`K`],[`հ`,`h`],[`Հ`,`H`],[`ձ`,`dz`],[`Ձ`,`Dz`],[`ղ`,`gh`],[`Ղ`,`Gh`],[`ճ`,`tch`],[`Ճ`,`Tch`],[`մ`,`m`],[`Մ`,`M`],[`յ`,`y`],[`Յ`,`Y`],[`ն`,`n`],[`Ն`,`N`],[`շ`,`sh`],[`Շ`,`Sh`],[`ու`,`u`],[`ՈՒ`,`U`],[`Ու`,`U`],[`ո`,`vo`],[`Ո`,`Vo`],[`չ`,`ch`],[`Չ`,`Ch`],[`պ`,`p`],[`Պ`,`P`],[`ջ`,`j`],[`Ջ`,`J`],[`ռ`,`r`],[`Ռ`,`R`],[`ս`,`s`],[`Ս`,`S`],[`վ`,`v`],[`Վ`,`V`],[`տ`,`t`],[`Տ`,`T`],[`ր`,`r`],[`Ր`,`R`],[`ց`,`c`],[`Ց`,`C`],[`փ`,`p`],[`Փ`,`P`],[`ք`,`q`],[`Ք`,`Q`],[`օ`,`o`],[`Օ`,`O`],[`ֆ`,`f`],[`Ֆ`,`F`],[`և`,`yev`],[`ა`,`a`],[`ბ`,`b`],[`გ`,`g`],[`დ`,`d`],[`ე`,`e`],[`ვ`,`v`],[`ზ`,`z`],[`თ`,`t`],[`ი`,`i`],[`კ`,`k`],[`ლ`,`l`],[`მ`,`m`],[`ნ`,`n`],[`ო`,`o`],[`პ`,`p`],[`ჟ`,`zh`],[`რ`,`r`],[`ს`,`s`],[`ტ`,`t`],[`უ`,`u`],[`ფ`,`ph`],[`ქ`,`q`],[`ღ`,`gh`],[`ყ`,`k`],[`შ`,`sh`],[`ჩ`,`ch`],[`ც`,`ts`],[`ძ`,`dz`],[`წ`,`ts`],[`ჭ`,`tch`],[`ხ`,`kh`],[`ჯ`,`j`],[`ჰ`,`h`],[`č`,`c`],[`ď`,`d`],[`ě`,`e`],[`ň`,`n`],[`ř`,`r`],[`š`,`s`],[`ť`,`t`],[`ů`,`u`],[`ž`,`z`],[`Č`,`C`],[`Ď`,`D`],[`Ě`,`E`],[`Ň`,`N`],[`Ř`,`R`],[`Š`,`S`],[`Ť`,`T`],[`Ů`,`U`],[`Ž`,`Z`],[`ހ`,`h`],[`ށ`,`sh`],[`ނ`,`n`],[`ރ`,`r`],[`ބ`,`b`],[`ޅ`,`lh`],[`ކ`,`k`],[`އ`,`a`],[`ވ`,`v`],[`މ`,`m`],[`ފ`,`f`],[`ދ`,`dh`],[`ތ`,`th`],[`ލ`,`l`],[`ގ`,`g`],[`ޏ`,`gn`],[`ސ`,`s`],[`ޑ`,`d`],[`ޒ`,`z`],[`ޓ`,`t`],[`ޔ`,`y`],[`ޕ`,`p`],[`ޖ`,`j`],[`ޗ`,`ch`],[`ޘ`,`tt`],[`ޙ`,`hh`],[`ޚ`,`kh`],[`ޛ`,`th`],[`ޜ`,`z`],[`ޝ`,`sh`],[`ޞ`,`s`],[`ޟ`,`d`],[`ޠ`,`t`],[`ޡ`,`z`],[`ޢ`,`a`],[`ޣ`,`gh`],[`ޤ`,`q`],[`ޥ`,`w`],[`ަ`,`a`],[`ާ`,`aa`],[`ި`,`i`],[`ީ`,`ee`],[`ު`,`u`],[`ޫ`,`oo`],[`ެ`,`e`],[`ޭ`,`ey`],[`ޮ`,`o`],[`ޯ`,`oa`],[`ް`,``],[`α`,`a`],[`β`,`v`],[`γ`,`g`],[`δ`,`d`],[`ε`,`e`],[`ζ`,`z`],[`η`,`i`],[`θ`,`th`],[`ι`,`i`],[`κ`,`k`],[`λ`,`l`],[`μ`,`m`],[`ν`,`n`],[`ξ`,`ks`],[`ο`,`o`],[`π`,`p`],[`ρ`,`r`],[`σ`,`s`],[`τ`,`t`],[`υ`,`y`],[`φ`,`f`],[`χ`,`x`],[`ψ`,`ps`],[`ω`,`o`],[`ά`,`a`],[`έ`,`e`],[`ί`,`i`],[`ό`,`o`],[`ύ`,`y`],[`ή`,`i`],[`ώ`,`o`],[`ς`,`s`],[`ϊ`,`i`],[`ΰ`,`y`],[`ϋ`,`y`],[`ΐ`,`i`],[`Α`,`A`],[`Β`,`B`],[`Γ`,`G`],[`Δ`,`D`],[`Ε`,`E`],[`Ζ`,`Z`],[`Η`,`I`],[`Θ`,`TH`],[`Ι`,`I`],[`Κ`,`K`],[`Λ`,`L`],[`Μ`,`M`],[`Ν`,`N`],[`Ξ`,`KS`],[`Ο`,`O`],[`Π`,`P`],[`Ρ`,`R`],[`Σ`,`S`],[`Τ`,`T`],[`Υ`,`Y`],[`Φ`,`F`],[`Χ`,`X`],[`Ψ`,`PS`],[`Ω`,`O`],[`Ά`,`A`],[`Έ`,`E`],[`Ί`,`I`],[`Ό`,`O`],[`Ύ`,`Y`],[`Ή`,`I`],[`Ώ`,`O`],[`Ϊ`,`I`],[`Ϋ`,`Y`],[`ā`,`a`],[`ē`,`e`],[`ģ`,`g`],[`ī`,`i`],[`ķ`,`k`],[`ļ`,`l`],[`ņ`,`n`],[`ū`,`u`],[`Ā`,`A`],[`Ē`,`E`],[`Ģ`,`G`],[`Ī`,`I`],[`Ķ`,`K`],[`Ļ`,`L`],[`Ņ`,`N`],[`Ū`,`U`],[`č`,`c`],[`š`,`s`],[`ž`,`z`],[`Č`,`C`],[`Š`,`S`],[`Ž`,`Z`],[`ą`,`a`],[`č`,`c`],[`ę`,`e`],[`ė`,`e`],[`į`,`i`],[`š`,`s`],[`ų`,`u`],[`ū`,`u`],[`ž`,`z`],[`Ą`,`A`],[`Č`,`C`],[`Ę`,`E`],[`Ė`,`E`],[`Į`,`I`],[`Š`,`S`],[`Ų`,`U`],[`Ū`,`U`],[`Ќ`,`Kj`],[`ќ`,`kj`],[`Љ`,`Lj`],[`љ`,`lj`],[`Њ`,`Nj`],[`њ`,`nj`],[`Тс`,`Ts`],[`тс`,`ts`],[`ą`,`a`],[`ć`,`c`],[`ę`,`e`],[`ł`,`l`],[`ń`,`n`],[`ś`,`s`],[`ź`,`z`],[`ż`,`z`],[`Ą`,`A`],[`Ć`,`C`],[`Ę`,`E`],[`Ł`,`L`],[`Ń`,`N`],[`Ś`,`S`],[`Ź`,`Z`],[`Ż`,`Z`],[`Є`,`Ye`],[`І`,`I`],[`Ї`,`Yi`],[`Ґ`,`G`],[`є`,`ye`],[`і`,`i`],[`ї`,`yi`],[`ґ`,`g`],[`IJ`,`IJ`],[`ij`,`ij`],[`¢`,`c`],[`¥`,`Y`],[`߿`,`b`],[`৳`,`t`],[`૱`,`Bo`],[`฿`,`B`],[`₠`,`CE`],[`₡`,`C`],[`₢`,`Cr`],[`₣`,`F`],[`₥`,`m`],[`₦`,`N`],[`₧`,`Pt`],[`₨`,`Rs`],[`₩`,`W`],[`₫`,`s`],[`€`,`E`],[`₭`,`K`],[`₮`,`T`],[`₯`,`Dp`],[`₰`,`S`],[`₱`,`P`],[`₲`,`G`],[`₳`,`A`],[`₴`,`S`],[`₵`,`C`],[`₶`,`tt`],[`₷`,`S`],[`₸`,`T`],[`₹`,`R`],[`₺`,`L`],[`₽`,`P`],[`₿`,`B`],[`﹩`,`$`],[`¢`,`c`],[`¥`,`Y`],[`₩`,`W`],[`𝐀`,`A`],[`𝐁`,`B`],[`𝐂`,`C`],[`𝐃`,`D`],[`𝐄`,`E`],[`𝐅`,`F`],[`𝐆`,`G`],[`𝐇`,`H`],[`𝐈`,`I`],[`𝐉`,`J`],[`𝐊`,`K`],[`𝐋`,`L`],[`𝐌`,`M`],[`𝐍`,`N`],[`𝐎`,`O`],[`𝐏`,`P`],[`𝐐`,`Q`],[`𝐑`,`R`],[`𝐒`,`S`],[`𝐓`,`T`],[`𝐔`,`U`],[`𝐕`,`V`],[`𝐖`,`W`],[`𝐗`,`X`],[`𝐘`,`Y`],[`𝐙`,`Z`],[`𝐚`,`a`],[`𝐛`,`b`],[`𝐜`,`c`],[`𝐝`,`d`],[`𝐞`,`e`],[`𝐟`,`f`],[`𝐠`,`g`],[`𝐡`,`h`],[`𝐢`,`i`],[`𝐣`,`j`],[`𝐤`,`k`],[`𝐥`,`l`],[`𝐦`,`m`],[`𝐧`,`n`],[`𝐨`,`o`],[`𝐩`,`p`],[`𝐪`,`q`],[`𝐫`,`r`],[`𝐬`,`s`],[`𝐭`,`t`],[`𝐮`,`u`],[`𝐯`,`v`],[`𝐰`,`w`],[`𝐱`,`x`],[`𝐲`,`y`],[`𝐳`,`z`],[`𝐴`,`A`],[`𝐵`,`B`],[`𝐶`,`C`],[`𝐷`,`D`],[`𝐸`,`E`],[`𝐹`,`F`],[`𝐺`,`G`],[`𝐻`,`H`],[`𝐼`,`I`],[`𝐽`,`J`],[`𝐾`,`K`],[`𝐿`,`L`],[`𝑀`,`M`],[`𝑁`,`N`],[`𝑂`,`O`],[`𝑃`,`P`],[`𝑄`,`Q`],[`𝑅`,`R`],[`𝑆`,`S`],[`𝑇`,`T`],[`𝑈`,`U`],[`𝑉`,`V`],[`𝑊`,`W`],[`𝑋`,`X`],[`𝑌`,`Y`],[`𝑍`,`Z`],[`𝑎`,`a`],[`𝑏`,`b`],[`𝑐`,`c`],[`𝑑`,`d`],[`𝑒`,`e`],[`𝑓`,`f`],[`𝑔`,`g`],[`𝑖`,`i`],[`𝑗`,`j`],[`𝑘`,`k`],[`𝑙`,`l`],[`𝑚`,`m`],[`𝑛`,`n`],[`𝑜`,`o`],[`𝑝`,`p`],[`𝑞`,`q`],[`𝑟`,`r`],[`𝑠`,`s`],[`𝑡`,`t`],[`𝑢`,`u`],[`𝑣`,`v`],[`𝑤`,`w`],[`𝑥`,`x`],[`𝑦`,`y`],[`𝑧`,`z`],[`𝑨`,`A`],[`𝑩`,`B`],[`𝑪`,`C`],[`𝑫`,`D`],[`𝑬`,`E`],[`𝑭`,`F`],[`𝑮`,`G`],[`𝑯`,`H`],[`𝑰`,`I`],[`𝑱`,`J`],[`𝑲`,`K`],[`𝑳`,`L`],[`𝑴`,`M`],[`𝑵`,`N`],[`𝑶`,`O`],[`𝑷`,`P`],[`𝑸`,`Q`],[`𝑹`,`R`],[`𝑺`,`S`],[`𝑻`,`T`],[`𝑼`,`U`],[`𝑽`,`V`],[`𝑾`,`W`],[`𝑿`,`X`],[`𝒀`,`Y`],[`𝒁`,`Z`],[`𝒂`,`a`],[`𝒃`,`b`],[`𝒄`,`c`],[`𝒅`,`d`],[`𝒆`,`e`],[`𝒇`,`f`],[`𝒈`,`g`],[`𝒉`,`h`],[`𝒊`,`i`],[`𝒋`,`j`],[`𝒌`,`k`],[`𝒍`,`l`],[`𝒎`,`m`],[`𝒏`,`n`],[`𝒐`,`o`],[`𝒑`,`p`],[`𝒒`,`q`],[`𝒓`,`r`],[`𝒔`,`s`],[`𝒕`,`t`],[`𝒖`,`u`],[`𝒗`,`v`],[`𝒘`,`w`],[`𝒙`,`x`],[`𝒚`,`y`],[`𝒛`,`z`],[`𝒜`,`A`],[`𝒞`,`C`],[`𝒟`,`D`],[`𝒢`,`g`],[`𝒥`,`J`],[`𝒦`,`K`],[`𝒩`,`N`],[`𝒪`,`O`],[`𝒫`,`P`],[`𝒬`,`Q`],[`𝒮`,`S`],[`𝒯`,`T`],[`𝒰`,`U`],[`𝒱`,`V`],[`𝒲`,`W`],[`𝒳`,`X`],[`𝒴`,`Y`],[`𝒵`,`Z`],[`𝒶`,`a`],[`𝒷`,`b`],[`𝒸`,`c`],[`𝒹`,`d`],[`𝒻`,`f`],[`𝒽`,`h`],[`𝒾`,`i`],[`𝒿`,`j`],[`𝓀`,`k`],[`𝓁`,`l`],[`𝓂`,`m`],[`𝓃`,`n`],[`𝓅`,`p`],[`𝓆`,`q`],[`𝓇`,`r`],[`𝓈`,`s`],[`𝓉`,`t`],[`𝓊`,`u`],[`𝓋`,`v`],[`𝓌`,`w`],[`𝓍`,`x`],[`𝓎`,`y`],[`𝓏`,`z`],[`𝓐`,`A`],[`𝓑`,`B`],[`𝓒`,`C`],[`𝓓`,`D`],[`𝓔`,`E`],[`𝓕`,`F`],[`𝓖`,`G`],[`𝓗`,`H`],[`𝓘`,`I`],[`𝓙`,`J`],[`𝓚`,`K`],[`𝓛`,`L`],[`𝓜`,`M`],[`𝓝`,`N`],[`𝓞`,`O`],[`𝓟`,`P`],[`𝓠`,`Q`],[`𝓡`,`R`],[`𝓢`,`S`],[`𝓣`,`T`],[`𝓤`,`U`],[`𝓥`,`V`],[`𝓦`,`W`],[`𝓧`,`X`],[`𝓨`,`Y`],[`𝓩`,`Z`],[`𝓪`,`a`],[`𝓫`,`b`],[`𝓬`,`c`],[`𝓭`,`d`],[`𝓮`,`e`],[`𝓯`,`f`],[`𝓰`,`g`],[`𝓱`,`h`],[`𝓲`,`i`],[`𝓳`,`j`],[`𝓴`,`k`],[`𝓵`,`l`],[`𝓶`,`m`],[`𝓷`,`n`],[`𝓸`,`o`],[`𝓹`,`p`],[`𝓺`,`q`],[`𝓻`,`r`],[`𝓼`,`s`],[`𝓽`,`t`],[`𝓾`,`u`],[`𝓿`,`v`],[`𝔀`,`w`],[`𝔁`,`x`],[`𝔂`,`y`],[`𝔃`,`z`],[`𝔄`,`A`],[`𝔅`,`B`],[`𝔇`,`D`],[`𝔈`,`E`],[`𝔉`,`F`],[`𝔊`,`G`],[`𝔍`,`J`],[`𝔎`,`K`],[`𝔏`,`L`],[`𝔐`,`M`],[`𝔑`,`N`],[`𝔒`,`O`],[`𝔓`,`P`],[`𝔔`,`Q`],[`𝔖`,`S`],[`𝔗`,`T`],[`𝔘`,`U`],[`𝔙`,`V`],[`𝔚`,`W`],[`𝔛`,`X`],[`𝔜`,`Y`],[`𝔞`,`a`],[`𝔟`,`b`],[`𝔠`,`c`],[`𝔡`,`d`],[`𝔢`,`e`],[`𝔣`,`f`],[`𝔤`,`g`],[`𝔥`,`h`],[`𝔦`,`i`],[`𝔧`,`j`],[`𝔨`,`k`],[`𝔩`,`l`],[`𝔪`,`m`],[`𝔫`,`n`],[`𝔬`,`o`],[`𝔭`,`p`],[`𝔮`,`q`],[`𝔯`,`r`],[`𝔰`,`s`],[`𝔱`,`t`],[`𝔲`,`u`],[`𝔳`,`v`],[`𝔴`,`w`],[`𝔵`,`x`],[`𝔶`,`y`],[`𝔷`,`z`],[`𝔸`,`A`],[`𝔹`,`B`],[`𝔻`,`D`],[`𝔼`,`E`],[`𝔽`,`F`],[`𝔾`,`G`],[`𝕀`,`I`],[`𝕁`,`J`],[`𝕂`,`K`],[`𝕃`,`L`],[`𝕄`,`M`],[`𝕆`,`O`],[`𝕊`,`S`],[`𝕋`,`T`],[`𝕌`,`U`],[`𝕍`,`V`],[`𝕎`,`W`],[`𝕏`,`X`],[`𝕐`,`Y`],[`𝕒`,`a`],[`𝕓`,`b`],[`𝕔`,`c`],[`𝕕`,`d`],[`𝕖`,`e`],[`𝕗`,`f`],[`𝕘`,`g`],[`𝕙`,`h`],[`𝕚`,`i`],[`𝕛`,`j`],[`𝕜`,`k`],[`𝕝`,`l`],[`𝕞`,`m`],[`𝕟`,`n`],[`𝕠`,`o`],[`𝕡`,`p`],[`𝕢`,`q`],[`𝕣`,`r`],[`𝕤`,`s`],[`𝕥`,`t`],[`𝕦`,`u`],[`𝕧`,`v`],[`𝕨`,`w`],[`𝕩`,`x`],[`𝕪`,`y`],[`𝕫`,`z`],[`𝕬`,`A`],[`𝕭`,`B`],[`𝕮`,`C`],[`𝕯`,`D`],[`𝕰`,`E`],[`𝕱`,`F`],[`𝕲`,`G`],[`𝕳`,`H`],[`𝕴`,`I`],[`𝕵`,`J`],[`𝕶`,`K`],[`𝕷`,`L`],[`𝕸`,`M`],[`𝕹`,`N`],[`𝕺`,`O`],[`𝕻`,`P`],[`𝕼`,`Q`],[`𝕽`,`R`],[`𝕾`,`S`],[`𝕿`,`T`],[`𝖀`,`U`],[`𝖁`,`V`],[`𝖂`,`W`],[`𝖃`,`X`],[`𝖄`,`Y`],[`𝖅`,`Z`],[`𝖆`,`a`],[`𝖇`,`b`],[`𝖈`,`c`],[`𝖉`,`d`],[`𝖊`,`e`],[`𝖋`,`f`],[`𝖌`,`g`],[`𝖍`,`h`],[`𝖎`,`i`],[`𝖏`,`j`],[`𝖐`,`k`],[`𝖑`,`l`],[`𝖒`,`m`],[`𝖓`,`n`],[`𝖔`,`o`],[`𝖕`,`p`],[`𝖖`,`q`],[`𝖗`,`r`],[`𝖘`,`s`],[`𝖙`,`t`],[`𝖚`,`u`],[`𝖛`,`v`],[`𝖜`,`w`],[`𝖝`,`x`],[`𝖞`,`y`],[`𝖟`,`z`],[`𝖠`,`A`],[`𝖡`,`B`],[`𝖢`,`C`],[`𝖣`,`D`],[`𝖤`,`E`],[`𝖥`,`F`],[`𝖦`,`G`],[`𝖧`,`H`],[`𝖨`,`I`],[`𝖩`,`J`],[`𝖪`,`K`],[`𝖫`,`L`],[`𝖬`,`M`],[`𝖭`,`N`],[`𝖮`,`O`],[`𝖯`,`P`],[`𝖰`,`Q`],[`𝖱`,`R`],[`𝖲`,`S`],[`𝖳`,`T`],[`𝖴`,`U`],[`𝖵`,`V`],[`𝖶`,`W`],[`𝖷`,`X`],[`𝖸`,`Y`],[`𝖹`,`Z`],[`𝖺`,`a`],[`𝖻`,`b`],[`𝖼`,`c`],[`𝖽`,`d`],[`𝖾`,`e`],[`𝖿`,`f`],[`𝗀`,`g`],[`𝗁`,`h`],[`𝗂`,`i`],[`𝗃`,`j`],[`𝗄`,`k`],[`𝗅`,`l`],[`𝗆`,`m`],[`𝗇`,`n`],[`𝗈`,`o`],[`𝗉`,`p`],[`𝗊`,`q`],[`𝗋`,`r`],[`𝗌`,`s`],[`𝗍`,`t`],[`𝗎`,`u`],[`𝗏`,`v`],[`𝗐`,`w`],[`𝗑`,`x`],[`𝗒`,`y`],[`𝗓`,`z`],[`𝗔`,`A`],[`𝗕`,`B`],[`𝗖`,`C`],[`𝗗`,`D`],[`𝗘`,`E`],[`𝗙`,`F`],[`𝗚`,`G`],[`𝗛`,`H`],[`𝗜`,`I`],[`𝗝`,`J`],[`𝗞`,`K`],[`𝗟`,`L`],[`𝗠`,`M`],[`𝗡`,`N`],[`𝗢`,`O`],[`𝗣`,`P`],[`𝗤`,`Q`],[`𝗥`,`R`],[`𝗦`,`S`],[`𝗧`,`T`],[`𝗨`,`U`],[`𝗩`,`V`],[`𝗪`,`W`],[`𝗫`,`X`],[`𝗬`,`Y`],[`𝗭`,`Z`],[`𝗮`,`a`],[`𝗯`,`b`],[`𝗰`,`c`],[`𝗱`,`d`],[`𝗲`,`e`],[`𝗳`,`f`],[`𝗴`,`g`],[`𝗵`,`h`],[`𝗶`,`i`],[`𝗷`,`j`],[`𝗸`,`k`],[`𝗹`,`l`],[`𝗺`,`m`],[`𝗻`,`n`],[`𝗼`,`o`],[`𝗽`,`p`],[`𝗾`,`q`],[`𝗿`,`r`],[`𝘀`,`s`],[`𝘁`,`t`],[`𝘂`,`u`],[`𝘃`,`v`],[`𝘄`,`w`],[`𝘅`,`x`],[`𝘆`,`y`],[`𝘇`,`z`],[`𝘈`,`A`],[`𝘉`,`B`],[`𝘊`,`C`],[`𝘋`,`D`],[`𝘌`,`E`],[`𝘍`,`F`],[`𝘎`,`G`],[`𝘏`,`H`],[`𝘐`,`I`],[`𝘑`,`J`],[`𝘒`,`K`],[`𝘓`,`L`],[`𝘔`,`M`],[`𝘕`,`N`],[`𝘖`,`O`],[`𝘗`,`P`],[`𝘘`,`Q`],[`𝘙`,`R`],[`𝘚`,`S`],[`𝘛`,`T`],[`𝘜`,`U`],[`𝘝`,`V`],[`𝘞`,`W`],[`𝘟`,`X`],[`𝘠`,`Y`],[`𝘡`,`Z`],[`𝘢`,`a`],[`𝘣`,`b`],[`𝘤`,`c`],[`𝘥`,`d`],[`𝘦`,`e`],[`𝘧`,`f`],[`𝘨`,`g`],[`𝘩`,`h`],[`𝘪`,`i`],[`𝘫`,`j`],[`𝘬`,`k`],[`𝘭`,`l`],[`𝘮`,`m`],[`𝘯`,`n`],[`𝘰`,`o`],[`𝘱`,`p`],[`𝘲`,`q`],[`𝘳`,`r`],[`𝘴`,`s`],[`𝘵`,`t`],[`𝘶`,`u`],[`𝘷`,`v`],[`𝘸`,`w`],[`𝘹`,`x`],[`𝘺`,`y`],[`𝘻`,`z`],[`𝘼`,`A`],[`𝘽`,`B`],[`𝘾`,`C`],[`𝘿`,`D`],[`𝙀`,`E`],[`𝙁`,`F`],[`𝙂`,`G`],[`𝙃`,`H`],[`𝙄`,`I`],[`𝙅`,`J`],[`𝙆`,`K`],[`𝙇`,`L`],[`𝙈`,`M`],[`𝙉`,`N`],[`𝙊`,`O`],[`𝙋`,`P`],[`𝙌`,`Q`],[`𝙍`,`R`],[`𝙎`,`S`],[`𝙏`,`T`],[`𝙐`,`U`],[`𝙑`,`V`],[`𝙒`,`W`],[`𝙓`,`X`],[`𝙔`,`Y`],[`𝙕`,`Z`],[`𝙖`,`a`],[`𝙗`,`b`],[`𝙘`,`c`],[`𝙙`,`d`],[`𝙚`,`e`],[`𝙛`,`f`],[`𝙜`,`g`],[`𝙝`,`h`],[`𝙞`,`i`],[`𝙟`,`j`],[`𝙠`,`k`],[`𝙡`,`l`],[`𝙢`,`m`],[`𝙣`,`n`],[`𝙤`,`o`],[`𝙥`,`p`],[`𝙦`,`q`],[`𝙧`,`r`],[`𝙨`,`s`],[`𝙩`,`t`],[`𝙪`,`u`],[`𝙫`,`v`],[`𝙬`,`w`],[`𝙭`,`x`],[`𝙮`,`y`],[`𝙯`,`z`],[`𝙰`,`A`],[`𝙱`,`B`],[`𝙲`,`C`],[`𝙳`,`D`],[`𝙴`,`E`],[`𝙵`,`F`],[`𝙶`,`G`],[`𝙷`,`H`],[`𝙸`,`I`],[`𝙹`,`J`],[`𝙺`,`K`],[`𝙻`,`L`],[`𝙼`,`M`],[`𝙽`,`N`],[`𝙾`,`O`],[`𝙿`,`P`],[`𝚀`,`Q`],[`𝚁`,`R`],[`𝚂`,`S`],[`𝚃`,`T`],[`𝚄`,`U`],[`𝚅`,`V`],[`𝚆`,`W`],[`𝚇`,`X`],[`𝚈`,`Y`],[`𝚉`,`Z`],[`𝚊`,`a`],[`𝚋`,`b`],[`𝚌`,`c`],[`𝚍`,`d`],[`𝚎`,`e`],[`𝚏`,`f`],[`𝚐`,`g`],[`𝚑`,`h`],[`𝚒`,`i`],[`𝚓`,`j`],[`𝚔`,`k`],[`𝚕`,`l`],[`𝚖`,`m`],[`𝚗`,`n`],[`𝚘`,`o`],[`𝚙`,`p`],[`𝚚`,`q`],[`𝚛`,`r`],[`𝚜`,`s`],[`𝚝`,`t`],[`𝚞`,`u`],[`𝚟`,`v`],[`𝚠`,`w`],[`𝚡`,`x`],[`𝚢`,`y`],[`𝚣`,`z`],[`𝚤`,`l`],[`𝚥`,`j`],[`𝛢`,`A`],[`𝛣`,`B`],[`𝛤`,`G`],[`𝛥`,`D`],[`𝛦`,`E`],[`𝛧`,`Z`],[`𝛨`,`I`],[`𝛩`,`TH`],[`𝛪`,`I`],[`𝛫`,`K`],[`𝛬`,`L`],[`𝛭`,`M`],[`𝛮`,`N`],[`𝛯`,`KS`],[`𝛰`,`O`],[`𝛱`,`P`],[`𝛲`,`R`],[`𝛳`,`TH`],[`𝛴`,`S`],[`𝛵`,`T`],[`𝛶`,`Y`],[`𝛷`,`F`],[`𝛸`,`x`],[`𝛹`,`PS`],[`𝛺`,`O`],[`𝛻`,`D`],[`𝛼`,`a`],[`𝛽`,`b`],[`𝛾`,`g`],[`𝛿`,`d`],[`𝜀`,`e`],[`𝜁`,`z`],[`𝜂`,`i`],[`𝜃`,`th`],[`𝜄`,`i`],[`𝜅`,`k`],[`𝜆`,`l`],[`𝜇`,`m`],[`𝜈`,`n`],[`𝜉`,`ks`],[`𝜊`,`o`],[`𝜋`,`p`],[`𝜌`,`r`],[`𝜍`,`s`],[`𝜎`,`s`],[`𝜏`,`t`],[`𝜐`,`y`],[`𝜑`,`f`],[`𝜒`,`x`],[`𝜓`,`ps`],[`𝜔`,`o`],[`𝜕`,`d`],[`𝜖`,`E`],[`𝜗`,`TH`],[`𝜘`,`K`],[`𝜙`,`f`],[`𝜚`,`r`],[`𝜛`,`p`],[`𝜜`,`A`],[`𝜝`,`V`],[`𝜞`,`G`],[`𝜟`,`D`],[`𝜠`,`E`],[`𝜡`,`Z`],[`𝜢`,`I`],[`𝜣`,`TH`],[`𝜤`,`I`],[`𝜥`,`K`],[`𝜦`,`L`],[`𝜧`,`M`],[`𝜨`,`N`],[`𝜩`,`KS`],[`𝜪`,`O`],[`𝜫`,`P`],[`𝜬`,`S`],[`𝜭`,`TH`],[`𝜮`,`S`],[`𝜯`,`T`],[`𝜰`,`Y`],[`𝜱`,`F`],[`𝜲`,`X`],[`𝜳`,`PS`],[`𝜴`,`O`],[`𝜵`,`D`],[`𝜶`,`a`],[`𝜷`,`v`],[`𝜸`,`g`],[`𝜹`,`d`],[`𝜺`,`e`],[`𝜻`,`z`],[`𝜼`,`i`],[`𝜽`,`th`],[`𝜾`,`i`],[`𝜿`,`k`],[`𝝀`,`l`],[`𝝁`,`m`],[`𝝂`,`n`],[`𝝃`,`ks`],[`𝝄`,`o`],[`𝝅`,`p`],[`𝝆`,`r`],[`𝝇`,`s`],[`𝝈`,`s`],[`𝝉`,`t`],[`𝝊`,`y`],[`𝝋`,`f`],[`𝝌`,`x`],[`𝝍`,`ps`],[`𝝎`,`o`],[`𝝏`,`a`],[`𝝐`,`e`],[`𝝑`,`i`],[`𝝒`,`k`],[`𝝓`,`f`],[`𝝔`,`r`],[`𝝕`,`p`],[`𝝖`,`A`],[`𝝗`,`B`],[`𝝘`,`G`],[`𝝙`,`D`],[`𝝚`,`E`],[`𝝛`,`Z`],[`𝝜`,`I`],[`𝝝`,`TH`],[`𝝞`,`I`],[`𝝟`,`K`],[`𝝠`,`L`],[`𝝡`,`M`],[`𝝢`,`N`],[`𝝣`,`KS`],[`𝝤`,`O`],[`𝝥`,`P`],[`𝝦`,`R`],[`𝝧`,`TH`],[`𝝨`,`S`],[`𝝩`,`T`],[`𝝪`,`Y`],[`𝝫`,`F`],[`𝝬`,`X`],[`𝝭`,`PS`],[`𝝮`,`O`],[`𝝯`,`D`],[`𝝰`,`a`],[`𝝱`,`v`],[`𝝲`,`g`],[`𝝳`,`d`],[`𝝴`,`e`],[`𝝵`,`z`],[`𝝶`,`i`],[`𝝷`,`th`],[`𝝸`,`i`],[`𝝹`,`k`],[`𝝺`,`l`],[`𝝻`,`m`],[`𝝼`,`n`],[`𝝽`,`ks`],[`𝝾`,`o`],[`𝝿`,`p`],[`𝞀`,`r`],[`𝞁`,`s`],[`𝞂`,`s`],[`𝞃`,`t`],[`𝞄`,`y`],[`𝞅`,`f`],[`𝞆`,`x`],[`𝞇`,`ps`],[`𝞈`,`o`],[`𝞉`,`a`],[`𝞊`,`e`],[`𝞋`,`i`],[`𝞌`,`k`],[`𝞍`,`f`],[`𝞎`,`r`],[`𝞏`,`p`],[`𝞐`,`A`],[`𝞑`,`V`],[`𝞒`,`G`],[`𝞓`,`D`],[`𝞔`,`E`],[`𝞕`,`Z`],[`𝞖`,`I`],[`𝞗`,`TH`],[`𝞘`,`I`],[`𝞙`,`K`],[`𝞚`,`L`],[`𝞛`,`M`],[`𝞜`,`N`],[`𝞝`,`KS`],[`𝞞`,`O`],[`𝞟`,`P`],[`𝞠`,`S`],[`𝞡`,`TH`],[`𝞢`,`S`],[`𝞣`,`T`],[`𝞤`,`Y`],[`𝞥`,`F`],[`𝞦`,`X`],[`𝞧`,`PS`],[`𝞨`,`O`],[`𝞩`,`D`],[`𝞪`,`av`],[`𝞫`,`g`],[`𝞬`,`d`],[`𝞭`,`e`],[`𝞮`,`z`],[`𝞯`,`i`],[`𝞰`,`i`],[`𝞱`,`th`],[`𝞲`,`i`],[`𝞳`,`k`],[`𝞴`,`l`],[`𝞵`,`m`],[`𝞶`,`n`],[`𝞷`,`ks`],[`𝞸`,`o`],[`𝞹`,`p`],[`𝞺`,`r`],[`𝞻`,`s`],[`𝞼`,`s`],[`𝞽`,`t`],[`𝞾`,`y`],[`𝞿`,`f`],[`𝟀`,`x`],[`𝟁`,`ps`],[`𝟂`,`o`],[`𝟃`,`a`],[`𝟄`,`e`],[`𝟅`,`i`],[`𝟆`,`k`],[`𝟇`,`f`],[`𝟈`,`r`],[`𝟉`,`p`],[`𝟊`,`F`],[`𝟋`,`f`],[`⒜`,`(a)`],[`⒝`,`(b)`],[`⒞`,`(c)`],[`⒟`,`(d)`],[`⒠`,`(e)`],[`⒡`,`(f)`],[`⒢`,`(g)`],[`⒣`,`(h)`],[`⒤`,`(i)`],[`⒥`,`(j)`],[`⒦`,`(k)`],[`⒧`,`(l)`],[`⒨`,`(m)`],[`⒩`,`(n)`],[`⒪`,`(o)`],[`⒫`,`(p)`],[`⒬`,`(q)`],[`⒭`,`(r)`],[`⒮`,`(s)`],[`⒯`,`(t)`],[`⒰`,`(u)`],[`⒱`,`(v)`],[`⒲`,`(w)`],[`⒳`,`(x)`],[`⒴`,`(y)`],[`⒵`,`(z)`],[`Ⓐ`,`(A)`],[`Ⓑ`,`(B)`],[`Ⓒ`,`(C)`],[`Ⓓ`,`(D)`],[`Ⓔ`,`(E)`],[`Ⓕ`,`(F)`],[`Ⓖ`,`(G)`],[`Ⓗ`,`(H)`],[`Ⓘ`,`(I)`],[`Ⓙ`,`(J)`],[`Ⓚ`,`(K)`],[`Ⓛ`,`(L)`],[`Ⓝ`,`(N)`],[`Ⓞ`,`(O)`],[`Ⓟ`,`(P)`],[`Ⓠ`,`(Q)`],[`Ⓡ`,`(R)`],[`Ⓢ`,`(S)`],[`Ⓣ`,`(T)`],[`Ⓤ`,`(U)`],[`Ⓥ`,`(V)`],[`Ⓦ`,`(W)`],[`Ⓧ`,`(X)`],[`Ⓨ`,`(Y)`],[`Ⓩ`,`(Z)`],[`ⓐ`,`(a)`],[`ⓑ`,`(b)`],[`ⓒ`,`(c)`],[`ⓓ`,`(d)`],[`ⓔ`,`(e)`],[`ⓕ`,`(f)`],[`ⓖ`,`(g)`],[`ⓗ`,`(h)`],[`ⓘ`,`(i)`],[`ⓙ`,`(j)`],[`ⓚ`,`(k)`],[`ⓛ`,`(l)`],[`ⓜ`,`(m)`],[`ⓝ`,`(n)`],[`ⓞ`,`(o)`],[`ⓟ`,`(p)`],[`ⓠ`,`(q)`],[`ⓡ`,`(r)`],[`ⓢ`,`(s)`],[`ⓣ`,`(t)`],[`ⓤ`,`(u)`],[`ⓥ`,`(v)`],[`ⓦ`,`(w)`],[`ⓧ`,`(x)`],[`ⓨ`,`(y)`],[`ⓩ`,`(z)`],[`Ċ`,`C`],[`ċ`,`c`],[`Ġ`,`G`],[`ġ`,`g`],[`Ħ`,`H`],[`ħ`,`h`],[`Ż`,`Z`],[`ż`,`z`],[`𝟎`,`0`],[`𝟏`,`1`],[`𝟐`,`2`],[`𝟑`,`3`],[`𝟒`,`4`],[`𝟓`,`5`],[`𝟔`,`6`],[`𝟕`,`7`],[`𝟖`,`8`],[`𝟗`,`9`],[`𝟘`,`0`],[`𝟙`,`1`],[`𝟚`,`2`],[`𝟛`,`3`],[`𝟜`,`4`],[`𝟝`,`5`],[`𝟞`,`6`],[`𝟟`,`7`],[`𝟠`,`8`],[`𝟡`,`9`],[`𝟢`,`0`],[`𝟣`,`1`],[`𝟤`,`2`],[`𝟥`,`3`],[`𝟦`,`4`],[`𝟧`,`5`],[`𝟨`,`6`],[`𝟩`,`7`],[`𝟪`,`8`],[`𝟫`,`9`],[`𝟬`,`0`],[`𝟭`,`1`],[`𝟮`,`2`],[`𝟯`,`3`],[`𝟰`,`4`],[`𝟱`,`5`],[`𝟲`,`6`],[`𝟳`,`7`],[`𝟴`,`8`],[`𝟵`,`9`],[`𝟶`,`0`],[`𝟷`,`1`],[`𝟸`,`2`],[`𝟹`,`3`],[`𝟺`,`4`],[`𝟻`,`5`],[`𝟼`,`6`],[`𝟽`,`7`],[`𝟾`,`8`],[`𝟿`,`9`],[`①`,`1`],[`②`,`2`],[`③`,`3`],[`④`,`4`],[`⑤`,`5`],[`⑥`,`6`],[`⑦`,`7`],[`⑧`,`8`],[`⑨`,`9`],[`⑩`,`10`],[`⑪`,`11`],[`⑫`,`12`],[`⑬`,`13`],[`⑭`,`14`],[`⑮`,`15`],[`⑯`,`16`],[`⑰`,`17`],[`⑱`,`18`],[`⑲`,`19`],[`⑳`,`20`],[`⑴`,`1`],[`⑵`,`2`],[`⑶`,`3`],[`⑷`,`4`],[`⑸`,`5`],[`⑹`,`6`],[`⑺`,`7`],[`⑻`,`8`],[`⑼`,`9`],[`⑽`,`10`],[`⑾`,`11`],[`⑿`,`12`],[`⒀`,`13`],[`⒁`,`14`],[`⒂`,`15`],[`⒃`,`16`],[`⒄`,`17`],[`⒅`,`18`],[`⒆`,`19`],[`⒇`,`20`],[`⒈`,`1.`],[`⒉`,`2.`],[`⒊`,`3.`],[`⒋`,`4.`],[`⒌`,`5.`],[`⒍`,`6.`],[`⒎`,`7.`],[`⒏`,`8.`],[`⒐`,`9.`],[`⒑`,`10.`],[`⒒`,`11.`],[`⒓`,`12.`],[`⒔`,`13.`],[`⒕`,`14.`],[`⒖`,`15.`],[`⒗`,`16.`],[`⒘`,`17.`],[`⒙`,`18.`],[`⒚`,`19.`],[`⒛`,`20.`],[`⓪`,`0`],[`⓫`,`11`],[`⓬`,`12`],[`⓭`,`13`],[`⓮`,`14`],[`⓯`,`15`],[`⓰`,`16`],[`⓱`,`17`],[`⓲`,`18`],[`⓳`,`19`],[`⓴`,`20`],[`⓵`,`1`],[`⓶`,`2`],[`⓷`,`3`],[`⓸`,`4`],[`⓹`,`5`],[`⓺`,`6`],[`⓻`,`7`],[`⓼`,`8`],[`⓽`,`9`],[`⓾`,`10`],[`⓿`,`0`],[`🙰`,`&`],[`🙱`,`&`],[`🙲`,`&`],[`🙳`,`&`],[`🙴`,`&`],[`🙵`,`&`],[`🙶`,`"`],[`🙷`,`"`],[`🙸`,`"`],[`‽`,`?!`],[`🙹`,`?!`],[`🙺`,`?!`],[`🙻`,`?!`],[`🙼`,`/`],[`🙽`,`\\`],[`🜇`,`AR`],[`🜈`,`V`],[`🜉`,`V`],[`🜆`,`VR`],[`🜅`,`VF`],[`🜩`,`2`],[`🜪`,`5`],[`🝡`,`f`],[`🝢`,`W`],[`🝣`,`U`],[`🝧`,`V`],[`🝨`,`T`],[`🝪`,`V`],[`🝫`,`MB`],[`🝬`,`VB`],[`🝲`,`3B`],[`🝳`,`3B`],[`💯`,`100`],[`🔙`,`BACK`],[`🔚`,`END`],[`🔛`,`ON!`],[`🔜`,`SOON`],[`🔝`,`TOP`],[`🔞`,`18`],[`🔤`,`abc`],[`🔠`,`ABCD`],[`🔡`,`abcd`],[`🔢`,`1234`],[`🔣`,`T&@%`],[`#️⃣`,`#`],[`*️⃣`,`*`],[`0️⃣`,`0`],[`1️⃣`,`1`],[`2️⃣`,`2`],[`3️⃣`,`3`],[`4️⃣`,`4`],[`5️⃣`,`5`],[`6️⃣`,`6`],[`7️⃣`,`7`],[`8️⃣`,`8`],[`9️⃣`,`9`],[`🔟`,`10`],[`🅰️`,`A`],[`🅱️`,`B`],[`🆎`,`AB`],[`🆑`,`CL`],[`🅾️`,`O`],[`🅿`,`P`],[`🆘`,`SOS`],[`🅲`,`C`],[`🅳`,`D`],[`🅴`,`E`],[`🅵`,`F`],[`🅶`,`G`],[`🅷`,`H`],[`🅸`,`I`],[`🅹`,`J`],[`🅺`,`K`],[`🅻`,`L`],[`🅼`,`M`],[`🅽`,`N`],[`🆀`,`Q`],[`🆁`,`R`],[`🆂`,`S`],[`🆃`,`T`],[`🆄`,`U`],[`🆅`,`V`],[`🆆`,`W`],[`🆇`,`X`],[`🆈`,`Y`],[`🆉`,`Z`],[`−`,`-`],[`⁓`,`-`]]),HM=[[`æ`,`ae`],[`Æ`,`Ae`],[`ø`,`oe`],[`Ø`,`Oe`],[`å`,`aa`],[`Å`,`Aa`]],UM={sv:[[`ä`,`a`],[`Ä`,`A`],[`ö`,`o`],[`Ö`,`O`],[`å`,`a`],[`Å`,`A`]],da:HM,nb:HM,de:[[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`ß`,`ss`],[`ẞ`,`Ss`]],tr:[[`â`,`a`],[`Â`,`A`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`]],hu:[[`ű`,`u`],[`Ű`,`U`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`],[`á`,`a`],[`Á`,`A`],[`é`,`e`],[`É`,`E`],[`í`,`i`],[`Í`,`I`],[`ó`,`o`],[`Ó`,`O`],[`ú`,`u`],[`Ú`,`U`]],sr:[[`ђ`,`dj`],[`Ђ`,`Dj`],[`џ`,`dz`],[`Џ`,`Dz`],[`љ`,`lj`],[`Љ`,`Lj`],[`њ`,`nj`],[`Њ`,`Nj`],[`ћ`,`c`],[`Ћ`,`C`],[`ч`,`ch`],[`Ч`,`Ch`],[`ш`,`sh`],[`Ш`,`Sh`],[`ж`,`zh`],[`Ж`,`Zh`]]};for(let e of Object.keys(UM))UM[e]=new Map(UM[e]);var NSe=e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),WM=e=>{let t=[...e.keys()].sort((e,t)=>t.length-e.length);return new RegExp(t.map(e=>NSe(e)).join(`|`),`gu`)},PSe=WM(VM),GM=new Map;for(let[e,t]of Object.entries(UM)){let n=new Map(VM);for(let[e,r]of t)n.set(e,r);GM.set(e,{replacements:n,pattern:WM(n)})}var FSe=e=>{if(!e)return;let t=e.toLowerCase().replace(/^no(-|$)/,`nb$1`);if(Object.hasOwn(UM,t))return t;let n=t.split(`-`)[0];if(Object.hasOwn(UM,n))return n};function ISe(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string, got \`${typeof e}\``);t={customReplacements:[],...t};let n=FSe(t.locale),r=[...t.customReplacements],i=VM,a=PSe;if(n&&({replacements:i,pattern:a}=GM.get(n)),e=e.normalize(),r.length>0){r.sort((e,t)=>t[0].length-e[0].length);for(let[t,n]of r)e=e.replaceAll(t,n)}return e=e.replace(a,e=>i.get(e)??e),e=e.normalize(`NFD`).replaceAll(/\p{Diacritic}/gu,``).normalize(),e=e.replaceAll(/\p{Dash_Punctuation}/gu,`-`),e}var KM=RegExp(`[\\p{Z}[\\p{C}--[\\u200C\\u200D]]!"#$%\\x26'\\(\\)*+,\\/:;<=>?@\\[\\\\\\]^\`\\{\\|\\}]`,`v`),qM=/[^\w-~]/,LSe=/^\.+/,RSe={unicode:new RegExp(KM,`gv`),ascii:new RegExp(qM,`g`)},zSe=new Map,JM=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=JO.current??{},u=r??s,d=e;a&&(d=ISe(d.normalize(`NFD`),{locale:n?.replaceAll(`_`,`-`)})),d=d.replaceAll(RSe[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f,p=LSe;if(o){let e=LE(o),t=lA(zSe,e,()=>({consecutivePattern:RegExp(`(?:${e})+`,`g`),trimPattern:RegExp(`^(?:${e})+|(?:${e})+$`,`g`),leadingDotsPattern:RegExp(`^(?:\\.|${e})+`)}));d=d.replace(t.consecutivePattern,o),c&&({trimPattern:f}=t,d=d.replace(f,``),p=t.leadingDotsPattern)}return d=d.replace(p,``),!d&&t&&(d=Jc(`short`)),typeof u==`number`&&d.length>u&&(d=RE(d,u,{ellipsis:``}),f&&(d=d.replace(f,``))),l&&(d=d.toLocaleLowerCase()),d},YM=e=>JM(e.trim(),{fallback:!1}),XM=({takenNames:e,name:t})=>{let n=t.trim();if(!n)return`empty`;let r=YM(n);return!r||n.includes(`/`)||n.startsWith(`.`)?`invalid`:e.includes(r)?`duplicate`:void 0},BSe=new Set([`local`,`utc`]),ZM=new WeakMap,QM=e=>typeof e==`string`&&!BSe.has(e),$M=e=>{let t=ZM.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:QM(v)?v:void 0};return ZM.set(e,y),y},VSe=[{key:`af`,name:`Afrikaans`},{key:`am`,name:`Amharic`},{key:`ar-iq`,name:` Arabic (Iraq)`},{key:`ar-dz`,name:`Arabic (Algeria)`},{key:`ar-kw`,name:`Arabic (Kuwait)`},{key:`ar-ly`,name:`Arabic (Lybia)`},{key:`ar-ma`,name:`Arabic (Morocco)`},{key:`ar-sa`,name:`Arabic (Saudi Arabia)`},{key:`ar-tn`,name:` Arabic (Tunisia)`},{key:`ar`,name:`Arabic`},{key:`az`,name:`Azerbaijani`},{key:`be`,name:`Belarusian`},{key:`bg`,name:`Bulgarian`},{key:`bi`,name:`Bislama`},{key:`bm`,name:`Bambara`},{key:`bn-bd`,name:`Bengali (Bangladesh)`},{key:`bn`,name:`Bengali`},{key:`bo`,name:`Tibetan`},{key:`br`,name:`Breton`},{key:`bs`,name:`Bosnian`},{key:`ca`,name:`Catalan`},{key:`cs`,name:`Czech`},{key:`cv`,name:`Chuvash`},{key:`cy`,name:`Welsh`},{key:`da`,name:`Danish`},{key:`de-at`,name:`German (Austria)`},{key:`de-ch`,name:`German (Switzerland)`},{key:`de`,name:`German`},{key:`dv`,name:`Maldivian`},{key:`en-au`,name:`English (Australia)`},{key:`el`,name:`Greek`},{key:`en-gb`,name:`English (United Kingdom)`},{key:`en-ie`,name:`English (Ireland)`},{key:`en-il`,name:`English (Israel)`},{key:`en-in`,name:`English (India)`},{key:`en-nz`,name:`English (New Zealand)`},{key:`en-sg`,name:`English (Singapore)`},{key:`en-tt`,name:`English (Trinidad & Tobago)`},{key:`en-ca`,name:`English (Canada)`},{key:`en`,name:`English`},{key:`eo`,name:`Esperanto`},{key:`es-mx`,name:`Spanish (Mexico)`},{key:`es-pr`,name:`Spanish (Puerto Rico)`},{key:`es-us`,name:`Spanish (United States)`},{key:`es-do`,name:`Spanish (Dominican Republic)`},{key:`et`,name:`Estonian`},{key:`eu`,name:`Basque`},{key:`fa`,name:`Persian`},{key:`fi`,name:`Finnish`},{key:`fr-ca`,name:`French (Canada)`},{key:`fr-ch`,name:`French (Switzerland)`},{key:`fr`,name:`French`},{key:`fo`,name:`Faroese`},{key:`fy`,name:`Frisian`},{key:`ga`,name:`Irish or Irish Gaelic`},{key:`gd`,name:`Scottish Gaelic`},{key:`gl`,name:`Galician`},{key:`gom-latn`,name:`Konkani Latin script`},{key:`gu`,name:`Gujarati`},{key:`he`,name:`Hebrew`},{key:`hi`,name:`Hindi`},{key:`hr`,name:`Croatian`},{key:`ht`,name:`Haitian Creole (Haiti)`},{key:`hu`,name:`Hungarian`},{key:`hy-am`,name:`Armenian`},{key:`id`,name:`Indonesian`},{key:`is`,name:`Icelandic`},{key:`it-ch`,name:`Italian (Switzerland)`},{key:`it`,name:`Italian`},{key:`jv`,name:`Javanese`},{key:`ka`,name:`Georgian`},{key:`kk`,name:`Kazakh`},{key:`km`,name:`Cambodian`},{key:`ko`,name:`Korean`},{key:`ku`,name:`Kurdish`},{key:`ky`,name:`Kyrgyz`},{key:`kn`,name:`Kannada`},{key:`lb`,name:`Luxembourgish`},{key:`ja`,name:`Japanese`},{key:`lt`,name:`Lithuanian`},{key:`lv`,name:`Latvian`},{key:`me`,name:`Montenegrin`},{key:`mi`,name:`Maori`},{key:`mk`,name:`Macedonian`},{key:`ml`,name:`Malayalam`},{key:`mn`,name:`Mongolian`},{key:`mr`,name:`Marathi`},{key:`ms-my`,name:`Malay`},{key:`ms`,name:`Malay`},{key:`mt`,name:`Maltese (Malta)`},{key:`lo`,name:`Lao`},{key:`my`,name:`Burmese`},{key:`nb`,name:`Norwegian Bokmål`},{key:`ne`,name:`Nepalese`},{key:`nl`,name:`Dutch`},{key:`nl-be`,name:`Dutch (Belgium)`},{key:`nn`,name:`Nynorsk`},{key:`pa-in`,name:`Punjabi (India)`},{key:`pl`,name:`Polish`},{key:`pt-br`,name:`Portuguese (Brazil)`},{key:`pt`,name:`Portuguese`},{key:`rn`,name:`Kirundi`},{key:`ro`,name:`Romanian`},{key:`es`,name:`Spanish`},{key:`ru`,name:`Russian`},{key:`rw`,name:`Kinyarwanda (Rwanda)`},{key:`sd`,name:`Sindhi`},{key:`se`,name:`Northern Sami`},{key:`si`,name:`Sinhalese`},{key:`sk`,name:`Slovak`},{key:`sl`,name:`Slovenian`},{key:`oc-lnc`,name:`Occitan, lengadocian dialecte`},{key:`sq`,name:`Albanian`},{key:`sr-cyrl`,name:`Serbian Cyrillic`},{key:`sr`,name:`Serbian`},{key:`ss`,name:`siSwati`},{key:`sv-fi`,name:`Finland Swedish`},{key:`sv`,name:`Swedish`},{key:`sw`,name:`Swahili`},{key:`ta`,name:`Tamil`},{key:`te`,name:`Telugu`},{key:`tet`,name:`Tetun Dili (East Timor)`},{key:`tg`,name:`Tajik`},{key:`th`,name:`Thai`},{key:`tl-ph`,name:`Tagalog (Philippines)`},{key:`tlh`,name:`Klingon`},{key:`tr`,name:`Turkish`},{key:`tzl`,name:`Talossan`},{key:`tzm`,name:`Central Atlas Tamazight`},{key:`ug-cn`,name:`Uyghur (China)`},{key:`uk`,name:`Ukrainian`},{key:`tk`,name:`Turkmen`},{key:`ur`,name:`Urdu`},{key:`uz-latn`,name:`Uzbek Latin`},{key:`uz`,name:`Uzbek`},{key:`vi`,name:`Vietnamese`},{key:`x-pseudo`,name:`Pseudo`},{key:`tzm-latn`,name:`Central Atlas Tamazight Latin`},{key:`yo`,name:`Yoruba Nigeria`},{key:`zh-cn`,name:`Chinese (China)`},{key:`zh-hk`,name:`Chinese (Hong Kong)`},{key:`zh-tw`,name:`Chinese (Taiwan)`},{key:`zh`,name:`Chinese`}],HSe=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},USe=(typeof document>`u`?void 0:document.currentScript?.src)||{}.url,eN=e=>{let t=`https://unpkg.com/${e}`,n=Ibe[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},tN=async(e,t)=>HSe(()=>import(`${eN(e)}/${t}`),void 0),WSe=async()=>`${eN(`leaflet`)}/dist/images/marker-icon-2x.png`,GSe=[`unpkg.com`,`cdn.jsdelivr.net`],KSe=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return e;let[,r,i,a]=n;return i===FO||i===void 0&&!GSe.includes(t.host)?e:(t.pathname=`${r}@${FO}${a}`,t.href)},qSe=(e,t=USe)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@${FO}/dist/${n}`;if(!t)return[r];let i=new URL(n,KSe(t)).href;return i===r?[r]:[i,r]},nN={},rN=async e=>{if(e in nN)return nN[e]();let t;for(let n of qSe(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},JSe=async e=>(await tN(`dayjs`,`esm/locale/${e}.js`)).default,YSe=new Set(VSe.map(({key:e})=>e)),iN=new Set([`en`]),aN=new Map,XSe=new Map,ZSe=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>YSe.has(e))},oN=e=>lA(XSe,e,()=>ZSe(e)),QSe=e=>{if(iN.has(e))return Promise.resolve();let t=aN.get(e);return t||(t=(async()=>{try{LM.default.locale(await JSe(e),void 0,!0),iN.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{aN.delete(e)}})(),aN.set(e,t)),t},$Se=async e=>{let t=new Set([...e].map(oN).filter(e=>e!==void 0));await Promise.all([...t].map(QSe))},sN=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=oN(r);return i&&i!==`en`&&iN.has(i)?i:void 0},cN=u(s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))}))(),1);LM.default.extend(RM.default),LM.default.extend(zM.default),LM.default.extend(BM.default),LM.default.extend(cN.default);var lN=e=>e instanceof Date&&!Number.isNaN(e.getTime()),uN=e=>e?LM.default.utc:LM.default,dN=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,eCe=/Z/,tCe=/[AaHhkmSsXx]|LT|LLL|lll/,fN=e=>e.replaceAll(/\[.*?]/g,``),pN=e=>eCe.test(fN(e)),mN=(e,t)=>dN.test(e)&&tCe.test(fN(t))&&!pN(t),hN=(e,t,n,r)=>e(t,n,r,mN(t,n)),gN=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=uN(n),a=hN(i,e,t,r);return a.isValid()?a:i(e)},_N=(e,t,n)=>(n?e.locale(n):e).format(t),vN=(e,t)=>t===`UTC`?e.toDate():LM.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),yN=(e,t)=>{if(!t||dN.test(e))return new Date(e);let n=LM.default.utc(e);return n.isValid()?vN(n,t):void 0},bN=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=$M(e);return r||t&&i?`UTC`:n?void 0:a},xN=(e,t,n)=>{let{format:r,timeOnly:i}=$M(t);if(!e)return;let a=bN(t),o;if(r){let i=sN(t,n);if(a===`UTC`||!a){let t=gN({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=hN(uN(!0),e,r,i);o=t.isValid()?pN(r)?t.toDate():vN(t,a):yN(e,a)}}else o=yN(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(lN(o))return o;console.error(`Invalid Date`,e)};LM.default.extend(RM.default),LM.default.extend(zM.default),LM.default.extend(BM.default);var nCe=/^\d{4}-[01]\d-[0-3]\d$/,rCe=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,SN=Object.freeze([`date`,`default`,`localize`,`lower`,`slugify`,`ternary`,`truncate`,`upper`]),CN=/^[A-Za-z_]\w*$/,iCe=RegExp(`^(?${CN.source.slice(1,-1)})(?:\\((?.*)\\))?$`,`s`),aCe=/\s*(?:'(?.*?)'|(?-?\d+(?:\.\d+)?))\s*(?,|$)/sy,oCe=Object.entries({date:/^date\('(?.+?)'(?:,\s*'(?.+?)')?\)$/,default:/^default\('(?.+?)'\)$/,ternary:/^ternary\('(?.*?)',\s*'(?.*?)'\)$/,truncate:/^truncate\((?\d+)(?:,\s*'(?.+?)')?\)$/}),sCe=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(aCe),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},cCe=e=>{for(let[t,n]of oCe){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(iCe)?.groups??{};if(t&&!SN.includes(t)){if(n===void 0)return{method:t,args:{}};let e=sCe(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},lCe=e=>{let t=[],n=``,r=!1;return[...e].forEach((i,a)=>{i===`'`&&(!r&&/[(,]\s*$/.test(e.slice(0,a))?r=!0:r&&/^\s*[,)]/.test(e.slice(a+1))&&(r=!1)),i===`|`&&!r?(t.push(n.trim()),n=``):n+=i}),t.push(n.trim()),t},uCe=new Map,wN=e=>uA(uCe,e,()=>{let[t,...n]=lCe(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=cCe(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),dCe=e=>String(e).toUpperCase(),fCe=e=>String(e).toLowerCase(),pCe=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=$M(r),l=o?sN(r,i):void 0,u=n===`utc`||c||s&&!!a.match(nCe)||s&&!!a.match(rCe),d=o&&!(e instanceof Date)?gN({value:a,format:o,parseAsUTC:u,localeKey:l}):uN(u)(a);return d.isValid()?_N(d,t,l):``},mCe=(e,{defaultValue:t})=>e?String(e):t,hCe=(e,{truthyValue:t,falsyValue:n})=>e?t:n,gCe=(e,{max:t,ellipsis:n=`…`})=>RE(String(e),Number(t),{ellipsis:n}),_Ce=new WeakMap,vCe=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=lA(_Ce,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},yCe=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return dCe(t);case`lower`:return fCe(t);case`slugify`:return JM(String(t),{fallback:!1,locale:r});case`date`:return pCe(t,a,e??{},r);case`default`:return mCe(t,a);case`ternary`:return hCe(t,a);case`truncate`:return gCe(t,a);default:{let e=NO.get(i);return e?vCe({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},TN=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=yCe({fieldConfig:e,value:t,transformation:n,locale:r})}),t),EN=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=e.split(`.`),r=``;n.forEach((e,n)=>{if(n>0){let n=t.get(r);n?n.add(e):t.set(r,new Set([e]))}r=n===0?e:`${r}.${e}`})}),{childSegmentMap:t}},DN=(e,t)=>e.childSegmentMap.has(t),ON=(e,t)=>[...e.childSegmentMap.get(t)??[]].filter(Ej).map(Number).sort((e,t)=>e-t),kN=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=0;for(;;){let r=e.indexOf(`.`,n);if(r===-1)return;let i=e.indexOf(`.`,r+1),a=i===-1?e.length:i,o=e.slice(r+1,a);if(Ej(o)){let n=e.slice(0,r),i=t.get(n);i?i.add(Number(o)):t.set(n,new Set([Number(o)]))}n=r+1}}),t},AN=(e,t)=>[...e.get(t)??[]].sort((e,t)=>e-t),bCe=/^\d{4}-[01]\d-[0-3]\d$/,xCe=/T00:00(?::00)?(?:\.000)?Z$/,jN={year:`numeric`,month:`short`,day:`numeric`},MN={hour:`numeric`,minute:`numeric`,hour12:!0},SCe={...jN,...MN},CCe=new Map,NN=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:lA(CCe,t??``,()=>new Intl.DateTimeFormat(t??void 0,SCe)).format(e);LM.default.extend(RM.default),LM.default.extend(zM.default),LM.default.extend(BM.default),LM.default.extend(cN.default);var wCe=new Map,PN=({locale:e,parts:t,timeZone:n})=>lA(wCe,[e,t,n].join(`|`),()=>t===`time`?new Intl.DateTimeFormat(e,{...MN,timeZone:n}):t===`date`?new Intl.DateTimeFormat(e,{...jN,timeZone:n}):new Intl.DateTimeFormat(e,{...jN,...MN,timeZone:n,timeZoneName:void 0})),FN=({locale:e,fieldConfig:t,currentValue:n})=>{let{format:r,dateOnly:i,timeOnly:a,utc:o,singleCustomTimeZone:s}=$M(t),c=o?`UTC`:s;if(typeof n!=`string`||!n.trim())return``;if(r){let i=sN(t,e);if(mN(n,r)){let a=xN(n,t,e),o=bN(t);return a?_N(o?(0,LM.default)(a).tz(o):(0,LM.default)(a),r,i):``}let a=gN({value:n,format:r,parseAsUTC:o,localeKey:i});return a.isValid()?a.format(r):(console.error(`Invalid Date`,n),``)}let l=xN(n,t,e),u=yA(e);return lN(l)?a?PN({locale:u,parts:`time`,timeZone:c}).format(l):i?PN({locale:u,parts:`date`,timeZone:o||bCe.test(n)||xCe.test(n)?`UTC`:c}).format(l):PN({locale:u,parts:`datetime`,timeZone:c}).format(l):``},TCe=new Map,IN=e=>lA(TCe,e,()=>Intl.NumberFormat(e,{maximumFractionDigits:20})),LN=({widget:e,value_type:t})=>t??(e===`compute`?`string`:`int`),RN=e=>[`float`,`float/string`].includes(LN(e)),zN=e=>![`int`,`float`].includes(LN(e)),BN=e=>e.widget===`number`||e.widget===`compute`&&LN(e)!==`string`,VN=e=>(e.widget===`number`||e.widget===`compute`)&&!zN(e),HN=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN,UN=(e,t)=>{if(RN(t))return Number.isFinite(e)?e+0:NaN;let n=Math.trunc(e);return Number.isSafeInteger(n)?n+0:NaN},WN=(e,t)=>e==null||typeof e==`string`&&!e.trim()?!1:Number.isNaN(UN(Number(e),t)),GN=({inputValue:e,fieldConfig:t})=>{if(typeof e==`string`)return e;if(e===void 0||Number.isNaN(e))return zN(t)?``:null;let n=UN(e,t);return Number.isNaN(n)?String(e):zN(t)?String(n):n},ECe=({currentValue:e,fieldConfig:t,inputValue:n=void 0})=>{if(WN(e,t)&&e===GN({inputValue:n,fieldConfig:t}))return n;if(typeof e==`number`)return e;if(typeof e!=`string`||!e.trim())return;let r=UN(Number(e),t);return Number.isNaN(r)?void 0:r},DCe=pA(()=>KA.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{lA(t,n,()=>[]).push(e)}):n.push([e,VA(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),KN=e=>{let{fileMap:t,regexFolders:n}=DCe();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},OCe=pA(()=>KA.current,()=>new WeakMap),kCe=e=>lA(OCe(),e,()=>KN(Object.values(e.locales)[0].path)),qN=e=>kCe(e).map(({collectionName:e})=>VA(e)).filter(e=>!!e),ACe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;li)return t.slice(0,l-c.length+1)}return t}})),jCe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),MCe=s(((e,t)=>{var n=ACe(),r=jCe();t.exports=n.bind(null,r)})),NCe=u(s(((e,t)=>{var n=MCe(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},YN=e=>JN(e,decodeURI),XN=e=>JN(e,decodeURIComponent),ZN=e=>{try{return new URL(e).href}catch{return encodeURI(YN(e).toWellFormed())}},QN=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),$N=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),eP=e=>e.replace(/\/+$/,``),tP=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),nP=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=$N(e,QN),t?`@${e}`:e},rP=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?hk(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${LE(i)}-(?\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},iP=e=>(0,NCe.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),PCe=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],aP=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||PCe.some(e=>e.includes(n)&&e.includes(r))},oP=e=>e.filter(Boolean).join(`/`),sP=e=>hk(e).dirname??``,cP=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,FCe=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),lP=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},uP=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,dP=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,fP=async e=>{let t=await e.arrayBuffer();return Zc(new Blob([`blob ${t.byteLength}\0`,t]))},ICe=new WeakMap,pP=e=>typeof e==`string`?fP(uP(e)):fA(ICe,e,()=>fP(e)),mP=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??(n?e.locales[n]:void 0)??Object.values(e.locales)[0],hP=(e,t)=>e[t]?t:Object.keys(e)[0],gP=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],_P=(e,t)=>sP(mP(e,{locale:t}).path),vP=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return sP(r);let i=zE(t??``);return sP(mA(i)?sxe(e,i):cP(e,i))},yP=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},bP=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},xP=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?bP(n,e?.[r]):void 0)??[],SP=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},CP=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||SP(e).some(e=>CP(e,t,n));return n?.set(e,i),i},LCe=/^(?:0|[1-9]\d*)$/,RCe=/^(.+)\.\d+\.([^.]+)$/,wP=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},zCe=e=>LCe.test(e)&&Number(e)<2**32-1,BCe=(e,t)=>!E(e)||!Object.values(e).every(e=>e===null||E(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),VCe=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=E(e)?e:{};return[String(n),r]})):e,HCe=new WeakMap,UCe=e=>CP(e,e=>!!wP(e),HCe),TP=(e,t,n)=>{let{widget:r=`string`}=t,{fields:i,types:a,typeKey:o}=t,s=e=>xP({value:e,fields:i,types:a,typeKey:o});if(!UCe(t))return e;if(r===`object`)return EP(e,s(e),n);if(r!==`list`)return e;let c=wP(t),{field:l}=t,u=c&&n?BCe(e,c):e;if(Array.isArray(u)){let e=u.map(e=>l?TP(e,l,n):EP(e,s(e),n));e.some((e,t)=>e!==u[t])&&(u=e)}return c&&!n?VCe(u,c):u},EP=(e,t,n)=>{if(!E(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=TP(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},DP=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(RCe)??[];if(!t)return;let r=Fj({...e,keyPath:t});if(r&&wP(r)===n)return{listKeyPath:t,keyField:n}},OP=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&Ej(e.slice(r.length,-i.length)))},WCe=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>OP({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),kP=Symbol.for(`yaml.alias`),AP=Symbol.for(`yaml.document`),jP=Symbol.for(`yaml.map`),MP=Symbol.for(`yaml.pair`),NP=Symbol.for(`yaml.scalar`),PP=Symbol.for(`yaml.seq`),FP=Symbol.for(`yaml.node.type`),IP=e=>!!e&&typeof e==`object`&&e[FP]===kP,LP=e=>!!e&&typeof e==`object`&&e[FP]===AP,RP=e=>!!e&&typeof e==`object`&&e[FP]===jP,zP=e=>!!e&&typeof e==`object`&&e[FP]===MP,BP=e=>!!e&&typeof e==`object`&&e[FP]===NP,VP=e=>!!e&&typeof e==`object`&&e[FP]===PP;function HP(e){if(e&&typeof e==`object`)switch(e[FP]){case jP:case PP:return!0}return!1}function UP(e){if(e&&typeof e==`object`)switch(e[FP]){case kP:case jP:case NP:case PP:return!0}return!1}var WP=e=>(BP(e)||HP(e))&&!!e.anchor,GP=Symbol(`break visit`),GCe=Symbol(`skip children`),KP=Symbol(`remove node`);function qP(e,t){let n=KCe(t);LP(e)?JP(null,e.contents,n,Object.freeze([e]))===KP&&(e.contents=null):JP(null,e,n,Object.freeze([]))}qP.BREAK=GP,qP.SKIP=GCe,qP.REMOVE=KP;function JP(e,t,n,r){let i=qCe(e,t,n,r);if(UP(i)||zP(i))return JCe(e,r,i),JP(e,i,n,r);if(typeof i!=`symbol`){if(HP(t)){r=Object.freeze(r.concat(t));for(let e=0;ee.replace(/[!,[\]{}]/g,e=>YCe[e]),YP=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+XCe(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&UP(e.contents)){let t={};qP(e.contents,(e,n)=>{UP(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(` -`)}};YP.defaultYaml={explicit:!1,version:`1.2`},YP.defaultTags={"!!":`tag:yaml.org,2002:`};function XP(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function ZP(e){let t=new Set;return qP(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function QP(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function ZCe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ZP(e);let a=QP(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(BP(t.node)||HP(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function $P(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;teF(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!WP(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var tF=class{constructor(e){Object.defineProperty(this,FP,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!LP(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=eF(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?$P(i,{"":o},``,o):o}},nF=class extends tF{constructor(e){super(kP),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],qP(e,{Node:(e,t)=>{(IP(t)||WP(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(eF(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=rF(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(XP(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function rF(e,t,n){if(IP(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(HP(t)){let r=0;for(let i of t.items){let t=rF(e,i,n);t>r&&(r=t)}return r}if(zP(t)){let r=rF(e,t.key,n),i=rF(e,t.value,n);return Math.max(r,i)}return 1}var iF=e=>!e||typeof e!=`function`&&typeof e!=`object`,aF=class extends tF{constructor(e){super(NP),this.value=e}toJSON(e,t){return t?.keep?this.value:eF(this.value,e,t)}toString(){return String(this.value)}};aF.BLOCK_FOLDED=`BLOCK_FOLDED`,aF.BLOCK_LITERAL=`BLOCK_LITERAL`,aF.PLAIN=`PLAIN`,aF.QUOTE_DOUBLE=`QUOTE_DOUBLE`,aF.QUOTE_SINGLE=`QUOTE_SINGLE`;var QCe=`tag:yaml.org,2002:`;function $Ce(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function oF(e,t,n){if(LP(e)&&(e=e.contents),UP(e))return e;if(zP(e)){let t=n.schema[jP].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new nF(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=QCe+t.slice(2));let l=$Ce(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new aF(e);return c&&(c.node=t),t}l=e instanceof Map?o[jP]:Symbol.iterator in Object(e)?o[PP]:o[jP]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new aF(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function sF(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return oF(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var cF=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,lF=class extends tF{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>UP(t)||zP(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(cF(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(HP(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,sF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(HP(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&BP(i)?i.value:i:HP(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!zP(t))return!1;let n=t.value;return n==null||e&&BP(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return HP(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(HP(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,sF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},ewe=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function uF(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var dF=(e,t,n)=>e.endsWith(` -`)?uF(n,t):n.includes(` +}::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-ajli7a {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-ajli7a {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-ajli7a {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-ajli7a {display:flex;flex-direction:column;overflow:hidden;}`};function Xxe(e,t){k(t,!0),q(e,Yxe);let n=Y(t,`orientation`,3,`horizontal`),r=gs(t,Gxe),i=M(!1);vs(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{N(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=Jxe();Qo(`ajli7a`,e=>{var t=Kxe(),n=F(t);Wxe(L(n,4),{}),z(e=>J(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),W(e,t)});var o=F(a),s=e=>{var t=qxe();as(t,``,{},{opacity:`0`}),W(e,t)};K(o,e=>{B(i)||e(s)});var c=L(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{Hxe(e.target)||e.preventDefault()};us(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-ajli7a`),Uo(P(c),()=>t.children??jr),O(c),W(e,a),A()}var Zxe=V(`
`),Qxe={hash:`svelte-j9b5tx`,code:`.empty-state.svelte-j9b5tx {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function DO(e,t){q(e,Qxe);let n=Y(t,`children`,3,void 0);var r=Zxe();Uo(P(r),()=>n()??jr),O(r),W(e,r)}var $xe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),eSe=V(`
`),tSe={hash:`svelte-1xj2823`,code:`.inner.svelte-1xj2823 {display:contents;}`};function OO(e,t){q(e,tSe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,$xe);var o=eSe();us(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1xj2823`);var s=P(o);Uo(P(s),()=>t.children??jr),O(s),O(o),z(()=>s.inert=r()),W(e,o)}var nSe=V(`
`),rSe={hash:`svelte-1swh89p`,code:`.placeholder.svelte-1swh89p {height:64px;}`};function kO(e,t){k(t,!0),q(e,rSe);let n=Y(t,`eager`,3,!1),r=M(null),i=M(na(n()));R(()=>(B(r)&&(async()=>{await al(B(r)),N(i,!0)})(),()=>{B(r)&&il(B(r))}));var a=U(),o=F(a),s=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},c=e=>{var t=nSe();ms(t,e=>N(r,e),()=>B(r)),W(e,t)};K(o,e=>{B(i)?e(s):e(c,-1)}),W(e,a),A()}var iSe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function aSe(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};Tu(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),A()}var oSe=V(`

`);function sSe(e,t){k(t,!0);let n=Y(t,`currentValue`,3,!1);var r=U(),i=F(r),a=e=>{var t=oSe(),r=I(t,!0);z(e=>G(r,e),[()=>X(`boolean.${n()}`)]),W(e,t)};K(i,e=>{typeof n()==`boolean`&&e(a)}),W(e,r),A()}var cSe=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],lSe=[`difference`,`intersection`,`symmetricDifference`,`union`],AO=!1,jO=class e extends Set{#e=new Map;#t=M(0);#n=M(0);#r=Xa||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}AO||this.#a()}#i(e){return Xa===this.#r?M(e):Xi(e)}#a(){AO=!0;var t=e.prototype,n=Set.prototype;for(let e of cSe)t[e]=function(...t){return B(this.#t),n[e].apply(this,t)};for(let r of lSe)t[r]=function(...t){B(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return B(this.#t),!1;r=this.#i(!0),n.set(e,r)}return B(r),t}add(e){return super.has(e)||(super.add(e),N(this.#n,super.size),ta(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),N(r,!1)),t&&(N(this.#n,super.size),ta(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())N(t,!1);e.clear(),N(this.#n,0),ta(this.#t)}}keys(){return this.values()}values(){return B(this.#t),super.values()}entries(){return B(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return B(this.#n)}},MO=class extends Map{#e=new Map;#t=M(0);#n=M(0);#r=Xa||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return Xa===this.#r?M(e):Xi(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return B(this.#t),!1}return B(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{B(this.#t);return}}return B(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),N(this.#n,super.size),ta(o);else if(i!==t){ta(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||ta(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),N(n,-1)),r&&(N(this.#n,super.size),ta(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;N(this.#n,0);for(var t of e.values())N(t,-1);ta(this.#t),e.clear()}}#a(){B(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)B(n)}keys(){return B(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return B(this.#n),super.size}},NO=new Map,PO=new MO,FO=new Map,IO=new Map,LO=new Set,RO=new Map,zO=new Map,BO=new Set,{DEV:uSe,VITE_SITE_URL:dSe}={DEV:!1},VO=uSe?dSe||`http://localhost:5174`:void 0,fSe=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],HO=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),na(e)),UO=e=>ai(e),WO=e=>{let t=M(e);return{get current(){return B(t)},set current(e){N(t,e)}}},GO=e=>na({current:e}),KO=e=>{let t=j(e);return{get current(){return B(t)}}},qO=e=>{let t;return KO(()=>{let n=e();return(0,Cr.default)(n,t)||(t=n),t})},JO=e=>xa(()=>{R(e)}),YO=(e,t)=>{R(()=>(e(),co(t)))},XO=(e,t,n)=>{R(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},ZO=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return YO(e,s),YO(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},QO=WO(),$O=QO,ek={},tk=WO(),nk=WO([]),rk=KO(()=>!!$O.current||!!nk.current.length),ik={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},ak=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),ok=e=>Array.isArray(e.files),sk=e=>ok(e)&&e.name===`_singletons`,ck=e=>e?._type===`entry`&&!!e._file.arrayFile,pSe=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?ak(e):n===`file`?ok(e):n===`singleton`?sk(e):ak(e)||ok(e),lk=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),uk=e=>e.filter(e=>lk(e)),dk=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],fk=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],pk=fk.filter(e=>![`boolean`,`number`].includes(e)),mk=[`file`,`image`],hk=[`richtext`,`markdown`],gk=[`text`,`string`,...hk],_k=[...mk,`relation`,`select`],mSe=[..._k,`datetime`,`keyvalue`,`list`,`number`],vk=(e=``)=>RegExp(`\\bblob:${JE(globalThis.location.origin)}\\/${kre.source}\\b`,e),hSe=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,gSe=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],yk=e=>e.startsWith(`text/`)||gSe.includes(e),bk=e=>{let t=e.length;for(;e[t-1]===`/`;)--t;let[,n,r=``,i=``,a]=e.slice(0,t).match(hSe)??[];return{dirname:n,basename:r,filename:i,extension:a}},xk=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},_Se=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&xk(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},vSe=async e=>(await e.text()).replace(/\r\n?/g,` +`),ySe=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Sk=async e=>{let t=ySe(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},bSe=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},xSe=new Map([[`application/gzip`,`gz`],[`application/javascript`,`js`],[`application/ld+json`,`jsonld`],[`audio/mpeg`,`mp3`],[`text/javascript`,`js`],[`text/markdown`,`md`],[`text/plain`,`txt`],[`video/quicktime`,`mov`]]),SSe=e=>{let t=e.toLowerCase().split(`;`)[0].trim(),n=xSe.get(t);if(n)return n;let r=t.split(`/`)[1]?.split(`+`)[0];if(r&&!/[.-]/.test(r))return r},CSe=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=SSe(e.type);n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},Ck=/(?e.replace(Dk,``),Ak=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},jk=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],Mk=(e,t)=>JE(e).replace(wSe,t),Nk={slug_length:!1,slug_editor_tag:!1,yaml_quote:!1,save_all_locales:!1,automatic_deployments:!1,multiple_folders_i18n_root:!1,omit_default_locale_from_filename:!1,logo_url:!1},ESe={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. ",slug_editor_tag:"The `{{fields._slug}}` and `{{fields._slug | localize}}` slug template tags are deprecated and will be removed in Sveltia CMS 1.0. Use the `slug` collection option’s object form instead: `{{fields._slug}}` is equivalent to `slug: { editable: true }`, and `{{fields._slug | localize}}` is equivalent to `slug: { editable: true, i18n: true }`. https://sveltiacms.app/en/docs/collections/entries/slugs#making-slugs-editable",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n/options#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments",multiple_folders_i18n_root:"The `multiple_folders_i18n_root` i18n structure is deprecated and will be removed in Sveltia CMS 1.0. Use the `multiple_root_folders` structure instead. https://sveltiacms.app/en/docs/i18n/structures#multiple-root-folders",omit_default_locale_from_filename:"The `omit_default_locale_from_filename` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `omit_default_locale_from_file_path` option instead. https://sveltiacms.app/en/docs/i18n/structures",logo_url:"The `logo_url` option is deprecated and will be removed in a future version of Sveltia CMS. Use the `logo.src` option instead. https://sveltiacms.app/en/docs/customization#custom-logo"},Pk=(e,t)=>{Nk[e]||(console.warn(t??ESe[e]),Nk[e]=!0)},DSe=`_index`,Fk=new WeakMap,Ik=e=>{if(!ak(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??DSe},Lk=e=>{let t=Fk.get(e);if(t&&t.locale===Fc.current)return t.indexFile;let n=Ik(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={...i,name:n,label:i.label||X(`index_file`),icon:i.icon??`home`}}return Fk.set(e,{locale:Fc.current,indexFile:r}),r},Rk=(e,t)=>{let n=Ik(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},zk=(e,t)=>{let n=Ik(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:Rk(e,r)},Bk=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],OSe={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},Vk={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},Hk={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},Uk=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],Wk=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...Uk,`raw`],Gk=[`toml`,`toml-frontmatter`],Kk={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},qk=e=>Object.hasOwn(Kk,e)?Kk[e]:void 0,Jk=e=>typeof e==`string`&&!!e.trim(),Yk=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&QE(e.trim()),Xk=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&`).replaceAll(`"`,`"`),kSe={"&":`&`,"<":`<`,">":`>`},Zk=e=>e.replace(/[&<>]/g,e=>kSe[e]),Qk={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},$k=(e,t)=>_t(e.replace(`
`,``),Qk),eA=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>_t(vr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),tA=e=>eA(e.replaceAll(`\\n`,`
`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),nA=[`index`,`_index`],ASe=[...Bk,...Object.keys(Vk)],jSe=e=>{if(typeof e!=`string`||!e.trim())return;let t=XE(e.trim()),{filename:n,extension:r}=bk(t);return r!==void 0&&ASe.includes(r)?n:t},rA=WO(``),iA=e=>{let t=e;if(!ak(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:Jk(i)?i:void 0,subfolders:a!==!1}},aA=e=>!!iA(e),oA=e=>{if(!aA(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:jSe(t.index_file)}},sA=e=>aA(e)?oA(e)?.indexFileName:void 0,cA=e=>iA(e)?.subfolders===!1?void 0:oA(e)?.indexFileName,lA=(e,t)=>{let n=cA(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},uA=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&cA(e)?!0:!!XE(r)||!!XE(n??``),dA=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},fA=(e,t)=>!e||t.startsWith(`${e}/`),MSe=({collection:e,entries:t,dirPath:n})=>{if(!aA(e))return!1;let r=XE(n);return!r||t.some(({subPath:e})=>fA(r,e))},pA=({collection:e,entries:t,dirPath:n})=>{let r=iA(e);if(!r)return t;let{subfolders:i}=r,a=XE(n);return t.filter(({subPath:e})=>{if(!fA(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},mA=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},hA=(e,t)=>{let n=e.get(t);return e.delete(t),e.set(t,n),n},gA=(e,t,n,r)=>{e.delete(t),e.set(t,n),e.size>r&&e.delete(e.keys().next().value)},_A=e=>{let t=new Map;return{has:e=>t.has(e),get:e=>t.has(e)?hA(t,e):void 0,set:(n,r)=>{gA(t,n,r,e)},clear:()=>{t.clear()}}},vA=(e,t,n,r)=>{if(e.has(t))return hA(e,t);let i=n();return gA(e,t,i,r),i},yA=(e,t,n)=>mA(e,t,()=>n().finally(()=>{e.delete(t)})),bA=(e,t,n)=>mA(e,t,()=>n().catch(n=>{throw e.delete(t),n})),xA=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},NSe=/(?:^|\/){{locale}}(?:\/|$)/,SA=e=>e.includes(`{{locale}}`),PSe=e=>e.split(`{{locale}}`).length===2&&NSe.test(e),CA=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},wA=e=>CA(e)!==void 0,TA=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=CA(e)??e),e.replaceAll(`{{locale}}`,t)),EA=(e,t)=>`${e}/`.split(`{{locale}}/`).map(JE).join(t),FSe=new Map,ISe=(e,t)=>e.replace(mA(FSe,t,()=>RegExp(`^${EA(t,`(?:[^/]+\\/)?`)}`)),``),LSe={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},DA=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},OA=e=>e===`_default`?`auto`:Pc(e)?`rtl`:`ltr`,RSe=new Map,kA=(e,{displayLocale:t=DA(Fc.current??`en`),formatterOptions:n=LSe}={})=>{let r=DA(e);if(!r)return;let i=t?mA(RSe,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},zSe=new Map,AA=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return mA(zSe,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(DA(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},jA=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return TA({path:n,locale:t,omitLocale:i&&t===r})},MA=({extension:e,format:t})=>(t?IO.get(t)?.extension:void 0)||e||(t?OSe[t]??`md`:`md`),NA=({extension:e,format:t})=>t||(Bk.includes(e)?`frontmatter`:Vk[e]??`yaml-frontmatter`),BSe=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?JE(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${Mk(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?${c})`},VSe=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(JE).join(`|`),h=c.filter(e=>e!==l).map(JE).join(`|`),g=`(?${m})`,_=u?`(?:(?${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?${h}))?`:`\\.${g}`,y=!!n&&SA(n),b=y?EA(n,_):n?`${JE(n)}\\/`:``,x=MA({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${JE(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,BSe({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${JE(x)}|${JE(S)})`:JE(x),`$`].join(``);return new RegExp(w)},PA=({format:e,delimiter:t})=>Jk(t)?[t,t]:Array.isArray(t)&&t.length===2?t:Hk[e]??void 0,HSe=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=MA({extension:r,format:i}),o=NA({extension:a,format:i}),s=MA({extension:t,format:n}),c=NA({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},FA=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=ak(e),f=d&&typeof i==`string`,p=t?.file?XE(t.file):f?XE(i):void 0,m=p?bk(p).extension:o,h=t?.format??s,g=MA({format:h,extension:m}),_=NA({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?XE(r):void 0,x=y?Lk(e):void 0,S=x?.name,C=y?iA(e)?.depth:void 0,w=HSe({indexFile:x,extension:o,format:s});u!==void 0&&Pk(`yaml_quote`);let T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:VSe({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?jA({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:PA({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:PA({format:w.format,delimiter:v})}),T},IA=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},LA={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},USe=[LA.MULTIPLE_FOLDERS_I18N_ROOT,LA.MULTIPLE_ROOT_FOLDERS],RA={key:`translationKey`,value:`{{slug}}`},zA=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!D(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(D(o)&&Object.assign(i,o),n){if(!n.i18n)return;D(n.i18n)&&Object.assign(i,n.i18n)}return i}},WSe=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,GSe={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:LA.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...RA},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},BA=e=>(e?.collectionFile??e?.collection)?._i18n??GSe,KSe=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&SA(n)?LA.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?LA.MULTIPLE_FILES:e===LA.SINGLE_FILE_DEFAULT_ROOT?LA.SINGLE_FILE_DEFAULT_ROOT:LA.SINGLE_FILE,qSe=(e,t)=>({i18nSingleFile:e&&t===LA.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===LA.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===LA.MULTIPLE_FILES,i18nMultiFolder:e&&t===LA.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===LA.MULTIPLE_FOLDERS_I18N_ROOT||t===LA.MULTIPLE_ROOT_FOLDERS)}),VA=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,HA=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,JSe=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,YSe=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),XSe=(e,t,n)=>e?n?wA(n.file):HA(t):!1,UA=(e,t)=>{let n=zA({cmsConfig:$O.current,collection:e,file:t}),{structure:r=LA.SINGLE_FILE,locales:i=[],default_locale:a,initial_locales:o,save_all_locales:s=!0,canonical_slug:c={key:void 0,value:void 0},omit_default_locale_from_filename:l,omit_default_locale_from_file_path:u=l??!1,omit_default_locale_from_preview_path:d=!1}=n??{};n?.save_all_locales!==void 0&&Pk(`save_all_locales`),l!==void 0&&Pk(`omit_default_locale_from_filename`);let{key:f=RA.key,value:p=RA.value}=c,m=i.length>0,h=m?i:[`_default`],g=JSe(m,h,a),{folder:_,file:v}=e,y=KSe(r,t,_,v),b=qSe(m,y),x=!m||s===!0&&o===void 0,S=YSe(o,h,g),C=XSe(u,b,t);return y===`multiple_folders_i18n_root`&&Pk(`multiple_folders_i18n_root`),{i18nEnabled:m,saveAllLocales:x,allLocales:h,defaultLocale:g,initialLocales:S,structure:y,structureMap:b,canonicalSlug:{key:f,value:p},omitDefaultLocaleFromFilePath:C,omitDefaultLocaleFromPreviewPath:d}},WA=WO(),GA=new Map,KA=({collections:e=$O.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>pSe(e,{visible:t,type:n})),ZSe=()=>KA({visible:!0})[0],QSe=e=>{if(!ak(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>mk.includes(e)).map(({multiple:e,name:t})=>e?`${t}.*`:t):[]},$Se=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:FA({rawCollection:e,_i18n:t}),_thumbnailFieldNames:QSe(e)}),qA=(e,t,n)=>({...e,_i18n:t,_type:sk(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(lk).map(t=>{let n=UA(e,t),r=FA({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),JA=()=>{let e=$O.current?.singletons;if(!Array.isArray(e))return;let t=uk(e).map(e=>({...e,file:XE(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return qA(n,UA(n),t)},YA=e=>{let t=GA.get(e);if(t)return t;if(e===`_singletons`){let t=JA();return GA.set(e,t),t}let n=KA().find(t=>t.name===e);if(!n){GA.set(e,void 0);return}let r=ak(n)?n:void 0,i=ok(n)?n:void 0;if(!r&&!i){GA.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=XE(r.folder)),typeof r.file==`string`&&(r.file=XE(r.file))):i?.files.forEach(e=>{e.file&&=XE(e.file)});let a=UA(n),o=r?$Se(r,a):qA(i,a,i.files);return GA.set(e,o),o},XA=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?X(`files`):t&&a?a:i||r},ZA=e=>e?e===`_singletons`?9999999:$O.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,QA=WO(!1),$A=WO(),ej=WO([]),tj=WO([]),eCe=xA(()=>tj.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),nj=e=>{let t=eCe(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index{let n=typeof e==`string`?YA(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},aj=(e,t)=>{let n=YA(e);if(!n)return;let r=t?ij(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},oj=e=>e.label||e.name,sj=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({file:e,_file:n,_i18n:r})=>Object.entries(t.locales).some(([t,{path:i}])=>i===(t===r.defaultLocale?n.fullPath:jA({_i18n:r,locale:t,path:XE(e)})))):[],cj=(e,t)=>{let n=ej.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(n?.filePathMap)return nj(Object.values(n.filePathMap))},lj=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=$O.current;if(e===`_singletons`)return Array.isArray(r)?uk(r).findIndex(e=>e.name===t):-1;let i=KA({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1},uj=e=>JE(e).replaceAll(`\\*`,`\\d+`),dj=(e,t)=>e===t||e.startsWith(`${t}.`),fj=new WeakMap,tCe=e=>{let t=fj.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=tCe(e),i=0,a=r.length;for(;ie-t).map(([e])=>e)},mj=/\.\d+$/,hj=/^(?.+)\.\d+$/,gj=new WeakMap,_j=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(hj)?.groups?.parent===t);let r=gj.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(hj)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),gj.set(e,r)),r.get(t)??[]};function vj(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function yj(e){return e}function nCe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||yj,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=vj(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c0&&(l=o(c.shift()),u=o(c[0]))}d[l]=bj(e[s],t)}),a}var rCe=``,iCe=``,aCe=/[.\uE000\uE001]/g,oCe=/\uE001([\uE000\uE001])|\uE000/g,xj=/[\uE000\uE001]/,Sj=`\0`,Cj=/^(?:0|[1-9]\d*)$/,wj=e=>!Number.isNaN(Number(e))&&!Cj.test(e),sCe=e=>wj(e)?`${Sj}${e}`:e,Tj=e=>D(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),Ej=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=Ej(t)}),e):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(Sj)?e.slice(1):e,Ej(t)])):e,Dj=e=>e.includes(`.`)||xj.test(e)?e.replace(aCe,e=>e===`.`?rCe:`${iCe}${e}`):e,Oj=e=>xj.test(e)?e.replace(oCe,(e,t)=>t??`.`):e,kj=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,cCe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>Cj.test(e)),lCe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&Cj.test(e.slice(n.length).split(`.`)[0]))},Aj=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&cCe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=Dj(e),o=t===void 0?a:`${t}.${a}`;kj(i)?r(i,o):n[o]=i})};return kj(e)?r(e,t):t!==void 0&&(n[t]=e),n},uCe=e=>sCe(Oj(e)),jj=e=>{let t=Object.entries(e);return t.some(([,e])=>kj(e))?jj(Object.fromEntries(t.flatMap(([e,t])=>kj(t)?Object.entries(Aj(t,e)):[[e,t]]))):t.some(([e])=>xj.test(e)||e.split(`.`).some(wj))?Ej(bj(e,{transformKey:uCe})):bj(e)},Mj=e=>e?jj(Object.fromEntries(Object.entries(e).sort(([e],[t])=>$E(e,t)))):bj(e),Nj=e=>e==null||e===``||Array.isArray(e)&&!e.length||Tj(e)&&!Object.keys(e).length,Pj=e=>Array.isArray(e)&&!e.length||D(e)&&!Object.keys(e).length,Fj=(e,t)=>({[e]:Array.isArray(t)?[]:{},...Aj(t,e)}),Ij=(e,t,{live:n=!1}={})=>{let r=pj(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Pj(a)&&i.push([`_`,a]),Mj(Object.fromEntries(i))._},dCe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Lj=(e,t,n)=>{let r=pj(t,`${n}.`),i=[...r,n].map(e=>dCe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:Ij(t,n)}),e.subtree},Rj=(e,t)=>{Object.keys(e).forEach(n=>{dj(n,t)&&delete e[n]})},fCe=(e,t,n)=>{Rj(e,t),Object.assign(e,Fj(t,n))},zj=e=>!!e&&`type`in e&&e.type===`inline`,pCe=({source:e,flags:t})=>new RegExp(e.startsWith(`^`)?e.slice(1):e,t.replace(/[gy]/g,``)),mCe=e=>{let{id:t,label:n,icon:r,pattern:i,trigger:a,toPreview:o,onInsert:s,onEdit:c}=e,{fromBlock:l,toBlock:u}=e,d=e.fromInline??l,f=e.toInline??u;return{id:t,label:n,icon:r,fields:[],pattern:pCe(i),fromBlock:d,toBlock:f,toPreview:o,inlinePattern:{trigger:a||void 0,onInsert:s,onEdit:c}}},hCe=new WeakMap,gCe=(e,t)=>{let n=t?`sticky`:`global`,r=mA(hCe,e,()=>({}));return r[n]??=new RegExp(e.source,`${e.flags}${t?`y`:`g`}`),r[n]},Bj=(e,t,{trigger:n}={},r=1/0)=>{let i=gCe(t,!!n),a=[],o=n?e.indexOf(n):0;for(;o!==-1&&a.lengthObject.assign(new RegExp(e),{[Symbol.match]:n=>Bj(n,e,t,1)[0]??null}),Vj=e=>e.startsWith(`__sc_`),Hj=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),Uj=({pattern:e,inlinePattern:t})=>!!t||!Hj(e),vCe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},Wj=e=>{let t=vCe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},yCe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},Gj=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,Kj=e=>jj(Object.fromEntries(Object.entries(Aj(e)).filter(([e])=>!Vj(e.split(`.`).pop())))),bCe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},xCe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},qj=(e,t)=>{let n,r=window.requestAnimationFrame(()=>{n=xCe(e,t)});return()=>{window.cancelAnimationFrame(r),n?.disconnect()}},Jj=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),Yj=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),SCe=[String.raw`(?:[^\][\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\[(?:[^\][\\!]|\\(?!!\[).|!(?!\[))*\])*`].join(``),CCe=[String.raw`(?:[^"()\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?`].join(``),Xj=e=>String.raw`(?:[^${e}\\!]|\\(?!!\[).|!(?!\[))*`,Zj=(e=``)=>[String.raw`!\[(?${SCe})\]\((?${CCe})`,String.raw`(?:(?${Xj(`"`)})"`,String.raw`|'(?${Xj(`'`)})'))?\)`].join(``),Qj=new RegExp(Zj()),wCe=new RegExp(String.raw`\[${Zj(`2`)}\](?:\((?[^()]*(?:\([^)]*\)[^)]*|\([^)]*)?)\))`),$j=RegExp(`${Qj.source}|${wCe.source}`),eM=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),tM=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},nM={id:`image`,label:`Image`,fields:[{name:`src`,label:`Source`,widget:`image`},{name:`alt`,label:`Alt Text`,required:!1},{name:`title`,label:`Title`,required:!1}],pattern:Qj,fromBlock:e=>{let{src:t,alt:n,title:r=e.groups?.singleQuotedTitle}=e.groups??{};return{src:t,alt:n,title:r&&Jj(r)}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return t?`![${n}](${t}${r?` "${Yj(r)}"`:``})`:``},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return`${Xk(n)}`},htmlSelector:`img`,fromBlockHTML:eM,toBlockHTML:tM},TCe={id:`linked-image`,label:`Image`,fields:[...nM.fields,{name:`link`,label:`Link`,required:!1}],pattern:$j,fromBlock:e=>{let{src:t,alt:n,title:r,singleQuotedTitle:i,src2:a,alt2:o,title2:s,singleQuotedTitle2:c,link:l}=e.groups??{};return{src:(t||a||``).trim(),alt:(n||o||``).trim(),title:Jj(r||i||s||c||``).trim(),link:(l||``).trim()}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=t?`![${n}](${t}${r?` "${Yj(r)}"`:``})`:``;return a&&i?`[${a}](${i})`:a},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=`${Xk(n)}`;return i?`
${a}`:a},htmlSelector:`a:has(> img:only-child), img`,fromBlockHTML:e=>{if(e.localName===`img`)return{...eM(e),link:``};if(!e.textContent?.trim())return{...eM(e.querySelector(`img`)),link:e.getAttribute(`href`)??``}},toBlockHTML:e=>{let{link:t=``}=e,n=tM(e);if(!n||!t)return n;let r=document.createElement(`a`);return r.setAttribute(`href`,t),r.append(n),r}},ECe=()=>{let e={icon:`image`,label:X(`editor_components.image`),fields:[{name:`src`,label:X(`editor_components.src`),widget:`image`},{name:`alt`,label:X(`editor_components.alt`),required:!1},{name:`title`,label:X(`editor_components.title`),required:!1}],trigger:`button`,createMarkdown:()=>`![]()`};return[{...nM,...e},{...TCe,...e,fields:[...e.fields,{name:`link`,label:X(`editor_components.link`),required:!1}]}]},rM=e=>{if(!e)return;if(NO.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&NO.has(t)?t:void 0},iM=e=>{let t=rM(e);if(t){let e=NO.get(t),n=zj(e)?mCe(e):e;return{...n,id:`x-${t}`,label:n.label??t}}return ECe().find(({id:t})=>t===e)},aM=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},oM=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},sM=e=>{let t=$O.current;return e.multiple??aM(e.media_libraries)??oM(e.media_library)??aM(t?.media_libraries)??oM(t?.media_library)??!1},DCe=/^\d+$/,cM=e=>DCe.test(e),lM=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),uM=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},dM=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(lM(e)),r=uM(Math.round(uM(n,t)),-t);return Math.sign(e)*r+0},OCe=/^(.*?)<([^>]+)>(.*)$/,fM=new Map,pM=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},mM=e=>{let t=e.widget??`string`;return mk.includes(t)?sM(e):_k.includes(t)?!!e.multiple:!1},hM=e=>{let t=e.match(OCe);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},kCe=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=hM(t),{widget:c=`text`}=e,l=s??i,u=cM(o),d=o===`*`;if((u||d)&&_k.includes(c))return{field:mM(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},gM=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),_M=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(fM.has(s))return fM.get(s);let c=YA(t),l=c&&n?ij(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){fM.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?Lk(c):void 0,f=r?iM(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=hM(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=kCe({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||fM.set(s,m),m},vM=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(cM(e)){let e=_M({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(_k.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=_M({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},yM=e=>{let t=e.widget??`string`;return dk.includes(t)?`builtin`:FO.has(t)?`custom`:`unknown`},bM=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,xM=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return D(i)?Ij(e,t)??i:i;let a=_j(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||D(i)?Ij(e,t)??i:i:[]},SM=(e,t)=>e?.widget===`relation`&&e.collection===t,CM=(e,t)=>e.pendingEntries.filter(e=>e.collectionName===t),wM=(e,t)=>CM(e,t).filter(({baseEntry:e})=>!e),ACe=({collectionName:e,fileName:t,isIndexFile:n,currentValues:r,extraValues:i})=>[...Object.values(r).map(r=>({valueMap:r,fieldArgs:{collectionName:e,fileName:t,isIndexFile:n}})),...Object.values(i).map(e=>({valueMap:e}))],jCe=({collectionName:e,entry:t})=>Object.values(t.locales).flatMap(({content:t})=>t?[{valueMap:t,fieldArgs:{collectionName:e}}]:[]),MCe=(e,{collectionName:t,values:n})=>e.some(({valueMap:e,fieldArgs:r})=>Object.entries(e).some(([i,a])=>{if(!n.includes(a))return!1;if(!r)return!0;let o=_M({...r,valueMap:e,keyPath:i});return!o||SM(o,t)})),TM=e=>{let t=ACe(e),n=new Set,r=()=>{let r=e.pendingEntries.filter(e=>!n.has(e)&&MCe(t,e));return r.forEach(e=>{n.add(e),t.push(...jCe(e))}),r.length>0};for(;r(););return n},EM=e=>e.pendingEntries?.some(({baseEntry:e})=>!!e)?[...TM(e)].filter(({baseEntry:e})=>!!e):[],NCe=e=>{let t=TM(e);return e.pendingEntries.filter(e=>t.has(e)).map(e=>UO(e))},DM=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},OM=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},kM=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?OM(n,e?.[r]):void 0)??[],AM=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},jM=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||AM(e).some(e=>jM(e,t,n));return n?.set(e,i),i},MM=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},NM=(e,t,{unescape:n=!0}={})=>{let r=``,i=0;for(;i=e.length){r+=e.slice(a);break}}return r},PM=e=>{let t=[];return{tags:t,literals:NM(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},FM=e=>{let t=[];return NM(e,(e,n)=>(t.push({tag:e,content:n,name:n.split(`|`)[0].trim()}),e)),t},IM=e=>Ck.test(e),LM=(e,t)=>NM(e,(e,n)=>String(t(n)??``)),RM=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=LM(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=LM(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=LM(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&e.includes(`{{`))&&(c=s.map(e=>typeof e==`string`?LM(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),PCe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`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+)?$/,h=/\[([^\]]+)]|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,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(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,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),ICe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(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`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),LCe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),zM=u(PCe(),1),BM=u(FCe(),1),VM=u(ICe(),1),HM=u(LCe(),1),UM=(e,t)=>Array.from({length:t-e+1},(t,n)=>String.fromCodePoint(e+n)),RCe=Array.from({length:94},(e,t)=>{let n=65281+t;return[String.fromCodePoint(n),String.fromCodePoint(n-65248)]}),zCe=[`I`,`II`,`III`,`IV`,`V`,`VI`,`VII`,`VIII`,`IX`,`X`,`XI`,`XII`,`L`,`C`,`D`,`M`].flatMap((e,t)=>[[String.fromCodePoint(8544+t),e],[String.fromCodePoint(8560+t),e.toLowerCase()]]),BCe=`a.b.g.d.e.v.z.t.i.k.l.m.n.o.p.zh.r.s.t.u.ph.k.gh.q.sh.ch.ts.dz.ts.tch.kh.j.h`.split(`.`).flatMap((e,t)=>{let n=e[0].toUpperCase()+e.slice(1);return[[String.fromCodePoint(4304+t),e],[String.fromCodePoint(11520+t),e],[String.fromCodePoint(7312+t),n],[String.fromCodePoint(4256+t),n]]}),VCe=[[688,696],[737,739],[7468,7530],[7579,7615],[8305,8305],[8319,8319],[8336,8351],[43868,43871],[43881,43881],[67456,67514]],HCe=new Map([[`ʱ`,`h`],[`ʴ`,`r`],[`ʵ`,`r`],[`ʶ`,`r`],[`ᴭ`,`AE`],[`ᴯ`,`B`],[`ᴲ`,`E`],[`ᴻ`,`N`],[`ᴽ`,`Ou`],[`ᵄ`,`a`],[`ᵅ`,`a`],[`ᵆ`,`ae`],[`ᵊ`,`a`],[`ᵋ`,`e`],[`ᵌ`,`e`],[`ᵎ`,`i`],[`ᵑ`,`n`],[`ᵓ`,`o`],[`ᵔ`,`o`],[`ᵕ`,`o`],[`ᵙ`,`u`],[`ᵚ`,`u`],[`ᵜ`,`e`],[`ᵝ`,`v`],[`ᵞ`,`g`],[`ᵟ`,`d`],[`ᵠ`,`f`],[`ᵡ`,`x`],[`ᵦ`,`v`],[`ᵧ`,`g`],[`ᵨ`,`r`],[`ᵩ`,`f`],[`ᵪ`,`x`],[`ₔ`,`a`],[`₝`,`w`],[`₞`,`y`],[`₟`,`z`],[`ᶞ`,`d`],[`ᶴ`,`sh`],[`ᶾ`,`zh`],[`ᶵ`,`t`],[`ᶹ`,`v`],[`ᶿ`,`th`]]),UCe=VCe.flatMap(([e,t])=>UM(e,t)).map(e=>[e,HCe.get(e)??e.normalize(`NFKC`)]).filter(([,e])=>RegExp(`^\\p{ASCII}*$`,`v`).test(e)),WCe=[...UM(8448,8527).map(e=>[e,e.normalize(`NFKC`)]).filter(([e,t])=>e.normalize()===e&&RegExp(`^[0-9A-Za-z]$`,`v`).test(t)),[`ⱼ`,`j`],[`ⱽ`,`V`],[`℀`,`a/c`],[`℁`,`a/s`],[`℅`,`c/o`],[`℆`,`c/u`],[`℠`,`(sm)`],[`℡`,`TEL`],[`℻`,`FAX`]],WM=UM(65,90),GCe=[...[10102,10112,10122].flatMap(e=>UM(e,e+9).map((e,t)=>[e,String(t+1)])),...UM(12881,12895).map((e,t)=>[e,String(t+21)]),...UM(12977,12991).map((e,t)=>[e,String(t+36)]),...WM.map((e,t)=>[String.fromCodePoint(127248+t),`(${e})`]),...WM.map((e,t)=>[String.fromCodePoint(127280+t),e]),...WM.map((e,t)=>[String.fromCodePoint(127312+t),e]),[String.fromCodePoint(127232),`0.`],...UM(127233,127242).map((e,t)=>[e,`${t},`]),[String.fromCodePoint(127243),`0`],[String.fromCodePoint(127244),`0`],[`🄫`,`C`],[`🄬`,`R`],[`🄭`,`CD`],[`🄮`,`WZ`],[`🅊`,`HV`],[`🅋`,`MV`],[`🅌`,`SD`],[`🅍`,`SS`],[`🅎`,`PPV`],[`🅏`,`WC`],[`🅪`,`MC`],[`🅫`,`MD`],[`🅬`,`MR`],[`🆐`,`DJ`],[`㉐`,`PTE`],[`﬩`,`+`]],KCe=[...[[13004,13007],[13056,13311],[65040,65055],[65072,65128],[65130,65135],[130032,130041]].flatMap(([e,t])=>UM(e,t)).map(e=>[e,e.normalize(`NFKC`)]).filter(([,e])=>RegExp(`^\\p{ASCII}+$`,`v`).test(e)),...[...WM,...UM(48,57)].map((e,t)=>[String.fromCodePoint(117974+t),e])],qCe=[[`ß`,`ss`],[`ẞ`,`Ss`],[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`À`,`A`],[`Á`,`A`],[`Â`,`A`],[`Ã`,`A`],[`Å`,`A`],[`Æ`,`AE`],[`Ç`,`C`],[`È`,`E`],[`É`,`E`],[`Ê`,`E`],[`Ë`,`E`],[`Ə`,`A`],[`Ì`,`I`],[`Í`,`I`],[`Î`,`I`],[`Ï`,`I`],[`Ð`,`D`],[`Ñ`,`N`],[`Ò`,`O`],[`Ó`,`O`],[`Ô`,`O`],[`Õ`,`O`],[`Ō`,`O`],[`Ő`,`O`],[`Ø`,`O`],[`Œ`,`OE`],[`Ù`,`U`],[`Ú`,`U`],[`Û`,`U`],[`Ű`,`U`],[`Ý`,`Y`],[`Þ`,`TH`],[`à`,`a`],[`á`,`a`],[`â`,`a`],[`ã`,`a`],[`å`,`a`],[`æ`,`ae`],[`ç`,`c`],[`è`,`e`],[`é`,`e`],[`ê`,`e`],[`ë`,`e`],[`ə`,`a`],[`ì`,`i`],[`í`,`i`],[`î`,`i`],[`ï`,`i`],[`ð`,`d`],[`ñ`,`n`],[`ò`,`o`],[`ó`,`o`],[`ô`,`o`],[`õ`,`o`],[`ō`,`o`],[`ő`,`o`],[`ø`,`o`],[`œ`,`oe`],[`ù`,`u`],[`ú`,`u`],[`û`,`u`],[`ű`,`u`],[`ý`,`y`],[`þ`,`th`],[`ÿ`,`y`],[`ª`,`a`],[`º`,`o`],[`µ`,`u`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Ŧ`,`T`],[`ŧ`,`t`],[`Ɓ`,`B`],[`ɓ`,`b`],[`Ɗ`,`D`],[`ɗ`,`d`],[`Ɖ`,`D`],[`ɖ`,`d`],[`Ƙ`,`K`],[`ƙ`,`k`],[`Ƴ`,`Y`],[`ƴ`,`y`],[`Ɣ`,`Gh`],[`ɣ`,`gh`],[`Ʋ`,`V`],[`ʋ`,`v`],[`Ʃ`,`Sh`],[`ʃ`,`sh`],[`Ʒ`,`Zh`],[`ʒ`,`zh`],[`Ɛ`,`E`],[`ɛ`,`e`],[`Ɔ`,`O`],[`ɔ`,`o`],[`ǝ`,`e`],[`Ǥ`,`G`],[`ǥ`,`g`],[`Ǝ`,`E`],[`Ƕ`,`Hv`],[`ƕ`,`hv`],[`Ƿ`,`W`],[`ƿ`,`w`],[`Ȝ`,`Y`],[`ȝ`,`y`],[`ƀ`,`b`],[`Ƃ`,`B`],[`ƃ`,`b`],[`Ƈ`,`C`],[`ƈ`,`c`],[`Ƌ`,`D`],[`ƌ`,`d`],[`Ƒ`,`F`],[`ƒ`,`f`],[`Ɠ`,`G`],[`Ɩ`,`I`],[`Ɨ`,`I`],[`ƚ`,`l`],[`Ɲ`,`N`],[`ƞ`,`n`],[`Ɵ`,`O`],[`Ƣ`,`Gh`],[`ƣ`,`gh`],[`Ƥ`,`P`],[`ƥ`,`p`],[`ƫ`,`t`],[`Ƭ`,`T`],[`ƭ`,`t`],[`Ʈ`,`T`],[`Ʊ`,`U`],[`Ƶ`,`Z`],[`ƶ`,`z`],[`Ǿ`,`O`],[`ǿ`,`o`],[`Ƞ`,`N`],[`ȡ`,`d`],[`Ȣ`,`Ou`],[`ȣ`,`ou`],[`Ȥ`,`Z`],[`ȥ`,`z`],[`ȴ`,`l`],[`ȵ`,`n`],[`ȶ`,`t`],[`ȷ`,`j`],[`Ⱥ`,`A`],[`Ȼ`,`C`],[`ȼ`,`c`],[`Ƚ`,`L`],[`Ⱦ`,`T`],[`ȿ`,`s`],[`ɀ`,`z`],[`Ɂ`,`'`],[`ɂ`,`'`],[`Ƀ`,`B`],[`Ʉ`,`U`],[`Ɇ`,`E`],[`ɇ`,`e`],[`Ɉ`,`J`],[`ɉ`,`j`],[`ɋ`,`q`],[`Ɍ`,`R`],[`ɍ`,`r`],[`Ɏ`,`Y`],[`ɏ`,`y`],[`Ⱡ`,`L`],[`ⱡ`,`l`],[`Ɫ`,`L`],[`Ᵽ`,`P`],[`Ɽ`,`R`],[`ⱥ`,`a`],[`ⱦ`,`t`],[`Ⱨ`,`H`],[`ⱨ`,`h`],[`Ⱪ`,`K`],[`ⱪ`,`k`],[`Ⱬ`,`Z`],[`ⱬ`,`z`],[`Ɑ`,`A`],[`Ɱ`,`M`],[`Ɐ`,`A`],[`Ɒ`,`A`],[`ⱱ`,`v`],[`Ⱳ`,`W`],[`ⱳ`,`w`],[`ⱴ`,`v`],[`Ⱶ`,`H`],[`ⱶ`,`h`],[`ⱸ`,`e`],[`ⱺ`,`o`],[`Ȿ`,`S`],[`Ɀ`,`Z`],[`Ꜧ`,`H`],[`ꜧ`,`h`],[`Ꜳ`,`Aa`],[`ꜳ`,`aa`],[`Ꜵ`,`Ao`],[`ꜵ`,`ao`],[`Ꜷ`,`Au`],[`ꜷ`,`au`],[`Ꜹ`,`Av`],[`ꜹ`,`av`],[`Ꜻ`,`Av`],[`ꜻ`,`av`],[`Ꜽ`,`Ay`],[`ꜽ`,`ay`],[`Ꝁ`,`K`],[`ꝁ`,`k`],[`Ꝃ`,`K`],[`ꝃ`,`k`],[`Ꝅ`,`K`],[`ꝅ`,`k`],[`Ꝉ`,`L`],[`ꝉ`,`l`],[`Ꝋ`,`O`],[`ꝋ`,`o`],[`Ꝏ`,`Oo`],[`ꝏ`,`oo`],[`Ꝑ`,`P`],[`ꝑ`,`p`],[`Ꝓ`,`P`],[`ꝓ`,`p`],[`Ꝕ`,`P`],[`ꝕ`,`p`],[`Ꝗ`,`Q`],[`ꝗ`,`q`],[`Ꝙ`,`Q`],[`ꝙ`,`q`],[`Ꝟ`,`V`],[`ꝟ`,`v`],[`Ꝡ`,`Vy`],[`ꝡ`,`vy`],[`Ꝩ`,`V`],[`ꝩ`,`v`],[`Ꝫ`,`Et`],[`ꝫ`,`et`],[`Ꝭ`,`Is`],[`ꝭ`,`is`],[`Ꝯ`,`Con`],[`ꝯ`,`con`],[`ꞎ`,`l`],[`Ꞑ`,`N`],[`ꞑ`,`n`],[`Ꞓ`,`C`],[`ꞓ`,`c`],[`ꞔ`,`c`],[`ꞕ`,`h`],[`Ꞗ`,`B`],[`ꞗ`,`b`],[`Ꞙ`,`F`],[`ꞙ`,`f`],[`Ꞡ`,`G`],[`ꞡ`,`g`],[`Ꞣ`,`K`],[`ꞣ`,`k`],[`Ꞥ`,`N`],[`ꞥ`,`n`],[`Ꞧ`,`R`],[`ꞧ`,`r`],[`Ꞩ`,`S`],[`ꞩ`,`s`],[`Ɦ`,`H`],[`Ɬ`,`L`],[`Ʝ`,`J`],[`Ꞹ`,`U`],[`ꞹ`,`u`],[`Ꞔ`,`C`],[`Ʂ`,`S`],[`Ᶎ`,`Z`],[`Ꟈ`,`D`],[`ꟈ`,`d`],[`Ꟊ`,`S`],[`ꟊ`,`s`],[`Ꟍ`,`S`],[`ꟍ`,`s`],[`꟱`,`S`],[`ꟲ`,`C`],[`ꟳ`,`F`],[`ꟴ`,`Q`],[`Ꟶ`,`H`],[`ꟶ`,`h`],[`ꟷ`,`I`],[`ꟸ`,`H`],[`ꟹ`,`oe`],[`ꟺ`,`m`],[`ſ`,`s`],[`ff`,`ff`],[`fi`,`fi`],[`fl`,`fl`],[`ffi`,`ffi`],[`ffl`,`ffl`],[`ſt`,`st`],[`st`,`st`],[`DŽ`,`DZ`],[`Dž`,`Dz`],[`dž`,`dz`],[`LJ`,`LJ`],[`Lj`,`Lj`],[`lj`,`lj`],[`NJ`,`NJ`],[`Nj`,`Nj`],[`nj`,`nj`],[`DZ`,`DZ`],[`Dz`,`Dz`],[`dz`,`dz`],[`ă`,`a`],[`Ă`,`A`],[`Đ`,`D`],[`đ`,`d`],[`ĩ`,`i`],[`Ĩ`,`I`],[`ũ`,`u`],[`Ũ`,`U`],[`ơ`,`o`],[`Ơ`,`O`],[`ư`,`u`],[`Ư`,`U`],[`ạ`,`a`],[`Ạ`,`A`],[`ả`,`a`],[`Ả`,`A`],[`ấ`,`a`],[`Ấ`,`A`],[`ầ`,`a`],[`Ầ`,`A`],[`ẩ`,`a`],[`Ẩ`,`A`],[`ẫ`,`a`],[`Ẫ`,`A`],[`ậ`,`a`],[`Ậ`,`A`],[`ắ`,`a`],[`Ắ`,`A`],[`ằ`,`a`],[`Ằ`,`A`],[`ẳ`,`a`],[`Ẳ`,`A`],[`ẵ`,`a`],[`Ẵ`,`A`],[`ặ`,`a`],[`Ặ`,`A`],[`ẹ`,`e`],[`Ẹ`,`E`],[`ẻ`,`e`],[`Ẻ`,`E`],[`ẽ`,`e`],[`Ẽ`,`E`],[`ế`,`e`],[`Ế`,`E`],[`ề`,`e`],[`Ề`,`E`],[`ể`,`e`],[`Ể`,`E`],[`ễ`,`e`],[`Ễ`,`E`],[`ệ`,`e`],[`Ệ`,`E`],[`ỉ`,`i`],[`Ỉ`,`I`],[`ị`,`i`],[`Ị`,`I`],[`ọ`,`o`],[`Ọ`,`O`],[`ỏ`,`o`],[`Ỏ`,`O`],[`ố`,`o`],[`Ố`,`O`],[`ồ`,`o`],[`Ồ`,`O`],[`ổ`,`o`],[`Ổ`,`O`],[`ỗ`,`o`],[`Ỗ`,`O`],[`ộ`,`o`],[`Ộ`,`O`],[`ớ`,`o`],[`Ớ`,`O`],[`ờ`,`o`],[`Ờ`,`O`],[`ở`,`o`],[`Ở`,`O`],[`ỡ`,`o`],[`Ỡ`,`O`],[`ợ`,`o`],[`Ợ`,`O`],[`ụ`,`u`],[`Ụ`,`U`],[`ủ`,`u`],[`Ủ`,`U`],[`ứ`,`u`],[`Ứ`,`U`],[`ừ`,`u`],[`Ừ`,`U`],[`ử`,`u`],[`Ử`,`U`],[`ữ`,`u`],[`Ữ`,`U`],[`ự`,`u`],[`Ự`,`U`],[`ỳ`,`y`],[`Ỳ`,`Y`],[`ỵ`,`y`],[`Ỵ`,`Y`],[`ỷ`,`y`],[`Ỷ`,`Y`],[`ỹ`,`y`],[`Ỹ`,`Y`],[`ء`,`e`],[`آ`,`a`],[`أ`,`a`],[`ؤ`,`w`],[`إ`,`a`],[`ئ`,`y`],[`ا`,`a`],[`ب`,`b`],[`ة`,`t`],[`ت`,`t`],[`ث`,`th`],[`ج`,`j`],[`ح`,`h`],[`خ`,`kh`],[`د`,`d`],[`ذ`,`dh`],[`ر`,`r`],[`ز`,`z`],[`س`,`s`],[`ش`,`sh`],[`ص`,`s`],[`ض`,`d`],[`ط`,`t`],[`ظ`,`z`],[`ع`,`e`],[`غ`,`gh`],[`ـ`,`_`],[`ف`,`f`],[`ق`,`q`],[`ك`,`k`],[`ل`,`l`],[`م`,`m`],[`ن`,`n`],[`ه`,`h`],[`و`,`w`],[`ى`,`a`],[`ي`,`y`],[`َ`,`a`],[`ُ`,`u`],[`ِ`,`i`],[`ًا`,`an`],[`اً`,`an`],[`ً`,`an`],[`ٌ`,`un`],[`ٍ`,`in`],[`ٰ`,`a`],[`َٰ`,`a`],[`ؐ`,``],[`ؑ`,``],[`ؒ`,``],[`ؓ`,``],[`ؔ`,``],[`ؕ`,``],[`ؖ`,``],[`ؗ`,``],[`ؘ`,`a`],[`ؙ`,`u`],[`ؚ`,`i`],[`ٓ`,``],[`ٔ`,``],[`ٕ`,``],[`ٖ`,``],[`ٙ`,``],[`ٚ`,``],[`ٛ`,``],[`ٜ`,``],[`ٝ`,`u`],[`ٞ`,`a`],[`ٟ`,``],[`ۖ`,``],[`ۗ`,``],[`ۘ`,``],[`ۙ`,``],[`ۚ`,``],[`ۛ`,``],[`ۜ`,``],[`ۡ`,``],[`ۢ`,``],[`ۣ`,``],[`ۤ`,``],[`ۧ`,``],[`ۨ`,``],[`ۭ`,``],[`ࢗ`,`e`],[`࣓`,``],[`ࣔ`,``],[`ࣕ`,``],[`ࣖ`,``],[`ࣗ`,``],[`ࣘ`,``],[`ࣙ`,``],[`ࣚ`,``],[`ࣛ`,``],[`ࣜ`,``],[`ࣝ`,``],[`ࣞ`,``],[`ࣟ`,``],[`࣠`,``],[`࣡`,``],[`ࣿ`,``],[`٠`,`0`],[`١`,`1`],[`٢`,`2`],[`٣`,`3`],[`٤`,`4`],[`٥`,`5`],[`٦`,`6`],[`٧`,`7`],[`٨`,`8`],[`٩`,`9`],[`،`,`,`],[`؛`,`;`],[`؟`,`?`],[`٪`,`%`],[`٫`,`.`],[`٬`,`,`],[`٭`,`*`],[`۔`,`.`],[`؍`,`/`],[`؞`,`.`],[`﴾`,`(`],[`﴿`,`)`],[`ٱ`,`a`],[`ۂ`,`h`],[`ۃ`,`t`],[`ۓ`,`y`],[`ۇ`,`u`],[`ۈ`,`u`],[`ۊ`,`u`],[`ۆ`,`o`],[`ۅ`,`o`],[`ۋ`,`v`],[`ۏ`,`v`],[`ە`,`e`],[`ڭ`,`ng`],[`ڴ`,`ng`],[`ڻ`,`n`],[`چ`,`ch`],[`ک`,`k`],[`گ`,`g`],[`پ`,`p`],[`ژ`,`zh`],[`ی`,`y`],[`۰`,`0`],[`۱`,`1`],[`۲`,`2`],[`۳`,`3`],[`۴`,`4`],[`۵`,`5`],[`۶`,`6`],[`۷`,`7`],[`۸`,`8`],[`۹`,`9`],[`ټ`,`t`],[`ځ`,`z`],[`څ`,`c`],[`ډ`,`d`],[`ړ`,`r`],[`ږ`,`g`],[`ښ`,`x`],[`ګ`,`g`],[`ڼ`,`n`],[`ۀ`,`e`],[`ې`,`e`],[`ۍ`,`ai`],[`ٹ`,`t`],[`ڈ`,`d`],[`ڑ`,`r`],[`ں`,`n`],[`ہ`,`h`],[`ھ`,`h`],[`ے`,`e`],[`ڤ`,`v`],[`ڕ`,`r`],[`ڵ`,`l`],[`ێ`,`e`],[`ٺ`,`th`],[`ٻ`,`b`],[`ٽ`,`t`],[`ٿ`,`th`],[`ڀ`,`bh`],[`ڃ`,`n`],[`ڄ`,`j`],[`ڇ`,`ch`],[`ڊ`,`d`],[`ڋ`,`d`],[`ڌ`,`dh`],[`ڍ`,`dh`],[`ڎ`,`d`],[`ڏ`,`d`],[`ڐ`,`d`],[`ڙ`,`r`],[`ڳ`,`g`],[`ڱ`,`ng`],[`ڪ`,`k`],[`ڦ`,`ph`],[`ٮ`,`b`],[`ٯ`,`q`],[`ٲ`,`a`],[`ٳ`,`a`],[`ٴ`,`'`],[`ٵ`,`a`],[`ٶ`,`w`],[`ٷ`,`u`],[`ٸ`,`y`],[`𞸀`,`a`],[`𞸁`,`b`],[`𞸂`,`j`],[`𞸃`,`d`],[`𞸅`,`w`],[`𞸆`,`z`],[`𞸇`,`h`],[`𞸈`,`t`],[`𞸉`,`y`],[`𞸊`,`k`],[`𞸋`,`l`],[`𞸌`,`m`],[`𞸍`,`n`],[`𞸎`,`s`],[`𞸏`,`e`],[`𞸐`,`f`],[`𞸑`,`s`],[`𞸒`,`q`],[`𞸓`,`r`],[`𞸔`,`sh`],[`𞸕`,`t`],[`𞸖`,`th`],[`𞸗`,`kh`],[`𞸘`,`dh`],[`𞸙`,`d`],[`𞸚`,`z`],[`𞸛`,`gh`],[`𞸜`,`b`],[`𞸝`,`n`],[`𞸞`,`f`],[`𞸟`,`q`],[`𞸡`,`b`],[`𞸢`,`j`],[`𞸤`,`h`],[`𞸧`,`h`],[`𞸩`,`y`],[`𞸪`,`k`],[`𞸫`,`l`],[`𞸬`,`m`],[`𞸭`,`n`],[`𞸮`,`s`],[`𞸯`,`e`],[`𞸰`,`f`],[`𞸱`,`s`],[`𞸲`,`q`],[`𞸴`,`sh`],[`𞸵`,`t`],[`𞸶`,`th`],[`𞸷`,`kh`],[`𞸹`,`d`],[`𞸻`,`gh`],[`𞹂`,`j`],[`𞹇`,`h`],[`𞹉`,`y`],[`𞹋`,`l`],[`𞹍`,`n`],[`𞹎`,`s`],[`𞹏`,`e`],[`𞹑`,`s`],[`𞹒`,`q`],[`𞹔`,`sh`],[`𞹗`,`kh`],[`𞹙`,`d`],[`𞹛`,`gh`],[`𞹝`,`n`],[`𞹟`,`q`],[`𞹡`,`b`],[`𞹢`,`j`],[`𞹤`,`h`],[`𞹧`,`h`],[`𞹨`,`t`],[`𞹩`,`y`],[`𞹪`,`k`],[`𞹬`,`m`],[`𞹭`,`n`],[`𞹮`,`s`],[`𞹯`,`e`],[`𞹰`,`f`],[`𞹱`,`s`],[`𞹲`,`q`],[`𞹴`,`sh`],[`𞹵`,`t`],[`𞹶`,`th`],[`𞹷`,`kh`],[`𞹹`,`d`],[`𞹺`,`z`],[`𞹻`,`gh`],[`𞹼`,`b`],[`𞹾`,`f`],[`𞺀`,`a`],[`𞺁`,`b`],[`𞺂`,`j`],[`𞺃`,`d`],[`𞺄`,`h`],[`𞺅`,`w`],[`𞺆`,`z`],[`𞺇`,`h`],[`𞺈`,`t`],[`𞺉`,`y`],[`𞺋`,`l`],[`𞺌`,`m`],[`𞺍`,`n`],[`𞺎`,`s`],[`𞺏`,`e`],[`𞺐`,`f`],[`𞺑`,`s`],[`𞺒`,`q`],[`𞺓`,`r`],[`𞺔`,`sh`],[`𞺕`,`t`],[`𞺖`,`th`],[`𞺗`,`kh`],[`𞺘`,`dh`],[`𞺙`,`d`],[`𞺚`,`z`],[`𞺛`,`gh`],[`𞺡`,`b`],[`𞺢`,`j`],[`𞺣`,`d`],[`𞺥`,`w`],[`𞺦`,`z`],[`𞺧`,`h`],[`𞺨`,`t`],[`𞺩`,`y`],[`𞺫`,`l`],[`𞺬`,`m`],[`𞺭`,`n`],[`𞺮`,`s`],[`𞺯`,`e`],[`𞺰`,`f`],[`𞺱`,`s`],[`𞺲`,`q`],[`𞺳`,`r`],[`𞺴`,`sh`],[`𞺵`,`t`],[`𞺶`,`th`],[`𞺷`,`kh`],[`𞺸`,`dh`],[`𞺹`,`d`],[`𞺺`,`z`],[`𞺻`,`gh`],[`А`,`A`],[`а`,`a`],[`Б`,`B`],[`б`,`b`],[`В`,`V`],[`в`,`v`],[`Г`,`G`],[`г`,`g`],[`Д`,`D`],[`д`,`d`],[`ъе`,`ye`],[`Ъе`,`Ye`],[`ъЕ`,`yE`],[`ЪЕ`,`YE`],[`Е`,`E`],[`е`,`e`],[`Ё`,`Yo`],[`ё`,`yo`],[`Ж`,`Zh`],[`ж`,`zh`],[`З`,`Z`],[`з`,`z`],[`И`,`I`],[`и`,`i`],[`ый`,`iy`],[`Ый`,`Iy`],[`ЫЙ`,`IY`],[`ыЙ`,`iY`],[`Й`,`Y`],[`й`,`y`],[`К`,`K`],[`к`,`k`],[`Л`,`L`],[`л`,`l`],[`М`,`M`],[`м`,`m`],[`Н`,`N`],[`н`,`n`],[`О`,`O`],[`о`,`o`],[`П`,`P`],[`п`,`p`],[`Р`,`R`],[`р`,`r`],[`С`,`S`],[`с`,`s`],[`Т`,`T`],[`т`,`t`],[`У`,`U`],[`у`,`u`],[`Ф`,`F`],[`ф`,`f`],[`Х`,`Kh`],[`х`,`kh`],[`Ц`,`Ts`],[`ц`,`ts`],[`Ч`,`Ch`],[`ч`,`ch`],[`Ш`,`Sh`],[`ш`,`sh`],[`Щ`,`Sch`],[`щ`,`sch`],[`Ъ`,``],[`ъ`,``],[`Ы`,`Y`],[`ы`,`y`],[`Ь`,``],[`ь`,``],[`Э`,`E`],[`э`,`e`],[`Ю`,`Yu`],[`ю`,`yu`],[`Я`,`Ya`],[`я`,`ya`],[`Ѣ`,`E`],[`ѣ`,`e`],[`Ѳ`,`F`],[`ѳ`,`f`],[`Ѵ`,`I`],[`ѵ`,`i`],[`Ѡ`,`O`],[`ѡ`,`o`],[`Ѻ`,`O`],[`ѻ`,`o`],[`Ѯ`,`Ks`],[`ѯ`,`ks`],[`Ѱ`,`Ps`],[`ѱ`,`ps`],[`Ѹ`,`U`],[`ѹ`,`u`],[`Ѥ`,`Ye`],[`ѥ`,`ye`],[`Ҁ`,`Q`],[`ҁ`,`q`],[`Ѿ`,`Ot`],[`ѿ`,`ot`],[`Ѧ`,`E`],[`ѧ`,`e`],[`Ѩ`,`Ye`],[`ѩ`,`ye`],[`Ѫ`,`U`],[`ѫ`,`u`],[`Ѭ`,`Yu`],[`ѭ`,`yu`],[`Ѽ`,`O`],[`ѽ`,`o`],[`Ә`,`A`],[`ә`,`a`],[`Ғ`,`Gh`],[`ғ`,`gh`],[`Җ`,`J`],[`җ`,`j`],[`Қ`,`Q`],[`қ`,`q`],[`Ң`,`Ng`],[`ң`,`ng`],[`Һ`,`H`],[`һ`,`h`],[`Ө`,`O`],[`ө`,`o`],[`Ұ`,`U`],[`ұ`,`u`],[`Ү`,`U`],[`ү`,`u`],[`Ҳ`,`H`],[`ҳ`,`h`],[`Ҷ`,`J`],[`ҷ`,`j`],[`Ӯ`,`U`],[`ӯ`,`u`],[`Ӣ`,`I`],[`ӣ`,`i`],[`Ҝ`,`G`],[`ҝ`,`g`],[`Ҹ`,`J`],[`ҹ`,`j`],[`Ҡ`,`Q`],[`ҡ`,`q`],[`Ҫ`,`Th`],[`ҫ`,`th`],[`Ӑ`,`A`],[`ӑ`,`a`],[`Ӗ`,`E`],[`ӗ`,`e`],[`Ӂ`,`J`],[`ӂ`,`j`],[`Ӕ`,`Ae`],[`ӕ`,`ae`],[`Ӈ`,`Ng`],[`ӈ`,`ng`],[`Ӱ`,`U`],[`ӱ`,`u`],[`Ӳ`,`U`],[`ӳ`,`u`],[`Ӧ`,`O`],[`ӧ`,`o`],[`Ӵ`,`Ch`],[`ӵ`,`ch`],[`Ӹ`,`Y`],[`ӹ`,`y`],[`Ӄ`,`Q`],[`ӄ`,`q`],[`Ҋ`,`J`],[`ҋ`,`j`],[`Ҍ`,``],[`ҍ`,``],[`Ҏ`,`R`],[`ҏ`,`r`],[`Ҕ`,`Gh`],[`ҕ`,`gh`],[`Ҙ`,`Dh`],[`ҙ`,`dh`],[`Ҟ`,`K`],[`ҟ`,`k`],[`Ҥ`,`Ng`],[`ҥ`,`ng`],[`Ҧ`,`P`],[`ҧ`,`p`],[`Ҩ`,`H`],[`ҩ`,`h`],[`Ҭ`,`T`],[`ҭ`,`t`],[`Ҵ`,`Ts`],[`ҵ`,`ts`],[`Ҽ`,`Ch`],[`ҽ`,`ch`],[`Ҿ`,`Ch`],[`ҿ`,`ch`],[`Ӏ`,`'`],[`ӏ`,`'`],[`Ӆ`,`L`],[`ӆ`,`l`],[`Ӊ`,`N`],[`ӊ`,`n`],[`Ӌ`,`J`],[`ӌ`,`j`],[`Ӎ`,`M`],[`ӎ`,`m`],[`Ӡ`,`Dz`],[`ӡ`,`dz`],[`Ӷ`,`G`],[`ӷ`,`g`],[`Ӻ`,`Gh`],[`ӻ`,`gh`],[`Ӽ`,`Kh`],[`ӽ`,`kh`],[`Ӿ`,`H`],[`ӿ`,`h`],[`Ԁ`,`D`],[`ԁ`,`d`],[`Ԃ`,`Dj`],[`ԃ`,`dj`],[`Ԅ`,`Zj`],[`ԅ`,`zj`],[`Ԇ`,`Dz`],[`ԇ`,`dz`],[`Ԉ`,`Lj`],[`ԉ`,`lj`],[`Ԋ`,`Nj`],[`ԋ`,`nj`],[`Ԍ`,`Sj`],[`ԍ`,`sj`],[`Ԏ`,`Tj`],[`ԏ`,`tj`],[`Ԑ`,`E`],[`ԑ`,`e`],[`Ԓ`,`L`],[`ԓ`,`l`],[`Ԕ`,`Lh`],[`ԕ`,`lh`],[`Ԗ`,`Rh`],[`ԗ`,`rh`],[`Ԙ`,`Yae`],[`ԙ`,`yae`],[`Ԛ`,`Q`],[`ԛ`,`q`],[`Ԝ`,`W`],[`ԝ`,`w`],[`Ԟ`,`Q`],[`ԟ`,`q`],[`Ԡ`,`L`],[`ԡ`,`l`],[`Ԣ`,`Ng`],[`ԣ`,`ng`],[`Ԥ`,`P`],[`ԥ`,`p`],[`Ԧ`,`Sh`],[`ԧ`,`sh`],[`Ԩ`,`Ng`],[`ԩ`,`ng`],[`Ԫ`,`Dzh`],[`ԫ`,`dzh`],[`Ԭ`,`Tch`],[`ԭ`,`tch`],[`Ԯ`,`L`],[`ԯ`,`l`],[`ᲀ`,`v`],[`ᲁ`,`d`],[`ᲂ`,`o`],[`ᲃ`,`s`],[`ᲄ`,`t`],[`ᲅ`,`t`],[`ᲆ`,``],[`ᲇ`,`e`],[`ᲈ`,`u`],[`Ᲊ`,`C`],[`ᲊ`,`c`],[`҈`,``],[`҉`,``],[`ⷠ`,``],[`ⷡ`,``],[`ⷢ`,``],[`ⷣ`,``],[`ⷤ`,``],[`ⷥ`,``],[`ⷦ`,``],[`ⷧ`,``],[`ⷨ`,``],[`ⷩ`,``],[`ⷪ`,``],[`ⷫ`,``],[`ⷬ`,``],[`ⷭ`,``],[`ⷮ`,``],[`ⷯ`,``],[`ⷰ`,``],[`ⷱ`,``],[`ⷲ`,``],[`ⷳ`,``],[`ⷴ`,``],[`ⷵ`,``],[`ⷶ`,``],[`ⷷ`,``],[`ⷸ`,``],[`ⷹ`,``],[`ⷺ`,``],[`ⷻ`,``],[`ⷼ`,``],[`ⷽ`,``],[`ⷾ`,``],[`ⷿ`,``],[`꙰`,``],[`꙱`,``],[`꙲`,``],[`ꙴ`,``],[`ꙵ`,``],[`ꙶ`,``],[`ꙷ`,``],[`ꙸ`,``],[`ꙹ`,``],[`ꙺ`,``],[`ꙻ`,``],[`𝉂`,``],[`𝉃`,``],[`𝉄`,``],[`ꙮ`,`o`],[`꙳`,`*`],[`꙾`,`'`],[`Ꙁ`,`Z`],[`ꙁ`,`z`],[`Ꙃ`,`Dz`],[`ꙃ`,`dz`],[`Ꙅ`,`Dz`],[`ꙅ`,`dz`],[`Ꙇ`,`I`],[`ꙇ`,`i`],[`Ꙉ`,`Dj`],[`ꙉ`,`dj`],[`Ꙋ`,`U`],[`ꙋ`,`u`],[`Ꙍ`,`O`],[`ꙍ`,`o`],[`Ꙏ`,``],[`ꙏ`,``],[`Ꙑ`,`Y`],[`ꙑ`,`y`],[`Ꙓ`,`Ye`],[`ꙓ`,`ye`],[`Ꙕ`,`Yu`],[`ꙕ`,`yu`],[`Ꙗ`,`Ya`],[`ꙗ`,`ya`],[`Ꙙ`,`E`],[`ꙙ`,`e`],[`Ꙛ`,`E`],[`ꙛ`,`e`],[`Ꙝ`,`Ye`],[`ꙝ`,`ye`],[`Ꙟ`,`Y`],[`ꙟ`,`y`],[`Ꙡ`,`Ts`],[`ꙡ`,`ts`],[`Ꙣ`,`D`],[`ꙣ`,`d`],[`Ꙥ`,`L`],[`ꙥ`,`l`],[`Ꙧ`,`M`],[`ꙧ`,`m`],[`Ꙩ`,`O`],[`ꙩ`,`o`],[`Ꙫ`,`O`],[`ꙫ`,`o`],[`Ꙭ`,`O`],[`ꙭ`,`o`],[`Ꚁ`,`D`],[`ꚁ`,`d`],[`Ꚃ`,`Dz`],[`ꚃ`,`dz`],[`Ꚅ`,`Zh`],[`ꚅ`,`zh`],[`Ꚇ`,`Ch`],[`ꚇ`,`ch`],[`Ꚉ`,`Dzh`],[`ꚉ`,`dzh`],[`Ꚋ`,`T`],[`ꚋ`,`t`],[`Ꚍ`,`T`],[`ꚍ`,`t`],[`Ꚏ`,`Ts`],[`ꚏ`,`ts`],[`Ꚑ`,`Ts`],[`ꚑ`,`ts`],[`Ꚓ`,`Ch`],[`ꚓ`,`ch`],[`Ꚕ`,`H`],[`ꚕ`,`h`],[`Ꚗ`,`Sh`],[`ꚗ`,`sh`],[`Ꚙ`,`Oo`],[`ꚙ`,`oo`],[`Ꚛ`,`O`],[`ꚛ`,`o`],[`ș`,`s`],[`Ș`,`S`],[`ț`,`t`],[`Ț`,`T`],[`ţ`,`t`],[`Ţ`,`T`],[`ş`,`s`],[`Ş`,`S`],[`ğ`,`g`],[`Ğ`,`G`],[`ı`,`i`],[`İ`,`I`],[`ա`,`a`],[`Ա`,`A`],[`բ`,`b`],[`Բ`,`B`],[`գ`,`g`],[`Գ`,`G`],[`դ`,`d`],[`Դ`,`D`],[`ե`,`ye`],[`Ե`,`Ye`],[`զ`,`z`],[`Զ`,`Z`],[`է`,`e`],[`Է`,`E`],[`ը`,`y`],[`Ը`,`Y`],[`թ`,`t`],[`Թ`,`T`],[`ժ`,`zh`],[`Ժ`,`Zh`],[`ի`,`i`],[`Ի`,`I`],[`լ`,`l`],[`Լ`,`L`],[`խ`,`kh`],[`Խ`,`Kh`],[`ծ`,`ts`],[`Ծ`,`Ts`],[`կ`,`k`],[`Կ`,`K`],[`հ`,`h`],[`Հ`,`H`],[`ձ`,`dz`],[`Ձ`,`Dz`],[`ղ`,`gh`],[`Ղ`,`Gh`],[`ճ`,`tch`],[`Ճ`,`Tch`],[`մ`,`m`],[`Մ`,`M`],[`յ`,`y`],[`Յ`,`Y`],[`ն`,`n`],[`Ն`,`N`],[`շ`,`sh`],[`Շ`,`Sh`],[`ու`,`u`],[`ՈՒ`,`U`],[`Ու`,`U`],[`ո`,`vo`],[`Ո`,`Vo`],[`չ`,`ch`],[`Չ`,`Ch`],[`պ`,`p`],[`Պ`,`P`],[`ջ`,`j`],[`Ջ`,`J`],[`ռ`,`r`],[`Ռ`,`R`],[`ս`,`s`],[`Ս`,`S`],[`վ`,`v`],[`Վ`,`V`],[`տ`,`t`],[`Տ`,`T`],[`ր`,`r`],[`Ր`,`R`],[`ց`,`c`],[`Ց`,`C`],[`փ`,`p`],[`Փ`,`P`],[`ք`,`q`],[`Ք`,`Q`],[`օ`,`o`],[`Օ`,`O`],[`ֆ`,`f`],[`Ֆ`,`F`],[`ւ`,`v`],[`Ւ`,`V`],[`և`,`yev`],[`ﬓ`,`mn`],[`ﬔ`,`mye`],[`ﬕ`,`mi`],[`ﬖ`,`vn`],[`ﬗ`,`mkh`],[`։`,`.`],[`՝`,`,`],[`՞`,`?`],[`՛`,`!`],[`՜`,`!`],[`՚`,`'`],[`՟`,`.`],[`ՠ`,`a`],[`ֈ`,`y`],...BCe,[`ჱ`,`e`],[`ჲ`,`y`],[`ჳ`,`w`],[`ჴ`,`q`],[`ჵ`,`o`],[`ჶ`,`f`],[`ႁ`,`E`],[`ႂ`,`Y`],[`ႃ`,`W`],[`ႄ`,`Q`],[`ႅ`,`O`],[`ⴡ`,`e`],[`ⴢ`,`y`],[`ⴣ`,`w`],[`ⴤ`,`q`],[`ⴥ`,`o`],[`Ჱ`,`E`],[`Ჲ`,`Y`],[`Ჳ`,`W`],[`Ჴ`,`Q`],[`Ჵ`,`O`],[`Ჶ`,`F`],[`č`,`c`],[`ď`,`d`],[`ě`,`e`],[`ň`,`n`],[`ř`,`r`],[`š`,`s`],[`ť`,`t`],[`ů`,`u`],[`ž`,`z`],[`Č`,`C`],[`Ď`,`D`],[`Ě`,`E`],[`Ň`,`N`],[`Ř`,`R`],[`Š`,`S`],[`Ť`,`T`],[`Ů`,`U`],[`Ž`,`Z`],[`ހ`,`h`],[`ށ`,`sh`],[`ނ`,`n`],[`ރ`,`r`],[`ބ`,`b`],[`ޅ`,`lh`],[`ކ`,`k`],[`އ`,`a`],[`ވ`,`v`],[`މ`,`m`],[`ފ`,`f`],[`ދ`,`dh`],[`ތ`,`th`],[`ލ`,`l`],[`ގ`,`g`],[`ޏ`,`gn`],[`ސ`,`s`],[`ޑ`,`d`],[`ޒ`,`z`],[`ޓ`,`t`],[`ޔ`,`y`],[`ޕ`,`p`],[`ޖ`,`j`],[`ޗ`,`ch`],[`ޘ`,`tt`],[`ޙ`,`hh`],[`ޚ`,`kh`],[`ޛ`,`th`],[`ޜ`,`z`],[`ޝ`,`sh`],[`ޞ`,`s`],[`ޟ`,`d`],[`ޠ`,`t`],[`ޡ`,`z`],[`ޢ`,`a`],[`ޣ`,`gh`],[`ޤ`,`q`],[`ޥ`,`w`],[`ޱ`,`n`],[`ަ`,`a`],[`ާ`,`aa`],[`ި`,`i`],[`ީ`,`ee`],[`ު`,`u`],[`ޫ`,`oo`],[`ެ`,`e`],[`ޭ`,`ey`],[`ޮ`,`o`],[`ޯ`,`oa`],[`ް`,``],[`α`,`a`],[`β`,`v`],[`γ`,`g`],[`δ`,`d`],[`ε`,`e`],[`ζ`,`z`],[`η`,`i`],[`θ`,`th`],[`ι`,`i`],[`κ`,`k`],[`λ`,`l`],[`μ`,`m`],[`ν`,`n`],[`ξ`,`ks`],[`ο`,`o`],[`π`,`p`],[`ρ`,`r`],[`σ`,`s`],[`τ`,`t`],[`υ`,`y`],[`φ`,`f`],[`χ`,`x`],[`ψ`,`ps`],[`ω`,`o`],[`ά`,`a`],[`έ`,`e`],[`ί`,`i`],[`ό`,`o`],[`ύ`,`y`],[`ή`,`i`],[`ώ`,`o`],[`ς`,`s`],[`ϊ`,`i`],[`ΰ`,`y`],[`ϋ`,`y`],[`ΐ`,`i`],[`Α`,`A`],[`Β`,`V`],[`Γ`,`G`],[`Δ`,`D`],[`Ε`,`E`],[`Ζ`,`Z`],[`Η`,`I`],[`Θ`,`TH`],[`Ι`,`I`],[`Κ`,`K`],[`Λ`,`L`],[`Μ`,`M`],[`Ν`,`N`],[`Ξ`,`KS`],[`Ο`,`O`],[`Π`,`P`],[`Ρ`,`R`],[`Σ`,`S`],[`Τ`,`T`],[`Υ`,`Y`],[`Φ`,`F`],[`Χ`,`X`],[`Ψ`,`PS`],[`Ω`,`O`],[`Ά`,`A`],[`Έ`,`E`],[`Ί`,`I`],[`Ό`,`O`],[`Ύ`,`Y`],[`Ή`,`I`],[`Ώ`,`O`],[`Ϊ`,`I`],[`Ϋ`,`Y`],[`ϐ`,`v`],[`ϑ`,`th`],[`ϕ`,`f`],[`ϖ`,`p`],[`ϰ`,`k`],[`ϱ`,`r`],[`ϲ`,`s`],[`ϳ`,`j`],[`ϵ`,`e`],[`ϒ`,`Y`],[`ϓ`,`Y`],[`ϔ`,`Y`],[`ϴ`,`TH`],[`ϗ`,`k`],[`Ϗ`,`K`],[`϶`,`e`],[`ᴦ`,`g`],[`ᴧ`,`l`],[`ᴨ`,`p`],[`ᴩ`,`r`],[`ᴪ`,`ps`],[`Ͱ`,`H`],[`ͱ`,`h`],[`Ͳ`,`SS`],[`ͳ`,`ss`],[`Ͷ`,`W`],[`ͷ`,`w`],[`Ϳ`,`J`],[`Ϸ`,`SH`],[`ϸ`,`sh`],[`Ϙ`,`Q`],[`ϙ`,`q`],[`Ϛ`,`ST`],[`ϛ`,`st`],[`Ϝ`,`W`],[`ϝ`,`w`],[`Ϟ`,`Q`],[`ϟ`,`q`],[`Ϡ`,`SS`],[`ϡ`,`ss`],[`Ϻ`,`S`],[`ϻ`,`s`],[`ϼ`,`r`],[`Ϲ`,`S`],[`Ͻ`,`S`],[`Ͼ`,`S`],[`Ͽ`,`S`],[`ͻ`,`s`],[`ͼ`,`s`],[`ͽ`,`s`],[`ā`,`a`],[`ē`,`e`],[`ģ`,`g`],[`ī`,`i`],[`ķ`,`k`],[`ļ`,`l`],[`ņ`,`n`],[`ū`,`u`],[`Ā`,`A`],[`Ē`,`E`],[`Ģ`,`G`],[`Ī`,`I`],[`Ķ`,`K`],[`Ļ`,`L`],[`Ņ`,`N`],[`Ū`,`U`],[`ą`,`a`],[`ę`,`e`],[`ė`,`e`],[`į`,`i`],[`ų`,`u`],[`Ą`,`A`],[`Ę`,`E`],[`Ė`,`E`],[`Į`,`I`],[`Ų`,`U`],[`Ѓ`,`Gj`],[`ѓ`,`gj`],[`Ѕ`,`Dz`],[`ѕ`,`dz`],[`Ј`,`J`],[`ј`,`j`],[`Ќ`,`Kj`],[`ќ`,`kj`],[`Љ`,`Lj`],[`љ`,`lj`],[`Њ`,`Nj`],[`њ`,`nj`],[`Џ`,`Dz`],[`џ`,`dz`],[`Тс`,`Ts`],[`тс`,`ts`],[`Ђ`,`Dj`],[`ђ`,`dj`],[`Ћ`,`C`],[`ћ`,`c`],[`ć`,`c`],[`ł`,`l`],[`ń`,`n`],[`ś`,`s`],[`ź`,`z`],[`ż`,`z`],[`Ć`,`C`],[`Ł`,`L`],[`Ń`,`N`],[`Ś`,`S`],[`Ź`,`Z`],[`Ż`,`Z`],[`Є`,`Ye`],[`І`,`I`],[`Ї`,`Yi`],[`Ґ`,`G`],[`є`,`ye`],[`і`,`i`],[`ї`,`yi`],[`ґ`,`g`],[`IJ`,`IJ`],[`ij`,`ij`],[`¢`,`c`],[`£`,`L`],[`¥`,`Y`],[`߿`,`b`],[`৳`,`t`],[`૱`,`Bo`],[`฿`,`B`],[`₠`,`CE`],[`₡`,`C`],[`₢`,`Cr`],[`₣`,`F`],[`₤`,`L`],[`₥`,`m`],[`₦`,`N`],[`₧`,`Pt`],[`₨`,`Rs`],[`₩`,`W`],[`₫`,`d`],[`€`,`E`],[`₭`,`K`],[`₮`,`T`],[`₯`,`Dp`],[`₰`,`S`],[`₱`,`P`],[`₲`,`G`],[`₳`,`A`],[`₴`,`S`],[`₵`,`C`],[`₶`,`tt`],[`₷`,`S`],[`₸`,`T`],[`₹`,`R`],[`₺`,`L`],[`₽`,`P`],[`₿`,`B`],[`﹩`,`$`],[`¢`,`c`],[`£`,`L`],[`¥`,`Y`],[`₩`,`W`],...WCe,[`𝐀`,`A`],[`𝐁`,`B`],[`𝐂`,`C`],[`𝐃`,`D`],[`𝐄`,`E`],[`𝐅`,`F`],[`𝐆`,`G`],[`𝐇`,`H`],[`𝐈`,`I`],[`𝐉`,`J`],[`𝐊`,`K`],[`𝐋`,`L`],[`𝐌`,`M`],[`𝐍`,`N`],[`𝐎`,`O`],[`𝐏`,`P`],[`𝐐`,`Q`],[`𝐑`,`R`],[`𝐒`,`S`],[`𝐓`,`T`],[`𝐔`,`U`],[`𝐕`,`V`],[`𝐖`,`W`],[`𝐗`,`X`],[`𝐘`,`Y`],[`𝐙`,`Z`],[`𝐚`,`a`],[`𝐛`,`b`],[`𝐜`,`c`],[`𝐝`,`d`],[`𝐞`,`e`],[`𝐟`,`f`],[`𝐠`,`g`],[`𝐡`,`h`],[`𝐢`,`i`],[`𝐣`,`j`],[`𝐤`,`k`],[`𝐥`,`l`],[`𝐦`,`m`],[`𝐧`,`n`],[`𝐨`,`o`],[`𝐩`,`p`],[`𝐪`,`q`],[`𝐫`,`r`],[`𝐬`,`s`],[`𝐭`,`t`],[`𝐮`,`u`],[`𝐯`,`v`],[`𝐰`,`w`],[`𝐱`,`x`],[`𝐲`,`y`],[`𝐳`,`z`],[`𝐴`,`A`],[`𝐵`,`B`],[`𝐶`,`C`],[`𝐷`,`D`],[`𝐸`,`E`],[`𝐹`,`F`],[`𝐺`,`G`],[`𝐻`,`H`],[`𝐼`,`I`],[`𝐽`,`J`],[`𝐾`,`K`],[`𝐿`,`L`],[`𝑀`,`M`],[`𝑁`,`N`],[`𝑂`,`O`],[`𝑃`,`P`],[`𝑄`,`Q`],[`𝑅`,`R`],[`𝑆`,`S`],[`𝑇`,`T`],[`𝑈`,`U`],[`𝑉`,`V`],[`𝑊`,`W`],[`𝑋`,`X`],[`𝑌`,`Y`],[`𝑍`,`Z`],[`𝑎`,`a`],[`𝑏`,`b`],[`𝑐`,`c`],[`𝑑`,`d`],[`𝑒`,`e`],[`𝑓`,`f`],[`𝑔`,`g`],[`𝑖`,`i`],[`𝑗`,`j`],[`𝑘`,`k`],[`𝑙`,`l`],[`𝑚`,`m`],[`𝑛`,`n`],[`𝑜`,`o`],[`𝑝`,`p`],[`𝑞`,`q`],[`𝑟`,`r`],[`𝑠`,`s`],[`𝑡`,`t`],[`𝑢`,`u`],[`𝑣`,`v`],[`𝑤`,`w`],[`𝑥`,`x`],[`𝑦`,`y`],[`𝑧`,`z`],[`𝑨`,`A`],[`𝑩`,`B`],[`𝑪`,`C`],[`𝑫`,`D`],[`𝑬`,`E`],[`𝑭`,`F`],[`𝑮`,`G`],[`𝑯`,`H`],[`𝑰`,`I`],[`𝑱`,`J`],[`𝑲`,`K`],[`𝑳`,`L`],[`𝑴`,`M`],[`𝑵`,`N`],[`𝑶`,`O`],[`𝑷`,`P`],[`𝑸`,`Q`],[`𝑹`,`R`],[`𝑺`,`S`],[`𝑻`,`T`],[`𝑼`,`U`],[`𝑽`,`V`],[`𝑾`,`W`],[`𝑿`,`X`],[`𝒀`,`Y`],[`𝒁`,`Z`],[`𝒂`,`a`],[`𝒃`,`b`],[`𝒄`,`c`],[`𝒅`,`d`],[`𝒆`,`e`],[`𝒇`,`f`],[`𝒈`,`g`],[`𝒉`,`h`],[`𝒊`,`i`],[`𝒋`,`j`],[`𝒌`,`k`],[`𝒍`,`l`],[`𝒎`,`m`],[`𝒏`,`n`],[`𝒐`,`o`],[`𝒑`,`p`],[`𝒒`,`q`],[`𝒓`,`r`],[`𝒔`,`s`],[`𝒕`,`t`],[`𝒖`,`u`],[`𝒗`,`v`],[`𝒘`,`w`],[`𝒙`,`x`],[`𝒚`,`y`],[`𝒛`,`z`],[`𝒜`,`A`],[`𝒞`,`C`],[`𝒟`,`D`],[`𝒢`,`G`],[`𝒥`,`J`],[`𝒦`,`K`],[`𝒩`,`N`],[`𝒪`,`O`],[`𝒫`,`P`],[`𝒬`,`Q`],[`𝒮`,`S`],[`𝒯`,`T`],[`𝒰`,`U`],[`𝒱`,`V`],[`𝒲`,`W`],[`𝒳`,`X`],[`𝒴`,`Y`],[`𝒵`,`Z`],[`𝒶`,`a`],[`𝒷`,`b`],[`𝒸`,`c`],[`𝒹`,`d`],[`𝒻`,`f`],[`𝒽`,`h`],[`𝒾`,`i`],[`𝒿`,`j`],[`𝓀`,`k`],[`𝓁`,`l`],[`𝓂`,`m`],[`𝓃`,`n`],[`𝓅`,`p`],[`𝓆`,`q`],[`𝓇`,`r`],[`𝓈`,`s`],[`𝓉`,`t`],[`𝓊`,`u`],[`𝓋`,`v`],[`𝓌`,`w`],[`𝓍`,`x`],[`𝓎`,`y`],[`𝓏`,`z`],[`𝓐`,`A`],[`𝓑`,`B`],[`𝓒`,`C`],[`𝓓`,`D`],[`𝓔`,`E`],[`𝓕`,`F`],[`𝓖`,`G`],[`𝓗`,`H`],[`𝓘`,`I`],[`𝓙`,`J`],[`𝓚`,`K`],[`𝓛`,`L`],[`𝓜`,`M`],[`𝓝`,`N`],[`𝓞`,`O`],[`𝓟`,`P`],[`𝓠`,`Q`],[`𝓡`,`R`],[`𝓢`,`S`],[`𝓣`,`T`],[`𝓤`,`U`],[`𝓥`,`V`],[`𝓦`,`W`],[`𝓧`,`X`],[`𝓨`,`Y`],[`𝓩`,`Z`],[`𝓪`,`a`],[`𝓫`,`b`],[`𝓬`,`c`],[`𝓭`,`d`],[`𝓮`,`e`],[`𝓯`,`f`],[`𝓰`,`g`],[`𝓱`,`h`],[`𝓲`,`i`],[`𝓳`,`j`],[`𝓴`,`k`],[`𝓵`,`l`],[`𝓶`,`m`],[`𝓷`,`n`],[`𝓸`,`o`],[`𝓹`,`p`],[`𝓺`,`q`],[`𝓻`,`r`],[`𝓼`,`s`],[`𝓽`,`t`],[`𝓾`,`u`],[`𝓿`,`v`],[`𝔀`,`w`],[`𝔁`,`x`],[`𝔂`,`y`],[`𝔃`,`z`],[`𝔄`,`A`],[`𝔅`,`B`],[`𝔇`,`D`],[`𝔈`,`E`],[`𝔉`,`F`],[`𝔊`,`G`],[`𝔍`,`J`],[`𝔎`,`K`],[`𝔏`,`L`],[`𝔐`,`M`],[`𝔑`,`N`],[`𝔒`,`O`],[`𝔓`,`P`],[`𝔔`,`Q`],[`𝔖`,`S`],[`𝔗`,`T`],[`𝔘`,`U`],[`𝔙`,`V`],[`𝔚`,`W`],[`𝔛`,`X`],[`𝔜`,`Y`],[`𝔞`,`a`],[`𝔟`,`b`],[`𝔠`,`c`],[`𝔡`,`d`],[`𝔢`,`e`],[`𝔣`,`f`],[`𝔤`,`g`],[`𝔥`,`h`],[`𝔦`,`i`],[`𝔧`,`j`],[`𝔨`,`k`],[`𝔩`,`l`],[`𝔪`,`m`],[`𝔫`,`n`],[`𝔬`,`o`],[`𝔭`,`p`],[`𝔮`,`q`],[`𝔯`,`r`],[`𝔰`,`s`],[`𝔱`,`t`],[`𝔲`,`u`],[`𝔳`,`v`],[`𝔴`,`w`],[`𝔵`,`x`],[`𝔶`,`y`],[`𝔷`,`z`],[`𝔸`,`A`],[`𝔹`,`B`],[`𝔻`,`D`],[`𝔼`,`E`],[`𝔽`,`F`],[`𝔾`,`G`],[`𝕀`,`I`],[`𝕁`,`J`],[`𝕂`,`K`],[`𝕃`,`L`],[`𝕄`,`M`],[`𝕆`,`O`],[`𝕊`,`S`],[`𝕋`,`T`],[`𝕌`,`U`],[`𝕍`,`V`],[`𝕎`,`W`],[`𝕏`,`X`],[`𝕐`,`Y`],[`𝕒`,`a`],[`𝕓`,`b`],[`𝕔`,`c`],[`𝕕`,`d`],[`𝕖`,`e`],[`𝕗`,`f`],[`𝕘`,`g`],[`𝕙`,`h`],[`𝕚`,`i`],[`𝕛`,`j`],[`𝕜`,`k`],[`𝕝`,`l`],[`𝕞`,`m`],[`𝕟`,`n`],[`𝕠`,`o`],[`𝕡`,`p`],[`𝕢`,`q`],[`𝕣`,`r`],[`𝕤`,`s`],[`𝕥`,`t`],[`𝕦`,`u`],[`𝕧`,`v`],[`𝕨`,`w`],[`𝕩`,`x`],[`𝕪`,`y`],[`𝕫`,`z`],[`𝕬`,`A`],[`𝕭`,`B`],[`𝕮`,`C`],[`𝕯`,`D`],[`𝕰`,`E`],[`𝕱`,`F`],[`𝕲`,`G`],[`𝕳`,`H`],[`𝕴`,`I`],[`𝕵`,`J`],[`𝕶`,`K`],[`𝕷`,`L`],[`𝕸`,`M`],[`𝕹`,`N`],[`𝕺`,`O`],[`𝕻`,`P`],[`𝕼`,`Q`],[`𝕽`,`R`],[`𝕾`,`S`],[`𝕿`,`T`],[`𝖀`,`U`],[`𝖁`,`V`],[`𝖂`,`W`],[`𝖃`,`X`],[`𝖄`,`Y`],[`𝖅`,`Z`],[`𝖆`,`a`],[`𝖇`,`b`],[`𝖈`,`c`],[`𝖉`,`d`],[`𝖊`,`e`],[`𝖋`,`f`],[`𝖌`,`g`],[`𝖍`,`h`],[`𝖎`,`i`],[`𝖏`,`j`],[`𝖐`,`k`],[`𝖑`,`l`],[`𝖒`,`m`],[`𝖓`,`n`],[`𝖔`,`o`],[`𝖕`,`p`],[`𝖖`,`q`],[`𝖗`,`r`],[`𝖘`,`s`],[`𝖙`,`t`],[`𝖚`,`u`],[`𝖛`,`v`],[`𝖜`,`w`],[`𝖝`,`x`],[`𝖞`,`y`],[`𝖟`,`z`],[`𝖠`,`A`],[`𝖡`,`B`],[`𝖢`,`C`],[`𝖣`,`D`],[`𝖤`,`E`],[`𝖥`,`F`],[`𝖦`,`G`],[`𝖧`,`H`],[`𝖨`,`I`],[`𝖩`,`J`],[`𝖪`,`K`],[`𝖫`,`L`],[`𝖬`,`M`],[`𝖭`,`N`],[`𝖮`,`O`],[`𝖯`,`P`],[`𝖰`,`Q`],[`𝖱`,`R`],[`𝖲`,`S`],[`𝖳`,`T`],[`𝖴`,`U`],[`𝖵`,`V`],[`𝖶`,`W`],[`𝖷`,`X`],[`𝖸`,`Y`],[`𝖹`,`Z`],[`𝖺`,`a`],[`𝖻`,`b`],[`𝖼`,`c`],[`𝖽`,`d`],[`𝖾`,`e`],[`𝖿`,`f`],[`𝗀`,`g`],[`𝗁`,`h`],[`𝗂`,`i`],[`𝗃`,`j`],[`𝗄`,`k`],[`𝗅`,`l`],[`𝗆`,`m`],[`𝗇`,`n`],[`𝗈`,`o`],[`𝗉`,`p`],[`𝗊`,`q`],[`𝗋`,`r`],[`𝗌`,`s`],[`𝗍`,`t`],[`𝗎`,`u`],[`𝗏`,`v`],[`𝗐`,`w`],[`𝗑`,`x`],[`𝗒`,`y`],[`𝗓`,`z`],[`𝗔`,`A`],[`𝗕`,`B`],[`𝗖`,`C`],[`𝗗`,`D`],[`𝗘`,`E`],[`𝗙`,`F`],[`𝗚`,`G`],[`𝗛`,`H`],[`𝗜`,`I`],[`𝗝`,`J`],[`𝗞`,`K`],[`𝗟`,`L`],[`𝗠`,`M`],[`𝗡`,`N`],[`𝗢`,`O`],[`𝗣`,`P`],[`𝗤`,`Q`],[`𝗥`,`R`],[`𝗦`,`S`],[`𝗧`,`T`],[`𝗨`,`U`],[`𝗩`,`V`],[`𝗪`,`W`],[`𝗫`,`X`],[`𝗬`,`Y`],[`𝗭`,`Z`],[`𝗮`,`a`],[`𝗯`,`b`],[`𝗰`,`c`],[`𝗱`,`d`],[`𝗲`,`e`],[`𝗳`,`f`],[`𝗴`,`g`],[`𝗵`,`h`],[`𝗶`,`i`],[`𝗷`,`j`],[`𝗸`,`k`],[`𝗹`,`l`],[`𝗺`,`m`],[`𝗻`,`n`],[`𝗼`,`o`],[`𝗽`,`p`],[`𝗾`,`q`],[`𝗿`,`r`],[`𝘀`,`s`],[`𝘁`,`t`],[`𝘂`,`u`],[`𝘃`,`v`],[`𝘄`,`w`],[`𝘅`,`x`],[`𝘆`,`y`],[`𝘇`,`z`],[`𝘈`,`A`],[`𝘉`,`B`],[`𝘊`,`C`],[`𝘋`,`D`],[`𝘌`,`E`],[`𝘍`,`F`],[`𝘎`,`G`],[`𝘏`,`H`],[`𝘐`,`I`],[`𝘑`,`J`],[`𝘒`,`K`],[`𝘓`,`L`],[`𝘔`,`M`],[`𝘕`,`N`],[`𝘖`,`O`],[`𝘗`,`P`],[`𝘘`,`Q`],[`𝘙`,`R`],[`𝘚`,`S`],[`𝘛`,`T`],[`𝘜`,`U`],[`𝘝`,`V`],[`𝘞`,`W`],[`𝘟`,`X`],[`𝘠`,`Y`],[`𝘡`,`Z`],[`𝘢`,`a`],[`𝘣`,`b`],[`𝘤`,`c`],[`𝘥`,`d`],[`𝘦`,`e`],[`𝘧`,`f`],[`𝘨`,`g`],[`𝘩`,`h`],[`𝘪`,`i`],[`𝘫`,`j`],[`𝘬`,`k`],[`𝘭`,`l`],[`𝘮`,`m`],[`𝘯`,`n`],[`𝘰`,`o`],[`𝘱`,`p`],[`𝘲`,`q`],[`𝘳`,`r`],[`𝘴`,`s`],[`𝘵`,`t`],[`𝘶`,`u`],[`𝘷`,`v`],[`𝘸`,`w`],[`𝘹`,`x`],[`𝘺`,`y`],[`𝘻`,`z`],[`𝘼`,`A`],[`𝘽`,`B`],[`𝘾`,`C`],[`𝘿`,`D`],[`𝙀`,`E`],[`𝙁`,`F`],[`𝙂`,`G`],[`𝙃`,`H`],[`𝙄`,`I`],[`𝙅`,`J`],[`𝙆`,`K`],[`𝙇`,`L`],[`𝙈`,`M`],[`𝙉`,`N`],[`𝙊`,`O`],[`𝙋`,`P`],[`𝙌`,`Q`],[`𝙍`,`R`],[`𝙎`,`S`],[`𝙏`,`T`],[`𝙐`,`U`],[`𝙑`,`V`],[`𝙒`,`W`],[`𝙓`,`X`],[`𝙔`,`Y`],[`𝙕`,`Z`],[`𝙖`,`a`],[`𝙗`,`b`],[`𝙘`,`c`],[`𝙙`,`d`],[`𝙚`,`e`],[`𝙛`,`f`],[`𝙜`,`g`],[`𝙝`,`h`],[`𝙞`,`i`],[`𝙟`,`j`],[`𝙠`,`k`],[`𝙡`,`l`],[`𝙢`,`m`],[`𝙣`,`n`],[`𝙤`,`o`],[`𝙥`,`p`],[`𝙦`,`q`],[`𝙧`,`r`],[`𝙨`,`s`],[`𝙩`,`t`],[`𝙪`,`u`],[`𝙫`,`v`],[`𝙬`,`w`],[`𝙭`,`x`],[`𝙮`,`y`],[`𝙯`,`z`],[`𝙰`,`A`],[`𝙱`,`B`],[`𝙲`,`C`],[`𝙳`,`D`],[`𝙴`,`E`],[`𝙵`,`F`],[`𝙶`,`G`],[`𝙷`,`H`],[`𝙸`,`I`],[`𝙹`,`J`],[`𝙺`,`K`],[`𝙻`,`L`],[`𝙼`,`M`],[`𝙽`,`N`],[`𝙾`,`O`],[`𝙿`,`P`],[`𝚀`,`Q`],[`𝚁`,`R`],[`𝚂`,`S`],[`𝚃`,`T`],[`𝚄`,`U`],[`𝚅`,`V`],[`𝚆`,`W`],[`𝚇`,`X`],[`𝚈`,`Y`],[`𝚉`,`Z`],[`𝚊`,`a`],[`𝚋`,`b`],[`𝚌`,`c`],[`𝚍`,`d`],[`𝚎`,`e`],[`𝚏`,`f`],[`𝚐`,`g`],[`𝚑`,`h`],[`𝚒`,`i`],[`𝚓`,`j`],[`𝚔`,`k`],[`𝚕`,`l`],[`𝚖`,`m`],[`𝚗`,`n`],[`𝚘`,`o`],[`𝚙`,`p`],[`𝚚`,`q`],[`𝚛`,`r`],[`𝚜`,`s`],[`𝚝`,`t`],[`𝚞`,`u`],[`𝚟`,`v`],[`𝚠`,`w`],[`𝚡`,`x`],[`𝚢`,`y`],[`𝚣`,`z`],[`𝚤`,`i`],[`𝚥`,`j`],[`𝚨`,`A`],[`𝚩`,`V`],[`𝚪`,`G`],[`𝚫`,`D`],[`𝚬`,`E`],[`𝚭`,`Z`],[`𝚮`,`I`],[`𝚯`,`TH`],[`𝚰`,`I`],[`𝚱`,`K`],[`𝚲`,`L`],[`𝚳`,`M`],[`𝚴`,`N`],[`𝚵`,`KS`],[`𝚶`,`O`],[`𝚷`,`P`],[`𝚸`,`R`],[`𝚹`,`TH`],[`𝚺`,`S`],[`𝚻`,`T`],[`𝚼`,`Y`],[`𝚽`,`F`],[`𝚾`,`X`],[`𝚿`,`PS`],[`𝛀`,`O`],[`𝛁`,`D`],[`𝛂`,`a`],[`𝛃`,`v`],[`𝛄`,`g`],[`𝛅`,`d`],[`𝛆`,`e`],[`𝛇`,`z`],[`𝛈`,`i`],[`𝛉`,`th`],[`𝛊`,`i`],[`𝛋`,`k`],[`𝛌`,`l`],[`𝛍`,`m`],[`𝛎`,`n`],[`𝛏`,`ks`],[`𝛐`,`o`],[`𝛑`,`p`],[`𝛒`,`r`],[`𝛓`,`s`],[`𝛔`,`s`],[`𝛕`,`t`],[`𝛖`,`y`],[`𝛗`,`f`],[`𝛘`,`x`],[`𝛙`,`ps`],[`𝛚`,`o`],[`𝛛`,`d`],[`𝛜`,`e`],[`𝛝`,`th`],[`𝛞`,`k`],[`𝛟`,`f`],[`𝛠`,`r`],[`𝛡`,`p`],[`𝛢`,`A`],[`𝛣`,`V`],[`𝛤`,`G`],[`𝛥`,`D`],[`𝛦`,`E`],[`𝛧`,`Z`],[`𝛨`,`I`],[`𝛩`,`TH`],[`𝛪`,`I`],[`𝛫`,`K`],[`𝛬`,`L`],[`𝛭`,`M`],[`𝛮`,`N`],[`𝛯`,`KS`],[`𝛰`,`O`],[`𝛱`,`P`],[`𝛲`,`R`],[`𝛳`,`TH`],[`𝛴`,`S`],[`𝛵`,`T`],[`𝛶`,`Y`],[`𝛷`,`F`],[`𝛸`,`X`],[`𝛹`,`PS`],[`𝛺`,`O`],[`𝛻`,`D`],[`𝛼`,`a`],[`𝛽`,`v`],[`𝛾`,`g`],[`𝛿`,`d`],[`𝜀`,`e`],[`𝜁`,`z`],[`𝜂`,`i`],[`𝜃`,`th`],[`𝜄`,`i`],[`𝜅`,`k`],[`𝜆`,`l`],[`𝜇`,`m`],[`𝜈`,`n`],[`𝜉`,`ks`],[`𝜊`,`o`],[`𝜋`,`p`],[`𝜌`,`r`],[`𝜍`,`s`],[`𝜎`,`s`],[`𝜏`,`t`],[`𝜐`,`y`],[`𝜑`,`f`],[`𝜒`,`x`],[`𝜓`,`ps`],[`𝜔`,`o`],[`𝜕`,`d`],[`𝜖`,`e`],[`𝜗`,`th`],[`𝜘`,`k`],[`𝜙`,`f`],[`𝜚`,`r`],[`𝜛`,`p`],[`𝜜`,`A`],[`𝜝`,`V`],[`𝜞`,`G`],[`𝜟`,`D`],[`𝜠`,`E`],[`𝜡`,`Z`],[`𝜢`,`I`],[`𝜣`,`TH`],[`𝜤`,`I`],[`𝜥`,`K`],[`𝜦`,`L`],[`𝜧`,`M`],[`𝜨`,`N`],[`𝜩`,`KS`],[`𝜪`,`O`],[`𝜫`,`P`],[`𝜬`,`R`],[`𝜭`,`TH`],[`𝜮`,`S`],[`𝜯`,`T`],[`𝜰`,`Y`],[`𝜱`,`F`],[`𝜲`,`X`],[`𝜳`,`PS`],[`𝜴`,`O`],[`𝜵`,`D`],[`𝜶`,`a`],[`𝜷`,`v`],[`𝜸`,`g`],[`𝜹`,`d`],[`𝜺`,`e`],[`𝜻`,`z`],[`𝜼`,`i`],[`𝜽`,`th`],[`𝜾`,`i`],[`𝜿`,`k`],[`𝝀`,`l`],[`𝝁`,`m`],[`𝝂`,`n`],[`𝝃`,`ks`],[`𝝄`,`o`],[`𝝅`,`p`],[`𝝆`,`r`],[`𝝇`,`s`],[`𝝈`,`s`],[`𝝉`,`t`],[`𝝊`,`y`],[`𝝋`,`f`],[`𝝌`,`x`],[`𝝍`,`ps`],[`𝝎`,`o`],[`𝝏`,`d`],[`𝝐`,`e`],[`𝝑`,`th`],[`𝝒`,`k`],[`𝝓`,`f`],[`𝝔`,`r`],[`𝝕`,`p`],[`𝝖`,`A`],[`𝝗`,`V`],[`𝝘`,`G`],[`𝝙`,`D`],[`𝝚`,`E`],[`𝝛`,`Z`],[`𝝜`,`I`],[`𝝝`,`TH`],[`𝝞`,`I`],[`𝝟`,`K`],[`𝝠`,`L`],[`𝝡`,`M`],[`𝝢`,`N`],[`𝝣`,`KS`],[`𝝤`,`O`],[`𝝥`,`P`],[`𝝦`,`R`],[`𝝧`,`TH`],[`𝝨`,`S`],[`𝝩`,`T`],[`𝝪`,`Y`],[`𝝫`,`F`],[`𝝬`,`X`],[`𝝭`,`PS`],[`𝝮`,`O`],[`𝝯`,`D`],[`𝝰`,`a`],[`𝝱`,`v`],[`𝝲`,`g`],[`𝝳`,`d`],[`𝝴`,`e`],[`𝝵`,`z`],[`𝝶`,`i`],[`𝝷`,`th`],[`𝝸`,`i`],[`𝝹`,`k`],[`𝝺`,`l`],[`𝝻`,`m`],[`𝝼`,`n`],[`𝝽`,`ks`],[`𝝾`,`o`],[`𝝿`,`p`],[`𝞀`,`r`],[`𝞁`,`s`],[`𝞂`,`s`],[`𝞃`,`t`],[`𝞄`,`y`],[`𝞅`,`f`],[`𝞆`,`x`],[`𝞇`,`ps`],[`𝞈`,`o`],[`𝞉`,`d`],[`𝞊`,`e`],[`𝞋`,`th`],[`𝞌`,`k`],[`𝞍`,`f`],[`𝞎`,`r`],[`𝞏`,`p`],[`𝞐`,`A`],[`𝞑`,`V`],[`𝞒`,`G`],[`𝞓`,`D`],[`𝞔`,`E`],[`𝞕`,`Z`],[`𝞖`,`I`],[`𝞗`,`TH`],[`𝞘`,`I`],[`𝞙`,`K`],[`𝞚`,`L`],[`𝞛`,`M`],[`𝞜`,`N`],[`𝞝`,`KS`],[`𝞞`,`O`],[`𝞟`,`P`],[`𝞠`,`R`],[`𝞡`,`TH`],[`𝞢`,`S`],[`𝞣`,`T`],[`𝞤`,`Y`],[`𝞥`,`F`],[`𝞦`,`X`],[`𝞧`,`PS`],[`𝞨`,`O`],[`𝞩`,`D`],[`𝞪`,`a`],[`𝞫`,`v`],[`𝞬`,`g`],[`𝞭`,`d`],[`𝞮`,`e`],[`𝞯`,`z`],[`𝞰`,`i`],[`𝞱`,`th`],[`𝞲`,`i`],[`𝞳`,`k`],[`𝞴`,`l`],[`𝞵`,`m`],[`𝞶`,`n`],[`𝞷`,`ks`],[`𝞸`,`o`],[`𝞹`,`p`],[`𝞺`,`r`],[`𝞻`,`s`],[`𝞼`,`s`],[`𝞽`,`t`],[`𝞾`,`y`],[`𝞿`,`f`],[`𝟀`,`x`],[`𝟁`,`ps`],[`𝟂`,`o`],[`𝟃`,`d`],[`𝟄`,`e`],[`𝟅`,`th`],[`𝟆`,`k`],[`𝟇`,`f`],[`𝟈`,`r`],[`𝟉`,`p`],[`𝟊`,`W`],[`𝟋`,`w`],[`⒜`,`(a)`],[`⒝`,`(b)`],[`⒞`,`(c)`],[`⒟`,`(d)`],[`⒠`,`(e)`],[`⒡`,`(f)`],[`⒢`,`(g)`],[`⒣`,`(h)`],[`⒤`,`(i)`],[`⒥`,`(j)`],[`⒦`,`(k)`],[`⒧`,`(l)`],[`⒨`,`(m)`],[`⒩`,`(n)`],[`⒪`,`(o)`],[`⒫`,`(p)`],[`⒬`,`(q)`],[`⒭`,`(r)`],[`⒮`,`(s)`],[`⒯`,`(t)`],[`⒰`,`(u)`],[`⒱`,`(v)`],[`⒲`,`(w)`],[`⒳`,`(x)`],[`⒴`,`(y)`],[`⒵`,`(z)`],[`Ⓐ`,`(A)`],[`Ⓑ`,`(B)`],[`Ⓒ`,`(C)`],[`Ⓓ`,`(D)`],[`Ⓔ`,`(E)`],[`Ⓕ`,`(F)`],[`Ⓖ`,`(G)`],[`Ⓗ`,`(H)`],[`Ⓘ`,`(I)`],[`Ⓙ`,`(J)`],[`Ⓚ`,`(K)`],[`Ⓛ`,`(L)`],[`Ⓜ`,`(M)`],[`Ⓝ`,`(N)`],[`Ⓞ`,`(O)`],[`Ⓟ`,`(P)`],[`Ⓠ`,`(Q)`],[`Ⓡ`,`(R)`],[`Ⓢ`,`(S)`],[`Ⓣ`,`(T)`],[`Ⓤ`,`(U)`],[`Ⓥ`,`(V)`],[`Ⓦ`,`(W)`],[`Ⓧ`,`(X)`],[`Ⓨ`,`(Y)`],[`Ⓩ`,`(Z)`],[`ⓐ`,`(a)`],[`ⓑ`,`(b)`],[`ⓒ`,`(c)`],[`ⓓ`,`(d)`],[`ⓔ`,`(e)`],[`ⓕ`,`(f)`],[`ⓖ`,`(g)`],[`ⓗ`,`(h)`],[`ⓘ`,`(i)`],[`ⓙ`,`(j)`],[`ⓚ`,`(k)`],[`ⓛ`,`(l)`],[`ⓜ`,`(m)`],[`ⓝ`,`(n)`],[`ⓞ`,`(o)`],[`ⓟ`,`(p)`],[`ⓠ`,`(q)`],[`ⓡ`,`(r)`],[`ⓢ`,`(s)`],[`ⓣ`,`(t)`],[`ⓤ`,`(u)`],[`ⓥ`,`(v)`],[`ⓦ`,`(w)`],[`ⓧ`,`(x)`],[`ⓨ`,`(y)`],[`ⓩ`,`(z)`],[`Ċ`,`C`],[`ċ`,`c`],[`Ġ`,`G`],[`ġ`,`g`],[`Ħ`,`H`],[`ħ`,`h`],[`½`,`1/2`],[`⅓`,`1/3`],[`⅔`,`2/3`],[`¼`,`1/4`],[`¾`,`3/4`],[`⅕`,`1/5`],[`⅖`,`2/5`],[`⅗`,`3/5`],[`⅘`,`4/5`],[`⅙`,`1/6`],[`⅚`,`5/6`],[`⅐`,`1/7`],[`⅛`,`1/8`],[`⅜`,`3/8`],[`⅝`,`5/8`],[`⅞`,`7/8`],[`⅑`,`1/9`],[`⅒`,`1/10`],[`⅟`,`1/`],[`↉`,`0/3`],[`ↄ`,`c`],[`¹`,`1`],[`²`,`2`],[`³`,`3`],[`⁰`,`0`],[`⁴`,`4`],[`⁵`,`5`],[`⁶`,`6`],[`⁷`,`7`],[`⁸`,`8`],[`⁹`,`9`],[`⁺`,`+`],[`⁻`,`-`],[`⁼`,`=`],[`⁽`,`(`],[`⁾`,`)`],[`₀`,`0`],[`₁`,`1`],[`₂`,`2`],[`₃`,`3`],[`₄`,`4`],[`₅`,`5`],[`₆`,`6`],[`₇`,`7`],[`₈`,`8`],[`₉`,`9`],[`₊`,`+`],[`₋`,`-`],[`₌`,`=`],[`₍`,`(`],[`₎`,`)`],...UCe,[`𞀰`,`a`],[`𞀱`,`b`],[`𞀲`,`v`],[`𞀳`,`g`],[`𞀴`,`d`],[`𞀵`,`e`],[`𞀶`,`zh`],[`𞀷`,`z`],[`𞀸`,`i`],[`𞀹`,`k`],[`𞀺`,`l`],[`𞀻`,`m`],[`𞀼`,`o`],[`𞀽`,`p`],[`𞀾`,`r`],[`𞀿`,`s`],[`𞁀`,`t`],[`𞁁`,`u`],[`𞁂`,`f`],[`𞁃`,`kh`],[`𞁄`,`ts`],[`𞁅`,`ch`],[`𞁆`,`sh`],[`𞁇`,`y`],[`𞁈`,`e`],[`𞁉`,`yu`],[`𞁊`,`dzh`],[`𞁋`,`a`],[`𞁌`,`i`],[`𞁍`,`j`],[`𞁎`,`o`],[`𞁏`,`u`],[`𞁐`,`'`],[`𞁫`,`th`],[`𞁬`,`y`],[`𞁭`,`u`],[`𝟎`,`0`],[`𝟏`,`1`],[`𝟐`,`2`],[`𝟑`,`3`],[`𝟒`,`4`],[`𝟓`,`5`],[`𝟔`,`6`],[`𝟕`,`7`],[`𝟖`,`8`],[`𝟗`,`9`],[`𝟘`,`0`],[`𝟙`,`1`],[`𝟚`,`2`],[`𝟛`,`3`],[`𝟜`,`4`],[`𝟝`,`5`],[`𝟞`,`6`],[`𝟟`,`7`],[`𝟠`,`8`],[`𝟡`,`9`],[`𝟢`,`0`],[`𝟣`,`1`],[`𝟤`,`2`],[`𝟥`,`3`],[`𝟦`,`4`],[`𝟧`,`5`],[`𝟨`,`6`],[`𝟩`,`7`],[`𝟪`,`8`],[`𝟫`,`9`],[`𝟬`,`0`],[`𝟭`,`1`],[`𝟮`,`2`],[`𝟯`,`3`],[`𝟰`,`4`],[`𝟱`,`5`],[`𝟲`,`6`],[`𝟳`,`7`],[`𝟴`,`8`],[`𝟵`,`9`],[`𝟶`,`0`],[`𝟷`,`1`],[`𝟸`,`2`],[`𝟹`,`3`],[`𝟺`,`4`],[`𝟻`,`5`],[`𝟼`,`6`],[`𝟽`,`7`],[`𝟾`,`8`],[`𝟿`,`9`],[`①`,`1`],[`②`,`2`],[`③`,`3`],[`④`,`4`],[`⑤`,`5`],[`⑥`,`6`],[`⑦`,`7`],[`⑧`,`8`],[`⑨`,`9`],[`⑩`,`10`],[`⑪`,`11`],[`⑫`,`12`],[`⑬`,`13`],[`⑭`,`14`],[`⑮`,`15`],[`⑯`,`16`],[`⑰`,`17`],[`⑱`,`18`],[`⑲`,`19`],[`⑳`,`20`],[`⑴`,`1`],[`⑵`,`2`],[`⑶`,`3`],[`⑷`,`4`],[`⑸`,`5`],[`⑹`,`6`],[`⑺`,`7`],[`⑻`,`8`],[`⑼`,`9`],[`⑽`,`10`],[`⑾`,`11`],[`⑿`,`12`],[`⒀`,`13`],[`⒁`,`14`],[`⒂`,`15`],[`⒃`,`16`],[`⒄`,`17`],[`⒅`,`18`],[`⒆`,`19`],[`⒇`,`20`],[`⒈`,`1.`],[`⒉`,`2.`],[`⒊`,`3.`],[`⒋`,`4.`],[`⒌`,`5.`],[`⒍`,`6.`],[`⒎`,`7.`],[`⒏`,`8.`],[`⒐`,`9.`],[`⒑`,`10.`],[`⒒`,`11.`],[`⒓`,`12.`],[`⒔`,`13.`],[`⒕`,`14.`],[`⒖`,`15.`],[`⒗`,`16.`],[`⒘`,`17.`],[`⒙`,`18.`],[`⒚`,`19.`],[`⒛`,`20.`],...GCe,...KCe,[`⓪`,`0`],[`⓫`,`11`],[`⓬`,`12`],[`⓭`,`13`],[`⓮`,`14`],[`⓯`,`15`],[`⓰`,`16`],[`⓱`,`17`],[`⓲`,`18`],[`⓳`,`19`],[`⓴`,`20`],[`⓵`,`1`],[`⓶`,`2`],[`⓷`,`3`],[`⓸`,`4`],[`⓹`,`5`],[`⓺`,`6`],[`⓻`,`7`],[`⓼`,`8`],[`⓽`,`9`],[`⓾`,`10`],[`⓿`,`0`],...zCe,...RCe,[`‘`,`'`],[`’`,`'`],[`‚`,`'`],[`‛`,`'`],[`‹`,`'`],[`›`,`'`],[`′`,`'`],[`‵`,`'`],[`“`,`"`],[`”`,`"`],[`„`,`"`],[`‟`,`"`],[`«`,`"`],[`»`,`"`],[`″`,`"`],[`‶`,`"`],[`‴`,`'''`],[`‷`,`'''`],[`🙰`,`&`],[`🙱`,`&`],[`🙲`,`&`],[`🙳`,`&`],[`🙴`,`&`],[`🙵`,`&`],[`🙶`,`"`],[`🙷`,`"`],[`🙸`,`"`],[`…`,`...`],[`⋯`,`...`],[`‥`,`..`],[`․`,`.`],[`‼`,`!!`],[`⁇`,`??`],[`⁈`,`?!`],[`⁉`,`!?`],[`⩴`,`::=`],[`⩵`,`==`],[`⩶`,`===`],[`⁄`,`/`],[`№`,`No`],[`™`,`(tm)`],[`©`,`(c)`],[`®`,`(r)`],[`¿`,`?`],[`¡`,`!`],[`‽`,`?!`],[`⸘`,`?!`],[`⸜`,`(`],[`⸝`,`)`],[`⸢`,`[`],[`⸣`,`]`],[`⸤`,`[`],[`⸥`,`]`],[`⸦`,`(`],[`⸧`,`)`],[`⸨`,`((`],[`⸩`,`))`],[`⸪`,`:`],[`⸫`,`:`],[`⸮`,`?`],[`⸱`,`.`],[`⸲`,`,`],[`⸴`,`,`],[`⸵`,`;`],[`⸼`,`.`],[`⹁`,`,`],[`⹂`,`"`],[`⹕`,`[`],[`⹖`,`]`],[`⹗`,`[`],[`⹘`,`]`],[`⹙`,`(`],[`⹚`,`)`],[`⹛`,`(`],[`⹜`,`)`],[`⹠`,`!`],[`⹡`,`!`],[`⹢`,`(`],[`⹣`,`)`],[`🙹`,`?!`],[`🙺`,`?!`],[`🙻`,`?!`],[`🙼`,`/`],[`🙽`,`\\`],[`🜇`,`AR`],[`🜈`,`V`],[`🜉`,`V`],[`🜆`,`VR`],[`🜅`,`VF`],[`🜩`,`2`],[`🜪`,`5`],[`🝡`,`f`],[`🝢`,`W`],[`🝣`,`U`],[`🝧`,`V`],[`🝨`,`T`],[`🝪`,`V`],[`🝫`,`MB`],[`🝬`,`VB`],[`🝲`,`3B`],[`🝳`,`3B`],[`💯`,`100`],[`🔙`,`BACK`],[`🔚`,`END`],[`🔛`,`ON!`],[`🔜`,`SOON`],[`🔝`,`TOP`],[`🔞`,`18`],[`🔤`,`abc`],[`🔠`,`ABCD`],[`🔡`,`abcd`],[`🔢`,`1234`],[`🔣`,`T&@%`],...[`#`,`*`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].flatMap(e=>[[`${e}\u{FE0F}\u{20E3}`,e],[`${e}\u{20E3}`,e]]),...[[`🅰`,`A`],[`🅱`,`B`],[`🅾`,`O`]].flatMap(([e,t])=>[[`${e}\u{FE0F}`,t],[e,t]]),[`🔟`,`10`],[`🆎`,`AB`],[`🆑`,`CL`],[`🅿`,`P`],[`🆘`,`SOS`],[`🅲`,`C`],[`🅳`,`D`],[`🅴`,`E`],[`🅵`,`F`],[`🅶`,`G`],[`🅷`,`H`],[`🅸`,`I`],[`🅹`,`J`],[`🅺`,`K`],[`🅻`,`L`],[`🅼`,`M`],[`🅽`,`N`],[`🆀`,`Q`],[`🆁`,`R`],[`🆂`,`S`],[`🆃`,`T`],[`🆄`,`U`],[`🆅`,`V`],[`🆆`,`W`],[`🆇`,`X`],[`🆈`,`Y`],[`🆉`,`Z`],[`−`,`-`],[`⁓`,`-`],[`⁃`,`-`]],GM=new Map(qCe),KM=[[`æ`,`ae`],[`Æ`,`Ae`],[`ø`,`oe`],[`Ø`,`Oe`],[`å`,`aa`],[`Å`,`Aa`]],qM={sv:[[`ä`,`a`],[`Ä`,`A`],[`ö`,`o`],[`Ö`,`O`],[`å`,`a`],[`Å`,`A`]],da:KM,nb:KM,de:[[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`ß`,`ss`],[`ẞ`,`Ss`]],tr:[[`â`,`a`],[`Â`,`A`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`]],hu:[[`ű`,`u`],[`Ű`,`U`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`],[`á`,`a`],[`Á`,`A`],[`é`,`e`],[`É`,`E`],[`í`,`i`],[`Í`,`I`],[`ó`,`o`],[`Ó`,`O`],[`ú`,`u`],[`Ú`,`U`]],bg:[[`х`,`h`],[`Х`,`H`],[`щ`,`sht`],[`Щ`,`Sht`],[`ъ`,`a`],[`Ъ`,`A`],[`ь`,`y`],[`Ь`,`Y`],[`ъе`,`ae`],[`Ъе`,`Ae`],[`ъЕ`,`aE`],[`ЪЕ`,`AE`]],sr:[[`х`,`h`],[`Х`,`H`],[`ђ`,`dj`],[`Ђ`,`Dj`],[`đ`,`dj`],[`Đ`,`Dj`],[`џ`,`dz`],[`Џ`,`Dz`],[`љ`,`lj`],[`Љ`,`Lj`],[`њ`,`nj`],[`Њ`,`Nj`],[`ћ`,`c`],[`Ћ`,`C`],[`ч`,`ch`],[`Ч`,`Ch`],[`ш`,`sh`],[`Ш`,`Sh`],[`ж`,`zh`],[`Ж`,`Zh`]]};for(let e of Object.keys(qM))qM[e]=new Map(qM[e]);var JM=e=>new RegExp(String.raw`(?new RegExp(String.raw`${e}(?!\p{Mark}*\p{Letter})`,`gv`),JCe={bg:[[JM(`България`),`Bulgaria`],[JM(`БЪЛГАРИЯ`),`BULGARIA`],[JM(`българия`),`bulgaria`],[YM(`ия`),`ia`],[YM(`Ия`),`Ia`],[YM(`ИЯ`),`IA`]]},YCe=e=>e.replaceAll(RegExp(`[$\\(\\)*+.?\\[\\\\\\]^\\{\\|\\}]`,`gv`),String.raw`\$&`),XCe=(e=>{let t=e.keys().toArray().toSorted((e,t)=>t.length-e.length);return new RegExp(t.map(e=>YCe(e)).join(`|`),`gv`)})(GM),ZCe={replacements:GM,contextReplacements:[]},XM=new Map,QCe=e=>{if(e===void 0)return ZCe;let t=XM.get(e);return t===void 0&&(t={replacements:new Map([...GM,...qM[e]]),contextReplacements:JCe[e]??[]},XM.set(e,t)),t},$Ce=e=>{if(!e)return;let t=e.toLowerCase().replace(RegExp(`^(?:no|nn)(?-|$)`,`v`),`nb$`);if(Object.hasOwn(qM,t))return t;let n=t.split(`-`,1)[0];if(Object.hasOwn(qM,n))return n},ZM=(e,t)=>{if(RegExp(`\\p{Mark}{101}`,`v`).test(e))throw RangeError(`Cannot normalize more than 100 consecutive combining marks`);return e.normalize(t)};function ewe(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string, got \`${typeof e}\``);let{replacements:n,contextReplacements:r}=QCe($Ce(t?.locale)),i=e=>e.replace(XCe,e=>n.get(e)),a=Array.from(t?.customReplacements??[],([e,t])=>[ZM(e),t]);if(a.length===0&&!RegExp(`\\P{ASCII}`,`v`).test(e))return e;if(e=ZM(e),a.length>0){a.sort((e,t)=>t[0].length-e[0].length);for(let[t,n]of a)e=e.replaceAll(t,n);e=ZM(e)}for(let[t,n]of r)e=e.replaceAll(t,()=>n);if(e=e.replaceAll(RegExp(`[\\u{FB50}-\\u{FDFF}\\u{FE70}-\\u{FEFF}]`,`gv`),e=>e.normalize(`NFKC`)),e=i(e),!RegExp(`\\P{ASCII}`,`v`).test(e))return e;let o=ZM(ZM(e,`NFD`).replaceAll(RegExp(`[[\\p{Diacritic}--\\p{ASCII}]--\\u{338}]`,`gv`),``));return o!==e&&(e=i(o)),e=e.replaceAll(RegExp(`[\\p{Dash_Punctuation}--\\-]`,`gv`),`-`),e}var QM=RegExp(`[\\p{Z}[\\p{C}--[\\u200C\\u200D]]!"#$%\\x26'\\(\\)*+,\\/:;<=>?@\\[\\\\\\]^\`\\{\\|\\}]`,`v`),$M=/[^\w-~]/,twe=/^\.+/,nwe=/\.+$/,rwe={unicode:new RegExp(QM,`gv`),ascii:new RegExp($M,`g`)},iwe=new Map,eN=e=>{let t=JE(e);return mA(iwe,t,()=>({consecutivePattern:RegExp(`(?:${t})+`,`g`),trimPattern:RegExp(`^(?:${t})+|(?:${t})+$`,`g`),leadingDotsPattern:RegExp(`^(?:\\.|${t})+`),trailingDotsPattern:RegExp(`(?:\\.|${t})+$`)}))},tN=({sanitize_replacement:e=`-`,trim:t=!0}={})=>e&&t?eN(e).trailingDotsPattern:nwe,nN=e=>e.replace(tN($O.current?.slug),``),rN=()=>$O.current?.slug?.timezone===`local`?void 0:`UTC`,iN=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=$O.current??{},u=r??s,d=e;a&&(d=ewe(d.normalize(`NFD`),{locale:n?.replaceAll(`_`,`-`)})),d=d.replaceAll(rwe[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f=twe;if(o){let e=eN(o);d=d.replace(e.consecutivePattern,o),c&&(d=d.replace(e.trimPattern,``),{leadingDotsPattern:f}=e)}let p=tN({sanitize_replacement:o,trim:c});return d=d.replace(f,``),d=d.replace(p,``),!d&&t&&(d=Qc(`short`)),typeof u==`number`&&d.length>u&&(d=YE(d,u,{ellipsis:``}),d=d.replace(p,``)),l&&(d=d.toLowerCase()),d},aN=e=>iN(e.trim(),{fallback:!1}),oN=({takenNames:e,name:t})=>{let n=t.trim();if(!n)return`empty`;let r=aN(n);return!r||n.includes(`/`)||n.startsWith(`.`)?`invalid`:e.includes(r)?`duplicate`:void 0},awe=new Set([`local`,`utc`]),sN=new WeakMap,cN=e=>typeof e==`string`&&!awe.has(e),lN=e=>{let t=sN.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:cN(v)?v:void 0};return sN.set(e,y),y},owe=[{key:`af`,name:`Afrikaans`},{key:`am`,name:`Amharic`},{key:`ar-iq`,name:` Arabic (Iraq)`},{key:`ar-dz`,name:`Arabic (Algeria)`},{key:`ar-kw`,name:`Arabic (Kuwait)`},{key:`ar-ly`,name:`Arabic (Lybia)`},{key:`ar-ma`,name:`Arabic (Morocco)`},{key:`ar-sa`,name:`Arabic (Saudi Arabia)`},{key:`ar-tn`,name:` Arabic (Tunisia)`},{key:`ar`,name:`Arabic`},{key:`az`,name:`Azerbaijani`},{key:`be`,name:`Belarusian`},{key:`bg`,name:`Bulgarian`},{key:`bi`,name:`Bislama`},{key:`bm`,name:`Bambara`},{key:`bn-bd`,name:`Bengali (Bangladesh)`},{key:`bn`,name:`Bengali`},{key:`bo`,name:`Tibetan`},{key:`br`,name:`Breton`},{key:`bs`,name:`Bosnian`},{key:`ca`,name:`Catalan`},{key:`cs`,name:`Czech`},{key:`cv`,name:`Chuvash`},{key:`cy`,name:`Welsh`},{key:`da`,name:`Danish`},{key:`de-at`,name:`German (Austria)`},{key:`de-ch`,name:`German (Switzerland)`},{key:`de`,name:`German`},{key:`dv`,name:`Maldivian`},{key:`en-au`,name:`English (Australia)`},{key:`el`,name:`Greek`},{key:`en-gb`,name:`English (United Kingdom)`},{key:`en-ie`,name:`English (Ireland)`},{key:`en-il`,name:`English (Israel)`},{key:`en-in`,name:`English (India)`},{key:`en-nz`,name:`English (New Zealand)`},{key:`en-sg`,name:`English (Singapore)`},{key:`en-tt`,name:`English (Trinidad & Tobago)`},{key:`en-ca`,name:`English (Canada)`},{key:`en`,name:`English`},{key:`eo`,name:`Esperanto`},{key:`es-mx`,name:`Spanish (Mexico)`},{key:`es-pr`,name:`Spanish (Puerto Rico)`},{key:`es-us`,name:`Spanish (United States)`},{key:`es-do`,name:`Spanish (Dominican Republic)`},{key:`et`,name:`Estonian`},{key:`eu`,name:`Basque`},{key:`fa`,name:`Persian`},{key:`fi`,name:`Finnish`},{key:`fr-ca`,name:`French (Canada)`},{key:`fr-ch`,name:`French (Switzerland)`},{key:`fr`,name:`French`},{key:`fo`,name:`Faroese`},{key:`fy`,name:`Frisian`},{key:`ga`,name:`Irish or Irish Gaelic`},{key:`gd`,name:`Scottish Gaelic`},{key:`gl`,name:`Galician`},{key:`gom-latn`,name:`Konkani Latin script`},{key:`gu`,name:`Gujarati`},{key:`he`,name:`Hebrew`},{key:`hi`,name:`Hindi`},{key:`hr`,name:`Croatian`},{key:`ht`,name:`Haitian Creole (Haiti)`},{key:`hu`,name:`Hungarian`},{key:`hy-am`,name:`Armenian`},{key:`id`,name:`Indonesian`},{key:`is`,name:`Icelandic`},{key:`it-ch`,name:`Italian (Switzerland)`},{key:`it`,name:`Italian`},{key:`jv`,name:`Javanese`},{key:`ka`,name:`Georgian`},{key:`kk`,name:`Kazakh`},{key:`km`,name:`Cambodian`},{key:`ko`,name:`Korean`},{key:`ku`,name:`Kurdish`},{key:`ky`,name:`Kyrgyz`},{key:`kn`,name:`Kannada`},{key:`lb`,name:`Luxembourgish`},{key:`ja`,name:`Japanese`},{key:`lt`,name:`Lithuanian`},{key:`lv`,name:`Latvian`},{key:`me`,name:`Montenegrin`},{key:`mi`,name:`Maori`},{key:`mk`,name:`Macedonian`},{key:`ml`,name:`Malayalam`},{key:`mn`,name:`Mongolian`},{key:`mr`,name:`Marathi`},{key:`ms-my`,name:`Malay`},{key:`ms`,name:`Malay`},{key:`mt`,name:`Maltese (Malta)`},{key:`lo`,name:`Lao`},{key:`my`,name:`Burmese`},{key:`nb`,name:`Norwegian Bokmål`},{key:`ne`,name:`Nepalese`},{key:`nl`,name:`Dutch`},{key:`nl-be`,name:`Dutch (Belgium)`},{key:`nn`,name:`Nynorsk`},{key:`pa-in`,name:`Punjabi (India)`},{key:`pl`,name:`Polish`},{key:`pt-br`,name:`Portuguese (Brazil)`},{key:`pt`,name:`Portuguese`},{key:`rn`,name:`Kirundi`},{key:`ro`,name:`Romanian`},{key:`es`,name:`Spanish`},{key:`ru`,name:`Russian`},{key:`rw`,name:`Kinyarwanda (Rwanda)`},{key:`sd`,name:`Sindhi`},{key:`se`,name:`Northern Sami`},{key:`si`,name:`Sinhalese`},{key:`sk`,name:`Slovak`},{key:`sl`,name:`Slovenian`},{key:`oc-lnc`,name:`Occitan, lengadocian dialecte`},{key:`sq`,name:`Albanian`},{key:`sr-cyrl`,name:`Serbian Cyrillic`},{key:`sr`,name:`Serbian`},{key:`ss`,name:`siSwati`},{key:`sv-fi`,name:`Finland Swedish`},{key:`sv`,name:`Swedish`},{key:`sw`,name:`Swahili`},{key:`ta`,name:`Tamil`},{key:`te`,name:`Telugu`},{key:`tet`,name:`Tetun Dili (East Timor)`},{key:`tg`,name:`Tajik`},{key:`th`,name:`Thai`},{key:`tl-ph`,name:`Tagalog (Philippines)`},{key:`tlh`,name:`Klingon`},{key:`tr`,name:`Turkish`},{key:`tzl`,name:`Talossan`},{key:`tzm`,name:`Central Atlas Tamazight`},{key:`ug-cn`,name:`Uyghur (China)`},{key:`uk`,name:`Ukrainian`},{key:`tk`,name:`Turkmen`},{key:`ur`,name:`Urdu`},{key:`uz-latn`,name:`Uzbek Latin`},{key:`uz`,name:`Uzbek`},{key:`vi`,name:`Vietnamese`},{key:`x-pseudo`,name:`Pseudo`},{key:`tzm-latn`,name:`Central Atlas Tamazight Latin`},{key:`yo`,name:`Yoruba Nigeria`},{key:`zh-cn`,name:`Chinese (China)`},{key:`zh-hk`,name:`Chinese (Hong Kong)`},{key:`zh-tw`,name:`Chinese (Taiwan)`},{key:`zh`,name:`Chinese`}],swe=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},cwe=(typeof document>`u`?void 0:document.currentScript?.src)||{}.url,uN=e=>{let t=`https://unpkg.com/${e}`,n=cee[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},dN=async(e,t)=>swe(()=>import(`${uN(e)}/${t}`),void 0),lwe=async()=>`${uN(`leaflet`)}/dist/images/marker-icon-2x.png`,uwe=[`unpkg.com`,`cdn.jsdelivr.net`],dwe=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return e;let[,r,i,a]=n;return i===xr||i===void 0&&!uwe.includes(t.host)?e:(t.pathname=`${r}@${xr}${a}`,t.href)},fwe=(e,t=cwe)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@${xr}/dist/${n}`;if(!t)return[r];let i=new URL(n,dwe(t)).href;return i===r?[r]:[i,r]},fN={},pN=async e=>{if(e in fN)return fN[e]();let t;for(let n of fwe(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},pwe=async e=>(await dN(`dayjs`,`esm/locale/${e}.js`)).default,mwe=new Set(owe.map(({key:e})=>e)),mN=new Set([`en`]),hN=new Map,hwe=new Map,gwe=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>mwe.has(e))},gN=e=>mA(hwe,e,()=>gwe(e)),_we=e=>{if(mN.has(e))return Promise.resolve();let t=hN.get(e);return t||(t=(async()=>{try{zM.default.locale(await pwe(e),void 0,!0),mN.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{hN.delete(e)}})(),hN.set(e,t)),t},vwe=async e=>{let t=new Set([...e].map(gN).filter(e=>e!==void 0));await Promise.all([...t].map(_we))},_N=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=gN(r);return i&&i!==`en`&&mN.has(i)?i:void 0},ywe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(n,(function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`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(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),bwe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),vN=u(ywe(),1),yN=u(bwe(),1);zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var bN=e=>e instanceof Date&&!Number.isNaN(e.getTime()),xN=e=>e?zM.default.utc:zM.default,SN=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,xwe=/[XxZ]/,Swe=/[AaHhkmSsXx]|LT|LLL|lll/,CN=e=>e.replaceAll(/\[.*?]/g,``),wN=e=>xwe.test(CN(e)),TN=(e,t)=>SN.test(e)&&Swe.test(CN(t))&&!wN(t),EN=(e,t,n,r)=>e(t,n,r,TN(t,n)),DN=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=xN(n),a=EN(i,e,t,r);return a.isValid()?a:i(e)},ON=(e,t,n)=>(n?e.locale(n):e).format(t),kN=(e,t)=>t===`UTC`?e.toDate():zM.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),AN=(e,t)=>{if(!t||SN.test(e))return new Date(e);let n=zM.default.utc(e);return n.isValid()?kN(n,t):void 0},jN=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=lN(e);return r||t&&i?`UTC`:n?void 0:a},MN=(e,t,n)=>{let{format:r,timeOnly:i}=lN(t);if(!e)return;let a=jN(t),o;if(r){let i=_N(t,n);if(a===`UTC`||!a){let t=DN({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=EN(xN(!0),e,r,i);o=t.isValid()?wN(r)?t.toDate():kN(t,a):AN(e,a)}}else o=AN(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(bN(o))return o;console.error(`Invalid Date`,e)};zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default);var Cwe=/^\d{4}-[01]\d-[0-3]\d$/,wwe=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,NN=Object.freeze([`date`,`default`,`localize`,`lower`,`slugify`,`ternary`,`truncate`,`upper`]),PN=/^[A-Za-z_]\w*$/,Twe=RegExp(`^(?${PN.source.slice(1,-1)})(?:\\((?.*)\\))?$`,`s`),Ewe=/\s*(?:'(?.*?)'|(?-?\d+(?:\.\d+)?))\s*(?,|$)/sy,Dwe=Object.entries({date:/^date\('(?.+?)'(?:,\s*'(?.+?)')?\)$/,default:/^default\('(?.+?)'\)$/,ternary:/^ternary\('(?.*?)',\s*'(?.*?)'\)$/,truncate:/^truncate\((?\d+)(?:,\s*'(?.+?)')?\)$/}),Owe=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(Ewe),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},kwe=e=>{for(let[t,n]of Dwe){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(Twe)?.groups??{};if(t&&!NN.includes(t)){if(n===void 0)return{method:t,args:{}};let e=Owe(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},FN=e=>{let t=[],n=``,r=!1;for(let i=0;ivA(Awe,e,()=>{let[t,...n]=FN(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=kwe(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),jwe=e=>String(e??``).toUpperCase(),Mwe=e=>String(e??``).toLowerCase(),Nwe=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=lN(r),l=o?_N(r,i):void 0,u=n===`utc`||c||s&&!!a.match(Cwe)||s&&!!a.match(wwe),d=o&&!(e instanceof Date)?DN({value:a,format:o,parseAsUTC:u,localeKey:l}):xN(u)(a);return d.isValid()?ON(d,t,l):``},Pwe=(e,{defaultValue:t})=>e?String(e):t,Fwe=(e,{truthyValue:t,falsyValue:n})=>e?t:n,Iwe=(e,{max:t,ellipsis:n=`…`})=>YE(String(e??``),Number(t),{ellipsis:n}),Lwe=new WeakMap,Rwe=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=mA(Lwe,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},zwe=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return jwe(t);case`lower`:return Mwe(t);case`slugify`:return iN(String(t??``),{fallback:!1,locale:r});case`date`:return Nwe(t,a,e??{},r);case`default`:return Pwe(t,a);case`ternary`:return Fwe(t,a);case`truncate`:return Iwe(t,a);default:{let e=zO.get(i);return e?Rwe({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},LN=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=zwe({fieldConfig:e,value:t,transformation:n,locale:r})}),t),Bwe=/^\d{4}-[01]\d-[0-3]\d$/,Vwe=/T00:00(?::00)?(?:\.000)?Z$/,RN={year:`numeric`,month:`short`,day:`numeric`},zN={hour:`numeric`,minute:`numeric`,hour12:!0},Hwe={...RN,...zN},Uwe=new Map,BN=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:mA(Uwe,t??``,()=>new Intl.DateTimeFormat(t??void 0,Hwe)).format(e);zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var Wwe=new Map,VN=({locale:e,parts:t,timeZone:n})=>mA(Wwe,[e,t,n].join(`|`),()=>t===`time`?new Intl.DateTimeFormat(e,{...zN,timeZone:n}):t===`date`?new Intl.DateTimeFormat(e,{...RN,timeZone:n}):new Intl.DateTimeFormat(e,{...RN,...zN,timeZone:n,timeZoneName:void 0})),HN=({locale:e,fieldConfig:t,currentValue:n})=>{let{format:r,dateOnly:i,timeOnly:a,utc:o,singleCustomTimeZone:s}=lN(t),c=o?`UTC`:s;if(typeof n!=`string`||!n.trim())return``;if(r){let i=_N(t,e);if(TN(n,r)){let a=MN(n,t,e),o=jN(t);return a?ON(o?(0,zM.default)(a).tz(o):(0,zM.default)(a),r,i):``}let a=DN({value:n,format:r,parseAsUTC:o,localeKey:i});return a.isValid()?a.format(r):(console.error(`Invalid Date`,n),``)}let l=MN(n,t,e),u=DA(e);return bN(l)?a?VN({locale:u,parts:`time`,timeZone:c}).format(l):i?VN({locale:u,parts:`date`,timeZone:o||Bwe.test(n)||Vwe.test(n)?`UTC`:c}).format(l):VN({locale:u,parts:`datetime`,timeZone:c}).format(l):``},Gwe=new Map,UN=e=>mA(Gwe,e,()=>Intl.NumberFormat(e,{maximumFractionDigits:20})),WN=({widget:e,value_type:t})=>t??(e===`compute`?`string`:`int`),GN=e=>[`float`,`float/string`].includes(WN(e)),KN=e=>![`int`,`float`].includes(WN(e)),qN=e=>e.widget===`number`||e.widget===`compute`&&WN(e)!==`string`,JN=e=>(e.widget===`number`||e.widget===`compute`)&&!KN(e),YN=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN,XN=(e,t)=>{if(GN(t))return Number.isFinite(e)?e+0:NaN;let n=Math.trunc(e);return Number.isSafeInteger(n)?n+0:NaN},ZN=(e,t)=>e==null||typeof e==`string`&&!e.trim()?!1:Number.isNaN(XN(Number(e),t)),QN=({inputValue:e,fieldConfig:t})=>{if(typeof e==`string`)return e;if(e===void 0||Number.isNaN(e))return KN(t)?``:null;let n=XN(e,t);return Number.isNaN(n)?String(e):KN(t)?String(n):n},Kwe=({currentValue:e,fieldConfig:t,inputValue:n=void 0})=>{if(ZN(e,t)&&e===QN({inputValue:n,fieldConfig:t}))return n;if(typeof e==`number`)return e;if(typeof e!=`string`||!e.trim())return;let r=XN(Number(e),t);return Number.isNaN(r)?void 0:r},qwe=xA(()=>ej.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{mA(t,n,()=>[]).push(e)}):n.push([e,YA(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),$N=e=>{let{fileMap:t,regexFolders:n}=qwe();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},Jwe=xA(()=>ej.current,()=>new WeakMap),Ywe=e=>mA(Jwe(),e,()=>$N(Object.values(e.locales)[0].path)),eP=e=>Ywe(e).map(({collectionName:e})=>YA(e)).filter(e=>!!e),Xwe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;li)return t.slice(0,l-c.length+1)}return t}})),Zwe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),Qwe=s(((e,t)=>{var n=Xwe(),r=Zwe();t.exports=n.bind(null,r)})),$we=u(s(((e,t)=>{var n=Qwe(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},nP=e=>tP(e,decodeURI),rP=e=>tP(e,decodeURIComponent),iP=e=>{try{return new URL(e).href}catch{return encodeURI(nP(e).toWellFormed())}},aP=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),oP=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),sP=e=>e.replace(/\/+$/,``),cP=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),lP=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=oP(e,aP),t?`@${e}`:e},uP=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?bk(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${JE(i)}-(?\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},dP=e=>(0,$we.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),eTe=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],fP=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||eTe.some(e=>e.includes(n)&&e.includes(r))},pP=e=>e.filter(Boolean).join(`/`),mP=e=>bk(e).dirname??``,hP=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,tTe=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),gP=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},_P=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,vP=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,yP=async e=>{let t=await e.arrayBuffer();return el(new Blob([`blob ${t.byteLength}\0`,t]))},nTe=new WeakMap,bP=e=>typeof e==`string`?yP(_P(e)):bA(nTe,e,()=>yP(e)),xP=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??(n?e.locales[n]:void 0)??Object.values(e.locales)[0],SP=(e,t)=>e[t]?t:Object.keys(e)[0],CP=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],wP=(e,t)=>mP(xP(e,{locale:t}).path),TP=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return mP(r);let i=XE(t??``);return mP(SA(i)?ISe(e,i):hP(e,i))},rTe=/^(?:0|[1-9]\d*)$/,iTe=/^(.+)\.\d+\.([^.]+)$/,EP=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},aTe=e=>rTe.test(e)&&Number(e)<2**32-1,oTe=(e,t)=>!D(e)||!Object.values(e).every(e=>e===null||D(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),sTe=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=D(e)?e:{};return[String(n),r]})):e,cTe=new WeakMap,lTe=e=>jM(e,e=>!!EP(e),cTe),DP=(e,t,n)=>{let{widget:r=`string`}=t,{fields:i,types:a,typeKey:o}=t,s=e=>kM({value:e,fields:i,types:a,typeKey:o});if(!lTe(t))return e;if(r===`object`)return OP(e,s(e),n);if(r!==`list`)return e;let c=EP(t),{field:l}=t,u=c&&n?oTe(e,c):e;if(Array.isArray(u)){let e=u.map(e=>l?DP(e,l,n):OP(e,s(e),n));e.some((e,t)=>e!==u[t])&&(u=e)}return c&&!n?sTe(u,c):u},OP=(e,t,n)=>{if(!D(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=DP(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},kP=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(iTe)??[];if(!t)return;let r=_M({...e,keyPath:t});if(r&&EP(r)===n)return{listKeyPath:t,keyField:n}},AP=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&cM(e.slice(r.length,-i.length)))},uTe=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>AP({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),jP=Symbol.for(`yaml.alias`),MP=Symbol.for(`yaml.document`),NP=Symbol.for(`yaml.map`),PP=Symbol.for(`yaml.pair`),FP=Symbol.for(`yaml.scalar`),IP=Symbol.for(`yaml.seq`),LP=Symbol.for(`yaml.node.type`),RP=e=>!!e&&typeof e==`object`&&e[LP]===jP,zP=e=>!!e&&typeof e==`object`&&e[LP]===MP,BP=e=>!!e&&typeof e==`object`&&e[LP]===NP,VP=e=>!!e&&typeof e==`object`&&e[LP]===PP,HP=e=>!!e&&typeof e==`object`&&e[LP]===FP,UP=e=>!!e&&typeof e==`object`&&e[LP]===IP;function WP(e){if(e&&typeof e==`object`)switch(e[LP]){case NP:case IP:return!0}return!1}function GP(e){if(e&&typeof e==`object`)switch(e[LP]){case jP:case NP:case FP:case IP:return!0}return!1}var KP=e=>(HP(e)||WP(e))&&!!e.anchor,qP=Symbol(`break visit`),dTe=Symbol(`skip children`),JP=Symbol(`remove node`);function YP(e,t){let n=fTe(t);zP(e)?XP(null,e.contents,n,Object.freeze([e]))===JP&&(e.contents=null):XP(null,e,n,Object.freeze([]))}YP.BREAK=qP,YP.SKIP=dTe,YP.REMOVE=JP;function XP(e,t,n,r){let i=pTe(e,t,n,r);if(GP(i)||VP(i))return mTe(e,r,i),XP(e,i,n,r);if(typeof i!=`symbol`){if(WP(t)){r=Object.freeze(r.concat(t));for(let e=0;ee.replace(/[!,[\]{}]/g,e=>hTe[e]),ZP=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+gTe(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&GP(e.contents)){let t={};YP(e.contents,(e,n)=>{GP(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(` +`)}};ZP.defaultYaml={explicit:!1,version:`1.2`},ZP.defaultTags={"!!":`tag:yaml.org,2002:`};function QP(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function $P(e){let t=new Set;return YP(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function eF(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function _Te(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=$P(e);let a=eF(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(HP(t.node)||WP(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function tF(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;tnF(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!KP(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var rF=class{constructor(e){Object.defineProperty(this,LP,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!zP(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=nF(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?tF(i,{"":o},``,o):o}},iF=class extends rF{constructor(e){super(jP),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],YP(e,{Node:(e,t)=>{(RP(t)||KP(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(nF(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=aF(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(QP(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function aF(e,t,n){if(RP(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(WP(t)){let r=0;for(let i of t.items){let t=aF(e,i,n);t>r&&(r=t)}return r}if(VP(t)){let r=aF(e,t.key,n),i=aF(e,t.value,n);return Math.max(r,i)}return 1}var oF=e=>!e||typeof e!=`function`&&typeof e!=`object`,sF=class extends rF{constructor(e){super(FP),this.value=e}toJSON(e,t){return t?.keep?this.value:nF(this.value,e,t)}toString(){return String(this.value)}};sF.BLOCK_FOLDED=`BLOCK_FOLDED`,sF.BLOCK_LITERAL=`BLOCK_LITERAL`,sF.PLAIN=`PLAIN`,sF.QUOTE_DOUBLE=`QUOTE_DOUBLE`,sF.QUOTE_SINGLE=`QUOTE_SINGLE`;var vTe=`tag:yaml.org,2002:`;function yTe(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function cF(e,t,n){if(zP(e)&&(e=e.contents),GP(e))return e;if(VP(e)){let t=n.schema[NP].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new iF(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=vTe+t.slice(2));let l=yTe(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new sF(e);return c&&(c.node=t),t}l=e instanceof Map?o[NP]:Symbol.iterator in Object(e)?o[IP]:o[NP]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new sF(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function lF(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return cF(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var uF=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,dF=class extends rF{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>GP(t)||VP(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(uF(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(WP(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,lF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(WP(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&HP(i)?i.value:i:WP(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!VP(t))return!1;let n=t.value;return n==null||e&&HP(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return WP(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(WP(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,lF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},bTe=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function fF(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var pF=(e,t,n)=>e.endsWith(` +`)?fF(n,t):n.includes(` `)?` -`+uF(n,t):(e.endsWith(` `)?``:` `)+n;function fF(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;ii-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=pF(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===` -`)n===`block`&&(h=pF(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==` +`+fF(n,t):(e.endsWith(` `)?``:` `)+n;function mF(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;ii-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=hF(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===` +`)n===`block`&&(h=hF(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==` `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==` -`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hF=e=>/^(%|---|\.\.\.)/m.test(e);function twe(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;tr)return!0;if(n=t+1,i-n<=r)return!1}return!0}function gF(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(hF(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),_F=e=>/^(%|---|\.\.\.)/m.test(e);function xTe(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;tr)return!0;if(n=t+1,i-n<=r)return!1}return!0}function vF(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(_F(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==` `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(` `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p.replace(yF,`$&${l}`));let h=!1,g,_=-1;for(g=0;g{i=!0});let s=fF(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function nwe(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(` -`)||u&&/[[\]{},]/.test(a))return vF(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` -`)?vF(a,t):bF(e,t,n,r);if(!s&&!u&&i!==aF.PLAIN&&a.includes(` -`))return bF(e,t,n,r);if(hF(a)){if(c===``)return t.forceBlockIndent=!0,bF(e,t,n,r);if(s&&c===l)return vF(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return vF(a,t)}return s?d:fF(d,c,`flow`,mF(t,!1))}function xF(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==aF.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=aF.QUOTE_DOUBLE);let c=e=>{switch(e){case aF.BLOCK_FOLDED:case aF.BLOCK_LITERAL:return i||a?vF(o.value,t):bF(o,t,n,r);case aF.QUOTE_DOUBLE:return gF(o.value,t);case aF.QUOTE_SINGLE:return _F(o.value,t);case aF.PLAIN:return nwe(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function SF(e,t){let n=Object.assign({blockQuote:!0,commentString:ewe,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function rwe(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(BP(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function iwe(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(BP(e)||HP(e))&&e.anchor;a&&XP(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function CF(e,t,n,r){if(zP(e))return e.toString(t,n,r);if(IP(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=UP(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=rwe(t.doc.schema.tags,a);let o=iwe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):BP(a)?xF(a,t,n,r):a.toString(t,n,r);return o?BP(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function awe({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=UP(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(HP(e)||!UP(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||HP(e)||(BP(e)?e.type===aF.BLOCK_FOLDED||e.type===aF.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=CF(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=dF(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=dF(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=dF(g,n.indent,l(f))));let _,v,y;UP(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&BP(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&VP(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=CF(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?` -`:``,v){let e=l(v);S+=`\n${uF(e,n.indent)}`}x===``&&!n.inFlow?S===` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=gF(r,!0);o!==`folded`&&t!==sF.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=mF(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function STe(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(` +`)||u&&/[[\]{},]/.test(a))return bF(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` +`)?bF(a,t):SF(e,t,n,r);if(!s&&!u&&i!==sF.PLAIN&&a.includes(` +`))return SF(e,t,n,r);if(_F(a)){if(c===``)return t.forceBlockIndent=!0,SF(e,t,n,r);if(s&&c===l)return bF(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return bF(a,t)}return s?d:mF(d,c,`flow`,gF(t,!1))}function CF(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==sF.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=sF.QUOTE_DOUBLE);let c=e=>{switch(e){case sF.BLOCK_FOLDED:case sF.BLOCK_LITERAL:return i||a?bF(o.value,t):SF(o,t,n,r);case sF.QUOTE_DOUBLE:return vF(o.value,t);case sF.QUOTE_SINGLE:return yF(o.value,t);case sF.PLAIN:return STe(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function wF(e,t){let n=Object.assign({blockQuote:!0,commentString:bTe,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function CTe(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(HP(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function wTe(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(HP(e)||WP(e))&&e.anchor;a&&QP(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function TF(e,t,n,r){if(VP(e))return e.toString(t,n,r);if(RP(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=GP(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=CTe(t.doc.schema.tags,a);let o=wTe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):HP(a)?CF(a,t,n,r):a.toString(t,n,r);return o?HP(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function TTe({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=GP(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(WP(e)||!GP(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||WP(e)||(HP(e)?e.type===sF.BLOCK_FOLDED||e.type===sF.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=TF(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=pF(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=pF(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=pF(g,n.indent,l(f))));let _,v,y;GP(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&HP(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&UP(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=TF(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?` +`:``,v){let e=l(v);S+=`\n${fF(e,n.indent)}`}x===``&&!n.inFlow?S===` `&&y&&(S=` -`):S+=`\n${n.indent}`}else if(!p&&HP(t)){let e=x[0],r=x.indexOf(` +`):S+=`\n${n.indent}`}else if(!p&&WP(t)){let e=x[0],r=x.indexOf(` `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&ne===TF||typeof e==`symbol`&&e.description===TF,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new aF(Symbol(TF)),{addToJSMap:DF}),stringify:()=>TF},owe=(e,t)=>(EF.identify(t)||BP(t)&&(!t.type||t.type===aF.PLAIN)&&EF.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===EF.tag&&e.default);function DF(e,t,n){let r=kF(e,n);if(VP(r))for(let n of r.items)OF(e,t,n);else if(Array.isArray(r))for(let n of r)OF(e,t,n);else OF(e,t,r)}function OF(e,t,n){let r=kF(e,n);if(!RP(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function kF(e,t){return e&&IP(t)?t.resolve(e.doc,e):t}function AF(e,t,{key:n,value:r}){if(UP(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(owe(e,n))DF(e,t,r);else{let i=eF(n,``,e);if(t instanceof Map)t.set(i,eF(r,i,e));else if(t instanceof Set)t.add(i);else{let a=swe(n,i,e),o=eF(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function swe(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(UP(e)&&n?.doc){let t=SF(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),wF(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function jF(e,t,n){return new MF(oF(e,void 0,n),oF(t,void 0,n))}var MF=class e{constructor(e,t=null){Object.defineProperty(this,FP,{value:MP}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return UP(n)&&(n=n.clone(t)),UP(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return AF(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?awe(this,e,t,n):JSON.stringify(this)}};function NF(e,t,n){return(t.inFlow??e.flow?lwe:cwe)(e,t,n)}function cwe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;eo=null,()=>d=!0);o&&(s+=dF(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;ee===DF||typeof e==`symbol`&&e.description===DF,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new sF(Symbol(DF)),{addToJSMap:kF}),stringify:()=>DF},ETe=(e,t)=>(OF.identify(t)||HP(t)&&(!t.type||t.type===sF.PLAIN)&&OF.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===OF.tag&&e.default);function kF(e,t,n){let r=jF(e,n);if(UP(r))for(let n of r.items)AF(e,t,n);else if(Array.isArray(r))for(let n of r)AF(e,t,n);else AF(e,t,r)}function AF(e,t,n){let r=jF(e,n);if(!BP(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function jF(e,t){return e&&RP(t)?t.resolve(e.doc,e):t}function MF(e,t,{key:n,value:r}){if(GP(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ETe(e,n))kF(e,t,r);else{let i=nF(n,``,e);if(t instanceof Map)t.set(i,nF(r,i,e));else if(t instanceof Set)t.add(i);else{let a=DTe(n,i,e),o=nF(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function DTe(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(GP(e)&&n?.doc){let t=wF(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),EF(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function NF(e,t,n){return new PF(cF(e,void 0,n),cF(t,void 0,n))}var PF=class e{constructor(e,t=null){Object.defineProperty(this,LP,{value:PP}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return GP(n)&&(n=n.clone(t)),GP(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return MF(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?TTe(this,e,t,n):JSON.stringify(this)}};function FF(e,t,n){return(t.inFlow??e.flow?kTe:OTe)(e,t,n)}function OTe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;eo=null,()=>d=!0);o&&(s+=pF(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;ea=null);l||=d.length>u||o.includes(` -`),n0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=dF(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:` -`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function PF({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=uF(t(r),e);n.push(i.trimStart())}}function FF(e,t){let n=BP(t)?t.value:t;for(let r of e)if(zP(r)&&(r.key===t||r.key===n||BP(r.key)&&r.key.value===n))return r}var IF=class extends lF{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(jP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(jF(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=zP(e)?e:!e||typeof e!=`object`||!(`key`in e)?new MF(e,e?.value):new MF(e.key,e.value);let r=FF(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);BP(r.value)&&iF(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=FF(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=FF(this.items,e)?.value;return(!t&&BP(n)?n.value:n)??void 0}has(e){return!!FF(this.items,e)}set(e,t){this.add(new MF(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)AF(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!zP(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),NF(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},LF={collection:`map`,default:!0,nodeClass:IF,tag:`tag:yaml.org,2002:map`,resolve(e,t){return RP(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>IF.from(e,t,n)},RF=class extends lF{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(PP,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=zF(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=zF(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&BP(r)?r.value:r}has(e){let t=zF(e);return typeof t==`number`&&t=0?t:null}var BF={collection:`seq`,default:!0,nodeClass:RF,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return VP(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>RF.from(e,t,n)},VF={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),xF(e,t,n,r)}},HF={identify:e=>e==null,createNode:()=>new aF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new aF(null),stringify:({source:e},t)=>typeof e==`string`&&HF.test.test(e)?e:t.options.nullStr},UF={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new aF(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&UF.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function WF({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var GF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:WF},KF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():WF(e)}},qF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new aF(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:WF},JF=e=>typeof e==`bigint`||Number.isInteger(e),YF=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function XF(e,t,n){let{value:r}=e;return JF(r)&&r>=0?n+r.toString(t):WF(e)}var ZF={identify:e=>JF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>YF(e,2,8,n),stringify:e=>XF(e,8,`0o`)},QF={identify:JF,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>YF(e,0,10,n),stringify:WF},$F={identify:e=>JF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>YF(e,2,16,n),stringify:e=>XF(e,16,`0x`)},uwe=[LF,BF,VF,HF,UF,ZF,QF,$F,GF,KF,qF];function eI(e){return typeof e==`bigint`||Number.isInteger(e)}var tI=({value:e})=>JSON.stringify(e),dwe=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:tI},{identify:e=>e==null,createNode:()=>new aF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:tI},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:tI},{identify:eI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>eI(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:tI}],fwe=[LF,BF].concat(dwe,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),nI={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new MF(new aF(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=zP(r)?r:new MF(r)}}else t(`Expected a sequence for this tag`);return e}function iI(e,t,n){let{replacer:r}=n,i=new RF(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(jF(o,s,n))}return i}var aI={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:rI,createNode:iI},oI=class e extends RF{constructor(){super(),this.add=IF.prototype.add.bind(this),this.delete=IF.prototype.delete.bind(this),this.get=IF.prototype.get.bind(this),this.has=IF.prototype.has.bind(this),this.set=IF.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(zP(e)?(r=eF(e.key,``,t),i=eF(e.value,r,t)):r=eF(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=iI(e,t,n),i=new this;return i.items=r.items,i}};oI.tag=`tag:yaml.org,2002:omap`;var sI={collection:`seq`,identify:e=>e instanceof Map,nodeClass:oI,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=rI(e,t),r=[];for(let{key:e}of n.items)BP(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new oI,n)},createNode:(e,t,n)=>oI.from(e,t,n)};function cI({value:e,source:t},n){return t&&(e?lI:uI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var lI={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new aF(!0),stringify:cI},uI={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new aF(!1),stringify:cI},pwe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:WF},mwe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():WF(e)}},hwe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new aF(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:WF},dI=e=>typeof e==`bigint`||Number.isInteger(e);function fI(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function pI(e,t,n){let{value:r}=e;if(dI(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return WF(e)}var gwe={identify:dI,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>fI(e,2,2,n),stringify:e=>pI(e,2,`0b`)},_we={identify:dI,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>fI(e,1,8,n),stringify:e=>pI(e,8,`0`)},vwe={identify:dI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>fI(e,0,10,n),stringify:WF},ywe={identify:dI,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>fI(e,2,16,n),stringify:e=>pI(e,16,`0x`)},mI=class e extends IF{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=zP(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new MF(e.key,null):new MF(e,null),FF(this.items,t.key)||this.items.push(t)}get(e,t){let n=FF(this.items,e);return!t&&zP(n)?BP(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=FF(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new MF(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(jF(e,null,n));return i}};mI.tag=`tag:yaml.org,2002:set`;var hI={collection:`map`,identify:e=>e instanceof Set,nodeClass:mI,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>mI.from(e,t,n),resolve(e,t){if(RP(e)){if(e.hasAllNullValues(!0))return Object.assign(new mI,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function gI(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function _I(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return WF(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var vI={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>gI(e,n),stringify:_I},yI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>gI(e,!1),stringify:_I},bI={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(bI.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=gI(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},xI=[LF,BF,VF,HF,lI,uI,gwe,_we,vwe,ywe,pwe,mwe,hwe,nI,EF,sI,aI,hI,vI,yI,bI],SI=new Map([[`core`,uwe],[`failsafe`,[LF,BF,VF]],[`json`,fwe],[`yaml11`,xI],[`yaml-1.1`,xI]]),CI={binary:nI,bool:UF,float:qF,floatExp:KF,floatNaN:GF,floatTime:yI,int:QF,intHex:$F,intOct:ZF,intTime:vI,map:LF,merge:EF,null:HF,omap:sI,pairs:aI,seq:BF,set:hI,timestamp:bI},bwe={"tag:yaml.org,2002:binary":nI,"tag:yaml.org,2002:merge":EF,"tag:yaml.org,2002:omap":sI,"tag:yaml.org,2002:pairs":aI,"tag:yaml.org,2002:set":hI,"tag:yaml.org,2002:timestamp":bI};function wI(e,t,n){let r=SI.get(t);if(r&&!e)return n&&!r.includes(EF)?r.concat(EF):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(SI.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(EF)),i.reduce((e,t)=>{let n=typeof t==`string`?CI[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(CI).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var xwe=(e,t)=>e.keyt.key),Swe=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?wI(e,`compat`):e?wI(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?bwe:{},this.tags=wI(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,jP,{value:LF}),Object.defineProperty(this,NP,{value:VF}),Object.defineProperty(this,PP,{value:BF}),this.sortMapEntries=typeof a==`function`?a:a===!0?xwe:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Cwe(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=SF(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(uF(t,``))}let o=!1,s=null;if(e.contents){if(UP(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(uF(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=CF(e.contents,i,()=>s=null,t);s&&(c+=dF(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(CF(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(` -`)?(n.push(`...`),n.push(uF(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(uF(a(t),``)))}return n.join(` +`+fF(l(e),c),s&&s()):d&&o&&o(),p}function kTe({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;na=null);l||=d.length>u||o.includes(` +`),n0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=pF(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:` +`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function IF({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=fF(t(r),e);n.push(i.trimStart())}}function LF(e,t){let n=HP(t)?t.value:t;for(let r of e)if(VP(r)&&(r.key===t||r.key===n||HP(r.key)&&r.key.value===n))return r}var RF=class extends dF{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(NP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(NF(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=VP(e)?e:!e||typeof e!=`object`||!(`key`in e)?new PF(e,e?.value):new PF(e.key,e.value);let r=LF(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);HP(r.value)&&oF(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=LF(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=LF(this.items,e)?.value;return(!t&&HP(n)?n.value:n)??void 0}has(e){return!!LF(this.items,e)}set(e,t){this.add(new PF(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)MF(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!VP(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),FF(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},zF={collection:`map`,default:!0,nodeClass:RF,tag:`tag:yaml.org,2002:map`,resolve(e,t){return BP(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>RF.from(e,t,n)},BF=class extends dF{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(IP,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=VF(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=VF(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&HP(r)?r.value:r}has(e){let t=VF(e);return typeof t==`number`&&t=0?t:null}var HF={collection:`seq`,default:!0,nodeClass:BF,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return UP(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>BF.from(e,t,n)},UF={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),CF(e,t,n,r)}},WF={identify:e=>e==null,createNode:()=>new sF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new sF(null),stringify:({source:e},t)=>typeof e==`string`&&WF.test.test(e)?e:t.options.nullStr},GF={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new sF(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&GF.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function KF({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var qF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KF},JF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():KF(e)}},YF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new sF(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:KF},XF=e=>typeof e==`bigint`||Number.isInteger(e),ZF=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function QF(e,t,n){let{value:r}=e;return XF(r)&&r>=0?n+r.toString(t):KF(e)}var $F={identify:e=>XF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>ZF(e,2,8,n),stringify:e=>QF(e,8,`0o`)},eI={identify:XF,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ZF(e,0,10,n),stringify:KF},tI={identify:e=>XF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ZF(e,2,16,n),stringify:e=>QF(e,16,`0x`)},ATe=[zF,HF,UF,WF,GF,$F,eI,tI,qF,JF,YF];function nI(e){return typeof e==`bigint`||Number.isInteger(e)}var rI=({value:e})=>JSON.stringify(e),jTe=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:rI},{identify:e=>e==null,createNode:()=>new sF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:rI},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:rI},{identify:nI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>nI(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:rI}],MTe=[zF,HF].concat(jTe,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),iI={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new PF(new sF(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=VP(r)?r:new PF(r)}}else t(`Expected a sequence for this tag`);return e}function oI(e,t,n){let{replacer:r}=n,i=new BF(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(NF(o,s,n))}return i}var sI={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:aI,createNode:oI},cI=class e extends BF{constructor(){super(),this.add=RF.prototype.add.bind(this),this.delete=RF.prototype.delete.bind(this),this.get=RF.prototype.get.bind(this),this.has=RF.prototype.has.bind(this),this.set=RF.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(VP(e)?(r=nF(e.key,``,t),i=nF(e.value,r,t)):r=nF(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=oI(e,t,n),i=new this;return i.items=r.items,i}};cI.tag=`tag:yaml.org,2002:omap`;var lI={collection:`seq`,identify:e=>e instanceof Map,nodeClass:cI,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=aI(e,t),r=[];for(let{key:e}of n.items)HP(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new cI,n)},createNode:(e,t,n)=>cI.from(e,t,n)};function uI({value:e,source:t},n){return t&&(e?dI:fI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var dI={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sF(!0),stringify:uI},fI={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sF(!1),stringify:uI},NTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KF},PTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():KF(e)}},FTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new sF(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:KF},pI=e=>typeof e==`bigint`||Number.isInteger(e);function mI(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function hI(e,t,n){let{value:r}=e;if(pI(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return KF(e)}var ITe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>mI(e,2,2,n),stringify:e=>hI(e,2,`0b`)},LTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>mI(e,1,8,n),stringify:e=>hI(e,8,`0`)},RTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>mI(e,0,10,n),stringify:KF},zTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>mI(e,2,16,n),stringify:e=>hI(e,16,`0x`)},gI=class e extends RF{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=VP(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new PF(e.key,null):new PF(e,null),LF(this.items,t.key)||this.items.push(t)}get(e,t){let n=LF(this.items,e);return!t&&VP(n)?HP(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=LF(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new PF(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(NF(e,null,n));return i}};gI.tag=`tag:yaml.org,2002:set`;var _I={collection:`map`,identify:e=>e instanceof Set,nodeClass:gI,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>gI.from(e,t,n),resolve(e,t){if(BP(e)){if(e.hasAllNullValues(!0))return Object.assign(new gI,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function vI(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function yI(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return KF(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var bI={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>vI(e,n),stringify:yI},xI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>vI(e,!1),stringify:yI},SI={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(SI.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=vI(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},CI=[zF,HF,UF,WF,dI,fI,ITe,LTe,RTe,zTe,NTe,PTe,FTe,iI,OF,lI,sI,_I,bI,xI,SI],wI=new Map([[`core`,ATe],[`failsafe`,[zF,HF,UF]],[`json`,MTe],[`yaml11`,CI],[`yaml-1.1`,CI]]),TI={binary:iI,bool:GF,float:YF,floatExp:JF,floatNaN:qF,floatTime:xI,int:eI,intHex:tI,intOct:$F,intTime:bI,map:zF,merge:OF,null:WF,omap:lI,pairs:sI,seq:HF,set:_I,timestamp:SI},BTe={"tag:yaml.org,2002:binary":iI,"tag:yaml.org,2002:merge":OF,"tag:yaml.org,2002:omap":lI,"tag:yaml.org,2002:pairs":sI,"tag:yaml.org,2002:set":_I,"tag:yaml.org,2002:timestamp":SI};function EI(e,t,n){let r=wI.get(t);if(r&&!e)return n&&!r.includes(OF)?r.concat(OF):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(wI.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(OF)),i.reduce((e,t)=>{let n=typeof t==`string`?TI[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(TI).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var VTe=(e,t)=>e.keyt.key),HTe=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?EI(e,`compat`):e?EI(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?BTe:{},this.tags=EI(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,NP,{value:zF}),Object.defineProperty(this,FP,{value:UF}),Object.defineProperty(this,IP,{value:HF}),this.sortMapEntries=typeof a==`function`?a:a===!0?VTe:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function UTe(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=wF(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(fF(t,``))}let o=!1,s=null;if(e.contents){if(GP(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(fF(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=TF(e.contents,i,()=>s=null,t);s&&(c+=pF(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(TF(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(` +`)?(n.push(`...`),n.push(fF(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(fF(a(t),``)))}return n.join(` `)+` -`}var TI=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,FP,{value:AP});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new YP({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[FP]:{value:AP}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=UP(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){EI(this.contents)&&this.contents.add(e)}addIn(e,t){EI(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ZP(this);e.anchor=!t||n.has(t)?QP(t||`a`,n):t}return new nF(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=ZCe(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=oF(e,l,p);return o&&HP(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new MF(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return EI(this.contents)?this.contents.delete(e):!1}deleteIn(e){return cF(e)?this.contents!=null&&(this.contents=null,!0):EI(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return HP(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return cF(e)?!t&&BP(this.contents)?this.contents.value:this.contents:HP(this.contents)?this.contents.getIn(e,t):void 0}has(e){return HP(this.contents)?this.contents.has(e):!1}hasIn(e){return cF(e)?this.contents!==void 0:HP(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=sF(this.schema,[e],t):EI(this.contents)&&this.contents.set(e,t)}setIn(e,t){cF(e)?this.contents=t:this.contents==null?this.contents=sF(this.schema,Array.from(e),t):EI(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new YP({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new YP({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Swe(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=eF(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?$P(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Cwe(this,e)}};function EI(e){if(HP(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var DI=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},OI=class extends DI{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},wwe=class extends DI{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},kI=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… -`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function AI(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function jI(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` -`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(jI(t.key)||jI(t.value))return!0}return!1;default:return!0}}function MI(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&jI(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function NI(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||BP(e)&&BP(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var PI=`All mapping items must start at the same column`;function Twe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??IF)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=AI(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,PI)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=` -`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||jI(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,PI);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&MI(r.indent,u,i),n.atKey=!1,NI(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=AI(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&MI(r.indent,f,i),s=c.range[2];let l=new MF(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=` -`+_.comment:g.comment=_.comment);let e=new MF(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&ce&&(e.type===`block-map`||e.type===`block-seq`);function Dwe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?IF:RF))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a0){let e=FI(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=` -`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function RI(e,t,n,r,i,a){let o=n.type===`block-map`?Twe(e,t,n,r,a):n.type===`block-seq`?Ewe(e,t,n,r,a):Dwe(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Owe(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offsete.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),RI(e,t,n,i,o)}let l=RI(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=UP(u)?u:new aF(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function kwe(e,t,n){let r=t.offset,i=Awe(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?aF.BLOCK_FOLDED:aF.BLOCK_LITERAL,o=t.source?jwe(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?` +`}var DI=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,LP,{value:MP});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ZP({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[LP]:{value:MP}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=GP(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){OI(this.contents)&&this.contents.add(e)}addIn(e,t){OI(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=$P(this);e.anchor=!t||n.has(t)?eF(t||`a`,n):t}return new iF(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=_Te(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=cF(e,l,p);return o&&WP(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new PF(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return OI(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uF(e)?this.contents!=null&&(this.contents=null,!0):OI(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return WP(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return uF(e)?!t&&HP(this.contents)?this.contents.value:this.contents:WP(this.contents)?this.contents.getIn(e,t):void 0}has(e){return WP(this.contents)?this.contents.has(e):!1}hasIn(e){return uF(e)?this.contents!==void 0:WP(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=lF(this.schema,[e],t):OI(this.contents)&&this.contents.set(e,t)}setIn(e,t){uF(e)?this.contents=t:this.contents==null?this.contents=lF(this.schema,Array.from(e),t):OI(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new ZP({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new ZP({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new HTe(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=nF(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?tF(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return UTe(this,e)}};function OI(e){if(WP(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var kI=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},AI=class extends kI{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},WTe=class extends kI{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},jI=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… +`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function MI(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function NI(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` +`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(NI(t.key)||NI(t.value))return!0}return!1;default:return!0}}function PI(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&NI(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function FI(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||HP(e)&&HP(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var II=`All mapping items must start at the same column`;function GTe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??RF)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=MI(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,II)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=` +`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||NI(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,II);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&PI(r.indent,u,i),n.atKey=!1,FI(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=MI(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&PI(r.indent,f,i),s=c.range[2];let l=new PF(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=` +`+_.comment:g.comment=_.comment);let e=new PF(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&ce&&(e.type===`block-map`||e.type===`block-seq`);function qTe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?RF:BF))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a0){let e=LI(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=` +`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function BI(e,t,n,r,i,a){let o=n.type===`block-map`?GTe(e,t,n,r,a):n.type===`block-seq`?KTe(e,t,n,r,a):qTe(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function JTe(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offsete.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),BI(e,t,n,i,o)}let l=BI(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=GP(u)?u:new sF(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function YTe(e,t,n){let r=t.offset,i=XTe(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?sF.BLOCK_FOLDED:sF.BLOCK_LITERAL,o=t.source?ZTe(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?` `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;tc&&(c=r.length);else{r.length=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;ec||r[0]===` `?(f===` `?f=` `:!p&&f===` `&&(f=` @@ -2284,48 +2296,48 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ `+o[e][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Awe({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;tn(r+e,t,i);switch(i){case`scalar`:s=aF.PLAIN,c=Nwe(a,l);break;case`single-quoted-scalar`:s=aF.QUOTE_SINGLE,c=Pwe(a,l);break;case`double-quoted-scalar`:s=aF.QUOTE_DOUBLE,c=Fwe(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=FI(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Nwe(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),zI(e)}function Pwe(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),zI(e.slice(1,-1)).replace(/''/g,`'`)}function zI(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?n(r+e,t,i);switch(i){case`scalar`:s=sF.PLAIN,c=$Te(a,l);break;case`single-quoted-scalar`:s=sF.QUOTE_SINGLE,c=eEe(a,l);break;case`double-quoted-scalar`:s=sF.QUOTE_DOUBLE,c=tEe(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=LI(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function $Te(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),VI(e)}function eEe(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),VI(e.slice(1,-1)).replace(/''/g,`'`)}function VI(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Iwe(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===` +`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function nEe(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===` `||r===`\r`)&&(r!==`\r`||e[t+2]===` `);)r===` `&&(n+=` -`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Lwe={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:` -`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Rwe(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function BI(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?kwe(e,t,r):Mwe(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[NP]:c?zwe(e.schema,i,c,n,r):t.type===`scalar`?Bwe(e,i,t,r):e.schema[NP];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=BP(a)?a:new aF(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new aF(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function zwe(e,t,n,r,i){if(n===`!`)return e[NP];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[NP])}function Bwe({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[NP];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[NP];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Vwe(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Hwe={composeNode:VI,composeEmptyNode:HI};function VI(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Uwe(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=BI(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Owe(Hwe,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=HI(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!BP(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function HI(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=BI(e,{type:`scalar`,offset:Vwe(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Uwe({options:e},{offset:t,source:n,end:r},i){let a=new nF(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=FI(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Wwe(e,t,{offset:n,start:r,value:i,end:a},o){let s=new TI(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=AI(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?VI(c,i,l,o):HI(c,l.end,r,null,l,o);let u=s.contents.range[2],d=FI(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function UI(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function WI(e){let t=``,n=!1,r=!1;for(let i=0;ir(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[FP]:c?aEe(e.schema,i,c,n,r):t.type===`scalar`?oEe(e,i,t,r):e.schema[FP];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=HP(a)?a:new sF(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new sF(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function aEe(e,t,n,r,i){if(n===`!`)return e[FP];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[FP])}function oEe({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[FP];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[FP];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function sEe(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var cEe={composeNode:UI,composeEmptyNode:WI};function UI(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=lEe(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=HI(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=JTe(cEe,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=WI(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!HP(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function WI(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=HI(e,{type:`scalar`,offset:sEe(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function lEe({options:e},{offset:t,source:n,end:r},i){let a=new iF(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=LI(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function uEe(e,t,{offset:n,start:r,value:i,end:a},o){let s=new DI(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=MI(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?UI(c,i,l,o):WI(c,l.end,r,null,l,o);let u=s.contents.range[2],d=LI(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function GI(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function KI(e){let t=``,n=!1,r=!1;for(let i=0;i{let i=UI(e);r?this.warnings.push(new wwe(i,t,n)):this.errors.push(new OI(i,t,n))},this.directives=new YP({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=WI(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(HP(i)&&!i.flow&&i.items.length>0){let e=i.items[0];zP(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t{let i=UI(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Wwe(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new OI(UI(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new OI(UI(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=FI(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new OI(UI(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new TI(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},GI=Symbol(`break visit`),Kwe=Symbol(`skip children`),KI=Symbol(`remove item`);function qI(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),JI(Object.freeze([]),e,t)}qI.BREAK=GI,qI.SKIP=Kwe,qI.REMOVE=KI,qI.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},qI.parentCollection=(e,t)=>{let n=qI.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function JI(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t{let i=GI(e);r?this.warnings.push(new WTe(i,t,n)):this.errors.push(new AI(i,t,n))},this.directives=new ZP({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=KI(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(WP(i)&&!i.flow&&i.items.length>0){let e=i.items[0];VP(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t{let i=GI(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=uEe(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new AI(GI(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new AI(GI(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=LI(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new AI(GI(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new DI(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},qI=Symbol(`break visit`),fEe=Symbol(`skip children`),pEe=Symbol(`remove item`);function JI(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),mEe(Object.freeze([]),e,t)}JI.BREAK=qI,JI.SKIP=fEe,JI.REMOVE=pEe,JI.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},JI.parentCollection=(e,t)=>{let n=JI.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function mEe(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t`:return`block-scalar-header`}return null}function YI(e){switch(e){case void 0:case` `:case` -`:case`\r`:case` `:return!0;default:return!1}}var XI=new Set(`0123456789ABCDEFabcdef`),Jwe=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),ZI=new Set(`,[]{}`),Ywe=new Set(` ,[]{} -\r `),QI=e=>!e||Ywe.has(e),Xwe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===` +`:case`\r`:case` `:return!0;default:return!1}}var gEe=new Set(`0123456789ABCDEFabcdef`),_Ee=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),XI=new Set(`,[]{}`),vEe=new Set(` ,[]{} +\r `),ZI=e=>!e||vEe.has(e),yEe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===` `||t===`\r`&&this.buffer[e+1]===` `}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===` `||!t&&!this.atEnd)return e+n+1}return t===` `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&YI(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&ethis.indentValue&&!YI(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&YI(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(QI),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&nthis.indentValue&&!YI(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&YI(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(ZI),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>YI(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case` `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===` `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(` `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===` `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===` -`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(YI(r)||e&&ZI.has(r))break;t=n}else if(YI(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===` +`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(YI(r)||e&&XI.has(r))break;t=n}else if(YI(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===` `?(n+=1,r=` -`,i=this.buffer[n+1]):t=n),i===`#`||e&&ZI.has(i))break;if(r===` -`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&ZI.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(QI),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(YI(n)||t&&ZI.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!YI(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Jwe.has(t))t=this.buffer[++e];else if(t===`%`&&XI.has(this.buffer[e+1])&&XI.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,i=this.buffer[n+1]):t=n),i===`#`||e&&XI.has(i))break;if(r===` +`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&XI.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(ZI),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(YI(n)||t&&XI.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!YI(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(_Ee.has(t))t=this.buffer[++e];else if(t===`%`&&gEe.has(this.buffer[e+1])&&gEe.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Zwe=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function iL(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&aL(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&eL(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},bEe=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function tL(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&CEe(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&xEe(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if($I(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=rL(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($I(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tL(t.key)&&!$I(t.sep,`newline`)){let e=rL(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):$I(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!$I(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){iL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||$I(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=rL(nL(t));aL(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(` +`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(QI(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=eL(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(QI(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(SEe(t.key)&&!QI(t.sep,`newline`)){let e=eL(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):QI(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!QI(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||QI(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=eL($I(t));CEe(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` -`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=rL(nL(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=rL(nL(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function $we(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Zwe||null,prettyErrors:t}}function oL(e,t={}){let{lineCounter:n,prettyErrors:r}=$we(t),i=new Qwe(n?.addNewLine),a=new Gwe(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new OI(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(kI(e,n)),o.warnings.forEach(kI(e,n))),o}function eTe(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=oL(e,n);if(!i)return null;if(i.warnings.forEach(e=>wF(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function sL(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return LP(e)&&!r?e.toString(n):new TI(e,r,n).toString(n)}var cL=new Map,tTe=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,nTe=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,rTe=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,iTe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,lL=/^-?\d+$/,uL=e=>tTe.test(e),dL=e=>typeof e==`number`&&Number.isInteger(e),fL=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},pL=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},mL=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},aTe=e=>{let t={},n=(e,r)=>{if(BP(e)){let{value:n,source:i,tag:a}=e;r&&dL(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!nTe.test(i)&&(t[r]={value:n,source:i})}else RP(e)?e.items.forEach(({key:e,value:t})=>{BP(e)&&n(t,mL(r,String(e.value)))}):VP(e)&&e.items.forEach((e,t)=>{n(e,mL(r,t))})};return n(e.contents,``),t},hL=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},oTe=(e,t,n)=>{let r=n?.source;return dL(t)&&typeof r==`string`&&!lL.test(r)?new hL(t,r):t},sTe=e=>{let t={},n=(e,r)=>e instanceof hL?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||E(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,mL(r,t))}),e);return{value:n(e,``),sourceMap:t}},gL=(e,t)=>{Object.keys(t).length&&cL.set(e,t)},_L=(e,t,n)=>{let r=t?e.get(t):void 0;return r?e.set(n,r):e.delete(n),r},cTe=({previousPath:e,path:t})=>_L(cL,e,t),lTe=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},uTe=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new hL(e,n):void 0,vL=(e,t,n=uTe,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>vL(e,t,n,mL(r,i))):ij(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,vL(i,t,n,mL(r,e))])):e:a},yL=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,dTe=({value:e,source:t})=>yL(t,e,iTe)?t:void 0,fTe={identify:e=>e instanceof hL,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return yL(n,t,rTe)?n:fL(t)}},bL=new Map,pTe=({_file:e,previousPath:t,path:n})=>{if(e.format!==`frontmatter`)return e;let r=_L(bL,t,n);return r?{...e,format:r,configuredFormat:e.format,fmDelimiters:e.fmDelimiters??Lk[r]}:e},xL=new Map,mTe=/\d{16}/,SL=e=>mTe.test(e),CL=(e,t)=>{pL(xL,e,t)},wL=e=>{let t=Number(e);return Number.isSafeInteger(t)||CL(t,String(e)),t},TL=e=>typeof e==`bigint`?wL(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(CL(e,String(BigInt(e))),e):((Array.isArray(e)||E(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=TL(n)}),e),EL=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&lL.test(r)?wL(BigInt(r)):t},DL=e=>typeof e==`number`&&!Number.isSafeInteger(e)?xL.get(e)??void 0:void 0,hTe=()=>xL.size>0,OL=e=>{let t=DL(e);return t===void 0?Array.isArray(e)?e.map(OL):ij(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,OL(t)])):e:BigInt(t)}; +`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=eL($I(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=eL($I(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function TEe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new bEe||null,prettyErrors:t}}function EEe(e,t={}){let{lineCounter:n,prettyErrors:r}=TEe(t),i=new wEe(n?.addNewLine),a=new dEe(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new AI(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(jI(e,n)),o.warnings.forEach(jI(e,n))),o}function DEe(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=EEe(e,n);if(!i)return null;if(i.warnings.forEach(e=>EF(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function OEe(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return zP(e)&&!r?e.toString(n):new DI(e,r,n).toString(n)}var nL=new Map,kEe=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,AEe=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,jEe=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,MEe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,NEe=/^-?\d+$/,rL=e=>kEe.test(e),PEe=e=>typeof e==`number`&&Number.isInteger(e),iL=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},aL=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},oL=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},FEe=e=>{let t={},n=(e,r)=>{if(HP(e)){let{value:n,source:i,tag:a}=e;r&&PEe(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!AEe.test(i)&&(t[r]={value:n,source:i})}else BP(e)?e.items.forEach(({key:e,value:t})=>{HP(e)&&n(t,oL(r,String(e.value)))}):UP(e)&&e.items.forEach((e,t)=>{n(e,oL(r,t))})};return n(e.contents,``),t},sL=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},IEe=(e,t,n)=>{let r=n?.source;return PEe(t)&&typeof r==`string`&&!NEe.test(r)?new sL(t,r):t},LEe=e=>{let t={},n=(e,r)=>e instanceof sL?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||D(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,oL(r,t))}),e);return{value:n(e,``),sourceMap:t}},cL=(e,t)=>{Object.keys(t).length&&nL.set(e,t)},REe=(e,t,n)=>{let r=t?e.get(t):void 0;return r?e.set(n,r):e.delete(n),r},zEe=({previousPath:e,path:t})=>REe(nL,e,t),BEe=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},VEe=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new sL(e,n):void 0,lL=(e,t,n=VEe,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>lL(e,t,n,oL(r,i))):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,lL(i,t,n,oL(r,e))])):e:a},uL=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,HEe=({value:e,source:t})=>uL(t,e,MEe)?t:void 0,UEe={identify:e=>e instanceof sL,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return uL(n,t,jEe)?n:iL(t)}},dL=new Map,WEe=({_file:e,previousPath:t,path:n})=>{if(e.format!==`frontmatter`)return e;let r=REe(dL,t,n);return r?{...e,format:r,configuredFormat:e.format,fmDelimiters:e.fmDelimiters??Hk[r]}:e},fL=new Map,GEe=/\d{16}/,pL=e=>GEe.test(e),KEe=(e,t)=>{aL(fL,e,t)},qEe=e=>{let t=Number(e);return Number.isSafeInteger(t)||KEe(t,String(e)),t},mL=e=>typeof e==`bigint`?qEe(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(KEe(e,String(BigInt(e))),e):((Array.isArray(e)||D(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=mL(n)}),e),JEe=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&NEe.test(r)?qEe(BigInt(r)):t},hL=e=>typeof e==`number`&&!Number.isSafeInteger(e)?fL.get(e)??void 0:void 0,YEe=()=>fL.size>0,gL=e=>{let t=hL(e);return t===void 0?Array.isArray(e)?e.map(gL):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,gL(t)])):e:BigInt(t)}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause @@ -2353,9 +2365,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -function gTe(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function _Te(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=` +function XEe(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function ZEe(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=` `,e===t&&(i+=` `.repeat(a+n+2),i+=`^ -`))}return i}var kL=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=gTe(t.toml,t.ptr),i=_Te(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}}; +`))}return i}var _L=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=XEe(t.toml,t.ptr),i=ZEe(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause @@ -2383,8 +2395,8 @@ function gTe(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().leng * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -function AL(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&kL.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&kL.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=` -`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:kL.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&kL.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);kL.x(`unfinished string`,e,t)} +function QEe(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&_L.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&_L.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=` +`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:_L.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&_L.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);_L.x(`unfinished string`,e,t)} /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause @@ -2412,7 +2424,7 @@ function AL(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCode * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var vTe=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,jL=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(vTe);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}}; +var $Ee=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,vL=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match($Ee);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause @@ -2440,7 +2452,7 @@ var vTe=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -function ML(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function NL(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function PL(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||kL.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?CTe(e):STe(e);return e.d++,t}return r===34||r===39?AL(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&kL.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&kL.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?FL(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?yTe(e,r,t):e.s.charCodeAt(e.p+2)===58?bTe(e,r,t):FL(e,e.p,r,0,t)}function FL(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&kL.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&kL.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||NL(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return IL(e,t,16,i);if(a===98)return IL(e,t,2,i);if(a===111)return IL(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:kL.x(`illegal leading zero`,e,t)}else ML(a)||kL.x(`invalid value`,e,t);for(;++e.p9?o-=11:o&1||o++:kL.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||kL.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):LL(e,c,10,t)}function IL(e,t,n,r){let i,a=1;for(;++e.p=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!ML(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return RL(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&kL.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ML(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return RL(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return RL(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return RL(e,e.s.slice(r,e.p),2,i,r)}function bTe(e,t,n){let r=e.p;if(!ML(t)||!ML(e.s.charCodeAt(++e.p)))return FL(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ML(e.s.charCodeAt(++e.p)););return RL(e,e.s.slice(r,e.p),4,!1,r)}function RL(e,t,n,r,i,a){if(e.ld){let a=new jL(t,n,r);return a.isValid()||kL.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){kL.x(t instanceof Error?t.message:``+t,e,i)}} +function yL(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function bL(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function xL(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||_L.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?aDe(e):iDe(e);return e.d++,t}return r===34||r===39?QEe(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&_L.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&_L.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?SL(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?tDe(e,r,t):e.s.charCodeAt(e.p+2)===58?nDe(e,r,t):SL(e,e.p,r,0,t)}function SL(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&_L.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&_L.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||bL(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return CL(e,t,16,i);if(a===98)return CL(e,t,2,i);if(a===111)return CL(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:_L.x(`illegal leading zero`,e,t)}else yL(a)||_L.x(`invalid value`,e,t);for(;++e.p9?o-=11:o&1||o++:_L.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||_L.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):eDe(e,c,10,t)}function CL(e,t,n,r){let i,a=1;for(;++e.p=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!yL(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return wL(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&_L.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;yL(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return wL(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return wL(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return wL(e,e.s.slice(r,e.p),2,i,r)}function nDe(e,t,n){let r=e.p;if(!yL(t)||!yL(e.s.charCodeAt(++e.p)))return SL(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;yL(e.s.charCodeAt(++e.p)););return wL(e,e.s.slice(r,e.p),4,!1,r)}function wL(e,t,n,r,i,a){if(e.ld){let a=new vL(t,n,r);return a.isValid()||_L.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){_L.x(t instanceof Error?t.message:``+t,e,i)}} /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause @@ -2468,7 +2480,7 @@ function ML(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -function xTe(e){for(;e.p57&&o<65||o>90&&o<97&&o!==95||o>122?kL.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));kL.x(`incomplete key-value: cannot find end of key`,e,n)}function STe(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p57&&o<65||o>90&&o<97&&o!==95||o>122?_L.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));_L.x(`incomplete key-value: cannot find end of key`,e,n)}function iDe(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p{let n=yL(t,e,FTe)?t:fL(e);return Object.assign(new Date(0),{toISOString:()=>n})},RTe=e=>{let t=new Map,n=new Set;return e.replace(PTe,` `).match(NTe)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&pL(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},zTe=e=>{let t=new Map;return e.match(MTe)?.forEach(e=>{let n=new jL(e);n.isValid()&&pL(t,n.toISOString(),e)}),t},BTe=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof jL){let i=t.toISOString();r??=zTe(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=uL(e)?RTe(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??fL(t)})):(Array.isArray(t)||E(t))&&Object.entries(t).forEach(([e,t])=>{a(t,mL(o,e))})};return a(t,``),n},VTe=({path:e,str:t,parsed:n})=>{gL(e,BTe(t,n))},HTe=(e,t)=>e===t||e instanceof jL&&e.toISOString()===t,UTe=(e,{value:t,source:n})=>typeof t==`number`?e===t?LTe(t,n):void 0:HTe(e,t)?new ITe(t,n):void 0,WTe=(e,t)=>vL(e,t,UTe),GTe=(e,t,n)=>oTe(e,EL(e,t,n),n),KTe=(e,t)=>{if(t===void 0||!uL(e))return SL(e)?JSON.parse(e,EL):JSON.parse(e);let{value:n,sourceMap:r}=sTe(JSON.parse(e,GTe));return gL(t,r),n},qTe=(e,t)=>{let n=TL(wTe(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&VTe({path:t,str:e,parsed:n}),mr(n)},JTe=(e,t,n)=>{let r=oL(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return gL(n,aTe(r)),r.toJS(t)},YTe=(e,t,n)=>{let r=SL(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&uL(e)?JTe(e,i,n):eTe(e,i);return r?TL(a):a},XTe=e=>Rk.find(t=>e.startsWith(Lk[t][0]))??`yaml-frontmatter`,ZTe=/^\{\n(?\{[\s\S]*?\})\n\}(?:\n\n(?[\s\S]*))?$/,QTe=(e,t)=>{let n=e.trim();return KTe(n.startsWith(`{`)?n:`{${n}}`,t)},$Te={yaml:(e,t)=>YTe(e,void 0,t),toml:qTe,json:KTe},eEe={...$Te,json:QTe},tEe=new Map,nEe=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=OA({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?EA({format:r,delimiter:s}):s)??Lk[`yaml-frontmatter`],f=LE(u),p=LE(d),m=lA(tEe,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(ZTe)?.groups:void 0)??h.match(m)?.groups;if(!g)return{[c]:i};let{head:_=``,body:v}=g,y=Rk.includes(r)?Hk(r):void 0,b=y?eEe[y](_,a):{};return(!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}}},rEe=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=VA(t),i=r&&n?XA(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&Nk(r,e),{format:o}=OA({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},iEe=e=>{try{return!!AO.get(rEe(e).format)?.parser}catch{return!1}},aEe=async({text:e=``,path:t,folder:n})=>{let r=rEe({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;cL.delete(t),e=e.trimEnd().replace(/\r\n?/g,` -`);let c=e.trimStart(),l=AO.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{if(s===`frontmatter`){let e=XTe(c);bL.set(t,e),s=e}if(Rk.includes(s))return nEe({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});let n=Hk(s);if(n)return $Te[n](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw AO.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},oEe=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await qc()},sEe=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i=n&&(await oEe(),r=performance.now()),await t(e[i])},YL=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},XL=e=>{let t=0,n=[];return async r=>{t>=e?await new Promise(e=>{n.push(()=>e(void 0))}):t+=1;try{return await r()}finally{let e=n.shift();e?e():--t}}},cEe=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),lEe=/{{([^]*?)}}/,uEe=new Map,ZL=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=lA(uEe,t,()=>{let e=t.split(lEe).map((e,t)=>t%2==0?LE(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},dEe=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>dEe(e,t));return t.delete(e),n},fEe=()=>`${FO}\n${XO.current}`,pEe=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),format:bL.get(t),valueSources:cL.get(t)})}catch{}},mEe=async(e,t,n)=>{let{path:r,parsed:i}=e,a=fEe(),o=iEe(e);if(i?.key===a&&!o)return i.format?bL.set(r,i.format):bL.delete(r),i.valueSources?cL.set(r,i.valueSources):cL.delete(r),i.content;try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await aEe(e);if(dEe(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!SL(e.text)&&pEe({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},hEe=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!E(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},gEe=(e,t,n)=>{if(!E(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{E(e[t])&&(a[t]=e[t])}),a},_Ee=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return jj(t,`list`)?hEe({...r,validate:wP(t[0])?e=>E(e)||Array.isArray(e):Array.isArray}):jj(t,`keyvalue`)?hEe({...r,validate:e=>E(e)&&Object.values(e).every(e=>typeof e==`string`)}):E(e)?e:void 0},vEe=(e,t,n)=>{let r=_Ee(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,EP(n,t,!0)])):EP(r,t,!0)},yEe=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:cEe(e)?!(t||Mk(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||nA(n)===`_index`):!1,bEe=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},xEe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||ZL({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:cj(t)}},SEe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||ZL({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>E(t[e])).map(e=>[e,{slug:s,path:n,content:cj(t[e])}]))},CEe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||ZL({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:cj(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},QL=new Map,$L=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?gEe(t,s,c):t,d=u?vEe(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?SEe({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):xEe({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},wEe=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(QL.set(a,n),n.forEach((t,n)=>{let i=$L({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(QL.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},TEe=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await mEe(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=ZA(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&QL.set(o,null);return}if(!u)return;if(f){wEe({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&Nk(u,o)&&Mk(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?gEe(a,v,y):a;if(!C)return;let w=NA(b),T=vEe(C,S,w);if(!T||yEe(o,l,u,h,g))return;let ee=PA(b),{subPath:te,locale:ne}=bEe({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!te||ee&&!ne)return;let re={id:``,slug:``,subPath:te,locales:{},...s},ie={entry:re,rawContent:T,path:o,fileName:l,subPath:te,subPathTemplate:h};if(!_)xEe(ie);else if(w)SEe({...ie,allLocales:v});else if(CEe({...ie,locale:ne,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(re)},eR=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await sEe(e,async e=>{try{await TEe({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=Jc(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},EEe=/^\/(?.+)\/(?[dgimsuvy]*)$/,DEe=/[gy]/g,OEe=e=>{try{return RegExp(``,e),!0}catch{return!1}},tR=e=>{if(e instanceof RegExp){let t=e.flags.replace(DEe,``);return t===e.flags?e:new RegExp(e.source,t)}if(typeof e==`string`&&e){let{pattern:t,flags:n}=e.match(EEe)?.groups??{};if(t!==void 0)try{return tR(new RegExp(t,n))}catch{if(OEe(n))return}try{return new RegExp(e)}catch{}}},nR=zO([]),kEe=VO(()=>new Set(nR.current.map(e=>e.id))),AEe=new WeakMap,jEe=e=>lA(AEe,e,()=>{let{filter:t}=e._type===`entry`?e:{},n=t?.field;if(n!==void 0)return{field:n,pattern:tR(t?.pattern),values:t?.value===void 0?[]:Array.isArray(t.value)?t.value:[t.value]}}),MEe=(e,t)=>{let n=jEe(e);if(!n||Pk(e,t))return!0;let{field:r,pattern:i,values:a}=n,o=qR({entry:t,locale:e._i18n.defaultLocale,collectionName:e.name,key:r}),s=Array.isArray(o)?o:[o??null];return i?s.some(e=>e!=null&&i.test(String(e))):s.some(e=>a.includes(e))},rR=e=>qN(e).filter(t=>!t.hide&&MEe(t,e)),iR={entrySource:void 0,folderSource:void 0,buckets:void 0,map:new Map,folderMap:new Map},NEe=()=>{if(!iR.buckets){let e=new Map;qA.current.forEach(t=>{new Set(qN(t).map(({name:e})=>e)).forEach(n=>{lA(e,n,()=>[]).push(t)})}),iR.buckets=e}return iR.buckets},PEe=e=>{let t=VA(e);return t?(NEe().get(e)??[]).filter(e=>MEe(t,e)):[]},FEe=()=>{let e=qA.current,t=KA.current;(e!==iR.entrySource||t!==iR.folderSource)&&(iR.entrySource=e,iR.folderSource=t,iR.buckets=void 0,iR.map=new Map,iR.folderMap=new Map)},aR=e=>{FEe();let t=iR.map.get(e);if(t)return t;let n=PEe(e);return iR.map.set(e,n),n},IEe=(e,t)=>{let{_file:{fullPathRegEx:n=void 0,subPath:r=void 0}={}}=e._type===`entry`?e:{};if(!n)return[];let{defaultLocale:i}=e._i18n,a=new Set(t);return qA.current.flatMap(e=>{if(a.has(e))return[];let t={},o={};Object.values(e.locales).forEach(e=>{let{subPath:a,locale:s=i}=e.path.match(n)?.groups??{};a&&(t[s]={...e,slug:ZL({subPath:a,subPathTemplate:r})},o[s]=a)});let s=hP(t,i);if(!s)return[];let{slug:c}=t[s],l=o[s];return[{...e,slug:c,subPath:l,locales:t}]})},oR=e=>(FEe(),lA(iR.folderMap,e,()=>{let t=VA(e),n=NEe().get(e)??[];return t?[...n,...IEe(t,n)]:n})),LEe=(e,t)=>{let n=VA(e);return!n||jk(n)===void 0?t.length:t.filter(e=>!Pk(n,e)).length},REe=e=>Mk(e)?!aR(e.name).some(t=>Pk(e,t)):!1,zEe=`order`,BEe=e=>e?._type===`entry`&&(!!e.reorder||rk(e)),sR=e=>{let t=e?.reorder;if(t&&typeof e.file!=`string`)return E(t)&&typeof t.key==`string`&&t.key?t.key:zEe},VEe=e=>{let t=e?.reorder;if(E(t)&&typeof t.group==`string`&&t.group)return t.group},cR=e=>{if(rk(e))return e=>e.arrayIndex??0;let t=sR(e);if(!t)return()=>void 0;let{defaultLocale:n}=e._i18n;return e=>{let r=e.locales[n]?.content?.[t],i=typeof r==`number`||typeof r==`string`&&r.trim()?Number(r):NaN;return Number.isFinite(i)?i:void 0}},lR=(e,t)=>{let n=cR(t),r=e.map(e=>({entry:e,v:n(e)}));return r.sort((e,t)=>e.v!==void 0&&t.v!==void 0?e.v-t.v:e.v===void 0?t.v===void 0?0:1:-1),r.map(({entry:e})=>e)},uR=e=>e?.identifier_field??`title`,HEe=new WeakMap,UEe=e=>lA(HEe,e,()=>{let t=new Map;return e.forEach(({value:e,label:n})=>{t.has(e)||t.set(e,n)}),t}),WEe=new WeakMap,GEe=0,KEe=e=>lA(WEe,e,()=>{let e=GEe;return GEe+=1,e}),dR=e=>IM(e)?e:e===`slug`?`{{fields.slug}}`:`{{${e}}}`,qEe=e=>{if(!e||e.widget!==`list`)return!1;let t=`fields`in e,n=`types`in e;return t||n},JEe={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},YEe=new Map,XEe=e=>{let t=e??``,n=YEe.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...JEe,hourCycle:`h23`,timeZone:e}),YEe.set(t,n)),n},fR=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries(XEe(t).formatToParts(e).filter(({type:e})=>e in JEe).map(({type:e,value:t})=>[e,t])),ZEe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),QEe={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function $Ee(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function eDe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function tDe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function nDe(e){return tDe(e)||$Ee(e)}var rDe=document.createElement(`i`);function iDe(e){let t=`&`+e+`;`;rDe.innerHTML=t;let n=rDe.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var aDe=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function pR(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?nDe:u===`decimal`?$Ee:eDe;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&ZEe.includes(y)&&(_=y,v=iDe(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&iDe(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):nDe(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(oDe(e))h(7,S),C=`�`;else if(e in QEe)h(6,S),C=QEe[e];else{let t=``;sDe(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,aDe[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function oDe(e){return e>=55296&&e<=57343||e>1114111}function sDe(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var mR=e=>e?.name||e?.login||e?.email,cDe=/^#+[^\S\n\r\u2028\u2029]+(.*)$/gm,lDe=e=>{if(!e.endsWith(`}`))return e;for(let t=e.indexOf(`{#`,1);t>0&&!(t+2>=e.length-1);t=e.indexOf(`{#`,t+1))if(/\s/.test(e[t-1]))return e.slice(0,t).trimEnd();return e},uDe=e=>e.matchAll(cDe).map(([,e])=>lDe(e.trim())).find(e=>!!e)??``,dDe=(e,{allowMarkdown:t=!1}={})=>(e=lr(e),t&&(e=pR(e)),e=_t(e,{ALLOWED_TAGS:t?[`strong`,`em`,`code`]:[],ALLOWED_ATTR:[]}),t||(e=pR(e)),e.trim()),hR=(e,{identifierField:t=`title`,useBody:n=!0}={})=>{let r=[t,`title`,`name`,`label`].find(t=>typeof e[t]==`string`&&!!e[t].trim());return r?e[r].trim():n&&typeof e.body==`string`?uDe(e.body):``},fDe=(e,t)=>{let{slug:n,entryPath:r,basePath:i,fullPathRegEx:a,locales:o,localeSuffixes:s,commitDate:c,commitAuthor:l}=t;if(e===`slug`)return n;if(e===`locales`)return o.sort((e,t)=>e.localeCompare(t)).join(`, `);if(e===`dirname`)return vP(r,{basePath:i,fullPathRegEx:a});if(e===`filename`||e===`extension`)return Tk(r,s)[e];if(e===`commit_date`)return c??``;if(e===`commit_author`)return mR(l)},gR=!1,pDe=(e,t)=>{let{content:n,collectionName:r,replaceSubContext:i,locale:a,fallbackSummary:o}=t,{value:s,transformations:c}=wN(e),l=wk(s),u={collectionName:r,valueMap:n,keyPath:l},d=fDe(s,i),f=MM(c,e=>pDe(e,t));if(d===void 0&&(f.some(({method:e})=>e===`date`||e===`ternary`)?d=Object.hasOwn(n,l)?n[l]:void 0:(Fj(u)?.widget===`relation`&&(gR=!0),d=KR({...u,locale:a})),l===`title`&&!d&&(d=o)),d===void 0)return``;if(d instanceof Date&&!f.length){let{year:e,month:t,day:n}=fR({date:d});return`${e}-${t}-${n}`}return f.length&&(d=TN({fieldConfig:Fj({...u}),value:d,transformations:f,locale:a})),String(d)},mDe=new WeakMap,hDe,gDe=0,_De=()=>{let e=qA.current;return e!==hDe&&(hDe=e,gDe+=1),gDe},vDe=(e,t,{locale:n,useTemplate:r=!1,allowMarkdown:i=!1,template:a,useIndexFileLabel:o=!0}={})=>{if(o&&Pk(e,t))return Mk(e)?.label;let{_type:s,name:c,_i18n:{defaultLocale:l}}=e,{_file:{basePath:u,fullPathRegEx:d}={},summary:f}=s===`entry`?e:{},p=uR(s===`entry`?e:void 0),m=a??f,{locales:h,slug:g,commitDate:_,commitAuthor:v}=t,y=n??l,b=Object.hasOwn(h,y)?y:Object.keys(h)[0]??y,{content:x={},path:S=``}=h[b]??{},C=hR(x,{identifierField:p})||g.replaceAll(`-`,` `);if(!r||!m)return dDe(C,{allowMarkdown:i});let w={content:x,collectionName:c,replaceSubContext:{slug:g,entryPath:S,basePath:u,fullPathRegEx:d,locales:Object.keys(h),localeSuffixes:Ek(e),commitDate:_,commitAuthor:v},locale:b,fallbackSummary:C};return dDe(PM(m,(e,t)=>pDe(t,w)),{allowMarkdown:i})},_R=(e,t,n={})=>{let{locale:r,useTemplate:i=!1,allowMarkdown:a=!1,template:o,useIndexFileLabel:s=!0}=n,c=lA(lA(mDe,t,()=>new WeakMap),e,()=>new Map),l=[r??``,i?`1`:`0`,a?`1`:`0`,o??``,s?`1`:`0`,Oc.current].join(` -`),u=_De(),d=c.get(l);if(d&&(d.generation===void 0||d.generation===u))return d.summary;let f=gR;gR=!1;let p=vDe(e,t,n),m=gR;return gR=f||m,c.set(l,{summary:p,generation:m?u:void 0}),p},yDe=(e,t)=>{let n=e?.[t];return n==null?``:String(n)},bDe=(e,t,n,{stored:r=!1}={})=>{let{slug:i,locale:a,getDisplayValue:o}=t,{content:s,locales:c,defaultLocale:l}=n;if(e===`slug`)return i;if(e===`locale`)return a;let u=wk(e);return r?yDe(s,u)||yDe(c[l]?.content,u):o(u)||o(u,l)||``},xDe=(e,t)=>{let{content:n,locales:r,defaultLocale:i,identifierField:a}=t;return hR(n,{identifierField:a})||hR(r[i]?.content||{},{identifierField:a})||e.slug},vR=(e,t,n,r)=>{let{label:i,value:a,searchValue:o}=e,s=!1;return t.forEach(e=>{let t=`{{${e}}}`,c=bDe(e,n,r);if(a.includes(t)){let i=bDe(e,n,r,{stored:!0});i||(s=!0),a=a.replaceAll(t,()=>i)}i=i.replaceAll(t,()=>c),o=o?.replaceAll(t,()=>c)??``}),{label:i.trim()||xDe(n,r),value:s?``:a,searchValue:o.trim()}},yR=e=>{let t=[];return PM(e,(e,n)=>(t.push(n),``)),t},SDe=(e,t)=>{let n=e.value_field,r=e.display_fields??[n??`{{${t}}}`],i=e.search_fields??r,a=dR(n??`{{slug}}`),o=r.map(dR).join(` `),s=i.map(dR).join(` `),c=eO([...yR(o),...yR(a),...yR(s)]);return{_valueField:a,_displayField:o,_searchField:s,allFieldNames:c,hasListFields:c.some(e=>e.includes(`*`))}},CDe=/\.(\d+)$/,wDe=(e,t)=>{let n=new Map;return e.filter(e=>e.includes(`*`)).forEach(e=>{let r=e.replace(/\.\*.*$/,``),i=Fj({...t,keyPath:r});n.set(e,{baseFieldName:r,fieldConfig:i,isComplexListField:qEe(i)})}),Map.groupBy(n.entries(),([,{baseFieldName:e}])=>e)},TDe=({templates:e,replacements:t,staticFieldNames:n,context:r,fallbackContext:i})=>{let{_displayField:a,_valueField:o,_searchField:s}=e,c=e=>t.reduce((e,[t,n])=>e.replaceAll(`{{${t}}}`,()=>n),e),{label:l,value:u,searchValue:d}=vR({label:c(a),value:c(o),searchValue:c(s)},n,r,i);return{label:l,value:t.some(([e,t])=>o.includes(`{{${e}}}`)&&String(t??``)===``)?``:u,searchValue:d||l}},EDe=new Map,DDe=(e,t,n=t)=>Object.entries(e).filter(([e])=>t.test(e)).map(([e,t])=>{let r=e.match(n);return{index:parseInt(r[1],10),value:t}}).sort((e,t)=>e.index-t.index),ODe=({baseFieldName:e,groupEntries:t,content:n,templates:r,allFieldNames:i,context:a,fallbackContext:o})=>{let s=DDe(n,lA(EDe,e,()=>RegExp(`^${LE(e)}\\.\\d+$`)),CDe),c=i.filter(e=>!e.includes(`*`));return s.map(({value:e})=>TDe({templates:r,replacements:t.map(([t])=>[t,e]),staticFieldNames:c,context:a,fallbackContext:o}))},kDe=/^(.+)\.\*\.(.+)$/,ADe=new Map,jDe=e=>{let t=null;return e.some(([e])=>(t=e.match(kDe),!!t)),t},MDe=({groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let[,o,s]=jDe(e)??[];if(!o)return[];let c=DDe(t,lA(ADe,`${o}:${s}`,()=>{let e=LE(o),t=LE(s);return RegExp(`^${e}\\.([0-9]+)\\.${t}$`)})),l=r.filter(e=>!e.includes(`*`));return c.map(({index:r})=>TDe({templates:n,replacements:e.flatMap(([e])=>{let[,n,i]=e.match(kDe)??[];return n?[[e,t[`${n}.${r}.${i}`]??``]]:[]}),staticFieldNames:l,context:i,fallbackContext:a}))},NDe=({baseFieldGroups:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let o=[],s=!1;return e.forEach((e,c)=>{if(e.length===0)return;let[,l]=e[0],u={groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a},d=l.isComplexListField?MDe({...u}):ODe({...u,baseFieldName:c});o.push(...d),s=!0}),{results:o,hasProcessedListFields:s}},PDe=({templates:e,allFieldNames:t,context:n,fallbackContext:r})=>{let{_displayField:i,_valueField:a,_searchField:o}=e,{label:s,value:c,searchValue:l}=vR({label:i,value:a,searchValue:o},t,n,r);return{label:s,value:c,searchValue:l||s}},bR=e=>e.filter(({value:e})=>!!e),FDe=({refEntry:e,content:t,collection:n,templates:r,fileName:i,locale:a,identifierField:o,pendingEntries:s=void 0})=>{let{locales:c}=e,{name:l,_i18n:{defaultLocale:u}}=n,{allFieldNames:d,hasListFields:f}=r,p=iA(n,e.slug),m={collectionName:l,fileName:i,isIndexFile:Pk(n,e),keyPath:``},h={slug:p,locale:a,getDisplayValue:(e,n)=>KR({...m,keyPath:e,valueMap:n?c[n]?.content??{}:t,locale:n??a,pendingEntries:s})},g={content:t,locales:c,defaultLocale:u,identifierField:o};if(!f)return bR([PDe({templates:r,allFieldNames:d,context:h,fallbackContext:g})]);let{results:_,hasProcessedListFields:v}=NDe({baseFieldGroups:wDe(d,m),content:t,templates:r,allFieldNames:d,context:h,fallbackContext:g});if(v)return bR(_);let{_displayField:y,_valueField:b,_searchField:x}=r,{label:S,value:C,searchValue:w}=vR({label:y,value:b,searchValue:x},d.filter(e=>!e.includes(`*`)),h,g);return bR([{label:S,value:C,searchValue:w||S}])},IDe=/^{{fields\.(.+?)}}$/,LDe=new Map,RDe=(e,t)=>{let n=e[t];if(n!==void 0&&!Array.isArray(n))return n;let r=lA(LDe,t,()=>RegExp(`^${LE(t)}\\.\\d+$`)),i=Object.keys(e).filter(e=>r.test(e)).map(t=>e[t]);return i.length?i:n},zDe=(e,t,n=void 0)=>e.map(({field:e,values:r,exclude:i})=>({field:e,exclude:i,values:r.flatMap(e=>{if(typeof e!=`string`)return[e];if(e===`{{slug}}`)return n?[n]:[];let r=e.match(IDe);if(!r)return[e];let i=t?RDe(t,r[1]):void 0;return Array.isArray(i)?i:i===void 0?[]:[i]})})),BDe=({refEntries:e,collection:t,locale:n,fileName:r=void 0,entryFilters:i=[],defaultLocale:a=void 0})=>e.filter(e=>!r||r===e.slug).map(e=>{let{content:t}=e.locales[n]??(a?e.locales[a]:void 0)??e.locales._default??{};return{refEntry:e,hasContent:!!t&&Object.keys(t).length>0,content:t??{}}}).filter(({hasContent:e,content:n,refEntry:r})=>e&&i.every(({field:e,values:i,exclude:a=!1})=>{if(i.length===0)return!0;let o=e===`slug`,s=wk(e),c=o?iA(t,r.slug):RDe(n,s),l=Array.isArray(c)?c.some(e=>i.includes(e)):i.includes(c);return a?!l:l})),xR=(e,t)=>{let{databaseName:n}=e??{};return n?new UE(n,t):void 0},SR=[`eq`,`ne`,`lt`,`lte`,`gt`,`gte`,`in`,`not_in`,`empty`],CR=e=>{let{field:t,pattern:n}=e,r={field:t};return n!==void 0&&(r.pattern=n),SR.forEach(t=>{e[t]!==void 0&&(r[t]=e[t])}),r},VDe=e=>!!e&&SR.some(t=>e[t]!==void 0),wR=e=>{let{field:t,pattern:n}=e,r=[t],i=Object.fromEntries(SR.filter(t=>e[t]!==void 0).map(t=>[t,e[t]]));return n===void 0?Object.keys(i).length&&r.push(null):r.push(String(n)),Object.keys(i).length&&r.push(i),JSON.stringify(r)},TR=e=>e===`*other`?Y(`other`):e,HDe=(e,t,n)=>{let r=tR(t);return[...Map.groupBy(e,e=>{let t=n(e);return t==null?`*other`:r?String(t).match(r)?.[0]??`*other`:String(t)})].sort(([e],[t])=>VE(TR(e),TR(t)))},UDe=(e,t,n)=>{let{field:r,pattern:i}=t??{};return r?Object.fromEntries(HDe(e,i,e=>n(e,r))):e.length?{"*":e}:{}},WDe=(e,t,n)=>n?n.test(String(e??``)):e===t,GDe=(e,t,n)=>n?VE(e,t):e-t,ER=(e,t,n,r)=>{let i=e.map(e=>({item:e,key:t(e)})),a=i.filter(({key:e})=>e!==void 0),o=i.filter(({key:e})=>e===void 0);return a.sort(({key:e},{key:t})=>GDe(e,t,n)),r===`descending`&&a.reverse(),[...a,...o].forEach(({item:t},n)=>{e[n]=t}),e},KDe=e=>e.filter(e=>e!==`*`),DR=e=>e?wR(e):void 0,OR=(e,t)=>{let n=DR(e.group);return n!==void 0&&!!e.collapsedGroups?.[n]?.includes(t)},qDe=(e,t)=>{let n=DR(e.group);if(n===void 0)return e;let{[n]:r,...i}=e.collapsedGroups??{},a=t.length?{...i,[n]:t}:i,{collapsedGroups:o,...s}=e;return Object.keys(a).length?{...s,collapsedGroups:a}:s},JDe=(e,t,n)=>{let r=DR(e.group),i=(r===void 0?[]:e.collapsedGroups?.[r]??[]).filter(e=>e!==t);return n&&i.push(t),qDe(e,i)},YDe=(e,t,n)=>qDe(e,n?[...t]:[]),kR=async(e,t,n,{defaults:r={}}={})=>{let i=xR(e,`ui-settings`),a;try{a=await i?.get(t)}catch{}let o={...r,...E(a)?a:{}};n.current=o;let s=o;return UO(()=>{let{current:e}=n;(0,hr.default)(e,s)||(s=e,(async()=>{try{await i?.set(t,e)}catch{}})())})},AR=(e,t)=>{if(Array.isArray(e))return{options:e};if(E(e)){let n=e[t],r=e.default;if(Array.isArray(n)){let e=r?n.find(({name:e})=>e===r):void 0;return{options:n,default:e?CR(e):void 0}}}return{options:[]}},XDe=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),ZDe=e=>{if(XDe(e))return{keys:e};if(E(e)){let{fields:t,default:n}=e;return XDe(t)?E(n)?{keys:t,defaultKey:n.field,defaultOrder:[`descending`,`Descending`].includes(n.direction??``)?`descending`:`ascending`}:{keys:t}:{keys:[]}}return{keys:[]}},jR=[`slug`,`commit_author`,`commit_date`],QDe=[`dirname`,`filename`,`extension`,`locales`],$De=/\{\{.+?\}\}/,eOe=/^\{\{\s*(?:fields\.)?([^\s|{}]+)\s*\}\}$/,MR=e=>$De.test(e),NR=e=>{let{table_columns:t,summary_fields:n}=e;if(Array.isArray(t))return t.map(e=>E(e)?{key:e.field,label:e.label}:{key:e});if(Array.isArray(n))return n.map(e=>({key:e===`summary`?`_summary`:e}))},tOe=new Map,nOe=e=>lA(tOe,e,()=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return e.toLowerCase()}}),rOe=(e,t)=>{if(Object.hasOwn(e,t))return t;let n=nOe(t),r=Object.keys(e).filter(e=>nOe(e)===n);return r.find(e=>!e.includes(`-`))??r[0]},iOe=(e,t)=>{let n=e[`${t}_localized`];return E(n)?n:void 0},PR=({config:e,option:t,locale:n})=>{if(!e)return;let r=iOe(e,t);if(r){if(n&&n!==`_default`&&Object.hasOwn(r,n))return r[n];let e=Oc.current?rOe(r,Oc.current):void 0;if(e!==void 0)return r[e]}return e[t]},FR=({config:e,locale:t})=>PR({config:e,option:`label`,locale:t})||e.name||``,aOe=({fieldConfig:e,locale:t,defaultLocale:n})=>{let r=iOe(e,`default`);if(!r)return e;let{default_localized:i,...a}=e,o=e.i18n===`duplicate`?n:t;return Object.hasOwn(r,o)?{...a,default:r[o]}:a},oOe=[`title`,`name`,`date`,`author`,`description`],sOe=[`ascending`,`descending`],cOe=[`date`,`commit_date`],IR={slug:String,commit_author:String,commit_date:Date,_summary:String,_manual:String},LR=Object.keys(IR),lOe=e=>e?{keys:[e,...oOe.filter(t=>t!==e)],defaultKey:e}:{keys:[...oOe]},RR=({collection:e,isCommitAuthorAvailable:t,isCommitDateAvailable:n})=>{let{name:r,identifier_field:i,sortable_fields:a,summary:o,_i18n:{i18nEnabled:s,canonicalSlug:c}}=e,l=a?ZDe(a):lOe(i),u=[...l.keys],{defaultKey:d,defaultOrder:f}=l;o&&u.unshift(`_summary`);let p=s?[...LR,c.key]:LR;u=eO(u).filter(e=>!!e&&(p.includes(e)||!!Fj({collectionName:r,keyPath:e})));let m=u.includes(`commit_author`),h=u.includes(`commit_date`),g=rk(e);t&&!g?!u.includes(`author`)&&!m&&u.push(`commit_author`):m&&(u=u.filter(e=>e!==`commit_author`)),n&&!g?!u.includes(`date`)&&!h&&u.push(`commit_date`):h&&(u=u.filter(e=>e!==`commit_date`));let _=sR(e);return(_||rk(e))&&(u=u.filter(e=>e!==_),u.includes(`_manual`)||u.unshift(`_manual`),d=`_manual`,f=`ascending`),d=d&&u.includes(d)?d:u[0],f??=d?`ascending`:void 0,{keys:u,default:{key:d,order:f}}},uOe=({key:e,fieldConfig:t})=>e in IR?IR[e]:t?.widget===`boolean`?Boolean:t&&VN(t)?Number:String,zR=({collection:e,key:t})=>{if([...LR,`name`].includes(t))return Y(`sort_keys.${t}`);if(t.includes(`.`))return t.split(`.`).map((t,n,r)=>{if(Ej(t))return;let i=r.slice(0,n+1).join(`.`);return PR({config:Fj({collectionName:e.name,keyPath:i}),option:`label`})||t}).filter(Boolean).join(` – `);let n=e.fields?.find(({name:e})=>e===t);return PR({config:n,option:`label`})||t},BR=VO(()=>{let e=IA.current;if(e?._type!==`entry`)return[];let{current:t}=qA,{keys:n}=RR({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)});return n.map(t=>{let n=Fj({collectionName:e.name,keyPath:t}),r={key:t,label:zR({collection:e,key:t})};return uOe({key:t,fieldConfig:n})===Number&&(r.type=`number`),r})}),dOe=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},fOe=new ar,pOe=RegExp(`<(?:br|hr)\\b[^>]*>|`,`gi`),mOe=e=>pR(_t(fOe.parse(e).replaceAll(pOe,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),hOe=1e3,gOe=[`title`,`summary`,`description`],_Oe=e=>e==null||e===``,vOe=({key:e,type:t,collection:n,locale:r,collectionName:i,dateFieldConfig:a,isMarkdownField:o})=>e===`_summary`?e=>_R(n,e,{locale:r,useTemplate:!0}):a?t=>{let n=xN(qR({entry:t,locale:r,collectionName:i,key:e}),a,r)?.getTime()??NaN;return Number.isNaN(n)?void 0:n}:t===String?t=>{let n=qR({entry:t,locale:r,collectionName:i,key:e});if(_Oe(n))return;let a=String(n);return o?dOe(a.slice(0,hOe)):a}:t===Boolean?t=>+(qR({entry:t,locale:r,collectionName:i,key:e})===!0):t=>{let n=qR({entry:t,locale:r,collectionName:i,key:e}),a=_Oe(n)?NaN:Number(n);return Number.isNaN(a)?void 0:a},VR=({collection:e,key:t,locale:n})=>{let{name:r}=e,i=Fj({collectionName:r,keyPath:t}),a=uOe({key:t,fieldConfig:i}),o=i?.widget===`datetime`?i:void 0;return{getSortKey:vOe({key:t,type:a,collection:e,locale:n,collectionName:r,dateFieldConfig:o,isMarkdownField:uk.includes(i?.widget??``)||gOe.includes(t)}),isStringType:!o&&a===String}},yOe=(e,t)=>{let n=e.findIndex(e=>Pk(t,e));return n>-1&&e.unshift(e.splice(n,1)[0]),e},bOe=(e,t,{key:n,order:r}={})=>{let i=[...e];if(n===void 0)return i;let{_i18n:{defaultLocale:a}}=t,{getSortKey:o,isStringType:s}=n===`_manual`||n===sR(t)?{getSortKey:cR(t),isStringType:!1}:VR({collection:t,key:n,locale:a});return ER(i,o,s,r),yOe(i,t)},xOe=({collection:e,key:t,locale:n})=>{if(t===`_manual`||t===sR(e))return{getSortKey:cR(e),isStringType:!1};let{defaultLocale:r}=e._i18n,i=VR({collection:e,key:t,locale:n}),a=n===r?i:VR({collection:e,key:t,locale:r});return{getSortKey:e=>e.locales[n]?i.getSortKey(e):a.getSortKey(e),isStringType:i.isStringType}},SOe=({groups:e,collection:t,sortBy:n,locale:r})=>{let{field:i,direction:a}=n,{getSortKey:o,isStringType:s}=xOe({collection:t,key:i,locale:r}),c=a===`descending`?-1:1,l=e.flatMap(({refEntry:e,options:t})=>{let n=o(e);return t.map(e=>({option:e,sortKey:n}))});return l.sort((e,t)=>{if(e.sortKey!==t.sortKey){if(e.sortKey===void 0)return 1;if(t.sortKey===void 0)return-1;let n=GDe(e.sortKey,t.sortKey,s);if(n)return n*c}return VE(e.option.label,t.option.label)}),l.map(({option:e})=>e)},COe=new Map,wOe=100,HR=new Set,TOe=new WeakMap,EOe=(e,t,n=[])=>{if(!n.length)return e;let r=TOe.get(e);r||(r=new WeakMap,TOe.set(e,r));let i=r.get(n);if(i?.count===n.length)return i.entries;let a=n.filter(e=>e.collectionName===t).map(({entry:e})=>e),o=a.length?[...e,...a]:e;return r.set(n,{count:n.length,entries:o}),o},DOe=({locale:e,fieldConfig:t,refEntries:n,entryFilters:r=[],pendingEntries:i=void 0})=>{let{collection:a,file:o}=t,s=VA(a);if(!s)return[];let{_type:c,_i18n:{defaultLocale:l}}=s,u=uR(c===`entry`?s:void 0),d=SDe(t,u);return BDe({refEntries:n,collection:s,locale:e,fileName:o,entryFilters:r,defaultLocale:l}).map(({refEntry:t,content:n})=>({refEntry:t,options:FDe({refEntry:t,content:n,collection:s,templates:d,fileName:o,locale:e,identifierField:u,pendingEntries:i})}))},OOe=e=>DOe(e).flatMap(({options:e})=>e),kOe=({collection:e,file:t})=>{if(t){let n=ej(e,t);return n?[n]:[]}return aR(e)},UR=({locale:e,fieldConfig:t,refEntries:n,currentLocaleValues:r=void 0,currentSlug:i=void 0,pendingEntries:a=void 0})=>{let{collection:o,file:s,filters:c,sort_by:l}=t,u=zDe(c??[],r,i),d=JSON.stringify(u.map(({values:e})=>e)),f=`${e}|${`${KEe(t)}|${KEe(n)}`}|${a?.length??0}|${d}`;return HR.has(f)?[]:uA(COe,f,()=>{HR.add(f);try{let r=VA(o);if(r&&!s&&l?.field)return SOe({groups:DOe({locale:e,fieldConfig:t,refEntries:n,entryFilters:u,pendingEntries:a}),collection:r,sortBy:l,locale:e});let i=!s&&BEe(r),c=OOe({locale:e,fieldConfig:t,refEntries:i?lR(n,r):n,entryFilters:u,pendingEntries:a});return s||i?c:c.sort((e,t)=>VE(e.label,t.label))}finally{HR.delete(f)}},wOe)},WR=({locale:e,fieldConfig:t,refEntry:n,pendingEntries:r=void 0})=>OOe({locale:e,fieldConfig:t,refEntries:[n],pendingEntries:r}),AOe=({fieldConfig:e,valueMap:t,keyPath:n,locale:r,pendingEntries:i=void 0})=>{let{multiple:a,collection:o}=e,s=UEe(UR({locale:r,fieldConfig:e,refEntries:EOe(aR(o),o,i),pendingEntries:i})),c=e=>s.get(e)||e;return a?TO(t,n).map(e=>c(t[e])):c(t[n])},jOe=new Map,MOe=1e3,NOe=new WeakMap,POe=e=>lA(NOe,e,()=>JSON.stringify(e)),FOe=({fieldConfig:e,valueMap:t,keyPath:n})=>{let{multiple:r,options:i}=e,a=$D(i),o;r&&(o=TO(t,n).map(e=>t[e]));let s=`${n}|${POe(i)}|${JSON.stringify(r?o:t[n])}`,c=e=>i.find(t=>t.value===e)?.label||e;return uA(jOe,s,()=>{if(r)return a?o.map(c):o;let e=t[n];return a?c(e):e},MOe)},GR=e=>E(e)?e.value:e,IOe=({fieldConfig:e,value:t})=>e.options.some(e=>GR(e)===t),LOe=({fieldConfig:e,currentValue:t})=>{let{options:n,multiple:r=!1}=e,i=$D(n),a=e=>i&&n.find(t=>t.value===e)?.label||String(e);return r?Array.isArray(t)?t.map(a).sort():[]:t===void 0||t===null&&!IOe({fieldConfig:e,value:null})?[]:[a(t)]},ROe=e=>e===null?`number`:typeof e,zOe=e=>e===void 0||typeof e==`string`?``:null,BOe=e=>uk.includes(e?.widget),KR=({collectionName:e,fileName:t,componentName:n=void 0,valueMap:r={},keyPath:i,locale:a,transformations:o,isIndexFile:s=!1,pendingEntries:c=void 0,plainText:l=!1})=>{let u=Fj({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,isIndexFile:s}),d=Object.hasOwn(r,i)?r[i]:void 0;if(d===void 0&&o?.length)return``;if(u?.widget===`datetime`&&(o?.some(({method:e})=>e===`date`)||(d=FN({locale:a,fieldConfig:u,currentValue:d}))),u?.widget===`relation`&&(d=AOe({fieldConfig:u,valueMap:r,keyPath:i,locale:a,pendingEntries:c})),u?.widget===`select`&&(d=FOe({fieldConfig:u,valueMap:r,keyPath:i})),u?.widget===`list`){let{field:o}=u,{fields:f}=u,{types:p}=u;if(!(f||p)){let u=TO(r,i);d=SA(a).format((o?u.map(i=>KR({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,locale:a,isIndexFile:s,pendingEntries:c,plainText:l})):u.map(e=>r[e]).filter(e=>typeof e==`string`)).filter(e=>!!e))}}if(u&&VN(u)&&d!=null&&d!==``){let e=Number(d);Number.isNaN(e)||(d=IN(yA(a)).format(e))}return l&&BOe(u)&&typeof d==`string`&&(d=mOe(d)),Array.isArray(d)&&(d=SA(a).format(d)),o?.length&&(d=TN({fieldConfig:u,value:d,transformations:o,locale:a})),String(d??``)},VOe=({valueMap:e,locale:t,keyPath:n,keyPathPrefix:r,getFieldArgs:i,plainText:a=!1})=>{let o=[`${n}.title`,`${n}.name`,...xO(e,r)].find(t=>{let n=e[t];if(!t.startsWith(r)||!(Uk(n)||typeof n==`number`&&!Number.isNaN(n)))return!1;let a=Fj({...i,keyPath:t});return!!a&&a.widget!==`hidden`});return o?KR({...i,keyPath:o,locale:t,plainText:a}):``},qR=({entry:e,locale:t,collectionName:n,key:r,resolveRef:i=!0})=>{let{slug:a,locales:o,commitAuthor:s,commitDate:c}=e;if(r===`slug`)return a;if(r===`commit_author`)return mR(s);if(r===`commit_date`)return c;let{content:l}=o[t]??{};if(l===void 0)return;let u=VA(n);if(!u)return;let d=Fj({collectionName:n,keyPath:r,isIndexFile:Pk(u,e)});if(i&&d?.widget===`relation`)return AOe({fieldConfig:d,valueMap:l,keyPath:r,locale:t});if(d&&(d.widget===`list`||Mj(d))){let e=TO(l,r);if(e.length)return e.map(e=>l[e])}let f=Object.hasOwn(l,r)?l[r]:void 0;if(f===void 0&&(d?.widget===`object`||d?.widget===`list`)){let e=xO(l,`${r}.`);if(e.length)return e.map(e=>l[e])}return f},HOe=/\s*(?:(?\d+(?:\.\d+)?|\.\d+)|(?\0)|(?[A-Za-z_]\w*)|(?[-+*/%(),]))/y,UOe=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/i,JR=e=>e.reduce((e,t)=>e+t,0),YR={abs:{minArgs:1,maxArgs:1,fn:Math.abs},ceil:{minArgs:1,maxArgs:1,fn:Math.ceil},floor:{minArgs:1,maxArgs:1,fn:Math.floor},round:{minArgs:1,maxArgs:2,fn:(e,t=0)=>kj(e,Math.trunc(t))},avg:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?JR(e)/e.length:void 0},count:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length,anyValue:!0},max:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.max(...e):void 0},min:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.min(...e):void 0},sum:{minArgs:1,maxArgs:1/0,aggregate:JR}},WOe=100,GOe=new Map,KOe=e=>{let t=[],n=new RegExp(HOe),r=0,i=e.trimEnd().length;for(;n.lastIndex{let t=0,n=new Set,r=n=>{let r=e[t];return r?.type===`punctuator`&&r.value===n&&(t+=1,!0)},i,a=(e,t)=>{let n=t();for(;n;){let i=e.find(r);if(!i)break;let a=t();n=a?{type:`binary`,operator:i,left:n,right:a}:void 0}return n},o=()=>{let e=[];if(r(`)`))return e;do{let t=i();if(!t)return;e.push(t)}while(r(`,`));return r(`)`)?e:void 0},s=()=>{let a=e[t];if(a?.type===`number`||a?.type===`tag`)return t+=1,a;if(a?.type===`name`){t+=1;let{name:e}=a,i=Object.hasOwn(YR,e)?YR[e]:void 0,s=i&&r(`(`)?o():void 0;return!i||!s||s.lengthi.maxArgs?void 0:(i.aggregate&&s.forEach(e=>{e.type===`tag`&&n.add(e.index)}),{type:`call`,name:e,args:s})}if(r(`(`)){let e=i();return e&&r(`)`)?e:void 0}},c=()=>{let e=[`-`,`+`].find(r);if(!e)return s();let t=c();return t?{type:`unary`,operator:e,operand:t}:void 0},l=()=>a([`*`,`/`,`%`],c);i=()=>a([`+`,`-`],l);let u=i();return{tree:t===e.length?u:void 0,allItemsTagIndexes:n}},XR=e=>uA(GOe,e,()=>{let{tags:t,literals:n}=FM(e),r=KOe(n.join(`\0`)),{tree:i,allItemsTagIndexes:a}=r?qOe(r):{tree:void 0,allItemsTagIndexes:new Set};return{tree:i,tags:t.map((e,t)=>({content:e,allItems:a.has(t)}))}},WOe),ZR=e=>String(e??``).trim(),QR=e=>{let t=ZR(e);return UOe.test(t)?Number(t):void 0},JOe=e=>!ZR(e),YOe=(e,t,n,r)=>{let i=[];for(let a of t){let t=a.type===`tag`?n[a.index]:void 0;if(Array.isArray(t))for(let n of t.filter(e=>!JOe(e))){let t=e.anyValue?0:QR(n);if(t===void 0)return;i.push(t)}else{let e=r(a);if(e===void 0)return;i.push(e)}}return e.aggregate(i)},$R=(e,t)=>{if(e.type===`number`)return e.value;if(e.type===`tag`)return t[e.index];if(e.type===`unary`){let n=$R(e.operand,t);return n===void 0?void 0:e.operator===`-`?-n:n}if(e.type===`call`){let n=YR[e.name];if(n.aggregate)return YOe(n,e.args,t,e=>$R(e,t));let r=e.args.map(e=>$R(e,t));return r.includes(void 0)?void 0:n.fn(...r)}let n=$R(e.left,t),r=$R(e.right,t);if(n!==void 0&&r!==void 0)switch(e.operator){case`+`:return n+r;case`-`:return n-r;case`*`:return n*r;case`/`:return n/r;default:return n%r}},XOe=(e,t)=>{let{tree:n,tags:r}=XR(e);if(!n)return;let i=$R(n,r.map(({content:e,allItems:n})=>n?[t(e,{allItems:n})].flat():QR(t(e,{allItems:n}))));return i!==void 0&&Number.isFinite(i)?i:void 0},ZOe=new WeakMap,ez=e=>{let t=e.split(`.`).findLast(Ej);return t===void 0?void 0:Number(t)},tz=e=>Object.hasOwn(Ck,e),nz=e=>{let{tags:t,literals:n}=FM(e),r=t.map(e=>wN(e).value),i=n.map(LE),a=r.findIndex(e=>!tz(e)),o=r.findLastIndex(e=>!tz(e)),s=(e,t)=>r.slice(e,t).map((t,n)=>`${i[e+n]}(${Ck[t].pattern})`).join(``)+i[t],c=a===-1?s(0,r.length):`${s(0,a)}[\\s\\S]*${s(o+1,r.length)}`;return{uuidTags:r.map((e,t)=>({tagName:e,extractable:a===-1||to})).filter(({tagName:e})=>tz(e)),regex:RegExp(`^${c}$`,`i`)}},rz=(e=``)=>nz(e).uuidTags.length>0,QOe=({valueTemplate:e,keyPath:t,valueMap:n})=>{let{uuidTags:r,regex:i}=nz(e);if(!r.length)return[];let a=n[t],o=typeof a==`string`?a.match(i)?.slice(1):void 0;if(o?.length===r.length)return o;let s=lA(ZOe,n,()=>new Map),c=s.get(t);if(c?.length!==r.length&&(c=r.map(({tagName:e})=>Jc(Ck[e].length)),s.set(t,c)),!o)return c;let l=0;return r.map(({extractable:e},t)=>{if(!e)return c[t];let n=o[l];return l+=1,n})},$Oe=(e,t)=>{let n=zN(t),r=!RN(t),i=e===void 0?void 0:(r?Math.round(e):Dj(e))+0;return i===void 0||r&&!Number.isSafeInteger(i)?n?``:null:n?String(i):i},eke=({value:e,fieldConfig:t,canonicalLocale:n})=>{let r=String(e??``),i=Number(e);return BN(t)&&r.trim()&&Number.isFinite(i)?IN(n).format(i):r},tke=new WeakMap,nke=({fieldKeyPath:e,ownKeyPath:t,allItems:n,valueMap:r})=>{let i=e.split(`.`),a=i.lastIndexOf(`*`);if(a===-1)return[e];let o=t.split(`.`),s=[[]];return i.forEach((e,t)=>{e===`*`?s=s.flatMap(e=>{let i=n&&t===a,s=o[t];return!i&&Ej(s??``)&&e.every((e,t)=>e===o[t])?[[...e,s]]:n?AN(lA(tke,r,()=>kN(r)),e.join(`.`)).map(t=>[...e,String(t)]):[]}):s.forEach(t=>t.push(e))}),s.map(e=>e.join(`.`))},rke=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(t)).map(([e,n])=>[e.slice(t.length),n])),ike=(e,t)=>{let{keyPath:n,valueMap:r,keyPathPrefix:i,componentName:a,collectionName:o,fileName:s,isIndexFile:c}=e;return i?a&&Fj({collectionName:o,fileName:s,isIndexFile:c,keyPath:t,componentName:a})?(e.componentValues??=rke(r,i),{valueMap:e.componentValues,componentName:a,ownKeyPath:n.slice(i.length)}):{valueMap:e.entryValueMap,ownKeyPath:i.split(`:`)[0]}:{valueMap:r,ownKeyPath:n}},ake=(e,t)=>!!e&&(BN(e)||t&&(e.widget===`select`||e.widget===`relation`)),iz=(e,t,n,r)=>{let{locale:i,collectionName:a,fileName:o,isIndexFile:s,numeric:c,listFormatter:l}=e,{valueMap:u,componentName:d}=n,f={collectionName:a,fileName:o,componentName:d,valueMap:u,keyPath:t,isIndexFile:s},p=u[t],m=p!==void 0;if(m){let e=Fj(f);if(ake(e,c)){let t=String(p??``);return r.length?TN({fieldConfig:e,value:t,transformations:r,locale:i}):t}}let h=KR({...f,locale:i,transformations:m?r:void 0}),g=Array.isArray(h)?l.format(h):String(h);return!m&&r.length?TN({value:g,transformations:r,locale:i}):g},oke=({fieldConfig:e,keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o=!1,keyPathPrefix:s=``,entryValueMap:c={}})=>{let{value:l=``}=e,u=BN(e);if(!u&&l===`{{index}}`)return ez(t)??``;let d=u?[]:QOe({valueTemplate:l,keyPath:t,valueMap:r}),f=0,p={keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o,keyPathPrefix:s,entryValueMap:c,componentName:s?r[`${s}__sc_component_name`]:void 0,numeric:u,listFormatter:SA(n)},m=(e,{allItems:r=!1}={})=>{let{value:i,transformations:a}=wN(e);if(i===`index`){let e=String(ez(t)??``);return r?[e]:e}let o=MM(a,e=>tz(wN(e).value)?``:m(e));if(Sk.test(i)){let e=wk(i),t=ike(p,e),n=nke({fieldKeyPath:e,ownKeyPath:t.ownKeyPath,allItems:r,valueMap:t.valueMap});return r?n.map(e=>iz(p,e,t,o)):iz(p,n[0]??e,t,o)}if(!tz(i))return r?[]:``;let s=d[f];return f+=1,o.length&&(s=TN({value:s,transformations:o,locale:n})),r?[s]:s};return u?$Oe(XOe(l,m),e):PM(l,(e,t)=>m(t))},ske=B(`

`);function cke(e,t){O(t,!0);let n=A(()=>yA(t.locale));var r=ske(),i=F(r,!0);R((e,t)=>{q(r,`lang`,z(n)),q(r,`dir`,e),W(i,t),r.dir=r.dir},[()=>bA(t.locale),()=>eke({value:t.currentValue,fieldConfig:t.fieldConfig,canonicalLocale:z(n)})]),U(e,r),k()}var az=(e,t)=>{let n=t?.media_libraries?.[e];if(n!=null)return n;let{media_library:r}=t??{},i=r?.name??qO.current?.media_library?.name;return r&&i===e?r:void 0},oz=(e,t)=>{if(t===void 0)return e;if(!t||!e)return t;let n={...e,...t};return Object.entries(t).forEach(([t,r])=>{E(r)&&E(e[t])&&(n[t]={...e[t],...r})}),n},sz=(e,t)=>oz(az(e,qO.current),az(e,t)),cz=zO(!1),lz=zO(!1),uz=zO(!1),dz=new URL(`https://console.cloudinary.com/console/media_library`).origin,lke=[`cloud_name`,`api_key`,`username`,`timestamp`,`signature`,`integration`,`use_saml`,`saml_iframe_support`],uke=[`integration`,`inline_container`,`z_index`,`multiple`,`max_files`,`default_transformations`,`insert_caption`,`remove_header`,`folder`,`search`,`collection`,`asset`,`transformation`,`sandboxNotAllowedAttributes`,`theme`],dke=(e=qO.current)=>az(`cloudinary`,e),fz=new Map,pz=e=>{let t=e?JSON.stringify(e):`global`,n=fz.get(t);if(n)return n;let r=sz(`cloudinary`,e)||{},i={...r,config:{...r.config}};return fz.set(t,i),i},mz=e=>{let t=sz(`cloudinary`,e),{cloud_name:n,api_key:r}=(t?t.config:void 0)??{};return{cloudName:n,apiKey:r}},fke={serviceType:`cloud_storage`,serviceId:`cloudinary`,serviceLabel:`Cloudinary`,serviceURL:`https://cloudinary.com/`,showServiceLink:!0,hotlinking:!0,authType:`widget`,developerURL:`https://cloudinary.com/documentation/`,apiKeyURL:`https://console.cloudinary.com/settings/api-keys`,apiKeyPattern:/^[A-Za-z0-9_-]{15,}$/,isEnabled:e=>{let{cloudName:t,apiKey:n}=mz(e);return!!(t&&n)},isAssetURL:e=>{let{cloudName:t}=mz();return!!t&&e.startsWith(`https://res.cloudinary.com/${t}/`)}},hz=(e,{noopener:t=!0}={})=>{if(!e)return null;let n=t?`noopener,noreferrer`:``;return window.open(e,`_blank`,n)},pke=B(`
`,1);function gz(e,t){O(t,!0);let n=J(t,`multiple`,3,!1),r=J(t,`hidden`,3,!1),i=A(()=>pz(t.fieldConfig)),a=null,o=()=>{let{folder:e}=z(i).config,r={...Object.fromEntries(Object.entries(z(i).config).filter(([e])=>uke.includes(e))),multiple:n(),max_files:t.fieldConfig?.max??z(i).config.max_files??20,folder:{path:e?.path??``,resource_type:e?.resource_type??t.kind}},o={type:`ML_WIDGET_SHOW`,data:{mlId:a?.dataset?.mlId,config:r}};console.debug(`Cloudinary Panel sending message:`,o),a?.contentWindow?.postMessage(JSON.stringify(o),dz)},s=({assets:e})=>{let{output_filename_only:n=!1,use_transformations:r=!0}=z(i),a=e.map(e=>{let t=e.secure_url;if(n){let{public_id:t,format:n}=e;return{url:n?`${t}.${n}`:t}}return r?{url:e.derived?.[0]?.secure_url??t}:{url:t}});t.onSelect(a)},c=({origin:e,data:t})=>{if(e===dz){if(typeof t==`string`)try{t=JSON.parse(t)}catch{return}E(t)&&(console.debug(`Cloudinary Panel received message:`,t),t.type===`login`&&t.consoleDomain&&(cz.current=!0,uz.current=!0),t.type===`consoleLoaded`&&(lz.current=!0),t.type===`ML_WIDGET_INSERT_DATA`&&(uz.current=!1,s(t.data)),t.type===`ML_WIDGET_HIDE`&&(uz.current=!1))}};xs(()=>(a=document.querySelector(`iframe#cloudinary-iframe`),window.addEventListener(`message`,c),()=>{window.removeEventListener(`message`,c)})),L(()=>{z(i)&&lz.current&&o()});var l=H(),u=P(l),d=e=>{hO(e,{children:(e,t)=>{var n=H(),r=P(n),i=e=>{{let t=A(()=>Y(`cloud_storage.cloudinary.open_library`));ul(e,{variant:`primary`,get label(){return z(t)},onclick:()=>{uz.current=!0}})}},a=e=>{var t=pke(),n=P(t);{let e=A(()=>Y(`cloud_storage.cloudinary.activate.button_label`));ul(n,{variant:`primary`,get label(){return z(e)},onclick:()=>{hz(`https://console.cloudinary.com/console/media_library/cms_login?cms=true`,{noopener:!1})}})}var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`cloud_storage.cloudinary.activate.description`)]),U(e,t)};G(r,e=>{cz.current?e(i):e(a,-1)}),U(e,n)},$$slots:{default:!0}})};G(u,e=>{r()||e(d)}),U(e,l),k()}var mke=B(``),hke=B(`/`,1),gke=B(``),_ke={hash:`svelte-1ngvthn`,code:`.name.svelte-1ngvthn {color:var(--sui-tertiary-foreground-color);strong {color:var(--sui-primary-foreground-color);font-weight:var(--sui-font-weight-normal);}}`};function _z(e,t){O(t,!0),K(e,_ke);let n={ALLOWED_TAGS:[`wbr`],ALLOWED_ATTR:[]},r=J(t,`children`,3,void 0),i=A(()=>t.path?zE(t.path).split(`/`):t.caption?[t.caption]:[]),a=e=>_t(e.replace(/([-_.])/g,`$1`),n);var o=H(),s=P(o),c=e=>{var t=gke(),n=N(t);Kc(n,{lines:2,children:(e,t)=>{var n=H();ko(P(n),19,()=>z(i),(e,t)=>`${e}-${t}`,(e,t,n)=>{var r=H(),o=P(r),s=e=>{var n=mke();No(n,()=>a(z(t)),!0),D(n),U(e,n)},c=e=>{var n=hke();No(P(n),()=>a(z(t))),Kr(),U(e,n)};G(o,e=>{z(n)===z(i).length-1?e(s):e(c,-1)}),U(e,r)}),U(e,n)},$$slots:{default:!0}}),Po(I(n,2),()=>r()??Tr),D(t),R(()=>t.dir=t.dir),U(e,t)};G(s,e=>{z(i).length&&e(c)}),U(e,o),k()}var vz=e=>{{let t=A(()=>Dc()?`chevron_left`:`chevron_right`);Ac(e,{get name(){return z(t)},class:`separator`})}},yz=(e,t)=>{let n=()=>(t?.()).label,r=()=>(t?.()).onClick;var i=yke(),a=P(i);ul(a,{variant:`link`,class:`crumb`,get onclick(){return r()},children:(e,t)=>{var r=vke(),i=F(r,!0);R(()=>W(i,n())),U(e,r)},$$slots:{default:!0}}),vz(I(a,2)),U(e,i)},vke=B(` `),yke=B(` `,1),bke=B(` `,1),xke=B(` `,1),Ske=B(``),Cke={hash:`svelte-r6xh9b`,code:`.breadcrumb.svelte-r6xh9b {position:relative;display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap; +var yDe=/(?{let n=uL(t,e,SDe)?t:iL(e);return Object.assign(new Date(0),{toISOString:()=>n})},TDe=e=>{let t=new Map,n=new Set;return e.replace(xDe,` `).match(bDe)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&aL(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},EDe=e=>{let t=new Map;return e.match(yDe)?.forEach(e=>{let n=new vL(e);n.isValid()&&aL(t,n.toISOString(),e)}),t},DDe=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof vL){let i=t.toISOString();r??=EDe(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=rL(e)?TDe(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??iL(t)})):(Array.isArray(t)||D(t))&&Object.entries(t).forEach(([e,t])=>{a(t,oL(o,e))})};return a(t,``),n},ODe=({path:e,str:t,parsed:n})=>{cL(e,DDe(t,n))},kDe=(e,t)=>e===t||e instanceof vL&&e.toISOString()===t,ADe=(e,{value:t,source:n})=>typeof t==`number`?e===t?wDe(t,n):void 0:kDe(e,t)?new CDe(t,n):void 0,jDe=(e,t)=>lL(e,t,ADe),MDe=(e,t,n)=>IEe(e,JEe(e,t,n),n),NDe=(e,t)=>{if(t===void 0||!rL(e))return pL(e)?JSON.parse(e,JEe):JSON.parse(e);let{value:n,sourceMap:r}=LEe(JSON.parse(e,MDe));return cL(t,r),n},PDe=(e,t)=>{let n=mL(cDe(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&ODe({path:t,str:e,parsed:n}),Sr(n)},FDe=(e,t,n)=>{let r=EEe(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return cL(n,FEe(r)),r.toJS(t)},IDe=(e,t,n)=>{let r=pL(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&rL(e)?FDe(e,i,n):DEe(e,i);return r?mL(a):a},LDe=e=>{let t=e.split(` +`,1)[0].trim();return Uk.find(e=>t===Hk[e][0])??`yaml-frontmatter`},RDe=/^\{\n(?\{[\s\S]*?\})\n\}(?:\n\n(?[\s\S]*))?$/,zDe=(e,t)=>{let n=e.trim();return NDe(n.startsWith(`{`)?n:`{${n}}`,t)},BDe={yaml:(e,t)=>IDe(e,void 0,t),toml:PDe,json:NDe},VDe={...BDe,json:zDe},HDe=new Map,UDe=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=IA({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?PA({format:r,delimiter:s}):s)??Hk[`yaml-frontmatter`],f=JE(u),p=JE(d),m=mA(HDe,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(RDe)?.groups:void 0)??h.match(m)?.groups;if(!g)return{content:{[c]:i},hasFrontMatter:!1};let{head:_=``,body:v}=g,y=Uk.includes(r)?qk(r):void 0,b=y?VDe[y](_,a):{};return(!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{content:{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}},hasFrontMatter:!0}},WDe=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=YA(t),i=r&&n?ij(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&Rk(r,e),{format:o}=IA({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},GDe=e=>{try{return!!IO.get(WDe(e).format)?.parser}catch{return!1}},KDe=async({text:e=``,path:t,folder:n})=>{let r=WDe({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;nL.delete(t),dL.delete(t),e=e.trimEnd().replace(/\r\n?/g,` +`);let c=e.trimStart(),l=IO.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{let n=s===`frontmatter`;if(n&&(s=LDe(c)),Uk.includes(s)){let{content:r,hasFrontMatter:c}=UDe({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});return n&&c&&dL.set(t,s),r}let r=qk(s);if(r)return BDe[r](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw IO.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},qDe=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await Zc()},JDe=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i=n&&(await qDe(),r=performance.now()),await t(e[i])},AL=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},jL=(e,{lastInFirstOut:t=!1}={})=>{let n=0,r=[];return Object.assign(async(i,{key:a=void 0}={})=>{n>=e?await new Promise(e=>{r.push({start:e,key:a})}):n+=1;try{return await i()}finally{let e=t?r.pop():r.shift();e?e.start():--n}},{prioritize:e=>{let n=e===void 0?-1:r.findIndex(t=>t.key===e);if(n>-1){let[e]=r.splice(n,1);t?r.push(e):r.unshift(e)}}})},YDe=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),XDe=/{{([^]*?)}}/,ZDe=new Map,ML=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=mA(ZDe,t,()=>{let e=t.split(XDe).map((e,t)=>t%2==0?JE(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},QDe=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>QDe(e,t));return t.delete(e),n},$De=()=>`${xr}\n${tk.current}`,eOe=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),format:dL.get(t),valueSources:nL.get(t)})}catch{}},tOe=async(e,t,n)=>{let{path:r,parsed:i}=e,a=$De(),o=GDe(e);if(i?.key===a&&!o)return i.format?dL.set(r,i.format):dL.delete(r),i.valueSources?nL.set(r,i.valueSources):nL.delete(r),i.content;try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await KDe(e);if(QDe(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!pL(e.text)&&eOe({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},nOe=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!D(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},rOe=(e,t,n)=>{if(!D(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{D(e[t])&&(a[t]=e[t])}),a},iOe=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return pM(t,`list`)?nOe({...r,validate:EP(t[0])?e=>D(e)||Array.isArray(e):Array.isArray}):pM(t,`keyvalue`)?nOe({...r,validate:e=>D(e)&&Object.values(e).every(e=>typeof e==`string`)}):D(e)?e:void 0},aOe=(e,t,n)=>{let r=iOe(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,OP(n,t,!0)])):OP(r,t,!0)},oOe=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:YDe(e)?!(t||Lk(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||sA(n)===`_index`):!1,sOe=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},cOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||ML({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:Aj(t)}},lOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||ML({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>D(t[e])).map(e=>[e,{slug:s,path:n,content:Aj(t[e])}]))},uOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||ML({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:Aj(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},NL=new Map,PL=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?rOe(t,s,c):t,d=u?aOe(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?lOe({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):cOe({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},dOe=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(NL.set(a,n),n.forEach((t,n)=>{let i=PL({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(NL.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},fOe=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await tOe(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=aj(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&NL.set(o,null);return}if(!u)return;if(f){dOe({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&Rk(u,o)&&Lk(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?rOe(a,v,y):a;if(!C)return;let w=VA(b),T=aOe(C,S,w);if(!T||oOe(o,l,u,h,g))return;let ee=HA(b),{subPath:E,locale:te}=sOe({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!E||ee&&!te)return;let ne={id:``,slug:``,subPath:E,locales:{},...s},re={entry:ne,rawContent:T,path:o,fileName:l,subPath:E,subPathTemplate:h};if(!_)cOe(re);else if(w)lOe({...re,allLocales:v});else if(uOe({...re,locale:te,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(ne)},FL=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await JDe(e,async e=>{try{await fOe({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=Qc(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},pOe=/^\/(?.+)\/(?[dgimsuvy]*)$/,mOe=/[gy]/g,hOe=e=>{try{return RegExp(``,e),!0}catch{return!1}},IL=e=>{if(e instanceof RegExp){let t=e.flags.replace(mOe,``);return t===e.flags?e:new RegExp(e.source,t)}if(typeof e==`string`&&e){let{pattern:t,flags:n}=e.match(pOe)?.groups??{};if(t!==void 0)try{return IL(new RegExp(t,n))}catch{if(hOe(n))return}try{return new RegExp(e)}catch{}}},LL=WO([]),gOe=KO(()=>new Set(LL.current.map(e=>e.id))),_Oe=new WeakMap,vOe=e=>mA(_Oe,e,()=>{let{filter:t}=e._type===`entry`?e:{},n=t?.field;if(n!==void 0)return{field:n,pattern:IL(t?.pattern),values:t?.value===void 0?[]:Array.isArray(t.value)?t.value:[t.value]}}),yOe=(e,t)=>{let n=vOe(e);if(!n||zk(e,t))return!0;let{field:r,pattern:i,values:a}=n,o=zR({entry:t,locale:e._i18n.defaultLocale,collectionName:e.name,key:r,resolveRef:!1}),s=Array.isArray(o)?o:[o??null];return i?s.some(e=>e!=null&&i.test(String(e))):s.some(e=>a.includes(e))},RL=e=>eP(e).filter(t=>!t.hide&&yOe(t,e)),zL={entrySource:void 0,folderSource:void 0,buckets:void 0,map:new Map,folderMap:new Map},bOe=()=>{if(!zL.buckets){let e=new Map;tj.current.forEach(t=>{new Set(eP(t).map(({name:e})=>e)).forEach(n=>{mA(e,n,()=>[]).push(t)})}),zL.buckets=e}return zL.buckets},xOe=e=>{let t=YA(e);return t?(bOe().get(e)??[]).filter(e=>yOe(t,e)):[]},SOe=()=>{let e=tj.current,t=ej.current;(e!==zL.entrySource||t!==zL.folderSource)&&(zL.entrySource=e,zL.folderSource=t,zL.buckets=void 0,zL.map=new Map,zL.folderMap=new Map)},BL=e=>{SOe();let t=zL.map.get(e);if(t)return t;let n=xOe(e);return zL.map.set(e,n),n},COe=(e,t)=>{let{_file:{fullPathRegEx:n=void 0,subPath:r=void 0}={}}=e._type===`entry`?e:{};if(!n)return[];let{defaultLocale:i}=e._i18n,a=new Set(t);return tj.current.flatMap(e=>{if(a.has(e))return[];let t={},o={};Object.values(e.locales).forEach(e=>{let{subPath:a,locale:s=i}=e.path.match(n)?.groups??{};a&&(t[s]={...e,slug:ML({subPath:a,subPathTemplate:r})},o[s]=a)});let s=SP(t,i);if(!s)return[];let{slug:c}=t[s],l=o[s];return[{...e,slug:c,subPath:l,locales:t}]})},VL=e=>(SOe(),mA(zL.folderMap,e,()=>{let t=YA(e),n=bOe().get(e)??[];return t?[...n,...COe(t,n)]:n})),wOe=(e,t)=>{let n=YA(e);return!n||Ik(n)===void 0?t.length:t.filter(e=>!zk(n,e)).length},TOe=e=>Lk(e)?!BL(e.name).some(t=>zk(e,t)):!1,EOe=`order`,DOe=e=>e?._type===`entry`&&(!!e.reorder||ck(e)),HL=e=>{let t=e?.reorder;if(t&&typeof e.file!=`string`)return D(t)&&typeof t.key==`string`&&t.key?t.key:EOe},OOe=e=>{let t=e?.reorder;if(D(t)&&typeof t.group==`string`&&t.group)return t.group},UL=e=>{if(ck(e))return e=>e.arrayIndex??0;let t=HL(e);if(!t)return()=>void 0;let{defaultLocale:n}=e._i18n;return e=>{let r=e.locales[n]?.content?.[t],i=typeof r==`number`||typeof r==`string`&&r.trim()?Number(r):NaN;return Number.isFinite(i)?i:void 0}},WL=(e,t)=>{let n=UL(t),r=e.map(e=>({entry:e,v:n(e)}));return r.sort((e,t)=>e.v!==void 0&&t.v!==void 0?e.v-t.v:e.v===void 0?t.v===void 0?0:1:-1),r.map(({entry:e})=>e)},GL=e=>e?.identifier_field??`title`,kOe=new WeakMap,AOe=e=>mA(kOe,e,()=>{let t=new Map;return e.forEach(({value:e,label:n})=>{t.has(e)||t.set(e,n)}),t}),jOe=new WeakMap,MOe=0,KL=e=>mA(jOe,e,()=>{let e=MOe;return MOe+=1,e}),qL=e=>IM(e)?e:e===`slug`?`{{fields.slug}}`:`{{${e}}}`,NOe=e=>{if(!e||e.widget!==`list`)return!1;let t=`fields`in e,n=`types`in e;return t||n},POe={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},FOe=new Map,IOe=e=>{let t=e??``,n=FOe.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...POe,hourCycle:`h23`,timeZone:e}),FOe.set(t,n)),n},JL=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries(IOe(t).formatToParts(e).filter(({type:e})=>e in POe).map(({type:e,value:t})=>[e,t])),LOe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ROe={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function zOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function BOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function VOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function HOe(e){return VOe(e)||zOe(e)}var UOe=document.createElement(`i`);function WOe(e){let t=`&`+e+`;`;UOe.innerHTML=t;let n=UOe.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var GOe=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function YL(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?HOe:u===`decimal`?zOe:BOe;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&LOe.includes(y)&&(_=y,v=WOe(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&WOe(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):HOe(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(KOe(e))h(7,S),C=`�`;else if(e in ROe)h(6,S),C=ROe[e];else{let t=``;qOe(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,GOe[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function KOe(e){return e>=55296&&e<=57343||e>1114111}function qOe(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var XL=e=>e?.name||e?.login||e?.email,JOe=/^#+[^\S\n\r\u2028\u2029]+(.*)$/gm,YOe=e=>{if(!e.endsWith(`}`))return e;for(let t=e.indexOf(`{#`,1);t>0&&!(t+2>=e.length-1);t=e.indexOf(`{#`,t+1))if(/\s/.test(e[t-1]))return e.slice(0,t).trimEnd();return e},XOe=e=>e.matchAll(JOe).map(([,e])=>YOe(e.trim())).find(e=>!!e)??``,ZOe=``,QOe=/<(?!\/?(?:strong|em|code)(?:\s[^>]*)?>)/g,$Oe=(e,{allowMarkdown:t=!1}={})=>(e=vr(e.replace(QOe,ZOe)),t&&(e=YL(e)),e=_t(e,{ALLOWED_TAGS:t?[`strong`,`em`,`code`]:[],ALLOWED_ATTR:[]}),t||(e=YL(e)),e.replaceAll(ZOe,t?`<`:`<`).trim()),ZL=(e,{identifierField:t=`title`,useBody:n=!0}={})=>{let r=[t,`title`,`name`,`label`].find(t=>typeof e[t]==`string`&&!!e[t].trim());return r?e[r].trim():n&&typeof e.body==`string`?XOe(e.body):``},eke=(e,t)=>{let{slug:n,entryPath:r,basePath:i,fullPathRegEx:a,locales:o,localeSuffixes:s,commitDate:c,commitAuthor:l}=t;if(e===`slug`)return n;if(e===`locales`)return o.sort((e,t)=>e.localeCompare(t)).join(`, `);if(e===`dirname`)return TP(r,{basePath:i,fullPathRegEx:a});if(e===`filename`||e===`extension`)return Ak(r,s)[e];if(e===`commit_date`)return c??``;if(e===`commit_author`)return XL(l)},QL=!1,tke=(e,t)=>{let{content:n,collectionName:r,fileName:i,isIndexFile:a,replaceSubContext:o,locale:s,fallbackSummary:c}=t,{value:l,transformations:u}=IN(e),d=kk(l),f={collectionName:r,fileName:i,valueMap:n,keyPath:d,isIndexFile:a},p=eke(l,o),m=RM(u,e=>tke(e,t));if(p===void 0&&(m.some(({method:e})=>e===`date`||e===`ternary`)?p=Object.hasOwn(n,d)?n[d]:void 0:(_M(f)?.widget===`relation`&&(QL=!0),p=RR({...f,locale:s})),d===`title`&&!p&&(p=c)),p===void 0)return``;if(p instanceof Date&&!m.length){let{year:e,month:t,day:n}=JL({date:p});return`${e}-${t}-${n}`}return m.length&&(p=LN({fieldConfig:_M({...f}),value:p,transformations:m,locale:s})),String(p)},nke=new WeakMap,rke,ike=0,ake=()=>{let e=tj.current;return e!==rke&&(rke=e,ike+=1),ike},oke=(e,t,n)=>{let r=n?ij(e,n):void 0;if(r)return{collectionFile:r,isIndexFile:!1,label:oj(r),template:r.summary};let i=zk(e,t),{label:a,summary:o}=i&&Lk(e)||{};return{isIndexFile:i,label:a,template:o}},ske=(e,t,{locale:n,useTemplate:r=!1,allowMarkdown:i=!1,template:a,useIndexFileLabel:o=!0,fileName:s}={})=>{let{_type:c,name:l}=e,{collectionFile:u,isIndexFile:d,label:f,template:p}=oke(e,t,s);if((u||d&&o)&&!(r&&a===void 0&&p))return f;let{defaultLocale:m}=(u??e)._i18n,{_file:{basePath:h,fullPathRegEx:g}={},summary:_}=c===`entry`?e:{},v=GL(c===`entry`?e:void 0),y=a??p??_,{locales:b,slug:x,commitDate:S,commitAuthor:C}=t,w=n??m,T=Object.hasOwn(b,w)?w:Object.keys(b)[0]??w,{content:ee={},path:E=``}=b[T]??{},te=ZL(ee,{identifierField:v})||f||x.replaceAll(`-`,` `);if(!r||!y)return $Oe(te,{allowMarkdown:i});let ne={content:ee,collectionName:l,fileName:u?.name,isIndexFile:d,replaceSubContext:{slug:x,entryPath:E,basePath:h,fullPathRegEx:g,locales:Object.keys(b),localeSuffixes:jk(u??e),commitDate:S,commitAuthor:C},locale:T,fallbackSummary:te};return $Oe(NM(y,(e,t)=>tke(t,ne)),{allowMarkdown:i})},$L=(e,t,n={})=>{let{locale:r,useTemplate:i=!1,allowMarkdown:a=!1,template:o,useIndexFileLabel:s=!0,fileName:c}=n,l=mA(mA(nke,t,()=>new WeakMap),e,()=>new Map),u=[r??``,i?`1`:`0`,a?`1`:`0`,o??``,s?`1`:`0`,c??``,Fc.current].join(` +`),d=ake(),f=l.get(u);if(f&&(f.generation===void 0||f.generation===d))return f.summary;let p=QL;QL=!1;let m=ske(e,t,n),h=QL;return QL=p||h,l.set(u,{summary:m,generation:h?d:void 0}),m},cke=(e,t)=>{if(!ij(e,t)?.summary)return;let n=cj(e.name,t);return n?$L(e,n,{fileName:t,useTemplate:!0,allowMarkdown:!0}):void 0},lke=(e,t)=>{let n=e?.[t];return n==null?``:String(n)},uke=(e,t,n,{stored:r=!1}={})=>{let{slug:i,locale:a,getDisplayValue:o}=t,{content:s,locales:c,defaultLocale:l}=n;if(e===`slug`)return i;if(e===`locale`)return a;let u=kk(e);return r?lke(s,u)||lke(c[l]?.content,u):o(u)||o(u,l)||``},dke=(e,t)=>{let{content:n,locales:r,defaultLocale:i,identifierField:a}=t;return ZL(n,{identifierField:a})||ZL(r[i]?.content||{},{identifierField:a})||e.slug},eR=(e,t,n,r)=>{let{label:i,value:a,searchValue:o}=e,s=!1;return t.forEach(e=>{let t=`{{${e}}}`,c=uke(e,n,r);if(a.includes(t)){let i=uke(e,n,r,{stored:!0});i||(s=!0),a=a.replaceAll(t,()=>i)}i=i.replaceAll(t,()=>c),o=o?.replaceAll(t,()=>c)??``}),{label:i.trim()||dke(n,r),value:s?``:a,searchValue:o.trim()}},tR=e=>{let t=[];return NM(e,(e,n)=>(t.push(n),``)),t},fke=(e,t)=>{let n=e.value_field,r=e.display_fields??[n??`{{${t}}}`],i=e.search_fields??r,a=qL(n??`{{slug}}`),o=r.map(qL).join(` `),s=i.map(qL).join(` `),c=bO([...tR(o),...tR(a),...tR(s)]);return{_valueField:a,_displayField:o,_searchField:s,allFieldNames:c,hasListFields:c.some(e=>e.includes(`*`))}},pke=/\.(\d+)$/,mke=(e,t)=>{let n=new Map;return e.filter(e=>e.includes(`*`)).forEach(e=>{let r=e.replace(/\.\*.*$/,``),i=_M({...t,keyPath:r});n.set(e,{baseFieldName:r,fieldConfig:i,isComplexListField:NOe(i)})}),Map.groupBy(n.entries(),([,{baseFieldName:e}])=>e)},hke=({templates:e,replacements:t,staticFieldNames:n,context:r,fallbackContext:i})=>{let{_displayField:a,_valueField:o,_searchField:s}=e,c=e=>t.reduce((e,[t,n])=>e.replaceAll(`{{${t}}}`,()=>n),e),{label:l,value:u,searchValue:d}=eR({label:c(a),value:c(o),searchValue:c(s)},n,r,i);return{label:l,value:t.some(([e,t])=>o.includes(`{{${e}}}`)&&String(t??``)===``)?``:u,searchValue:d||l}},gke=new Map,_ke=(e,t,n=t)=>Object.entries(e).filter(([e])=>t.test(e)).map(([e,t])=>{let r=e.match(n);return{index:parseInt(r[1],10),value:t}}).sort((e,t)=>e.index-t.index),vke=({baseFieldName:e,groupEntries:t,content:n,templates:r,allFieldNames:i,context:a,fallbackContext:o})=>{let s=_ke(n,mA(gke,e,()=>RegExp(`^${JE(e)}\\.\\d+$`)),pke),c=i.filter(e=>!e.includes(`*`));return s.map(({value:e})=>hke({templates:r,replacements:t.map(([t])=>[t,e]),staticFieldNames:c,context:a,fallbackContext:o}))},yke=/^(.+)\.\*\.(.+)$/,bke=new Map,xke=e=>{let t=null;return e.some(([e])=>(t=e.match(yke),!!t)),t},Ske=({groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let[,o,s]=xke(e)??[];if(!o)return[];let c=_ke(t,mA(bke,`${o}:${s}`,()=>{let e=JE(o),t=JE(s);return RegExp(`^${e}\\.([0-9]+)\\.${t}$`)})),l=r.filter(e=>!e.includes(`*`));return c.map(({index:r})=>hke({templates:n,replacements:e.flatMap(([e])=>{let[,n,i]=e.match(yke)??[];return n?[[e,t[`${n}.${r}.${i}`]??``]]:[]}),staticFieldNames:l,context:i,fallbackContext:a}))},Cke=({baseFieldGroups:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let o=[],s=!1;return e.forEach((e,c)=>{if(e.length===0)return;let[,l]=e[0],u={groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a},d=l.isComplexListField?Ske({...u}):vke({...u,baseFieldName:c});o.push(...d),s=!0}),{results:o,hasProcessedListFields:s}},wke=({templates:e,allFieldNames:t,context:n,fallbackContext:r})=>{let{_displayField:i,_valueField:a,_searchField:o}=e,{label:s,value:c,searchValue:l}=eR({label:i,value:a,searchValue:o},t,n,r);return{label:s,value:c,searchValue:l||s}},nR=e=>e.filter(({value:e})=>!!e),Tke=({refEntry:e,content:t,collection:n,templates:r,fileName:i,locale:a,identifierField:o,pendingEntries:s=void 0})=>{let{locales:c}=e,{name:l,_i18n:{defaultLocale:u}}=n,{allFieldNames:d,hasListFields:f}=r,p=lA(n,e.slug),m={collectionName:l,fileName:i,isIndexFile:zk(n,e),keyPath:``},h={slug:p,locale:a,getDisplayValue:(e,n)=>RR({...m,keyPath:e,valueMap:n?c[n]?.content??{}:t,locale:n??a,pendingEntries:s})},g={content:t,locales:c,defaultLocale:u,identifierField:o};if(!f)return nR([wke({templates:r,allFieldNames:d,context:h,fallbackContext:g})]);let{results:_,hasProcessedListFields:v}=Cke({baseFieldGroups:mke(d,m),content:t,templates:r,allFieldNames:d,context:h,fallbackContext:g});if(v)return nR(_);let{_displayField:y,_valueField:b,_searchField:x}=r,{label:S,value:C,searchValue:w}=eR({label:y,value:b,searchValue:x},d.filter(e=>!e.includes(`*`)),h,g);return nR([{label:S,value:C,searchValue:w||S}])},rR=e=>e===!0||e===`translate`||e===`duplicate_if_empty`,iR=e=>e===`duplicate`||e===`sync`,aR=e=>rR(e)||iR(e),oR=e=>e===void 0||e===!1||e===`none`,sR=({fieldConfig:e,getFieldArgs:t})=>{if(e.i18n!==void 0)return e.i18n;let n=t.keyPath.split(`.`);for(let e=n.length-2;e>=0;--e)if(!cM(n[e])){let{i18n:r}=_M({...t,keyPath:n.slice(0,e+1).join(`.`)})??{};if(r!==void 0)return r}},cR=e=>iR(sR(e)),lR=e=>sR(e)===`sync`,uR=({getFieldArgs:e,locale:t,defaultLocale:n,keyPath:r})=>{if(t===n)return!0;let i=r.split(`.`),a=!1,o;return i.every((t,n)=>{if(n{if(t===n||!i)return r;let{collectionName:a,fileName:o,isIndexFile:s}=e,c=JSON.stringify([a,o,s,t,n]);return{...mA(mA(Eke,i,()=>new Map),c,()=>{let r={...e,valueMap:i};return Object.fromEntries(Object.entries(i).filter(([e])=>!uR({getFieldArgs:r,locale:t,defaultLocale:n,keyPath:e})))}),...r}},Oke=(e,t)=>{let{defaultLocale:n}=BA(e),r=e?.currentValues[n];if(!e||!r||t===n)return;let i=gM(e,{valueMap:r});return{values:r,isShared:e=>!uR({getFieldArgs:i,locale:t,defaultLocale:n,keyPath:e})}},kke=/^{{fields\.(.+?)}}$/,Ake=new Map,dR=(e,t)=>{let n=e[t];if(n!==void 0&&!Array.isArray(n))return n;let r=mA(Ake,t,()=>RegExp(`^${JE(t)}\\.\\d+$`)),i=Object.keys(e).filter(e=>r.test(e)).map(t=>e[t]);return i.length?i:n},jke=(e,t,n=void 0,r=void 0)=>e.map(({field:e,values:i,exclude:a})=>({field:e,exclude:a,values:i.flatMap(e=>{if(typeof e!=`string`)return[e];if(e===`{{slug}}`)return n?[n]:[];let i=e.match(kke);if(!i)return[e];let a=t?dR(t,i[1]):void 0;return a===void 0&&r?.isShared(i[1])&&(a=dR(r.values,i[1])),Array.isArray(a)?a:a===void 0?[]:[a]})})),Mke=({refEntries:e,collection:t,locale:n,fileName:r=void 0,entryFilters:i=[],defaultLocale:a=void 0})=>{let o=new Map,s=(e,i,s)=>{let c=dR(i,s),l=a?e.locales[a]?.content:void 0;return c!==void 0||!l||l===i||mA(o,s,()=>uR({getFieldArgs:{collectionName:t.name,fileName:r,valueMap:l},locale:n,defaultLocale:a,keyPath:s}))?c:dR(l,s)};return e.filter(e=>!r||r===e.slug).map(e=>{let{content:t}=e.locales[n]??(a?e.locales[a]:void 0)??e.locales._default??{};return{refEntry:e,hasContent:!!t&&Object.keys(t).length>0,content:t??{}}}).filter(({hasContent:e,content:n,refEntry:r})=>e&&i.every(({field:e,values:i,exclude:a=!1})=>{if(i.length===0)return!0;let o=e===`slug`,c=kk(e),l=o?lA(t,r.slug):s(r,n,c),u=Array.isArray(l)?l.some(e=>i.includes(e)):i.includes(l);return a?!u:u}))},fR=(e,t)=>{let{databaseName:n}=e??{};return n?new tD(n,t):void 0},pR=[`eq`,`ne`,`lt`,`lte`,`gt`,`gte`,`in`,`not_in`,`empty`],mR=e=>{let{field:t,pattern:n}=e,r={field:t};return n!==void 0&&(r.pattern=n),pR.forEach(t=>{e[t]!==void 0&&(r[t]=e[t])}),r},Nke=e=>!!e&&pR.some(t=>e[t]!==void 0),hR=e=>{let{field:t,pattern:n}=e,r=[t],i=Object.fromEntries(pR.filter(t=>e[t]!==void 0).map(t=>[t,e[t]]));return n===void 0?Object.keys(i).length&&r.push(null):r.push(String(n)),Object.keys(i).length&&r.push(i),JSON.stringify(r)},gR=e=>e===`*other`?X(`other`):e,Pke=(e,t,n)=>{let r=IL(t);return[...Map.groupBy(e,e=>{let t=n(e);return t==null?`*other`:r?String(t).match(r)?.[0]??`*other`:String(t)})].sort(([e],[t])=>$E(gR(e),gR(t)))},Fke=(e,t,n)=>{let{field:r,pattern:i}=t??{};return r?Object.fromEntries(Pke(e,i,e=>n(e,r))):e.length?{"*":e}:{}},Ike=(e,t,n)=>n?n.test(String(e??``)):e===t,Lke=(e,t,n)=>n?$E(e,t):e-t,_R=(e,t,n,r)=>{let i=e.map(e=>({item:e,key:t(e)})),a=i.filter(({key:e})=>e!==void 0),o=i.filter(({key:e})=>e===void 0);return a.sort(({key:e},{key:t})=>Lke(e,t,n)),r===`descending`&&a.reverse(),[...a,...o].forEach(({item:t},n)=>{e[n]=t}),e},Rke=e=>e.filter(e=>e!==`*`),vR=e=>e?hR(e):void 0,yR=(e,t)=>{let n=vR(e.group);return n!==void 0&&!!e.collapsedGroups?.[n]?.includes(t)},zke=(e,t)=>{let n=vR(e.group);if(n===void 0)return e;let{[n]:r,...i}=e.collapsedGroups??{},a=t.length?{...i,[n]:t}:i,{collapsedGroups:o,...s}=e;return Object.keys(a).length?{...s,collapsedGroups:a}:s},Bke=(e,t,n)=>{let r=vR(e.group),i=(r===void 0?[]:e.collapsedGroups?.[r]??[]).filter(e=>e!==t);return n&&i.push(t),zke(e,i)},Vke=(e,t,n)=>zke(e,n?[...t]:[]),bR=async(e,t,n,{defaults:r={}}={})=>{let i=fR(e,`ui-settings`),a;try{a=await i?.get(t)}catch{}let o={...r,...D(a)?a:{}};n.current=o;let s=o;return JO(()=>{let{current:e}=n;(0,Cr.default)(e,s)||(s=e,(async()=>{try{await i?.set(t,e)}catch{}})())})},xR=(e,t)=>{if(Array.isArray(e))return{options:e};if(D(e)){let n=e[t],r=e.default;if(Array.isArray(n)){let e=r?n.find(({name:e})=>e===r):void 0;return{options:n,default:e?mR(e):void 0}}}return{options:[]}},Hke=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),Uke=e=>{let t=D(e)?e.default_sort:void 0;return t===!0||t===`asc`||t===`desc`},Wke=e=>{let t=[],n={},r;return e.forEach(e=>{if(typeof e==`string`){t.push(e);return}if(!D(e)||typeof e.field!=`string`)return;let{field:i,label:a}=e;t.push(i),typeof a==`string`&&a.trim()&&(n[i]=a),!r&&Uke(e)&&(r=e)}),{keys:t,...Object.keys(n).length?{labels:n}:{},...r?{defaultKey:r.field,defaultOrder:r.default_sort===`desc`?`descending`:`ascending`}:{}}},Gke=e=>{if(Array.isArray(e))return Wke(e);if(D(e)){let{fields:t,default:n}=e;return Hke(t)?D(n)?{keys:t,defaultKey:n.field,defaultOrder:[`descending`,`Descending`].includes(n.direction??``)?`descending`:`ascending`}:{keys:t}:{keys:[]}}return{keys:[]}},SR=[`slug`,`commit_author`,`commit_date`],Kke=[`dirname`,`filename`,`extension`,`locales`],qke=/^\{\{\s*(?:fields\.)?([^\s|{}]+)\s*\}\}$/,CR=e=>IM(e),wR=e=>{let{table_columns:t,summary_fields:n}=e;if(Array.isArray(t))return t.map(e=>D(e)?{key:e.field,label:e.label}:{key:e});if(Array.isArray(n))return n.map(e=>({key:e===`summary`?`_summary`:e}))},Jke=new Map,Yke=e=>mA(Jke,e,()=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return e.toLowerCase()}}),Xke=(e,t)=>{if(Object.hasOwn(e,t))return t;let n=Yke(t),r=Object.keys(e).filter(e=>Yke(e)===n);return r.find(e=>!e.includes(`-`))??r[0]},Zke=(e,t)=>{let n=e[`${t}_localized`];return D(n)?n:void 0},TR=({config:e,option:t,locale:n})=>{if(!e)return;let r=Zke(e,t);if(r){if(n&&n!==`_default`&&Object.hasOwn(r,n))return r[n];let e=Fc.current?Xke(r,Fc.current):void 0;if(e!==void 0)return r[e]}return e[t]},ER=({config:e,locale:t})=>TR({config:e,option:`label`,locale:t})||e.name||``,Qke=({fieldConfig:e,locale:t,defaultLocale:n})=>{let r=Zke(e,`default`);if(!r)return e;let{default_localized:i,...a}=e,o=iR(e.i18n)?n:t;return Object.hasOwn(r,o)?{...a,default:r[o]}:a},$ke=[`title`,`name`,`date`,`author`,`description`],eAe=[`ascending`,`descending`],tAe=[`date`,`commit_date`],DR={slug:String,commit_author:String,commit_date:Date,_summary:String,_manual:String},OR=Object.keys(DR),nAe=e=>e?{keys:[e,...$ke.filter(t=>t!==e)],defaultKey:e}:{keys:[...$ke]},kR=({collection:e,isCommitAuthorAvailable:t,isCommitDateAvailable:n})=>{let{name:r,identifier_field:i,sortable_fields:a,summary:o,_i18n:{i18nEnabled:s,canonicalSlug:c}}=e,l=a?Gke(a):nAe(i),u=[...l.keys],{defaultKey:d,defaultOrder:f}=l,{labels:p}=l;o&&u.unshift(`_summary`);let m=s?[...OR,c.key]:OR;u=bO(u).filter(e=>!!e&&(m.includes(e)||!!_M({collectionName:r,keyPath:e})));let h=u.includes(`commit_author`),g=u.includes(`commit_date`),_=ck(e);t&&!_?!u.includes(`author`)&&!h&&u.push(`commit_author`):h&&(u=u.filter(e=>e!==`commit_author`)),n&&!_?!u.includes(`date`)&&!g&&u.push(`commit_date`):g&&(u=u.filter(e=>e!==`commit_date`));let v=HL(e);return(v||ck(e))&&(u=u.filter(e=>e!==v),u.includes(`_manual`)||u.unshift(`_manual`),d=`_manual`,f=`ascending`),d=d&&u.includes(d)?d:u[0],f??=d?`ascending`:void 0,{keys:u,labels:p,default:{key:d,order:f}}},rAe=({key:e,fieldConfig:t})=>Object.hasOwn(DR,e)?DR[e]:t?.widget===`boolean`?Boolean:t&&JN(t)?Number:String,AR=({collection:e,key:t})=>{if([...OR,`name`].includes(t))return X(`sort_keys.${t}`);if(t.includes(`.`))return t.split(`.`).map((t,n,r)=>{if(cM(t))return;let i=r.slice(0,n+1).join(`.`);return TR({config:_M({collectionName:e.name,keyPath:i}),option:`label`})||t}).filter(Boolean).join(` – `);let n=e.fields?.find(({name:e})=>e===t);return TR({config:n,option:`label`})||t},jR=KO(()=>{let e=WA.current;if(e?._type!==`entry`)return[];let{current:t}=tj,{keys:n,labels:r}=kR({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)});return n.map(t=>{let n=_M({collectionName:e.name,keyPath:t}),i={key:t,label:r?.[t]??AR({collection:e,key:t})};return rAe({key:t,fieldConfig:n})===Number&&(i.type=`number`),i})}),iAe=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},aAe=new mr,oAe=RegExp(`<(?:br|hr)\\b[^>]*>|`,`gi`),sAe=e=>YL(_t(aAe.parse(e).replaceAll(oAe,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),cAe=1e3,lAe=[`title`,`summary`,`description`],uAe=e=>e==null||e===``,dAe=({key:e,type:t,collection:n,locale:r,collectionName:i,dateFieldConfig:a,isMarkdownField:o})=>e===`_summary`?e=>$L(n,e,{locale:r,useTemplate:!0}):a?t=>{let n=MN(zR({entry:t,locale:r,collectionName:i,key:e}),a,r)?.getTime()??NaN;return Number.isNaN(n)?void 0:n}:t===String?t=>{let n=zR({entry:t,locale:r,collectionName:i,key:e});if(uAe(n))return;let a=String(n);return o?iAe(a.slice(0,cAe)):a}:t===Boolean?t=>+(zR({entry:t,locale:r,collectionName:i,key:e})===!0):t=>{let n=zR({entry:t,locale:r,collectionName:i,key:e}),a=uAe(n)?NaN:Number(n);return Number.isNaN(a)?void 0:a},MR=({collection:e,key:t,locale:n})=>{let{name:r}=e,i=_M({collectionName:r,keyPath:t}),a=rAe({key:t,fieldConfig:i}),o=i?.widget===`datetime`?i:void 0;return{getSortKey:dAe({key:t,type:a,collection:e,locale:n,collectionName:r,dateFieldConfig:o,isMarkdownField:hk.includes(i?.widget??``)||lAe.includes(t)}),isStringType:!o&&a===String}},fAe=(e,t)=>{let n=e.findIndex(e=>zk(t,e));return n>-1&&e.unshift(e.splice(n,1)[0]),e},pAe=(e,t,{key:n,order:r}={})=>{let i=[...e];if(n===void 0)return i;let{_i18n:{defaultLocale:a}}=t,{getSortKey:o,isStringType:s}=n===`_manual`||n===HL(t)?{getSortKey:UL(t),isStringType:!1}:MR({collection:t,key:n,locale:a});return _R(i,o,s,r),fAe(i,t)},mAe=({collection:e,key:t,locale:n})=>{if(t===`_manual`||t===HL(e))return{getSortKey:UL(e),isStringType:!1};let{defaultLocale:r}=e._i18n,i=MR({collection:e,key:t,locale:n}),a=n===r?i:MR({collection:e,key:t,locale:r}),o=n!==r&&!OR.includes(t)&&!uR({getFieldArgs:{collectionName:e.name,valueMap:{}},locale:n,defaultLocale:r,keyPath:t});return{getSortKey:e=>e.locales[n]&&!o?i.getSortKey(e):a.getSortKey(e),isStringType:i.isStringType}},hAe=({groups:e,collection:t,sortBy:n,locale:r})=>{let{field:i,direction:a}=n,{getSortKey:o,isStringType:s}=mAe({collection:t,key:i,locale:r}),c=a===`descending`?-1:1,l=e.flatMap(({refEntry:e,options:t})=>{let n=o(e);return t.map(e=>({option:e,sortKey:n}))});return l.sort((e,t)=>{if(e.sortKey!==t.sortKey){if(e.sortKey===void 0)return 1;if(t.sortKey===void 0)return-1;let n=Lke(e.sortKey,t.sortKey,s);if(n)return n*c}return $E(e.option.label,t.option.label)}),l.map(({option:e})=>e)},gAe=new Map,_Ae=100,NR=new Set,vAe=10,yAe=new WeakMap,bAe=(e=[])=>e.map(e=>KL(e)).join(`,`),xAe=(e,t,n)=>{let r=n.filter(e=>e.collectionName===t).map(({entry:e})=>e),i=new Map(r.map(e=>[e.id,e]));return r.length?[...e.map(e=>{let t=i.get(e.id);return i.delete(e.id),t??e}),...i.values()]:e},SAe=(e,t,n=[])=>{if(!n.length)return e;let r=yAe.get(e);return r||(r=new Map,yAe.set(e,r)),vA(r,bAe(n),()=>xAe(e,t,n),vAe)},CAe=({locale:e,fieldConfig:t,refEntries:n,entryFilters:r=[],pendingEntries:i=void 0})=>{let{collection:a,file:o}=t,s=YA(a);if(!s)return[];let{_type:c,_i18n:{defaultLocale:l}}=s,u=GL(c===`entry`?s:void 0),d=fke(t,u);return Mke({refEntries:n,collection:s,locale:e,fileName:o,entryFilters:r,defaultLocale:l}).map(({refEntry:t,content:n})=>({refEntry:t,options:Tke({refEntry:t,content:n,collection:s,templates:d,fileName:o,locale:e,identifierField:u,pendingEntries:i})}))},wAe=e=>CAe(e).flatMap(({options:e})=>e),TAe=({collection:e,file:t})=>{if(t){let n=cj(e,t);return n?[n]:[]}return BL(e)},PR=({locale:e,fieldConfig:t,refEntries:n,currentLocaleValues:r=void 0,currentSlug:i=void 0,pendingEntries:a=void 0,sharedValues:o=void 0})=>{let{collection:s,file:c,filters:l,sort_by:u}=t,d=jke(l??[],r,i,o),f=JSON.stringify(d.map(({values:e})=>e)),p=`${e}|${`${KL(t)}|${KL(n)}`}|${bAe(a)}|${f}`;return NR.has(p)?[]:vA(gAe,p,()=>{NR.add(p);try{let r=YA(s);if(r&&!c&&u?.field)return hAe({groups:CAe({locale:e,fieldConfig:t,refEntries:n,entryFilters:d,pendingEntries:a}),collection:r,sortBy:u,locale:e});let i=!c&&DOe(r),o=wAe({locale:e,fieldConfig:t,refEntries:i?WL(n,r):n,entryFilters:d,pendingEntries:a});return c||i?o:o.sort((e,t)=>$E(e.label,t.label))}finally{NR.delete(p)}},_Ae)},FR=({locale:e,fieldConfig:t,refEntry:n,pendingEntries:r=void 0})=>wAe({locale:e,fieldConfig:t,refEntries:[n],pendingEntries:r}),EAe=({fieldConfig:e,valueMap:t,keyPath:n,locale:r,pendingEntries:i=void 0})=>{let{multiple:a,collection:o}=e,s=AOe(PR({locale:r,fieldConfig:e,refEntries:SAe(BL(o),o,i),pendingEntries:i})),c=e=>s.get(e)||e;return a?_j(t,n).map(e=>c(t[e])):c(t[n])},DAe=new Map,OAe=1e3,kAe=new WeakMap,AAe=e=>mA(kAe,e,()=>JSON.stringify(e)),jAe=({fieldConfig:e,valueMap:t,keyPath:n})=>{let{multiple:r,options:i}=e,a=Ebe(i),o;r&&(o=_j(t,n).map(e=>t[e]));let s=`${n}|${AAe(i)}|${JSON.stringify(r?o:t[n])}`,c=e=>i.find(t=>t.value===e)?.label||e;return vA(DAe,s,()=>{if(r)return a?o.map(c):o;let e=t[n];return a?c(e):e},OAe)},IR=e=>D(e)?e.value:e,MAe=({fieldConfig:e,value:t})=>e.options.some(e=>IR(e)===t),NAe=({fieldConfig:e,currentValue:t})=>{let{options:n,multiple:r=!1}=e,i=Ebe(n),a=e=>i&&n.find(t=>t.value===e)?.label||String(e);return r?Array.isArray(t)?t.map(a).sort():[]:t===void 0||t===null&&!MAe({fieldConfig:e,value:null})?[]:[a(t)]},PAe=e=>e===null?`number`:typeof e,LR=e=>e===void 0||typeof e==`string`?``:null,FAe=e=>hk.includes(e?.widget),RR=({collectionName:e,fileName:t,componentName:n=void 0,valueMap:r={},keyPath:i,locale:a,transformations:o,isIndexFile:s=!1,pendingEntries:c=void 0,plainText:l=!1})=>{let u=_M({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,isIndexFile:s}),d=Object.hasOwn(r,i)?r[i]:void 0;if(d===void 0&&o?.length)return String(LN({fieldConfig:u,value:``,transformations:o,locale:a}));if(u?.widget===`datetime`&&(o?.some(({method:e})=>e===`date`)||(d=HN({locale:a,fieldConfig:u,currentValue:d}))),u?.widget===`relation`&&(d=EAe({fieldConfig:u,valueMap:r,keyPath:i,locale:a,pendingEntries:c})),u?.widget===`select`&&(d=jAe({fieldConfig:u,valueMap:r,keyPath:i})),u?.widget===`list`){let{field:o}=u,{fields:f}=u,{types:p}=u;if(!(f||p)){let u=_j(r,i);d=AA(a).format((o?u.map(i=>RR({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,locale:a,isIndexFile:s,pendingEntries:c,plainText:l})):u.map(e=>r[e]).filter(e=>typeof e==`string`)).filter(e=>!!e))}}if(u&&JN(u)&&d!=null&&d!==``){let e=Number(d);Number.isNaN(e)||(d=UN(DA(a)).format(e))}return l&&FAe(u)&&typeof d==`string`&&(d=sAe(d)),Array.isArray(d)&&(d=AA(a).format(d)),o?.length&&(d=LN({fieldConfig:u,value:d,transformations:o,locale:a})),String(d??``)},IAe=({valueMap:e,locale:t,keyPath:n,keyPathPrefix:r,getFieldArgs:i,plainText:a=!1})=>{let o=[`${n}.title`,`${n}.name`,...pj(e,r)].find(t=>{let n=e[t];if(!t.startsWith(r)||!(Jk(n)||typeof n==`number`&&!Number.isNaN(n)))return!1;let a=_M({...i,keyPath:t});return!!a&&a.widget!==`hidden`});return o?RR({...i,keyPath:o,locale:t,plainText:a}):``},zR=({entry:e,locale:t,collectionName:n,key:r,resolveRef:i=!0})=>{let{slug:a,locales:o,commitAuthor:s,commitDate:c}=e;if(r===`slug`)return a;if(r===`commit_author`)return XL(s);if(r===`commit_date`)return c;let{content:l}=o[t]??{};if(l===void 0)return;let u=YA(n);if(!u)return;let d=_M({collectionName:n,keyPath:r,isIndexFile:zk(u,e)});if(i&&d?.widget===`relation`)return EAe({fieldConfig:d,valueMap:l,keyPath:r,locale:t});if(d&&(d.widget===`list`||mM(d))){let e=_j(l,r);if(e.length)return e.map(e=>l[e])}let f=Object.hasOwn(l,r)?l[r]:void 0;if(f===void 0&&(d?.widget===`object`||d?.widget===`list`)){let e=pj(l,`${r}.`);if(e.length)return e.map(e=>l[e])}return f},LAe=({collectionName:e,fileName:t,keyPath:n,itemKeyPath:r=n,valueMap:i,isIndexFile:a=!1,locale:o,summaryTemplate:s,hasSingleSubField:c=!1})=>{let l={collectionName:e,fileName:t,keyPath:``,valueMap:i,isIndexFile:a};if(!s)return c?RR({...l,keyPath:r,locale:o,plainText:!0}):IAe({valueMap:i,locale:o,keyPath:r,keyPathPrefix:`${r}.`,getFieldArgs:l,plainText:!0});let u=(e,t)=>{let i=kk(e);if(c){let e=_M({...l,keyPath:n});if(!(`field`in e)||e.field.name!==i)return``}return RR({...l,keyPath:c?r:`${r}.${i}`,locale:o,plainText:!0,transformations:t?RM(t,e=>u(IN(e).value)):void 0})};return NM(s,(e,t)=>{let{value:n,transformations:r}=IN(t);return u(n,r)})},RAe=({fieldType:e,type:t,typeKey:n,types:r})=>t?`The “${t}” type is not defined for the ${e} field.`:`The type key is not found in the ${e===`list`?`list item`:`object`}. The item must include the “${n}” property with one of the defined types: ${r.map(e=>e.name).join(`, `)}`,zAe=({fieldType:e,keyPath:t,...n})=>{console.warn(`${e===`list`?`List item`:`Object field`} ${t}: ${RAe({fieldType:e,...n})}`)},BR=({types:e,fields:t,summary:n,type:r})=>{if(!e)return{typeConfig:void 0,unknownType:!1,subFields:t??[],summaryTemplate:n};let i=r?e.find(({name:e})=>e===r):void 0;return{typeConfig:i,unknownType:!i,subFields:i?.fields??[],summaryTemplate:i?.summary||n}},VR=(e,t)=>t?`${e}<${t}>`:e,HR=({typedKeyPath:e,type:t,subFieldName:n})=>`${VR(e,t)}.${n}`,BAe=/(?[+-]\d{2})(?::?(?\d{2}))?(?::?(?\d{2}))?(?:\.\d+)?$|Z$/,VAe=e=>String(Math.abs(Number(e))).padStart(2,`0`),HAe=new Map,UAe=(e,t)=>{if(typeof e!=`string`||!e.trim())return;let{inputTimeZone:n}=lN(t);if(n===`local`||n===`utc`)return;let r=new Date(e);if(Number.isNaN(r.getTime()))return;let i=e.match(BAe);if(!i?.groups)return;let{hours:a,minutes:o=`0`}=i.groups,s=i[0]===`Z`?`+00:00`:`${a.startsWith(`-`)?`-`:`+`}${VAe(a)}:${VAe(o)}`;return(mA(HAe,n,()=>new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`longOffset`})).formatToParts(r).find(e=>e.type===`timeZoneName`)?.value??``).replace(`GMT`,``)===s?n:void 0},WAe=(e,t)=>{let n=UAe(e,t);if(n)return n;let{inputTimeZone:r,singleCustomTimeZone:i}=lN(t);if(i)return i;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(r===`local`)return e}catch{return r===`local`?``:void 0}},GAe=(e,t=new Date)=>{try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``,r=e.split(`/`).pop()?.replaceAll(`_`,` `)??e;return`(${n.replace(`GMT`,``)}) ${r}`}catch{return e}};zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var KAe=/^(?\d{4}-[01]\d-[0-3]\d)(?:T00:00(?::00)?(?:\.000)?Z)?$/,qAe=/(?:^|T)(?