kennel 0.2.1 → 0.2.3

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.
Files changed (872) hide show
  1. package/README.md +18 -5
  2. package/dist/cli/dispatch.js +9 -0
  3. package/dist/cli/src/automations/notifications.d.ts +40 -0
  4. package/dist/cli/src/automations/notifications.js +220 -0
  5. package/dist/cli/src/cli/dispatch.d.ts +1 -0
  6. package/dist/cli/src/cli/dispatch.js +125 -0
  7. package/dist/cli/src/cli/usage.d.ts +1 -0
  8. package/dist/cli/src/cli/usage.js +25 -0
  9. package/dist/cli/src/core/api-client.d.ts +13 -0
  10. package/dist/cli/src/core/api-client.js +1 -0
  11. package/dist/cli/src/core/command.d.ts +1 -0
  12. package/dist/cli/src/core/command.js +69 -0
  13. package/dist/cli/src/core/core-folders.d.ts +1 -0
  14. package/dist/cli/src/core/core-folders.js +42 -0
  15. package/dist/cli/src/core/init.d.ts +1 -0
  16. package/dist/cli/src/core/init.js +141 -0
  17. package/dist/cli/src/core/runtime.d.ts +14 -0
  18. package/dist/cli/src/core/runtime.js +1 -0
  19. package/dist/cli/src/deploy/cloudflare.d.ts +6 -0
  20. package/dist/cli/src/deploy/cloudflare.js +100 -0
  21. package/dist/cli/src/deploy/environment.d.ts +2 -0
  22. package/dist/cli/src/deploy/environment.js +47 -0
  23. package/dist/cli/src/deploy/smoke-tests.d.ts +4 -0
  24. package/dist/cli/src/deploy/smoke-tests.js +92 -0
  25. package/dist/cli/src/deploy/trigger-dev.d.ts +2 -0
  26. package/dist/cli/src/deploy/trigger-dev.js +255 -0
  27. package/dist/cli/src/deploy/vercel.d.ts +3 -0
  28. package/dist/cli/src/deploy/vercel.js +67 -0
  29. package/dist/cli/src/main.d.ts +1 -0
  30. package/dist/cli/src/main.js +9 -0
  31. package/dist/cli/src/mcp/agent-tools.d.ts +8 -0
  32. package/dist/cli/src/mcp/agent-tools.js +247 -0
  33. package/dist/cli/src/mcp/config.d.ts +25 -0
  34. package/dist/cli/src/mcp/config.js +185 -0
  35. package/dist/cli/src/mcp/function-source.d.ts +7 -0
  36. package/dist/cli/src/mcp/function-source.js +42 -0
  37. package/dist/cli/src/mcp/generate.d.ts +1 -0
  38. package/dist/cli/src/mcp/generate.js +47 -0
  39. package/dist/cli/src/mcp/install-page.d.ts +12 -0
  40. package/dist/cli/src/mcp/install-page.js +5 -0
  41. package/dist/cli/src/notifications/email-worker.d.ts +8 -0
  42. package/dist/cli/src/notifications/email-worker.js +137 -0
  43. package/dist/cli/src/package/mcp-data.d.ts +1 -0
  44. package/dist/cli/src/package/mcp-data.js +1 -0
  45. package/dist/cli/src/package/mcp-email-worker.d.ts +1 -0
  46. package/dist/cli/src/package/mcp-email-worker.js +1 -0
  47. package/dist/cli/src/package/mcp-http.d.ts +1 -0
  48. package/dist/cli/src/package/mcp-http.js +1 -0
  49. package/dist/cli/src/package/mcp-stdio.d.ts +1 -0
  50. package/dist/cli/src/package/mcp-stdio.js +1 -0
  51. package/dist/cli/src/package/mcp.d.ts +1 -0
  52. package/dist/cli/src/package/mcp.js +1 -0
  53. package/dist/cli/src/package/preview.d.ts +9 -0
  54. package/dist/cli/src/package/preview.js +1 -0
  55. package/dist/cli/src/plugins/external.d.ts +36 -0
  56. package/dist/cli/src/plugins/external.js +503 -0
  57. package/dist/cli/src/publish/cloudflare-init.d.ts +12 -0
  58. package/dist/cli/src/publish/cloudflare-init.js +101 -0
  59. package/dist/cli/src/publish/config.d.ts +28 -0
  60. package/dist/cli/src/publish/config.js +178 -0
  61. package/dist/cli/src/publish/options.d.ts +13 -0
  62. package/dist/cli/src/publish/options.js +78 -0
  63. package/dist/cli/src/publish/vercel-init.d.ts +9 -0
  64. package/dist/cli/src/publish/vercel-init.js +52 -0
  65. package/dist/cli/src/shared/json.d.ts +4 -0
  66. package/dist/cli/src/shared/json.js +56 -0
  67. package/dist/cli/src/shared/object.d.ts +2 -0
  68. package/dist/cli/src/shared/object.js +3 -0
  69. package/dist/cli/src/shared/package-manager.d.ts +11 -0
  70. package/dist/cli/src/shared/package-manager.js +39 -0
  71. package/dist/cli/src/shared/path.d.ts +4 -0
  72. package/dist/cli/src/shared/path.js +40 -0
  73. package/dist/cli/src/shared/process.d.ts +7 -0
  74. package/dist/cli/src/shared/process.js +12 -0
  75. package/dist/cli/src/shared/project-config.d.ts +2 -0
  76. package/dist/cli/src/shared/project-config.js +26 -0
  77. package/dist/cli/src/site/dev.d.ts +10 -0
  78. package/dist/cli/src/site/dev.js +126 -0
  79. package/dist/cli/src/site/extension.d.ts +8 -0
  80. package/dist/cli/src/site/extension.js +113 -0
  81. package/dist/cli/src/site/folder-icons.d.ts +46 -0
  82. package/dist/cli/src/site/folder-icons.js +86 -0
  83. package/dist/cli/src/site/hot-viewer.d.ts +2 -0
  84. package/dist/cli/src/site/hot-viewer.js +231 -0
  85. package/dist/cli/src/site/kinds.d.ts +1 -0
  86. package/dist/cli/src/site/kinds.js +1 -0
  87. package/dist/cli/src/site/mail.d.ts +1 -0
  88. package/dist/cli/src/site/mail.js +10 -0
  89. package/dist/cli/src/site/renderers.d.ts +61 -0
  90. package/dist/cli/src/site/renderers.js +219 -0
  91. package/dist/cli/src/site/server-plugins.d.ts +54 -0
  92. package/dist/cli/src/site/server-plugins.js +1 -0
  93. package/dist/cli/src/site/viewer.d.ts +36 -0
  94. package/dist/cli/src/site/viewer.js +352 -0
  95. package/dist/cli/src/site/vitepress.d.ts +1 -0
  96. package/dist/cli/src/site/vitepress.js +1 -0
  97. package/dist/cli/usage.js +1 -0
  98. package/dist/core/api-client.js +75 -44
  99. package/dist/core/command.js +6 -3
  100. package/dist/core/core-folders.js +38280 -33
  101. package/dist/core/init.js +59 -4
  102. package/dist/core/runtime.js +57163 -41853
  103. package/dist/package/preview.js +40589 -17894
  104. package/dist/plugins/external.d.ts +36 -0
  105. package/dist/plugins/external.js +503 -0
  106. package/dist/site/server-plugins.js +394 -59
  107. package/dist/site/viewer.js +18 -5
  108. package/kernel/apps/web/.env.example +11 -0
  109. package/kernel/apps/web/components.json +20 -0
  110. package/kernel/apps/web/eslint.config.mjs +60 -0
  111. package/kernel/apps/web/index.html +17 -0
  112. package/kernel/apps/web/package.json +79 -0
  113. package/kernel/apps/web/public/favicon.svg +6 -0
  114. package/kernel/apps/web/public/providers/claude.svg +1 -0
  115. package/kernel/apps/web/public/providers/codex.svg +1 -0
  116. package/kernel/apps/web/public/providers/cursor.svg +1 -0
  117. package/kernel/apps/web/public/providers/opencode.svg +1 -0
  118. package/kernel/apps/web/public/providers/pi.svg +1 -0
  119. package/kernel/apps/web/server/acp/index.ts +1 -0
  120. package/kernel/apps/web/server/acp/live-agent-connection.ts +1 -0
  121. package/kernel/apps/web/server/acp/process-manager.ts +1 -0
  122. package/kernel/apps/web/server/acp/registry.ts +1 -0
  123. package/kernel/apps/web/server/acp/sdk.ts +1 -0
  124. package/kernel/apps/web/server/acp/transport.ts +1 -0
  125. package/kernel/apps/web/server/acp/types.ts +1 -0
  126. package/kernel/apps/web/server/acp-live-plugin.ts +30 -0
  127. package/kernel/apps/web/server/api/document-edit.ts +1 -0
  128. package/kernel/apps/web/server/api/open-path.ts +1 -0
  129. package/kernel/apps/web/server/core-plugin.ts +49 -0
  130. package/kernel/apps/web/server/folder-favicon.ts +1 -0
  131. package/kernel/apps/web/server/folder-icons.ts +1 -0
  132. package/kernel/apps/web/server/folder-metadata-plugin.ts +31 -0
  133. package/kernel/apps/web/server/plugins.ts +1 -0
  134. package/kernel/apps/web/server/preview-kinds.ts +1 -0
  135. package/kernel/apps/web/src/ai-input.tsx +62 -0
  136. package/kernel/apps/web/src/annotations.tsx +430 -0
  137. package/kernel/apps/web/src/api/client.ts +3 -0
  138. package/kernel/apps/web/src/api/errors.ts +1 -0
  139. package/kernel/apps/web/src/api/events.ts +42 -0
  140. package/kernel/apps/web/src/app.css +332 -0
  141. package/kernel/apps/web/src/app.tsx +667 -0
  142. package/kernel/apps/web/src/ask-draft.ts +164 -0
  143. package/kernel/apps/web/src/ask-tray.tsx +256 -0
  144. package/kernel/apps/web/src/comment-editor.tsx +93 -0
  145. package/kernel/apps/web/src/comment-form.tsx +162 -0
  146. package/kernel/apps/web/src/copy-path.ts +18 -0
  147. package/kernel/apps/web/src/deferred-ask-tray.tsx +20 -0
  148. package/kernel/apps/web/src/document-url.ts +46 -0
  149. package/kernel/apps/web/src/documents-url.ts +23 -0
  150. package/kernel/apps/web/src/dropped-folder.ts +64 -0
  151. package/kernel/apps/web/src/external-plugins.ts +3 -0
  152. package/kernel/apps/web/src/file-viewer.tsx +171 -0
  153. package/kernel/apps/web/src/folder-filter-icons.tsx +39 -0
  154. package/kernel/apps/web/src/folder-metadata.ts +76 -0
  155. package/kernel/apps/web/src/folder-plugin-view.tsx +87 -0
  156. package/kernel/apps/web/src/folder-query-cache.ts +66 -0
  157. package/kernel/apps/web/src/host-adapters.ts +209 -0
  158. package/kernel/apps/web/src/host-bridge.ts +214 -0
  159. package/kernel/apps/web/src/lib/entity-folder.ts +2 -0
  160. package/kernel/apps/web/src/linked-session-header.tsx +43 -0
  161. package/kernel/apps/web/src/live-session-controls.tsx +326 -0
  162. package/kernel/apps/web/src/local-source.ts +32 -0
  163. package/kernel/apps/web/src/main.tsx +24 -0
  164. package/kernel/apps/web/src/markdown-page.tsx +444 -0
  165. package/kernel/apps/web/src/notes-page.tsx +103 -0
  166. package/kernel/apps/web/src/plugins.ts +53 -0
  167. package/kernel/apps/web/src/project-search-dialog.tsx +257 -0
  168. package/kernel/apps/web/src/project-search.ts +18 -0
  169. package/kernel/apps/web/src/query-client.ts +4 -0
  170. package/kernel/apps/web/src/rehype-source-lines.ts +22 -0
  171. package/kernel/apps/web/src/routes/document.tsx +1 -0
  172. package/kernel/apps/web/src/routes/entities.tsx +277 -0
  173. package/kernel/apps/web/src/routes/search.tsx +60 -0
  174. package/kernel/apps/web/src/selection-context.ts +68 -0
  175. package/kernel/apps/web/src/selection-input.tsx +58 -0
  176. package/kernel/apps/web/src/selection-popup.tsx +155 -0
  177. package/kernel/apps/web/src/session-transcript-page.tsx +152 -0
  178. package/kernel/apps/web/src/use-annotations.ts +162 -0
  179. package/kernel/apps/web/src/use-ask-ai.ts +26 -0
  180. package/kernel/apps/web/src/use-ask-draft.ts +27 -0
  181. package/kernel/apps/web/src/use-document.ts +37 -0
  182. package/kernel/apps/web/src/use-folder-notes.ts +49 -0
  183. package/kernel/apps/web/src/use-linked-session.ts +33 -0
  184. package/kernel/apps/web/src/view-context.tsx +69 -0
  185. package/kernel/apps/web/src/view-header.tsx +66 -0
  186. package/kernel/apps/web/src/viewer-capabilities.ts +33 -0
  187. package/kernel/apps/web/src/viewer-route.ts +1 -0
  188. package/kernel/apps/web/src/viewport-height.ts +33 -0
  189. package/kernel/apps/web/tsconfig.json +24 -0
  190. package/kernel/apps/web/vite.config.ts +252 -0
  191. package/kernel/packages/agents/eslint.config.js +10 -0
  192. package/kernel/packages/agents/package.json +75 -0
  193. package/kernel/packages/agents/src/agent-card.tsx +334 -0
  194. package/kernel/packages/agents/src/client.tsx +13 -0
  195. package/kernel/packages/agents/src/index.ts +18 -0
  196. package/kernel/packages/agents/src/manifest.ts +7 -0
  197. package/kernel/packages/agents/src/node.ts +447 -0
  198. package/kernel/packages/agents/src/profiles.ts +137 -0
  199. package/kernel/packages/agents/src/resolve.ts +69 -0
  200. package/kernel/packages/agents/src/server.ts +60 -0
  201. package/kernel/packages/agents/src/types.ts +82 -0
  202. package/kernel/packages/agents/src/viewer.tsx +370 -0
  203. package/kernel/packages/agents/test/profiles.test.mjs +88 -0
  204. package/kernel/packages/agents/test/resolve.test.mjs +729 -0
  205. package/kernel/packages/agents/tsconfig.json +17 -0
  206. package/kernel/packages/api/README.md +73 -0
  207. package/kernel/packages/api/openapi.json +3368 -0
  208. package/kernel/packages/api/package.json +41 -0
  209. package/kernel/packages/api/src/client/errors.ts +1 -0
  210. package/kernel/packages/api/src/client/index.ts +2 -0
  211. package/kernel/packages/api/src/contracts/schemas.ts +277 -0
  212. package/kernel/packages/api/src/contracts.ts +20 -0
  213. package/kernel/packages/api/src/index.ts +34 -0
  214. package/kernel/packages/api/src/server/acp/index.ts +35 -0
  215. package/kernel/packages/api/src/server/acp/live-agent-connection.ts +44 -0
  216. package/kernel/packages/api/src/server/acp/process-manager.ts +291 -0
  217. package/kernel/packages/api/src/server/acp/registry.ts +140 -0
  218. package/kernel/packages/api/src/server/acp/sdk.ts +15 -0
  219. package/kernel/packages/api/src/server/acp/transport.ts +115 -0
  220. package/kernel/packages/api/src/server/acp/types.ts +89 -0
  221. package/kernel/packages/api/src/server/acp-live-plugin.ts +423 -0
  222. package/kernel/packages/api/src/server/api/create-agent-file.ts +46 -0
  223. package/kernel/packages/api/src/server/api/document-edit.ts +125 -0
  224. package/kernel/packages/api/src/server/api/open-path.ts +40 -0
  225. package/kernel/packages/api/src/server/contracts.ts +85 -0
  226. package/kernel/packages/api/src/server/entity-folder.ts +353 -0
  227. package/kernel/packages/api/src/server/folder-favicon.ts +17 -0
  228. package/kernel/packages/api/src/server/folder-icons.ts +113 -0
  229. package/kernel/packages/api/src/server/folder-metadata-plugin.ts +1758 -0
  230. package/kernel/packages/api/src/server/host.ts +21 -0
  231. package/kernel/packages/api/src/server/index.ts +197 -0
  232. package/kernel/packages/api/src/server/linked-folder-discovery.ts +158 -0
  233. package/kernel/packages/api/src/server/plugins.ts +205 -0
  234. package/kernel/packages/api/src/server/project-discovery.ts +69 -0
  235. package/kernel/packages/api/src/server/watcher.ts +46 -0
  236. package/kernel/packages/api/src/shared/selection.ts +16 -0
  237. package/kernel/packages/api/src/shared/viewer-route.ts +200 -0
  238. package/kernel/packages/api/test/agents-loading.test.ts +94 -0
  239. package/kernel/packages/api/test/core.test.ts +364 -0
  240. package/kernel/packages/api/test/entity-folder.test.ts +131 -0
  241. package/kernel/packages/api/test/linked-folder-discovery.test.ts +78 -0
  242. package/kernel/packages/api/test/media-endpoint.test.ts +83 -0
  243. package/kernel/packages/api/test/partial-loading.test.ts +43 -0
  244. package/kernel/packages/api/test/project-discovery.test.ts +44 -0
  245. package/kernel/packages/api/tsconfig.json +11 -0
  246. package/kernel/packages/api-client/README.md +72 -0
  247. package/kernel/packages/api-client/package.json +26 -0
  248. package/kernel/packages/api-client/scripts/generate.ts +68 -0
  249. package/kernel/packages/api-client/src/errors.ts +59 -0
  250. package/kernel/packages/api-client/src/generated.d.ts +1248 -0
  251. package/kernel/packages/api-client/src/index.ts +206 -0
  252. package/kernel/packages/api-client/src/responses.ts +19 -0
  253. package/kernel/packages/api-client/test/client.test.ts +143 -0
  254. package/kernel/packages/api-client/tsconfig.json +12 -0
  255. package/kernel/packages/folder-plugin/eslint.config.js +10 -0
  256. package/kernel/packages/folder-plugin/package.json +50 -0
  257. package/kernel/packages/folder-plugin/src/client.ts +73 -0
  258. package/kernel/packages/folder-plugin/src/endpoint.ts +273 -0
  259. package/kernel/packages/folder-plugin/src/index.ts +15 -0
  260. package/kernel/packages/folder-plugin/src/server.ts +78 -0
  261. package/kernel/packages/folder-plugin/src/subpath.ts +34 -0
  262. package/kernel/packages/folder-plugin/src/types.ts +86 -0
  263. package/kernel/packages/folder-plugin/src/validation.ts +56 -0
  264. package/kernel/packages/folder-plugin/test/contract.test.mjs +133 -0
  265. package/kernel/packages/folder-plugin/tsconfig.json +17 -0
  266. package/kernel/packages/kinds/package.json +24 -0
  267. package/kernel/packages/kinds/src/kinds.ts +172 -0
  268. package/kernel/packages/markdown/README.md +40 -0
  269. package/kernel/packages/markdown/explorer.css +1 -0
  270. package/kernel/packages/markdown/package.json +30 -0
  271. package/kernel/packages/markdown/src/documents.ts +1 -0
  272. package/kernel/packages/markdown/src/explorer.ts +1 -0
  273. package/kernel/packages/markdown/src/index.ts +2 -0
  274. package/kernel/packages/markdown/src/metadata.ts +63 -0
  275. package/kernel/packages/markdown/src/node.ts +1 -0
  276. package/kernel/packages/markdown/styles.css +1 -0
  277. package/kernel/packages/notes/SKILL.md +19 -0
  278. package/kernel/packages/notes/eslint.config.js +10 -0
  279. package/kernel/packages/notes/package.json +72 -0
  280. package/kernel/packages/notes/src/client.tsx +12 -0
  281. package/kernel/packages/notes/src/data/ai-input.ts +58 -0
  282. package/kernel/packages/notes/src/data/api.ts +40 -0
  283. package/kernel/packages/notes/src/data/parse.ts +15 -0
  284. package/kernel/packages/notes/src/data/routing.ts +33 -0
  285. package/kernel/packages/notes/src/data/use-folder-notes.ts +49 -0
  286. package/kernel/packages/notes/src/index.ts +2 -0
  287. package/kernel/packages/notes/src/manifest.ts +6 -0
  288. package/kernel/packages/notes/src/pages/notes-page.tsx +79 -0
  289. package/kernel/packages/notes/src/pages/single-note-page.tsx +57 -0
  290. package/kernel/packages/notes/src/server.ts +88 -0
  291. package/kernel/packages/notes/src/ui/ai-composer-controls.tsx +70 -0
  292. package/kernel/packages/notes/src/ui/folder-notes-list.tsx +140 -0
  293. package/kernel/packages/notes/tsconfig.json +16 -0
  294. package/kernel/packages/schemas/ICON-POLICY.md +43 -0
  295. package/kernel/packages/schemas/SKILL.md +185 -0
  296. package/kernel/packages/schemas/eslint.config.js +10 -0
  297. package/kernel/packages/schemas/package.json +81 -0
  298. package/kernel/packages/schemas/src/client.tsx +137 -0
  299. package/kernel/packages/schemas/src/data/config-file.ts +37 -0
  300. package/kernel/packages/schemas/src/data/contract.ts +174 -0
  301. package/kernel/packages/schemas/src/data/favicon.ts +218 -0
  302. package/kernel/packages/schemas/src/data/fields.ts +96 -0
  303. package/kernel/packages/schemas/src/data/icon-image.ts +53 -0
  304. package/kernel/packages/schemas/src/data/icon.ts +97 -0
  305. package/kernel/packages/schemas/src/data/load.ts +161 -0
  306. package/kernel/packages/schemas/src/data/params.ts +103 -0
  307. package/kernel/packages/schemas/src/data/query.ts +33 -0
  308. package/kernel/packages/schemas/src/data/sort.ts +50 -0
  309. package/kernel/packages/schemas/src/data/workspace.ts +101 -0
  310. package/kernel/packages/schemas/src/index.ts +22 -0
  311. package/kernel/packages/schemas/src/manifest.ts +4 -0
  312. package/kernel/packages/schemas/src/node.ts +384 -0
  313. package/kernel/packages/schemas/src/pages/collection.tsx +252 -0
  314. package/kernel/packages/schemas/src/server.ts +208 -0
  315. package/kernel/packages/schemas/src/ui/schema-entity-list.tsx +124 -0
  316. package/kernel/packages/schemas/src/ui/schema-filters.tsx +186 -0
  317. package/kernel/packages/schemas/src/ui/schema-search.tsx +35 -0
  318. package/kernel/packages/schemas/src/ui/use-query-param-filter-setting.tsx +15 -0
  319. package/kernel/packages/schemas/test/contract.test.mjs +26 -0
  320. package/kernel/packages/schemas/test/fields.test.mjs +187 -0
  321. package/kernel/packages/schemas/test/load.test.mjs +12 -0
  322. package/kernel/packages/schemas/test/node.test.mjs +412 -0
  323. package/kernel/packages/schemas/test/query.test.mjs +134 -0
  324. package/kernel/packages/schemas/test/workspace.test.mjs +86 -0
  325. package/kernel/packages/schemas/tsconfig.json +17 -0
  326. package/kernel/packages/session-finding/package.json +33 -0
  327. package/kernel/packages/session-finding/src/index.ts +120 -0
  328. package/kernel/packages/session-finding/test/list-sessions.test.mjs +139 -0
  329. package/kernel/packages/session-finding/tsconfig.json +12 -0
  330. package/kernel/packages/ui/LICENSE +21 -0
  331. package/kernel/packages/ui/components.json +20 -0
  332. package/kernel/packages/ui/eslint.config.js +8 -0
  333. package/kernel/packages/ui/package.json +106 -0
  334. package/kernel/packages/ui/src/chat/file-link.ts +178 -0
  335. package/kernel/packages/ui/src/chat/index.ts +18 -0
  336. package/kernel/packages/ui/src/chat/transcript.tsx +348 -0
  337. package/kernel/packages/ui/src/chat/turns.ts +76 -0
  338. package/kernel/packages/ui/src/chat/types.ts +23 -0
  339. package/kernel/packages/ui/src/chat/use-overflowing.ts +56 -0
  340. package/kernel/packages/ui/src/components/accordion.tsx +74 -0
  341. package/kernel/packages/ui/src/components/alert-dialog.tsx +164 -0
  342. package/kernel/packages/ui/src/components/alert.tsx +68 -0
  343. package/kernel/packages/ui/src/components/app-breadcrumbs.tsx +170 -0
  344. package/kernel/packages/ui/src/components/app-header.tsx +125 -0
  345. package/kernel/packages/ui/src/components/app-options.tsx +87 -0
  346. package/kernel/packages/ui/src/components/app-view-header.tsx +34 -0
  347. package/kernel/packages/ui/src/components/aspect-ratio.tsx +11 -0
  348. package/kernel/packages/ui/src/components/avatar.tsx +53 -0
  349. package/kernel/packages/ui/src/components/badge.tsx +47 -0
  350. package/kernel/packages/ui/src/components/base-dialog.tsx +3 -0
  351. package/kernel/packages/ui/src/components/base-tabs.tsx +63 -0
  352. package/kernel/packages/ui/src/components/breadcrumb.tsx +110 -0
  353. package/kernel/packages/ui/src/components/button-group.tsx +86 -0
  354. package/kernel/packages/ui/src/components/button.tsx +65 -0
  355. package/kernel/packages/ui/src/components/calendar.tsx +240 -0
  356. package/kernel/packages/ui/src/components/card.tsx +95 -0
  357. package/kernel/packages/ui/src/components/carousel.tsx +240 -0
  358. package/kernel/packages/ui/src/components/chart.tsx +375 -0
  359. package/kernel/packages/ui/src/components/checkbox.tsx +39 -0
  360. package/kernel/packages/ui/src/components/collapsible.tsx +33 -0
  361. package/kernel/packages/ui/src/components/collection-icon.tsx +28 -0
  362. package/kernel/packages/ui/src/components/command.tsx +205 -0
  363. package/kernel/packages/ui/src/components/content-issues.tsx +63 -0
  364. package/kernel/packages/ui/src/components/context-menu.tsx +298 -0
  365. package/kernel/packages/ui/src/components/copy-context.tsx +134 -0
  366. package/kernel/packages/ui/src/components/dialog.tsx +157 -0
  367. package/kernel/packages/ui/src/components/drawer.tsx +162 -0
  368. package/kernel/packages/ui/src/components/dropdown-menu.tsx +303 -0
  369. package/kernel/packages/ui/src/components/empty.tsx +108 -0
  370. package/kernel/packages/ui/src/components/field.tsx +260 -0
  371. package/kernel/packages/ui/src/components/file-preview.tsx +152 -0
  372. package/kernel/packages/ui/src/components/file-renderer.tsx +466 -0
  373. package/kernel/packages/ui/src/components/filter-chip-panel.tsx +157 -0
  374. package/kernel/packages/ui/src/components/filter-select.tsx +127 -0
  375. package/kernel/packages/ui/src/components/folder-activity.tsx +646 -0
  376. package/kernel/packages/ui/src/components/folder-file-list.tsx +58 -0
  377. package/kernel/packages/ui/src/components/folder-filter-bar.tsx +191 -0
  378. package/kernel/packages/ui/src/components/folder-image.tsx +18 -0
  379. package/kernel/packages/ui/src/components/folder-landing.tsx +70 -0
  380. package/kernel/packages/ui/src/components/folder-list.tsx +140 -0
  381. package/kernel/packages/ui/src/components/folder-metadata.tsx +107 -0
  382. package/kernel/packages/ui/src/components/folder-mobile-bar.tsx +60 -0
  383. package/kernel/packages/ui/src/components/folder-project-list.tsx +133 -0
  384. package/kernel/packages/ui/src/components/folder-session-list.tsx +113 -0
  385. package/kernel/packages/ui/src/components/folder-session-page.tsx +126 -0
  386. package/kernel/packages/ui/src/components/folder-sidebar.tsx +52 -0
  387. package/kernel/packages/ui/src/components/folder-skill-list.tsx +62 -0
  388. package/kernel/packages/ui/src/components/folder-tabs.tsx +156 -0
  389. package/kernel/packages/ui/src/components/form.tsx +167 -0
  390. package/kernel/packages/ui/src/components/hover-card.tsx +52 -0
  391. package/kernel/packages/ui/src/components/icons.tsx +34 -0
  392. package/kernel/packages/ui/src/components/input-group.tsx +184 -0
  393. package/kernel/packages/ui/src/components/input-otp.tsx +90 -0
  394. package/kernel/packages/ui/src/components/input.tsx +29 -0
  395. package/kernel/packages/ui/src/components/item.tsx +195 -0
  396. package/kernel/packages/ui/src/components/kbd.tsx +32 -0
  397. package/kernel/packages/ui/src/components/label.tsx +27 -0
  398. package/kernel/packages/ui/src/components/link.tsx +45 -0
  399. package/kernel/packages/ui/src/components/live-tool-call.tsx +193 -0
  400. package/kernel/packages/ui/src/components/menubar.tsx +323 -0
  401. package/kernel/packages/ui/src/components/navigation-menu.tsx +210 -0
  402. package/kernel/packages/ui/src/components/note-card.tsx +149 -0
  403. package/kernel/packages/ui/src/components/pagination.tsx +128 -0
  404. package/kernel/packages/ui/src/components/popover.tsx +56 -0
  405. package/kernel/packages/ui/src/components/progress.tsx +31 -0
  406. package/kernel/packages/ui/src/components/radio-group.tsx +54 -0
  407. package/kernel/packages/ui/src/components/scroll-area.tsx +61 -0
  408. package/kernel/packages/ui/src/components/select.tsx +219 -0
  409. package/kernel/packages/ui/src/components/separator.tsx +30 -0
  410. package/kernel/packages/ui/src/components/session-icon.tsx +124 -0
  411. package/kernel/packages/ui/src/components/sheet.tsx +157 -0
  412. package/kernel/packages/ui/src/components/sidebar.tsx +789 -0
  413. package/kernel/packages/ui/src/components/skeleton.tsx +13 -0
  414. package/kernel/packages/ui/src/components/slider.tsx +73 -0
  415. package/kernel/packages/ui/src/components/sonner.tsx +41 -0
  416. package/kernel/packages/ui/src/components/spinner.tsx +16 -0
  417. package/kernel/packages/ui/src/components/switch.tsx +40 -0
  418. package/kernel/packages/ui/src/components/table.tsx +120 -0
  419. package/kernel/packages/ui/src/components/tabs.tsx +78 -0
  420. package/kernel/packages/ui/src/components/textarea.tsx +25 -0
  421. package/kernel/packages/ui/src/components/toggle-group.tsx +87 -0
  422. package/kernel/packages/ui/src/components/toggle.tsx +48 -0
  423. package/kernel/packages/ui/src/components/tooltip.tsx +71 -0
  424. package/kernel/packages/ui/src/components/viewer-options.tsx +166 -0
  425. package/kernel/packages/ui/src/hooks/use-folder-filter.ts +103 -0
  426. package/kernel/packages/ui/src/hooks/use-mobile.ts +19 -0
  427. package/kernel/packages/ui/src/index.ts +13 -0
  428. package/kernel/packages/ui/src/lib/document-extensions.ts +83 -0
  429. package/kernel/packages/ui/src/lib/folder-activity.ts +143 -0
  430. package/kernel/packages/ui/src/lib/folder-filter.ts +284 -0
  431. package/kernel/packages/ui/src/lib/live-tool-call.tsx +109 -0
  432. package/kernel/packages/ui/src/lib/media-urls.ts +176 -0
  433. package/kernel/packages/ui/src/lib/obsidian-links.ts +120 -0
  434. package/kernel/packages/ui/src/lib/source-components.tsx +65 -0
  435. package/kernel/packages/ui/src/lib/utils.tsx +7 -0
  436. package/kernel/packages/ui/src/pages/entity-detail-page.tsx +82 -0
  437. package/kernel/packages/ui/src/pages/entity-list-page.tsx +50 -0
  438. package/kernel/packages/ui/src/pages/entity-page.tsx +69 -0
  439. package/kernel/packages/ui/src/styles/folder-activity.css +2151 -0
  440. package/kernel/packages/ui/test/copy-context.test.mjs +48 -0
  441. package/kernel/packages/ui/test/folder-filter.test.mjs +484 -0
  442. package/kernel/packages/ui/tsconfig.json +15 -0
  443. package/kernel/plugins/calendar/SKILL.md +173 -0
  444. package/kernel/plugins/calendar/eslint.config.js +10 -0
  445. package/kernel/plugins/calendar/package.json +73 -0
  446. package/kernel/plugins/calendar/schema.json +137 -0
  447. package/kernel/plugins/calendar/src/calendar.tsx +328 -0
  448. package/kernel/plugins/calendar/src/client.tsx +139 -0
  449. package/kernel/plugins/calendar/src/context.ts +48 -0
  450. package/kernel/plugins/calendar/src/copy-button.tsx +66 -0
  451. package/kernel/plugins/calendar/src/event-dialog.tsx +270 -0
  452. package/kernel/plugins/calendar/src/index.ts +4 -0
  453. package/kernel/plugins/calendar/src/manifest.ts +7 -0
  454. package/kernel/plugins/calendar/src/parse.ts +610 -0
  455. package/kernel/plugins/calendar/src/server.ts +160 -0
  456. package/kernel/plugins/calendar/src/utils.ts +80 -0
  457. package/kernel/plugins/calendar/src/views.tsx +418 -0
  458. package/kernel/plugins/calendar/test/context.test.mjs +60 -0
  459. package/kernel/plugins/calendar/test/package.test.mjs +43 -0
  460. package/kernel/plugins/calendar/test/parse.test.mjs +392 -0
  461. package/kernel/plugins/calendar/test/server.test.mjs +126 -0
  462. package/kernel/plugins/calendar/tsconfig.json +17 -0
  463. package/kernel/plugins/mail/SKILL.md +97 -0
  464. package/kernel/plugins/mail/eslint.config.js +10 -0
  465. package/kernel/plugins/mail/package.json +79 -0
  466. package/kernel/plugins/mail/src/api.ts +359 -0
  467. package/kernel/plugins/mail/src/bun-ffi.d.ts +14 -0
  468. package/kernel/plugins/mail/src/client.tsx +14 -0
  469. package/kernel/plugins/mail/src/flock.ts +137 -0
  470. package/kernel/plugins/mail/src/folders.ts +37 -0
  471. package/kernel/plugins/mail/src/history.ts +485 -0
  472. package/kernel/plugins/mail/src/index.ts +3 -0
  473. package/kernel/plugins/mail/src/mail-card.tsx +123 -0
  474. package/kernel/plugins/mail/src/mail-conversation.tsx +153 -0
  475. package/kernel/plugins/mail/src/mail-detail-page.tsx +467 -0
  476. package/kernel/plugins/mail/src/mail-hooks.ts +252 -0
  477. package/kernel/plugins/mail/src/mail-page.tsx +109 -0
  478. package/kernel/plugins/mail/src/mail-request.ts +78 -0
  479. package/kernel/plugins/mail/src/mail-send-box.tsx +175 -0
  480. package/kernel/plugins/mail/src/mailos.ts +723 -0
  481. package/kernel/plugins/mail/src/manifest.ts +7 -0
  482. package/kernel/plugins/mail/src/node.ts +171 -0
  483. package/kernel/plugins/mail/src/parse.ts +139 -0
  484. package/kernel/plugins/mail/src/server.ts +125 -0
  485. package/kernel/plugins/mail/src/types.ts +10 -0
  486. package/kernel/plugins/mail/src/viewer.tsx +147 -0
  487. package/kernel/plugins/mail/test/flock.test.mjs +156 -0
  488. package/kernel/plugins/mail/test/folders.test.mjs +138 -0
  489. package/kernel/plugins/mail/test/history.test.mjs +460 -0
  490. package/kernel/plugins/mail/test/mailos.test.mjs +752 -0
  491. package/kernel/plugins/mail/test/node.test.mjs +207 -0
  492. package/kernel/plugins/mail/test/package.test.mjs +54 -0
  493. package/kernel/plugins/mail/test/parse.test.mjs +32 -0
  494. package/kernel/plugins/mail/test/server.test.mjs +116 -0
  495. package/kernel/plugins/mail/test/viewer.test.mjs +192 -0
  496. package/kernel/plugins/mail/tsconfig.json +17 -0
  497. package/kernel/plugins/projects/SKILL.md +73 -0
  498. package/kernel/plugins/projects/eslint.config.js +10 -0
  499. package/kernel/plugins/projects/package.json +70 -0
  500. package/kernel/plugins/projects/src/client.tsx +17 -0
  501. package/kernel/plugins/projects/src/data/model.ts +129 -0
  502. package/kernel/plugins/projects/src/index.ts +17 -0
  503. package/kernel/plugins/projects/src/manifest.ts +7 -0
  504. package/kernel/plugins/projects/src/project-context.ts +41 -0
  505. package/kernel/plugins/projects/src/server.ts +276 -0
  506. package/kernel/plugins/projects/src/ui/project-card.tsx +61 -0
  507. package/kernel/plugins/projects/src/ui/projects-page.tsx +102 -0
  508. package/kernel/plugins/projects/test/package.test.mjs +51 -0
  509. package/kernel/plugins/projects/tsconfig.json +17 -0
  510. package/kernel/plugins/tasks/SKILL.md +341 -0
  511. package/kernel/plugins/tasks/eslint.config.js +10 -0
  512. package/kernel/plugins/tasks/package.json +74 -0
  513. package/kernel/plugins/tasks/schema.json +939 -0
  514. package/kernel/plugins/tasks/src/api.ts +212 -0
  515. package/kernel/plugins/tasks/src/client.tsx +23 -0
  516. package/kernel/plugins/tasks/src/data/parse.ts +544 -0
  517. package/kernel/plugins/tasks/src/data/task-id.ts +56 -0
  518. package/kernel/plugins/tasks/src/data/todo-model.ts +795 -0
  519. package/kernel/plugins/tasks/src/index.ts +34 -0
  520. package/kernel/plugins/tasks/src/manifest.ts +7 -0
  521. package/kernel/plugins/tasks/src/pages/task-detail.tsx +48 -0
  522. package/kernel/plugins/tasks/src/pages/task-list.tsx +88 -0
  523. package/kernel/plugins/tasks/src/server.ts +447 -0
  524. package/kernel/plugins/tasks/src/styles.css +9 -0
  525. package/kernel/plugins/tasks/src/ui/compact-todo-list.tsx +372 -0
  526. package/kernel/plugins/tasks/src/ui/error-details.tsx +78 -0
  527. package/kernel/plugins/tasks/src/ui/task-page.tsx +392 -0
  528. package/kernel/plugins/tasks/src/ui/todo-agent-filter.tsx +36 -0
  529. package/kernel/plugins/tasks/src/ui/todo-filter-bar.tsx +66 -0
  530. package/kernel/plugins/tasks/src/ui/todo-item.tsx +494 -0
  531. package/kernel/plugins/tasks/src/ui/todo-status-filter.tsx +60 -0
  532. package/kernel/plugins/tasks/src/ui/todo-tag-filter.tsx +48 -0
  533. package/kernel/plugins/tasks/src/ui/todo-warnings.tsx +106 -0
  534. package/kernel/plugins/tasks/test/api.test.mjs +99 -0
  535. package/kernel/plugins/tasks/test/folder-sources.test.mjs +46 -0
  536. package/kernel/plugins/tasks/test/package.test.mjs +54 -0
  537. package/kernel/plugins/tasks/test/parse.test.mjs +225 -0
  538. package/kernel/plugins/tasks/test/server.test.mjs +386 -0
  539. package/kernel/plugins/tasks/tsconfig.json +17 -0
  540. package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
  541. package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
  542. package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1835 -0
  543. package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1885 -0
  544. package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  545. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
  546. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
  547. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
  548. package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +82 -0
  549. package/node_modules/@agentclientprotocol/sdk/dist/connection.js +428 -0
  550. package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
  551. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
  552. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +470 -0
  553. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
  554. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
  555. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
  556. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
  557. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
  558. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
  559. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
  560. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
  561. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
  562. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
  563. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
  564. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
  565. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
  566. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
  567. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +221 -0
  568. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
  569. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
  570. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
  571. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
  572. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
  573. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +112 -0
  574. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
  575. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
  576. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
  577. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
  578. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
  579. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -0
  580. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
  581. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
  582. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
  583. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
  584. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
  585. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1064 -0
  586. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
  587. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
  588. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +851 -0
  589. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
  590. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
  591. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -0
  592. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
  593. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
  594. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
  595. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
  596. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
  597. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -0
  598. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
  599. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
  600. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
  601. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
  602. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
  603. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -0
  604. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
  605. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
  606. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
  607. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
  608. package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
  609. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +57 -0
  610. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
  611. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
  612. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +73 -0
  613. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
  614. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +199 -0
  615. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +211 -0
  616. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
  617. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
  618. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
  619. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
  620. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6118 -0
  621. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
  622. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
  623. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +14160 -0
  624. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3066 -0
  625. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
  626. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
  627. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -0
  628. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
  629. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
  630. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
  631. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
  632. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
  633. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
  634. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
  635. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
  636. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +490 -0
  637. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
  638. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
  639. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +104 -0
  640. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
  641. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
  642. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +52 -0
  643. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
  644. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
  645. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +946 -0
  646. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
  647. package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
  648. package/node_modules/@agentclientprotocol/sdk/dist/server.js +380 -0
  649. package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
  650. package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
  651. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1082 -0
  652. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
  653. package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
  654. package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -0
  655. package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
  656. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
  657. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
  658. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
  659. package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
  660. package/node_modules/@agentclientprotocol/sdk/dist/stream.js +106 -0
  661. package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  662. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
  663. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +206 -0
  664. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
  665. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
  666. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
  667. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
  668. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
  669. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
  670. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
  671. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
  672. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
  673. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
  674. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +806 -0
  675. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1183 -0
  676. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
  677. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
  678. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +512 -0
  679. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
  680. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +954 -0
  681. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1035 -0
  682. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
  683. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
  684. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -0
  685. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
  686. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6146 -0
  687. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
  688. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
  689. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +30552 -0
  690. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3204 -0
  691. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
  692. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
  693. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +358 -0
  694. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
  695. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
  696. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +246 -0
  697. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
  698. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
  699. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +833 -0
  700. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
  701. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
  702. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
  703. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
  704. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
  705. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
  706. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
  707. package/node_modules/@agentclientprotocol/sdk/package.json +105 -0
  708. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8819 -0
  709. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10098 -0
  710. package/package.json +52 -6
  711. package/web/assets/{abnfDiagram-VRR7QNED-Nfq-O04D.js → abnfDiagram-VRR7QNED-Bgfb1nEB.js} +1 -1
  712. package/web/assets/app-DoGr2Zi7.js +2 -0
  713. package/web/assets/app-options-D-RJiQ-X.js +25 -0
  714. package/web/assets/app-view-header-BLvLq02T.js +1 -0
  715. package/web/assets/arc-Dk_KI36B.js +1 -0
  716. package/web/assets/{architectureDiagram-ZJ3FMSHR-qhRwPNcQ.js → architectureDiagram-ZJ3FMSHR-NR_KhRCf.js} +1 -1
  717. package/web/assets/ask-tray-TzeTcO6-.js +14 -0
  718. package/web/assets/{blockDiagram-677ZJIJ3-C56P3bGu.js → blockDiagram-677ZJIJ3-CkLkwx9C.js} +1 -1
  719. package/web/assets/button-C6arH7zt.js +1 -0
  720. package/web/assets/{c4Diagram-LMCZKHZV-Ey1M72zD.js → c4Diagram-LMCZKHZV-CFCUH8e_.js} +1 -1
  721. package/web/assets/channel-uMEjV8qc.js +1 -0
  722. package/web/assets/{chunk-2Q5K7J3B-a6isk9VU.js → chunk-2Q5K7J3B-B_BPLWsW.js} +1 -1
  723. package/web/assets/{chunk-32BRIVSS-uy4kdSLL.js → chunk-32BRIVSS-B1VB1hOy.js} +1 -1
  724. package/web/assets/{chunk-5VM5RSS4-oj2sBFd7.js → chunk-5VM5RSS4-KFcYr8Co.js} +1 -1
  725. package/web/assets/{chunk-EX3LRPZG-Bzl1ukAi.js → chunk-EX3LRPZG-CpBX3kuK.js} +3 -3
  726. package/web/assets/{chunk-JWPE2WC7-sUph7I_t.js → chunk-JWPE2WC7-BPSl40wG.js} +1 -1
  727. package/web/assets/{chunk-MOJQB5TN-C0ERSuVK.js → chunk-MOJQB5TN-D2RcYmoU.js} +1 -1
  728. package/web/assets/{chunk-RYQCIY6F-Dyw1Hfwp.js → chunk-RYQCIY6F-m7Gyn-t3.js} +1 -1
  729. package/web/assets/{chunk-V7JOEXUC-DnSz22rb.js → chunk-V7JOEXUC-TDvdopxS.js} +1 -1
  730. package/web/assets/{chunk-VR4S4FIN-Bp2SNel7.js → chunk-VR4S4FIN-DZTsG51a.js} +1 -1
  731. package/web/assets/{chunk-XXDRQBXY-Dqtar746.js → chunk-XXDRQBXY-Dp0--RE2.js} +1 -1
  732. package/web/assets/classDiagram-OUVF2IWQ-fbZocVor.js +1 -0
  733. package/web/assets/classDiagram-v2-EOCWNBFH-fbZocVor.js +1 -0
  734. package/web/assets/client-C6Nxdfif.js +2 -0
  735. package/web/assets/client-CXYfBko5.js +17 -0
  736. package/web/assets/client-CoKtOq-X.js +7 -0
  737. package/web/assets/client-DyRQz5RU.js +53 -0
  738. package/web/assets/client-OY6HUzuD.js +98 -0
  739. package/web/assets/client-YOYWZIFi.js +34 -0
  740. package/web/assets/client-j2kQmxsO.js +22 -0
  741. package/web/assets/command-BugZBGXE.js +38 -0
  742. package/web/assets/copy-context-C0Uqsp-3.js +1 -0
  743. package/web/assets/{cose-bilkent-JH36ORCC-Dx1VqMjj.js → cose-bilkent-JH36ORCC-CPu3PI8h.js} +1 -1
  744. package/web/assets/{cynefin-VYW2F7L2-SjhCWmIV.js → cynefin-VYW2F7L2-DWxftYAm.js} +1 -1
  745. package/web/assets/{cynefinDiagram-TSTJHNR4-Dvqz2594.js → cynefinDiagram-TSTJHNR4-DsmN2V-p.js} +1 -1
  746. package/web/assets/{dagre-VKFMJZFB-Ju2m2qXt.js → dagre-VKFMJZFB-COEbApyY.js} +1 -1
  747. package/web/assets/{diagram-FQU43EPY-DsHKTt0k.js → diagram-FQU43EPY-0O9WGWKB.js} +1 -1
  748. package/web/assets/{diagram-G47NLZAW-DWHAcLkJ.js → diagram-G47NLZAW-CutEdMVh.js} +1 -1
  749. package/web/assets/{diagram-NH7WQ7WH-uUMz46ZD.js → diagram-NH7WQ7WH-C9KZc3B2.js} +1 -1
  750. package/web/assets/{diagram-OA4YK3LP-BRjVzjdp.js → diagram-OA4YK3LP-D8kkPXbY.js} +1 -1
  751. package/web/assets/{diagram-WEI45ONY-Cb-FhBpQ.js → diagram-WEI45ONY-_YqiTaGP.js} +1 -1
  752. package/web/assets/document-Dgt5eZFj.js +19 -0
  753. package/web/assets/{ebnfDiagram-CCIWWBDH-IhhxX3IB.js → ebnfDiagram-CCIWWBDH-JO-zQh6g.js} +1 -1
  754. package/web/assets/{entities-DUnx74kH.js → entities-C3wz7FCx.js} +12 -12
  755. package/web/assets/{erDiagram-Q63AITRT-D1frgeWf.js → erDiagram-Q63AITRT-9UjQwJ4P.js} +1 -1
  756. package/web/assets/file-viewer-DZJ8nYnl.js +1 -0
  757. package/web/assets/{flowDiagram-23GEKE2U-BiPPM-FY.js → flowDiagram-23GEKE2U-Ca08tnYM.js} +5 -5
  758. package/web/assets/folder-image-BfGgxo7i.js +1 -0
  759. package/web/assets/folder-landing-qUKBCnG-.js +54 -0
  760. package/web/assets/folder-list-BfFjv7rR.js +1 -0
  761. package/web/assets/folder-metadata-DCw8xzHk.js +2 -0
  762. package/web/assets/folder-mobile-bar-Ubz4babf.js +1 -0
  763. package/web/assets/folder-plugin-view-DsWR1zmQ.js +6 -0
  764. package/web/assets/{ganttDiagram-NO4QXBWP-CmEOlHD7.js → ganttDiagram-NO4QXBWP-KnHzX5W3.js} +1 -1
  765. package/web/assets/{gitGraphDiagram-IHSO6WYX-tTjcpZpU.js → gitGraphDiagram-IHSO6WYX-Cm8woNtK.js} +1 -1
  766. package/web/assets/index-BaRnbYRw.js +1 -0
  767. package/web/assets/index-BexmLxIP.css +1 -0
  768. package/web/assets/index-Bp9DidgD.js +1 -0
  769. package/web/assets/{index-eL1k96k8.js → index-CCXE8zc9.js} +1 -1
  770. package/web/assets/index-CNyy98F8.js +2 -0
  771. package/web/assets/{index-DmrKjrlM.js → index-CXhBn-ar.js} +1 -1
  772. package/web/assets/index-DDirZMgx.js +1 -0
  773. package/web/assets/{infoDiagram-FWYZ7A6U-Ok2sdbc1.js → infoDiagram-FWYZ7A6U-yyqmUtIb.js} +1 -1
  774. package/web/assets/{ishikawaDiagram-FXEZZL3T-kPnM5psX.js → ishikawaDiagram-FXEZZL3T-BfvR_Zy4.js} +4 -4
  775. package/web/assets/{journeyDiagram-5HDEW3XC-BkoT0-45.js → journeyDiagram-5HDEW3XC-BKuw06HM.js} +1 -1
  776. package/web/assets/{kanban-definition-HUTT4EX6-xnm_eFoU.js → kanban-definition-HUTT4EX6-n0010rmQ.js} +8 -8
  777. package/web/assets/{linear-CLZpgLH-.js → linear-C0d0lT8O.js} +1 -1
  778. package/web/assets/linked-session-header-BkEweU0Z.js +3 -0
  779. package/web/assets/{markdown-njUwQKsR.js → markdown-Bw9RgUGR.js} +9 -9
  780. package/web/assets/{mermaid.core-Bvxj3RoN.js → mermaid.core-BDVbShyO.js} +6 -6
  781. package/web/assets/metadata-KV0dpp4G.js +1 -0
  782. package/web/assets/{mindmap-definition-LN4V7U3C-42Uoox79.js → mindmap-definition-LN4V7U3C--_0ks3GF.js} +1 -1
  783. package/web/assets/note-card-DBfX6gW1.js +6 -0
  784. package/web/assets/{pegDiagram-2B236MQR-B-GZCw3w.js → pegDiagram-2B236MQR-CBoNIpKR.js} +1 -1
  785. package/web/assets/{pieDiagram-ENE6RG2P-DRmmssIB.js → pieDiagram-ENE6RG2P-MA5tkYh5.js} +3 -3
  786. package/web/assets/popover-DBD7FF-W.js +9 -0
  787. package/web/assets/{project-search-dialog-B730oZ1S.js → project-search-dialog-DM1IkSZu.js} +6 -6
  788. package/web/assets/{quadrantDiagram-ABIIQ3AL-BfhVQ7V9.js → quadrantDiagram-ABIIQ3AL-CWT1ryqF.js} +1 -1
  789. package/web/assets/{railroadDiagram-RFXS5EU6-DxKx7XRp.js → railroadDiagram-RFXS5EU6-ZiLB5FGi.js} +1 -1
  790. package/web/assets/{react-DZzLHL-l.js → react-B9jn2M18.js} +2 -2
  791. package/web/assets/{requirementDiagram-TGXJPOKE-NUzj9fw1.js → requirementDiagram-TGXJPOKE-CQq9uneq.js} +1 -1
  792. package/web/assets/{sankeyDiagram-HTMAVEWB-Cy9OMnl-.js → sankeyDiagram-HTMAVEWB-qDG-0JqI.js} +1 -1
  793. package/web/assets/search-DNrQA5fF.js +2 -0
  794. package/web/assets/select-D8cqNgcp.js +30 -0
  795. package/web/assets/selection-popup-DmtTeRs2.js +7 -0
  796. package/web/assets/{sequenceDiagram-DBY2YBRQ-CBNE9mzn.js → sequenceDiagram-DBY2YBRQ-CiApurLO.js} +1 -1
  797. package/web/assets/{sizeCapture-X5ZJPWSS-S4HhfX0n.js → sizeCapture-X5ZJPWSS-DZSR5QXm.js} +1 -1
  798. package/web/assets/stateDiagram-2N3HPSRC-CjJJR9_z.js +1 -0
  799. package/web/assets/stateDiagram-v2-6OUMAXLB-BpeGSCu9.js +1 -0
  800. package/web/assets/{swimlanes-5IMT3BWC-DJ2aLWal.js → swimlanes-5IMT3BWC-CKmo1sg6.js} +2 -2
  801. package/web/assets/swimlanesDiagram-G3AALYLV-D9RjLKb9.js +8 -0
  802. package/web/assets/tanstack-YzX_Mi37.js +3 -0
  803. package/web/assets/{timeline-definition-FHXFAJF6-vFDUVPCX.js → timeline-definition-FHXFAJF6-D-NMwS3y.js} +1 -1
  804. package/web/assets/{use-folder-filter-BbTUlXgG.js → use-folder-filter-LQyXns5Q.js} +1 -1
  805. package/web/assets/{utils-CwHGE3BB.js → utils-DCaHk0Gm.js} +1 -1
  806. package/web/assets/{vennDiagram-L72KCM5P-AsnhK2zW.js → vennDiagram-L72KCM5P-CfL6LBWw.js} +1 -1
  807. package/web/assets/view-context-gyDl_p2V.js +229 -0
  808. package/web/assets/viewer-capabilities-Bpp8Uvcg.js +1 -0
  809. package/web/assets/{wardleyDiagram-EHGQE667-Cj1wFbNV.js → wardleyDiagram-EHGQE667-DgldMxaj.js} +1 -1
  810. package/web/assets/{xychartDiagram-FW5EYKEG-Bbvnutsm.js → xychartDiagram-FW5EYKEG-CIoAIFX8.js} +1 -1
  811. package/web/favicon.svg +6 -0
  812. package/web/index.html +5 -4
  813. package/web/assets/app-CPSmsokP.js +0 -2
  814. package/web/assets/app-options-XEWvevsz.js +0 -25
  815. package/web/assets/app-view-header-BKZ90ToF.js +0 -1
  816. package/web/assets/arc-DbpbZvCt.js +0 -1
  817. package/web/assets/arrow-left-CFeHb-Z1.js +0 -1
  818. package/web/assets/ask-tray-D2YHtbPj.js +0 -14
  819. package/web/assets/button-BJ7z-ZA7.js +0 -1
  820. package/web/assets/calendar-days-DWh2XMO2.js +0 -1
  821. package/web/assets/channel-dSRp_qTo.js +0 -1
  822. package/web/assets/chevron-down-C5oRtqbX.js +0 -1
  823. package/web/assets/chevron-right-CsPtvh8C.js +0 -1
  824. package/web/assets/chevron-up-DjpU6Pyv.js +0 -1
  825. package/web/assets/classDiagram-OUVF2IWQ-B7B2zLzM.js +0 -1
  826. package/web/assets/classDiagram-v2-EOCWNBFH-B7B2zLzM.js +0 -1
  827. package/web/assets/client-CAudjYV9.js +0 -34
  828. package/web/assets/client-Dn9-_Gm_.js +0 -14
  829. package/web/assets/client-Dxrf2tyq.js +0 -102
  830. package/web/assets/client-aFI2M4pE.js +0 -53
  831. package/web/assets/collection-icon-TbOVyORG.js +0 -1
  832. package/web/assets/collection-page-Du6FKkuU.js +0 -10
  833. package/web/assets/command-C_g5E1Wx.js +0 -38
  834. package/web/assets/copy-Ikmr6Iq2.js +0 -1
  835. package/web/assets/copy-context-Cl1TE2PJ.js +0 -1
  836. package/web/assets/document-DcjNSJCk.js +0 -2
  837. package/web/assets/external-link-BXmSXqqF.js +0 -1
  838. package/web/assets/file-renderer-BRZTrYx8.js +0 -19
  839. package/web/assets/file-text-CiiSsCDq.js +0 -1
  840. package/web/assets/file-viewer-C1wAeVDK.js +0 -1
  841. package/web/assets/folder-image-AXBrHUcU.js +0 -1
  842. package/web/assets/folder-landing-BhRg7hwn.js +0 -54
  843. package/web/assets/folder-list-rIdszVde.js +0 -1
  844. package/web/assets/folder-metadata-puTC5QqJ.js +0 -2
  845. package/web/assets/folder-mobile-bar-DjjRQo3T.js +0 -1
  846. package/web/assets/folder-plugin-view-BU_kzR8j.js +0 -6
  847. package/web/assets/index-DS2Wmd9I.css +0 -1
  848. package/web/assets/index-DgqzSeIR.js +0 -1
  849. package/web/assets/index-DnlTDqaa.js +0 -1
  850. package/web/assets/index-DztTMDFz.js +0 -2
  851. package/web/assets/index-kY75qc96.js +0 -1
  852. package/web/assets/index-p38i_yyY.js +0 -1
  853. package/web/assets/link-2-BWKA6t--.js +0 -1
  854. package/web/assets/link-DC_1Z6Yy.js +0 -11
  855. package/web/assets/linked-session-header-DJYWZ_-q.js +0 -3
  856. package/web/assets/mail-2rCdIFul.js +0 -1
  857. package/web/assets/markdown-title-dncAYYiP.js +0 -131
  858. package/web/assets/notes-page-DIW6rgJp.js +0 -10
  859. package/web/assets/pencil-8cobiSSq.js +0 -1
  860. package/web/assets/plus-BHV2wJr7.js +0 -1
  861. package/web/assets/popover-Cmmgj-MJ.js +0 -9
  862. package/web/assets/search-CvlYUkN6.js +0 -2
  863. package/web/assets/select-1SvaKQsS.js +0 -30
  864. package/web/assets/selection-popup-ntjycEVh.js +0 -7
  865. package/web/assets/sparkles-CBhGREdc.js +0 -1
  866. package/web/assets/stateDiagram-2N3HPSRC-BEw1Mheu.js +0 -1
  867. package/web/assets/stateDiagram-v2-6OUMAXLB-BHtjl1iD.js +0 -1
  868. package/web/assets/swimlanesDiagram-G3AALYLV-Z362aroZ.js +0 -8
  869. package/web/assets/tanstack-CD46mJkU.js +0 -1
  870. package/web/assets/view-context-D-fh9AbH.js +0 -81
  871. package/web/assets/viewer-capabilities-CROIaoqh.js +0 -1
  872. package/web/assets/x-BUeE--I4.js +0 -1
