@akairos/pipeline 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARTICLE-THEMES.md +2 -2
- package/README.md +34 -15
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/package.json +3 -4
- package/src/wechat-preview/assets/browser-dist/.vite/manifest.json +47 -47
- package/src/wechat-preview/assets/browser-dist/assets/{index-BHJY0B4E.js → index-52O71prB.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-CdxKyTX6.js → index-BOH11YN9.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-DDQGWU_D.js → index-BOZWI3FE.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BlVpb0dF.js → index-BRUZEgPh.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BPmBcGI-.js → index-BTPh91V-.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BYV6TA8f.js → index-BXjcry0g.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-ifI5svkD.js → index-BoIlqlZt.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-D_EI5vFS.js → index-Btrc4kp0.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BFLGVgsp.js → index-ButcQVWD.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-vRiJxvj2.js → index-C-LFn5io.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-DpuVrwze.js → index-C1Bxnw4o.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BzHql5Rp.js → index-C2N6r4Fw.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BqKARoyW.js → index-Cbm1GiZg.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-DENMoE5l.js → index-CwgSvQOC.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BTVIa90Y.js → index-D7f6KXoI.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-IBlhKHQr.js → index-DkhSv5cA.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-DA7Z4paG.js → index-DmoEW40N.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BDdU9pNh.js → index-Dyi5bUmz.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-CPFEJ9fX.js → index-TOFwZskx.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-BOnKEJxh.js → index-lWl3DOj9.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{index-CyXDvcwY.js → index-sgpqKtmR.js} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{style-Cif_gYUW.css → style-CVnSjpTH.css} +1 -1
- package/src/wechat-preview/assets/browser-dist/assets/{wechat-renderer-CcHuq7M-.js → wechat-renderer-GrfbOjo2.js} +13 -4
- package/src/wechat-preview/assets/browser-dist/editor-export.js +1 -1
- package/src/wechat-preview/assets/browser-dist/src/wechat-preview/browser/studio/studio.html +2 -2
- package/src/wechat-preview/assets/browser-dist/studio.js +3 -3
- package/src/wechat-preview/browser/editor-export.css +2 -2
- package/src/wechat-preview/browser/editor-export.ts +1 -1
- package/src/wechat-preview/browser/studio/myno-editor.ts +2 -2
- package/src/wechat-preview/browser/studio/studio.ts +1 -1
- package/src/wechat-preview/index.ts +2 -2
- package/src/wechat-preview/wechat-export.integration.test.ts +3 -0
- package/src/wechat-preview.test.ts +1 -1
package/ARTICLE-THEMES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 离线正文模板
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 本文以 Pipeline `0.19.0` 为基线;`article-theme`、独立 JSON 和 myno 插件均已随 npm 版本提供。升级旧版本后,可用 `zzp --help` 和 `zzp wechat-export --help` 核对命令。
|
|
4
4
|
|
|
5
5
|
Pipeline 保持 MIT 开源。正文排版、本地模板包、customCss 和渲染插件不要求登录或会员。付费模板由各作者单独交付、单独授权,不包含在此仓库或 npm 包中。
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ zzp publish --state ./workflow-state.json --article-theme ./my-template
|
|
|
26
26
|
|
|
27
27
|
WeChat Visual Studio 的「导出配置」下载独立 `wechat-style.json`,同样通过 `--article-theme` 选择。文件含内嵌 `css`、`editorVars`、`exportTheme`、`syntaxPresets` 和 `structure`;页首图片以内嵌 Data URL 保存。不含账号凭据,不需要附带目录包文件。独立 JSON 使用自身样式,不叠加账号 `theme/customCss`,显式 `wechat-export --custom-css` 仍可覆盖。可用 `article-theme --path` 校验或安装;默认配置引用后由现有 `typeset-assets-sync` 收集部署,详见 [Studio 配置指南](docs/visual-studio-and-config-sync.md)。
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
目录模板叠加在基础样式上,账号 `theme` 和 `customCss` 仍可覆盖;独立 JSON 使用自身样式。正文模板默认不附带内置账号署名,用户配置的 `footerText` 仍保留。内置渲染器和 myno 的浏览器型插件均由 Pipeline 解析、校验模板;其他 `render()` 型插件需自行支持可选 `articleThemePath`。桌面端预览调用当前已配置的渲染插件。
|
|
30
30
|
|
|
31
31
|
发布前冻结模板版本、CSS 和资源到工作区 `.zzhub-media/article-themes`;渲染结果记录 `article_theme_hash`。同一篇文章更改模板、版本或声明素材后会重新导出。旧状态不含该字段时仍可使用。
|
|
32
32
|
|
package/README.md
CHANGED
|
@@ -12,13 +12,30 @@ Pipeline 可以独立使用,也可以作为 Web、App、桌面客户端背后
|
|
|
12
12
|
|
|
13
13
|
> Cloud Worker 已在本仓库实现,可从源码构建 Docker 镜像部署。它不包含在 npm CLI 包中;npm 只分发 CLI 和渲染资源。`v0.14.0` tag 包含初版 Worker,账号同步和正文模板等接口以实际部署的 revision 为准,生产环境请固定 commit/tag。
|
|
14
14
|
|
|
15
|
+
## 生态与使用者
|
|
16
|
+
|
|
17
|
+
本仓库是发布执行层,供本机用户、Agent 和应用后端调用。以下都是可独立使用的公开仓库;npm 包统一使用 `@akairos` scope,GitHub 仓库位于 `k7airos`。
|
|
18
|
+
|
|
19
|
+
| 项目 | 与 Pipeline 的关系 | 什么时候使用 |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| [myno](https://github.com/k7airos/myno) · [`@akairos/myno`](https://www.npmjs.com/package/@akairos/myno) | 可选的正文编辑、排版与 Studio 插件,配置 `plugins.markdownRenderer` | 交互调样式、导出独立配置、复制富文本;也能脱离 Pipeline 独立运行 |
|
|
22
|
+
| [Typeset Studio](https://github.com/k7airos/typeset-studio) · [`@akairos/typeset-studio`](https://www.npmjs.com/package/@akairos/typeset-studio) | 图片渲染插件,配置 `plugins.imageRenderer` | 设计与渲染文章封面、贴图封面和多页内容图 |
|
|
23
|
+
| [Milkdown Article Plugins](https://github.com/k7airos/milkdown-article-plugins) | Pipeline 与 myno 共用的语法、序列化和微信组件渲染 | 给自己的 Milkdown 宿主接入高亮、提示卡、徽章和快捷键 |
|
|
24
|
+
| myno CSS 入口 | `@akairos/myno/article.css` 与 `tokens-default.css`,统一提供正文排版和主题变量 | 仅复用样式时无需加载编辑器脚本 |
|
|
25
|
+
| [Obsidian 微信发布插件](https://github.com/k7airos/obsidian-wechat-publish) | 通过本机 `zzp` 调用 Pipeline 的桌面客户端 | 在 Obsidian 内提交笔记到公众号草稿箱 |
|
|
26
|
+
| [Kairos Skills](https://github.com/k7airos/kairos-skills) | 外部 Agent 的写作规范、审核与状态机编排说明 | 让 Agent 按 `status → next_action` 写稿和推进任务 |
|
|
27
|
+
| [blog.zzao.club](https://github.com/k7airos/blog.zzao.club) | 博客路由的公开消费方和目录约定示例 | 将文章同步到 Nuxt Content,再执行自定义发布命令 |
|
|
28
|
+
| [Bun 微信中转服务](https://github.com/k7airos/bun-wx-server) | 可参考的自托管认证、COS 与基础微信代理实现 | 研究中转 API;当前只覆盖部分微信端点,接入限制见该仓库 README |
|
|
29
|
+
|
|
30
|
+
Nezus 也是现有消费方:桌面端调用本机 CLI,云端通过业务后端调用 Worker。它是独立应用,不是安装 Pipeline 的前提。Pipeline 不依赖任何私有仓库才能启动或本地排版。
|
|
31
|
+
|
|
15
32
|
## 能做什么
|
|
16
33
|
|
|
17
34
|
| 能力 | 说明 |
|
|
18
35
|
| --- | --- |
|
|
19
36
|
| 公众号文章 | Markdown 转微信兼容 HTML,生成自适应头图,上传图片,创建或更新文章草稿 |
|
|
20
|
-
|
|
|
21
|
-
|
|
|
37
|
+
| Markdown 与扩展组件 | 支持 CommonMark/GFM、Callout、导读/互动卡、徽章、按键和高亮;微信导出范围见正文模板文档 |
|
|
38
|
+
| 封面裁切 | 按真实图片尺寸计算 2.35:1 与右对齐 1:1 裁切参数;仍需符合微信素材要求 |
|
|
22
39
|
| 公众号贴图 | 渲染单页卡片或多页 PNG 图集,创建 `newspic` 草稿 |
|
|
23
40
|
| 博客同步 | 把 Markdown 和图片同步到配置的博客项目,并执行发布命令 |
|
|
24
41
|
| 可恢复工作流 | 保存任务状态、素材、审核决定、渲染版本和发布结果,失败后可以继续或重置 |
|
|
@@ -26,7 +43,7 @@ Pipeline 可以独立使用,也可以作为 Web、App、桌面客户端背后
|
|
|
26
43
|
| 排版扩展 | 封面主题、正文模板、品牌配置和可替换渲染插件 |
|
|
27
44
|
| 排版工作台 | `zzp wechat-preview studio` 提供所见即所得排版调优、配色选型、语法预设与配置持久化 |
|
|
28
45
|
| 本机监控 | `zzp monitor` 提供任务快照、日志和 SSE 事件流 |
|
|
29
|
-
| 云端执行 | 私有 HTTP Worker
|
|
46
|
+
| 云端执行 | 私有 HTTP Worker 提供账号同步、串行队列、持久化任务和状态轮询,运行中可附带当前动作进度 |
|
|
30
47
|
|
|
31
48
|
Pipeline 不内置 LLM、用户登录、计费或配额服务。调用方需要自己提供正文和审核决定;云端 Worker 接收已经确认的完整正文,并只推进支持的 CLI 动作。
|
|
32
49
|
|
|
@@ -94,19 +111,19 @@ zzp wechat-export \
|
|
|
94
111
|
|
|
95
112
|
### 视觉排版工作台 (WeChat Visual Studio)
|
|
96
113
|
|
|
97
|
-
Pipeline
|
|
114
|
+
启用 [myno 排版插件](#myno-排版插件) 后,下面的命令加载 myno 随 npm 包提供的工作台;未配置插件时使用 Pipeline 内置工作台:
|
|
98
115
|
|
|
99
116
|
```bash
|
|
100
117
|
zzp wechat-preview studio
|
|
101
118
|
```
|
|
102
119
|
|
|
103
|
-
终端启动后会自动唤起浏览器打开 `http://127.0.0.1:18765/studio
|
|
120
|
+
终端启动后会自动唤起浏览器打开 `http://127.0.0.1:18765/studio`。可调整主题配色、字号行距、标题/引用/分割线等预设和自定义 CSS;提示卡片的标题与 Emoji 写在 Markdown 中。调整后可复制富文本、导出独立 JSON,或保存到当前账号配置。
|
|
104
121
|
|
|
105
122
|
> **云端使用者注意**:本地 Studio 保存的样式会写入本地 `config.json`。若使用私有云端 Worker,需将调整后的配置同步至服务器,详见 [Visual Studio 排版调优与云端配置同步指南](docs/visual-studio-and-config-sync.md)。
|
|
106
123
|
|
|
107
124
|
### 公众号全语法与扩展组件
|
|
108
125
|
|
|
109
|
-
Pipeline
|
|
126
|
+
Pipeline 与 myno 基于 `@akairos/milkdown-article-plugins` 和 myno 内置正文样式支持以下扩展,导出时转换为微信兼容的内联样式:
|
|
110
127
|
|
|
111
128
|
#### 1. 语义提示卡片 (Callout Alerts)
|
|
112
129
|
支持 GFM 标准的 5 种语义卡片,并支持行内自定义标题与 Emoji:
|
|
@@ -141,23 +158,24 @@ Pipeline 内置基于 `@akairos/milkdown-article-plugins` 与 `@akairos/milkdown
|
|
|
141
158
|
```
|
|
142
159
|
|
|
143
160
|
#### 3. 行内组件 (Badge / Kbd / Highlight)
|
|
144
|
-
- **状态徽章**:`[badge:
|
|
161
|
+
- **状态徽章**:`[badge:brand|推荐]`、`[badge:success|运行正常]`、`[badge:warning|待确认]`、`[badge:danger|异常]`、`[badge:info|说明]`
|
|
145
162
|
- **键盘按键**:按 `[[kbd:Cmd]] + [[kbd:K]]` 快速调起指令,按 `[[kbd:Shift]] + [[kbd:Enter]]` 换行
|
|
146
163
|
- **荧光笔高亮**:使用 `==荧光笔标记核心概念与重点论述==`
|
|
147
164
|
|
|
148
165
|
#### 4. 智能居中防拉伸分割线 (Divider)
|
|
149
|
-
标准 Markdown `---`
|
|
166
|
+
标准 Markdown `---` 可应用 Studio 中配置的分割线预设(如 `short-center`、`dashed`、`hairline`),导出为微信可用的结构和内联样式。
|
|
150
167
|
|
|
151
168
|
#### 5. 智能封面裁切比率自动适配
|
|
152
|
-
Pipeline
|
|
169
|
+
Pipeline 在创建和更新草稿时读取封面图真实尺寸,默认裁切最右侧的 1:1 区域(纵向居中),并生成 `pic_crop_235_1` 与 `pic_crop_1_1` 参数。此处解决裁切几何问题,不能保证绕过微信的其他内容或素材校验。
|
|
153
170
|
|
|
154
171
|
### 模块化生态组成
|
|
155
172
|
|
|
156
173
|
| 模块包名 | 职责说明 |
|
|
157
174
|
| --- | --- |
|
|
158
175
|
| **`@akairos/pipeline`** | 核心可恢复状态机、CLI 工具链与多端发布器 |
|
|
159
|
-
| **`@akairos/
|
|
160
|
-
| **`@akairos/milkdown-article-plugins`** | Remark / Milkdown
|
|
176
|
+
| **`@akairos/myno/article.css`** | Kairos 原创微信排版 CSS 样式规范与设计令牌,随 myno 维护 |
|
|
177
|
+
| **`@akairos/milkdown-article-plugins`** | Remark / Milkdown 文章扩展语法与渲染插件 |
|
|
178
|
+
| **`@akairos/myno`** | 可独立运行的正文编辑器、样式工作台与可选 Markdown 渲染插件 |
|
|
161
179
|
| **`@akairos/typeset-studio`** | 微信大图头图、多比例排版与卡片视觉合成引擎 |
|
|
162
180
|
|
|
163
181
|
配置在 `plugins.imageRenderer` / `plugins.markdownRenderer` 的外部插件在独立 Bun 子进程中加载,插件的 `render`、`doctor`、`browser` 和 `studio` 方法也在子进程调用。加载、资源入口查询与 doctor 默认上限为 10 秒,`render` 为 120 秒;Markdown 渲染显式传入 `timeoutMs` 时,子进程上限额外预留 10 秒。可通过 `ZZHUB_PIPELINE_PLUGIN_TIMEOUT_MS` 覆盖子进程调用上限。同步死循环、超时和异常退出会终止插件进程,非法返回值会给出 `PLUGIN_*` 错误,命令不会自动重试或静默切换模板。浏览器型插件返回入口后,由 pipeline 现有 Chrome 运行时加载页面,并按渲染 `timeoutMs` 管理浏览器生命周期。
|
|
@@ -172,7 +190,7 @@ Pipeline 在创建和更新草稿时,会自动读取封面图真实尺寸,
|
|
|
172
190
|
|
|
173
191
|
### myno 排版插件
|
|
174
192
|
|
|
175
|
-
|
|
193
|
+
Pipeline 0.19.1 起固定依赖 `@akairos/myno@0.3.1`,内置导出与插件共用 myno 正文 CSS。使用 myno 完整排版和工作台时,仍需在配置中显式选择插件。npm 配置示例:
|
|
176
194
|
|
|
177
195
|
```json
|
|
178
196
|
{
|
|
@@ -216,7 +234,7 @@ Studio 模板与 pipeline 配置分开保存:`data/templates/*.json` 保存模
|
|
|
216
234
|
|
|
217
235
|
固定素材的 `templateAssetKey` 是模板内的替换标识,图片来源仍是 `images[].src`。支持可访问的 HTTP/HTTPS URL、本地文件及 `/uploads/...` 引用。使用 `/uploads/...` 时应连同 `uploads/` 目录原文件名一起同步;绝对路径应改为服务器可用路径,或把素材上传到 COS/CDN 后使用稳定 HTTPS URL。编辑器预览远程图片还需要图片服务允许跨域读取。
|
|
218
236
|
|
|
219
|
-
|
|
237
|
+
**版本基线(2026-10-15):** Pipeline `0.19.1` 固定 Typeset Studio `0.2.6` 和 myno `0.3.1`;插件仍需显式配置。模板与素材不打进 npm 包,服务器通过运行时配置包提供。源码适配器路径仅用于本地联调,Worker 使用 npm 入口。
|
|
220
238
|
|
|
221
239
|
### 生成 Worker 运行时配置包
|
|
222
240
|
|
|
@@ -231,7 +249,7 @@ zzp typeset-assets-sync --output ./pipeline-runtime --account-map '{"default":"W
|
|
|
231
249
|
|
|
232
250
|
命令扫描模板引用的本地文件和 Base64 图片,使用现有 COS 配置上传;图片 URL 验证成功后,备份并回写模板,再生成带逐文件 SHA-256 的 `manifest.json`、`pipeline.patch.json`、`typeset-studio/` 和 `markdown/`。上传记录按目标和图片内容保存,重复执行复用成功上传;本地原图保留。上传或校验失败保留模板和旧输出包,上传期间的模板修改会触发冲突提示。`--template` 仅限制本次素材迁移范围,输出仍包含全部模板;其他模板存在未迁移素材时拒绝生成不完整包。
|
|
233
251
|
|
|
234
|
-
配置包只包含插件入口、Studio 容器路径和账号主题/CSS/文章模板路径,不包含微信凭据、COS PAT 或 Worker token。账号的 `customCss`、`articleTheme` 为 null
|
|
252
|
+
配置包只包含插件入口、Studio 容器路径和账号主题/CSS/文章模板路径,不包含微信凭据、COS PAT 或 Worker token。账号的 `customCss`、`articleTheme` 为 null 时会清除服务器旧引用。Markdown 插件只导出 `null` 或 `@akairos/myno/adapter` npm 入口和空 `options`,不导出本机模块路径。自托管时按文件哈希校验、备份和样式白名单合并后切换;项目自己的部署工具可消费此包,镜像与 npm 依赖仍需固定版本。
|
|
235
253
|
|
|
236
254
|
WeChat Visual Studio 可通过「导出配置」下载不绑定账号的独立排版 JSON。CLI 用 `--article-theme ./wechat-style.json` 选择;在默认配置的账号 `articleTheme` 中引用后,也会由上述运行时包收集部署。文件内嵌 CSS 与页首图片,无需附带模板目录。详见 [Studio 独立配置与部署](docs/visual-studio-and-config-sync.md)。
|
|
237
255
|
|
|
@@ -293,7 +311,7 @@ Worker 已经可以部署,但应作为**内部服务**使用:
|
|
|
293
311
|
- `PIPELINE_WORKER_TOKEN` 是服务令牌,不是用户登录 token,也不是微信中转 PAT;不要下发给客户端。
|
|
294
312
|
- 当前是单进程串行队列,使用 JSON 文件保存任务、正文和账号;数据目录必须挂载持久卷,不支持多个副本共享同一目录。
|
|
295
313
|
- 任务状态为 `queued`、`running`、`succeeded`、`failed` 或 `interrupted`,`step` 表示当前 Pipeline 动作。
|
|
296
|
-
-
|
|
314
|
+
- Worker 轮询返回步骤、结果和可选当前动作进度,不提供云端 SSE 或原始日志。本机 `zzp monitor` 是另一套观测接口。
|
|
297
315
|
|
|
298
316
|
最短 Docker 启动示例:
|
|
299
317
|
|
|
@@ -320,6 +338,7 @@ docker run -d --name pipeline-worker --restart unless-stopped \
|
|
|
320
338
|
| 方法 | 路径 | 用途 |
|
|
321
339
|
| --- | --- | --- |
|
|
322
340
|
| `GET` | `/health` | 查看 Worker 是否存活、排队数和账号数 |
|
|
341
|
+
| `PUT` | `/v1/maintenance` | 暂停或恢复接收新任务,供维护更新使用 |
|
|
323
342
|
| `PUT` | `/v1/accounts/:account` | 写入或替换公众号凭据 |
|
|
324
343
|
| `DELETE` | `/v1/accounts/:account` | 删除 Worker 中的公众号凭据 |
|
|
325
344
|
| `POST` | `/v1/jobs` | 提交完整正文,返回 job ID |
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bundled article styles
|
|
2
2
|
|
|
3
|
-
The browser renderer includes `@akairos/
|
|
3
|
+
The browser renderer includes `@akairos/myno` article styles (`article.css` and `tokens-default.css`, migrated from `@akairos/milkdown-article-style`), distributed under the following license. Other dependencies retain their own licenses. Commercial article templates are separate packages and are not covered by this license.
|
|
4
4
|
|
|
5
5
|
MIT License
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akairos/pipeline",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -28,15 +28,14 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@akairos/milkdown-article-plugins": "^0.1.6",
|
|
31
|
-
"@akairos/milkdown-article-style": "^0.1.2",
|
|
32
31
|
"@akairos/typeset-studio": "0.2.6",
|
|
33
32
|
"@chenglou/pretext": "0.0.8",
|
|
34
33
|
"image-size": "^2.0.2",
|
|
35
34
|
"pngjs": "^7.0.0",
|
|
36
|
-
"zod": "^4.4.2"
|
|
35
|
+
"zod": "^4.4.2",
|
|
36
|
+
"@akairos/myno": "0.3.1"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@akairos/myno": "0.3.0",
|
|
40
39
|
"@napi-rs/canvas": "^0.1.97",
|
|
41
40
|
"cos-nodejs-sdk-v5": "^2.15.4"
|
|
42
41
|
},
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"file": "assets/simple-mode-GW_nhZxv.js",
|
|
11
11
|
"name": "simple-mode"
|
|
12
12
|
},
|
|
13
|
-
"_wechat-renderer-
|
|
14
|
-
"file": "assets/wechat-renderer-
|
|
13
|
+
"_wechat-renderer-GrfbOjo2.js": {
|
|
14
|
+
"file": "assets/wechat-renderer-GrfbOjo2.js",
|
|
15
15
|
"name": "wechat-renderer"
|
|
16
16
|
},
|
|
17
17
|
"node_modules/@codemirror/lang-angular/dist/index.js": {
|
|
18
|
-
"file": "assets/index-
|
|
18
|
+
"file": "assets/index-BOH11YN9.js",
|
|
19
19
|
"name": "index",
|
|
20
20
|
"src": "node_modules/@codemirror/lang-angular/dist/index.js",
|
|
21
21
|
"isDynamicEntry": true,
|
|
@@ -24,45 +24,45 @@
|
|
|
24
24
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
25
25
|
"node_modules/@codemirror/lang-javascript/dist/index.js",
|
|
26
26
|
"_index-B13lCSuc.js",
|
|
27
|
-
"_wechat-renderer-
|
|
27
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
28
28
|
"node_modules/@codemirror/lang-css/dist/index.js"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
"node_modules/@codemirror/lang-cpp/dist/index.js": {
|
|
32
|
-
"file": "assets/index-
|
|
32
|
+
"file": "assets/index-TOFwZskx.js",
|
|
33
33
|
"name": "index",
|
|
34
34
|
"src": "node_modules/@codemirror/lang-cpp/dist/index.js",
|
|
35
35
|
"isDynamicEntry": true,
|
|
36
36
|
"imports": [
|
|
37
37
|
"_index-B13lCSuc.js",
|
|
38
38
|
"src/wechat-preview/browser/studio/studio.html",
|
|
39
|
-
"_wechat-renderer-
|
|
39
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"node_modules/@codemirror/lang-css/dist/index.js": {
|
|
43
|
-
"file": "assets/index-
|
|
43
|
+
"file": "assets/index-BTPh91V-.js",
|
|
44
44
|
"name": "index",
|
|
45
45
|
"src": "node_modules/@codemirror/lang-css/dist/index.js",
|
|
46
46
|
"isDynamicEntry": true,
|
|
47
47
|
"imports": [
|
|
48
48
|
"_index-B13lCSuc.js",
|
|
49
49
|
"src/wechat-preview/browser/studio/studio.html",
|
|
50
|
-
"_wechat-renderer-
|
|
50
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
"node_modules/@codemirror/lang-go/dist/index.js": {
|
|
54
|
-
"file": "assets/index-
|
|
54
|
+
"file": "assets/index-lWl3DOj9.js",
|
|
55
55
|
"name": "index",
|
|
56
56
|
"src": "node_modules/@codemirror/lang-go/dist/index.js",
|
|
57
57
|
"isDynamicEntry": true,
|
|
58
58
|
"imports": [
|
|
59
59
|
"_index-B13lCSuc.js",
|
|
60
60
|
"src/wechat-preview/browser/studio/studio.html",
|
|
61
|
-
"_wechat-renderer-
|
|
61
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"node_modules/@codemirror/lang-html/dist/index.js": {
|
|
65
|
-
"file": "assets/index-
|
|
65
|
+
"file": "assets/index-C1Bxnw4o.js",
|
|
66
66
|
"name": "index",
|
|
67
67
|
"src": "node_modules/@codemirror/lang-html/dist/index.js",
|
|
68
68
|
"isDynamicEntry": true,
|
|
@@ -71,33 +71,33 @@
|
|
|
71
71
|
"src/wechat-preview/browser/studio/studio.html",
|
|
72
72
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
73
73
|
"node_modules/@codemirror/lang-javascript/dist/index.js",
|
|
74
|
-
"_wechat-renderer-
|
|
74
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"node_modules/@codemirror/lang-java/dist/index.js": {
|
|
78
|
-
"file": "assets/index-
|
|
78
|
+
"file": "assets/index-CwgSvQOC.js",
|
|
79
79
|
"name": "index",
|
|
80
80
|
"src": "node_modules/@codemirror/lang-java/dist/index.js",
|
|
81
81
|
"isDynamicEntry": true,
|
|
82
82
|
"imports": [
|
|
83
83
|
"_index-B13lCSuc.js",
|
|
84
84
|
"src/wechat-preview/browser/studio/studio.html",
|
|
85
|
-
"_wechat-renderer-
|
|
85
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"node_modules/@codemirror/lang-javascript/dist/index.js": {
|
|
89
|
-
"file": "assets/index-
|
|
89
|
+
"file": "assets/index-C2N6r4Fw.js",
|
|
90
90
|
"name": "index",
|
|
91
91
|
"src": "node_modules/@codemirror/lang-javascript/dist/index.js",
|
|
92
92
|
"isDynamicEntry": true,
|
|
93
93
|
"imports": [
|
|
94
94
|
"_index-B13lCSuc.js",
|
|
95
95
|
"src/wechat-preview/browser/studio/studio.html",
|
|
96
|
-
"_wechat-renderer-
|
|
96
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
99
|
"node_modules/@codemirror/lang-jinja/dist/index.js": {
|
|
100
|
-
"file": "assets/index-
|
|
100
|
+
"file": "assets/index-52O71prB.js",
|
|
101
101
|
"name": "index",
|
|
102
102
|
"src": "node_modules/@codemirror/lang-jinja/dist/index.js",
|
|
103
103
|
"isDynamicEntry": true,
|
|
@@ -105,24 +105,24 @@
|
|
|
105
105
|
"src/wechat-preview/browser/studio/studio.html",
|
|
106
106
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
107
107
|
"_index-B13lCSuc.js",
|
|
108
|
-
"_wechat-renderer-
|
|
108
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
109
109
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
110
110
|
"node_modules/@codemirror/lang-javascript/dist/index.js"
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
113
|
"node_modules/@codemirror/lang-json/dist/index.js": {
|
|
114
|
-
"file": "assets/index-
|
|
114
|
+
"file": "assets/index-BRUZEgPh.js",
|
|
115
115
|
"name": "index",
|
|
116
116
|
"src": "node_modules/@codemirror/lang-json/dist/index.js",
|
|
117
117
|
"isDynamicEntry": true,
|
|
118
118
|
"imports": [
|
|
119
119
|
"_index-B13lCSuc.js",
|
|
120
120
|
"src/wechat-preview/browser/studio/studio.html",
|
|
121
|
-
"_wechat-renderer-
|
|
121
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
122
122
|
]
|
|
123
123
|
},
|
|
124
124
|
"node_modules/@codemirror/lang-less/dist/index.js": {
|
|
125
|
-
"file": "assets/index-
|
|
125
|
+
"file": "assets/index-Dyi5bUmz.js",
|
|
126
126
|
"name": "index",
|
|
127
127
|
"src": "node_modules/@codemirror/lang-less/dist/index.js",
|
|
128
128
|
"isDynamicEntry": true,
|
|
@@ -130,11 +130,11 @@
|
|
|
130
130
|
"src/wechat-preview/browser/studio/studio.html",
|
|
131
131
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
132
132
|
"_index-B13lCSuc.js",
|
|
133
|
-
"_wechat-renderer-
|
|
133
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
136
|
"node_modules/@codemirror/lang-liquid/dist/index.js": {
|
|
137
|
-
"file": "assets/index-
|
|
137
|
+
"file": "assets/index-DkhSv5cA.js",
|
|
138
138
|
"name": "index",
|
|
139
139
|
"src": "node_modules/@codemirror/lang-liquid/dist/index.js",
|
|
140
140
|
"isDynamicEntry": true,
|
|
@@ -142,19 +142,19 @@
|
|
|
142
142
|
"src/wechat-preview/browser/studio/studio.html",
|
|
143
143
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
144
144
|
"_index-B13lCSuc.js",
|
|
145
|
-
"_wechat-renderer-
|
|
145
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
146
146
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
147
147
|
"node_modules/@codemirror/lang-javascript/dist/index.js"
|
|
148
148
|
]
|
|
149
149
|
},
|
|
150
150
|
"node_modules/@codemirror/lang-markdown/dist/index.js": {
|
|
151
|
-
"file": "assets/index-
|
|
151
|
+
"file": "assets/index-DmoEW40N.js",
|
|
152
152
|
"name": "index",
|
|
153
153
|
"src": "node_modules/@codemirror/lang-markdown/dist/index.js",
|
|
154
154
|
"isDynamicEntry": true,
|
|
155
155
|
"imports": [
|
|
156
156
|
"src/wechat-preview/browser/studio/studio.html",
|
|
157
|
-
"_wechat-renderer-
|
|
157
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
158
158
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
159
159
|
"_index-B13lCSuc.js",
|
|
160
160
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
]
|
|
163
163
|
},
|
|
164
164
|
"node_modules/@codemirror/lang-php/dist/index.js": {
|
|
165
|
-
"file": "assets/index-
|
|
165
|
+
"file": "assets/index-Btrc4kp0.js",
|
|
166
166
|
"name": "index",
|
|
167
167
|
"src": "node_modules/@codemirror/lang-php/dist/index.js",
|
|
168
168
|
"isDynamicEntry": true,
|
|
@@ -170,35 +170,35 @@
|
|
|
170
170
|
"_index-B13lCSuc.js",
|
|
171
171
|
"src/wechat-preview/browser/studio/studio.html",
|
|
172
172
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
173
|
-
"_wechat-renderer-
|
|
173
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
174
174
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
175
175
|
"node_modules/@codemirror/lang-javascript/dist/index.js"
|
|
176
176
|
]
|
|
177
177
|
},
|
|
178
178
|
"node_modules/@codemirror/lang-python/dist/index.js": {
|
|
179
|
-
"file": "assets/index-
|
|
179
|
+
"file": "assets/index-BOZWI3FE.js",
|
|
180
180
|
"name": "index",
|
|
181
181
|
"src": "node_modules/@codemirror/lang-python/dist/index.js",
|
|
182
182
|
"isDynamicEntry": true,
|
|
183
183
|
"imports": [
|
|
184
184
|
"_index-B13lCSuc.js",
|
|
185
185
|
"src/wechat-preview/browser/studio/studio.html",
|
|
186
|
-
"_wechat-renderer-
|
|
186
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
187
187
|
]
|
|
188
188
|
},
|
|
189
189
|
"node_modules/@codemirror/lang-rust/dist/index.js": {
|
|
190
|
-
"file": "assets/index-
|
|
190
|
+
"file": "assets/index-Cbm1GiZg.js",
|
|
191
191
|
"name": "index",
|
|
192
192
|
"src": "node_modules/@codemirror/lang-rust/dist/index.js",
|
|
193
193
|
"isDynamicEntry": true,
|
|
194
194
|
"imports": [
|
|
195
195
|
"_index-B13lCSuc.js",
|
|
196
196
|
"src/wechat-preview/browser/studio/studio.html",
|
|
197
|
-
"_wechat-renderer-
|
|
197
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
198
198
|
]
|
|
199
199
|
},
|
|
200
200
|
"node_modules/@codemirror/lang-sass/dist/index.js": {
|
|
201
|
-
"file": "assets/index-
|
|
201
|
+
"file": "assets/index-ButcQVWD.js",
|
|
202
202
|
"name": "index",
|
|
203
203
|
"src": "node_modules/@codemirror/lang-sass/dist/index.js",
|
|
204
204
|
"isDynamicEntry": true,
|
|
@@ -206,22 +206,22 @@
|
|
|
206
206
|
"_index-B13lCSuc.js",
|
|
207
207
|
"src/wechat-preview/browser/studio/studio.html",
|
|
208
208
|
"node_modules/@codemirror/lang-css/dist/index.js",
|
|
209
|
-
"_wechat-renderer-
|
|
209
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
210
210
|
]
|
|
211
211
|
},
|
|
212
212
|
"node_modules/@codemirror/lang-sql/dist/index.js": {
|
|
213
|
-
"file": "assets/index-
|
|
213
|
+
"file": "assets/index-BoIlqlZt.js",
|
|
214
214
|
"name": "index",
|
|
215
215
|
"src": "node_modules/@codemirror/lang-sql/dist/index.js",
|
|
216
216
|
"isDynamicEntry": true,
|
|
217
217
|
"imports": [
|
|
218
218
|
"src/wechat-preview/browser/studio/studio.html",
|
|
219
219
|
"_index-B13lCSuc.js",
|
|
220
|
-
"_wechat-renderer-
|
|
220
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
221
221
|
]
|
|
222
222
|
},
|
|
223
223
|
"node_modules/@codemirror/lang-vue/dist/index.js": {
|
|
224
|
-
"file": "assets/index-
|
|
224
|
+
"file": "assets/index-D7f6KXoI.js",
|
|
225
225
|
"name": "index",
|
|
226
226
|
"src": "node_modules/@codemirror/lang-vue/dist/index.js",
|
|
227
227
|
"isDynamicEntry": true,
|
|
@@ -230,41 +230,41 @@
|
|
|
230
230
|
"node_modules/@codemirror/lang-html/dist/index.js",
|
|
231
231
|
"node_modules/@codemirror/lang-javascript/dist/index.js",
|
|
232
232
|
"_index-B13lCSuc.js",
|
|
233
|
-
"_wechat-renderer-
|
|
233
|
+
"_wechat-renderer-GrfbOjo2.js",
|
|
234
234
|
"node_modules/@codemirror/lang-css/dist/index.js"
|
|
235
235
|
]
|
|
236
236
|
},
|
|
237
237
|
"node_modules/@codemirror/lang-wast/dist/index.js": {
|
|
238
|
-
"file": "assets/index-
|
|
238
|
+
"file": "assets/index-BXjcry0g.js",
|
|
239
239
|
"name": "index",
|
|
240
240
|
"src": "node_modules/@codemirror/lang-wast/dist/index.js",
|
|
241
241
|
"isDynamicEntry": true,
|
|
242
242
|
"imports": [
|
|
243
243
|
"src/wechat-preview/browser/studio/studio.html",
|
|
244
244
|
"_index-B13lCSuc.js",
|
|
245
|
-
"_wechat-renderer-
|
|
245
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
246
246
|
]
|
|
247
247
|
},
|
|
248
248
|
"node_modules/@codemirror/lang-xml/dist/index.js": {
|
|
249
|
-
"file": "assets/index-
|
|
249
|
+
"file": "assets/index-sgpqKtmR.js",
|
|
250
250
|
"name": "index",
|
|
251
251
|
"src": "node_modules/@codemirror/lang-xml/dist/index.js",
|
|
252
252
|
"isDynamicEntry": true,
|
|
253
253
|
"imports": [
|
|
254
254
|
"_index-B13lCSuc.js",
|
|
255
255
|
"src/wechat-preview/browser/studio/studio.html",
|
|
256
|
-
"_wechat-renderer-
|
|
256
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
257
257
|
]
|
|
258
258
|
},
|
|
259
259
|
"node_modules/@codemirror/lang-yaml/dist/index.js": {
|
|
260
|
-
"file": "assets/index-
|
|
260
|
+
"file": "assets/index-C-LFn5io.js",
|
|
261
261
|
"name": "index",
|
|
262
262
|
"src": "node_modules/@codemirror/lang-yaml/dist/index.js",
|
|
263
263
|
"isDynamicEntry": true,
|
|
264
264
|
"imports": [
|
|
265
265
|
"_index-B13lCSuc.js",
|
|
266
266
|
"src/wechat-preview/browser/studio/studio.html",
|
|
267
|
-
"_wechat-renderer-
|
|
267
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
268
268
|
]
|
|
269
269
|
},
|
|
270
270
|
"node_modules/@codemirror/legacy-modes/mode/apl.js": {
|
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
"src": "src/wechat-preview/browser/editor-export.ts",
|
|
1086
1086
|
"isEntry": true,
|
|
1087
1087
|
"imports": [
|
|
1088
|
-
"_wechat-renderer-
|
|
1088
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
1089
1089
|
]
|
|
1090
1090
|
},
|
|
1091
1091
|
"src/wechat-preview/browser/studio/studio.html": {
|
|
@@ -1094,7 +1094,7 @@
|
|
|
1094
1094
|
"src": "src/wechat-preview/browser/studio/studio.html",
|
|
1095
1095
|
"isEntry": true,
|
|
1096
1096
|
"imports": [
|
|
1097
|
-
"_wechat-renderer-
|
|
1097
|
+
"_wechat-renderer-GrfbOjo2.js"
|
|
1098
1098
|
],
|
|
1099
1099
|
"dynamicImports": [
|
|
1100
1100
|
"node_modules/@codemirror/lang-sql/dist/index.js",
|
|
@@ -1297,7 +1297,7 @@
|
|
|
1297
1297
|
]
|
|
1298
1298
|
},
|
|
1299
1299
|
"style.css": {
|
|
1300
|
-
"file": "assets/style-
|
|
1300
|
+
"file": "assets/style-CVnSjpTH.css",
|
|
1301
1301
|
"src": "style.css"
|
|
1302
1302
|
}
|
|
1303
1303
|
}
|
package/src/wechat-preview/assets/browser-dist/assets/{index-BHJY0B4E.js → index-52O71prB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as Ps,S as Tt,a as Cs,p as Qs,e as As,L as Ts,s as Ms,t as C,i as Rs,h as Ds,f as $s}from"../studio.js";import{html as Es}from"./index-
|
|
1
|
+
import{l as Ps,S as Tt,a as Cs,p as Qs,e as As,L as Ts,s as Ms,t as C,i as Rs,h as Ds,f as $s}from"../studio.js";import{html as Es}from"./index-C1Bxnw4o.js";import{L as Bs,E as On,a as Ls}from"./index-B13lCSuc.js";import"./wechat-renderer-GrfbOjo2.js";import"./index-BTPh91V-.js";import"./index-C2N6r4Fw.js";class k{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Mt(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),et.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Mt(this,t,e);let i=[];return this.decompose(t,e,i,0),et.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new Ht(this),s=new Ht(t);for(let o=e,l=e;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new Ht(this,t)}iterRange(t,e=this.length){return new mn(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Sn(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?k.empty:t.length<=32?new D(t):et.from(D.split(t,[]))}}class D extends k{constructor(t,e=Ws(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let s=0;;s++){let o=this.text[s],l=n+o.length;if((e?i:l)>=t)return new Is(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let s=t<=0&&e>=this.length?this:new D(Di(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=ge(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new D(l,o.length+s.length));else{let a=l.length>>1;i.push(new D(l.slice(0,a)),new D(l.slice(a)))}}else i.push(s)}replace(t,e,i){if(!(i instanceof D))return super.replace(t,e,i);[t,e]=Mt(this,t,e);let n=ge(this.text,ge(i.text,Di(this.text,0,t)),e),s=this.length+i.length-(e-t);return n.length<=32?new D(n,s):et.from(D.split(n,[]),s)}sliceString(t,e=this.length,i=`
|
|
2
2
|
`){[t,e]=Mt(this,t,e);let n="";for(let s=0,o=0;s<=e&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>t&&o&&(n+=i),t<a&&e>s&&(n+=l.slice(Math.max(0,t-s),e-s)),s=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let s of t)i.push(s),n+=s.length+1,i.length==32&&(e.push(new D(i,n)),i=[],n=-1);return n>-1&&e.push(new D(i,n)),e}}class et extends k{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let s=0;;s++){let o=this.children[s],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let s=0,o=0;o<=e&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(t<=a&&e>=o){let h=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!h?i.push(l):l.decompose(t-o,e-o,i,h)}o=a+1}}replace(t,e,i){if([t,e]=Mt(this,t,e),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let o=this.children[n],l=s+o.length;if(t>=s&&e<=l){let a=o.replace(t-s,e-s,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[n]=a,new et(c,this.length-(e-t)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=`
|
|
3
3
|
`){[t,e]=Mt(this,t,e);let n="";for(let s=0,o=0;s<this.children.length&&o<=e;s++){let l=this.children[s],a=o+l.length;o>t&&s&&(n+=i),t<a&&e>o&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof et))return 0;let i=0,[n,s,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,s+=e){if(n==o||s==l)return i;let a=this.children[n],h=t.children[s];if(a!=h)return i+a.scanIdentical(h,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let g of t)g.flatten(d);return new D(d,e)}let n=Math.max(32,i>>5),s=n<<1,o=n>>1,l=[],a=0,h=-1,c=[];function f(d){let g;if(d.lines>s&&d instanceof et)for(let p of d.children)f(p);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof D&&a&&(g=c[c.length-1])instanceof D&&d.lines+g.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new D(g.text.concat(d.text),g.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:et.from(c,h)),h=-1,a=c.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new et(l,e)}}k.empty=new D([""],0);function Ws(r){let t=-1;for(let e of r)t+=e.length+1;return t}function ge(r,t,e=0,i=1e9){for(let n=0,s=0,o=!0;s<r.length&&n<=i;s++){let l=r[s],a=n+l.length;a>=e&&(a>i&&(l=l.slice(0,i-n)),n<e&&(l=l.slice(e-n)),o?(t[t.length-1]+=l,o=!1):t.push(l)),n=a+1}return t}function Di(r,t,e){return ge(r,[""],t,e)}class Ht{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof D?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],o=s>>1,l=n instanceof D?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;t--}else if(n instanceof D){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof D?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class mn{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new Ht(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Sn{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(k.prototype[Symbol.iterator]=function(){return this.iter()},Ht.prototype[Symbol.iterator]=mn.prototype[Symbol.iterator]=Sn.prototype[Symbol.iterator]=function(){return this});class Is{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Mt(r,t,e){return t=Math.max(0,Math.min(r.length,t)),[t,Math.max(t,Math.min(r.length,e))]}function nt(r,t,e=!0,i=!0){return Ps(r,t,e,i)}const Xe=/\r\n?|\n/;var U=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(U||(U={}));class at{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let s=this.sections[e++],o=this.sections[e++];o<0?(t(i,n,s),n+=s):n+=o,i+=s}}iterChangedRanges(t,e=!1){Ze(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new at(t)}composeDesc(t){return this.empty?t:t.empty?this:bn(this,t)}mapDesc(t,e=!1){return t.empty?this:qe(this,t,e)}mapPos(t,e=-1,i=U.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=n+l;if(a<0){if(h>t)return s+(t-n);s+=l}else{if(i!=U.Simple&&h>=t&&(i==U.TrackDel&&n<t&&h>t||i==U.TrackBefore&&n<t||i==U.TrackAfter&&h>t))return null;if(h>t||h==t&&e<0&&!l)return t==n||e<0?s:s+a;s+=a}n=h}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return s}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let s=this.sections[i++],o=this.sections[i++],l=n+s;if(o>=0&&n<=e&&l>=t)return n<t&&l>e?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new at(t)}static create(t){return new at(t)}}class E extends at{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Ze(this,(e,i,n,s,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return qe(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,s=0;n<e.length;n+=2){let o=e[n],l=e[n+1];if(l>=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length<a;)i.push(k.empty);i.push(o?t.slice(s,s+o):k.empty)}s+=o}return new E(e,i)}compose(t){return this.empty?t:t.empty?this:bn(this,t,!0)}map(t,e=!1){return t.empty?this:qe(this,t,e,!0)}iterChanges(t,e=!1){Ze(this,t,e)}get desc(){return at.create(this.sections)}filter(t){let e=[],i=[],n=[],s=new Ut(this);t:for(let o=0,l=0;;){let a=o==t.length?1e9:t[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break t;let c=Math.min(s.len,a-l);F(n,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;F(e,c,f),f>0&&ut(i,e,s.text),s.forward(c),l+=c}let h=t[o++];for(;l<h;){if(s.done)break t;let c=Math.min(s.len,h-l);F(e,c,-1),F(n,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),l+=c}}return{changes:new E(e,i),filtered:at.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):n==0?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!n.length)return;o<e&&F(n,e-o,-1);let f=new E(n,s);l=l?l.compose(f.map(l)):f,n=[],s=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof E){if(c.length!=e)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${e})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let g=d?typeof d=="string"?k.of(d.split(i||Xe)):d:k.empty,p=g.length;if(f==u&&p==0)return;f<o&&a(),f>o&&F(n,f-o,-1),F(n,u-f,p),ut(s,n,g),o=u}}return h(t),a(!l),l}static empty(t){return new E(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let s=t[n];if(typeof s=="number")e.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)e.push(s[0],0);else{for(;i.length<n;)i.push(k.empty);i[n]=k.of(s.slice(1)),e.push(s[0],i[n].length)}}}return new E(e,i)}static createSet(t,e){return new E(t,e)}}function F(r,t,e,i=!1){if(t==0&&e<=0)return;let n=r.length-2;n>=0&&e<=0&&e==r[n+1]?r[n]+=t:n>=0&&t==0&&r[n]==0?r[n+1]+=e:i?(r[n]+=t,r[n+1]+=e):r.push(t,e)}function ut(r,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i<r.length)r[r.length-1]=r[r.length-1].append(e);else{for(;r.length<i;)r.push(k.empty);r.push(e)}}function Ze(r,t,e){let i=r.inserted;for(let n=0,s=0,o=0;o<r.sections.length;){let l=r.sections[o++],a=r.sections[o++];if(a<0)n+=l,s+=l;else{let h=n,c=s,f=k.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(e||o==r.sections.length||r.sections[o+1]<0);)l=r.sections[o++],a=r.sections[o++];t(n,h,s,c,f),n=h,s=c}}}function qe(r,t,e,i=!1){let n=[],s=i?[]:null,o=new Ut(r),l=new Ut(t);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);F(n,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!e))){let h=l.len;for(F(n,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(F(n,0,o.ins),s&&ut(s,n,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;F(n,h,a<o.i?o.ins:0),s&&a<o.i&&ut(s,n,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return s?E.createSet(n,s):at.create(n);throw new Error("Mismatched change set lengths")}}}function bn(r,t,e=!1){let i=[],n=e?[]:null,s=new Ut(r),o=new Ut(t);for(let l=!1;;){if(s.done&&o.done)return n?E.createSet(i,n):at.create(i);if(s.ins==0)F(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)F(i,0,o.ins,l),n&&ut(n,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),h=i.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;F(i,a,c,l),n&&c&&ut(n,i,o.text)}else o.ins==-1?(F(i,s.off?0:s.len,a,l),n&&ut(n,i,s.textBit(a))):(F(i,s.off?0:s.len,o.off?0:o.ins,l),n&&!o.off&&ut(n,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}}}class Ut{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?k.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?k.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ft{constructor(t,e,i,n){this.from=t,this.to=e,this.flags=i,this.goalColumn=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new ft(i,n,this.flags,this.goalColumn)}extend(t,e=t,i=0){if(t<=this.anchor&&e>=this.anchor)return S.range(t,e,void 0,void 0,i);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return S.range(this.anchor,n,void 0,void 0,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(t.anchor,t.head)}static create(t,e,i,n){return new ft(t,e,i,n)}}class S{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:S.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new S([this.main],0)}addRange(t,e=!0){return S.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,S.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new S(t.ranges.map(e=>ft.fromJSON(e)),t.main)}static single(t,e=t){return new S([S.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let s=t[n];if(s.empty?s.from<=i:s.from<i)return S.normalized(t.slice(),e);i=s.to}return new S(t,e)}static cursor(t,e=0,i,n){return ft.create(t,t,(e==0?0:e<0?8:16)|(i==null?7:Math.min(6,i)),n)}static range(t,e,i,n,s){let o=n==null?7:Math.min(6,n);return!s&&t!=e&&(s=e<t?1:-1),s&&(o|=s<0?8:16),e<t?ft.create(e,t,o|32,i):ft.create(t,e,o,i)}static undirectionalRange(t,e){return ft.create(t,e,64,void 0)}static normalized(t,e=0){let i=t[e];t.sort((n,s)=>n.from-s.from),e=t.indexOf(i);for(let n=1;n<t.length;n++){let s=t[n],o=t[n-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);n<=e&&e--,t.splice(--n,2,s.anchor>s.head?S.range(a,l):S.range(l,a))}}return new S(t,e)}}function wn(r,t){for(let e of r.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let Si=0;class x{constructor(t,e,i,n,s){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=Si++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new x(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:bi),!!t.static,t.enables)}of(t){return new pe([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new pe(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new pe(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function bi(r,t){return r==t||r.length==t.length&&r.every((e,i)=>e===t[i])}class pe{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=Si++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((e=t[f.id])!==null&&e!==void 0?e:1)&1)==0&&c.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Ue(f,c)){let d=i(f);if(l?!$i(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,g=u.config.address[s];if(g!=null){let p=be(u,g);if(this.dependencies.every(O=>O instanceof x?u.facet(O)===f.facet(O):O instanceof Lt?u.field(O,!1)==f.field(O,!1):!0)||(l?$i(d=i(f),p,n):n(d=i(f),p)))return f.values[o]=p,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}}function $i(r,t,e){if(r.length!=t.length)return!1;for(let i=0;i<r.length;i++)if(!e(r[i],t[i]))return!1;return!0}function Ue(r,t){let e=!1;for(let i of t)zt(r,i)&1&&(e=!0);return e}function Vs(r,t,e){let i=e.map(a=>r[a.id]),n=e.map(a=>a.type),s=i.filter(a=>!(a&1)),o=r[t.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=be(a,i[c]);if(n[c]==2)for(let u of f)h.push(u);else h.push(f)}return t.combine(h)}return{create(a){for(let h of i)zt(a,h);return a.values[o]=l(a),1},update(a,h){if(!Ue(a,s))return 0;let c=l(a);return t.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=Ue(a,i),f=h.config.facets[t.id],u=h.facet(t);if(f&&!c&&bi(e,f))return a.values[o]=u,0;let d=l(a);return t.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const se=x.define({static:!0});class Lt{constructor(t,e,i,n,s){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(t){let e=new Lt(Si++,t.create,t.update,t.compare||((i,n)=>i===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(se).find(i=>i.field==this);return(e?.create||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let s=i.values[e],o=this.updateF(s,n);return this.compareF(s,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>{let s=i.facet(se),o=n.facet(se),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[e]=l.create(i),1):n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}}init(t){return[this,se.of({field:this,create:t})]}get extension(){return this}}const Ot={lowest:4,low:3,default:2,high:1,highest:0};function It(r){return t=>new vn(t,r)}const Fs={highest:It(Ot.highest),high:It(Ot.high),default:It(Ot.default),low:It(Ot.low),lowest:It(Ot.lowest)};class vn{constructor(t,e){this.inner=t,this.prec=e}get extension(){return this}}class Ae{of(t){return new je(this,t)}reconfigure(t){return Ae.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class je{constructor(t,e){this.compartment=t,this.inner=e}get extension(){return this}}class Se{constructor(t,e,i,n,s,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],s=Object.create(null),o=new Map;for(let u of Ns(t,e,o))u instanceof Lt?n.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of n)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in s){let d=s[u],g=d[0].facet,p=c&&c[u]||[];if(d.every(O=>O.type==0))if(l[g.id]=a.length<<1|1,bi(p,d))a.push(i.facet(g));else{let O=g.combine(d.map(m=>m.value));a.push(i&&g.compare(O,i.facet(g))?i.facet(g):O)}else{for(let O of d)O.type==0?(l[O.id]=a.length<<1|1,a.push(O.value)):(l[O.id]=h.length<<1,h.push(m=>O.dynamicSlot(m)));l[g.id]=h.length<<1,h.push(O=>Vs(O,g,d))}}let f=h.map(u=>u(l));return new Se(t,o,f,l,a,s)}}function Ns(r,t,e){let i=[[],[],[],[],[]],n=new Map;function s(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof je&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof je){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=t.get(o.compartment)||o.inner;e.set(o.compartment,h),s(h,l)}else if(o instanceof vn)s(o.inner,o.prec);else if(o instanceof Lt)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof pe)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Ot.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(r,Ot.default),i.reduce((o,l)=>o.concat(l))}function zt(r,t){if(t&1)return 2;let e=t>>1,i=r.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[e]=4;let n=r.computeSlot(r,r.config.dynamicSlots[e]);return r.status[e]=2|n}function be(r,t){return t&1?r.config.staticValues[t>>1]:r.values[t>>1]}const xn=x.define(),Ye=x.define({combine:r=>r.some(t=>t),static:!0}),yn=x.define({combine:r=>r.length?r[0]:void 0,static:!0}),kn=x.define(),Pn=x.define(),Cn=x.define(),Qn=x.define({combine:r=>r.length?r[0]:!1});class Wt{constructor(t,e){this.type=t,this.value=e}static define(){return new Hs}}class Hs{of(t){return new Wt(this,t)}}class zs{constructor(t){this.map=t}of(t){return new B(this,t)}}class B{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new B(this.type,e)}is(t){return this.type==t}static define(t={}){return new zs(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let s=n.map(e);s&&i.push(s)}return i}}B.reconfigure=B.define();B.appendConfig=B.define();class N{constructor(t,e,i,n,s,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&wn(i,e.newLength),s.some(l=>l.type==N.time)||(this.annotations=s.concat(N.time.of(Date.now())))}static create(t,e,i,n,s,o){return new N(t,e,i,n,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(N.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}N.time=Wt.define();N.userEvent=Wt.define();N.addToHistory=Wt.define();N.remote=Wt.define();function Gs(r,t){let e=[];for(let i=0,n=0;;){let s,o;if(i<r.length&&(n==t.length||t[n]>=r[i]))s=r[i++],o=r[i++];else if(n<t.length)s=t[n++],o=t[n++];else return e;!e.length||e[e.length-1]<s?e.push(s,o):e[e.length-1]<o&&(e[e.length-1]=o)}}function An(r,t,e){var i;let n,s,o;return e?(n=t.changes,s=E.empty(t.changes.length),o=r.changes.compose(t.changes)):(n=t.changes.map(r.changes),s=r.changes.mapDesc(t.changes,!0),o=r.changes.compose(n)),{changes:o,selection:t.selection?t.selection.map(s):(i=r.selection)===null||i===void 0?void 0:i.map(n),effects:B.mapEffects(r.effects,n).concat(B.mapEffects(t.effects,s)),annotations:r.annotations.length?r.annotations.concat(t.annotations):t.annotations,scrollIntoView:r.scrollIntoView||t.scrollIntoView}}function Ke(r,t,e){let i=t.selection,n=Pt(t.annotations);return t.userEvent&&(n=n.concat(N.userEvent.of(t.userEvent))),{changes:t.changes instanceof E?t.changes:E.of(t.changes||[],e,r.facet(yn)),selection:i&&(i instanceof S?i:S.single(i.anchor,i.head)),effects:Pt(t.effects),annotations:n,scrollIntoView:!!t.scrollIntoView}}function Tn(r,t,e){let i=Ke(r,t.length?t[0]:{},r.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let s=1;s<t.length;s++){t[s].filter===!1&&(e=!1);let o=!!t[s].sequential;i=An(i,Ke(r,t[s],o?i.changes.newLength:r.doc.length),o)}let n=N.create(r,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Zs(e?Xs(n):n)}function Xs(r){let t=r.startState,e=!0;for(let n of t.facet(kn)){let s=n(r);if(s===!1){e=!1;break}Array.isArray(s)&&(e=e===!0?s:Gs(e,s))}if(e!==!0){let n,s;if(e===!1)s=r.changes.invertedDesc,n=E.empty(t.doc.length);else{let o=r.changes.filter(e);n=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}r=N.create(t,n,r.selection&&r.selection.map(s),B.mapEffects(r.effects,s),r.annotations,r.scrollIntoView)}let i=t.facet(Pn);for(let n=i.length-1;n>=0;n--){let s=i[n](r);s instanceof N?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof N?r=s[0]:r=Tn(t,Pt(s),!1)}return r}function Zs(r){let t=r.startState,e=t.facet(Cn),i=r;for(let n=e.length-1;n>=0;n--){let s=e[n](r);s&&Object.keys(s).length&&(i=An(i,Ke(t,s,r.changes.newLength),!0))}return i==r?r:N.create(t,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const qs=[];function Pt(r){return r==null?qs:Array.isArray(r)?r:[r]}var ot=(function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r})(ot||(ot={}));const Us=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let _e;try{_e=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function js(r){if(_e)return _e.test(r);for(let t=0;t<r.length;t++){let e=r[t];if(/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Us.test(e)))return!0}return!1}function Ys(r){return t=>{if(!/\S/.test(t))return ot.Space;if(js(t))return ot.Word;for(let e=0;e<r.length;e++)if(t.indexOf(r[e])>-1)return ot.Word;return ot.Other}}class T{constructor(t,e,i,n,s,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)zt(this,l<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(i==null){if(e)throw new RangeError("Field is not present in this state");return}return zt(this,i),be(this,i)}update(...t){return Tn(this,t,!0)}applyTransaction(t){let e=this.config,{base:i,compartments:n}=e;for(let l of t.effects)l.is(Ae.reconfigure)?(e&&(n=new Map,e.compartments.forEach((a,h)=>n.set(h,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(B.reconfigure)?(e=null,i=l.value):l.is(B.appendConfig)&&(e=null,i=Pt(i).concat(l.value));let s;e?s=t.startState.values.slice():(e=Se.resolve(i,n,this),s=new T(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=t.startState.facet(Ye)?t.newSelection:t.newSelection.asSingle();new T(e,t.newDoc,o,s,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:S.cursor(e.from+t.length,-1)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),s=[i.range],o=Pt(i.effects);for(let l=1;l<e.ranges.length;l++){let a=t(e.ranges[l]),h=this.changes(a.changes),c=h.map(n);for(let u=0;u<l;u++)s[u]=s[u].map(c);let f=n.mapDesc(h,!0);s.push(a.range.map(f)),n=n.compose(c),o=B.mapEffects(o,c).concat(B.mapEffects(Pt(a.effects),f))}return{changes:n,selection:S.create(s,e.mainIndex),effects:o}}changes(t=[]){return t instanceof E?t:E.of(t,this.doc.length,this.facet(T.lineSeparator))}toText(t){return k.of(t.split(this.facet(T.lineSeparator)||Xe))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(zt(this,e),be(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof Lt&&this.config.address[n.id]!=null&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(t,s)){let o=i[s],l=t[s];n.push(o.init(a=>o.spec.fromJSON(l,a)))}}return T.create({doc:t.doc,selection:S.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=Se.resolve(t.extensions||[],new Map),i=t.doc instanceof k?t.doc:k.of((t.doc||"").split(e.staticFacet(T.lineSeparator)||Xe)),n=t.selection?t.selection instanceof S?t.selection:S.single(t.selection.anchor,t.selection.head):S.single(0);return wn(n,i.length),e.staticFacet(Ye)||(n=n.asSingle()),new T(e,i,n,e.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(T.tabSize)}get lineBreak(){return this.facet(T.lineSeparator)||`
|