@uniqbit/mate-core 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
  3. package/claude-plugin/hooks/hooks.json +10 -1
  4. package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
  5. package/opencode-plugin/src/server.ts +9 -2
  6. package/package.json +2 -1
  7. package/src/cli/commands/artifact/delivery/environment.ts +28 -8
  8. package/src/cli/commands/artifact/delivery/link.ts +28 -9
  9. package/src/cli/commands/artifact/delivery/output.ts +7 -0
  10. package/src/cli/commands/companion/update.ts +2 -19
  11. package/src/cli/commands/factory/factory.ts +11 -1
  12. package/src/cli/commands/install.ts +47 -36
  13. package/src/cli/commands/launch/claude.ts +2 -0
  14. package/src/cli/commands/launch/shared.ts +33 -6
  15. package/src/cli/commands/plugin/install.ts +27 -11
  16. package/src/cli/commands/report/index.ts +180 -184
  17. package/src/cli/commands/report/markdown.ts +67 -72
  18. package/src/cli/commands/shared/companion-selection.ts +3 -1
  19. package/src/cli/commands/studio/access.ts +6 -14
  20. package/src/cli/commands/studio/areas.ts +112 -33
  21. package/src/cli/commands/studio/companion-add.ts +87 -0
  22. package/src/cli/commands/studio/companion-removal.ts +15 -8
  23. package/src/cli/commands/studio/factory-credential.ts +1 -15
  24. package/src/cli/commands/studio/factory-git-tokens.ts +40 -0
  25. package/src/cli/commands/studio/factory-relay.ts +18 -0
  26. package/src/cli/commands/studio/graph-model.ts +61 -0
  27. package/src/cli/commands/studio/graph.ts +336 -0
  28. package/src/cli/commands/studio/index.ts +4 -4
  29. package/src/cli/commands/studio/payload.ts +42 -15
  30. package/src/cli/commands/studio/repository-add.ts +116 -0
  31. package/src/cli/commands/studio/routes.ts +6 -0
  32. package/src/cli/commands/studio/selection.ts +12 -3
  33. package/src/cli/commands/studio/server.ts +127 -5
  34. package/src/cli/commands/studio/services.ts +40 -0
  35. package/src/cli/commands/studio/terminal.ts +45 -3
  36. package/src/cli/commands/studio/views/vault/markdown-tree.ts +84 -3
  37. package/src/cli/commands/studio/workset-session.ts +47 -14
  38. package/src/cli/commands/unwrap.ts +3 -0
  39. package/src/cli/commands/update.ts +2 -0
  40. package/src/cli/commands/vscode/release-vsix.json +4 -0
  41. package/src/cli/commands/vscode/setup.ts +71 -13
  42. package/src/cli/commands/vscode/vsix.ts +48 -7
  43. package/src/cli/commands/working/cleanup.ts +40 -8
  44. package/src/cli/commands/working/worktree.ts +176 -35
  45. package/src/cli/main.ts +17 -2
  46. package/src/cli/usage.ts +1 -1
  47. package/src/hooks/rtk-worktree-git.ts +48 -0
  48. package/src/hooks/validate-artifact-path.ts +38 -7
  49. package/src/lib/delivery/branch-template.ts +122 -0
  50. package/src/lib/delivery/branches.ts +21 -16
  51. package/src/lib/delivery/checkout.ts +102 -0
  52. package/src/lib/delivery/environment.ts +2 -0
  53. package/src/lib/delivery/merge-git.ts +13 -1
  54. package/src/lib/delivery/record-delivery.ts +83 -29
  55. package/src/lib/delivery/record.ts +15 -3
  56. package/src/lib/delivery/resolve-branch.ts +157 -110
  57. package/src/lib/factory/attach-client.ts +11 -1
  58. package/src/lib/factory/broker.ts +37 -40
  59. package/src/lib/factory/client.ts +22 -1
  60. package/src/lib/factory/clone-url.ts +39 -0
  61. package/src/lib/factory/command.ts +21 -5
  62. package/src/lib/factory/git-auth.ts +61 -0
  63. package/src/lib/factory/git-credential-store.ts +181 -0
  64. package/src/lib/factory/ids.ts +12 -2
  65. package/src/lib/factory/outcomes/actions.ts +20 -4
  66. package/src/lib/factory/outcomes/index.ts +77 -11
  67. package/src/lib/factory/outcomes/lifecycle.ts +9 -2
  68. package/src/lib/factory/outcomes/sessions.ts +23 -1
  69. package/src/lib/factory/prepare.ts +9 -3
  70. package/src/lib/factory/runner/scheduler.ts +96 -14
  71. package/src/lib/factory/runner/workflow.ts +5 -1
  72. package/src/lib/factory/runtime.ts +143 -43
  73. package/src/lib/orchestrator/companion-hub.ts +6 -1
  74. package/src/lib/orchestrator/engine-floor.ts +48 -0
  75. package/src/lib/orchestrator/launcher.ts +34 -1
  76. package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
  77. package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
  78. package/src/lib/orchestrator/projection-claude-links.ts +32 -8
  79. package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
  80. package/src/lib/orchestrator/projection-entries.ts +22 -18
  81. package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
  82. package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
  83. package/src/lib/orchestrator/projection-types.ts +28 -1
  84. package/src/lib/orchestrator/refresh-working-claude-links.ts +3 -1
  85. package/src/lib/orchestrator/session-prepare.ts +6 -1
  86. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  87. package/src/lib/orchestrator/types.ts +4 -0
  88. package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
  89. package/src/lib/orchestrator/working-repo-projection.ts +24 -4
  90. package/src/lib/orchestrator/wrap-pass.ts +1 -0
  91. package/src/lib/public-npm.ts +95 -50
  92. package/src/lib/session-state.ts +72 -2
  93. package/src/lib/update-checker.ts +7 -1
  94. package/src/lib/usage/aggregate.ts +202 -0
  95. package/src/lib/usage/cache.ts +87 -0
  96. package/src/lib/usage/claude-pricing.ts +71 -0
  97. package/src/lib/usage/claude.ts +189 -0
  98. package/src/lib/usage/collect.ts +56 -0
  99. package/src/lib/usage/opencode.ts +188 -0
  100. package/src/lib/usage/records.ts +80 -0
  101. package/src/lib/usage/rtk-database.ts +72 -0
  102. package/src/lib/usage/savings.ts +209 -0
  103. package/src/lib/usage/scope.ts +182 -0
  104. package/src/lib/usage/source.ts +102 -0
  105. package/src/lib/usage/types.ts +143 -0
  106. package/src/lib/usage/window.ts +37 -0
  107. package/src/lib/workset/factory-local.ts +157 -0
  108. package/src/lib/workset/record.ts +25 -11
  109. package/src/lib/workset/repositories.ts +118 -25
  110. package/src/lib/workset/worktree-include.ts +161 -0
  111. package/src/lib/workset/worktree-index.ts +6 -2
  112. package/src/lib/workset/worktree.ts +591 -101
  113. package/src/opencode/companion-hooks.ts +46 -8
  114. package/src/opencode/companion-policy.ts +18 -5
  115. package/src/opencode/enter-worktree.ts +254 -6
  116. package/src/opencode/session-register.ts +2 -2
  117. package/src/runtime/claude-bg-isolation.ts +138 -0
  118. package/src/runtime/companion-git.ts +10 -2
  119. package/src/runtime/companion-guidance.ts +17 -4
  120. package/src/runtime/current-branch.ts +16 -2
  121. package/src/runtime/entered-worktree.ts +24 -0
  122. package/src/runtime/git-tracked.ts +60 -0
  123. package/src/runtime/repo-destination.ts +72 -0
  124. package/src/runtime/repo-local.ts +25 -3
  125. package/src/runtime/rtk-git-guard.ts +66 -0
  126. package/src/runtime/runtime-document-manifest.ts +229 -19
  127. package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
  128. package/src/runtime/secret-guard.ts +9 -2
  129. package/src/runtime/secret-policy-weakening.ts +122 -0
  130. package/src/runtime/serving-claude-wrap.ts +15 -2
  131. package/src/runtime/umbrella-folder.ts +56 -0
  132. package/src/runtime/wrap-state.ts +5 -13
  133. package/src/studio.ts +37 -0
  134. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +61 -6
  135. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +8 -4
  136. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +9 -5
  137. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +5 -4
  138. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +10 -4
  139. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +5 -1
  140. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +61 -6
  141. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +8 -4
  142. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +9 -5
  143. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +5 -4
  144. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +10 -4
  145. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +5 -1
  146. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +307 -42
  147. package/src/tools/setup/capabilities/rtk.ts +93 -1
  148. package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
  149. package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
  150. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
  151. package/src/tools/setup/dynamic-plugins/install.ts +24 -22
  152. package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
  153. package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
  154. package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
  155. package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
  156. package/src/tools/setup/mate.ts +3 -3
  157. package/src/tools/setup/plugins/gitignore.ts +15 -9
  158. package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
  159. package/src/tools/setup/providers/claude.ts +25 -3
  160. package/src/tools/setup/utils.ts +4 -2
  161. package/src/tools/setup/working-repo-cleanup.ts +2 -2
  162. package/src/tools/setup/working-repo-local-state.ts +2 -0
  163. package/src/tools/setup.ts +25 -14
  164. package/studio-dist/client/assets/app-D9cw6szy.css +2 -0
  165. package/studio-dist/client/assets/artifacts-WD2ZXYrx.js +1 -0
  166. package/studio-dist/client/assets/button-Br0O1sXw.js +1 -0
  167. package/studio-dist/client/assets/combobox-DA7RAUUZ.js +1 -0
  168. package/studio-dist/client/assets/companion-view-CrabvxS8.js +1 -0
  169. package/studio-dist/client/assets/factory-DGS0E16C.js +6 -0
  170. package/studio-dist/client/assets/fields-6aXBpFhJ.js +1 -0
  171. package/studio-dist/client/assets/getting-started-Clde4w6P.js +1 -0
  172. package/studio-dist/client/assets/getting-started-D6kgWwWZ.js +1 -0
  173. package/studio-dist/client/assets/getting-started._topic-BiunccbT.js +1 -0
  174. package/studio-dist/client/assets/getting-started.index-DpiNoGw8.js +1 -0
  175. package/studio-dist/client/assets/graph-B_TCBVbu.js +2 -0
  176. package/studio-dist/client/assets/graph-canvas-Ba37Y5AE.js +3242 -0
  177. package/studio-dist/client/assets/guides-Du_RtJxP.js +1 -0
  178. package/studio-dist/client/assets/index-Df8L1LQa.js +40 -0
  179. package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
  180. package/studio-dist/client/assets/markdown-view-BOX6x0rL.js +1 -0
  181. package/studio-dist/client/assets/panel-dbmCx7Mx.js +1 -0
  182. package/studio-dist/client/assets/queries-RvHeXY12.js +1 -0
  183. package/studio-dist/client/assets/react-3QStrcDO.js +27 -0
  184. package/studio-dist/client/assets/report-url-XRL0x1SY.js +1 -0
  185. package/studio-dist/client/assets/reports-r3IK7Doz.js +1 -0
  186. package/studio-dist/client/assets/routes-C0A5LTFc.js +1 -0
  187. package/studio-dist/client/assets/select-CnaMd617.js +1 -0
  188. package/studio-dist/client/assets/skills-CzjzHpBT.js +1 -0
  189. package/studio-dist/client/assets/specs-B0ldF_6J.js +1 -0
  190. package/studio-dist/client/assets/specs-view-BnCLA0gW.js +1 -0
  191. package/studio-dist/client/assets/spinner-Dcm3fqK1.js +1 -0
  192. package/studio-dist/client/assets/steps-C0p2N1Pb.js +1 -0
  193. package/studio-dist/client/assets/store-Dw34catY.js +1 -0
  194. package/studio-dist/client/assets/studio-Cpz_HRHp.js +100 -0
  195. package/studio-dist/client/assets/studio-queries-ibmpFo6R.js +2 -0
  196. package/studio-dist/client/assets/usage-C2QJ_0IZ.js +55 -0
  197. package/studio-dist/client/assets/useAnchoredPopupScrollLock-Bj-FWb8z.js +1 -0
  198. package/studio-dist/client/assets/useMutation-aAr2uiay.js +1 -0
  199. package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
  200. package/studio-dist/client/assets/vault-BGcxkSIY.js +1 -0
  201. package/studio-dist/client/assets/warnings-R1cE1rLf.js +1 -0
  202. package/studio-dist/client/assets/workflow-C2qTrMDH.js +1 -0
  203. package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-Bn896ZYj.js +122 -0
  204. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +102 -35
  205. package/studio-dist/server/assets/{actions-Bvgj9eb8.js → actions-DYSv-9VV.js} +10 -4
  206. package/studio-dist/server/assets/artifacts-DnF9L3dZ.js +216 -0
  207. package/studio-dist/server/assets/{button-CIJqAhni.js → button-CgOIVdmD.js} +13 -1702
  208. package/studio-dist/server/assets/combobox-DV_s9W0s.js +483 -0
  209. package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-BKVXD3TO.js} +3 -3
  210. package/studio-dist/server/assets/companions-C7fctnU9.js +31 -0
  211. package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
  212. package/studio-dist/server/assets/{factory-DUTa0eDs.js → factory-C7Ybg0xG.js} +1256 -353
  213. package/studio-dist/server/assets/{factory-DGPmNGbo.js → factory-Df5uAHjb.js} +53 -6
  214. package/studio-dist/server/assets/fields-BbieQTD0.js +1190 -0
  215. package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
  216. package/studio-dist/server/assets/getting-started-CRxMWorQ.js +67 -0
  217. package/studio-dist/server/assets/getting-started._topic-DJKQAzYl.js +13 -0
  218. package/studio-dist/server/assets/getting-started.index-D84gec1t.js +13 -0
  219. package/studio-dist/server/assets/graph-CSje3029.js +801 -0
  220. package/studio-dist/server/assets/graph-DDZzXM1L.js +16 -0
  221. package/studio-dist/server/assets/graph-canvas-22bWB5-2.js +21066 -0
  222. package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
  223. package/studio-dist/server/assets/guides-D9dk1Frq.js +13 -0
  224. package/studio-dist/server/assets/guides-IE-19POz.js +5 -0
  225. package/studio-dist/server/assets/guides.server-vcYRY5wx.js +66 -0
  226. package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
  227. package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-BR8dJ7aR.js} +28 -9
  228. package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-BR_t9iMM.js} +4 -4
  229. package/studio-dist/server/assets/queries-DWoTin-q.js +32 -0
  230. package/studio-dist/server/assets/react-CdqSUhaL.js +89 -0
  231. package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
  232. package/studio-dist/server/assets/report-url-BUXPcE_8.js +9 -0
  233. package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CQ9qQ1-n.js} +9 -10
  234. package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-dYDEoBeq.js} +3 -3
  235. package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DkRHNTpE.js} +787 -2862
  236. package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-B6GfOew4.js} +22 -171
  237. package/studio-dist/server/assets/{search-JAKurDNh.js → search-BJnWLfkG.js} +21 -2
  238. package/studio-dist/server/assets/select-Af7Wibii.js +1609 -0
  239. package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-Hq-hXgnT.js} +6 -5
  240. package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-B7nEuVbx.js} +9 -8
  241. package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-B_YYL7q8.js} +3 -3
  242. package/studio-dist/server/assets/specs-BpLUFntA.js +51 -0
  243. package/studio-dist/server/assets/specs-view-0peMVd22.js +426 -0
  244. package/studio-dist/server/assets/spinner-CdwJW4VB.js +20 -0
  245. package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D56DApvK.js} +1 -1
  246. package/studio-dist/server/assets/store-Cs17okNG.js +280 -0
  247. package/studio-dist/server/assets/studio-CAcKp3bM.js +10340 -0
  248. package/studio-dist/server/assets/studio-queries-BtRGzDdh.js +1451 -0
  249. package/studio-dist/server/assets/usage-COdjd1gD.js +25570 -0
  250. package/studio-dist/server/assets/usage-f6pqE1tm.js +24 -0
  251. package/studio-dist/server/assets/useAnchoredPopupScrollLock-DlBKHRw7.js +756 -0
  252. package/studio-dist/server/assets/useMutation-DzTZGenE.js +690 -0
  253. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
  254. package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-BDuIUq0F.js} +8 -5
  255. package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-BVLp6zu3.js} +3 -3
  256. package/studio-dist/server/assets/{views-BgYa-za2.js → views-flRUr21z.js} +4 -4
  257. package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-CDy9pdgL.js} +3 -2
  258. package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-D9GKI2EV.js} +132 -106
  259. package/studio-dist/server/server.js +582 -8
  260. package/src/cli/commands/report/collector.ts +0 -288
  261. package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
  262. package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
  263. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
  264. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
  265. package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
  266. package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
  267. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
  268. package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
  269. package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
  270. package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
  271. package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
  272. package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  273. package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
  274. package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
  275. package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
  276. package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
  277. package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
  278. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
  279. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
  280. package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
  281. package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
  282. package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
  283. package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
  284. package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
  285. package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
  286. package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
  287. package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o(((e,t)=>{t.exports=f()}));export{l as a,s as i,d as n,o as r,p as t};