@@ -1,3 +0,0 @@
1
- import{j as i}from"./react-DZzLHL-l.js";import{r}from"./folder-activity-Cv1X2ezj.js";import{u as o}from"./tanstack-CD46mJkU.js";import"./markdown-njUwQKsR.js";const l=["claude","codex","cursor","opencode","pi"];function c(e){const t=o({enabled:!!e,queryFn:async()=>{const s=await fetch(`/api/session?sessionId=${encodeURIComponent(e??"")}`);if(!s.ok)throw new Error("Session not found");return await s.json()},queryKey:["session",e],staleTime:3e4}),a=e?.slice(0,e.indexOf(":"));return{client:l.find(s=>s===a),title:t.data?.title??e,transcript:t.data}}function x({session:e}){const{client:t,title:a,transcript:n}=c(e);return t?i.jsxs("div",{className:`ml-auto flex min-w-0 items-center gap-2 text-[0.8rem]
2
- text-[#6c7a6d]`,title:e,children:[i.jsx("img",{alt:"","aria-hidden":"true",className:"size-4 flex-none rounded-[3px]",src:`/providers/${t}.svg`}),i.jsx("span",{className:"min-w-0 truncate font-medium text-[#3f4a40]","data-session-title":"",children:a}),n?i.jsx("span",{className:`flex-none whitespace-nowrap text-[#8a968b]
3
- max-[767px]:hidden`,children:n.lastMessageAt?` · ${r(n.lastMessageAt)}`:""}):null]}):null}export{x as LinkedSessionHeader};
@@ -1 +0,0 @@
1
- import{c as e}from"./view-context-D-fh9AbH.js";const o=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],a=e("mail",o);export{a as M};
@@ -1,131 +0,0 @@
1
- const et=Symbol.for("yaml.alias"),He=Symbol.for("yaml.document"),J=Symbol.for("yaml.map"),Lt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),P=Symbol.for("yaml.node.type"),oe=n=>!!n&&typeof n=="object"&&n[P]===et,_e=n=>!!n&&typeof n=="object"&&n[P]===He,ye=n=>!!n&&typeof n=="object"&&n[P]===J,$=n=>!!n&&typeof n=="object"&&n[P]===Lt,I=n=>!!n&&typeof n=="object"&&n[P]===q,be=n=>!!n&&typeof n=="object"&&n[P]===re;function E(n){if(n&&typeof n=="object")switch(n[P]){case J:case re:return!0}return!1}function L(n){if(n&&typeof n=="object")switch(n[P]){case et:case J:case q:case re:return!0}return!1}const $t=n=>(I(n)||E(n))&&!!n.anchor,Y=Symbol("break visit"),us=Symbol("skip children"),de=Symbol("remove node");function le(n,e){const t=hs(e);_e(n)?x(null,n.contents,t,Object.freeze([n]))===de&&(n.contents=null):x(null,n,t,Object.freeze([]))}le.BREAK=Y;le.SKIP=us;le.REMOVE=de;function x(n,e,t,s){const i=ds(n,e,t,s);if(L(i)||$(i))return ps(n,s,i),x(n,i,t,s);if(typeof i!="symbol"){if(E(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=x(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===Y)return Y;o===de&&(e.items.splice(r,1),r-=1)}}}else if($(e)){s=Object.freeze(s.concat(e));const r=x("key",e.key,t,s);if(r===Y)return Y;r===de&&(e.key=null);const o=x("value",e.value,t,s);if(o===Y)return Y;o===de&&(e.value=null)}}return i}function hs(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function ds(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(ye(e))return t.Map?.(n,e,s);if(be(e))return t.Seq?.(n,e,s);if($(e))return t.Pair?.(n,e,s);if(I(e))return t.Scalar?.(n,e,s);if(oe(e))return t.Alias?.(n,e,s)}function ps(n,e,t){const s=e[e.length-1];if(E(s))s.items[n]=t;else if($(s))n==="key"?s.key=t:s.value=t;else if(_e(s))s.contents=t;else{const i=oe(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const ms={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gs=n=>n.replace(/[!,[\]{}]/g,e=>ms[e]);class _{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_.defaultYaml,e),this.tags=Object.assign({},_.defaultTags,t)}clone(){const e=new _(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new _(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:_.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(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]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+gs(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&L(e.contents)){const r={};le(e.contents,(o,l)=>{L(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
- `)}}_.defaultYaml={explicit:!1,version:"1.2"};_.defaultTags={"!!":"tag:yaml.org,2002:"};function Ct(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function vt(n){const e=new Set;return le(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function _t(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function ys(n,e){const t=[],s=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=vt(n));const o=_t(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(I(o.node)||E(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:s}}function Z(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],l=Z(n,s,String(i),o);l===void 0?delete s[i]:l!==o&&(s[i]=l)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=Z(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=Z(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=Z(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}function K(n,e,t){if(Array.isArray(n))return n.map((s,i)=>K(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!$t(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}class tt{constructor(e){Object.defineProperty(this,P,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!_e(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=K(this,"",o);if(typeof i=="function")for(const{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?Z(r,{"":l},"",l):l}}class st extends tt{constructor(e){super(et),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],le(e,{Node:(r,o)=>{(oe(o)||$t(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=s.get(o);if(l||(K(o,null,t),l=s.get(o)),l?.res===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Ie(i,o,s)),l.count*l.aliasCount>r)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,s){const i=`*${this.source}`;if(e){if(Ct(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Ie(n,e,t){if(oe(e)){const s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(E(e)){let s=0;for(const i of e.items){const r=Ie(n,i,t);r>s&&(s=r)}return s}else if($(e)){const s=Ie(n,e.key,t),i=Ie(n,e.value,t);return Math.max(s,i)}return 1}const Bt=n=>!n||typeof n!="function"&&typeof n!="object";class O extends tt{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:K(this.value,e,t)}toString(){return String(this.value)}}O.BLOCK_FOLDED="BLOCK_FOLDED";O.BLOCK_LITERAL="BLOCK_LITERAL";O.PLAIN="PLAIN";O.QUOTE_DOUBLE="QUOTE_DOUBLE";O.QUOTE_SINGLE="QUOTE_SINGLE";const bs="tag:yaml.org,2002:";function ws(n,e,t){if(e){const s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function me(n,e,t){if(_e(n)&&(n=n.contents),L(n))return n;if($(n)){const f=t.schema[J].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t;let a;if(s&&n&&typeof n=="object"){if(a=l.get(n),a)return a.anchor??(a.anchor=i(n)),new st(a.anchor);a={anchor:null,node:null},l.set(n,a)}e?.startsWith("!!")&&(e=bs+e.slice(2));let c=ws(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const f=new O(n);return a&&(a.node=f),f}c=n instanceof Map?o[J]:Symbol.iterator in Object(n)?o[re]:o[J]}r&&(r(c),delete t.onTagObj);const d=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new O(n);return e?d.tag=e:c.default||(d.tag=c.tag),a&&(a.node=d),d}function $e(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return me(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const ue=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class Mt extends tt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>L(s)||$(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ue(e))this.add(t);else{const[s,...i]=e,r=this.get(s,!0);if(E(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,$e(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const i=this.get(t,!0);if(E(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&I(r)?r.value:r:E(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!$(t))return!1;const s=t.value;return s==null||e&&I(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const i=this.get(t,!0);return E(i)?i.hasIn(s):!1}setIn(e,t){const[s,...i]=e;if(i.length===0)this.set(s,t);else{const r=this.get(s,!0);if(E(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,$e(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const ks=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function F(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const G=(n,e,t)=>n.endsWith(`
3
- `)?F(t,e):t.includes(`
4
- `)?`
5
- `+F(t,e):(n.endsWith(" ")?"":" ")+t,Kt="flow",We="block",Ee="quoted";function Be(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return n;i<r&&(r=0);const a=Math.max(1+r,1+i-e.length);if(n.length<=a)return n;const c=[],d={};let f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):f=i-s);let u,m,g=!1,h=-1,p=-1,b=-1;t===We&&(h=gt(n,h,e.length),h!==-1&&(f=h+a));for(let k;k=n[h+=1];){if(t===Ee&&k==="\\"){switch(p=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(k===`
6
- `)t===We&&(h=gt(n,h,e.length)),f=h+e.length+a,u=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
7
- `&&m!==" "){const S=n[h+1];S&&S!==" "&&S!==`
8
- `&&S!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+a,u=void 0;else if(t===Ee){for(;m===" "||m===" ";)m=k,k=n[h+=1],g=!0;const S=h>b+1?h-2:p-1;if(d[S])return n;c.push(S),d[S]=!0,f=S+a,u=void 0}else g=!0}m=k}if(g&&l&&l(),c.length===0)return n;o&&o();let w=n.slice(0,c[0]);for(let k=0;k<c.length;++k){const S=c[k],N=c[k+1]||n.length;S===0?w=`
9
- ${e}${n.slice(0,N)}`:(t===Ee&&d[S]&&(w+=`${n[S]}\\`),w+=`
10
- ${e}${n.slice(S+1,N)}`)}return w}function gt(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
11
- `);s=e,i=e+1,r=n[i]}return s}const Me=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Ke=n=>/^(%|---|\.\.\.)/m.test(n);function Ss(n,e,t){if(!e||e<0)return!1;const s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
12
- `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function pe(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Ke(n)?" ":"");let o="",l=0;for(let a=0,c=t[a];c;c=t[++a])if(c===" "&&t[a+1]==="\\"&&t[a+2]==="n"&&(o+=t.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(t[a+1]){case"u":{o+=t.slice(l,a);const d=t.substr(a+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(a,6)}a+=5,l=a+1}break;case"n":if(s||t[a+2]==='"'||t.length<i)a+=1;else{for(o+=t.slice(l,a)+`
13
-
14
- `;t[a+2]==="\\"&&t[a+3]==="n"&&t[a+4]!=='"';)o+=`
15
- `,a+=2;o+=r,t[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+t.slice(l):t,s?o:Be(o,r,Ee,Me(e,!1))}function Xe(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(n))return pe(n,e);const t=e.indent||(Ke(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${t}`)+"'";return e.implicitKey?s:Be(s,t,Kt,Me(e,!1))}function ee(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=pe;else{const i=n.includes('"'),r=n.includes("'");i&&!r?s=Xe:r&&!i?s=pe:s=t?Xe:pe}return s(n,e)}let ze;try{ze=new RegExp(`(^|(?<!
18
- ))
19
- +(?!
20
- |$)`,"g")}catch{ze=/\n+(?!\n|$)/g}function Le({comment:n,type:e,value:t},s,i,r){const{blockQuote:o,commentString:l,lineWidth:a}=s.options;if(!o||/\n[\t ]+$/.test(t))return ee(t,s);const c=s.indent||(s.forceBlockIndent||Ke(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!Ss(t,a,c.length);if(!t)return d?`|
21
- `:`>
22
- `;let f,u;for(u=t.length;u>0;--u){const N=t[u-1];if(N!==`
23
- `&&N!==" "&&N!==" ")break}let m=t.substring(u);const g=m.indexOf(`
24
- `);g===-1?f="-":t===m||g!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
25
- `&&(m=m.slice(0,-1)),m=m.replace(ze,`$&${c}`));let h=!1,p,b=-1;for(p=0;p<t.length;++p){const N=t[p];if(N===" ")h=!0;else if(N===`
26
- `)b=p;else break}let w=t.substring(0,b<p?b+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let S=(h?c?"2":"1":"")+f;if(n&&(S+=" "+l(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const N=t.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let A=!1;const T=Me(s,!0);o!=="folded"&&e!==O.BLOCK_FOLDED&&(T.onOverflow=()=>{A=!0});const y=Be(`${w}${N}${m}`,c,We,T);if(!A)return`>${S}
28
- ${c}${y}`}return t=t.replace(/\n+/g,`$&${c}`),`|${S}
29
- ${c}${w}${t}${m}`}function Ns(n,e,t,s){const{type:i,value:r}=n,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:d}=e;if(l&&r.includes(`
30
- `)||d&&/[[\]{},]/.test(r))return ee(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||d||!r.includes(`
31
- `)?ee(r,e):Le(n,e,t,s);if(!l&&!d&&i!==O.PLAIN&&r.includes(`
32
- `))return Le(n,e,t,s);if(Ke(r)){if(a==="")return e.forceBlockIndent=!0,Le(n,e,t,s);if(l&&a===c)return ee(r,e)}const f=r.replace(/\n+/g,`$&
33
- ${a}`);if(o){const u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:m,tags:g}=e.doc.schema;if(g.some(u)||m?.some(u))return ee(r,e)}return l?f:Be(f,a,Kt,Me(e,!1))}function nt(n,e,t,s){const{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:l}=n;l!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=O.QUOTE_DOUBLE);const a=d=>{switch(d){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return i||r?ee(o.value,e):Le(o,e,t,s);case O.QUOTE_DOUBLE:return pe(o.value,e);case O.QUOTE_SINGLE:return Xe(o.value,e);case O.PLAIN:return Ns(o,e,t,s);default:return null}};let c=a(l);if(c===null){const{defaultKeyType:d,defaultStringType:f}=e.options,u=i&&d||f;if(c=a(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}function Pt(n,e){const t=Object.assign({blockQuote:!0,commentString:ks,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},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function Os(n,e){if(e.tag){const i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(I(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function As(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const i=[],r=(I(n)||E(n))&&n.anchor;r&&Ct(r)&&(t.add(r),i.push(`&${r}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function ne(n,e,t,s){if($(n))return n.toString(e,t,s);if(oe(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const r=L(n)?n:e.doc.createNode(n,{onTagObj:a=>i=a});i??(i=Os(e.doc.schema.tags,r));const o=As(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,e,t,s):I(r)?nt(r,e,t,s):r.toString(e,t,s);return o?I(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
34
- ${e.indent}${l}`:l}function Ts({key:n,value:e},t,s,i){const{allNullValues:r,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:d,simpleKeys:f}}=t;let u=L(n)&&n.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(E(n)||!L(n)&&typeof n=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!f&&(!n||u&&e==null&&!t.inFlow||E(n)||(I(n)?n.type===O.BLOCK_FOLDED||n.type===O.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:l+a});let g=!1,h=!1,p=ne(n,t,()=>g=!0,()=>h=!0);if(!m&&!t.inFlow&&p.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return g&&s&&s(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,u&&!g?p+=G(p,t.indent,c(u)):h&&i&&i(),p;g&&(u=null),m?(u&&(p+=G(p,t.indent,c(u))),p=`? ${p}
35
- ${l}:`):(p=`${p}:`,u&&(p+=G(p,t.indent,c(u))));let b,w,k;L(e)?(b=!!e.spaceBefore,w=e.commentBefore,k=e.comment):(b=!1,w=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!u&&I(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&a.length>=2&&!t.inFlow&&!m&&be(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const N=ne(e,t,()=>S=!0,()=>h=!0);let A=" ";if(u||b||w){if(A=b?`
36
- `:"",w){const T=c(w);A+=`
37
- ${F(T,t.indent)}`}N===""&&!t.inFlow?A===`
38
- `&&k&&(A=`
39
-
40
- `):A+=`
41
- ${t.indent}`}else if(!m&&E(e)){const T=N[0],y=N.indexOf(`
42
- `),C=y!==-1,U=t.inFlow??e.flow??e.items.length===0;if(C||!U){let W=!1;if(C&&(T==="&"||T==="!")){let v=N.indexOf(" ");T==="&"&&v!==-1&&v<y&&N[v+1]==="!"&&(v=N.indexOf(" ",v+1)),(v===-1||y<v)&&(W=!0)}W||(A=`
43
- ${t.indent}`)}}else(N===""||N[0]===`
44
- `)&&(A="");return p+=A+N,t.inFlow?S&&s&&s():k&&!S?p+=G(p,t.indent,c(k)):h&&i&&i(),p}function Is(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const Se="<<",R={identify:n=>n===Se||typeof n=="symbol"&&n.description===Se,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O(Symbol(Se)),{addToJSMap:jt}),stringify:()=>Se},Es=(n,e)=>(R.identify(e)||I(e)&&(!e.type||e.type===O.PLAIN)&&R.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===R.tag&&t.default);function jt(n,e,t){const s=Dt(n,t);if(be(s))for(const i of s.items)Ue(n,e,i);else if(Array.isArray(s))for(const i of s)Ue(n,e,i);else Ue(n,e,s)}function Ue(n,e,t){const s=Dt(n,t);if(!ye(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,n,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Dt(n,e){return n&&oe(e)?e.resolve(n.doc,n):e}function qt(n,e,{key:t,value:s}){if(L(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(Es(n,t))jt(n,e,s);else{const i=K(t,"",n);if(e instanceof Map)e.set(i,K(s,i,n));else if(e instanceof Set)e.add(i);else{const r=Ls(t,i,n),o=K(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Ls(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(L(n)&&t?.doc){const s=Pt(t.doc,{});s.anchors=new Set;for(const r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Is(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function it(n,e,t){const s=me(n,void 0,t),i=me(e,void 0,t);return new B(s,i)}class B{constructor(e,t=null){Object.defineProperty(this,P,{value:Lt}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return L(t)&&(t=t.clone(e)),L(s)&&(s=s.clone(e)),new B(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return qt(t,s,this)}toString(e,t,s){return e?.doc?Ts(this,e,t,s):JSON.stringify(this)}}function Ft(n,e,t){return(e.inFlow??n.flow?Cs:$s)(n,e,t)}function $s({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:a,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null});let f=!1;const u=[];for(let g=0;g<e.length;++g){const h=e[g];let p=null;if(L(h))!f&&h.spaceBefore&&u.push(""),Ce(t,u,h.commentBefore,f),h.comment&&(p=h.comment);else if($(h)){const w=L(h.key)?h.key:null;w&&(!f&&w.spaceBefore&&u.push(""),Ce(t,u,w.commentBefore,f))}f=!1;let b=ne(h,d,()=>p=null,()=>f=!0);p&&(b+=G(b,r,c(p))),f&&p&&(f=!1),u.push(s+b)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let g=1;g<u.length;++g){const h=u[g];m+=h?`
45
- ${a}${h}`:`
46
- `}}return n?(m+=`
47
- `+F(c(n),a),l&&l()):f&&o&&o(),m}function Cs({items:n},e,{flowChars:t,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;s+=r;const a=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,d=0;const f=[];for(let g=0;g<n.length;++g){const h=n[g];let p=null;if(L(h))h.spaceBefore&&f.push(""),Ce(e,f,h.commentBefore,!1),h.comment&&(p=h.comment);else if($(h)){const w=L(h.key)?h.key:null;w&&(w.spaceBefore&&f.push(""),Ce(e,f,w.commentBefore,!1),w.comment&&(c=!0));const k=L(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(c=!0)):h.value==null&&w?.comment&&(p=w.comment)}p&&(c=!0);let b=ne(h,a,()=>p=null);c||(c=f.length>d||b.includes(`
48
- `)),g<n.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((w,k)=>w+k.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),p&&(b+=G(b,s,l(p))),f.push(b),d=f.length}const{start:u,end:m}=t;if(f.length===0)return u+m;if(!c){const g=f.reduce((h,p)=>h+p.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(const h of f)g+=h?`
49
- ${r}${i}${h}`:`
50
- `;return`${g}
51
- ${i}${m}`}else return`${u}${o}${f.join(" ")}${o}${m}`}function Ce({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=F(e(s),n);t.push(r.trimStart())}}function Q(n,e){const t=I(e)?e.value:e;for(const s of n)if($(s)&&(s.key===e||s.key===t||I(s.key)&&s.key.value===t))return s}class M extends Mt{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(J,e),this.items=[]}static from(e,t,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),l=(a,c)=>{if(typeof r=="function")c=r.call(t,a,c);else if(Array.isArray(r)&&!r.includes(a))return;(c!==void 0||i)&&o.items.push(it(a,c,s))};if(t instanceof Map)for(const[a,c]of t)l(a,c);else if(t&&typeof t=="object")for(const a of Object.keys(t))l(a,t[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;$(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new B(e,e?.value):s=new B(e.key,e.value);const i=Q(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);I(i.value)&&Bt(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(l=>r(s,l)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=Q(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=Q(this.items,e)?.value;return(!t&&I(i)?i.value:i)??void 0}has(e){return!!Q(this.items,e)}set(e,t){this.add(new B(e,t),!0)}toJSON(e,t,s){const i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)qt(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!$(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ft(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const ae={collection:"map",default:!0,nodeClass:M,tag:"tag:yaml.org,2002:map",resolve(n,e){return ye(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>M.from(n,e,t)};class H extends Mt{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(re,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Ne(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=Ne(e);if(typeof s!="number")return;const i=this.items[s];return!t&&I(i)?i.value:i}has(e){const t=Ne(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=Ne(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];I(i)&&Bt(t)?i.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let i=0;for(const r of this.items)s.push(K(r,String(i++),t));return s}toString(e,t,s){return e?Ft(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let l of t){if(typeof i=="function"){const a=t instanceof Set?l:String(o++);l=i.call(t,a,l)}r.items.push(me(l,void 0,s))}}return r}}function Ne(n){let e=I(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const ce={collection:"seq",default:!0,nodeClass:H,tag:"tag:yaml.org,2002:seq",resolve(n,e){return be(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>H.from(n,e,t)},Pe={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),nt(n,e,t,s)}},je={identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:n},e)=>typeof n=="string"&&je.test.test(n)?n:e.options.nullStr},rt={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new O(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&rt.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function D({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let l=e-(r.length-o-1);for(;l-- >0;)r+="0"}return r}const Rt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D},Ut={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():D(n)}},Vt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new O(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:D},De=n=>typeof n=="bigint"||Number.isInteger(n),ot=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Jt(n,e,t){const{value:s}=n;return De(s)&&s>=0?t+s.toString(e):D(n)}const Yt={identify:n=>De(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>ot(n,2,8,t),stringify:n=>Jt(n,8,"0o")},Gt={identify:De,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>ot(n,0,10,t),stringify:D},Qt={identify:n=>De(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>ot(n,2,16,t),stringify:n=>Jt(n,16,"0x")},vs=[ae,ce,Pe,je,rt,Yt,Gt,Qt,Rt,Ut,Vt];function yt(n){return typeof n=="bigint"||Number.isInteger(n)}const Oe=({value:n})=>JSON.stringify(n),_s=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Oe},{identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Oe},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Oe},{identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>yt(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Oe}],Bs={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Ms=[ae,ce].concat(_s,Bs),lt={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";const o=t;let l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const a=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(l.length/a),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=a)d[f]=l.substr(u,a);l=d.join(e===O.BLOCK_LITERAL?`
52
- `:" ")}return nt({comment:n,type:e,value:l},s,i,r)}};function Ht(n,e){if(be(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!$(s)){if(ye(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new B(new O(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
53
- ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
54
- ${r.comment}`:s.comment}s=i}n.items[t]=$(s)?s:new B(s)}}else e("Expected a sequence for this tag");return n}function Wt(n,e,t){const{replacer:s}=t,i=new H(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(it(l,a,t))}return i}const at={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ht,createNode:Wt};class te extends H{constructor(){super(),this.add=M.prototype.add.bind(this),this.delete=M.prototype.delete.bind(this),this.get=M.prototype.get.bind(this),this.has=M.prototype.has.bind(this),this.set=M.prototype.set.bind(this),this.tag=te.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const i of this.items){let r,o;if($(i)?(r=K(i.key,"",t),o=K(i.value,r,t)):r=K(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){const i=Wt(e,t,s),r=new this;return r.items=i.items,r}}te.tag="tag:yaml.org,2002:omap";const ct={collection:"seq",identify:n=>n instanceof Map,nodeClass:te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Ht(n,e),s=[];for(const{key:i}of t.items)I(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new te,t)},createNode:(n,e,t)=>te.from(n,e,t)};function Xt({value:n,source:e},t){return e&&(n?zt:xt).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const zt={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O(!0),stringify:Xt},xt={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O(!1),stringify:Xt},Ks={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D},Ps={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():D(n)}},js={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new O(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:D},we=n=>typeof n=="bigint"||Number.isInteger(n);function qe(n,e,t,{intAsBigInt:s}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return i==="-"?BigInt(-1)*o:o}const r=parseInt(n,t);return i==="-"?-1*r:r}function ft(n,e,t){const{value:s}=n;if(we(s)){const i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return D(n)}const Ds={identify:we,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>qe(n,2,2,t),stringify:n=>ft(n,2,"0b")},qs={identify:we,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>qe(n,1,8,t),stringify:n=>ft(n,8,"0")},Fs={identify:we,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>qe(n,0,10,t),stringify:D},Rs={identify:we,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>qe(n,2,16,t),stringify:n=>ft(n,16,"0x")};class se extends M{constructor(e){super(e),this.tag=se.tag}add(e){let t;$(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new B(e.key,null):t=new B(e,null),Q(this.items,t.key)||this.items.push(t)}get(e,t){const s=Q(this.items,e);return!t&&$(s)?I(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const s=Q(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new B(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(it(o,null,s));return r}}se.tag="tag:yaml.org,2002:set";const ut={collection:"map",identify:n=>n instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>se.from(n,e,t),resolve(n,e){if(ye(n)){if(n.hasAllNullValues(!0))return Object.assign(new se,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function ht(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}function Zt(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return D(n);let s="";e<0&&(s="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const es={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>ht(n,t),stringify:Zt},ts={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>ht(n,!1),stringify:Zt},Fe={identify:n=>n 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(n){const e=n.match(Fe.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,i,r,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,i,r||0,o||0,l||0,a);const d=e[8];if(d&&d!=="Z"){let f=ht(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},bt=[ae,ce,Pe,je,zt,xt,Ds,qs,Fs,Rs,Ks,Ps,js,lt,R,ct,at,ut,es,ts,Fe],wt=new Map([["core",vs],["failsafe",[ae,ce,Pe]],["json",Ms],["yaml11",bt],["yaml-1.1",bt]]),kt={binary:lt,bool:rt,float:Vt,floatExp:Ut,floatNaN:Rt,floatTime:ts,int:Gt,intHex:Qt,intOct:Yt,intTime:es,map:ae,merge:R,null:je,omap:ct,pairs:at,seq:ce,set:ut,timestamp:Fe},Us={"tag:yaml.org,2002:binary":lt,"tag:yaml.org,2002:merge":R,"tag:yaml.org,2002:omap":ct,"tag:yaml.org,2002:pairs":at,"tag:yaml.org,2002:set":ut,"tag:yaml.org,2002:timestamp":Fe};function Ve(n,e,t){const s=wt.get(e);if(s&&!n)return t&&!s.includes(R)?s.concat(R):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{const r=Array.from(wt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(const r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(R)),i.reduce((r,o)=>{const l=typeof o=="string"?kt[o]:o;if(!l){const a=JSON.stringify(o),c=Object.keys(kt).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return r.includes(l)||r.push(l),r},[])}const Vs=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class dt{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Ve(e,"compat"):e?Ve(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Us:{},this.tags=Ve(t,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,J,{value:ae}),Object.defineProperty(this,q,{value:Pe}),Object.defineProperty(this,re,{value:ce}),this.sortMapEntries=typeof o=="function"?o:o===!0?Vs:null}clone(){const e=Object.create(dt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Js(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const a=n.directives.toString(n);a?(t.push(a),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const i=Pt(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const a=r(n.commentBefore);t.unshift(F(a,""))}let o=!1,l=null;if(n.contents){if(L(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const d=r(n.contents.commentBefore);t.push(F(d,""))}i.forceBlockIndent=!!n.comment,l=n.contents.comment}const a=l?void 0:()=>o=!0;let c=ne(n.contents,i,()=>l=null,a);l&&(c+=G(c,"",r(l))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ne(n.contents,i));if(n.directives?.docEnd)if(n.comment){const a=r(n.comment);a.includes(`
55
- `)?(t.push("..."),t.push(F(a,""))):t.push(`... ${a}`)}else t.push("...");else{let a=n.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(F(r(a),"")))}return t.join(`
56
- `)+`
57
- `}class Re{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,P,{value:He});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new _({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(Re.prototype,{[P]:{value:He}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=L(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){X(this.contents)&&this.contents.add(e)}addIn(e,t){X(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=vt(this);e.anchor=!t||s.has(t)?_t(t||"a",s):t}return new st(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const p=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=t.filter(p).map(String);b.length>0&&(t=t.concat(b)),i=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:d}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=ys(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},h=me(e,d,g);return l&&E(h)&&(h.flow=!0),u(),h}createPair(e,t,s={}){const i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new B(i,r)}delete(e){return X(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ue(e)?this.contents==null?!1:(this.contents=null,!0):X(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return E(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ue(e)?!t&&I(this.contents)?this.contents.value:this.contents:E(this.contents)?this.contents.getIn(e,t):void 0}has(e){return E(this.contents)?this.contents.has(e):!1}hasIn(e){return ue(e)?this.contents!==void 0:E(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=$e(this.schema,[e],t):X(this.contents)&&this.contents.set(e,t)}setIn(e,t){ue(e)?this.contents=t:this.contents==null?this.contents=$e(this.schema,Array.from(e),t):X(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new _({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new _({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new dt(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=K(this.contents,t??"",l);if(typeof r=="function")for(const{count:c,res:d}of l.anchors.values())r(d,c);return typeof o=="function"?Z(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Js(this,e)}}function X(n){if(E(n))return!0;throw new Error("Expected a YAML collection as document contents")}class ss extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}}class he extends ss{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Ys extends ss{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const St=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const l=Math.min(r-39,o.length-79);o="…"+o.substring(l),r-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let l=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
58
- `),o=l+o}if(/[^ ]/.test(o)){let l=1;const a=t.linePos[1];a?.line===s&&a.col>i&&(l=Math.max(1,Math.min(a.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(l);t.message+=`:
59
-
60
- ${o}
61
- ${c}
62
- `}};function ie(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let a=!1,c=l,d=l,f="",u="",m=!1,g=!1,h=null,p=null,b=null,w=null,k=null,S=null,N=null;for(const y of n)switch(g&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&r(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(c&&y.type!=="comment"&&y.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),y.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&y.source.includes(" ")&&(h=y),d=!0;break;case"comment":{d||r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const C=y.source.substring(1)||" ";f?f+=u+C:f=C,u="",c=!1;break}case"newline":c?f?f+=y.source:(!S||t!=="seq-item-ind")&&(a=!0):u+=y.source,c=!0,m=!0,(p||b)&&(w=y),d=!0;break;case"anchor":p&&r(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&r(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=y,N??(N=y.offset),c=!1,d=!1,g=!0;break;case"tag":{b&&r(y,"MULTIPLE_TAGS","A node can have at most one tag"),b=y,N??(N=y.offset),c=!1,d=!1,g=!0;break}case t:(p||b)&&r(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),S&&r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),S=y,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&r(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=y,c=!1,d=!1;break}default:r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),c=!1,d=!1}const A=n[n.length-1],T=A?A.offset+A.source.length:i;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:a,comment:f,hasNewline:m,anchor:p,tag:b,newlineAfterProp:w,end:T,start:N??T}}function ge(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
63
- `))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(ge(e.key)||ge(e.value))return!0}return!1;default:return!0}}function xe(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&ge(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function ns(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||I(r)&&I(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const Nt="All mapping items must start at the same column";function Gs({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??M,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let a=s.offset,c=null;for(const d of s.items){const{start:f,key:u,sep:m,value:g}=d,h=ie(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:a,onError:i,parentIndent:s.indent,startOnNewline:!0}),p=!h.found;if(p){if(u&&(u.type==="block-seq"?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(a,"BAD_INDENT",Nt)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(l.comment?l.comment+=`
64
- `+h.comment:l.comment=h.comment);continue}(h.newlineAfterProp||ge(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&i(a,"BAD_INDENT",Nt);t.atKey=!0;const b=h.end,w=u?n(t,u,h,i):e(t,b,f,null,h,i);t.schema.compat&&xe(s.indent,u,i),t.atKey=!1,ns(t,l.items,w)&&i(b,"DUPLICATE_KEY","Map keys must be unique");const k=ie(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(a=k.end,k.found){p&&(g?.type==="block-map"&&!k.hasNewline&&i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<k.found.offset-1024&&i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const S=g?n(t,g,k,i):e(t,a,m,null,k,i);t.schema.compat&&xe(s.indent,g,i),a=S.range[2];const N=new B(w,S);t.options.keepSourceTokens&&(N.srcToken=d),l.items.push(N)}else{p&&i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(w.comment?w.comment+=`
65
- `+k.comment:w.comment=k.comment);const S=new B(w);t.options.keepSourceTokens&&(S.srcToken=d),l.items.push(S)}}return c&&c<a&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,a,c??a],l}function Qs({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??H,l=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let a=s.offset,c=null;for(const{start:d,value:f}of s.items){const u=ie(d,{indicator:"seq-item-ind",next:f,offset:a,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(l.comment=u.comment);continue}const m=f?n(t,f,u,i):e(t,u.end,d,null,u,i);t.schema.compat&&xe(s.indent,f,i),a=m.range[2],l.items.push(m)}return l.range=[s.offset,a,c??a],l}function ke(n,e,t,s){let i="";if(n){let r=!1,o="";for(const l of n){const{source:a,type:c}=l;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=a.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=a),r=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:i,offset:e}}const Je="Block collections are not allowed within flow collections",Ye=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Hs({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=s.start.source==="{",l=o?"flow map":"flow sequence",a=r?.nodeClass??(o?M:H),c=new a(t.schema);c.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let p=0;p<s.items.length;++p){const b=s.items[p],{start:w,key:k,sep:S,value:N}=b,A=ie(w,{flow:l,indicator:"explicit-key-ind",next:k??S?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!S&&!N){p===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):p<s.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),A.comment&&(c.comment?c.comment+=`
66
- `+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&ge(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${l} items`),A.comment){let T="";e:for(const y of w)switch(y.type){case"comma":case"space":break;case"comment":T=y.source.substring(1);break e;default:break e}if(T){let y=c.items[c.items.length-1];$(y)&&(y=y.value??y.key),y.comment?y.comment+=`
67
- `+T:y.comment=T,A.comment=A.comment.substring(T.length+1)}}if(!o&&!S&&!A.found){const T=N?n(t,N,A,i):e(t,A.end,S,null,A,i);c.items.push(T),f=T.range[2],Ye(N)&&i(T.range,"BLOCK_IN_FLOW",Je)}else{t.atKey=!0;const T=A.end,y=k?n(t,k,A,i):e(t,T,w,null,A,i);Ye(k)&&i(y.range,"BLOCK_IN_FLOW",Je),t.atKey=!1;const C=ie(S??[],{flow:l,indicator:"map-value-ind",next:N,offset:y.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(C.found){if(!o&&!A.found&&t.options.strict){if(S)for(const v of S){if(v===C.found)break;if(v.type==="newline"){i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<C.found.offset-1024&&i(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?i(N,"MISSING_CHAR",`Missing space after : in ${l}`):i(C.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const U=N?n(t,N,C,i):C.found?e(t,C.end,S,null,C,i):null;U?Ye(N)&&i(U.range,"BLOCK_IN_FLOW",Je):C.comment&&(y.comment?y.comment+=`
68
- `+C.comment:y.comment=C.comment);const W=new B(y,U);if(t.options.keepSourceTokens&&(W.srcToken=b),o){const v=c;ns(t,v.items,y)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),v.items.push(W)}else{const v=new M(t.schema);v.flow=!0,v.items.push(W);const mt=(U??y).range;v.range=[y.range[0],mt[1],mt[2]],c.items.push(v)}f=U?U.range[2]:C.end}}const u=o?"}":"]",[m,...g]=s.end;let h=f;if(m?.source===u)h=m.offset+m.source.length;else{const p=l[0].toUpperCase()+l.substring(1),b=d?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(f,d?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const p=ke(g,h,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
69
- `+p.comment:c.comment=p.comment),c.range=[s.offset,h,p.offset]}else c.range=[s.offset,h,h];return c}function Ge(n,e,t,s,i,r){const o=t.type==="block-map"?Gs(n,e,t,s,r):t.type==="block-seq"?Qs(n,e,t,s,r):Hs(n,e,t,s,r),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function Ws(n,e,t,s,i){const r=s.tag,o=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){const{anchor:u,newlineAfterProp:m}=s,g=u&&r?u.offset>r.offset?u:r:u??r;g&&(!m||m.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===M.tagName&&l==="map"||o===H.tagName&&l==="seq")return Ge(n,e,t,i,o);let a=e.schema.tags.find(u=>u.tag===o&&u.collection===l);if(!a){const u=e.schema.knownTags[o];if(u?.collection===l)e.schema.tags.push(Object.assign({},u,{default:!1})),a=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${l} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ge(n,e,t,i,o)}const c=Ge(n,e,t,i,o,a),d=a.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=L(d)?d:new O(d);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Xs(n,e,t){const s=e.offset,i=zs(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,o=e.source?xs(e.source):[];let l=o.length;for(let h=o.length-1;h>=0;--h){const p=o[h][1];if(p===""||p==="\r")l=h;else break}if(l===0){const h=i.chomp==="+"&&o.length>0?`
70
- `.repeat(Math.max(1,o.length-1)):"";let p=s+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[s,p,p]}}let a=e.indent+i.indent,c=e.offset+i.length,d=0;for(let h=0;h<l;++h){const[p,b]=o[h];if(b===""||b==="\r")i.indent===0&&p.length>a&&(a=p.length);else{p.length<a&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(a=p.length),d=h,a===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+b.length+1}for(let h=o.length-1;h>=l;--h)o[h][0].length>a&&(l=h+1);let f="",u="",m=!1;for(let h=0;h<d;++h)f+=o[h][0].slice(a)+`
71
- `;for(let h=d;h<l;++h){let[p,b]=o[h];c+=p.length+b.length+1;const w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&p.length<a){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(w?2:1),"BAD_INDENT",S),p=""}r===O.BLOCK_LITERAL?(f+=u+p.slice(a)+b,u=`
72
- `):p.length>a||b[0]===" "?(u===" "?u=`
73
- `:!m&&u===`
74
- `&&(u=`
75
-
76
- `),f+=u+p.slice(a)+b,u=`
77
- `,m=!0):b===""?u===`
78
- `?f+=`
79
- `:u=`
80
- `:(f+=u+b,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=l;h<o.length;++h)f+=`
81
- `+o[h][0].slice(a);f[f.length-1]!==`
82
- `&&(f+=`
83
- `);break;default:f+=`
84
- `}const g=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,g,g]}}function zs({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,l="",a=-1;for(let u=1;u<i.length;++u){const m=i[u];if(!l&&(m==="-"||m==="+"))l=m;else{const g=Number(m);!o&&g?o=g:a===-1&&(a=n+u)}}a!==-1&&s(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",f=i.length;for(let u=1;u<e.length;++u){const m=e[u];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,d=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const g=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",g);const h=m.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:o,chomp:l,comment:d,length:f}}function xs(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Zs(n,e,t){const{offset:s,type:i,source:r,end:o}=n;let l,a;const c=(u,m,g)=>t(s+u,m,g);switch(i){case"scalar":l=O.PLAIN,a=en(r,c);break;case"single-quoted-scalar":l=O.QUOTE_SINGLE,a=tn(r,c);break;case"double-quoted-scalar":l=O.QUOTE_DOUBLE,a=sn(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,f=ke(o,d,e,t);return{value:a,type:l,comment:f.comment,range:[s,d,f.offset]}}function en(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),is(n)}function tn(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),is(n.slice(1,-1)).replace(/''/g,"'")}function is(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
- `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?r===`
87
- `?i+=r:r=`
88
- `:(i+=r+s[1],r=" "),o=t.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(n),i+r+(s?.[1]??"")}function sn(n,e){let t="";for(let s=1;s<n.length-1;++s){const i=n[s];if(!(i==="\r"&&n[s+1]===`
89
- `))if(i===`
90
- `){const{fold:r,offset:o}=nn(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s];const o=rn[r];if(o)t+=o;else if(r===`
91
- `)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
92
- `)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){const l=r==="x"?2:r==="u"?4:8;t+=on(n,s+1,l,e),s+=l}else{const l=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(i===" "||i===" "){const r=s;let o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
93
- `&&!(o==="\r"&&n[s+2]===`
94
- `)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function nn(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
95
- `||s==="\r")&&!(s==="\r"&&n[e+2]!==`
96
- `);)s===`
97
- `&&(t+=`
98
- `),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const rn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function on(n,e,t,s){const i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{const l=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function rs(n,e,t,s){const{value:i,type:r,comment:o,range:l}=e.type==="block-scalar"?Xs(n,e,s):Zs(e,n.options.strict,s),a=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[q]:a?c=ln(n.schema,i,a,t,s):e.type==="scalar"?c=an(n,i,e,s):c=n.schema[q];let d;try{const f=c.resolve(i,u=>s(t??e,"TAG_RESOLVE_FAILED",u),n.options);d=I(f)?f:new O(f)}catch(f){const u=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",u),d=new O(i)}return d.range=l,d.source=i,r&&(d.type=r),a&&(d.tag=a),c.format&&(d.format=c.format),o&&(d.comment=o),d}function ln(n,e,t,s,i){if(t==="!")return n[q];const r=[];for(const l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if(l.test?.test(e))return l;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[q])}function an({atKey:n,directives:e,schema:t},s,i,r){const o=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(s))||t[q];if(t.compat){const l=t.compat.find(a=>a.default&&a.test?.test(s))??t[q];if(o.tag!==l.tag){const a=e.tagString(o.tag),c=e.tagString(l.tag),d=`Value may be parsed as either ${a} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}function cn(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}const fn={composeNode:os,composeEmptyNode:pt};function os(n,e,t,s){const i=n.atKey,{spaceBefore:r,comment:o,anchor:l,tag:a}=t;let c,d=!0;switch(e.type){case"alias":c=un(n,e,s),(l||a)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=rs(n,e,a,s),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ws(fn,n,e,t,s),l&&(c.anchor=l.source.substring(1))}catch(f){const u=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",u)}break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=pt(n,e.offset,void 0,null,t,s)),l&&c.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!I(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function pt(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:l,end:a},c){const d={type:"scalar",offset:cn(e,t,s),indent:-1,source:""},f=rs(n,d,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=a),f}function un({options:n},{offset:e,source:t,end:s},i){const r=new st(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,l=ke(s,o,n.strict,i);return r.range=[e,o,l.offset],l.comment&&(r.comment=l.comment),r}function hn(n,e,{offset:t,start:s,value:i,end:r},o){const l=Object.assign({_directives:e},n),a=new Re(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},d=ie(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(a.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?os(c,i,d,o):pt(c,d.end,s,null,d,o);const f=a.contents.range[2],u=ke(r,f,!1,o);return u.comment&&(a.comment=u.comment),a.range=[t,f,u.offset],a}function fe(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Ot(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){const r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
100
-
101
- `:`
102
- `)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class dn{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{const o=fe(t);r?this.warnings.push(new Ys(o,s,i)):this.errors.push(new he(o,s,i))},this.directives=new _({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:i}=Ot(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
103
- ${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(E(r)&&!r.flow&&r.items.length>0){let o=r.items[0];$(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
104
- ${l}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
105
- ${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ot(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{const r=fe(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=hn(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":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new he(fe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new he(fe(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=ke(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
106
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new he(fe(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){const s=Object.assign({_directives:this.directives},this.options),i=new Re(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const ls="\uFEFF",as="",cs="",Ze="";function pn(n){switch(n){case ls:return"byte-order-mark";case as:return"doc-mode";case cs:return"flow-error-end";case Ze:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
107
- `:case`\r
108
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function j(n){switch(n){case void 0:case" ":case`
109
- `:case"\r":case" ":return!0;default:return!1}}const At=new Set("0123456789ABCDEFabcdef"),mn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ae=new Set(",[]{}"),gn=new Set(` ,[]{}
110
- \r `),Qe=n=>!n||gn.has(n);class yn{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 s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
111
- `?!0:t==="\r"?this.buffer[e+1]===`
112
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const i=this.buffer[s+e+1];if(i===`
113
- `||!i&&!this.atEnd)return e+s+1}return t===`
114
- `||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&j(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
115
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ls&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield as,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&j(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!j(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&j(t)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const 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(Qe),"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,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&j(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield cs,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Qe),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||j(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let i=s.indexOf(`
116
- `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
117
- `,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>j(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
118
- `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
119
- `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
120
- `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
121
- `;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const l=r;for(;o===" ";)o=this.buffer[--r];if(o===`
122
- `&&r>=this.pos&&r+1+t>l)e=r;else break}while(!0);return yield Ze,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(j(r)||e&&Ae.has(r))break;t=s}else if(j(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
123
- `?(s+=1,i=`
124
- `,r=this.buffer[s+1]):t=s),r==="#"||e&&Ae.has(r))break;if(i===`
125
- `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Ae.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ze,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){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Qe),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(j(s)||t&&Ae.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!j(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(mn.has(t))t=this.buffer[++e];else if(t==="%"&&At.has(this.buffer[e+1])&&At.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
126
- `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
127
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class bn{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function V(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Tt(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function fs(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Te(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function z(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function ve(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function It(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!V(e.start,"explicit-key-ind")&&!V(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,fs(e.value)?e.value.end?ve(e.value.end,e.sep):e.value.end=e.sep:ve(e.start,e.sep),delete e.sep)}class wn{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yn,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=pn(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const 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});return}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){const 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{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&It(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Tt(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Tt(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Te(this.peek(2)),s=z(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
128
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
129
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.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)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ve(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const o=[];for(let l=0;l<t.sep.length;++l){const a=t.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),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):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,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(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(V(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(fs(t.key)&&!V(t.sep,"newline")){const o=z(t.start),l=t.key,a=t.sep;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(V(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=z(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):V(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":{const o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!V(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 s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.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)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ve(i,t.start),i.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||V(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.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":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Te(s),r=z(i);It(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
130
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
131
- `,t)+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;const t=Te(e),s=z(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Te(e),s=z(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.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 kn(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new bn||null,prettyErrors:e}}function Sn(n,e={}){const{lineCounter:t,prettyErrors:s}=kn(e),i=new wn(t?.addNewLine),r=new dn(e);let o=null;for(const l of r.compose(i.parse(n),!0,n.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new he(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(St(n,t)),o.warnings.forEach(St(n,t))),o}function Nn(n){const e=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n|$)/.exec(n);if(!e)return;const t=Sn(e[1]??""),s=t.errors.length?void 0:t.toJS(),i=s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s):[],r=i.find(([o])=>o==="title")?.[1];return{body:n.slice(e[0].length),entries:i,lineOffset:(e[0].match(/\n/g)??[]).length,title:typeof r=="string"&&r.trim()?r.trim():void 0}}function Et(n){return n.replaceAll(/[`*_~[\]]/g,"").replaceAll(/\s+/g," ").trim()}function On(n){const e=n.replace(/^\uFEFF/,"").split(/\r?\n/);let t=0;for(;t<e.length&&!e[t]?.trim();)t+=1;const s=e[t]?.trimEnd();if(!s)return;const i=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(s);if(i?.[2])return Et(i[2]);const r=e[t+1]?.trim();if(r&&/^(=+|-+)$/.test(r))return Et(s.trim())}function An(n){const e=Nn(n),t=e?.body??n;return{body:t,entries:e?.entries??[],lineOffset:e?.lineOffset??0,title:e?.title??On(t)}}export{An as m};
@@ -1,10 +0,0 @@
1
- import{r as f,j as t}from"./react-DZzLHL-l.js";import{a as k}from"./tanstack-CD46mJkU.js";import{B as v}from"./button-BJ7z-ZA7.js";import{C as y}from"./copy-context-Cl1TE2PJ.js";import{r as w}from"./folder-activity-Cv1X2ezj.js";import{L as b}from"./link-2-BWKA6t--.js";import{a as $}from"./view-context-D-fh9AbH.js";import{u as C}from"./app-CPSmsokP.js";import{p as P,a as L,b as I,f as A}from"./index-DztTMDFz.js";import{P as g}from"./plus-BHV2wJr7.js";import"./markdown-njUwQKsR.js";import"./utils-CwHGE3BB.js";import"./copy-Ikmr6Iq2.js";import"./link-DC_1Z6Yy.js";function j(a){return a.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??a}const H=a=>["You are helping edit or review a note. Use the context below to locate the file, read it, and answer or propose edits grounded in its content.","","Instructions for the LLM:","- Read the note file first; it is the authoritative content.","- Match the note's existing structure (headings, frontmatter) when proposing edits.","- If information is missing, state what to read next rather than inventing content.","- Return: 1) what the note covers, 2) the answer or next concrete edit.","","Note context:",`- Title: ${a.name}`,`- Path: ${S(a)}`,a.folder?`- Source folder: ${a.folder}`:null,a.activityAt?`- Last activity: ${w(a.activityAt)}`:null].filter(n=>n!=null).join(`
2
- `),S=a=>a.folder?`${a.folder}/${a.relativePath}`:a.relativePath;function O({action:a,documentHref:n,error:l,files:r=[],folder:o,folderHref:i,loading:c}){const[d,x]=f.useState("all"),u=[...new Set(r.flatMap(e=>e.folder?[e.folder]:[]))],h=[{id:"all",label:"All",count:r.length},{id:"local",label:"This folder",count:r.filter(e=>!e.folder).length},...u.map(e=>({id:e,label:j(e),count:r.filter(m=>m.folder===e).length}))],s=h.some(e=>e.id===d)?d:"all",p=r.filter(e=>s==="all"||(s==="local"?!e.folder:e.folder===s)).sort((e,m)=>m.activityAt-e.activityAt||`${e.folder??""}/${e.relativePath}`.localeCompare(`${m.folder??""}/${m.relativePath}`));return t.jsxs("div",{className:"mx-auto grid w-full max-w-3xl gap-4 px-4 py-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h1",{className:"m-0 text-2xl font-semibold text-[#233025]",children:"Notes"}),a]}),u.length?t.jsx("div",{role:"group","aria-label":"Filter notes by source",className:"flex flex-wrap gap-2",children:h.map(e=>t.jsxs(v,{type:"button",size:"sm",variant:s===e.id?"secondary":"outline",className:`h-auto min-h-8 max-w-full rounded-full
3
- whitespace-normal`,"aria-pressed":s===e.id,onClick:()=>x(e.id),title:e.id==="local"?o:u.includes(e.id)?e.id:void 0,children:[u.includes(e.id)?t.jsx(b,{"aria-hidden":"true"}):null,t.jsx("span",{className:"break-all",children:e.label}),t.jsx("span",{className:"text-muted-foreground",children:e.count})]},e.id))}):null,c?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Loading…"}):null,l?t.jsx("p",{className:"m-0 text-sm text-[#9c3a3a]",children:l}):null,!c&&!l&&!p.length?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:r.length?"No notes match this filter.":"No notes found."}):null,p.length?t.jsx("ol",{className:"m-0 grid list-none gap-2 p-0",children:p.map(e=>t.jsxs("li",{className:`grid gap-1 rounded-xl border border-[#e7ebe7] bg-white
4
- text-[#2f382f] shadow-[0_1px_2px_rgb(31_41_55/0.05)]
5
- hover:bg-[#fafbfa]`,children:[t.jsxs("div",{className:"flex items-start",children:[t.jsxs("a",{className:`grid min-w-0 flex-1 gap-1 px-4 pt-3 pb-3
6
- no-underline`,href:n(e),children:[t.jsx("span",{className:"font-semibold break-words",children:e.name}),t.jsxs("span",{className:"text-[0.82rem] break-all text-[#6c7a6d]",children:[e.relativePath,e.activityAt?` · ${w(e.activityAt)}`:""]})]}),t.jsx(y,{className:`mt-2 mr-2.5 shrink-0 text-[#6c7a6d]
7
- hover:text-[#2f382f]`,context:()=>H(e),label:`Copy context for ${e.name}`})]}),e.folder?t.jsxs("a",{className:`mx-4 mb-3 inline-flex w-fit max-w-[calc(100%-2rem)]
8
- items-center gap-1 text-xs text-[#6c7a6d] underline
9
- underline-offset-4`,href:i(e.folder),title:e.folder,children:[t.jsx(b,{"aria-hidden":"true",className:"size-3 shrink-0"}),t.jsxs("span",{className:"break-all",children:["Linked · ",j(e.folder)]})]}):null]},`${e.folder??""}:${e.relativePath}`))}):null]})}const N=new Map;async function R(a){const l=(await $.config(a)).aiInputModule;if(typeof l!="string"||!l)return null;const r=N.get(l);if(r)return r;const o=import(l).then(i=>{const c=i.default;if(!c?.Composer)throw new Error("The AI input module must default-export an adapter with a Composer component.");return c});return N.set(l,o),o}function F(a){const[n,l]=f.useState();return f.useEffect(()=>{let r=!0;return R(a).then(async o=>{r&&(await o?.install?.(),r&&l({folder:a,adapter:o}))}).catch(o=>{console.error("Could not load the configured AI input adapter.",o)}),()=>{r=!1}},[a]),n?.folder===a?n?.adapter??null:null}function Q(){const a=k(),[n,l]=f.useState(!1),r=`${window.location.origin}${a.href}`,o=P(r).folder,i=F(o),c=o?L(o):"none",{local:d,linked:x,files:u,retryLinked:h}=C(r);return t.jsxs(t.Fragment,{children:[t.jsx(O,{action:i?t.jsx("button",{"aria-controls":"bark-composer","aria-expanded":n,"aria-label":n?"Hide bark input":"Open bark input",className:`inline-flex items-center gap-2 rounded-md border px-3
10
- py-1.5 text-sm`,onClick:()=>l(s=>!s),title:n?"Hide bark input":"Open bark input",type:"button",children:t.jsx(g,{"aria-hidden":"true",className:"size-4"})}):void 0,documentHref:s=>{const p=s.folder??o;return p?A(p,s.relativePath):s.relativePath},error:d.error?String(d.error):"",files:u,folder:o,folderHref:s=>I(s,"notes"),loading:d.isLoading},c),d.error?t.jsx("button",{className:"px-4",onClick:()=>{d.refetch()},children:"Retry local notes"}):null,x.isLoading?t.jsx("p",{role:"status",className:"text-muted-foreground px-4 text-sm",children:"Loading linked notes…"}):null,x.error?t.jsxs("p",{role:"alert",className:"px-4 text-sm",children:["Linked notes could not load."," ",t.jsx("button",{type:"button",onClick:h,children:"Retry"})]}):null,i?t.jsx(v,{"aria-controls":"bark-composer","aria-expanded":n,"aria-label":n?"Hide bark input":"Open bark input",className:"mobile-bark-toggle",onClick:()=>l(s=>!s),title:n?"Hide bark input":"Open bark input",type:"button",variant:"outline",children:t.jsx(g,{"aria-hidden":"true"})}):null,n&&i?t.jsx("section",{"aria-label":"AI composer",className:"ai-input-host",id:"bark-composer",children:t.jsx(i.Composer,{})}):null]})}export{Q as NotesPage};
@@ -1 +0,0 @@
1
- import{c as a}from"./view-context-D-fh9AbH.js";const c=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],o=a("pencil",c);export{o as P};
@@ -1 +0,0 @@
1
- import{c as e}from"./view-context-D-fh9AbH.js";const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c=e("plus",o);export{c as P};
@@ -1,9 +0,0 @@
1
- import{r as p,j as r}from"./react-DZzLHL-l.js";import{u as b,a as D,c as S}from"./utils-CwHGE3BB.js";import{c as T,P as M,b as C,a as _,d as I,h as k,R as N,f as y,F as $,D as z,g as G,i as L}from"./index-eL1k96k8.js";import{c as j,A as H,C as K,R as U}from"./index-p38i_yyY.js";var V=Object.defineProperty,l=(a,e)=>V(a,"name",{value:e,configurable:!0}),x="Popover",[A,le]=T(x,[j]),R=j(),[Z,v]=A(x),q=l(a=>{const{__scopePopover:e,children:s,open:n,defaultOpen:c,onOpenChange:t,modal:o=!1}=a,i=R(e),u=p.useRef(null),[P,d]=p.useState(!1),[m,f]=G({prop:n,defaultProp:c??!1,onChange:t,caller:x});return r.jsx(U,{...i,children:r.jsx(Z,{scope:e,contentId:L(),triggerRef:u,open:m,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:P,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:s})})},"Popover"),B="PopoverTrigger",J=p.forwardRef(l(function(e,s){const{__scopePopover:n,...c}=e,t=v(B,n),o=R(n),i=b(s,t.triggerRef),u=r.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.open?t.contentId:void 0,"data-state":O(t.open),...c,ref:i,onClick:C(e.onClick,t.onOpenToggle)});return t.hasCustomAnchor?u:r.jsx(H,{asChild:!0,...o,children:u})},"PopoverTrigger")),E="PopoverPortal",[Q,W]=A(E,{forceMount:void 0}),X=l(a=>{const{__scopePopover:e,forceMount:s,children:n,container:c}=a,t=v(E,e);return r.jsx(Q,{scope:e,forceMount:s,children:r.jsx(_,{present:s||t.open,children:r.jsx(I,{asChild:!0,container:c,children:n})})})},"PopoverPortal"),h="PopoverContent",Y=p.forwardRef(l(function(e,s){const n=W(h,e.__scopePopover),{forceMount:c=n.forceMount,...t}=e,o=v(h,e.__scopePopover);return r.jsx(_,{present:c||o.open,children:o.modal?r.jsx(oe,{...t,ref:s}):r.jsx(te,{...t,ref:s})})},"PopoverContent")),ee=D("PopoverContent.RemoveScroll"),oe=p.forwardRef(l(function(e,s){const n=v(h,e.__scopePopover),c=p.useRef(null),t=b(s,c),o=p.useRef(!1);return p.useEffect(()=>{const i=c.current;if(i)return k(i)},[]),r.jsx(N,{as:ee,allowPinchZoom:!0,children:r.jsx(F,{...e,ref:t,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:C(e.onCloseAutoFocus,i=>{i.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:C(e.onPointerDownOutside,i=>{const u=i.detail.originalEvent,P=u.button===0&&u.ctrlKey===!0,d=u.button===2||P;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:C(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),te=p.forwardRef(l(function(e,s){const n=v(h,e.__scopePopover),c=p.useRef(!1),t=p.useRef(!1);return r.jsx(F,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(c.current||n.triggerRef.current?.focus(),o.preventDefault()),c.current=!1,t.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(c.current=!0,o.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&t.current&&o.preventDefault()}})},"PopoverContentNonModal")),F=p.forwardRef(l(function(e,s){const{__scopePopover:n,trapFocus:c,onOpenAutoFocus:t,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:P,onFocusOutside:d,onInteractOutside:m,...f}=e,g=v(h,n),w=R(n);return y(),r.jsx($,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:t,onUnmountAutoFocus:o,children:r.jsx(z,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:P,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:r.jsx(K,{"data-state":O(g.open),role:"dialog",id:g.contentId,...w,...f,ref:s,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function O(a){return a?"open":"closed"}l(O,"getState");var re=q,ne=J,ae=X,se=Y;function de({...a}){return r.jsx(re,{"data-slot":"popover",...a})}function fe({...a}){return r.jsx(ne,{"data-slot":"popover-trigger",...a})}function ve({className:a,align:e="center",sideOffset:s=4,...n}){return r.jsx(ae,{children:r.jsx(se,{"data-slot":"popover-content",align:e,sideOffset:s,className:S(`bg-popover text-popover-foreground data-[state=open]:animate-in
2
- data-[state=closed]:animate-out data-[state=closed]:fade-out-0
3
- data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
4
- data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2
5
- data-[side=left]:slide-in-from-right-2
6
- data-[side=right]:slide-in-from-left-2
7
- data-[side=top]:slide-in-from-bottom-2 z-50 w-72
8
- origin-(--radix-popover-content-transform-origin) rounded-md border
9
- p-4 shadow-md outline-hidden`,a),...n})})}export{se as C,de as P,re as R,ne as T,fe as a,ve as b,ae as c};
@@ -1,2 +0,0 @@
1
- import{k as P,o as S,f as F,s as D,d as M,r as m,m as K,n as L,j as e,F as C,p as E,g as B}from"./react-DZzLHL-l.js";import{b as U,u as $}from"./tanstack-CD46mJkU.js";import{a as R}from"./view-context-D-fh9AbH.js";import{b as A}from"./index-DztTMDFz.js";import"./markdown-njUwQKsR.js";function q({children:r,className:c,ariaLabel:d,anchorRef:o,open:t=!0,onOpenChange:u}){const{refs:n,floatingStyles:h,context:p}=P({open:t,onOpenChange:u,placement:"top-end",strategy:"fixed",whileElementsMounted:B,middleware:[S(10),F({padding:12}),D({padding:12}),M({padding:12,apply({availableHeight:y,elements:x}){x.floating.style.setProperty("--scout-panel-available-height",`${Math.max(0,y)}px`)}})]});m.useEffect(()=>{o&&n.setReference(o.current)},[o,n]);const f=K(p,{enabled:!!u,outsidePress:!0}),{getFloatingProps:i}=L([f]);if(!t)return null;const g=e.jsx("div",{...i(),ref:n.setFloating,style:o?{...h,bottom:"auto",right:"auto"}:void 0,className:["scout-input-floating-panel",c].filter(Boolean).join(" "),role:"dialog","aria-label":d,children:r});return o?e.jsx(C,{children:e.jsx(E,{context:p,modal:!1,returnFocus:o,children:g})}):g}function N({projects:r,onSelect:c,resetKey:d,status:o="ready",maxResults:t=1/0}){const u=m.useId(),n=o==="ready"?r.slice(0,Math.max(0,t)):[],[h,p]=m.useState({key:d,id:n[0]?.id}),f=h.key===d?n.findIndex(a=>a.id===h.id):-1,i=n.length?Math.max(0,f):-1,g=a=>`${u}-${encodeURIComponent(a)}`,y=n[i]?.id;function x(a){p({key:d,id:n[a]?.id})}function j(a){a.defaultPrevented||a.nativeEvent.isComposing||a.keyCode===229||a.altKey||a.ctrlKey||a.metaKey||!n.length||(a.key==="ArrowDown"||a.key==="ArrowUp"?(a.preventDefault(),x(Math.max(0,Math.min(n.length-1,i+(a.key==="ArrowDown"?1:-1))))):a.key==="Enter"&&(a.preventDefault(),c(n[i])))}return{listId:u,optionId:g,activeId:y,activate:x,handleKeyDown:j,inputProps:{role:"combobox","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":u,"aria-activedescendant":y?g(y):void 0,onKeyDown:j}}}function H(r,c){const{projects:d,selectedProjectId:o=null,onSelect:t,emptyMessage:u="No projects found.",ariaLabel:n="Projects",maxResults:h=1/0,header:p,className:f,status:i="ready",loadingMessage:g="Loading projects…",errorMessage:y="Could not load projects.",onRetry:x,navigation:j}=r,a=N(r),l=j??a,b=m.useRef(null),v=i==="ready"?d.slice(0,Math.max(0,h)):[];m.useImperativeHandle(c,()=>({handleKeyDown:l.handleKeyDown}),[l.handleKeyDown]),m.useEffect(()=>{b.current?.querySelector('[data-active="true"]')?.scrollIntoView({block:"nearest"})},[l.activeId]);const w=i==="loading"?g:i==="error"?y:v.length===0?u:`${v.length} projects`;return e.jsxs("div",{className:["scout-project-results",f].filter(Boolean).join(" "),children:[p,e.jsx("div",{className:v.length?"scout-sr-only":"scout-project-empty",role:"status","aria-live":"polite",children:w}),i==="error"&&x&&e.jsx("button",{className:"scout-project-retry",type:"button",onClick:x,children:"Retry"}),e.jsx("ul",{ref:b,id:l.listId,className:"scout-project-list",role:"listbox","aria-label":n,"aria-busy":i==="loading",tabIndex:j?-1:0,"aria-activedescendant":l.activeId?l.optionId(l.activeId):void 0,onKeyDown:l.handleKeyDown,children:v.map((s,I)=>e.jsxs("li",{id:l.optionId(s.id),role:"option","aria-selected":o===s.id,"aria-label":[s.name,s.worktree,s.repositoryLabel??s.currentBranch].filter(Boolean).join(", "),title:s.worktree,className:`scout-project-option${o===s.id?" is-selected":""}${s.id===l.activeId?" is-active":""}`,"data-active":s.id===l.activeId,onMouseDown:k=>k.preventDefault(),onClick:()=>{l.activate(I),j||b.current?.focus(),t(s)},children:[e.jsxs("span",{className:"scout-project-option-left",children:[s.iconUrl&&e.jsx("img",{className:"scout-project-option-icon",src:s.iconUrl,alt:""}),e.jsxs("span",{className:"scout-project-option-title",children:[e.jsx("span",{className:"scout-project-option-name",children:s.name}),s.parentFolders&&e.jsx("span",{className:"scout-project-option-subtitle",children:s.parentFolders})]})]}),e.jsx("span",{className:"scout-project-option-repository",children:s.repositoryLabel??s.currentBranch??""})]},s.id))})]})}const Q=m.forwardRef(H);function z({query:r,onQueryChange:c,placeholder:d="Search projects...",autoFocus:o=!0,ariaLabel:t="Search projects",anchorRef:u,open:n,onOpenChange:h,...p}){const f=N({...p,resetKey:r});return e.jsx(q,{className:"scout-project-search",ariaLabel:t,anchorRef:u,open:n,onOpenChange:h,children:e.jsx("div",{className:"scout-project-search-inner",children:e.jsx(Q,{...p,ariaLabel:t,navigation:f,header:e.jsx("div",{className:"scout-project-search-row",children:e.jsx("input",{...f.inputProps,className:"scout-project-search-input",placeholder:d,"aria-label":t,value:r,onChange:i=>c(i.target.value),autoFocus:o})})})})})}function V(r){return A(r,"notes")}function X(){const r=U(),[c,d]=m.useState(""),o=$({queryKey:["project-search",c],queryFn:({signal:t})=>R.projectSearch(c,{signal:t}),retry:!1});return e.jsxs("main",{className:"search-page",children:[e.jsxs("div",{className:"search-page-header",children:[e.jsx("a",{className:"font-serif text-2xl tracking-tight",href:"/",children:"Kennel"}),e.jsx("span",{className:`rounded-full bg-emerald-800 px-3 py-1 text-[10px] font-bold
2
- tracking-[0.18em] text-white uppercase`,children:"Search projects"})]}),e.jsx(z,{ariaLabel:"Search local projects",emptyMessage:o.isPending?"Searching local projects…":o.error?o.error.message:"No local projects found.",placeholder:"Search local projects...",projects:(o.data?.items??[]).map(t=>({id:t.id,name:t.title,worktree:t.worktree,parentFolders:t.relativePath,repositoryLabel:t.repositoryLabel,iconUrl:t.icon})),query:c,onQueryChange:d,onSelect:t=>{r({to:V(t.worktree)})}})]})}export{X as ProjectSearchPage};
@@ -1,30 +0,0 @@
1
- import{j as e}from"./react-DZzLHL-l.js";import{c as r}from"./utils-CwHGE3BB.js";import{C as o}from"./chevron-down-C5oRtqbX.js";import{C as i}from"./button-BJ7z-ZA7.js";import{C as d}from"./chevron-up-DjpU6Pyv.js";import{S as c,a as u,b as m,c as p,d as f,e as x,f as g,g as h,h as v,i as b,j,k as S}from"./index-DnlTDqaa.js";function I({...t}){return e.jsx(c,{"data-slot":"select",...t})}function B({...t}){return e.jsx(p,{"data-slot":"select-value",...t})}function D({className:t,size:a="default",children:s,...l}){return e.jsxs(u,{"data-slot":"select-trigger","data-size":a,className:r(`border-input data-[placeholder]:text-muted-foreground
2
- [&_svg:not([class*='text-'])]:text-muted-foreground
3
- focus-visible:border-ring focus-visible:ring-ring/50
4
- aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40
5
- aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50
6
- flex w-fit items-center justify-between gap-2 rounded-md border
7
- bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs
8
- transition-[color,box-shadow] outline-none focus-visible:ring-[3px]
9
- disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9
10
- data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1
11
- *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center
12
- *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none
13
- [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...l,children:[s,e.jsx(m,{asChild:!0,children:e.jsx(o,{className:"size-4 opacity-50"})})]})}function T({className:t,children:a,position:s="item-aligned",align:l="center",...n}){return e.jsx(f,{children:e.jsxs(x,{"data-slot":"select-content",className:r(`bg-popover text-popover-foreground data-[state=open]:animate-in
14
- data-[state=closed]:animate-out data-[state=closed]:fade-out-0
15
- data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
16
- data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2
17
- data-[side=left]:slide-in-from-right-2
18
- data-[side=right]:slide-in-from-left-2
19
- data-[side=top]:slide-in-from-bottom-2 relative z-50
20
- max-h-(--radix-select-content-available-height) min-w-[8rem]
21
- origin-(--radix-select-content-transform-origin) overflow-x-hidden
22
- overflow-y-auto rounded-md border shadow-md`,s==="popper"&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1
23
- data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,t),position:s,align:l,...n,children:[e.jsx(w,{}),e.jsx(g,{className:r("p-1",s==="popper"&&`h-[var(--radix-select-trigger-height)] w-full
24
- min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:a}),e.jsx(y,{})]})})}function U({className:t,children:a,...s}){return e.jsxs(h,{"data-slot":"select-item",className:r(`focus:bg-accent focus:text-accent-foreground
25
- [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full
26
- cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm
27
- outline-hidden select-none data-[disabled]:pointer-events-none
28
- data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0
29
- [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex
30
- *:[span]:last:items-center *:[span]:last:gap-2`,t),...s,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(i,{className:"size-4"})})}),e.jsx(b,{children:a})]})}function w({className:t,...a}){return e.jsx(j,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(d,{className:"size-4"})})}function y({className:t,...a}){return e.jsx(S,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(o,{className:"size-4"})})}export{I as S,D as a,B as b,T as c,U as d};
@@ -1,7 +0,0 @@
1
- import{r as m,j as l,c as A}from"./react-DZzLHL-l.js";import{B as j}from"./button-BJ7z-ZA7.js";import{b as C,t as R,u as N}from"./view-context-D-fh9AbH.js";import{P as z}from"./plus-BHV2wJr7.js";import{s as P}from"./file-renderer-BRZTrYx8.js";import"./markdown-njUwQKsR.js";import"./utils-CwHGE3BB.js";import"./index-DztTMDFz.js";import"./tanstack-CD46mJkU.js";import"./link-DC_1Z6Yy.js";function B(c,n,r,u,e){if(!n.trim())return;const d=[0];for(let v=0;v<c.length;v++)c[v]===`
2
- `&&d.push(v+1);const s=e?d[e.start-1]:0,t=e?d[e.end]??c.length:c.length;if(s===void 0||t<=s)return;const i=c.slice(s,t),f=i.indexOf(n);if(f>=0&&i.indexOf(n,f+1)<0)return{path:r,folder:u,selection:n,source:n,start:s+f,end:s+f+n.length,lines:e,block:!1};if(e)return{path:r,folder:u,selection:n,source:i,start:s,end:t,lines:e,block:!0}}function D({context:c,onClose:n}){const[r,u]=m.useState(""),{add:e}=C(c.folder);return l.jsx("div",{className:`overflow-hidden rounded-xl border border-[#dce3dc] bg-white
3
- text-[#233025] shadow-lg`,children:l.jsxs("form",{className:"flex items-center gap-2 p-2",onSubmit:d=>{d.preventDefault(),r.trim()&&(e(c,r),R.success("Comment added to your message"),n())},children:[l.jsx("input",{"aria-label":"Comment on selected text",className:`min-w-0 flex-1 rounded-md bg-transparent px-2 py-1.5
4
- text-sm outline-none placeholder:text-[#798579] focus-visible:ring-1
5
- focus-visible:ring-[#c6d3c7]`,value:r,onChange:d=>u(d.target.value),placeholder:"Add a question or editing instruction…"}),l.jsx(j,{size:"icon",className:`size-8 shrink-0 rounded-lg bg-[#2f4a38] text-white
6
- hover:bg-[#27402f]`,type:"submit",disabled:!r.trim(),"aria-label":"Add comment to message",title:"Add to message",children:l.jsx(z,{className:"size-4","aria-hidden":"true"})})]})})}function J({children:c,content:n,folder:r,path:u}){const{enabled:e}=N(),d=m.useRef(null),s=m.useRef(null),[t,i]=m.useState(),[f,v]=m.useState({left:8,top:8});return m.useEffect(()=>{if(!e||!r.startsWith("/"))return;let p;const x=o=>o instanceof Node&&s.current?.contains(o),g=()=>{if(x(document.activeElement))return;const o=window.getSelection(),w=o?.rangeCount?o.getRangeAt(0):void 0,L=o?.toString()??"";if(!w||!L.trim()||!d.current?.contains(w.commonAncestorContainer)){i(void 0);return}const b=B(n,L,u,r,P(w));if(!b){i(void 0);return}const k=w.getBoundingClientRect();i(E=>E?.context.start===b.start&&E.context.end===b.end&&E.context.selection===L?E:{context:b,rect:k})},a=()=>{clearTimeout(p),p=setTimeout(g,150)},h=o=>{x(o.target)||i(void 0)},y=o=>{o.key==="Escape"&&(i(void 0),window.getSelection()?.removeAllRanges())},S=o=>{x(o.target)||i(void 0)};return document.addEventListener("selectionchange",a),document.addEventListener("pointerup",a),document.addEventListener("keyup",a),document.addEventListener("pointerdown",h),document.addEventListener("keydown",y),document.addEventListener("scroll",S,!0),window.addEventListener("resize",g),()=>{clearTimeout(p),document.removeEventListener("selectionchange",a),document.removeEventListener("pointerup",a),document.removeEventListener("keyup",a),document.removeEventListener("pointerdown",h),document.removeEventListener("keydown",y),document.removeEventListener("scroll",S,!0),window.removeEventListener("resize",g)}},[e,n,r,u]),m.useLayoutEffect(()=>{if(!t||!s.current)return;const p=s.current,x=()=>{const{width:a,height:h}=p.getBoundingClientRect();v({left:Math.max(8,Math.min(t.rect.left+t.rect.width/2-a/2,window.innerWidth-a-8)),top:Math.max(8,t.rect.top-h-8)})};x();const g=new ResizeObserver(x);return g.observe(p),()=>g.disconnect()},[t]),l.jsxs("div",{ref:d,className:"contents",children:[c,e&&t?A.createPortal(l.jsx("div",{"data-selection-ai":!0,ref:s,role:"region","aria-label":"Selection AI",className:`fixed z-50 max-h-[70dvh]
7
- w-[min(420px,calc(100vw-16px))] overflow-y-auto`,style:f,children:l.jsx(D,{context:t.context,onClose:()=>{i(void 0),window.getSelection()?.removeAllRanges()}},`${u}:${t.context.start}:${t.context.end}`)}),document.body):null]})}export{J as SelectionPopup};
@@ -1 +0,0 @@
1
- import{c as a}from"./view-context-D-fh9AbH.js";const e=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],c=a("folder-open",e);const o=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],r=a("sparkles",o);export{c as F,r as S};
@@ -1 +0,0 @@
1
- import{s as R,a as W,S as N}from"./chunk-EX3LRPZG-Bzl1ukAi.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a7 as _,a8 as U,a3 as C,x as F}from"./mermaid.core-Bvxj3RoN.js";import{G as O}from"./graph-BvS0Xx32.js";import{l as J}from"./layout-D4ui-CWC.js";import"./chunk-XXDRQBXY-Dqtar746.js";import"./chunk-VR4S4FIN-Bp2SNel7.js";import"./chunk-32BRIVSS-uy4kdSLL.js";import"./index-DztTMDFz.js";import"./react-DZzLHL-l.js";import"./markdown-njUwQKsR.js";import"./map-7eTsl7HP.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){m=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:m?1:b.edgeLengthFactor,nodeSep:m?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;g.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ut={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ut as diagram};
@@ -1 +0,0 @@
1
- import{s as r,b as e,a,S as s}from"./chunk-EX3LRPZG-Bzl1ukAi.js";import{_ as i}from"./mermaid.core-Bvxj3RoN.js";import"./chunk-XXDRQBXY-Dqtar746.js";import"./chunk-VR4S4FIN-Bp2SNel7.js";import"./chunk-32BRIVSS-uy4kdSLL.js";import"./index-DztTMDFz.js";import"./react-DZzLHL-l.js";import"./markdown-njUwQKsR.js";var b={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1,8 +0,0 @@
1
- import{c as r,s as e}from"./flowDiagram-23GEKE2U-BiPPM-FY.js";import{_ as a}from"./mermaid.core-Bvxj3RoN.js";import"./chunk-5VM5RSS4-oj2sBFd7.js";import"./chunk-XXDRQBXY-Dqtar746.js";import"./chunk-VR4S4FIN-Bp2SNel7.js";import"./chunk-32BRIVSS-uy4kdSLL.js";import"./channel-dSRp_qTo.js";import"./index-DztTMDFz.js";import"./react-DZzLHL-l.js";import"./markdown-njUwQKsR.js";var o=a(t=>`${e(t)}
2
- .swimlane.cluster rect {
3
- stroke: ${t.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,"getStyles"),m=o,_=r({defaultLayout:"swimlane",styles:m});export{_ as diagram};