@@ -0,0 +1 @@
1
+ import{ft as e}from"./studio-queries-ibmpFo6R.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";var i=t(n(),1),a=r(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(t,n,r){let s=t.c?.map((e,t)=>c(e,t,r)),{a:l}=t;if(t.t===`a`){if(r&&l?.guide){let[t,i]=l.guide.split(`#`);return t&&!/^\/getting-started(?:\/(?:worktrees|vscode))?$/.test(t)?(0,a.jsx)(`span`,{children:s},n):(0,a.jsx)(e,{to:t||`.`,hash:i,search:r,children:s},n)}return l?.note?(0,a.jsx)(e,{to:`/vault`,search:e=>({...e,path:l.note,dir:void 0,mode:void 0}),"data-vault-entry":l.note,children:s},n):l?.href&&/^https?:\/\//i.test(l.href)?(0,a.jsx)(`a`,{href:l.href,target:`_blank`,rel:`noopener noreferrer`,children:s},n):(0,a.jsx)(`span`,{children:s},n)}return t.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!l?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},n):o.has(t.t)?(r&&l?.id&&s&&s.push((0,a.jsx)(e,{to:`.`,hash:l.id,search:r,className:`guide-anchor`,"aria-label":`Link to ${l.id}`,children:`#`},`anchor`)),(0,i.createElement)(t.t,{key:n,className:l?.className,id:r?l?.id:void 0,tabIndex:r&&l?.id?-1:void 0,start:l?.start,style:l?.align?{textAlign:l.align}:void 0},s&&s.length>0?s:void 0)):(0,a.jsx)(`span`,{children:s},n)}function c(e,t,n){return typeof e==`string`?e:s(e,t,n)}function l({nodes:e,guideSearch:t}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map((e,n)=>c(e,n,t))})}export{l as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{Tr as r,r as i,t as a}from"./button-Br0O1sXw.js";import{G as o,J as s,K as c,X as l,Y as u,q as d,z as f}from"./index-Df8L1LQa.js";import{n as p}from"./fields-6aXBpFhJ.js";var m=e(t(),1),h=n();function g(e){return(0,h.jsx)(c,{"data-slot":`sheet`,...e})}var _=u;function v({className:e,wide:t=!1,...n}){return(0,h.jsxs)(d,{children:[(0,h.jsx)(l,{"data-slot":`sheet-overlay`,className:`fixed inset-0 z-30 bg-[color-mix(in_srgb,var(--bg)_45%,transparent)] transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`}),(0,h.jsx)(s,{"data-slot":`sheet-content`,"data-wide":t?``:void 0,className:r(`fixed top-2 right-2 bottom-2 z-30 flex w-[min(560px,calc(100vw-16px))] flex-col overflow-hidden rounded-panel border border-rule bg-surface text-text shadow-float outline-none transition-[transform,width] duration-250 ease-[cubic-bezier(.16,1,.3,1)] data-ending-style:translate-x-[calc(100%+16px)] data-starting-style:translate-x-[calc(100%+16px)] data-wide:w-[min(760px,calc(100vw-16px))]`,e),...n})]})}function y({className:e,...t}){return(0,h.jsx)(o,{"data-slot":`sheet-title`,className:r(`m-0 text-lg font-semibold break-words`,e),...t})}function b({items:e,current:t,onSelect:n,pass:r,wide:o,title:s,children:c}){let l=(0,m.useRef)(null),u=t!==null,d=t===null?-1:e.indexOf(t),b=d>0?e[d-1]:void 0,x=d>=0&&d<e.length-1?e[d+1]:void 0;(0,m.useEffect)(()=>{let e=e=>{let t=e.target;t?.closest&&!t.closest(`[data-slot=sheet-content]`)&&(l.current=t)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]);let S=(0,m.useEffectEvent)(e=>{if(e.metaKey||e.ctrlKey||e.altKey||f(e.target))return;let t=e.key===`ArrowRight`?x:e.key===`ArrowLeft`?b:void 0;t!==void 0&&(e.preventDefault(),n(t))});return(0,m.useEffect)(()=>{if(!u)return;let e=e=>S(e);return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[u]),(0,h.jsx)(g,{open:u,onOpenChange:e=>{e||n(null)},children:(0,h.jsxs)(v,{wide:o,"aria-label":s,finalFocus:()=>!l.current?.isConnected||l.current,initialFocus:()=>document.getElementById(`side-panel-close`),children:[(0,h.jsx)(y,{className:`sr-only`,children:s}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-rule py-2.5 pr-3 pl-5`,children:[(0,h.jsxs)(`span`,{className:`mr-auto font-mono text-xs text-muted`,"aria-live":`polite`,children:[d>=0?`${d+1} of ${e.length}`:null,r?` · ${r}`:null]}),(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Previous`,disabled:b===void 0,onClick:()=>b!==void 0&&n(b),children:(0,h.jsx)(i,{name:`left`})}),(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Next`,disabled:x===void 0,onClick:()=>x!==void 0&&n(x),children:(0,h.jsx)(i,{name:`right`})}),(0,h.jsx)(_,{id:`side-panel-close`,render:(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Close`}),children:(0,h.jsx)(i,{name:`close`})})]}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:c}),(0,h.jsxs)(`div`,{className:`flex gap-3.5 border-t border-rule px-5 py-2.5 text-2xs text-muted max-sm:hidden`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(p,{children:`←`}),(0,h.jsx)(p,{children:`→`}),` previous, next`]}),(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(p,{children:`esc`}),` close`]})]})]})})}function x({kicker:e,title:t,mono:n=!1,children:r}){return(0,h.jsxs)(`div`,{className:`grid gap-1.5 border-b border-rule px-5 pt-4 pb-3.5`,children:[e?(0,h.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:e}):null,(0,h.jsx)(`h2`,{className:n?`m-0 font-mono text-md font-semibold break-words`:`m-0 text-lg font-semibold`,children:t}),r]})}function S({title:e,aside:t,children:n}){return(0,h.jsxs)(`section`,{className:`grid gap-2.5 border-b border-rule-soft px-5 py-4`,"aria-label":e,children:[(0,h.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-sm font-semibold`,children:[e,t?(0,h.jsx)(`span`,{className:`ml-auto font-mono text-2xs font-normal text-muted`,children:t}):null]}),n]})}export{_ as a,g as i,S as n,v as o,b as r,y as s,x as t};
@@ -0,0 +1 @@
1
+ import{d as e}from"./studio-queries-ibmpFo6R.js";function t(e,t){return e.query({...t,staleTime:`static`})}async function n(n,r){return r.companion?(await t(n,e({companion:r.companion,studioMode:r.studioMode}))).selected?.digest??null:null}async function r(e,n,r=!1){return r?t(e,n):(t(e,n).catch(()=>{}),null)}export{r as n,n as r,t};
@@ -0,0 +1,27 @@
1
+ import{a as e,n as t}from"./jsx-runtime-MZURdZre.js";import{l as n,u as r}from"./studio-Cpz_HRHp.js";var i=`mate-studio-theme`,a=`mate-studio-companion`,o=`mate-studio-vault-tree`,s=`mate-studio-rail`,c=`(function () {
2
+ try {
3
+ var chosen = localStorage.getItem(${JSON.stringify(i)});
4
+ if (chosen === "dark" || chosen === "light") {
5
+ document.documentElement.setAttribute("data-theme", chosen);
6
+ }
7
+ if (localStorage.getItem(${JSON.stringify(o)}) === "hidden") {
8
+ document.documentElement.setAttribute("data-vault-tree", "hidden");
9
+ }
10
+ if (localStorage.getItem(${JSON.stringify(s)}) === "min") {
11
+ document.documentElement.setAttribute("data-rail", "min");
12
+ }
13
+ } catch (error) {
14
+ /* a blocked web store only costs the preference, never the page */
15
+ }
16
+
17
+ try {
18
+ var params = new URLSearchParams(location.search);
19
+ var last = localStorage.getItem(${JSON.stringify(a)});
20
+ if (!params.has(${JSON.stringify(r)}) && ${String(n)}.test(last || "")) {
21
+ params.set(${JSON.stringify(r)}, last);
22
+ location.replace(location.pathname + "?" + params.toString());
23
+ }
24
+ } catch (error) {
25
+ /* a blocked web store only costs the restore, never the page */
26
+ }
27
+ })();`,l=e(t(),1),u=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},d=(e=>e?u(e):u),f=e=>e;function p(e,t=f){let n=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return l.useDebugValue(n),n}var m=e=>{let t=d(e),n=e=>p(t,e);return Object.assign(n,t),n},h=(e=>e?m(e):m);export{i as a,c as i,a as n,o,s as r,h as t};
@@ -0,0 +1 @@
1
+ import{k as e}from"./studio-queries-ibmpFo6R.js";import"./studio-Cpz_HRHp.js";function t(t,n){let r=n===`system`?``:`?scheme=${n}`;return`${e}${t}${r}`}export{t};
@@ -0,0 +1 @@
1
+ import{Dr as e,Tr as t,r as n}from"./button-Br0O1sXw.js";import{a as r,t as i}from"./useSelector-AYcH7lB0.js";import{mt as a,u as o}from"./studio-queries-ibmpFo6R.js";import{a as s,n as c,t as l}from"./jsx-runtime-MZURdZre.js";import{c as u,f as d,o as f,s as p}from"./store-Dw34catY.js";import{r as m,t as h}from"./panel-dbmCx7Mx.js";import{c as g,ht as _,pt as v}from"./index-Df8L1LQa.js";import{t as y}from"./report-url-XRL0x1SY.js";function b(e){let t=r();return i(t.stores.location,a(e,t))}var x=s(c(),1),S=e=>String(e).padStart(2,`0`);function C(e){let t=new Date(e);return`${t.getFullYear()}-${S(t.getMonth()+1)}-${S(t.getDate())} ${S(t.getHours())}:${S(t.getMinutes())}`}var w=l(),T=/(?:^|[#&])report=([0-9a-f]{32})/;function E(e){try{let t=`${location.pathname}${location.search}${e?`#report=${e}`:``}`;history.replaceState(history.state,``,t)}catch{}}function D({report:e,src:t}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h,{title:e.title,kicker:(0,w.jsx)(`span`,{children:C(e.createdAt)}),children:(0,w.jsxs)(`a`,{id:`reports-open`,className:`inline-flex items-center gap-1.5 text-sm`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,w.jsx)(n,{name:`external`,className:`size-3.5`}),` Open in new tab`]})}),(0,w.jsx)(`iframe`,{id:`reports-frame`,className:`min-h-0 w-full flex-1 border-0 bg-page`,title:`Hosted report`,sandbox:`allow-scripts allow-modals`,referrerPolicy:`no-referrer`,src:t},t)]})}function O({companion:n}){let r=e(o(n)),i=v(e=>e.theme),a=_(e=>e.clearReports),s=T.exec(b({select:e=>`#${e.hash}`}))?.[1],[c,l]=(0,x.useState)(void 0);(0,x.useEffect)(a,[a]);let h=r.data??[],g=c===void 0?s??null:c,S=h.find(e=>e.id===g)??null,O=e=>{l(e),E(e)},k=S?y(S.id,i):null;return(0,w.jsxs)(`section`,{className:t(u,`grid content-start gap-3 pb-10`),"data-reports-view":!0,"aria-label":`Hosted reports`,children:[h.length===0?(0,w.jsx)(f,{children:(0,w.jsx)(`span`,{id:`reports-empty`,children:`No hosted reports yet.`})}):(0,w.jsx)(p,{title:`Reports`,count:h.length,hint:`Newest first`,children:(0,w.jsx)(`ul`,{id:`reports-list`,className:`m-0 list-none p-0`,"aria-label":`Reports`,children:h.map(e=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,className:t(d,`grid grid-cols-[minmax(0,1fr)_auto]`),"data-report-id":e.id,"aria-current":e.id===S?.id?`true`:void 0,onClick:()=>O(e.id),children:[(0,w.jsx)(`span`,{className:`truncate text-sm`,"data-report-title":!0,children:e.title}),(0,w.jsx)(`span`,{className:`font-mono text-xs text-muted`,"data-report-time":!0,children:C(e.createdAt)})]})},e.id))})}),(0,w.jsx)(m,{items:h.map(e=>e.id),current:S?.id??null,onSelect:O,wide:!0,title:S?`Report ${S.title}`:`Report`,children:S&&k?(0,w.jsx)(D,{report:S,src:k}):null})]})}var k=function(){let{companion:e}=g.useSearch();return e?(0,w.jsx)(O,{companion:e}):null};export{k as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./companion-view-CrabvxS8.js";import{ft as t,pt as n}from"./studio-queries-ibmpFo6R.js";import{a as r,n as i,t as a}from"./jsx-runtime-MZURdZre.js";import{Tr as o,r as s,t as c}from"./button-Br0O1sXw.js";import{a as l,c as u,d,f,i as p,o as m,p as h,r as g,s as _,u as v}from"./store-Dw34catY.js";import{n as y,r as b,t as x}from"./panel-dbmCx7Mx.js";import{t as S}from"./warnings-R1cE1rLf.js";import{i as C,n as w,r as T}from"./artifacts-WD2ZXYrx.js";import{F as E,I as D,L as O,N as k,P as A,R as j,d as M}from"./index-Df8L1LQa.js";var N=r(i(),1);function P(e){let t=new Set,n=[];for(let r of e)for(let e of r.specs)t.has(e)||(t.add(e),n.push({capability:e,change:r.name,archivedOn:r.archivedOn}));return n}var F=a(),I=20,L=12,R=`openspec/changes/archive`,z=e=>`openspec/specs/${e}/spec.md`,B=o(f,`grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 py-2`);function V({payload:e}){let[t,n]=(0,N.useState)(null),r=e.shipped.slice(0,I),i=r.find(e=>e.anchor===t)??null;return(0,F.jsxs)(`div`,{className:`analyst-overview`,children:[(0,F.jsx)(S,{warnings:e.warnings}),(0,F.jsx)(`div`,{className:o(u,`@container pb-10`),children:(0,F.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)] items-start gap-3 @max-[760px]:grid-cols-1`,children:[(0,F.jsx)(W,{all:e.shipped.length,shown:r,current:t,onOpen:n}),(0,F.jsx)(K,{shipped:e.shipped})]})}),(0,F.jsx)(b,{items:r.map(e=>e.anchor),current:i?.anchor??null,onSelect:n,title:i?`Shipped change ${i.name}`:`Shipped change`,children:i?(0,F.jsx)(G,{change:i}):null})]})}function H(e){let t=[];for(let n of e){let e=t.at(-1);e?.[0]===n.archivedOn?e[1].push(n):t.push([n.archivedOn,[n]])}return t}function U(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(`en`,{weekday:`long`,timeZone:`UTC`})}function W({all:e,shown:t,current:n,onOpen:r}){return(0,F.jsx)(_,{title:`Recently shipped`,count:e,hint:e>t.length?`newest ${t.length}`:void 0,children:t.length===0?(0,F.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No shipped changes yet.`}):(0,F.jsx)(`ol`,{className:`analyst-days m-0 list-none p-0`,children:H(t).map(([e,t])=>(0,F.jsxs)(`li`,{className:`border-t border-rule first:border-t-0`,children:[(0,F.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 bg-[color-mix(in_srgb,var(--surface)_45%,transparent)] px-4 pt-2.5 pb-1.5 text-xs font-semibold text-muted`,children:[(0,F.jsx)(`time`,{dateTime:e,className:`font-mono text-text`,children:e}),U(e),(0,F.jsx)(l,{value:t.length})]}),(0,F.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:o(f,`grid gap-0.5 py-2`),"aria-current":n===e.anchor?`true`:void 0,onClick:()=>r(e.anchor),children:[(0,F.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.name}),(0,F.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.specs.length===0?`no spec changes`:e.specs.join(`, `)})]})},e.anchor))})]},e))})})}function G({change:e}){let n=`${R}/${e.anchor}`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(x,{mono:!0,title:e.name,kicker:(0,F.jsxs)(`span`,{children:[`Shipped `,e.archivedOn]})}),(0,F.jsx)(y,{title:`Proposal`,children:e.hasProposal?(0,F.jsxs)(t,{className:`inline-flex items-center gap-2 text-sm`,to:`/vault`,search:e=>({...e,path:`${n}/proposal.md`}),children:[(0,F.jsx)(s,{name:`doc`}),` Read the proposal`]}):(0,F.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`This change has no proposal.`,` `,(0,F.jsx)(t,{to:`/vault`,search:e=>({...e,dir:n}),children:`Open its folder`})]})}),(0,F.jsx)(y,{title:`Specs it changed`,aside:String(e.specs.length),children:e.specs.length===0?(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No spec changed.`}):(0,F.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:e.specs.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(t,{className:`font-mono text-sm`,to:`/vault`,search:t=>({...t,path:z(e)}),children:e})},e))})})]})}function K({shipped:e}){let n=P(e).slice(0,L);return(0,F.jsx)(_,{title:`Recently changed specs`,hint:(0,F.jsx)(t,{to:`/specs`,search:e=>e,children:`All specs`}),children:n.length===0?(0,F.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No specs changed by shipped changes yet.`}):(0,F.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:n.map((e,r)=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(t,{className:B,to:`/vault`,search:t=>({...t,path:z(e.capability)}),children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,F.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.capability}),(0,F.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[`by `,e.change]})]}),(0,F.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.archivedOn===n[r-1]?.archivedOn?null:e.archivedOn})]})},e.capability))})})}var q={"needs-you":`Review or fix before the build goes on`,building:`Some tasks are done; others remain`,ready:`Every task is done`};function J(e){if(e.valid===!1)return{marker:`issue`,word:`Invalid`};let t=E(e);return t===`needs-you`?(e.totalTasks??0)===0?{marker:`warn`,word:`No tasks`}:{marker:`review`,word:`Review`}:t===`building`?{marker:`build`,word:A.building}:{marker:`done`,word:`Ready`}}var Y=[`Propose change`,`Human review`,`Apply change`,`Archive change`];function X({change:e,companion:t,reading:n,onRead:r}){let i=O(e),a=D(e),{marker:o,word:s}=J(e),c=(0,F.jsx)(y,{title:`Artifacts`,aside:e.schemaName,children:(0,F.jsx)(T,{change:e,companion:t,onRead:r})}),l=E(e)===`needs-you`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(x,{mono:!0,title:e.name,kicker:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h,{marker:o,children:s}),(0,F.jsx)(g,{at:e.lastModified,className:`ml-auto`})]}),children:(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:i.situation})}),n&&t?(0,F.jsx)(w,{companion:t,path:n,change:e,onBack:()=>r(null)}):(0,F.jsxs)(F.Fragment,{children:[l?c:null,(0,F.jsx)(y,{title:`Delivery Path`,aside:i.stage,children:(0,F.jsx)(C,{steps:Y,current:Y.indexOf(i.stage),tone:i.stage===`Human review`?`why`:`accent`})}),(0,F.jsxs)(y,{title:`Next step`,children:[(0,F.jsxs)(`p`,{className:`m-0 text-sm`,children:[i.next,`.`]}),(0,F.jsx)(p,{text:i.prompt})]}),(0,F.jsx)(y,{title:a.unit===`tasks`?`Tasks`:`Plan`,aside:`${a.done}/${a.total}`,children:(0,F.jsx)(d,{...a})}),l?null:c]})]})}function Z({change:e,current:t,onOpen:n}){let{marker:r,word:i}=J(e),a=O(e);return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:o(f,`grid grid-cols-[minmax(0,1fr)_max-content_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t?`true`:void 0,"data-change":e.name,onClick:n,children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,F.jsx)(`span`,{className:o(`truncate text-xs`,e.valid===!1?`text-bad`:`text-muted`),children:a.situation})]}),(0,F.jsx)(h,{marker:r,children:i}),(0,F.jsx)(`span`,{className:`@max-[640px]:hidden`,children:(0,F.jsx)(d,{...D(e)})}),(0,F.jsx)(g,{at:e.lastModified,className:`text-right @max-[640px]:hidden`})]})})}function Q({changes:e,selected:t,companion:r}){let i=n(),[a,s]=(0,N.useState)(`all`),[d,f]=(0,N.useState)(!1),[p,h]=(0,N.useState)(null),g=j(e),y=k.filter(e=>a===`all`||a===e),x=y.flatMap(e=>g[e]),S=d?g[`needs-you`]:x,C=e.find(e=>e.name===t)??null,w=p&&p.change===C?.name?p.path:null,T=e=>{e===null&&f(!1),i({to:`.`,search:t=>({...t,change:e??void 0}),replace:!0})};return e.length===0?(0,F.jsx)(`section`,{className:o(u,`pb-10`),"aria-label":`Changes`,children:(0,F.jsx)(m,{children:`No change is in flight in this companion.`})}):(0,F.jsxs)(`section`,{className:o(u,`@container grid content-start gap-3 pb-10`),"aria-label":`Changes`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(v,{label:`Show changes`,value:a,onChange:s,options:[{value:`all`,label:`All`,count:e.length},...k.map(e=>({value:e,label:A[e],count:g[e].length,tone:e===`needs-you`?`warn`:void 0}))]}),g[`needs-you`].length>0?(0,F.jsxs)(c,{variant:`primary`,size:`sm`,className:`ml-auto`,onClick:()=>{f(!0),T(g[`needs-you`][0].name)},children:[`Start review pass`,(0,F.jsx)(l,{value:g[`needs-you`].length})]}):null]}),y.map(e=>g[e].length===0?null:(0,F.jsx)(_,{title:A[e],count:g[e].length,hint:q[e],tone:e===`needs-you`?`warn`:void 0,children:(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:g[e].map(e=>(0,F.jsx)(Z,{change:e,current:e.name===t,onOpen:()=>{f(!1),T(e.name)}},e.name))})},e)),(0,F.jsx)(b,{items:S.map(e=>e.name),current:C?.name??null,onSelect:T,pass:d?`Needs you`:void 0,wide:w!==null,title:C?`Change ${C.name}`:`Change`,children:C?(0,F.jsx)(X,{change:C,companion:r,reading:w,onRead:e=>h(e?{change:C.name,path:e}:null)}):null})]})}function $({payload:e,selected:t,companion:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(S,{warnings:e.warnings}),(0,F.jsx)(Q,{changes:e.changes,selected:t,companion:n})]})}function ee(){let t=M.useSearch();return(0,F.jsx)(e,{view:`dashboard`,search:t,children:e=>e.studioMode===`analysis`?(0,F.jsx)(V,{payload:{shipped:e.shipped??[],warnings:e.warnings}}):(0,F.jsx)($,{payload:{changes:e.changes??[],warnings:e.warnings},selected:t.change,companion:t.companion})})}export{ee as component};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$t as r,Bt as i,Cn as a,Fn as o,Ft as s,G as c,Gn as l,H as u,Hn as d,Jn as f,Kn as p,L as m,M as h,Mn as g,On as _,Qt as v,Rt as y,S as b,Sn as x,T as S,Tr as C,Ut as w,V as ee,Vn as T,W as E,Wn as D,Xt as O,Y as k,Yn as A,_n as j,_r as M,_t as N,a as P,br as F,f as I,gr as L,hn as R,hr as z,ht as B,ir as V,l as H,mr as U,nt as te,on as ne,pn as W,q as re,qn as G,r as ie,rt as K,tt as q,vr as ae,w as J,wr as oe,x as se,xn as ce,xr as le}from"./button-Br0O1sXw.js";import{_ as Y,a as ue,c as de,d as fe,g as X,l as pe,m as me,o as he,s as ge,u as _e,v as ve}from"./fields-6aXBpFhJ.js";import{S as ye,_ as be,a as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,l as Oe,m as ke,n as Ae,p as je,s as Me,t as Ne,u as Pe,x as Fe,y as Ie}from"./useAnchoredPopupScrollLock-Bj-FWb8z.js";import{_t as Le,bt as Re,vt as ze,yt as Be}from"./index-Df8L1LQa.js";var Z=e(t(),1);function Ve(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,p=A(c),m=e.useState(`open`),h=k(),g=Z.useRef(``),_=Z.useRef(d??a??-1),v=Z.useRef(null),y=A(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!B(n)||n?.matches(`:disabled`)?!1:s==null||!N(L,e,s)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let f=n.current;if(g.current.length>0&&e.key===` `&&(i(e),p?.(!0)),g.current.length>0&&g.current[0]!==` `&&l(f,g.current)===-1&&e.key!==` `&&p?.(!1),f==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;m&&e.key!==` `&&(i(e),p?.(!0));let y=g.current===``;y&&(_.current=d??a??-1),f.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,_.current=v.current),g.current+=e.key,h.start(u,()=>{g.current=``,_.current=v.current,p?.(!1)});let b=((y?d??a??-1:_.current)??0)+1,x=l(f,g.current,b);x===-1?e.key!==` `&&(g.current=``,p?.(!1)):(o?.(x,e),v.current=x)}),b=A(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);W(r,n)||W(i,n)||(h.clear(),g.current=``,_.current=v.current,p?.(!1))});f(()=>{(m||d===null)&&(h.clear(),v.current=null,g.current!==``&&(g.current=``,p?.(!1)))},[m,d,h,p]);let x=Z.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Z.useMemo(()=>l?{reference:x,floating:x}:{},[l,x])}function He(e){let[t,n]=Z.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Q=n(),Ue=5;function $(e,t){let n=We(t);return e.clientX>=n.left-Ue&&e.clientX<=n.right+Ue&&e.clientY>=n.top-Ue&&e.clientY<=n.bottom+Ue}function We(e){let t=e.getBoundingClientRect(),n=V(e);if(R)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Ge(e,t){return e??t}var Ke=Z.createContext(void 0),qe=Z.createContext(void 0);function Je(){let e=Z.useContext(Ke);if(e===void 0)throw Error(G(60));return e}function Ye(){let e=Z.useContext(qe);if(e===void 0)throw Error(G(61));return e}var Xe={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Pe(t,r)!==``},hasNullItemLabel:(e,t)=>t?xe(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>we(t,e,n)):we(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Ze(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Qe(e,t){return Math.max(0,e-t)}function $e(e,t){if(t<=0)return 0;let n=Ze(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function et(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:l,name:p,form:m,autoComplete:h,disabled:g=!1,readOnly:v=!1,required:y=!1,modal:b=!0,actionsRef:x,inputRef:C,onOpenChangeComplete:w,items:T,multiple:E=!1,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:k=Te,highlightItemOnHover:j=!0,children:N}=e,{clearErrors:R}=_e(),{setDirty:B,setTouched:V,setFocused:U,validityData:te,setFilled:ne,name:W,disabled:re,validation:G,validationMode:ie}=me(),K=de({id:t}),q=re||g,J=W??p,[Y,ue]=oe({controlled:n,default:E?r??L:r,name:`Select`,state:`value`}),[X,pe]=oe({controlled:a,default:s,name:`Select`,state:`open`}),he=Z.useRef([]),ve=Z.useRef([]),be=Z.useRef(null),xe=Z.useRef(null),Ce=Z.useRef(0),we=Z.useRef(null),Ee=Z.useRef([]),je=Z.useRef(!1),Me=Z.useRef(null),Ne=Z.useRef(null),Le=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Re=Z.useRef(!1),ze=Z.useRef(Y),{openMethod:Be,triggerProps:Ue}=Ae(X),$=le(()=>new P({id:K,labelId:void 0,modal:b,multiple:E,disabled:q,readOnly:v,required:y,highlightItemOnHover:j,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:k,value:Y,open:X,mounted:X,transitionStatus:void 0,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:M,triggerProps:M,itemRoot:{props:M,multiple:E,disabled:q,readOnly:v,isItemEqualToValue:k},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:ae,setOpen:ae,handleScrollArrowVisibility:ae,onOpenChangeComplete:ae,listRef:he,popupRef:be,scrollHandlerRef:xe,scrollArrowsMountedCountRef:Ce,valueRef:we,valuesRef:Ee,labelsRef:ve,typingRef:je,selectionRef:Le,firstItemTextRef:Me,selectedItemTextRef:Ne,alignItemWithTriggerActiveRef:Re,initialValueRef:ze},Xe)).current,[We,Ge]=Z.useState(!1),{mounted:Je,transitionStatus:Ye,forceUnmount:Ze}=se({open:X,ref:be,preventUnmountOnClose:We,setPreventUnmountOnClose:Ge,onUnmount(){$.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),w?.(!1)}}),et=$.useState(`activeIndex`),tt=$.useState(`selectedIndex`),nt=$.useState(`triggerElement`),rt=$.useState(`positionerElement`),it=He(Be),at=Be??it,ot=Z.useMemo(()=>E?``:Pe(Y,O),[E,Y,O]),st=Z.useMemo(()=>E&&Array.isArray(Y)?Y.map(e=>Pe(e,O)):Pe(Y,O),[E,Y,O]),ct=c(nt),lt=A(()=>st);fe(ct,K,Y,lt,!q,p);let ut=E?Array.isArray(Y)&&Y.length>0:Y!=null&&ot!==``;f(()=>{ne(ut)},[ut,ne]),f(function(){let e=ke(Ee.current,Y,k,E);e===null&&(Ne.current=null),X||$.set(`selectedIndex`,e)},[E,X,Y,k,$]),ge(Y,()=>{R(J),B(De(Y,te.initialValue,k)),G.change(Y)});let dt=A((e,t)=>{let n=t,r=I(n);l?.(e,n),t.isCanceled||(e||Ge(r()),pe(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(V(!0),U(!1),ie===`onBlur`&&G.commit(Y)))});Z.useImperativeHandle(x,()=>({unmount:Ze,close:()=>{$.state.open&&dt(!1,d(_))}}),[Ze,dt,$]);let ft=A((e,t)=>{i?.(e,t),t.isCanceled||ue(e)}),pt=A(e=>{let t=Qe(e.scrollHeight,e.clientHeight),n=$e(e.scrollTop,t),r=n>0,i=n<t;$.set(`scrollUpArrowVisible`,r),$.set(`scrollDownArrowVisible`,i)}),mt=Fe({open:X,onOpenChange:dt,elements:{reference:nt,floating:rt}}),ht=ye(mt,{enabled:!q,event:`mousedown`}),gt=S(mt),_t=Se(mt,{enabled:!q,listRef:he,activeIndex:et,selectedIndex:tt,disabledIndices:L,onNavigate(e){(e!==null||X)&&$.set(`activeIndex`,e)},focusItemOnHover:j}),vt=Ve(mt,{enabled:!q&&(X||!v&&!E),listRef:ve,activeIndex:et,selectedIndex:tt,disabledIndices:e=>ce(he.current[e]),onMatch(e){X?$.set(`activeIndex`,e):ft(Ee.current[e],d(o))},onTyping(e){je.current=e}}),yt=Z.useMemo(()=>z(vt.reference,_t.reference,gt.reference,ht.reference,Ue),[ht.reference,vt.reference,_t.reference,gt.reference,Ue]),bt=Z.useMemo(()=>z(H,vt.floating,_t.floating,gt.floating),[vt.floating,_t.floating,gt.floating]),xt=_t.item??M,St=Z.useMemo(()=>({props:xt,multiple:E,disabled:q,readOnly:v,isItemEqualToValue:k}),[xt,E,q,v,k]);$.useContextCallback(`setValue`,ft),$.useContextCallback(`setOpen`,dt),$.useContextCallback(`handleScrollArrowVisibility`,pt),$.useContextCallback(`onOpenChangeComplete`,w),Ie(()=>{$.update({popupProps:bt,triggerProps:yt,itemRoot:St})}),$.useSyncedValues({id:K,modal:b,multiple:E,disabled:q,readOnly:v,required:y,highlightItemOnHover:j,value:Y,open:X,mounted:Je,transitionStatus:Ye,popupProps:bt,triggerProps:yt,itemRoot:St,items:T,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:k,openMethod:at});let Ct=F(C,G.inputRef),wt=E?void 0:J,Tt=Z.useMemo(()=>!E||!Array.isArray(Y)||!J?null:Y.map(e=>{let t=Pe(e,O);return(0,Q.jsx)(`input`,{type:`hidden`,form:m,name:J,value:t,disabled:q},t)}),[E,Y,m,J,O,q]);return(0,Q.jsxs)(Ke.Provider,{value:$,children:[(0,Q.jsx)(qe.Provider,{value:mt,children:N}),(0,Q.jsx)(`input`,{...G.getValidationProps(q,{onFocus(){$.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||q||v)return;let t=e.currentTarget.value,n=d(o,e.nativeEvent);function r(){if(E)return;let e=t.toLowerCase(),r=Ee.current.findIndex(t=>Pe(t,O).toLowerCase()===e||Oe(t,D).toLowerCase()===e);r===-1&&(r=Ee.current.findIndex((t,n)=>{let r=ve.current[n];return r!=null&&r.toLowerCase()===e}));let i=Ee.current[r];i!=null&&ft(i,n)}$.set(`forceMount`,!0),queueMicrotask(r)}}),id:K&&wt==null?`${K}-hidden-input`:void 0,form:m,name:wt,autoComplete:h,value:ot,disabled:q,required:y&&!(E&&ut),readOnly:v,ref:Ct,style:J?u:ee,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}var tt=`data-popup-side`,nt=400,rt={...v,...X,popupSide:e=>e?{[tt]:e}:null,value:()=>null},it=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:s=!1,nativeButton:u=!0,style:f,...m}=e,{setTouched:h,validationMode:g,validation:_,state:v,disabled:y}=me(),{labelId:b}=pe(),x=Je(),S=x.useState(`readOnly`),C=x.useState(`required`),ee=x.useState(`disabled`),T=y||ee||s,E=x.useState(`open`),D=x.useState(`mounted`),O=x.useState(`value`),A=x.useState(`triggerProps`),j=x.useState(`positionerElement`),M=x.useState(`listElement`),N=x.useState(`popupSide`),P=x.useState(`id`),F=x.useState(`labelId`),I=x.useState(`hasSelectedValue`),L=D&&j?N:null,R=i??P,B=Ge(b,F);de({id:i});let V=c(j),H=Z.useRef(null),te=he(T,H),{getButtonProps:ne,buttonRef:re}=l({disabled:T,native:u}),G=x.useStateSetter(`triggerElement`),ie=k(),K=k(),q=k();Z.useEffect(()=>{if(E)return q.start(nt,()=>{x.context.selectionRef.current.allowUnselectedMouseUp=!0,x.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{q.clear()};x.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[E,x,K,q]);let ae=z(A,{id:R,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-controls":E?M?.id??w(j)?.id:void 0,"aria-labelledby":B,"aria-readonly":S||void 0,"aria-required":C||void 0,tabIndex:T?-1:0,onFocus(e){te(!0),E&&x.context.alignItemWithTriggerActiveRef.current&&x.context.setOpen(!1,d(o,e.nativeEvent)),ie.start(0,()=>{x.set(`forceMount`,!0)})},onBlur(e){W(j,e.relatedTarget)||(h(!0),te(!1),g===`onBlur`&&_.commit(O))},onMouseDown(e){if(E)return;let t=p(e.currentTarget);function n(e){if(!H.current)return;let t=e.target;W(H.current,t)||W(V.current,t)||$(e,H.current)||x.context.setOpen(!1,d(a,e))}K.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},m,ne),J=_.getValidationProps(T,ae);J.role=`combobox`;let oe={...v,open:E,disabled:T,value:O,readOnly:S,popupSide:L,placeholder:!I};return U(`button`,e,{ref:[t,H,re,G],state:oe,stateAttributesMapping:rt,props:J})}),at={value:()=>null},ot=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Je(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Me(l,u,d):Ce(l,u,d)),U(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:at})}),st=Z.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,s={open:Je().useState(`open`)};return U(`span`,e,{state:s,ref:t,props:[{"aria-hidden":!0,children:`▼`},o],stateAttributesMapping:r})}),ct=Z.forwardRef(function(e,t){let n=Je(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Q.jsx)(h,{ref:t,...e}):null}),lt=Z.createContext(void 0);function ut(){let e=Z.useContext(lt);if(!e)throw Error(G(59));return e}function dt(e,t){e&&Object.assign(e.style,t)}var ft={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},pt={position:`fixed`},mt=Z.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:p=`clipping-ancestors`,collisionPadding:h,arrowPadding:g,sticky:_,disableAnchorTracking:v,alignItemWithTrigger:y=!0,collisionAvoidance:b=m,style:S,...C}=e,w=Je(),ee=Ye(),T=w.useState(`open`),E=w.useState(`mounted`),D=w.useState(`modal`),O=w.useState(`value`),k=w.useState(`openMethod`),j=w.useState(`positionerElement`),M=w.useState(`triggerElement`),N=w.useState(`isItemEqualToValue`),P=w.useState(`transitionStatus`),F=Z.useRef(null),I=Z.useRef(null),[L,R]=Z.useState(y),z=E&&L&&k!==`touch`;!E&&L!==y&&R(y),Z.useImperativeHandle(w.context.alignItemWithTriggerActiveRef,()=>z),Ne((z||D)&&T,k===`touch`,j,M);let B=Be({anchor:n,floatingRootContext:ee,positionMethod:a,mounted:E,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:g,collisionBoundary:p,collisionPadding:h,sticky:_,disableAnchorTracking:v??z,collisionAvoidance:b,keepMounted:!0}),V=z?`none`:B.side,H=z?pt:B.positionerStyles,U={open:T,side:V,align:B.align,anchorHidden:B.anchorHidden};f(()=>{w.set(`popupSide`,B.side)},[w,B.side]);let te=w.useStateSetter(`positionerElement`),ne=Le(e,U,{styles:H,transitionStatus:P,props:C,refs:[t,te],hidden:!E,inert:!T}),W=Z.useRef(0),re=A(e=>{if(w.context.valuesRef.current.length===0)return;let t=W.current;W.current=e.size;let n=d(o);if(t!==0&&!w.state.multiple&&O!==null&&je(w.context.valuesRef.current,O,N)===-1){let e=w.context.initialValueRef.current,t=e!=null&&je(w.context.valuesRef.current,e,N)!==-1?e:null;w.context.setValue(t,n),t===null&&(w.set(`selectedIndex`,null),w.context.selectedItemTextRef.current=null)}if(t!==0&&w.state.multiple&&Array.isArray(O)){let e=O.filter(e=>je(w.context.valuesRef.current,e,N)!==-1);e.length!==O.length&&(w.context.setValue(e,n),e.length===0&&(w.set(`selectedIndex`,null),w.context.selectedItemTextRef.current=null))}if(T&&z){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};dt(j,e),dt(w.context.popupRef.current,e)}}),G=Z.useMemo(()=>({...B,side:V,alignItemWithTriggerActive:z,setControlledAlignItemWithTrigger:R,scrollUpArrowRef:F,scrollDownArrowRef:I}),[B,V,z,R]);return(0,Q.jsx)(x,{elementsRef:w.context.listRef,labelsRef:w.context.labelsRef,onMapChange:re,children:(0,Q.jsxs)(lt.Provider,{value:G,children:[E&&D&&(0,Q.jsx)(ue,{inert:Y(!T),cutout:M}),ne]})})}),ht=`base-ui-disable-scrollbar`,gt={className:ht,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:ht,precedence:`base-ui:low`,children:`.${ht}{scrollbar-width:none}.${ht}::-webkit-scrollbar{display:none}`})}},_t=Z.createContext(void 0),vt={disableStyleElements:!1};function yt(){return Z.useContext(_t)??vt}var bt=`--transform-origin`,xt={...O,...ne},St=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Je(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),m=Ye(),{side:h,align:g,alignItemWithTriggerActive:_,isPositioned:v,setControlledAlignItemWithTrigger:y}=ut(),x=q(!0)!=null,S=te(),{nonce:C,disableStyleElements:w}=yt(),ee=s.useState(`id`),D=s.useState(`open`),O=s.useState(`openMethod`),k=s.useState(`mounted`),M=s.useState(`popupProps`),N=s.useState(`transitionStatus`),P=s.useState(`triggerElement`),F=s.useState(`positionerElement`),I=s.useState(`listElement`),L=Z.useRef(!1),R=Z.useRef(!1),z=Z.useRef({}),B=E(),H=A(e=>{if(!F||!s.context.popupRef.current||!R.current)return;let t=F.style.top===`0px`,n=F.style.bottom===`0px`;if(L.current||!_||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=Tt(F),i=Et(F.getBoundingClientRect().height,`y`,r),a=p(F),o=V(F),c=o.getComputedStyle(F),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Ct(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),m=e.scrollTop,h=wt(e),g=null,v=e=>{F.style.height=`${e}px`},y=t?h-m:m,b=Math.min(i+y,f);if(y<=1){let n=Ze(y,0,f-i);n>0&&v(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(L.current=!0),s.context.handleScrollArrowVisibility(e);return}f-b>1?g=t?1/0:0:n&&m<h&&(g=m-(y-(i+y-f)));let x=Math.ceil(b);if(x!==0&&v(x),g!=null){let t=Ze(g,0,wt(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}x>=f-1&&(L.current=!0),s.context.handleScrollArrowVisibility(e)});Z.useImperativeHandle(s.context.scrollHandlerRef,()=>H,[H]),b({open:D,ref:s.context.popupRef,onComplete(){D&&s.context.onOpenChangeComplete(!0)}});let ne={open:D,transitionStatus:N,side:h,align:g};f(()=>{F&&s.context.popupRef.current&&!Object.keys(z.current).length&&(z.current={top:F.style.top||`0`,left:F.style.left||`0`,right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[s,F]),f(()=>{D||_||(R.current=!1,L.current=!1,dt(F,z.current))},[D,_,F]),f(()=>{let e=s.context.popupRef.current;if(!D||!P||!F||!e||_&&!v||s.state.transitionStatus===`ending`)return;if(R.current=!0,e.style.removeProperty(bt),!_){B.request(()=>s.context.handleScrollArrowVisibility(I||e));return}let t=kt(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=V(F),i=r.getComputedStyle(F),a=r.getComputedStyle(e),o=p(P),c=Tt(P),l=Dt(P.getBoundingClientRect(),c),d=Dt(F.getBoundingClientRect(),c),f=l.height,m=I||e,h=m.scrollHeight,g=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Ct(a),C=o.documentElement.clientHeight-_-v,w=o.documentElement.clientWidth,ee=C-l.bottom+f,T,E=S===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=Dt(n.getBoundingClientRect(),c);T=Dt(t.getBoundingClientRect(),c),E=d.left+(S===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let O=ee+D+v+g,k=Math.min(C,O),A=C-_-v,M=O-k,N=w-5;F.style.left=`${Ze(E,5,N-d.width)}px`,F.style.height=`${k}px`,F.style.maxHeight=`none`,F.style.marginTop=`${_}px`,F.style.marginBottom=`${v}px`,e.style.height=`100%`;let R=wt(m),B=M>=R-1;B&&(k=Math.min(C,d.height)-(M-R));let H=l.top<20||l.bottom>C-20||Math.ceil(k)+1<Math.min(h,b),U=(r.visualViewport?.scale??1)!==1&&j;if(H||U){dt(F,z.current),y(!1);return}let te=Math.max(b,k);if(B){let e=Math.max(0,C-O);F.style.top=d.height>=A?`0`:`${e}px`,F.style.height=`${k}px`,m.scrollTop=wt(m)}else F.style.bottom=`0`,m.scrollTop=M;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=Ze(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(bt,`50% ${i}%`)}(te===C||k>=x)&&(L.current=!0),s.context.handleScrollArrowVisibility(m),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,D,F,P,_,y,B,I,u,S,v]),Z.useEffect(()=>{if(!_||!F||!D)return;let e=V(F);function t(e){s.context.setOpen(!1,d(T,e))}return re(e,`resize`,t)},[s,_,F,D]);let W={...I?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${ee}-list`},onKeyDown(e){x&&K.has(e.key)&&e.stopPropagation()},onScroll(e){I||H(e.currentTarget)},..._&&{style:I?{height:`100%`}:ft},className:!I&&_?gt.className:void 0},G=U(`div`,e,{ref:[t,s.context.popupRef],state:ne,stateAttributesMapping:xt,props:[M,W,ze(N),o]});return(0,Q.jsxs)(Z.Fragment,{children:[!w&&gt.getElement(C),(0,Q.jsx)(ve,{context:m,modal:!1,disabled:!k,openInteractionType:O,returnFocus:a,restoreFocus:!0,children:G})]})});function Ct(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function wt(e){return Qe(e.scrollHeight,e.clientHeight)}function Tt(e){return Re.getScale(e)}function Et(e,t,n){return e/n[t]}function Dt(e,t){return s({x:Et(e.x,`x`,t),y:Et(e.y,`y`,t),width:Et(e.width,`x`,t),height:Et(e.height,`y`,t)})}var Ot=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function kt(e){let{style:t}=e,n={};for(let[e,r]of Ot)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ot){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var At=Z.createContext(void 0);function jt(){let e=Z.useContext(At);if(!e)throw Error(G(57));return e}var Mt=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...u}=e,p=Z.useRef(null),m=D({guess:!0,label:o,textRef:p}),h=Je(),{props:_,multiple:v,disabled:b,readOnly:x,isItemEqualToValue:S}=h.useState(`itemRoot`),C=b||s,w=h.useState(`isActive`,m.index),ee=h.useState(`open`),T=h.useState(`isSelected`,a),E=h.useState(`isSelectedByFocus`,m.index),O=m.index,k=Z.useRef(null);f(()=>{let e=h.context.valuesRef.current;return e[O]=a,()=>{delete e[O]}},[O,a,h]),f(()=>{let e=h.state.value,t=h.state.selectedIndex,n=t,r;v&&Array.isArray(e)?(n=be(O,a,h.context.valuesRef.current,e,S,t),r=n===O,O===t&&!r&&(h.context.selectedItemTextRef.current=null)):(r=e!==void 0&&we(a,e,S),r&&(n=O)),h.set(`selectedIndex`,n),r&&p.current&&(h.context.selectedItemTextRef.current=p.current)},[O,v,S,h,a]);let A=Z.useRef(`mouse`),j=Z.useRef(!1),{getButtonProps:M,buttonRef:N}=l({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),P={disabled:C,selected:T,highlighted:w};function F(e){if(b||x)return;let t=h.state.value;if(v){let n=Array.isArray(t)?t:[],r=T?Ee(n,a,S):[...n,a];h.context.setValue(r,d(g,e))}else h.context.setValue(a,d(g,e)),h.context.setOpen(!1,d(g,e))}function I(){h.context.selectionRef.current.dragY=0}let L={role:`option`,"aria-selected":T,tabIndex:ee&&w?0:-1,onKeyDown(e){h.set(`activeIndex`,O),e.key===` `&&h.context.typingRef.current&&e.preventDefault()},onClick(e){let t=A.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&y(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!j.current;j.current=!1,C||i||F(e.nativeEvent)},onPointerEnter(e){A.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=h.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){A.current=e.pointerType,j.current=!0,I()},onMouseUp(){if(I(),C||A.current===`touch`||j.current)return;let e=!h.context.selectionRef.current.allowSelectedMouseUp&&T,t=!h.context.selectionRef.current.allowUnselectedMouseUp&&!T;e||t||(j.current=!0,k.current?.click(),j.current=!1)}},R=U(`div`,e,{ref:[N,t,m.ref,k],state:P,props:[_,L,u,M]}),z=Z.useMemo(()=>({selected:T,index:O,textRef:p,selectedByFocus:E}),[T,O,p,E]);return(0,Q.jsx)(At.Provider,{value:z,children:R})})),Nt=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=Z.useRef(null),{transitionStatus:l,setMounted:u}=J(o),d=U(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:ne});return b({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),Pt=Z.forwardRef(function(e,t){let{selected:n}=jt();return e.keepMounted||n?(0,Q.jsx)(Nt,{...e,selected:n,ref:t}):null}),Ft=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jt(),a=Je(),{render:o,className:s,style:c,...l}=e,u=Z.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return U(`div`,e,{ref:[u,t,r],props:l})})),It=`relative flex h-9 w-full min-w-0 items-center gap-2 rounded-control border border-rule bg-page pr-9 pl-3 text-left text-sm text-text outline-none transition-colors focus-visible:border-accent data-popup-open:border-accent disabled:cursor-not-allowed disabled:opacity-60`,Lt=`pointer-events-none size-4 text-muted`,Rt=`max-h-[min(var(--available-height),20rem)] min-w-(--anchor-width) overflow-y-auto rounded-card border border-rule bg-surface p-1 text-text shadow-float outline-none transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,zt=`relative flex cursor-default items-center rounded-[6px] py-1.5 pr-8 pl-2.5 text-sm outline-none select-none data-disabled:opacity-50 data-highlighted:bg-accent-soft`,Bt=`pointer-events-none absolute right-2.5 size-4 text-accent`;function Vt(e){return(0,Q.jsx)(et,{"data-slot":`select`,...e})}function Ht({className:e,children:t,...n}){return(0,Q.jsxs)(it,{"data-slot":`select-trigger`,className:C(It,e),...n,children:[t,(0,Q.jsx)(st,{className:`absolute right-3 flex`,children:(0,Q.jsx)(ie,{name:`chevron`,className:Lt})})]})}function Ut({className:e,...t}){return(0,Q.jsx)(ot,{"data-slot":`select-value`,className:C(`truncate`,e),...t})}function Wt({className:e,...t}){return(0,Q.jsx)(ct,{children:(0,Q.jsx)(mt,{alignItemWithTrigger:!1,sideOffset:6,className:`z-40`,children:(0,Q.jsx)(St,{"data-slot":`select-content`,className:C(Rt,e),...t})})})}function Gt({className:e,children:t,...n}){return(0,Q.jsxs)(Mt,{"data-slot":`select-item`,className:C(zt,e),...n,children:[(0,Q.jsx)(Ft,{className:`truncate`,children:t}),(0,Q.jsx)(Pt,{className:Bt,children:(0,Q.jsx)(ie,{name:`check`,className:`size-4`})})]})}export{Vt as a,Ht as c,Nt as d,Ge as f,Rt as i,Ut as l,Ve as m,zt as n,Wt as o,$ as p,Bt as r,Gt as s,Lt as t,It as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./companion-view-CrabvxS8.js";import{a as t,n,t as r}from"./jsx-runtime-MZURdZre.js";import{c as i,f as a,i as o,o as s,s as c,u as l}from"./store-Dw34catY.js";import{Dr as u,Tr as d,r as f}from"./button-Br0O1sXw.js";import{n as p,r as m,t as h}from"./panel-dbmCx7Mx.js";import{n as g}from"./steps-C0p2N1Pb.js";import{J as _,f as v}from"./studio-queries-ibmpFo6R.js";import{t as y}from"./markdown-view-BOX6x0rL.js";import{s as b}from"./index-Df8L1LQa.js";var x=t(n(),1),S=r(),C=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft aria-[current=true]:bg-accent-soft`;function w(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KB`}function T({companion:e,agent:t,name:n}){let[r,i]=(0,x.useState)(void 0),a=u({...v(e,t,n,r),placeholderData:_});if(!a.data)return(0,S.jsx)(p,{title:`Files`,children:a.isError?(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,role:`alert`,children:a.error instanceof Error?a.error.message:`The skill could not be read.`}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Listing files…`})});let{files:o,truncated:s,open:c}=a.data;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(p,{title:`Files`,aside:s?`first ${o.length}`:o.length,children:(0,S.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:o.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:C,"aria-current":c?.path===e.path?`true`:void 0,"data-skill-file":e.path,onClick:()=>i(e.path),children:[(0,S.jsx)(f,{name:`doc`,className:`flex-none text-muted`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,S.jsx)(`span`,{className:`ml-auto flex-none font-mono text-2xs text-muted`,children:w(e.size)})]})},e.path))})}),c?(0,S.jsxs)(`section`,{className:d(`grid gap-2.5 px-5 py-4`,a.isPlaceholderData&&`opacity-60`),"aria-label":`File ${c.path}`,children:[(0,S.jsx)(`code`,{className:`truncate font-mono text-xs text-muted`,children:c.path}),c.nodes?(0,S.jsx)(`div`,{className:`prose-panel`,children:(0,S.jsx)(y,{nodes:c.nodes})}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:c.note})]}):null]})}var E=[{id:`claude`,label:`Claude`,dir:`.claude/skills`,invoke:e=>`/${e}`},{id:`opencode`,label:`OpenCode`,dir:`.opencode/skills`,invoke:e=>`@${e}`},{id:`agents`,label:`Agents`,dir:`.agents/skills`,invoke:e=>`$${e}`}],D=new Set([`mate-grilling`,`mate-domain-modeling`]);function O(){let e=new Map;for(let t of g({}).paths[0]?.steps??[]){t.skill&&!e.has(t.skill)&&e.set(t.skill,t.label);for(let n of t.alternatives??[])e.has(n.name)||e.set(n.name,t.label)}return e}function k(e,t){let n=[...t.keys()],r=e.filter(e=>t.has(e)).toSorted((e,t)=>n.indexOf(e)-n.indexOf(t)),i=e.filter(e=>D.has(e)),a=e.filter(e=>e.startsWith(`mate-`)&&!t.has(e)&&!D.has(e)),o=e.filter(e=>!e.startsWith(`mate-`)&&!t.has(e));return[{title:`Delivery Path`,hint:`In the order a change meets them`,names:r},{title:`Other Mate skills`,hint:`Run when you need them`,names:a},{title:`Used by other skills`,hint:`Loaded for you, not started on their own`,names:i},{title:`Other skills`,hint:`Installed besides Mate`,names:o}].filter(e=>e.names.length>0)}function A({skills:e,companion:t}){let n=e??{claude:[],opencode:[],agents:[]},[r,u]=(0,x.useState)(`claude`),[f,g]=(0,x.useState)(null),_=O(),v=E.find(e=>e.id===r);return(0,S.jsxs)(`section`,{className:d(i,`grid content-start gap-3 pb-10`),"aria-label":`Agent skills`,"data-skills-root":!0,children:[(0,S.jsx)(l,{label:`Agent`,value:r,onChange:e=>{u(e),g(null)},options:E.map(e=>({value:e.id,label:e.label,count:n[e.id].length}))}),E.map(e=>{let t=e.id===r,i=n[e.id];return(0,S.jsx)(`div`,{id:`skills-panel-${e.id}`,className:t?`grid gap-3`:`hidden`,"aria-hidden":!t,"data-skill-panel":e.id,"data-active":t,children:i.length===0?(0,S.jsxs)(s,{children:[e.label,` has no skills in this companion.`]}):k(i,_).map(e=>(0,S.jsx)(c,{title:e.title,count:e.names.length,hint:e.hint,children:(0,S.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.names.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:d(a,`grid grid-cols-[minmax(0,1fr)_auto] py-1.5`),"aria-current":t&&f===e?`true`:void 0,"data-skill":e,onClick:()=>g(e),children:[(0,S.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e}),_.has(e)?(0,S.jsx)(`span`,{className:`text-xs text-muted`,children:_.get(e)}):null]})},e))})},e.title))},e.id)}),(0,S.jsx)(m,{items:k(n[r],_).flatMap(e=>e.names),current:f,onSelect:g,wide:t!==void 0,title:f?`Skill ${f}`:`Skill`,children:f?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(h,{mono:!0,title:f,kicker:_.has(f)?(0,S.jsxs)(`span`,{children:[`Delivery Path · `,_.get(f)]}):(0,S.jsx)(`span`,{children:v.label})}),(0,S.jsx)(p,{title:`Start`,children:D.has(f)?(0,S.jsx)(`p`,{className:`m-0 text-sm`,children:`Used by other skills: they load it when they need it, so it has no start command.`}):(0,S.jsx)(o,{text:v.invoke(f),label:`start command`})}),(0,S.jsx)(p,{title:`Installed for`,children:(0,S.jsx)(`ul`,{className:`m-0 grid list-none gap-1.5 p-0`,children:E.filter(e=>n[e.id].includes(f)).map(e=>(0,S.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`w-20 text-muted`,children:e.label}),(0,S.jsxs)(`code`,{className:`truncate font-mono text-xs`,children:[e.dir,`/`,f,`/`]})]},e.id))})}),t?(0,S.jsx)(T,{companion:t,agent:r,name:f},`${r}/${f}`):null]}):null})]})}var j=function(){let t=b.useSearch();return(0,S.jsx)(e,{view:`skills`,search:t,children:e=>(0,S.jsx)(A,{skills:e.skillInventory,companion:t.companion})})};export{j as component};
@@ -0,0 +1 @@
1
+ import"./studio-Cpz_HRHp.js";import{t as e}from"./companion-view-CrabvxS8.js";import{n as t,r as n}from"./specs-view-BnCLA0gW.js";import{o as r}from"./index-Df8L1LQa.js";import{t as i}from"./jsx-runtime-MZURdZre.js";function a(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:r})=>{let i=n(e);return i?[{action:i,runAgents:t,copyAgents:r}]:[]})}var o=i(),s=function(){let n=r.useSearch(),i=r.useNavigate();return(0,o.jsx)(e,{view:`specs`,search:n,children:e=>(0,o.jsx)(t,{payload:{specs:e.specs??[],warnings:e.warnings},actions:a(e),companion:n.companion,filter:{q:n.q,repo:n.repo,area:n.area},onFilterChange:e=>void i({search:t=>({...t,q:e.q||void 0,repo:e.repo,area:e.area}),replace:!0})})})};export{s as component};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{Dr as r,Tr as i,r as a}from"./button-Br0O1sXw.js";import{ft as o,h as s}from"./studio-queries-ibmpFo6R.js";import"./studio-Cpz_HRHp.js";import{c,f as l,o as u,p as d,s as f}from"./store-Dw34catY.js";import{t as p}from"./fields-6aXBpFhJ.js";import{a as m,c as h,l as g,o as _,s as v}from"./select-CnaMd617.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./combobox-DA7RAUUZ.js";import{t as T}from"./warnings-R1cE1rLf.js";import{n as ee,r as te,t as E}from"./panel-dbmCx7Mx.js";import{t as D}from"./markdown-view-BOX6x0rL.js";var O=[`binds`,`in`,`mentions`,`co-change`],k=`Repository root`,A=e=>`spec:${e}`,j=(e,t)=>`openspec/changes/archive/${e}/${t}`,ne=e=>`openspec/specs/${e}/spec.md`,re=/^[a-z0-9][a-z0-9-]{0,63}$/,M=[{id:`show-me`,skill:`mate-show-me`,label:`Show me`,subject:`spec`,prompts:{claude:e=>`/mate-show-me ${e}`,opencode:e=>`Use the mate-show-me skill on spec ${e}.`}}];function N(e){return M.find(t=>t.id===e)??null}var P=e(t(),1),F=`unassigned`,I=e=>e??`(none)`;function L(e){return e.flatMap(e=>e.scopes.length===0?[{repository:null,area:F,spec:e}]:e.scopes.map(t=>({repository:t.repository??null,area:t.area??F,spec:e})))}function R(e,t){return e===t?0:e===null?1:t===null?-1:e.localeCompare(t)}var z=e=>new Set(e.map(e=>e.spec.capability)).size;function B(e,t){let n=L(e),r=Map.groupBy(n,e=>I(e.repository)),i=[...r.entries()].map(([e,t])=>({value:e,repository:t[0].repository,count:z(t)})).toSorted((e,t)=>R(e.repository,t.repository)),a=t!==void 0&&r.get(t)||n;return{repositories:i,areas:[...Map.groupBy(a,e=>`${I(e.repository)}\n${e.area}`).values()].map(e=>{let{repository:t,area:n}=e[0];return{repo:I(t),repository:t,area:n,count:z(e)}}).toSorted((e,t)=>R(e.repository,t.repository)||e.area.localeCompare(t.area))}}function V({repositories:e,areas:t},n){let r=n.q?.trim(),i=e.some(e=>e.value===n.repo)?n.repo:void 0,a=i!==void 0&&t.some(e=>e.area===n.area)?n.area:void 0;return{...r?{q:r}:{},...i===void 0?{}:{repo:i},...a===void 0?{}:{area:a}}}function H(e,t){if(t.repo!==void 0&&I(e.repository)!==t.repo||t.area!==void 0&&e.area!==t.area)return!1;if(!t.q)return!0;let n=t.q.toLowerCase();return e.spec.capability.toLowerCase().includes(n)||e.area.toLowerCase().includes(n)}function U(e,t={}){let n=L(e).filter(e=>H(e,t));return[...Map.groupBy(n,e=>I(e.repository)).values()].map(e=>({repository:e[0].repository,areas:[...Map.groupBy(e,e=>e.area)].map(([e,t])=>({area:e,specs:[...new Set(t.map(e=>e.spec))]})).toSorted((e,t)=>e.area.localeCompare(t.area))})).toSorted((e,t)=>R(e.repository,t.repository))}var W=n(),G=[];function K(e){return e.valid===!1?(0,W.jsx)(d,{marker:`issue`,children:`${e.issueCount??0} issues`}):e.valid===!0?(0,W.jsx)(d,{marker:`done`,children:`valid`}):(0,W.jsx)(d,{marker:`idle`,children:`unvalidated`})}var q=`.`,J=e=>e===q?k:e,Y=e=>e??`No repository`,ie=({repository:e,area:t})=>[e,t===void 0?void 0:J(t)].filter(Boolean).join(` · `),ae=200;function X(e){return e===void 0?`requirements unknown`:`${e} ${e===1?`requirement`:`requirements`}`}var oe={};function se({payload:e,actions:t=G,companion:n,filter:r=oe,onFilterChange:i}){let[a,o]=(0,P.useState)(r);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(T,{warnings:e.warnings}),(0,W.jsx)(pe,{specs:e.specs,actions:t,companion:n,filter:i?r:a,onFilterChange:i??o})]})}var Z={key:``,label:`All Areas`},ce=(e,t)=>e.key===t.key,le=e=>e.label;function ue({specs:e,options:{repositories:t,areas:n},filter:r,search:i,onSearch:a,onChange:o}){let s=r.repo!==void 0,c=[{value:``,label:`All repositories`},...t.map(e=>({value:e.value,label:`${Y(e.repository)} (${e.count})`}))],l=[Z,...n.map(e=>{let t=s?J(e.area):`${Y(e.repository)} · ${J(e.area)}`;return{key:`${e.repo}\n${e.area}`,label:`${t} (${e.count})`,option:e}})],u=l.find(e=>e.option?.repo===r.repo&&e.option?.area===r.area)??Z;return(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`search`,"aria-label":`Filter specs`,children:[(0,W.jsx)(p,{type:`search`,className:`w-64 max-sm:w-full`,placeholder:`Search capability or Area`,"aria-label":`Search specs`,value:i,onChange:e=>a(e.currentTarget.value)}),(0,W.jsxs)(m,{items:c,value:r.repo??``,onValueChange:t=>{let n=t||void 0,i=B(e,n).areas.some(e=>e.repo===n&&e.area===r.area);o({...r,repo:n,area:i?r.area:void 0})},children:[(0,W.jsx)(h,{className:`w-auto max-w-72`,"aria-label":`Repository`,children:(0,W.jsx)(g,{})}),(0,W.jsx)(_,{children:c.map(e=>(0,W.jsx)(v,{value:e.value,children:e.label},e.value))})]}),(0,W.jsxs)(w,{items:l,value:u,onValueChange:e=>o(e?.option?{...r,repo:e.option.repo,area:e.option.area}:{...r,area:void 0}),isItemEqualToValue:ce,itemToStringLabel:le,children:[(0,W.jsx)(b,{className:`w-80 max-sm:w-full`,"aria-label":`Area`,placeholder:`All Areas`}),(0,W.jsxs)(x,{children:[(0,W.jsx)(C,{children:`No Areas match`}),(0,W.jsx)(S,{children:e=>(0,W.jsx)(y,{value:e,children:e.label},e.key)})]})]})]})}var Q=`inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft`;function de({capability:e,actions:t}){return!re.test(e)||t.length===0?null:(0,W.jsx)(`span`,{className:`spec-actions flex flex-wrap items-center gap-1.5`,children:t.map(({action:t,runAgents:n,copyAgents:r})=>(0,W.jsxs)(P.Fragment,{children:[n.length>0?(0,W.jsxs)(`button`,{type:`button`,className:i(Q,`spec-action`),"data-studio-action":t.id,"data-studio-subject":e,"data-studio-agents":n.join(` `),children:[(0,W.jsx)(a,{name:`play`,className:`size-3.5`}),t.label]}):null,(0,W.jsxs)(`button`,{type:`button`,className:i(Q,`spec-copy`),"aria-label":`Copy prompt`,"data-studio-copy-prompt":t.id,"data-prompt-claude":r.includes(`claude`)?t.prompts.claude(e):void 0,"data-prompt-opencode":r.includes(`opencode`)?t.prompts.opencode(e):void 0,children:[(0,W.jsx)(a,{name:`copy`,className:`size-3.5`}),`Copy prompt`]})]},t.id))})}function fe({specs:e,open:t,onOpen:n}){return(0,W.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:i(l,`grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t===e.capability?`true`:void 0,"data-spec":e.capability,onClick:()=>n(e.capability),children:[(0,W.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.capability}),e.valid===!0?(0,W.jsx)(`span`,{}):K(e),(0,W.jsx)(`span`,{className:`text-right text-xs text-muted tabular-nums max-sm:hidden`,children:X(e.requirementCount)})]})},e.capability))})}function pe({specs:e,actions:t,companion:n,filter:r,onFilterChange:a}){let[o,s]=(0,P.useState)(r.q??``),[l,d]=(0,P.useState)(r.q);r.q!==l&&(d(r.q),(r.q??``)!==o.trim()&&s(r.q??``));let p=(0,P.useRef)(void 0);(0,P.useEffect)(()=>()=>clearTimeout(p.current),[]);let m=B(e,r.repo),h=V(m,{...r,q:o}),g=e=>{clearTimeout(p.current),a(e)},_=e=>{s(e),clearTimeout(p.current),p.current=setTimeout(()=>a({...h,q:e.trim()}),ae)},v=()=>{s(``),g({})},y=U(e,h),[b,x]=(0,P.useState)(null),S=[...new Set(y.flatMap(e=>e.areas.flatMap(e=>e.specs.map(e=>e.capability))))],C=e.find(e=>e.capability===b)??null;return(0,W.jsxs)(`section`,{className:i(c,`grid content-start gap-3 pb-10`),"aria-label":`Specs by repository and Area`,children:[e.length===0?(0,W.jsx)(u,{children:`No specs in this companion.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{specs:e,options:m,filter:h,search:o,onSearch:_,onChange:e=>g({...e,q:o.trim()})}),y.length===0?(0,W.jsxs)(u,{className:`flex flex-wrap items-center gap-3`,children:[`No spec matches the search and filters.`,(0,W.jsx)(`button`,{type:`button`,className:Q,onClick:v,children:`Clear filters`})]}):y.map(e=>(0,W.jsxs)(`section`,{className:`grid content-start gap-3`,"aria-label":`Repository ${Y(e.repository)}`,children:[(0,W.jsx)(`h2`,{className:`m-0 mt-2 font-mono text-sm font-semibold text-muted`,children:Y(e.repository)}),e.areas.map(({area:e,specs:t})=>(0,W.jsx)(f,{level:3,title:e===q?J(e):(0,W.jsx)(`span`,{className:`font-mono`,children:e}),label:`Area ${e}`,count:t.length,children:(0,W.jsx)(fe,{specs:t,open:b,onOpen:x})},e))]},e.repository??``))]}),(0,W.jsx)(te,{items:S,current:C?.capability??null,onSelect:x,wide:!0,title:C?`Spec ${C.capability}`:`Spec`,children:C?(0,W.jsx)($,{spec:C,actions:t,companion:n}):null})]})}function $({spec:e,actions:t=G,companion:n,withStatus:i=!0,children:c}){let l=ne(e.capability),u=r({...s(n??``,{path:l}),enabled:!!n}),d=u.data?.open?.markdown;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(E,{mono:!0,title:e.capability,kicker:(0,W.jsxs)(W.Fragment,{children:[i?K(e):null,(0,W.jsx)(`span`,{className:`ml-auto`,children:e.scopes.map(ie).join(`, `)})]}),children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(de,{capability:e.capability,actions:t}),(0,W.jsxs)(o,{className:`inline-flex items-center gap-1.5 text-sm`,to:`/vault`,search:e=>({companion:e.companion,studioMode:e.studioMode,path:l}),children:[(0,W.jsx)(a,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]})}),c,(0,W.jsx)(ee,{title:`Spec`,aside:e.requirementCount===void 0?void 0:X(e.requirementCount),children:d?(0,W.jsx)(`div`,{className:`prose-panel`,children:(0,W.jsx)(D,{nodes:d})}):(0,W.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:u.isError?`The spec file could not be read.`:u.isPending&&n?`Loading…`:`The spec file could not be read.`})})]})}export{k as a,O as i,se as n,j as o,N as r,A as s,$ as t};
@@ -0,0 +1 @@
1
+ import{Tr as e}from"./button-Br0O1sXw.js";import{t}from"./jsx-runtime-MZURdZre.js";var n=t();function r({className:t,...r}){return(0,n.jsx)(`svg`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,className:e(`size-4 shrink-0 animate-spin motion-reduce:animate-none`,t),...r,children:(0,n.jsx)(`path`,{d:`M12 3a9 9 0 1 1-9 9`})})}export{r as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,d as n,o as r,s as i}from"./studio-Cpz_HRHp.js";var a=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],o={"mate-clarify-intent":`Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.`,"mate-interview-me":`Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.`,"mate-grill-me":`Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks.`},s={"clarify-intent":{what:`Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.`,why:`Intent gaps are cheapest to close before exploration turns them into documents.`},explore:{what:`Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.`,why:`It separates uncertainty from the proposal's committed scope.`},propose:{what:`Chooses the schema from the minimal eligibility test, checks slicing when explore agreed none, and writes the change's planning artifacts in one prompt.`,why:`One prompt writes every artifact; each one is then reviewed on its own.`},apply:{what:`Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.`,why:`The recorded branch is what archive and publication later wait on.`},"inspect-outcome":{what:`Shows what the applied change did as a rendered diagram and diff in a Mate report.`,why:`Seeing the result tells the reviewer whether cleanup is warranted.`},"refine-code":{what:`Looks for smaller, clearer code once tests pass, preserving behavior.`,why:`Cleanup lands before archive, so shipped code and recorded specs agree.`},archive:{what:`Applies the delta specs to the local canonical specs and records the delivery; allowed before the branch merges.`,why:`A feature's later changes build on canonical specs that already include this one.`},publish:{what:`Commits, tags, and pushes archived changes whose delivery branches are merged, chosen by the developer.`,why:`Published canonical specs then describe the default branch; unmerged archives wait.`}};function c(e,t,n){return{what:(t?.schemaName===n?t.artifacts.find(t=>t.id===e)?.description:void 0)??`A person reviews the ${e} artifact.`,why:`Reviews stay with people: Mate never marks them approved.`}}function l(e,r){if(e.kind===`human`)return null;if(e.id===`clarify-intent`)return`/${e.skill} about ${n}`;let i=e.id===`propose`&&r!==`mate-v1`?` (use schema: ${r})`:``;return`/${e.skill}${i} for ${t}`}function u(e){return e&&e.replace(` ${t}`,``).replace(` ${n}`,``)}function d(e){return a.filter(e).map(e=>({name:e,description:o[e],prompt:`/${e} about ${n}`,copyPrompt:`/${e} about`}))}var f=new Set([`explore`,`propose`,`apply`,`archive`]);function p(e){if(e.kind===`human`)return[`human-review`];let t=e.optional?[`optional`,`skill`]:[`skill`];return f.has(e.id)&&t.push(`openspec`),t}var m={"mate-v1":{tagline:`full planning`,description:`Full planning path: proposal, specs, design, and tasks.`},"mate-minimal":{tagline:`minimal planning`,description:`Short path: specs and tasks only, for one-Area, low-risk changes with clear intent.`}};function h(e){return i(e)?m[e]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var g={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`};function _(e,t){return e.kind===`human`?`review`:e.id===`apply`||t===`build`&&e.optional?`build`:t===void 0||t===`plan`?`plan`:`ship`}function v(e){return e.kind===`human`?`human`:e.optional?`optional`:null}function y(e){let t=[];for(let n of e){let e=v(n),r=t.at(-1);e&&r?.group===e?r.steps.push(n):t.push({group:e,steps:[n]})}return t.map(e=>e.group===`human`||e.group===`optional`&&e.steps.length>1?{kind:`group`,group:e.group,steps:e.steps}:{kind:`stage`,step:e.steps[0]})}function b(e,t,n){let i=n.skills?new Set(n.skills):null,a=e=>!i||i.has(e),o=r(t),f=[];for(let t of o.stages){let r=t.kind===`human`?c(t.artifact,n.topology,e):s[t.id],i=l(t,e),o=f.at(-1),m={...t,what:r.what,why:r.why,badges:p(t),prompt:i,copyPrompt:u(i),phase:_(t,o?.phase)};t.id===`clarify-intent`&&(m.alternatives=d(a)),t.kind===`skill`&&!a(t.skill)&&(m.missingSkill=t.skill),t.id===`apply`&&(m.sessionBreakBefore=!0),f.push(m)}return{schema:e,label:e,...h(e),steps:f,map:y(f),reviewsKnown:o.reviewsKnown}}function x(t,n){return n?.schemaName===t?n.artifacts.map(e=>e.id):i(t)?e[t]:void 0}function S(t={}){let n=t.topology?.schemaName;return{paths:(n&&!i(n)?[n]:Object.keys(e)).map(e=>b(e,x(e,t.topology),t))}}export{S as n,g as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$ as r,Tr as i,_r as a,et as o,i as s}from"./button-Br0O1sXw.js";var c=e(t(),1),l=n();function u({title:e,description:t,actions:n}){return(0,l.jsxs)(`header`,{className:`page-header flex flex-wrap items-end gap-x-4 gap-y-2 px-6 pt-5 pb-1 max-sm:px-4`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`h1`,{className:`m-0 text-xl font-semibold tracking-[-0.015em]`,children:e}),(0,l.jsx)(`p`,{className:`m-0 mt-0.5 text-sm text-muted`,children:t})]}),n?(0,l.jsx)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:n}):null]})}var d=`px-6 max-sm:px-4`,f={warn:`text-warn`,bad:`text-bad`,accent:`text-accent`,why:`text-why`,muted:`text-muted`};function p({value:e,tone:t,className:n,label:r}){return(0,l.jsx)(`span`,{className:i(`count inline-grid h-[18px] min-w-[18px] flex-none place-items-center rounded-full px-1.5 font-mono text-2xs leading-none font-medium tabular-nums`,t===`warn`&&e>0?`bg-warn-soft text-warn`:`bg-[color-mix(in_srgb,var(--muted)_16%,transparent)] text-muted`,n),"aria-label":r,children:e})}function m({title:e,count:t,hint:n,tone:r,children:a,className:o,label:s,level:c=2}){let u=c===3?`h3`:`h2`;return(0,l.jsxs)(`section`,{className:i(`list-card overflow-hidden rounded-card border border-rule`,o),"aria-label":s??(typeof e==`string`?e:void 0),children:[(0,l.jsxs)(`div`,{className:i(`list-card-head flex items-center gap-2.5 border-b border-rule bg-surface px-4 py-2 text-[0.9rem] font-semibold`,r?f[r]:null),children:[(0,l.jsx)(u,{className:`m-0 text-[inherit] font-[inherit]`,children:e}),t===void 0?null:(0,l.jsx)(p,{value:t,tone:r===`warn`?`warn`:void 0}),n?(0,l.jsx)(`span`,{className:`ml-auto text-xs font-normal text-muted`,children:n}):null]}),a]})}var h=`list-row flex w-full min-w-0 items-center gap-4 border-0 border-t border-rule-soft bg-transparent px-4 py-2 text-left text-base text-text no-underline transition-colors first:border-t-0 hover:bg-surface aria-[current=true]:bg-surface aria-[current=true]:shadow-[inset_2px_0_0_var(--accent)]`;function g({label:e,options:t,value:n,onChange:i,className:a}){return(0,l.jsx)(r,{"aria-label":e,value:[n],onValueChange:e=>{let t=e[0];t&&i(t)},className:a,children:t.map(e=>(0,l.jsxs)(o,{value:e.value,children:[e.label,e.count===void 0?null:(0,l.jsx)(p,{value:e.count,tone:e.tone===`warn`?`warn`:void 0})]},e.value))})}var _={review:`rotate-45 rounded-[2px] size-[7px] bg-why`,build:`rotate-45 rounded-[2px] size-[7px] bg-accent`,done:`rounded-full size-2 bg-accent`,issue:`rounded-[1px] size-2 bg-bad`,idle:`rounded-full size-2 ring-[1.5px] ring-muted ring-inset`,warn:`rounded-full size-2 bg-warn`},v={review:`text-why`,build:`text-accent`,done:`text-accent`,issue:`text-bad`,idle:`text-muted`,warn:`text-warn`};function y({marker:e,children:t}){return(0,l.jsxs)(`span`,{className:i(`status-word inline-flex items-center gap-2 text-xs whitespace-nowrap`,v[e]),children:[(0,l.jsx)(`span`,{className:i(`flex-none`,_[e]),"aria-hidden":`true`}),t]})}function b({done:e,total:t,unit:n=`tasks`}){if(t===0)return(0,l.jsxs)(`span`,{className:`text-xs text-muted`,children:[`No `,n]});let r=Math.min(100,Math.round(e/t*100)),i=`${e} of ${t} ${n}`;return(0,l.jsxs)(`span`,{className:`grid min-w-[120px] gap-1.5 text-xs text-muted`,children:[(0,l.jsx)(`span`,{children:i}),(0,l.jsx)(`span`,{className:`relative block h-1 w-full max-w-[140px] overflow-hidden rounded-full bg-rule`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"aria-label":i,children:(0,l.jsx)(`span`,{className:`absolute inset-y-0 left-0 rounded-full bg-accent`,style:{width:`${r}%`}})})]})}var x=()=>()=>{};function S({at:e,className:t}){let n=(0,c.useSyncExternalStore)(x,()=>e===void 0?``:C(e,Date.now()),()=>``);if(e===void 0)return null;let r=new Date(e);return Number.isNaN(r.getTime())?null:(0,l.jsx)(`time`,{dateTime:r.toISOString(),className:i(`font-mono text-xs whitespace-nowrap text-muted`,t),children:n})}function C(e,t){let n=Math.max(0,Math.round((t-new Date(e).getTime())/1e3));return n<60?`just now`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function w({children:e,className:t}){return(0,l.jsx)(`p`,{className:i(`empty m-0 rounded-card border border-dashed border-rule px-5 py-5 text-base text-muted`,t),children:e})}function T({text:e,copy:t=e,label:n=`prompt`}){return(0,l.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-control border border-rule bg-page py-1.5 pr-1.5 pl-3 font-mono text-xs`,children:[(0,l.jsx)(`code`,{className:`min-w-0 flex-1 truncate`,children:e}),(0,l.jsx)(`button`,{type:`button`,className:`inline-flex h-7 flex-none items-center rounded-[6px] border border-rule bg-surface px-2.5 font-sans text-xs text-text hover:border-accent hover:bg-accent-soft`,"data-copy":t,"data-copy-label":n,children:`Copy`})]})}function E(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new s({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:a,inactiveTriggerProps:a,popupProps:a}}var D=e=>e.triggerIdProp??e.activeTriggerId,O=e=>e.openProp??e.open,k=e=>(e.popupElement?.id??e.floatingId)||void 0;function A(e,t){return t!==void 0&&O(e)&&D(e)===t}function j(e,t){return A(e,t)?!0:t!==void 0&&O(e)&&D(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var M={open:O,mounted:e=>e.mounted,transitionStatus:e=>O(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:D,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:k,isTriggerActive:(e,t)=>t!==void 0&&D(e)===t,isOpenedByTrigger:(e,t)=>A(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&D(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>j(e,t)?k(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{p as a,d as c,b as d,h as f,T as i,u as l,M as n,w as o,y as p,S as r,m as s,E as t,g as u};
@@ -0,0 +1,100 @@
1
+ import{r as e}from"./jsx-runtime-MZURdZre.js";e(((e,t)=>{t.exports={}}))();var t=[`engineering`,`analysis`],n={engineering:[`dashboard`,`factory`,`workflow`,`skills`,`getting-started`],analysis:[`dashboard`]},r=[`vault`,`specs`,`reports`,`graph`,`usage`];function i(e){return[...n[e],...r]}var a={standard:Object.freeze({profile:`standard`,enabled:Object.freeze([`engineering`,`analysis`]),defaultMode:`engineering`}),appliance:Object.freeze({profile:`appliance`,enabled:Object.freeze([`analysis`]),defaultMode:`analysis`})};function o(e=`standard`){return a[e]}o(`standard`);var s={"product-engineer":`engineering`,"business-analyst":`analysis`},c=`companion`,l=`studioMode`,u=`role`,d=`<change-name>`,f=`<idea>`,p=RegExp(`^[0-9a-f]{10}$`);function m(e){let n=e.get(l);if(n!==null)return t.includes(n)?n:null;let r=e.get(`role`)??``;return Object.hasOwn(s,r)?s[r]:null}function h(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var g=h();function _(e){g=e}var v={exec:()=>null};function y(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function b(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(S.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var x=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),S={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:y(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:y(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:y(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:y(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:y(e=>RegExp(`^ {0,${e}}(?:</?(?:${pe})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:y(e=>RegExp(`^ {0,${e}}>`))},ee=/^(?:[ \t]*(?:\n|$))+/,te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ne=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,re=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ie=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ae=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=b(ae).replace(/bull/g,ie).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),se=b(ae).replace(/bull/g,ie).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,le=/^[^\n]+/,ue=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,de=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ue).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fe=b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ie).getRegex(),pe=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,he=b(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,me).replace(`tag`,pe).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=e=>b(ce).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,pe).getRegex(),_e=ge(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ve=ge(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ye={blockquote:b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ve).getRegex(),code:te,def:de,fences:ne,heading:re,hr:C,html:he,lheading:oe,list:fe,newline:ee,paragraph:_e,table:v,text:le},be=b(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,pe).getRegex(),xe={...ye,lheading:se,table:be,paragraph:b(ce).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,be).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,pe).getRegex()},Se={...ye,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,me).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:v,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(ce).replace(`hr`,C).replace(`heading`,` *#{1,6} *[^
2
+ ]`).replace(`lheading`,oe).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ce=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,we=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Te=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,w=/[\p{P}\p{S}]/u,T=/[\s\p{P}\p{S}]/u,E=/[^\s\p{P}\p{S}]/u,De=b(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,T).getRegex(),Oe=/[\p{Pi}\p{Ps}"']/u,ke=/(?!~)[\p{P}\p{S}]/u,Ae=/(?!~)[\s\p{P}\p{S}]/u,je=/(?:[^\s\p{P}\p{S}]|~)/u,Me=b(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,x?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ne=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Pe=b(Ne,`u`).replace(/punct/g,w).getRegex(),Fe=b(Ne,`u`).replace(/punct/g,ke).getRegex(),Ie=b(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Oe).replace(/punct/g,w).getRegex(),Le=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Re=b(Le,`gu`).replace(/notPunctSpace/g,E).replace(/punctSpace/g,T).replace(/punct/g,w).getRegex(),ze=b(Le,`gu`).replace(/notPunctSpace/g,je).replace(/punctSpace/g,Ae).replace(/punct/g,ke).getRegex(),Be=b(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,E).replace(/punctSpace/g,T).replace(/punct/g,w).getRegex(),Ve=b(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,E).replace(/punctSpace/g,T).replace(/punct/g,w).getRegex(),He=b(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,E).replace(/punctSpace/g,T).replace(/punct/g,w).getRegex(),Ue=b(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,w).getRegex(),We=b(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,E).replace(/punctSpace/g,T).replace(/punct/g,w).getRegex(),Ge=b(/\\(punct)/,`gu`).replace(/punct/g,w).getRegex(),Ke=b(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,w).getRegex(),qe=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Je=b(me).replace(`(?:-->|$)`,`-->`).getRegex(),Ye=b(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Je).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xe=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ze=b(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Xe).getRegex(),Qe=b(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Ze).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$e=b(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ze).replace(`ref`,ue).getRegex(),et=b(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ue).getRegex(),tt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,nt=b(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Xe).getRegex(),rt=b(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,b(/^!?\[(label)\]\[(ref)\]/).replace(`label`,nt).replace(`ref`,tt).getRegex()).replace(`nolink`,b(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,tt).getRegex()).getRegex(),it=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,at=b(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),ot={_backpedal:v,anyPunctuation:Ge,anyPunctuationOutsideCode:Ke,autolink:qe,blockSkip:Me,br:Te,code:we,del:v,delLDelim:v,delRDelim:v,emStrongLDelim:Pe,emStrongRDelimAst:Re,emStrongRDelimUnd:Ve,escape:Ce,link:Qe,nolink:et,punctuation:De,reflink:$e,reflinkSearch:rt,tag:Ye,text:Ee,url:v},st={...ot,emStrongLDelim:Ie,emStrongRDelimAst:Be,emStrongRDelimUnd:He,link:b(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ze).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ze).getRegex()},ct={...ot,emStrongRDelimAst:ze,emStrongLDelim:Fe,delLDelim:Ue,delRDelim:We,url:b(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,at).replace(`protocol`,it).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:b(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,it).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},lt={...ct,br:b(Te).replace(`{2,}`,`*`).getRegex(),text:b(ct.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ut={normal:ye,gfm:xe,pedantic:Se},D={normal:ot,gfm:ct,breaks:lt,pedantic:st},dt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},ft=e=>dt[e];function O(e,t){if(t){if(S.escapeTest.test(e))return e.replace(S.escapeReplace,ft)}else if(S.escapeTestNoEncode.test(e))return e.replace(S.escapeReplaceNoEncode,ft);return e}function pt(e){return S.numericCharacterReference.test(e)?e.replace(S.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function mt(e){try{e=encodeURI(e).replace(S.percentDecode,`%`)}catch{return null}return e}function ht(e,t){let n=e.replace(S.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(S.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(S.slashPipe,`|`);return n}function k(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function gt(e){let t=e.split(`
3
+ `),n=t.length-1;for(;n>=0&&S.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
4
+ `)}function _t(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function vt(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function yt(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function bt(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function xt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
5
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
6
+ `)}function St(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Ct=class{options;rules;lexer;constructor(e){this.options=e||g}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:gt(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=xt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=k(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:k(t[0],`
7
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:k(t[0],`
8
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=k(t[0],`
9
+ `).split(`
10
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
11
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
12
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
13
+ ${s}`:s,r=r?`${r}
14
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
15
+ `),o=t.raw+`
16
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
17
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
18
+ ${d.join(`
19
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
20
+ `+e.join(`
21
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
22
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
23
+ `,1)[0],d=t[1].length,f=this.options.pedantic?yt(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>yt(e,d)),p=e.split(`
24
+ `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
25
+ `,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>yt(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
26
+ `+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
27
+ `+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=gt(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&vt(t[2],`()`)!==-1)return;let e=_t(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:k(t[0],`
28
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ht(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
29
+ `):[],a={type:`table`,raw:k(t[0],`
30
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ht(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:k(t[0],`
31
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
32
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&St(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=k(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=vt(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),bt(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&St(e,n[1],r,this.rules))return;let i=t[_t((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return bt(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:pt(t[0]),escaped:e}}}},A=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||g,this.options.tokenizer=this.options.tokenizer||new Ct,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:S,block:ut.normal,inline:D.normal};this.options.pedantic?(t.block=ut.pedantic,t.inline=D.pedantic):this.options.gfm&&(t.block=ut.gfm,t.inline=this.options.breaks?D.breaks:D.gfm),this.tokenizer.rules=t}static get rules(){return{block:ut,inline:D}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(S.carriageReturn,`
33
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(S.tabCharGlobal,` `).replace(S.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
34
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
35
+ `)?``:`
36
+ `)+i.raw,n.text+=`
37
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
38
+ `)?``:`
39
+ `)+i.raw,n.text+=`
40
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
41
+ `)?``:`
42
+ `)+i.raw,r.text+=`
43
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
44
+ `)?``:`
45
+ `)+i.raw,n.text+=`
46
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,_t(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,_t(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},wt=class{options;parser;constructor(e){this.options=e||g}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(S.notSpaceStart)?.[0],i=e?e.replace(S.endingNewline,``)+`
47
+ `:``;return r?`<pre><code class="language-`+O(r)+`">`+(n?i:O(i,!0))+`</code></pre>
48
+ `:`<pre><code>`+(n?i:O(i,!0))+`</code></pre>
49
+ `}blockquote({tokens:e}){return`<blockquote>
50
+ ${this.parser.parse(e)}</blockquote>
51
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
52
+ `}hr(e){return`<hr>
53
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
54
+ `+r+`</`+i+`>
55
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
56
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
57
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
58
+ <thead>
59
+ `+t+`</thead>
60
+ `+r+`</table>
61
+ `}tablerow({text:e}){return`<tr>
62
+ ${e}</tr>
63
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
64
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${O(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?O(n,!0):this.parser.parseInline(r),o=mt(e);if(o===null)return a;e=O(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+O(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=mt(e);if(i===null)return O(n);e=i;let a=`<img src="${O(e)}" alt="${O(n)}"`;return t&&(a+=` title="${O(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:O(e.text)}},Tt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},j=class e{options;renderer;textRenderer;constructor(e){this.options=e||g,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tt}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},M=class{options;block;constructor(e){this.options=e||g}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?A.lex:A.lexInline}provideParser(e=this.block){return e?j.parse:j.parseInline}};function N(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var P=new class{defaults=h();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=j;Renderer=wt;TextRenderer=Tt;Lexer=A;Tokenizer=Ct;Hooks=M;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(N(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)N(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)N(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;N(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);N(n,this.walkTokens(i,t))}):e.tokens&&N(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new wt(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Ct(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new M;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=M.passThroughHooks.has(n)?e=>{if(this.defaults.async&&M.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&N(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return A.lex(e,t??this.defaults)}parser(e,t){return j.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?A.lex:A.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?j.parse:j.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?A.lex:A.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?j.parse:j.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
65
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+O(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function F(e,t){return P.parse(e,t)}F.options=F.setOptions=function(e){return P.setOptions(e),F.defaults=P.defaults,_(F.defaults),F},F.getDefaults=h,F.defaults=g;function Et(...e){return P.use(...e),F.defaults=P.defaults,_(F.defaults),F}F.use=Et,F.walkTokens=function(e,t){return P.walkTokens(e,t)},F.parseInline=P.parseInline,F.Parser=j,F.parser=j.parse,F.Renderer=wt,F.TextRenderer=Tt,F.Lexer=A,F.lexer=A.lex,F.Tokenizer=Ct,F.Hooks=M,F.parse=F,F.options,F.setOptions,F.walkTokens,F.parseInline,j.parse,A.lex;var Dt=Symbol.for(`yaml.alias`),Ot=Symbol.for(`yaml.document`),I=Symbol.for(`yaml.map`),kt=Symbol.for(`yaml.pair`),At=Symbol.for(`yaml.scalar`),jt=Symbol.for(`yaml.seq`),L=Symbol.for(`yaml.node.type`),R=e=>!!e&&typeof e==`object`&&e[L]===Dt,Mt=e=>!!e&&typeof e==`object`&&e[L]===Ot,Nt=e=>!!e&&typeof e==`object`&&e[L]===I,z=e=>!!e&&typeof e==`object`&&e[L]===kt,B=e=>!!e&&typeof e==`object`&&e[L]===At,Pt=e=>!!e&&typeof e==`object`&&e[L]===jt;function V(e){if(e&&typeof e==`object`)switch(e[L]){case I:case jt:return!0}return!1}function H(e){if(e&&typeof e==`object`)switch(e[L]){case Dt:case I:case At:case jt:return!0}return!1}var Ft=e=>(B(e)||V(e))&&!!e.anchor,U=Symbol(`break visit`),It=Symbol(`skip children`),Lt=Symbol(`remove node`);function Rt(e,t){let n=zt(t);Mt(e)?W(null,e.contents,n,Object.freeze([e]))===Lt&&(e.contents=null):W(null,e,n,Object.freeze([]))}Rt.BREAK=U,Rt.SKIP=It,Rt.REMOVE=Lt;function W(e,t,n,r){let i=Bt(e,t,n,r);if(H(i)||z(i))return Vt(e,r,i),W(e,i,n,r);if(typeof i!=`symbol`){if(V(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=W(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===U)return U;else i===Lt&&(t.items.splice(e,1),--e)}}else if(z(t)){r=Object.freeze(r.concat(t));let e=W(`key`,t.key,n,r);if(e===U)return U;e===Lt&&(t.key=null);let i=W(`value`,t.value,n,r);if(i===U)return U;i===Lt&&(t.value=null)}}return i}function zt(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Bt(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Nt(t))return n.Map?.(e,t,r);if(Pt(t))return n.Seq?.(e,t,r);if(z(t))return n.Pair?.(e,t,r);if(B(t))return n.Scalar?.(e,t,r);if(R(t))return n.Alias?.(e,t,r)}function Vt(e,t,n){let r=t[t.length-1];if(V(r))r.items[e]=n;else if(z(r))e===`key`?r.key=n:r.value=n;else if(Mt(r))r.contents=n;else{let e=R(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function Ht(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Ut(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Ut(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Ut(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Ut(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Ut(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function G(e,t,n){if(Array.isArray(e))return e.map((e,t)=>G(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Ft(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Wt=class{constructor(e){Object.defineProperty(this,L,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Mt(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=G(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Ut(i,{"":o},``,o):o}},Gt=class extends Wt{constructor(e){super(Dt),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Rt(e,{Node:(e,t)=>{(R(t)||Ft(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(G(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Kt(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Ht(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Kt(e,t,n){if(R(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(V(t)){let r=0;for(let i of t.items){let t=Kt(e,i,n);t>r&&(r=t)}return r}if(z(t)){let r=Kt(e,t.key,n),i=Kt(e,t.value,n);return Math.max(r,i)}return 1}var qt=e=>!e||typeof e!=`function`&&typeof e!=`object`,K=class extends Wt{constructor(e){super(At),this.value=e}toJSON(e,t){return t?.keep?this.value:G(this.value,e,t)}toString(){return String(this.value)}};K.BLOCK_FOLDED=`BLOCK_FOLDED`,K.BLOCK_LITERAL=`BLOCK_LITERAL`,K.PLAIN=`PLAIN`,K.QUOTE_DOUBLE=`QUOTE_DOUBLE`,K.QUOTE_SINGLE=`QUOTE_SINGLE`;var Jt=`tag:yaml.org,2002:`;function Yt(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Xt(e,t,n){if(Mt(e)&&(e=e.contents),H(e))return e;if(z(e)){let t=n.schema[I].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new Gt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Jt+t.slice(2));let l=Yt(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new K(e);return c&&(c.node=t),t}l=e instanceof Map?o[I]:Symbol.iterator in Object(e)?o[jt]:o[I]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new K(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zt(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Xt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Qt=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,$t=class extends Wt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>H(t)||z(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Qt(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(V(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Zt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(V(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&B(i)?i.value:i:V(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!z(t))return!1;let n=t.value;return n==null||e&&B(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return V(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(V(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Zt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},en=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function tn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var q=(e,t,n)=>e.endsWith(`
66
+ `)?tn(n,t):n.includes(`
67
+ `)?`
68
+ `+tn(n,t):(e.endsWith(` `)?``:` `)+n,nn=`flow`,rn=`block`,an=`quoted`;function on(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=sn(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
69
+ `)n===`block`&&(h=sn(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
70
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
71
+ `&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function sn(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
72
+ `);r=t,i=t+1,a=e[i]}return r}var cn=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ln=e=>/^(%|---|\.\.\.)/m.test(e);function un(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
73
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function dn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ln(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
74
+
75
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
76
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:on(o,a,an,cn(t,!1))}function fn(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
77
+ `)||/[ \t]\n|\n[ \t]/.test(e))return dn(e,t);let n=t.indent||(ln(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:on(r,n,nn,cn(t,!1))}function J(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=dn;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?fn:i&&!t?dn:n?fn:dn}return r(e,t)}var pn;try{pn=RegExp(`(^|(?<!
78
+ ))
79
+ +(?!
80
+ |$)`,`g`)}catch{pn=/\n+(?!\n|$)/g}function mn({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return J(n,r);let l=r.indent||(r.forceBlockIndent||ln(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===K.BLOCK_FOLDED?!1:t===K.BLOCK_LITERAL||!un(n,c,l.length);if(!n)return u?`|
81
+ `:`>
82
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
83
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
84
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
85
+ `&&(p=p.slice(0,-1)),p.replace(pn,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
86
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
87
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=cn(r,!0);o!==`folded`&&t!==K.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=on(`${v}${e}${p}`,l,rn,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function hn(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
88
+ `)||u&&/[[\]{},]/.test(a))return J(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
89
+ `)?J(a,t):mn(e,t,n,r);if(!s&&!u&&i!==K.PLAIN&&a.includes(`
90
+ `))return mn(e,t,n,r);if(ln(a)){if(c===``)return t.forceBlockIndent=!0,mn(e,t,n,r);if(s&&c===l)return J(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return J(a,t)}return s?d:on(d,c,nn,cn(t,!1))}function gn(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==K.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=K.QUOTE_DOUBLE);let c=e=>{switch(e){case K.BLOCK_FOLDED:case K.BLOCK_LITERAL:return i||a?J(o.value,t):mn(o,t,n,r);case K.QUOTE_DOUBLE:return dn(o.value,t);case K.QUOTE_SINGLE:return fn(o.value,t);case K.PLAIN:return hn(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function _n(e,t){let n=Object.assign({blockQuote:!0,commentString:en,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function vn(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(B(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function yn(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(B(e)||V(e))&&e.anchor;a&&Ht(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function bn(e,t,n,r){if(z(e))return e.toString(t,n,r);if(R(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=H(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=vn(t.doc.schema.tags,a);let o=yn(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):B(a)?gn(a,t,n,r):a.toString(t,n,r);return o?B(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function xn({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=H(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(V(e)||!H(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||V(e)||(B(e)?e.type===K.BLOCK_FOLDED||e.type===K.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=bn(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=q(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=q(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=q(g,n.indent,l(f))));let _,v,y;H(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&B(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Pt(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=bn(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
91
+ `:``,v){let e=l(v);S+=`\n${tn(e,n.indent)}`}x===``&&!n.inFlow?S===`
92
+ `&&y&&(S=`
93
+
94
+ `):S+=`\n${n.indent}`}else if(!p&&V(t)){let e=x[0],r=x.indexOf(`
95
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
96
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=q(g,n.indent,l(y)):h&&i&&i(),g}function Sn(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Cn=`<<`,wn={identify:e=>e===Cn||typeof e==`symbol`&&e.description===Cn,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new K(Symbol(Cn)),{addToJSMap:En}),stringify:()=>Cn},Tn=(e,t)=>(wn.identify(t)||B(t)&&(!t.type||t.type===K.PLAIN)&&wn.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===wn.tag&&e.default);function En(e,t,n){let r=On(e,n);if(Pt(r))for(let n of r.items)Dn(e,t,n);else if(Array.isArray(r))for(let n of r)Dn(e,t,n);else Dn(e,t,r)}function Dn(e,t,n){let r=On(e,n);if(!Nt(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function On(e,t){return e&&R(t)?t.resolve(e.doc,e):t}function kn(e,t,{key:n,value:r}){if(H(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Tn(e,n))En(e,t,r);else{let i=G(n,``,e);if(t instanceof Map)t.set(i,G(r,i,e));else if(t instanceof Set)t.add(i);else{let a=An(n,i,e),o=G(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function An(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(H(e)&&n?.doc){let t=_n(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Sn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function jn(e,t,n){return new Y(Xt(e,void 0,n),Xt(t,void 0,n))}var Y=class e{constructor(e,t=null){Object.defineProperty(this,L,{value:kt}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return H(n)&&(n=n.clone(t)),H(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return kn(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?xn(this,e,t,n):JSON.stringify(this)}};function Mn(e,t,n){return(t.inFlow??e.flow?Pn:Nn)(e,t,n)}function Nn({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(H(i))!d&&i.spaceBefore&&f.push(``),Fn(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(z(i)){let e=H(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Fn(n,f,e.commentBefore,d))}d=!1;let s=bn(i,u,()=>o=null,()=>d=!0);o&&(s+=q(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
97
+ `}}return e?(p+=`
98
+ `+tn(l(e),c),s&&s()):d&&o&&o(),p}function Pn({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(H(i))i.spaceBefore&&d.push(``),Fn(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(z(i)){let e=H(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Fn(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=H(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=bn(i,c,()=>a=null);l||=d.length>u||o.includes(`
99
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=q(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
100
+ `;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Fn({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=tn(t(r),e);n.push(i.trimStart())}}function X(e,t){let n=B(t)?t.value:t;for(let r of e)if(z(r)&&(r.key===t||r.key===n||B(r.key)&&r.key.value===n))return r}var Z=class extends $t{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(I,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(jn(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=z(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Y(e,e?.value):new Y(e.key,e.value);let r=X(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);B(r.value)&&qt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=X(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=X(this.items,e)?.value;return(!t&&B(n)?n.value:n)??void 0}has(e){return!!X(this.items,e)}set(e,t){this.add(new Y(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)kn(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!z(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Mn(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},In={collection:`map`,default:!0,nodeClass:Z,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Nt(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Z.from(e,t,n)},Ln=class extends $t{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(jt,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Rn(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Rn(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&B(r)?r.value:r}has(e){let t=Rn(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Rn(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];B(r)&&qt(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(G(e,String(r++),t));return n}toString(e,t,n){return e?Mn(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Xt(a,void 0,n))}}return i}};function Rn(e){let t=B(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var zn={collection:`seq`,default:!0,nodeClass:Ln,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Pt(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Ln.from(e,t,n)};function Bn(e){return typeof e==`bigint`||Number.isInteger(e)}var Vn=({value:e})=>JSON.stringify(e),Hn=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Vn},{identify:e=>e==null,createNode:()=>new K(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Vn},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Vn},{identify:Bn,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Bn(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Vn}];[In,zn].concat(Hn,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Un(e,t,n){let{replacer:r}=n,i=new Ln(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(jn(o,s,n))}return i}var Wn=class e extends Ln{constructor(){super(),this.add=Z.prototype.add.bind(this),this.delete=Z.prototype.delete.bind(this),this.get=Z.prototype.get.bind(this),this.has=Z.prototype.has.bind(this),this.set=Z.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(z(e)?(r=G(e.key,``,t),i=G(e.value,r,t)):r=G(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Un(e,t,n),i=new this;return i.items=r.items,i}};Wn.tag=`tag:yaml.org,2002:omap`;var Gn=class e extends Z{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=z(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Y(e.key,null):new Y(e,null),X(this.items,t.key)||this.items.push(t)}get(e,t){let n=X(this.items,e);return!t&&z(n)?B(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=X(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Y(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(jn(e,null,n));return i}};Gn.tag=`tag:yaml.org,2002:set`;var Kn=Symbol(`break visit`),qn=Symbol(`skip children`),Jn=Symbol(`remove item`);function Q(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Yn(Object.freeze([]),e,t)}Q.BREAK=Kn,Q.SKIP=qn,Q.REMOVE=Jn,Q.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Q.parentCollection=(e,t)=>{let n=Q.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Yn(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Yn(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Kn)return Kn;else r===Jn&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var Xn={"mate-v1":[`proposal`,`specs`,`design`,`tasks`],"mate-minimal":[`specs`,`tasks`]},Zn=`mate-v1`;function Qn(e){return Object.hasOwn(Xn,e)}function $(e,t,n,r=!1){return{id:e,label:t,kind:`skill`,skill:n,optional:r}}var $n=[$(`clarify-intent`,`Clarify intent`,`mate-clarify-intent`,!0),$(`explore`,`Explore change`,`mate-explore-change`),$(`propose`,`Propose change`,`mate-propose-change`)],er=[$(`apply`,`Apply change`,`mate-apply-change`),$(`inspect-outcome`,`Inspect outcome`,`mate-show-me`,!0),$(`refine-code`,`Refine code`,`mate-simplify-code`,!0),$(`archive`,`Archive change`,`mate-archive-change`),$(`publish`,`Publish companion artifacts`,`mate-publish-artifact`)];[...$n,...er].map(e=>e.skill);function tr(e){return{id:`review-${e}`,label:`Review ${e}`,kind:`human`,skill:null,artifact:e,optional:!1}}function nr(e){return{stages:[...$n,...(e??[]).map(tr),...er],reviewsKnown:e!==void 0}}var rr=[`clarify-intent`,`explore`,`propose`,`human-review`,`apply`,`merge-wait`,`publish`,`done`];new Map(nr([]).stages.map(e=>[e.id,e.label]));var ir={ink:{hex:`#1F2421`,ansi256:235},mateGreen:{hex:`#2E7D5B`,ansi256:29},cream:{hex:`#F4F0E8`,ansi256:255},lightGreen:{hex:`#7FD0A6`,ansi256:115},night:{hex:`#15191A`,ansi256:234}};ir.mateGreen.hex;function ar(e){let t=Number.parseInt(e.slice(1),16);return`${t>>16&255};${t>>8&255};${t&255}`}`${ar(ir.mateGreen.hex)}`;var{ink:or,mateGreen:sr,cream:cr,lightGreen:lr,night:ur}=ir,dr={ink:or.hex,bg:`#FFFFFF`,muted:`#59625E`,rule:`#E2DED5`,accent:sr.hex,surface:`#F7F5F0`,ok:sr.hex,warn:`#8A5A00`,error:`#B3261E`,info:`#2F5F9E`,neutral:`#66706B`,addBg:`#E4F3EA`,delBg:`#FBE8E6`,hunkBg:`#F1EEE7`},fr={ink:cr.hex,bg:ur.hex,muted:`#A5AEA9`,rule:`#2D3433`,accent:lr.hex,surface:`#1C2223`,ok:lr.hex,warn:`#E3B45C`,error:`#F28B82`,info:`#8DB8F0`,neutral:`#A5AEA9`,addBg:`#16382A`,delBg:`#46211E`,hunkBg:`#232A2B`};({...dr});export{m as _,Xn as a,d as c,f as d,u as f,l as g,t as h,Zn as i,p as l,r as m,dr as n,nr as o,n as p,rr as r,Qn as s,fr as t,c as u,i as v};