spec-cat 0.1.21 → 0.1.23

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 (139) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{qt0TxNaY.js → -EMqkm_u.js} +1 -1
  3. package/.output/public/_nuxt/{N3ZxlKm3.js → BDd_kh9e.js} +1 -1
  4. package/.output/public/_nuxt/BJKzOiTU.js +1 -0
  5. package/.output/public/_nuxt/{DqNujSig.js → Bk4uZfKR.js} +1 -1
  6. package/.output/public/_nuxt/C9Qk2Hno.js +1 -0
  7. package/.output/public/_nuxt/CDLI67Cr.js +1 -0
  8. package/.output/public/_nuxt/CLPz4Oer.js +1 -0
  9. package/.output/public/_nuxt/CYVeOpC3.js +1 -0
  10. package/.output/public/_nuxt/CZbP5QXb.js +1 -0
  11. package/.output/public/_nuxt/DQtVbA-s.js +150 -0
  12. package/.output/public/_nuxt/DXWMFGmi.js +1 -0
  13. package/.output/public/_nuxt/DgiJut-o.js +1 -0
  14. package/.output/public/_nuxt/{DUodkQcr.js → FbKhJXKu.js} +3 -3
  15. package/.output/public/_nuxt/builds/latest.json +1 -1
  16. package/.output/public/_nuxt/builds/meta/53b5c409-86a8-4624-8a0f-5bf31ab82deb.json +1 -0
  17. package/.output/public/_nuxt/default.eSO6fRPf.css +1 -0
  18. package/.output/public/_nuxt/entry.BtencOYX.css +1 -0
  19. package/.output/public/_nuxt/useTheme.Dp77PlfC.css +1 -0
  20. package/.output/server/chunks/_/conversationStore.mjs +13 -1
  21. package/.output/server/chunks/_/conversationStore.mjs.map +1 -1
  22. package/.output/server/chunks/_/git.mjs +7 -6
  23. package/.output/server/chunks/_/git.mjs.map +1 -1
  24. package/.output/server/chunks/_/git2.mjs.map +1 -1
  25. package/.output/server/chunks/_/gitApiHelpers.mjs +43 -0
  26. package/.output/server/chunks/_/gitApiHelpers.mjs.map +1 -0
  27. package/.output/server/chunks/_/jobPersister.mjs +326 -0
  28. package/.output/server/chunks/_/jobPersister.mjs.map +1 -0
  29. package/.output/server/chunks/_/jobQueue.mjs +714 -0
  30. package/.output/server/chunks/_/jobQueue.mjs.map +1 -0
  31. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  32. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
  33. package/.output/server/chunks/nitro/nitro.mjs +693 -657
  34. package/.output/server/chunks/routes/_ws.mjs +133 -527
  35. package/.output/server/chunks/routes/_ws.mjs.map +1 -1
  36. package/.output/server/chunks/routes/api/git/branch-rename.post.mjs +5 -18
  37. package/.output/server/chunks/routes/api/git/branch-rename.post.mjs.map +1 -1
  38. package/.output/server/chunks/routes/api/git/branch.delete.mjs +5 -18
  39. package/.output/server/chunks/routes/api/git/branch.delete.mjs.map +1 -1
  40. package/.output/server/chunks/routes/api/git/branches.get.mjs +5 -18
  41. package/.output/server/chunks/routes/api/git/branches.get.mjs.map +1 -1
  42. package/.output/server/chunks/routes/api/git/checkout.post.mjs +5 -19
  43. package/.output/server/chunks/routes/api/git/checkout.post.mjs.map +1 -1
  44. package/.output/server/chunks/routes/api/git/cherry-pick.post.mjs +5 -18
  45. package/.output/server/chunks/routes/api/git/cherry-pick.post.mjs.map +1 -1
  46. package/.output/server/chunks/routes/api/git/clean.post.mjs +5 -19
  47. package/.output/server/chunks/routes/api/git/clean.post.mjs.map +1 -1
  48. package/.output/server/chunks/routes/api/git/commit/_id_.get.mjs +23 -26
  49. package/.output/server/chunks/routes/api/git/commit/_id_.get.mjs.map +1 -1
  50. package/.output/server/chunks/routes/api/git/commit.post.mjs +5 -19
  51. package/.output/server/chunks/routes/api/git/commit.post.mjs.map +1 -1
  52. package/.output/server/chunks/routes/api/git/diff.get.mjs +5 -24
  53. package/.output/server/chunks/routes/api/git/diff.get.mjs.map +1 -1
  54. package/.output/server/chunks/routes/api/git/fetch.post.mjs +5 -18
  55. package/.output/server/chunks/routes/api/git/fetch.post.mjs.map +1 -1
  56. package/.output/server/chunks/routes/api/git/file-diff.get.mjs +5 -24
  57. package/.output/server/chunks/routes/api/git/file-diff.get.mjs.map +1 -1
  58. package/.output/server/chunks/routes/api/git/graph.get.mjs +9 -20
  59. package/.output/server/chunks/routes/api/git/graph.get.mjs.map +1 -1
  60. package/.output/server/chunks/routes/api/git/log.get.mjs +5 -24
  61. package/.output/server/chunks/routes/api/git/log.get.mjs.map +1 -1
  62. package/.output/server/chunks/routes/api/git/merge-base.get.mjs +5 -24
  63. package/.output/server/chunks/routes/api/git/merge-base.get.mjs.map +1 -1
  64. package/.output/server/chunks/routes/api/git/merge.post.mjs +5 -18
  65. package/.output/server/chunks/routes/api/git/merge.post.mjs.map +1 -1
  66. package/.output/server/chunks/routes/api/git/pull.post.mjs +14 -26
  67. package/.output/server/chunks/routes/api/git/pull.post.mjs.map +1 -1
  68. package/.output/server/chunks/routes/api/git/push.post.mjs +15 -27
  69. package/.output/server/chunks/routes/api/git/push.post.mjs.map +1 -1
  70. package/.output/server/chunks/routes/api/git/rebase.post.mjs +10 -22
  71. package/.output/server/chunks/routes/api/git/rebase.post.mjs.map +1 -1
  72. package/.output/server/chunks/routes/api/git/remote.delete.mjs +5 -18
  73. package/.output/server/chunks/routes/api/git/remote.delete.mjs.map +1 -1
  74. package/.output/server/chunks/routes/api/git/remote.post.mjs +10 -22
  75. package/.output/server/chunks/routes/api/git/remote.post.mjs.map +1 -1
  76. package/.output/server/chunks/routes/api/git/remote.put.mjs +5 -18
  77. package/.output/server/chunks/routes/api/git/remote.put.mjs.map +1 -1
  78. package/.output/server/chunks/routes/api/git/remotes.get.mjs +5 -18
  79. package/.output/server/chunks/routes/api/git/remotes.get.mjs.map +1 -1
  80. package/.output/server/chunks/routes/api/git/reset.post.mjs +12 -24
  81. package/.output/server/chunks/routes/api/git/reset.post.mjs.map +1 -1
  82. package/.output/server/chunks/routes/api/git/revert.post.mjs +5 -18
  83. package/.output/server/chunks/routes/api/git/revert.post.mjs.map +1 -1
  84. package/.output/server/chunks/routes/api/git/show.get.mjs +5 -24
  85. package/.output/server/chunks/routes/api/git/show.get.mjs.map +1 -1
  86. package/.output/server/chunks/routes/api/git/stage.post.mjs +9 -22
  87. package/.output/server/chunks/routes/api/git/stage.post.mjs.map +1 -1
  88. package/.output/server/chunks/routes/api/git/stash-apply.post.mjs +5 -19
  89. package/.output/server/chunks/routes/api/git/stash-apply.post.mjs.map +1 -1
  90. package/.output/server/chunks/routes/api/git/stash-branch.post.mjs +5 -19
  91. package/.output/server/chunks/routes/api/git/stash-branch.post.mjs.map +1 -1
  92. package/.output/server/chunks/routes/api/git/stash-drop.post.mjs +5 -19
  93. package/.output/server/chunks/routes/api/git/stash-drop.post.mjs.map +1 -1
  94. package/.output/server/chunks/routes/api/git/stash-pop.post.mjs +5 -19
  95. package/.output/server/chunks/routes/api/git/stash-pop.post.mjs.map +1 -1
  96. package/.output/server/chunks/routes/api/git/stash.get.mjs +5 -25
  97. package/.output/server/chunks/routes/api/git/stash.get.mjs.map +1 -1
  98. package/.output/server/chunks/routes/api/git/stash.post.mjs +5 -19
  99. package/.output/server/chunks/routes/api/git/stash.post.mjs.map +1 -1
  100. package/.output/server/chunks/routes/api/git/state.get.mjs +5 -25
  101. package/.output/server/chunks/routes/api/git/state.get.mjs.map +1 -1
  102. package/.output/server/chunks/routes/api/git/status.get.mjs +5 -25
  103. package/.output/server/chunks/routes/api/git/status.get.mjs.map +1 -1
  104. package/.output/server/chunks/routes/api/git/tag/_name_.get.mjs +5 -18
  105. package/.output/server/chunks/routes/api/git/tag/_name_.get.mjs.map +1 -1
  106. package/.output/server/chunks/routes/api/git/tag-push.post.mjs +10 -22
  107. package/.output/server/chunks/routes/api/git/tag-push.post.mjs.map +1 -1
  108. package/.output/server/chunks/routes/api/git/tag.delete.mjs +5 -18
  109. package/.output/server/chunks/routes/api/git/tag.delete.mjs.map +1 -1
  110. package/.output/server/chunks/routes/api/git/tag.post.mjs +17 -29
  111. package/.output/server/chunks/routes/api/git/tag.post.mjs.map +1 -1
  112. package/.output/server/chunks/routes/api/git/unstage.post.mjs +5 -19
  113. package/.output/server/chunks/routes/api/git/unstage.post.mjs.map +1 -1
  114. package/.output/server/chunks/routes/api/index.get.mjs +25 -14
  115. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  116. package/.output/server/chunks/routes/api/index.get2.mjs +14 -141
  117. package/.output/server/chunks/routes/api/index.get2.mjs.map +1 -1
  118. package/.output/server/chunks/routes/api/index.get3.mjs +167 -0
  119. package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -0
  120. package/.output/server/chunks/routes/api/index.post.mjs +77 -116
  121. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  122. package/.output/server/chunks/routes/api/index.post2.mjs +149 -0
  123. package/.output/server/chunks/routes/api/index.post2.mjs.map +1 -0
  124. package/.output/server/chunks/routes/api/jobs/_id/cancel.post.mjs +48 -0
  125. package/.output/server/chunks/routes/api/jobs/_id/cancel.post.mjs.map +1 -0
  126. package/.output/server/chunks/routes/api/jobs/_id_.get.mjs +55 -0
  127. package/.output/server/chunks/routes/api/jobs/_id_.get.mjs.map +1 -0
  128. package/.output/server/chunks/routes/api/repository/status.get.mjs +1 -1
  129. package/.output/server/package.json +1 -1
  130. package/package.json +1 -1
  131. package/.output/public/_nuxt/BIw1AQHU.js +0 -150
  132. package/.output/public/_nuxt/DBtLi_wJ.js +0 -1
  133. package/.output/public/_nuxt/DSDWvT5-.js +0 -1
  134. package/.output/public/_nuxt/K5rMM4le.js +0 -1
  135. package/.output/public/_nuxt/builds/meta/c0768eef-2dd5-410c-8648-edbd9e6c218c.json +0 -1
  136. package/.output/public/_nuxt/ddKcAgQK.js +0 -1
  137. package/.output/public/_nuxt/default.CZoNL3P_.css +0 -1
  138. package/.output/public/_nuxt/entry.DLBgeD7S.css +0 -1
  139. package/.output/public/_nuxt/sxXWehCn.js +0 -1
@@ -0,0 +1,150 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CLPz4Oer.js","./FbKhJXKu.js","./entry.BtencOYX.css","./Bk4uZfKR.js"])))=>i.map(i=>d[i]);
2
+ import{y as v,z as b,A as d,d as We,C as se,G as p,Q as tt,S as cn,R as at,I as we,E as Ne,B as M,P as V,g as R,J as Fe,U as zs,k as Y,V as mn,K as Pe,H as Oe,o as Tt,W as zt,X as Um,M as Ye,Y as Gn,T as cr,Z as mi,N as Ur,D as bt,O as ln,_ as Gm,$ as mh,a0 as Le,a1 as Ns,a2 as Zn,a3 as Hs,a4 as ru,a5 as qv,c as Yv,a6 as Ld,a7 as Hm,a8 as Fv,q as Uv,a9 as Gv,x as Hv}from"./FbKhJXKu.js";import{r as Yt,c as Gr,b as Ll,a as js,u as gh}from"./DgiJut-o.js";import{b as Dd,c as Kv,d as Jv,e as Zd,C as eb,u as tb,r as nb,a as rb}from"./BJKzOiTU.js";import{_ as Do}from"./DlAUqK2U.js";import{S as Ka,i as sb,a as ib,P as ob,W as Id,M as Xd,b as zd,c as Nd,g as Vd,d as ab,e as lb,f as ir,h as cb,u as su,j as ri,k as na,_ as ub}from"./CZbP5QXb.js";import{D as Km,b as Jm,a as Zo,u as Dl}from"./CLPz4Oer.js";function hb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"})])}function db(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function fb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"})])}function pb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})])}function mb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})])}function eg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"})])}function tg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})])}function ng(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"})])}function rg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})])}function sg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})])}function ig(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function gb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5"})])}function og(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})])}function Ob(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"})])}function vb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"})])}function bb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})])}function xb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})])}function Zl(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Oh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function yb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})])}function vh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function bh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})])}function kb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function xh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})])}function gi(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})])}function ag(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function lg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"})])}function cg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function wb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function ug(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function Sb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"})])}function $b(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function Cb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})])}function Oi(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})])}function Mi(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function ms(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function Qb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})])}function hg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function Pb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})])}function Tb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})])}function Mb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"})])}function Ab(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})])}function _b(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})])}function dg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})])}function Vs(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})])}function Rb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14"})])}function Eb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})])}function yh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}function Bb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})])}function Wd(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})])}function kh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})])}function fg(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})])}function wh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"})])}function Il(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})])}function Sh(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"})])}function iu(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function Lb(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})])}const Db={class:"flex items-center gap-1.5 px-2 py-1.5 bg-retro-panel border-b border-retro-border"},Zb={class:"relative flex-1 min-w-0"},Ib={key:0,class:"text-[11px] text-retro-muted flex-shrink-0 min-w-[60px] text-center"},Xb=["disabled"],zb=["disabled"],Nb=We({__name:"GitFindWidget",props:{resultCount:{},currentIndex:{}},emits:["search","next","prev","close"],setup(n,{expose:e,emit:t}){const r=t,s=R(""),i=R(null);let o=null;function a(){o&&clearTimeout(o),o=setTimeout(()=>{r("search",s.value)},200)}function l(u){u.key==="Escape"?(u.preventDefault(),r("close")):u.key==="Enter"&&(u.preventDefault(),u.shiftKey?r("prev"):r("next"))}function c(){i.value?.focus(),i.value?.select()}return e({focus:c}),(u,h)=>(v(),b("div",Db,[se(p(Vs),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("div",Zb,[tt(d("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=f=>at(s)?s.value=f:null),type:"text",placeholder:"Find in commits...","aria-label":"Search commits",class:"w-full px-2 py-1 text-sm bg-retro-dark border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onInput:a,onKeydown:l},null,544),[[cn,p(s)]])]),p(s)?(v(),b("span",Ib,[n.resultCount>0?(v(),b(we,{key:0},[Ne(M(n.currentIndex+1)+" of "+M(n.resultCount),1)],64)):(v(),b(we,{key:1},[Ne(" No results ")],64))])):V("",!0),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:n.resultCount===0,"aria-label":"Previous result",title:"Previous (Shift+Enter)",onClick:h[1]||(h[1]=f=>r("prev"))},[se(p(kb),{class:"w-4 h-4"})],8,Xb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:n.resultCount===0,"aria-label":"Next result",title:"Next (Enter)",onClick:h[2]||(h[2]=f=>r("next"))},[se(p(yb),{class:"w-4 h-4"})],8,zb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors","aria-label":"Close find widget",title:"Close (Escape)",onClick:h[3]||(h[3]=f=>r("close"))},[se(p(Yt),{class:"w-4 h-4"})])]))}}),Vb={class:"flex flex-col bg-retro-dark border border-retro-border rounded shadow-lg max-w-md w-full"},Wb={class:"flex items-center justify-between px-3 py-2 border-b border-retro-border"},jb={class:"flex-1 overflow-auto max-h-[300px]"},qb={class:"font-semibold text-retro-cyan flex-shrink-0 min-w-[60px]"},Yb=["onKeyup"],Fb=["onClick"],Ub={class:"text-retro-muted truncate flex-1 font-mono"},Gb=["onClick"],Hb=["onClick"],Kb={key:0,class:"px-3 py-4 text-center text-retro-muted text-xs"},Jb={key:0,class:"px-3 py-2 border-t border-retro-border space-y-2"},ex={class:"flex gap-2 justify-end"},tx=["disabled"],nx={key:1,class:"px-3 py-2 border-t border-retro-border"},rx=We({__name:"GitRemoteManager",props:{remotes:{},loading:{type:Boolean}},emits:["add","edit","delete","close"],setup(n,{emit:e}){const t=e,r=R(!1),s=R(""),i=R(""),o=R(null),a=R("");function l(){r.value=!0,s.value="",i.value=""}function c(){!s.value.trim()||!i.value.trim()||(t("add",{name:s.value.trim(),url:i.value.trim()}),r.value=!1)}function u(m){o.value=m.name,a.value=m.fetchUrl}function h(m){a.value.trim()&&(t("edit",{name:m,newUrl:a.value.trim()}),o.value=null)}function f(){o.value=null}return(m,g)=>(v(),b("div",Vb,[d("div",Wb,[g[5]||(g[5]=d("h3",{class:"text-sm font-semibold text-retro-text"},"Remote Repositories",-1)),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",onClick:g[0]||(g[0]=O=>t("close"))},[se(p(Yt),{class:"w-4 h-4"})])]),d("div",jb,[(v(!0),b(we,null,Fe(n.remotes,O=>(v(),b("div",{key:O.name,class:"flex items-center gap-2 px-3 py-2 border-b border-retro-border/50 text-xs"},[d("span",qb,M(O.name),1),p(o)===O.name?(v(),b(we,{key:0},[tt(d("input",{"onUpdate:modelValue":g[1]||(g[1]=y=>at(a)?a.value=y:null),type:"text",class:"flex-1 px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan",onKeyup:[zs(y=>h(O.name),["enter"]),zs(f,["escape"])]},null,40,Yb),[[cn,p(a)]]),d("button",{class:"p-0.5 text-retro-green hover:text-retro-green/80",onClick:y=>h(O.name)},[se(p(Oh),{class:"w-3.5 h-3.5"})],8,Fb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",onClick:f},[se(p(Yt),{class:"w-3.5 h-3.5"})])],64)):(v(),b(we,{key:1},[d("span",Ub,M(O.fetchUrl),1),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",title:"Edit",onClick:y=>u(O)},[se(p(yh),{class:"w-3.5 h-3.5"})],8,Gb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-red",title:"Delete",onClick:y=>t("delete",O.name)},[se(p(Gr),{class:"w-3.5 h-3.5"})],8,Hb)],64))]))),128)),n.remotes.length===0?(v(),b("div",Kb," No remotes configured ")):V("",!0)]),p(r)?(v(),b("div",Jb,[tt(d("input",{"onUpdate:modelValue":g[2]||(g[2]=O=>at(s)?s.value=O:null),type:"text",placeholder:"Remote name (e.g., origin)",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[cn,p(s)]]),tt(d("input",{"onUpdate:modelValue":g[3]||(g[3]=O=>at(i)?i.value=O:null),type:"text",placeholder:"Remote URL",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onKeyup:zs(c,["enter"])},null,544),[[cn,p(i)]]),d("div",ex,[d("button",{class:"px-2 py-1 text-xs text-retro-muted hover:text-retro-text transition-colors",onClick:g[4]||(g[4]=O=>r.value=!1)}," Cancel "),d("button",{class:"px-2 py-1 text-xs bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40 rounded hover:bg-retro-cyan/30 transition-colors",disabled:!p(s).trim()||!p(i).trim(),onClick:c}," Add Remote ",8,tx)])])):V("",!0),p(r)?V("",!0):(v(),b("div",nx,[d("button",{class:"flex items-center gap-1 text-xs text-retro-cyan hover:text-retro-cyan/80 transition-colors",onClick:l},[se(p(Ll),{class:"w-3.5 h-3.5"}),g[6]||(g[6]=Ne(" Add Remote ",-1))])]))]))}}),Xl={NODE_RADIUS:4,ROW_HEIGHT:32,COLUMN_WIDTH:20,PADDING:10,VISIBLE_BUFFER:10},ra=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#06B6D4","#84CC16","#F43F5E","#A855F7"],vi={A:{label:"Added",colorClass:"text-retro-green"},M:{label:"Modified",colorClass:"text-retro-yellow"},D:{label:"Deleted",colorClass:"text-retro-red"},R:{label:"Renamed",colorClass:"text-retro-blue"},C:{label:"Copied",colorClass:"text-retro-purple"},U:{label:"Unmerged",colorClass:"text-retro-cyan"}},sx=["width","height"],ix=["d","stroke","stroke-dasharray"],ox={key:0},ax=["cx","r"],lx=["cx","r","fill"],cx=["cx","r","stroke"],ux=["cx","r","fill"],hx=["cx","r","stroke"],dx=["cx","r","fill"],fx=["cx","r"],px=["cx","r","fill"],pg=We({__name:"GitGraphSvg",props:{rowData:{},maxLane:{default:4},highlightBranches:{},tooltipText:{}},setup(n){const e=n,{COLUMN_WIDTH:t,ROW_HEIGHT:r,NODE_RADIUS:s,PADDING:i}=Xl,o=Y(()=>i*2+(e.maxLane+1)*t),a=r,l=r/2;function c(f){return i+f*t}function u(f){const m=c(f.fromLane),g=c(f.toLane);if(f.type==="vertical")return`M ${m} 0 L ${g} ${a}`;if(f.type==="vertical-top")return`M ${m} 0 L ${m} ${l}`;if(f.type==="vertical-bottom")return`M ${m} ${l} L ${m} ${a}`;if(f.style==="rounded")return`M ${m} ${l} C ${m} ${a}, ${g} ${a}, ${g} ${a}`;{const O=a*.75;return`M ${m} ${l} L ${m} ${O} L ${g} ${a}`}}const h=Y(()=>e.rowData?c(e.rowData.lane):i);return(f,m)=>(v(),b("svg",{width:p(o),height:p(a),class:"block flex-shrink-0","aria-hidden":"true"},[n.rowData?(v(),b(we,{key:0},[(v(!0),b(we,null,Fe(n.rowData.connections,(g,O)=>(v(),b("path",{key:O,d:u(g),stroke:g.color,"stroke-width":"2",fill:"none","stroke-dasharray":g.type.startsWith("merge")?"4 3":"none"},null,8,ix))),128)),d("g",null,[n.tooltipText?(v(),b("title",ox,M(n.tooltipText),1)):V("",!0),n.rowData.nodeType==="head"?(v(),b(we,{key:1},[d("circle",{cx:p(h),cy:l,r:p(s)+2,fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-cyan"},null,8,ax),d("circle",{cx:p(h),cy:l,r:p(s),fill:n.rowData.color},null,8,lx)],64)):n.rowData.nodeType==="merge"?(v(),b(we,{key:2},[d("circle",{cx:p(h),cy:l,r:p(s)+1,fill:"none",stroke:n.rowData.color,"stroke-width":"1.5"},null,8,cx),d("circle",{cx:p(h),cy:l,r:p(s)-1,fill:n.rowData.color},null,8,ux)],64)):n.rowData.nodeType==="stash"?(v(),b(we,{key:3},[d("circle",{cx:p(h),cy:l,r:p(s),fill:"none",stroke:n.rowData.color,"stroke-width":"2"},null,8,hx),d("circle",{cx:p(h),cy:l,r:p(s)-2,fill:n.rowData.color},null,8,dx)],64)):n.rowData.nodeType==="uncommitted"?(v(),b("circle",{key:4,cx:p(h),cy:l,r:p(s),fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-yellow","stroke-dasharray":"3 2"},null,8,fx)):(v(),b("circle",{key:5,cx:p(h),cy:l,r:p(s),fill:n.rowData.color},null,8,px))])],64)):V("",!0)],8,sx))}}),mx=["aria-selected","aria-label"],gx={key:1,class:"flex gap-1 flex-shrink-0"},Ox=["title","onContextmenu"],vx={key:2,class:"flex gap-1 flex-shrink-0"},bx=["onContextmenu"],xx={class:"text-retro-text text-xs truncate flex-1"},yx={key:5,class:"flex-shrink-0 text-retro-muted text-[10px] hidden sm:inline"},kx={key:6,class:"flex-shrink-0 text-retro-muted text-[10px]"},jd=72,wx=We({__name:"GitCommitRow",props:{commit:{},index:{},isSelected:{type:Boolean},isHighlighted:{type:Boolean},isBranchHighlighted:{type:Boolean},isFeatureHighlighted:{type:Boolean},isPreviewHighlighted:{type:Boolean},isMuted:{type:Boolean},currentBranchName:{},localBranchNames:{},graphRowData:{},maxLane:{},columnVisibility:{}},emits:["click","keydown","branchContextMenu","commitContextMenu","tagContextMenu"],setup(n,{emit:e}){const t=n,r=e,s=Y(()=>{const f=t.commit.branches;if(f.length===0)return[];const m=t.localBranchNames,g=[],O=[];for(const T of f)m.has(T)?g.push(T):O.push(T);const y=new Set(g),x=new Map,S=[];for(const T of O){const D=T.indexOf("/");if(D>0){const K=T.substring(D+1),I=T.substring(0,D);y.has(K)?(x.has(K)||x.set(K,[]),x.get(K).push(I)):S.push(T)}else S.push(T)}const Q=[];for(const T of g){const D=x.get(T)||[];D.length>0?Q.push({displayName:`${T}/${D.join(",")}`,originalBranches:[T,...D.map(K=>`${K}/${T}`)],isLocal:!0}):Q.push({displayName:T,originalBranches:[T],isLocal:!0})}for(const T of S)Q.push({displayName:T,originalBranches:[T],isLocal:!1});return Q});function i(f,m){f.preventDefault(),f.stopPropagation();const g=m.originalBranches[0];r("branchContextMenu",{branch:g,x:f.clientX,y:f.clientY,isCurrentBranch:m.isLocal&&m.originalBranches.includes(t.currentBranchName??""),isLocal:m.isLocal})}function o(f,m){f.preventDefault(),f.stopPropagation(),r("tagContextMenu",{tag:m,x:f.clientX,y:f.clientY})}function a(f){f.preventDefault(),f.stopPropagation(),r("commitContextMenu",{x:f.clientX,y:f.clientY})}const{ROW_HEIGHT:l}=Xl,c=Y(()=>{const f=[t.commit.shortHash];return t.commit.branches.length>0&&f.push(t.commit.branches.join(", ")),t.commit.tags.length>0&&f.push(t.commit.tags.map(m=>`tag: ${m}`).join(", ")),f.join(" — ")});function u(f){const g=Date.now()/1e3-f;return g<60?"just now":g<3600?`${Math.floor(g/60)}m ago`:g<86400?`${Math.floor(g/3600)}h ago`:g<604800?`${Math.floor(g/86400)}d ago`:g<2592e3?`${Math.floor(g/604800)}w ago`:new Date(f*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function h(f){const m=f.split(`
3
+ `)[0];return m.length>jd?m.substring(0,jd-3)+"...":m}return(f,m)=>{const g=pg;return v(),b("div",{class:Pe(["flex items-center cursor-pointer group focus:outline-none focus:ring-1 focus:ring-retro-cyan/50 focus:ring-inset",{"opacity-40":n.isMuted,"bg-retro-magenta/10":n.isPreviewHighlighted,"bg-retro-yellow/20":n.isFeatureHighlighted&&!n.isPreviewHighlighted}]),style:mn({height:`${p(l)}px`}),role:"row",tabindex:"0","aria-selected":n.isSelected,"aria-label":`Commit ${n.commit.shortHash} by ${n.commit.author}: ${n.commit.message.split(`
4
+ `)[0]}`,onClick:m[0]||(m[0]=O=>r("click",O)),onKeydown:m[1]||(m[1]=O=>r("keydown",O)),onContextmenu:a},[se(g,{rowData:n.graphRowData,maxLane:n.maxLane,tooltipText:p(c)},null,8,["rowData","maxLane","tooltipText"]),d("div",{class:Pe(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-magenta/10 border-l-2 border-retro-magenta/40":n.isPreviewHighlighted,"bg-retro-yellow/30 border-l-2 border-retro-yellow":n.isFeatureHighlighted&&!n.isPreviewHighlighted,"bg-retro-cyan/15":n.isSelected&&!n.isFeatureHighlighted&&!n.isPreviewHighlighted,"bg-retro-yellow/10":n.isHighlighted&&!n.isSelected&&!n.isFeatureHighlighted&&!n.isPreviewHighlighted,"bg-retro-cyan/5":n.isBranchHighlighted&&!n.isSelected&&!n.isHighlighted&&!n.isFeatureHighlighted&&!n.isPreviewHighlighted,"group-hover:bg-retro-panel/50":!n.isSelected&&!n.isHighlighted&&!n.isFeatureHighlighted&&!n.isPreviewHighlighted&&!n.isBranchHighlighted}]),style:mn({height:`${p(l)-4}px`})},[!n.columnVisibility||n.columnVisibility.commit!==!1?(v(),b("span",{key:0,class:Pe(["flex-shrink-0 font-mono text-[11px]",n.commit.isHead?"text-retro-cyan font-semibold":"text-retro-muted"])},M(n.commit.shortHash),3)):V("",!0),p(s).length>0?(v(),b("div",gx,[(v(!0),b(we,null,Fe(p(s),O=>(v(),b("span",{key:O.displayName,class:Pe(["px-1.5 py-0.5 text-[10px] rounded font-semibold leading-none cursor-context-menu hover:ring-1 hover:ring-retro-cyan/50",n.commit.isHead&&O.isLocal?"bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40":n.isPreviewHighlighted?"bg-retro-magenta/10 text-retro-magenta border border-retro-magenta/40":n.isFeatureHighlighted?"bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/30":n.isBranchHighlighted?"bg-retro-cyan/15 text-retro-cyan/80 border border-retro-cyan/30":O.isLocal?"bg-retro-green/15 text-retro-green border border-retro-green/30":"bg-retro-orange/15 text-retro-orange border border-retro-orange/30"]),title:O.originalBranches.join(", "),onContextmenu:y=>i(y,O)},M(O.displayName),43,Ox))),128))])):V("",!0),n.commit.tags.length>0?(v(),b("div",vx,[(v(!0),b(we,null,Fe(n.commit.tags,O=>(v(),b("span",{key:O,class:"px-1 py-0.5 text-[10px] rounded-sm bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/25 flex items-center gap-0.5 leading-none cursor-context-menu hover:ring-1 hover:ring-retro-yellow/50",onContextmenu:y=>o(y,O)},[se(p(Sh),{class:"w-2.5 h-2.5"}),Ne(" "+M(O),1)],40,bx))),128))])):V("",!0),d("span",xx,M(h(n.commit.message)),1),n.commit.signatureStatus==="good"?(v(),Oe(p(fg),{key:3,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-green",title:"Verified signature"})):n.commit.signatureStatus==="bad"?(v(),Oe(p(wh),{key:4,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-red",title:"Bad signature"})):V("",!0),!n.columnVisibility||n.columnVisibility.author!==!1?(v(),b("span",yx,M(n.commit.author),1)):V("",!0),!n.columnVisibility||n.columnVisibility.date!==!1?(v(),b("span",kx,M(u(n.commit.timestamp)),1)):V("",!0)],6)],46,mx)}}});function Sx(){const{COLUMN_WIDTH:n,ROW_HEIGHT:e,NODE_RADIUS:t,PADDING:r}=Xl;function s(l){let c=0;for(let u=0;u<l.length;u++){const h=l.charCodeAt(u);c=(c<<5)-c+h,c=c&c}return Math.abs(c)}function i(l){const c=s(l)%ra.length;return ra[c]}function o(l,c="rounded"){const u=new Map;if(l.length===0)return u;const h=new Set,f=new Map;for(const Q of l)f.set(Q.hash,Q);const m=l.find(Q=>Q.isHead)||l[0];if(m){let Q=m;for(;Q;){h.add(Q.hash);const T=Q.parents?.[0];Q=T?f.get(T):void 0}}const g=new Map,O=new Map,y=new Map,x=new Map,S=new Map;for(let Q=0;Q<l.length;Q++){const T=l[Q];S.set(T.hash,Q);const D=h.has(T.hash);let K,I;if(x.has(T.hash)){const X=x.get(T.hash);K=X.lane,I=X.color,x.delete(T.hash)}else if(D)K=0,I=ra[0];else{for(K=1;y.has(K);)K++;I=i(T.hash.substring(0,7))}g.set(T.hash,K),O.set(T.hash,I),y.set(K,T.hash);const ue=T.isMerge||T.parents&&T.parents.length>1;let le="regular";T.isHead?le="head":ue&&(le="merge"),u.set(T.hash,{commitHash:T.hash,lane:K,color:I,nodeType:le,isMainline:h.has(T.hash),connections:[]});const oe=T.parents||[];for(let X=0;X<oe.length;X++){const B=oe[X];if(g.has(B)||x.has(B))continue;const q=h.has(B);let U,j;if(X===0)U=K,j=I;else if(q)U=0,j=ra[0];else{for(U=1;y.has(U)||U===K;)U++;j=i(B.substring(0,7))}x.set(B,{lane:U,color:j,childHash:T.hash})}const Z=oe[0];if(!Z)y.delete(K);else{const X=g.get(Z),B=x.get(Z),q=X??B?.lane;q!==void 0&&q!==K&&y.delete(K)}}for(let Q=0;Q<l.length;Q++){const T=l[Q],D=u.get(T.hash);if(!D)continue;const K=T.parents||[];for(let I=0;I<K.length;I++){const ue=K[I],le=g.get(ue),oe=S.get(ue);if(le===void 0)continue;const Z=D.lane,X=le,B=I===0?D.color:O.get(ue)||i(ue.substring(0,7));if(Z===X?D.connections.push({type:"vertical-bottom",fromLane:Z,toLane:X,color:B,style:c}):I>0?D.connections.push({type:Z<X?"merge-out":"merge-in",fromLane:Z,toLane:X,color:B,style:c}):D.connections.push({type:Z<X?"branch-out":"branch-in",fromLane:Z,toLane:X,color:B,style:c}),oe!==void 0&&oe>Q+1)for(let q=Q+1;q<oe;q++){const U=l[q],j=u.get(U.hash);j&&j.connections.push({type:"vertical",fromLane:X,toLane:X,color:B,style:c})}if(oe!==void 0){const q=u.get(ue);q&&q.connections.push({type:"vertical-top",fromLane:X,toLane:X,color:B,style:c})}}}return u}function a(l){let c=0;for(const u of l.values()){u.lane>c&&(c=u.lane);for(const h of u.connections)h.fromLane>c&&(c=h.fromLane),h.toLane>c&&(c=h.toLane)}return c}return{computeGraphRows:o,computeMaxLane:a,getBranchColor:i,COLUMN_WIDTH:n,ROW_HEIGHT:e,NODE_RADIUS:t,PADDING:r}}const $x=["aria-selected"],Cx={class:"text-retro-yellow text-xs font-medium"},Qx={key:1,class:"flex items-center justify-center gap-2 p-2 text-retro-muted text-sm"},Px={key:2,class:"p-2 text-center text-retro-muted/50 text-xs"},Tx=We({__name:"GitCommitList",props:{commits:{},stashes:{},selectedCommit:{},hasMore:{type:Boolean},loading:{type:Boolean},loadingMore:{type:Boolean},searchQuery:{},uncommittedChangesCount:{},isUncommittedChangesSelected:{type:Boolean},highlightBranches:{},featureHighlightBranches:{},featureMergeBases:{},previewHighlightBranches:{},previewMergeBases:{},currentBranchName:{},localBranchNames:{},graphStyle:{default:"rounded"},muteNonAncestral:{type:Boolean},columnVisibility:{}},emits:["select","compareSelect","loadMore","branchContextMenu","commitContextMenu","tagContextMenu","stashContextMenu","selectUncommittedChanges","scrollStart","scrollEnd"],setup(n,{expose:e,emit:t}){const r=n,s=t;function i(){s("selectUncommittedChanges")}function o(C){(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),s("selectUncommittedChanges"))}const a=Y(()=>r.searchQuery?.toLowerCase()??""),l=Y(()=>new Set(r.highlightBranches??[])),c=Y(()=>l.value.size>0),u=Y(()=>{const C=a.value;if(!C)return new Set;const w=new Set;for(const _ of r.commits)(_.message.toLowerCase().includes(C)||_.author.toLowerCase().includes(C)||_.shortHash.toLowerCase().includes(C)||_.hash.toLowerCase().includes(C)||_.branches.some(E=>E.toLowerCase().includes(C))||_.tags.some(E=>E.toLowerCase().includes(C)))&&w.add(_.hash);return w}),h=Y(()=>{if(!c.value)return new Set;const C=new Set;for(const w of r.commits)w.branches.some(_=>l.value.has(_))&&C.add(w.hash);return C}),f=Y(()=>{if(!r.featureHighlightBranches||r.featureHighlightBranches.length===0)return new Set;const C=r.featureMergeBases??{},w=new Map;for(const E of r.commits)w.set(E.hash,E);const _=new Set;for(const E of r.featureHighlightBranches){const z=r.commits.find(Qe=>Qe.branches.includes(E));if(!z)continue;const F=C[E]??null;if(!F)continue;let ne=z;for(;ne&&ne.hash!==F;)_.add(ne.hash),ne=ne.parents?.[0]?w.get(ne.parents[0]):void 0}return _}),m=Y(()=>{if(!r.previewHighlightBranches||r.previewHighlightBranches.length===0)return new Set;const C=r.previewMergeBases??{},w=new Map;for(const E of r.commits)w.set(E.hash,E);const _=new Set;for(const E of r.previewHighlightBranches){const z=r.commits.find(Qe=>Qe.branches.includes(E));if(!z)continue;const F=C[E]??null;if(!F)continue;let ne=z;for(;ne&&ne.hash!==F;)_.add(ne.hash),ne=ne.parents?.[0]?w.get(ne.parents[0]):void 0}return _});function g(C,w){s("branchContextMenu",{...w,commitHash:C.hash})}function O(C,w){s("commitContextMenu",{commit:C,...w})}function y(C,w){s("tagContextMenu",{...w,commitHash:C.hash})}const{ROW_HEIGHT:x,VISIBLE_BUFFER:S}=Xl,{computeGraphRows:Q,computeMaxLane:T}=Sx(),D=Y(()=>Q([...r.commits],r.graphStyle)),K=Y(()=>T(D.value)),I=Y(()=>{const C=r.stashes||[];if(C.length===0)return r.commits.map((z,F)=>({type:"commit",commit:z,commitIndex:F}));const w=[],_=[...C].sort((z,F)=>new Date(F.date).getTime()-new Date(z.date).getTime());let E=0;for(let z=0;z<r.commits.length;z++){const F=r.commits[z],ne=F.timestamp*1e3;for(;E<_.length&&new Date(_[E].date).getTime()>=ne;)w.push({type:"stash",stash:_[E]}),E++;w.push({type:"commit",commit:F,commitIndex:z})}for(;E<_.length;)w.push({type:"stash",stash:_[E]}),E++;return w}),ue=R(null),le=R(0),oe=R(400);let Z=null;const X=Y(()=>{const C=S,w=I.value.length,_=Math.max(0,Math.floor(le.value/x)-C),E=Math.min(w,Math.ceil((le.value+oe.value)/x)+C);return{startIndex:_,endIndex:E}}),B=Y(()=>{const{startIndex:C,endIndex:w}=X.value;return I.value.slice(C,w).map((_,E)=>({row:_,index:C+E,graphRow:_.type==="commit"&&D.value.get(_.commit.hash)||null,isHighlighted:_.type==="commit"?u.value.has(_.commit.hash):!1,isBranchHighlighted:_.type==="commit"?h.value.has(_.commit.hash):!1,isFeatureHighlighted:_.type==="commit"?f.value.has(_.commit.hash):!1,isPreviewHighlighted:_.type==="commit"?m.value.has(_.commit.hash):!1,isMuted:_.type==="commit"&&r.muteNonAncestral?!(D.value.get(_.commit.hash)?.isMainline??!1):!1}))}),q=Y(()=>I.value.length*x),U=Y(()=>X.value.startIndex*x);function j(C){const w=C.target;le.value=w.scrollTop,Z||s("scrollStart"),Z&&clearTimeout(Z),Z=setTimeout(()=>{Z=null,s("scrollEnd")},150),r.hasMore&&!r.loading&&!r.loadingMore&&w.scrollTop+w.clientHeight>=w.scrollHeight-200&&s("loadMore")}function N(C,w){w.ctrlKey||w.metaKey?s("compareSelect",C):s("select",C)}function W(C,w,_){if(C.key==="Enter"||C.key===" ")C.preventDefault(),s("select",w);else if(C.key==="ArrowDown"){C.preventDefault();for(let E=_+1;E<I.value.length;E++){const z=I.value[E];if(z.type==="commit"){s("select",z.commit),ve(E);break}}}else if(C.key==="ArrowUp"){C.preventDefault();for(let E=_-1;E>=0;E--){const z=I.value[E];if(z.type==="commit"){s("select",z.commit),ve(E);break}}}}function ve(C){if(!ue.value)return;const w=C*x,_=ue.value.scrollTop,E=_+ue.value.clientHeight;w<_?ue.value.scrollTop=w:w+x>E&&(ue.value.scrollTop=w+x-ue.value.clientHeight)}Tt(()=>{if(ue.value){oe.value=ue.value.clientHeight;const C=new ResizeObserver(w=>{for(const _ of w)oe.value=_.contentRect.height});C.observe(ue.value),zt(()=>C.disconnect())}});function te(){return ue.value?.scrollTop??0}function he(C){ue.value&&(ue.value.scrollTop=C)}return e({getScrollPosition:te,setScrollPosition:he,scrollToIndex:ve}),(C,w)=>{const _=pg,E=wx;return v(),b("div",{ref_key:"containerRef",ref:ue,class:"h-full overflow-auto",role:"list","aria-label":"Commit history",onScroll:j},[n.uncommittedChangesCount&&n.uncommittedChangesCount>0?(v(),b("div",{key:0,class:"flex items-center cursor-pointer group sticky top-0 z-10 bg-retro-dark border-b border-retro-border",style:mn({height:`${p(x)}px`}),role:"button",tabindex:"0","aria-selected":n.isUncommittedChangesSelected,onClick:i,onKeydown:o},[se(_,{rowData:{commitHash:"uncommitted",lane:0,color:"#F59E0B",nodeType:"uncommitted",isMainline:!1,connections:[]},maxLane:p(K)},null,8,["maxLane"]),d("div",{class:Pe(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-yellow/15":n.isUncommittedChangesSelected,"group-hover:bg-retro-panel/50":!n.isUncommittedChangesSelected}]),style:mn({height:`${p(x)-4}px`})},[se(p(Mi),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),d("span",Cx," Uncommitted Changes ("+M(n.uncommittedChangesCount)+") ",1),w[1]||(w[1]=d("span",{class:"flex-1"},null,-1)),w[2]||(w[2]=d("span",{class:"text-retro-muted text-[10px]"},"Working tree",-1))],6)],44,$x)):V("",!0),d("div",{class:"relative",style:mn({height:`${p(q)}px`})},[d("div",{class:"absolute left-0 right-0",style:mn({transform:`translateY(${p(U)}px)`})},[(v(!0),b(we,null,Fe(p(B),({row:z,index:F,graphRow:ne,isHighlighted:Qe,isBranchHighlighted:ke,isFeatureHighlighted:qe,isPreviewHighlighted:He,isMuted:me})=>(v(),b(we,{key:z.type==="commit"?z.commit.hash:`stash-${z.stash.index}`},[z.type==="commit"?Um([z.commit.hash,z.commit.message,z.commit.timestamp,z.commit.branches.join("|"),z.commit.tags.join("|"),n.selectedCommit?.hash===z.commit.hash,Qe,ke,qe,He,me,r.currentBranchName||"",r.columnVisibility?.date!==!1,r.columnVisibility?.author!==!1,r.columnVisibility?.commit!==!1],()=>(v(),Oe(E,{key:0,commit:z.commit,index:z.commitIndex,isSelected:n.selectedCommit?.hash===z.commit.hash,isHighlighted:Qe,isBranchHighlighted:ke,isFeatureHighlighted:qe,isPreviewHighlighted:He,isMuted:me,currentBranchName:r.currentBranchName,localBranchNames:r.localBranchNames,graphRowData:ne,maxLane:p(K),columnVisibility:r.columnVisibility,onClick:Ee=>N(z.commit,Ee),onKeydown:Ee=>W(Ee,z.commit,F),onBranchContextMenu:Ee=>g(z.commit,Ee),onCommitContextMenu:Ee=>O(z.commit,Ee),onTagContextMenu:Ee=>y(z.commit,Ee)},null,8,["commit","index","isSelected","isHighlighted","isBranchHighlighted","isFeatureHighlighted","isPreviewHighlighted","isMuted","currentBranchName","localBranchNames","graphRowData","maxLane","columnVisibility","onClick","onKeydown","onBranchContextMenu","onCommitContextMenu","onTagContextMenu"])),w,0):V("",!0)],64))),128))],4)],4),(n.loading||n.loadingMore)&&n.commits.length>0?(v(),b("div",Qx,[...w[3]||(w[3]=[d("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),Ne(" Loading more commits... ",-1)])])):V("",!0),!n.hasMore&&n.commits.length>0&&!n.loading?(v(),b("div",Px,M(n.commits.length)+" commits loaded ",1)):V("",!0)],544)}}});function Mx(n){const e=n.charAt(0).toUpperCase();return e in vi?e:"M"}function sa(n,e){if(n&&typeof n=="object"){const t=n;if(typeof t.data?.message=="string"&&t.data.message.trim())return t.data.message;if(typeof t.statusMessage=="string"&&t.statusMessage.trim())return t.statusMessage;if(typeof t.message=="string"&&t.message.trim())return t.message}return n instanceof Error&&n.message?n.message:e}function qd(n,e){const t=e.trim().toLowerCase();return t?n.filter(r=>r.message.toLowerCase().includes(t)||r.author.toLowerCase().includes(t)||r.shortHash.includes(t)||r.hash.includes(t)||r.branches.some(s=>s.toLowerCase().includes(t))||r.tags.some(s=>s.toLowerCase().includes(t))):[...n]}function Ax(n,e){return e.size===0?[...n]:n.filter(t=>t.branches.some(r=>e.has(r)))}const _x={class:"flex flex-col h-full border-t border-retro-border bg-retro-dark"},Rx={class:"flex items-center justify-between p-2 border-b border-retro-border flex-shrink-0"},Ex={class:"flex items-center gap-2 text-xs min-w-0"},Bx={class:"font-mono text-retro-cyan"},Lx={class:"font-mono text-retro-cyan"},Dx={key:0,class:"px-3 py-1.5 text-xs text-retro-muted border-b border-retro-border flex-shrink-0"},Zx={class:"text-retro-green"},Ix={class:"text-retro-red"},Xx={key:1,class:"flex-1 flex items-center justify-center"},zx={key:2,class:"flex-1 overflow-auto"},Nx={class:"text-retro-text truncate flex-1"},Vx={class:"text-retro-muted"},Wx={key:0,class:"flex-shrink-0 text-[10px] font-mono"},jx={key:0,class:"text-retro-green"},qx={key:1,class:"text-retro-red ml-1"},Yx={key:1,class:"flex-shrink-0 text-[10px] text-retro-muted italic"},Fx={key:3,class:"flex-1 flex items-center justify-center text-retro-muted text-sm"},Ux=We({__name:"GitComparisonView",props:{fromCommit:{},toCommit:{},files:{},stats:{},loading:{type:Boolean}},emits:["close"],setup(n,{emit:e}){const t=e;function r(s){const i=Mx(s);return vi[i]||vi.M}return(s,i)=>(v(),b("div",_x,[d("div",Rx,[d("div",Ex,[i[1]||(i[1]=d("span",{class:"text-retro-muted"},"Comparing",-1)),d("span",Bx,M(n.fromCommit.shortHash),1),i[2]||(i[2]=d("span",{class:"text-retro-muted"},"→",-1)),d("span",Lx,M(n.toCommit.shortHash),1)]),d("button",{class:"p-1 text-retro-muted hover:text-retro-text transition-colors flex-shrink-0","aria-label":"Close comparison",onClick:i[0]||(i[0]=o=>t("close"))},[se(p(Yt),{class:"w-4 h-4"})])]),n.stats?(v(),b("div",Dx,[Ne(M(n.stats.filesChanged)+" file"+M(n.stats.filesChanged!==1?"s":"")+" changed, ",1),d("span",Zx,"+"+M(n.stats.additions),1),d("span",Ix," -"+M(n.stats.deletions),1)])):V("",!0),n.loading?(v(),b("div",Xx,[...i[3]||(i[3]=[d("div",{class:"flex items-center gap-2 text-retro-muted text-sm"},[d("div",{class:"w-4 h-4 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"}),Ne(" Loading comparison... ")],-1)])])):n.files&&n.files.length>0?(v(),b("div",zx,[(v(!0),b(we,null,Fe(n.files,o=>(v(),b("div",{key:o.path,class:"flex items-center gap-2 px-3 py-1.5 hover:bg-retro-panel/50 text-xs border-b border-retro-border/50"},[d("span",{class:Pe(["flex-shrink-0 w-4 text-center font-semibold text-[10px]",r(o.status).colorClass])},M(o.status.charAt(0)),3),d("span",Nx,[o.oldPath&&o.status.startsWith("R")?(v(),b(we,{key:0},[d("span",Vx,M(o.oldPath),1),i[4]||(i[4]=d("span",{class:"text-retro-muted mx-1"},"→",-1))],64)):V("",!0),Ne(" "+M(o.path),1)]),o.binary?(v(),b("span",Yx,"binary")):(v(),b("span",Wx,[o.additions>0?(v(),b("span",jx,"+"+M(o.additions),1)):V("",!0),o.deletions>0?(v(),b("span",qx,"-"+M(o.deletions),1)):V("",!0)]))]))),128))])):n.files&&n.files.length===0?(v(),b("div",Fx," No differences between these commits ")):V("",!0)]))}});function $h(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ks=$h();function mg(n){Ks=n}var so={exec:()=>null};function ft(n,e=""){let t=typeof n=="string"?n:n.source;const r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(gn.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var gn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<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,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Gx=/^(?:[ \t]*(?:\n|$))+/,Hx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Kx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Io=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ch=/(?:[*+-]|\d{1,9}[.)])/,gg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Og=ft(gg).replace(/bull/g,Ch).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ey=ft(gg).replace(/bull/g,Ch).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ty=/^[^\n]+/,Ph=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ny=ft(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ph).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ry=ft(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ch).getRegex(),zl="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",Th=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sy=ft("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Th).replace("tag",zl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vg=ft(Qh).replace("hr",Io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex(),iy=ft(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vg).getRegex(),Mh={blockquote:iy,code:Hx,def:ny,fences:Kx,heading:Jx,hr:Io,html:sy,lheading:Og,list:ry,newline:Gx,paragraph:vg,table:so,text:ty},Yd=ft("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex(),oy={...Mh,lheading:ey,table:Yd,paragraph:ft(Qh).replace("hr",Io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex()},ay={...Mh,html:ft(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Th).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:so,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ft(Qh).replace("hr",Io).replace("heading",` *#{1,6} *[^
5
+ ]`).replace("lheading",Og).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ly=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bg=/^( {2,}|\\)\n(?!\s*$)/,uy=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Nl=/[\p{P}\p{S}]/u,Ah=/[\s\p{P}\p{S}]/u,xg=/[^\s\p{P}\p{S}]/u,hy=ft(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ah).getRegex(),yg=/(?!~)[\p{P}\p{S}]/u,dy=/(?!~)[\s\p{P}\p{S}]/u,fy=/(?:[^\s\p{P}\p{S}]|~)/u,py=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,kg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,my=ft(kg,"u").replace(/punct/g,Nl).getRegex(),gy=ft(kg,"u").replace(/punct/g,yg).getRegex(),wg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Oy=ft(wg,"gu").replace(/notPunctSpace/g,xg).replace(/punctSpace/g,Ah).replace(/punct/g,Nl).getRegex(),vy=ft(wg,"gu").replace(/notPunctSpace/g,fy).replace(/punctSpace/g,dy).replace(/punct/g,yg).getRegex(),by=ft("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xg).replace(/punctSpace/g,Ah).replace(/punct/g,Nl).getRegex(),xy=ft(/\\(punct)/,"gu").replace(/punct/g,Nl).getRegex(),yy=ft(/^<(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(),ky=ft(Th).replace("(?:-->|$)","-->").getRegex(),wy=ft("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ky).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ja=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sy=ft(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ja).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Sg=ft(/^!?\[(label)\]\[(ref)\]/).replace("label",Ja).replace("ref",Ph).getRegex(),$g=ft(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ph).getRegex(),$y=ft("reflink|nolink(?!\\()","g").replace("reflink",Sg).replace("nolink",$g).getRegex(),_h={_backpedal:so,anyPunctuation:xy,autolink:yy,blockSkip:py,br:bg,code:cy,del:so,emStrongLDelim:my,emStrongRDelimAst:Oy,emStrongRDelimUnd:by,escape:ly,link:Sy,nolink:$g,punctuation:hy,reflink:Sg,reflinkSearch:$y,tag:wy,text:uy,url:so},Cy={..._h,link:ft(/^!?\[(label)\]\((.*?)\)/).replace("label",Ja).getRegex(),reflink:ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ja).getRegex()},ou={..._h,emStrongRDelimAst:vy,emStrongLDelim:gy,url:ft(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Qy={...ou,br:ft(bg).replace("{2,}","*").getRegex(),text:ft(ou.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ia={normal:Mh,gfm:oy,pedantic:ay},Zi={normal:_h,gfm:ou,breaks:Qy,pedantic:Cy},Py={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fd=n=>Py[n];function wr(n,e){if(e){if(gn.escapeTest.test(n))return n.replace(gn.escapeReplace,Fd)}else if(gn.escapeTestNoEncode.test(n))return n.replace(gn.escapeReplaceNoEncode,Fd);return n}function Ud(n){try{n=encodeURI(n).replace(gn.percentDecode,"%")}catch{return null}return n}function Gd(n,e){const t=n.replace(gn.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=t.split(gn.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(gn.slashPipe,"|");return r}function Ii(n,e,t){const r=n.length;if(r===0)return"";let s=0;for(;s<r&&n.charAt(r-s-1)===e;)s++;return n.slice(0,r-s)}function Ty(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function Hd(n,e,t,r,s){const i=e.href,o=e.title||null,a=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function My(n,e,t){const r=n.match(t.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
6
+ `).map(i=>{const o=i.match(t.other.beginningSpace);if(o===null)return i;const[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(`
7
+ `)}var el=class{options;rules;lexer;constructor(n){this.options=n||Ks}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Ii(t,`
8
+ `)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],r=My(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const r=Ii(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Ii(e[0],`
9
+ `)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=Ii(e[0],`
10
+ `).split(`
11
+ `),r="",s="";const i=[];for(;t.length>0;){let o=!1;const a=[];let l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);const c=a.join(`
12
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
13
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
14
+ ${c}`:c,s=s?`${s}
15
+ ${u}`:u;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=h,t.length===0)break;const f=i.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){const m=f,g=m.raw+`
16
+ `+t.join(`
17
+ `),O=this.blockquote(g);i[i.length-1]=O,r=r.substring(0,r.length-m.raw.length)+O.raw,s=s.substring(0,s.length-m.text.length)+O.text;break}else if(f?.type==="list"){const m=f,g=m.raw+`
18
+ `+t.join(`
19
+ `),O=this.list(g);i[i.length-1]=O,r=r.substring(0,r.length-f.raw.length)+O.raw,s=s.substring(0,s.length-m.raw.length)+O.raw,t=g.substring(i.at(-1).raw.length).split(`
20
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");const i=this.rules.other.listItemRegex(t);let o=!1;for(;n;){let l=!1,c="",u="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let h=e[2].split(`
21
+ `,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),f=n.split(`
22
+ `,1)[0],m=!h.trim(),g=0;if(this.options.pedantic?(g=2,u=h.trimStart()):m?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=h.slice(g),g+=e[1].length),m&&this.rules.other.blankLine.test(f)&&(c+=f+`
23
+ `,n=n.substring(f.length+1),l=!0),!l){const x=this.rules.other.nextBulletRegex(g),S=this.rules.other.hrRegex(g),Q=this.rules.other.fencesBeginRegex(g),T=this.rules.other.headingBeginRegex(g),D=this.rules.other.htmlBeginRegex(g);for(;n;){const K=n.split(`
24
+ `,1)[0];let I;if(f=K,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),I=f):I=f.replace(this.rules.other.tabCharGlobal," "),Q.test(f)||T.test(f)||D.test(f)||x.test(f)||S.test(f))break;if(I.search(this.rules.other.nonSpaceChar)>=g||!f.trim())u+=`
25
+ `+I.slice(g);else{if(m||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(h)||T.test(h)||S.test(h))break;u+=`
26
+ `+f}!m&&!f.trim()&&(m=!0),c+=K+`
27
+ `,n=n.substring(K.length+1),h=I.slice(g)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let O=null,y;this.options.gfm&&(O=this.rules.other.listIsTask.exec(u),O&&(y=O[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!O,checked:y,loose:!1,text:u,tokens:[]}),s.raw+=c}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(h=>h.type==="space"),u=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(n){const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=Gd(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
28
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(const o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(const o of s)i.rows.push(Gd(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));return i}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
29
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const i=Ii(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{const i=Ty(e[2],"()");if(i===-2)return;if(i>-1){const a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Hd(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return Hd(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const i=[...r[0]].length-1;let o,a,l=i,c=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+i);(r=u.exec(e))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const h=[...r[0]][0].length,f=n.slice(0,i+r.index+h+a);if(Math.min(i,a)%2){const g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}const m=f.slice(2,-2);return{type:"strong",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},jr=class au{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ks,this.options.tokenizer=this.options.tokenizer||new el,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:gn,block:ia.normal,inline:Zi.normal};this.options.pedantic?(t.block=ia.pedantic,t.inline=Zi.pedantic):this.options.gfm&&(t.block=ia.gfm,this.options.breaks?t.inline=Zi.breaks:t.inline=Zi.gfm),this.tokenizer.rules=t}static get rules(){return{block:ia,inline:Zi}}static lex(e,t){return new au(t).lex(e)}static lexInline(e,t){return new au(t).inlineTokens(e)}lex(e){e=e.replace(gn.carriageReturn,`
30
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);const o=t.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
31
+ `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
32
+ `+s.raw,o.text+=`
33
+ `+s.text,this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
34
+ `+s.raw,o.text+=`
35
+ `+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0;const a=e.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){const o=t.at(-1);r&&o?.type==="paragraph"?(o.raw+=`
36
+ `+s.raw,o.text+=`
37
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);const o=t.at(-1);o?.type==="text"?(o.raw+=`
38
+ `+s.raw,o.text+=`
39
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,o="";for(;e;){i||(o=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0;const u=e.slice(1);let h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),i=!0;const c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},tl=class{options;parser;constructor(n){this.options=n||Ks}space(n){return""}code({text:n,lang:e,escaped:t}){const r=(e||"").match(gn.notSpaceStart)?.[0],s=n.replace(gn.endingNewline,"")+`
40
+ `;return r?'<pre><code class="language-'+wr(r)+'">'+(t?s:wr(s,!0))+`</code></pre>
41
+ `:"<pre><code>"+(t?s:wr(s,!0))+`</code></pre>
42
+ `}blockquote({tokens:n}){return`<blockquote>
43
+ ${this.parser.parse(n)}</blockquote>
44
+ `}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
45
+ `}hr(n){return`<hr>
46
+ `}list(n){const e=n.ordered,t=n.start;let r="";for(let o=0;o<n.items.length;o++){const a=n.items[o];r+=this.listitem(a)}const s=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+s+i+`>
47
+ `+r+"</"+s+`>
48
+ `}listitem(n){let e="";if(n.task){const t=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=t+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=t+" "+wr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
49
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
50
+ `}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<n.rows.length;s++){const i=n.rows[s];t="";for(let o=0;o<i.length;o++)t+=this.tablecell(i[o]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
51
+ <thead>
52
+ `+e+`</thead>
53
+ `+r+`</table>
54
+ `}tablerow({text:n}){return`<tr>
55
+ ${n}</tr>
56
+ `}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
57
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${wr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const r=this.parser.parseInline(t),s=Ud(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+wr(e)+'"'),i+=">"+r+"</a>",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));const s=Ud(n);if(s===null)return wr(t);n=s;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${wr(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:wr(n.text)}},Rh=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},qr=class lu{options;renderer;textRenderer;constructor(e){this.options=e||Ks,this.options.renderer=this.options.renderer||new tl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rh}static parse(e,t){return new lu(t).parse(e)}static parseInline(e,t){return new lu(t).parseInline(e)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const a=i,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}const o=i;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],l+=`
58
+ `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=a||"";continue}}const o=i;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},La=class{options;block;constructor(n){this.options=n||Ks}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?jr.lex:jr.lexInline}provideParser(){return this.block?qr.parse:qr.parseInline}},Ay=class{defaults=$h();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=qr;Renderer=tl;TextRenderer=Rh;Lexer=jr;Tokenizer=el;Hooks=La;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(const r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{const s=r;for(const i of s.header)t=t.concat(this.walkTokens(i.tokens,e));for(const i of s.rows)for(const o of i)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{const s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{const s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{const o=s[i].flat(1/0);t=t.concat(this.walkTokens(o,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){const s=this.defaults.renderer||new tl(this.defaults);for(const i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const o=i,a=t.renderer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}r.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new el(this.defaults);for(const i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const o=i,a=t.tokenizer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new La;for(const i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const o=i,a=t.hooks[o],l=s[o];La.passThroughHooks.has(i)?s[o]=c=>{if(this.defaults.async)return Promise.resolve(a.call(s,c)).then(h=>l.call(s,h));const u=a.call(s,c);return l.call(s,u)}:s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return jr.lex(n,e??this.defaults)}parser(n,e){return qr.parse(n,e??this.defaults)}parseMarkdown(n){return(t,r)=>{const s={...r},i={...this.defaults,...s},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=n);const a=i.hooks?i.hooks.provideLexer():n?jr.lex:jr.lexInline,l=i.hooks?i.hooks.provideParser():n?qr.parse:qr.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(c=>a(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let c=a(t,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return o(c)}}}onError(n,e){return t=>{if(t.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An error occurred:</p><pre>"+wr(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},qs=new Ay;function dt(n,e){return qs.parse(n,e)}dt.options=dt.setOptions=function(n){return qs.setOptions(n),dt.defaults=qs.defaults,mg(dt.defaults),dt};dt.getDefaults=$h;dt.defaults=Ks;dt.use=function(...n){return qs.use(...n),dt.defaults=qs.defaults,mg(dt.defaults),dt};dt.walkTokens=function(n,e){return qs.walkTokens(n,e)};dt.parseInline=qs.parseInline;dt.Parser=qr;dt.parser=qr.parse;dt.Renderer=tl;dt.TextRenderer=Rh;dt.Lexer=jr;dt.lexer=jr.lex;dt.Tokenizer=el;dt.Hooks=La;dt.parse=dt;dt.options;dt.setOptions;dt.use;dt.walkTokens;dt.parseInline;qr.parse;jr.lex;const{entries:Cg,setPrototypeOf:Kd,isFrozen:_y,getPrototypeOf:Ry,getOwnPropertyDescriptor:Ey}=Object;let{freeze:vn,seal:Hn,create:cu}=Object,{apply:uu,construct:hu}=typeof Reflect<"u"&&Reflect;vn||(vn=function(e){return e});Hn||(Hn=function(e){return e});uu||(uu=function(e,t){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return e.apply(t,s)});hu||(hu=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return new e(...r)});const oa=bn(Array.prototype.forEach),By=bn(Array.prototype.lastIndexOf),Jd=bn(Array.prototype.pop),Xi=bn(Array.prototype.push),Ly=bn(Array.prototype.splice),Da=bn(String.prototype.toLowerCase),ac=bn(String.prototype.toString),lc=bn(String.prototype.match),zi=bn(String.prototype.replace),Dy=bn(String.prototype.indexOf),Zy=bn(String.prototype.trim),or=bn(Object.prototype.hasOwnProperty),fn=bn(RegExp.prototype.test),Ni=Iy(TypeError);function bn(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return uu(n,e,r)}}function Iy(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return hu(n,t)}}function nt(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Da;Kd&&Kd(n,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=t(s);i!==s&&(_y(e)||(e[r]=i),s=i)}n[s]=!0}return n}function Xy(n){for(let e=0;e<n.length;e++)or(n,e)||(n[e]=null);return n}function Sr(n){const e=cu(null);for(const[t,r]of Cg(n))or(n,t)&&(Array.isArray(r)?e[t]=Xy(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Sr(r):e[t]=r);return e}function Vi(n,e){for(;n!==null;){const r=Ey(n,e);if(r){if(r.get)return bn(r.get);if(typeof r.value=="function")return bn(r.value)}n=Ry(n)}function t(){return null}return t}const ef=vn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cc=vn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uc=vn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),zy=vn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hc=vn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ny=vn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),tf=vn(["#text"]),nf=vn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),dc=vn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),rf=vn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),aa=vn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vy=Hn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Wy=Hn(/<%[\w\W]*|[\w\W]*%>/gm),jy=Hn(/\$\{[\w\W]*/gm),qy=Hn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Yy=Hn(/^aria-[\-\w]+$/),Qg=Hn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fy=Hn(/^(?:\w+script|data):/i),Uy=Hn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pg=Hn(/^html$/i),Gy=Hn(/^[a-z][.\w]*(-[.\w]+)+$/i);var sf=Object.freeze({__proto__:null,ARIA_ATTR:Yy,ATTR_WHITESPACE:Uy,CUSTOM_ELEMENT:Gy,DATA_ATTR:qy,DOCTYPE_NAME:Pg,ERB_EXPR:Wy,IS_ALLOWED_URI:Qg,IS_SCRIPT_OR_DATA:Fy,MUSTACHE_EXPR:Vy,TMPLIT_EXPR:jy});const Wi={element:1,text:3,progressingInstruction:7,comment:8,document:9},Hy=function(){return typeof window>"u"?null:window},Ky=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(r=t.getAttribute(s));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},of=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Tg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hy();const e=Be=>Tg(Be);if(e.version="3.3.1",e.removed=[],!n||!n.document||n.document.nodeType!==Wi.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,s=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:m}=n,g=l.prototype,O=Vi(g,"cloneNode"),y=Vi(g,"remove"),x=Vi(g,"nextSibling"),S=Vi(g,"childNodes"),Q=Vi(g,"parentNode");if(typeof o=="function"){const Be=t.createElement("template");Be.content&&Be.content.ownerDocument&&(t=Be.content.ownerDocument)}let T,D="";const{implementation:K,createNodeIterator:I,createDocumentFragment:ue,getElementsByTagName:le}=t,{importNode:oe}=r;let Z=of();e.isSupported=typeof Cg=="function"&&typeof Q=="function"&&K&&K.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:X,ERB_EXPR:B,TMPLIT_EXPR:q,DATA_ATTR:U,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:ve}=sf;let{IS_ALLOWED_URI:te}=sf,he=null;const C=nt({},[...ef,...cc,...uc,...hc,...tf]);let w=null;const _=nt({},[...nf,...dc,...rf,...aa]);let E=Object.seal(cu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,F=null;const ne=Object.seal(cu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,ke=!0,qe=!1,He=!0,me=!1,Ee=!0,de=!1,fe=!1,J=!1,Ce=!1,ze=!1,je=!1,Rt=!0,Lt=!1;const pr="user-content-";let Ut=!0,tn=!1,Vt={},Wt=null;const dn=nt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let nr=null;const mr=nt({},["audio","video","img","source","image","track"]);let Xn=null;const Qt=nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nn="http://www.w3.org/1998/Math/MathML",ee="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let ie=pe,xe=!1,Re=null;const Ue=nt({},[nn,ee,pe],ac);let Ge=nt({},["mi","mo","mn","ms","mtext"]),it=nt({},["annotation-xml"]);const $s=nt({},["title","style","font","a","script"]);let rr=null;const zn=["application/xhtml+xml","text/html"],Cs="text/html";let wt=null,Nn=null;const Qs=t.createElement("form"),ns=function(L){return L instanceof RegExp||L instanceof Function},Dr=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Nn&&Nn===L)){if((!L||typeof L!="object")&&(L={}),L=Sr(L),rr=zn.indexOf(L.PARSER_MEDIA_TYPE)===-1?Cs:L.PARSER_MEDIA_TYPE,wt=rr==="application/xhtml+xml"?ac:Da,he=or(L,"ALLOWED_TAGS")?nt({},L.ALLOWED_TAGS,wt):C,w=or(L,"ALLOWED_ATTR")?nt({},L.ALLOWED_ATTR,wt):_,Re=or(L,"ALLOWED_NAMESPACES")?nt({},L.ALLOWED_NAMESPACES,ac):Ue,Xn=or(L,"ADD_URI_SAFE_ATTR")?nt(Sr(Qt),L.ADD_URI_SAFE_ATTR,wt):Qt,nr=or(L,"ADD_DATA_URI_TAGS")?nt(Sr(mr),L.ADD_DATA_URI_TAGS,wt):mr,Wt=or(L,"FORBID_CONTENTS")?nt({},L.FORBID_CONTENTS,wt):dn,z=or(L,"FORBID_TAGS")?nt({},L.FORBID_TAGS,wt):Sr({}),F=or(L,"FORBID_ATTR")?nt({},L.FORBID_ATTR,wt):Sr({}),Vt=or(L,"USE_PROFILES")?L.USE_PROFILES:!1,Qe=L.ALLOW_ARIA_ATTR!==!1,ke=L.ALLOW_DATA_ATTR!==!1,qe=L.ALLOW_UNKNOWN_PROTOCOLS||!1,He=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=L.SAFE_FOR_TEMPLATES||!1,Ee=L.SAFE_FOR_XML!==!1,de=L.WHOLE_DOCUMENT||!1,Ce=L.RETURN_DOM||!1,ze=L.RETURN_DOM_FRAGMENT||!1,je=L.RETURN_TRUSTED_TYPE||!1,J=L.FORCE_BODY||!1,Rt=L.SANITIZE_DOM!==!1,Lt=L.SANITIZE_NAMED_PROPS||!1,Ut=L.KEEP_CONTENT!==!1,tn=L.IN_PLACE||!1,te=L.ALLOWED_URI_REGEXP||Qg,ie=L.NAMESPACE||pe,Ge=L.MATHML_TEXT_INTEGRATION_POINTS||Ge,it=L.HTML_INTEGRATION_POINTS||it,E=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&ns(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(E.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&ns(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(E.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(E.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),me&&(ke=!1),ze&&(Ce=!0),Vt&&(he=nt({},tf),w=[],Vt.html===!0&&(nt(he,ef),nt(w,nf)),Vt.svg===!0&&(nt(he,cc),nt(w,dc),nt(w,aa)),Vt.svgFilters===!0&&(nt(he,uc),nt(w,dc),nt(w,aa)),Vt.mathMl===!0&&(nt(he,hc),nt(w,rf),nt(w,aa))),L.ADD_TAGS&&(typeof L.ADD_TAGS=="function"?ne.tagCheck=L.ADD_TAGS:(he===C&&(he=Sr(he)),nt(he,L.ADD_TAGS,wt))),L.ADD_ATTR&&(typeof L.ADD_ATTR=="function"?ne.attributeCheck=L.ADD_ATTR:(w===_&&(w=Sr(w)),nt(w,L.ADD_ATTR,wt))),L.ADD_URI_SAFE_ATTR&&nt(Xn,L.ADD_URI_SAFE_ATTR,wt),L.FORBID_CONTENTS&&(Wt===dn&&(Wt=Sr(Wt)),nt(Wt,L.FORBID_CONTENTS,wt)),L.ADD_FORBID_CONTENTS&&(Wt===dn&&(Wt=Sr(Wt)),nt(Wt,L.ADD_FORBID_CONTENTS,wt)),Ut&&(he["#text"]=!0),de&&nt(he,["html","head","body"]),he.table&&(nt(he,["tbody"]),delete z.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=L.TRUSTED_TYPES_POLICY,D=T.createHTML("")}else T===void 0&&(T=Ky(m,s)),T!==null&&typeof D=="string"&&(D=T.createHTML(""));vn&&vn(L),Nn=L}},rs=nt({},[...cc,...uc,...zy]),ss=nt({},[...hc,...Ny]),Ps=function(L){let ge=Q(L);(!ge||!ge.tagName)&&(ge={namespaceURI:ie,tagName:"template"});const De=Da(L.tagName),lt=Da(ge.tagName);return Re[L.namespaceURI]?L.namespaceURI===ee?ge.namespaceURI===pe?De==="svg":ge.namespaceURI===nn?De==="svg"&&(lt==="annotation-xml"||Ge[lt]):!!rs[De]:L.namespaceURI===nn?ge.namespaceURI===pe?De==="math":ge.namespaceURI===ee?De==="math"&&it[lt]:!!ss[De]:L.namespaceURI===pe?ge.namespaceURI===ee&&!it[lt]||ge.namespaceURI===nn&&!Ge[lt]?!1:!ss[De]&&($s[De]||!rs[De]):!!(rr==="application/xhtml+xml"&&Re[L.namespaceURI]):!1},rn=function(L){Xi(e.removed,{element:L});try{Q(L).removeChild(L)}catch{y(L)}},Qn=function(L,ge){try{Xi(e.removed,{attribute:ge.getAttributeNode(L),from:ge})}catch{Xi(e.removed,{attribute:null,from:ge})}if(ge.removeAttribute(L),L==="is")if(Ce||ze)try{rn(ge)}catch{}else try{ge.setAttribute(L,"")}catch{}},Dt=function(L){let ge=null,De=null;if(J)L="<remove></remove>"+L;else{const pt=lc(L,/^[\r\n\t ]+/);De=pt&&pt[0]}rr==="application/xhtml+xml"&&ie===pe&&(L='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+L+"</body></html>");const lt=T?T.createHTML(L):L;if(ie===pe)try{ge=new f().parseFromString(lt,rr)}catch{}if(!ge||!ge.documentElement){ge=K.createDocument(ie,"template",null);try{ge.documentElement.innerHTML=xe?D:lt}catch{}}const Pt=ge.body||ge.documentElement;return L&&De&&Pt.insertBefore(t.createTextNode(De),Pt.childNodes[0]||null),ie===pe?le.call(ge,de?"html":"body")[0]:de?ge.documentElement:Pt},sn=function(L){return I.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pn=function(L){return L instanceof h&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Vn=function(L){return typeof a=="function"&&L instanceof a};function Gt(Be,L,ge){oa(Be,De=>{De.call(e,L,ge,Nn)})}const sr=function(L){let ge=null;if(Gt(Z.beforeSanitizeElements,L,null),Pn(L))return rn(L),!0;const De=wt(L.nodeName);if(Gt(Z.uponSanitizeElement,L,{tagName:De,allowedTags:he}),Ee&&L.hasChildNodes()&&!Vn(L.firstElementChild)&&fn(/<[/\w!]/g,L.innerHTML)&&fn(/<[/\w!]/g,L.textContent)||L.nodeType===Wi.progressingInstruction||Ee&&L.nodeType===Wi.comment&&fn(/<[/\w]/g,L.data))return rn(L),!0;if(!(ne.tagCheck instanceof Function&&ne.tagCheck(De))&&(!he[De]||z[De])){if(!z[De]&&is(De)&&(E.tagNameCheck instanceof RegExp&&fn(E.tagNameCheck,De)||E.tagNameCheck instanceof Function&&E.tagNameCheck(De)))return!1;if(Ut&&!Wt[De]){const lt=Q(L)||L.parentNode,Pt=S(L)||L.childNodes;if(Pt&&lt){const pt=Pt.length;for(let gt=pt-1;gt>=0;--gt){const Mt=O(Pt[gt],!0);Mt.__removalCount=(L.__removalCount||0)+1,lt.insertBefore(Mt,x(L))}}}return rn(L),!0}return L instanceof l&&!Ps(L)||(De==="noscript"||De==="noembed"||De==="noframes")&&fn(/<\/no(script|embed|frames)/i,L.innerHTML)?(rn(L),!0):(me&&L.nodeType===Wi.text&&(ge=L.textContent,oa([X,B,q],lt=>{ge=zi(ge,lt," ")}),L.textContent!==ge&&(Xi(e.removed,{element:L.cloneNode()}),L.textContent=ge)),Gt(Z.afterSanitizeElements,L,null),!1)},Tn=function(L,ge,De){if(Rt&&(ge==="id"||ge==="name")&&(De in t||De in Qs))return!1;if(!(ke&&!F[ge]&&fn(U,ge))){if(!(Qe&&fn(j,ge))){if(!(ne.attributeCheck instanceof Function&&ne.attributeCheck(ge,L))){if(!w[ge]||F[ge]){if(!(is(L)&&(E.tagNameCheck instanceof RegExp&&fn(E.tagNameCheck,L)||E.tagNameCheck instanceof Function&&E.tagNameCheck(L))&&(E.attributeNameCheck instanceof RegExp&&fn(E.attributeNameCheck,ge)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(ge,L))||ge==="is"&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&fn(E.tagNameCheck,De)||E.tagNameCheck instanceof Function&&E.tagNameCheck(De))))return!1}else if(!Xn[ge]){if(!fn(te,zi(De,W,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&L!=="script"&&Dy(De,"data:")===0&&nr[L])){if(!(qe&&!fn(N,zi(De,W,"")))){if(De)return!1}}}}}}}return!0},is=function(L){return L!=="annotation-xml"&&lc(L,ve)},Zr=function(L){Gt(Z.beforeSanitizeAttributes,L,null);const{attributes:ge}=L;if(!ge||Pn(L))return;const De={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let lt=ge.length;for(;lt--;){const Pt=ge[lt],{name:pt,namespaceURI:gt,value:Mt}=Pt,Wn=wt(pt),Ir=Mt;let $t=pt==="value"?Ir:Zy(Ir);if(De.attrName=Wn,De.attrValue=$t,De.keepAttr=!0,De.forceKeepAttr=void 0,Gt(Z.uponSanitizeAttribute,L,De),$t=De.attrValue,Lt&&(Wn==="id"||Wn==="name")&&(Qn(pt,L),$t=pr+$t),Ee&&fn(/((--!?|])>)|<\/(style|title|textarea)/i,$t)){Qn(pt,L);continue}if(Wn==="attributename"&&lc($t,"href")){Qn(pt,L);continue}if(De.forceKeepAttr)continue;if(!De.keepAttr){Qn(pt,L);continue}if(!He&&fn(/\/>/i,$t)){Qn(pt,L);continue}me&&oa([X,B,q],Or=>{$t=zi($t,Or," ")});const gr=wt(L.nodeName);if(!Tn(gr,Wn,$t)){Qn(pt,L);continue}if(T&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!gt)switch(m.getAttributeType(gr,Wn)){case"TrustedHTML":{$t=T.createHTML($t);break}case"TrustedScriptURL":{$t=T.createScriptURL($t);break}}if($t!==Ir)try{gt?L.setAttributeNS(gt,pt,$t):L.setAttribute(pt,$t),Pn(L)?rn(L):Jd(e.removed)}catch{Qn(pt,L)}}Gt(Z.afterSanitizeAttributes,L,null)},os=function Be(L){let ge=null;const De=sn(L);for(Gt(Z.beforeSanitizeShadowDOM,L,null);ge=De.nextNode();)Gt(Z.uponSanitizeShadowNode,ge,null),sr(ge),Zr(ge),ge.content instanceof i&&Be(ge.content);Gt(Z.afterSanitizeShadowDOM,L,null)};return e.sanitize=function(Be){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,De=null,lt=null,Pt=null;if(xe=!Be,xe&&(Be="<!-->"),typeof Be!="string"&&!Vn(Be))if(typeof Be.toString=="function"){if(Be=Be.toString(),typeof Be!="string")throw Ni("dirty is not a string, aborting")}else throw Ni("toString is not a function");if(!e.isSupported)return Be;if(fe||Dr(L),e.removed=[],typeof Be=="string"&&(tn=!1),tn){if(Be.nodeName){const Mt=wt(Be.nodeName);if(!he[Mt]||z[Mt])throw Ni("root node is forbidden and cannot be sanitized in-place")}}else if(Be instanceof a)ge=Dt("<!---->"),De=ge.ownerDocument.importNode(Be,!0),De.nodeType===Wi.element&&De.nodeName==="BODY"||De.nodeName==="HTML"?ge=De:ge.appendChild(De);else{if(!Ce&&!me&&!de&&Be.indexOf("<")===-1)return T&&je?T.createHTML(Be):Be;if(ge=Dt(Be),!ge)return Ce?null:je?D:""}ge&&J&&rn(ge.firstChild);const pt=sn(tn?Be:ge);for(;lt=pt.nextNode();)sr(lt),Zr(lt),lt.content instanceof i&&os(lt.content);if(tn)return Be;if(Ce){if(ze)for(Pt=ue.call(ge.ownerDocument);ge.firstChild;)Pt.appendChild(ge.firstChild);else Pt=ge;return(w.shadowroot||w.shadowrootmode)&&(Pt=oe.call(r,Pt,!0)),Pt}let gt=de?ge.outerHTML:ge.innerHTML;return de&&he["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&fn(Pg,ge.ownerDocument.doctype.name)&&(gt="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
60
+ `+gt),me&&oa([X,B,q],Mt=>{gt=zi(gt,Mt," ")}),T&&je?T.createHTML(gt):gt},e.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dr(Be),fe=!0},e.clearConfig=function(){Nn=null,fe=!1},e.isValidAttribute=function(Be,L,ge){Nn||Dr({});const De=wt(Be),lt=wt(L);return Tn(De,lt,ge)},e.addHook=function(Be,L){typeof L=="function"&&Xi(Z[Be],L)},e.removeHook=function(Be,L){if(L!==void 0){const ge=By(Z[Be],L);return ge===-1?void 0:Ly(Z[Be],ge,1)[0]}return Jd(Z[Be])},e.removeHooks=function(Be){Z[Be]=[]},e.removeAllHooks=function(){Z=of()},e}var Mg=Tg();const Jy={":art:":"🎨",":zap:":"⚡",":fire:":"🔥",":bug:":"🐛",":ambulance:":"🚑",":sparkles:":"✨",":memo:":"📝",":rocket:":"🚀",":lipstick:":"💄",":tada:":"🎉",":white_check_mark:":"✅",":lock:":"🔒",":closed_lock_with_key:":"🔐",":bookmark:":"🔖",":rotating_light:":"🚨",":construction:":"🚧",":green_heart:":"💚",":arrow_down:":"⬇️",":arrow_up:":"⬆️",":pushpin:":"📌",":construction_worker:":"👷",":chart_with_upwards_trend:":"📈",":recycle:":"♻️",":heavy_plus_sign:":"➕",":heavy_minus_sign:":"➖",":wrench:":"🔧",":hammer:":"🔨",":globe_with_meridians:":"🌐",":pencil2:":"✏️",":poop:":"💩",":rewind:":"⏪",":twisted_rightwards_arrows:":"🔀",":package:":"📦",":alien:":"👽",":truck:":"🚚",":page_facing_up:":"📄",":boom:":"💥",":bento:":"🍱",":wheelchair:":"♿",":bulb:":"💡",":beers:":"🍻",":speech_balloon:":"💬",":card_file_box:":"🗃️",":loud_sound:":"🔊",":mute:":"🔇",":busts_in_silhouette:":"👥",":children_crossing:":"🚸",":building_construction:":"🏗️",":iphone:":"📱",":clown_face:":"🤡",":egg:":"🥚",":see_no_evil:":"🙈",":camera_flash:":"📸",":alembic:":"⚗️",":mag:":"🔍",":label:":"🏷️",":seedling:":"🌱",":triangular_flag_on_post:":"🚩",":goal_net:":"🥅",":dizzy:":"💫",":wastebasket:":"🗑️",":passport_control:":"🛂",":adhesive_bandage:":"🩹",":monocle_face:":"🧐",":coffin:":"⚰️",":test_tube:":"🧪",":necktie:":"👔",":stethoscope:":"🩺",":bricks:":"🧱",":technologist:":"🧑‍💻",":money_with_wings:":"💸",":thread:":"🧵",":safety_vest:":"🦺"},ek=/https?:\/\/[^\s<>)"']+/g;function tk(n){return n.replace(ek,e=>`<a href="${e}" target="_blank" rel="noopener noreferrer" class="text-retro-blue hover:underline">${e}</a>`)}function nk(n){return n.replace(/:[a-z0-9_]+:/g,e=>Jy[e]||e)}function rk(n){if(!n)return"";let e=nk(n);return e=dt.parse(e),e=tk(e),e=Mg.sanitize(e,{ALLOWED_TAGS:["a","strong","em","code","b","i","br","p","ul","ol","li","pre","blockquote","h1","h2","h3"],ALLOWED_ATTR:["href","target","rel","class"]}),e}const sk={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},ik={class:"flex items-center gap-2 min-w-0"},ok={class:"text-retro-cyan font-mono text-sm"},ak={class:"text-retro-muted text-sm truncate"},lk={class:"flex items-center gap-1 flex-shrink-0"},ck=["aria-label","title"],uk={class:"flex-1 overflow-auto p-4 space-y-4"},hk={class:"space-y-2"},dk={class:"flex items-center gap-2 text-sm"},fk={class:"text-retro-text font-mono text-xs bg-retro-panel px-2 py-1 rounded"},pk={class:"flex items-center gap-2 text-sm"},mk={class:"text-retro-text"},gk={class:"text-retro-muted"},Ok={key:0,class:"flex items-center gap-2 text-sm"},vk={class:"text-retro-text"},bk={class:"text-retro-muted"},xk={class:"flex items-center gap-2 text-sm"},yk={class:"text-retro-text"},kk={key:1,class:"flex items-start gap-2 text-sm"},wk={class:"flex flex-wrap gap-1"},Sk=["onClick","title"],$k={key:2,class:"flex items-start gap-2 text-sm"},Ck={class:"flex flex-wrap gap-1"},Qk={key:3,class:"flex items-start gap-2 text-sm"},Pk={class:"flex flex-wrap gap-1"},Tk={class:"space-y-1"},Mk={class:"text-retro-text text-sm font-mono bg-retro-panel p-3 rounded"},Ak={key:0,class:"space-y-1"},_k=["innerHTML"],Rk={key:1,class:"space-y-2"},Ek={class:"flex items-center gap-2 text-sm"},Bk={class:"text-retro-muted"},Lk={key:0,class:"flex items-center gap-2"},Dk={class:"text-retro-green text-xs font-mono"},Zk={class:"flex-1 h-2 rounded overflow-hidden bg-retro-panel flex"},Ik={class:"text-retro-red text-xs font-mono"},Xk={key:2,class:"space-y-2"},zk={class:"flex items-center justify-between"},Nk={class:"text-retro-muted text-xs uppercase tracking-wide"},Vk={class:"flex items-center gap-1"},Wk={key:0,class:"text-retro-muted text-sm py-2"},jk={key:1,class:"space-y-0.5"},qk=["onClick"],Yk=["title"],Fk={class:"text-retro-text font-mono text-xs truncate flex-1"},Uk={class:"text-retro-muted"},Gk={class:"text-retro-text"},Hk={key:0,class:"flex-shrink-0 font-mono text-xs flex items-center gap-1"},Kk={key:0,class:"text-retro-green"},Jk={key:1,class:"text-retro-red"},ew={key:1,class:"flex-shrink-0 font-mono text-xs text-retro-muted"},tw={key:2,class:"space-y-0"},nw=["onClick"],rw={class:"text-retro-text font-mono text-xs"},sw=["title"],iw={class:"text-retro-text font-mono text-xs truncate flex-1"},ow={class:"text-retro-muted"},aw={class:"text-retro-text"},lw={key:0,class:"flex-shrink-0 font-mono text-xs flex items-center gap-1"},cw={key:0,class:"text-retro-green"},uw={key:1,class:"text-retro-red"},hw={key:1,class:"flex-shrink-0 font-mono text-xs text-retro-muted"},dw={key:3,class:"flex items-center gap-2 text-retro-muted text-sm py-2"},fw={key:4,class:"text-retro-muted text-sm py-2"},pw=We({__name:"GitCommitDetail",props:{commit:{},files:{},stats:{},loading:{type:Boolean,default:!1},committer:{},committerEmail:{},detailPosition:{default:"inline"}},emits:["close","navigateToCommit","togglePosition","navigatePrev","navigateNext","openFileDiff"],setup(n,{emit:e}){const t=n,r=e,s=R(null),i=R("flat"),o=R(new Set),a=Y(()=>!t.committer||!t.committerEmail?!1:t.committer!==t.commit.author||t.committerEmail!==t.commit.email),l=Y(()=>{const Z=t.commit.body;return Z?rk(Z):""}),c=Y(()=>{if(!t.stats)return"";const{filesChanged:Z,additions:X,deletions:B}=t.stats,U=[`${Z} ${Z===1?"file":"files"} changed`];return X>0&&U.push(`+${X} insertion${X===1?"":"s"}`),B>0&&U.push(`-${B} deletion${B===1?"":"s"}`),U.join(", ")});function u(Z){const X=[];for(const B of Z){const q=B.path.split("/");let U=X;for(let j=0;j<q.length;j++){const N=q[j],W=j===q.length-1,ve=q.slice(0,j+1).join("/");let te=U.find(he=>he.name===N&&he.isDirectory===!W);te||(te={name:N,fullPath:ve,isDirectory:!W,children:[],file:W?B:void 0},U.push(te)),W||(U=te.children)}}return h(X),X}function h(Z){for(const X of Z)if(X.isDirectory)for(h(X.children);X.children.length===1&&X.children[0].isDirectory;){const B=X.children[0];X.name=`${X.name}/${B.name}`,X.fullPath=B.fullPath,X.children=B.children}}function f(Z){return[...Z].sort((X,B)=>X.isDirectory&&!B.isDirectory?-1:!X.isDirectory&&B.isDirectory?1:X.name.localeCompare(B.name))}function m(Z,X,B){const q=[];for(const U of f(Z)){const j=B.size===0?!0:B.has(U.fullPath);q.push({key:U.fullPath,depth:X,isDirectory:U.isDirectory,name:U.name,fullPath:U.fullPath,expanded:U.isDirectory?j:!1,file:U.file}),U.isDirectory&&j&&q.push(...m(U.children,X+1,B))}return q}const g=Y(()=>!t.files||t.files.length===0?[]:u(t.files)),O=Y(()=>m(g.value,0,o.value));function y(Z){o.value.has(Z)?o.value.delete(Z):o.value.add(Z),o.value=new Set(o.value)}function x(){const Z=X=>{const B=[];for(const q of X)q.isDirectory&&(B.push(q.fullPath),B.push(...Z(q.children)));return B};o.value=new Set(Z(g.value))}function S(){o.value=new Set}Ye(i,Z=>{Z==="tree"&&x()});function Q(Z){return new Date(Z*1e3).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}function T(Z){return vi[Z]||{label:Z,colorClass:"text-retro-muted"}}const D=Y(()=>{if(!t.stats)return{addPct:0,delPct:0};const Z=t.stats.additions+t.stats.deletions;return Z===0?{addPct:50,delPct:50}:{addPct:Math.round(t.stats.additions/Z*100),delPct:Math.round(t.stats.deletions/Z*100)}});function K(Z){Z.key==="ArrowUp"?(Z.preventDefault(),r("navigatePrev")):Z.key==="ArrowDown"?(Z.preventDefault(),r("navigateNext")):Z.key==="Escape"&&(Z.preventDefault(),r("close"))}Tt(()=>{Gn(()=>{s.value?.focus()})}),Ye(()=>t.commit.hash,()=>{Gn(()=>{s.value?.focus()})});function I(){r("close")}function ue(Z){r("navigateToCommit",Z)}function le(){r("togglePosition")}function oe(Z){r("openFileDiff",Z)}return(Z,X)=>(v(),b("section",{ref_key:"containerRef",ref:s,tabindex:0,onKeydown:K,class:"flex-1 min-h-0 flex flex-col border-t border-retro-border bg-retro-dark focus:outline-none","aria-label":"Commit details",role:"region"},[d("div",sk,[d("div",ik,[d("span",ok,M(n.commit.shortHash),1),d("span",ak,M(n.commit.message.split(`
61
+ `)[0]),1)]),d("div",lk,[d("button",{onClick:le,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":n.detailPosition==="inline"?"Dock detail to bottom":"Show detail inline",title:n.detailPosition==="inline"?"Dock to bottom":"Show inline"},[n.detailPosition==="inline"?(v(),Oe(p(sg),{key:0,class:"w-4 h-4 text-retro-muted hover:text-retro-text"})):(v(),Oe(p(rg),{key:1,class:"w-4 h-4 text-retro-muted hover:text-retro-text"}))],8,ck),d("button",{onClick:I,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close commit details"},[se(p(Yt),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])])]),d("div",uk,[d("div",hk,[d("div",dk,[X[2]||(X[2]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Hash:",-1)),d("code",fk,M(n.commit.hash),1)]),d("div",pk,[se(p(iu),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",mk,M(n.commit.author),1),d("span",gk,"<"+M(n.commit.email)+">",1)]),a.value?(v(),b("div",Ok,[se(p(iu),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),X[3]||(X[3]=d("span",{class:"text-retro-muted text-xs uppercase mr-1"},"Committer:",-1)),d("span",vk,M(n.committer),1),d("span",bk,"<"+M(n.committerEmail)+">",1)])):V("",!0),d("div",xk,[se(p(ag),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",yk,M(Q(n.commit.timestamp)),1)]),n.commit.parents?.length>0?(v(),b("div",kk,[X[4]||(X[4]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Parents:",-1)),d("div",wk,[(v(!0),b(we,null,Fe(n.commit.parents,B=>(v(),b("button",{key:B,onClick:q=>ue(B),class:"text-retro-cyan font-mono text-xs bg-retro-panel px-2 py-0.5 rounded hover:bg-retro-dark hover:text-retro-text transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-retro-cyan",title:`Navigate to parent ${B.substring(0,7)}`},M(B.substring(0,7)),9,Sk))),128))])])):V("",!0),n.commit.branches?.length>0?(v(),b("div",$k,[X[5]||(X[5]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Branches:",-1)),d("div",Ck,[(v(!0),b(we,null,Fe(n.commit.branches,B=>(v(),b("span",{key:B,class:"text-retro-green font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},M(B),1))),128))])])):V("",!0),n.commit.tags?.length>0?(v(),b("div",Qk,[X[6]||(X[6]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Tags:",-1)),d("div",Pk,[(v(!0),b(we,null,Fe(n.commit.tags,B=>(v(),b("span",{key:B,class:"text-retro-yellow font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},M(B),1))),128))])])):V("",!0)]),d("div",Tk,[X[7]||(X[7]=d("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Message ",-1)),d("div",Mk,M(n.commit.message.split(`
62
+ `)[0]),1)]),n.commit.body?(v(),b("div",Ak,[X[8]||(X[8]=d("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Body ",-1)),d("div",{class:"text-retro-text text-sm font-mono bg-retro-panel p-3 rounded commit-body-rendered",innerHTML:l.value},null,8,_k)])):V("",!0),n.stats?(v(),b("div",Rk,[d("div",Ek,[d("span",Bk,M(c.value),1)]),n.stats.additions>0||n.stats.deletions>0?(v(),b("div",Lk,[d("span",Dk,"+"+M(n.stats.additions),1),d("div",Zk,[d("div",{class:"bg-retro-green h-full transition-all",style:mn({width:D.value.addPct+"%"})},null,4),d("div",{class:"bg-retro-red h-full transition-all",style:mn({width:D.value.delPct+"%"})},null,4)]),d("span",Ik,"-"+M(n.stats.deletions),1)])):V("",!0)])):V("",!0),n.files?(v(),b("div",Xk,[d("div",zk,[d("h4",Nk," Files Changed ("+M(n.files.length)+") ",1),d("div",Vk,[d("button",{onClick:X[0]||(X[0]=B=>i.value="flat"),class:Pe(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",i.value==="flat"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Flat file list",title:"Flat file list"},[se(p(dg),{class:"w-4 h-4"})],2),d("button",{onClick:X[1]||(X[1]=B=>i.value="tree"),class:Pe(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",i.value==="tree"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Tree file view",title:"Tree file view"},[se(p(Dd),{class:"w-4 h-4"})],2)])]),n.files.length===0?(v(),b("div",Wk," No files changed in this commit. ")):i.value==="flat"?(v(),b("ul",jk,[(v(!0),b(we,null,Fe(n.files,B=>(v(),b("li",{key:B.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group cursor-pointer",onClick:q=>oe(B)},[d("span",{class:Pe(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",T(B.status).colorClass]),title:T(B.status).label},M(B.status),11,Yk),se(p(Oi),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",Fk,[B.status==="R"&&B.oldPath?(v(),b(we,{key:0},[d("span",Uk,M(B.oldPath),1),X[9]||(X[9]=d("span",{class:"text-retro-yellow mx-1"},"→",-1)),d("span",Gk,M(B.path),1)],64)):(v(),b(we,{key:1},[Ne(M(B.path),1)],64))]),!B.binary&&(B.additions>0||B.deletions>0)?(v(),b("span",Hk,[B.additions>0?(v(),b("span",Kk,"+"+M(B.additions),1)):V("",!0),B.deletions>0?(v(),b("span",Jk,"-"+M(B.deletions),1)):V("",!0)])):B.binary?(v(),b("span",ew,"binary")):V("",!0)],8,qk))),128))])):(v(),b("div",tw,[d("div",{class:"flex items-center gap-2 mb-1"},[d("button",{onClick:x,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Expand all "),X[10]||(X[10]=d("span",{class:"text-retro-muted text-xs"},"|",-1)),d("button",{onClick:S,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Collapse all ")]),(v(!0),b(we,null,Fe(O.value,B=>(v(),b("div",{key:B.key,class:Pe(["flex items-center gap-1 py-0.5 px-1 hover:bg-retro-panel rounded text-sm cursor-pointer",{"select-none":B.isDirectory}]),style:mn({paddingLeft:B.depth*16+4+"px"}),onClick:q=>B.isDirectory?y(B.fullPath):B.file?oe(B.file):void 0},[B.isDirectory?(v(),b(we,{key:0},[se(p(vh),{class:Pe(["w-3 h-3 text-retro-muted transition-transform flex-shrink-0",{"rotate-90":B.expanded}])},null,8,["class"]),se(p(Dd),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),d("span",rw,M(B.name),1)],64)):B.file?(v(),b(we,{key:1},[d("span",{class:Pe(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",T(B.file.status).colorClass]),title:T(B.file.status).label},M(B.file.status),11,sw),se(p(Oi),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",iw,[B.file.status==="R"&&B.file.oldPath?(v(),b(we,{key:0},[d("span",ow,M(B.file.oldPath.split("/").pop()),1),X[11]||(X[11]=d("span",{class:"text-retro-yellow mx-1"},"→",-1)),d("span",aw,M(B.name),1)],64)):(v(),b(we,{key:1},[Ne(M(B.name),1)],64))]),!B.file.binary&&(B.file.additions>0||B.file.deletions>0)?(v(),b("span",lw,[B.file.additions>0?(v(),b("span",cw,"+"+M(B.file.additions),1)):V("",!0),B.file.deletions>0?(v(),b("span",uw,"-"+M(B.file.deletions),1)):V("",!0)])):B.file.binary?(v(),b("span",hw,"binary")):V("",!0)],64)):V("",!0)],14,nw))),128))]))])):n.loading?(v(),b("div",dw,[...X[12]||(X[12]=[d("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),Ne(" Loading file changes... ",-1)])])):(v(),b("div",fw," Failed to load file changes. "))])],544))}}),mw=Do(pw,[["__scopeId","data-v-29f450ea"]]),gw={class:"flex-1 min-h-0 flex flex-col border-t border-retro-border bg-retro-dark","aria-label":"Uncommitted changes details"},Ow={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},vw={class:"flex items-center gap-2 min-w-0"},bw={class:"text-retro-muted text-sm"},xw={key:0,class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin",title:"Staging..."},yw={class:"flex-1 overflow-auto p-4 space-y-3"},kw={class:"space-y-2"},ww=["disabled"],Sw={class:"space-y-1"},$w={class:"flex items-center justify-between"},Cw={class:"text-retro-green text-xs uppercase tracking-wide font-semibold"},Qw={key:0,class:"text-retro-muted text-xs py-1"},Pw={key:1,class:"space-y-0.5"},Tw=["aria-label","onClick"],Mw={class:"text-retro-text font-mono text-xs truncate"},Aw={class:"space-y-1"},_w={class:"flex items-center justify-between"},Rw={class:"text-retro-yellow text-xs uppercase tracking-wide font-semibold"},Ew={key:0,class:"text-retro-muted text-xs py-1"},Bw={key:1,class:"space-y-0.5"},Lw=["aria-label","onClick"],Dw={class:"text-retro-text font-mono text-xs truncate"},Zw=We({__name:"GitUncommittedDetail",props:{stagedFiles:{default:()=>[]},unstagedFiles:{default:()=>[]},isStaging:{type:Boolean,default:!1},isCommitting:{type:Boolean,default:!1}},emits:["close","stageFiles","unstageFiles","stageAll","unstageAll","commit"],setup(n,{emit:e}){const t=n,r=e,s=R(""),i=R(!1),o=Y(()=>s.value.trim().length>0&&t.stagedFiles.length>0&&!i.value&&!t.isCommitting);function a(O){return vi[O]||{label:O,colorClass:"text-retro-muted"}}function l(){r("close")}function c(O){r("stageFiles",[O.path])}function u(O){r("unstageFiles",[O.path])}function h(){r("stageAll")}function f(){r("unstageAll")}async function m(){o.value&&(i.value=!0,r("commit",s.value.trim()),s.value="",i.value=!1)}function g(O){(O.metaKey||O.ctrlKey)&&O.key==="Enter"&&(O.preventDefault(),m())}return(O,y)=>(v(),b("section",gw,[d("div",Ow,[d("div",vw,[se(p(Mi),{class:"w-4 h-4 text-retro-yellow"}),y[1]||(y[1]=d("span",{class:"text-retro-yellow font-semibold text-sm"},"Uncommitted Changes",-1)),d("span",bw,"("+M(n.stagedFiles.length+n.unstagedFiles.length)+" files)",1),t.isStaging?(v(),b("div",xw)):V("",!0)]),d("button",{onClick:l,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close uncommitted changes details"},[se(p(Yt),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])]),d("div",yw,[d("div",kw,[tt(d("textarea",{"onUpdate:modelValue":y[0]||(y[0]=x=>at(s)?s.value=x:null),placeholder:"Commit message...",rows:"3",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none font-mono",onKeydown:g},null,544),[[cn,p(s)]]),d("button",{disabled:!p(o),class:Pe(["w-full px-3 py-1.5 text-sm font-semibold rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",p(o)?"bg-retro-green text-retro-dark hover:bg-retro-green/90":"bg-retro-green/30 text-retro-dark"]),onClick:m},M(p(i)||t.isCommitting?"Committing...":`Commit (${n.stagedFiles.length} staged)`),11,ww)]),d("div",Sw,[d("div",$w,[d("h4",Cw," Staged Changes ("+M(n.stagedFiles.length)+") ",1),n.stagedFiles.length>0?(v(),b("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:f}," Unstage All ")):V("",!0)]),n.stagedFiles.length===0?(v(),b("div",Qw," No staged files. Stage files below to commit. ")):(v(),b("ul",Pw,[(v(!0),b(we,null,Fe(n.stagedFiles,x=>(v(),b("li",{key:"staged-"+x.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[d("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-red/20 transition-colors opacity-60 group-hover:opacity-100",title:"Unstage file","aria-label":`Unstage ${x.path}`,onClick:S=>u(x)},[se(p(Rb),{class:"w-3.5 h-3.5 text-retro-red"})],8,Tw),d("span",{class:Pe(["flex-shrink-0 w-4 text-center text-xs font-bold",a(x.status).colorClass])},M(x.status),3),se(p(Oi),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),d("span",Mw,M(x.oldPath?`${x.oldPath} → ${x.path}`:x.path),1)]))),128))]))]),d("div",Aw,[d("div",_w,[d("h4",Rw," Unstaged Changes ("+M(n.unstagedFiles.length)+") ",1),n.unstagedFiles.length>0?(v(),b("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:h}," Stage All ")):V("",!0)]),n.unstagedFiles.length===0?(v(),b("div",Ew," No unstaged changes. ")):(v(),b("ul",Bw,[(v(!0),b(we,null,Fe(n.unstagedFiles,x=>(v(),b("li",{key:"unstaged-"+x.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[d("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-green/20 transition-colors opacity-60 group-hover:opacity-100",title:"Stage file","aria-label":`Stage ${x.path}`,onClick:S=>c(x)},[se(p(Ll),{class:"w-3.5 h-3.5 text-retro-green"})],8,Lw),d("span",{class:Pe(["flex-shrink-0 w-4 text-center text-xs font-bold",a(x.status).colorClass])},M(x.status),3),se(p(Oi),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),d("span",Dw,M(x.oldPath?`${x.oldPath} → ${x.path}`:x.path),1)]))),128))]))])])]))}}),Iw=["aria-label"],Xw={key:0,class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border truncate font-mono"},zw={key:0,class:"my-1 border-t border-retro-border",role:"separator"},Nw=["aria-disabled","onClick","onMouseenter"],Vw={key:1,class:"w-4 h-4 flex-shrink-0"},af=220,Ww=36,jw=9,qw=29,zr=8,Xo=We({__name:"GitContextMenu",props:{items:{},x:{},y:{},title:{}},emits:["close","action"],setup(n,{emit:e}){const t=n,r=e,s=R(null),i=R(-1),o=Y(()=>t.items.map((m,g)=>({item:m,i:g})).filter(({item:m})=>!m.disabled).map(({i:m})=>m));let a=!1;function l(m){a&&s.value&&!s.value.contains(m.target)&&r("close")}Tt(()=>{requestAnimationFrame(()=>{a=!0}),document.addEventListener("mousedown",l),document.addEventListener("contextmenu",l),Gn(()=>{s.value?.focus()})}),zt(()=>{a=!1,document.removeEventListener("mousedown",l),document.removeEventListener("contextmenu",l)});function c(m){const g=o.value;if(g.length===0)return;if(i.value===-1){i.value=m===1?g[0]:g[g.length-1];return}const O=g.indexOf(i.value);if(O===-1){i.value=m===1?g[0]:g[g.length-1];return}const y=O+m;y>=0&&y<g.length&&(i.value=g[y])}function u(m){switch(m.key){case"Escape":m.preventDefault(),r("close");break;case"ArrowDown":m.preventDefault(),c(1);break;case"ArrowUp":m.preventDefault(),c(-1);break;case"Enter":{m.preventDefault();const g=t.items[i.value];g&&!g.disabled&&(r("action",g.key),r("close"));break}}}function h(m){m.disabled||(r("action",m.key),r("close"))}const f=Y(()=>{const m=t.title?qw:0,g=t.items.filter(Q=>Q.separator).length,O=t.items.length*Ww+g*jw+zr,y=m+O;let x=t.x,S=t.y;return typeof window<"u"&&(x+af>window.innerWidth-zr&&(x=window.innerWidth-af-zr),x<zr&&(x=zr),S+y>window.innerHeight-zr&&(S=window.innerHeight-y-zr),S<zr&&(S=zr)),{left:`${x}px`,top:`${S}px`}});return(m,g)=>(v(),Oe(cr,{to:"body"},[d("div",{ref_key:"menuRef",ref:s,class:"fixed z-50 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px]",style:mn(p(f)),role:"menu","aria-label":n.title??"Context menu",tabindex:"-1",onKeydown:u},[n.title?(v(),b("div",Xw,M(n.title),1)):V("",!0),(v(!0),b(we,null,Fe(n.items,(O,y)=>(v(),b(we,{key:O.key},[O.separator?(v(),b("div",zw)):V("",!0),d("button",{class:Pe(["w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors focus:outline-none",[O.disabled?"text-retro-muted/50 cursor-not-allowed":O.danger?["text-retro-red hover:bg-retro-red/10 focus:bg-retro-red/10",p(i)===y?"bg-retro-red/10":""]:["text-retro-text hover:bg-retro-cyan/10 focus:bg-retro-cyan/10",p(i)===y?"bg-retro-cyan/10":""]]]),role:"menuitem","aria-disabled":O.disabled||void 0,tabindex:-1,onClick:x=>h(O),onMouseenter:x=>i.value=O.disabled?p(i):y,onMouseleave:g[0]||(g[0]=x=>i.value=-1)},[O.icon?(v(),Oe(mi(O.icon),{key:0,class:Pe(["w-4 h-4 flex-shrink-0",O.disabled?"opacity-50":O.danger?"":"text-retro-muted"])},null,8,["class"])):(v(),b("span",Vw)),Ne(" "+M(O.label),1)],42,Nw)],64))),128))],44,Iw)]))}}),Yw=We({__name:"GitBranchMenu",props:{branchName:{},isCurrentBranch:{type:Boolean},isLocal:{type:Boolean},x:{},y:{}},emits:["close","checkout","createBranch","deleteBranch","rename","merge","rebase","push","pull","fetch","copyName"],setup(n,{emit:e}){const t=n,r=e,s=Y(()=>[{key:"checkout",label:"Checkout",icon:js,disabled:t.isCurrentBranch},{key:"rename",label:"Rename",icon:Kv,separator:!0},{key:"deleteBranch",label:"Delete",icon:Gr,danger:!0,disabled:t.isCurrentBranch},{key:"merge",label:"Merge into Current",icon:ig,separator:!0,disabled:t.isCurrentBranch},{key:"rebase",label:"Rebase Current Onto",icon:eg,disabled:t.isCurrentBranch},{key:"push",label:"Push",icon:tg,separator:!0},{key:"copyName",label:"Copy Branch Name",icon:gi,separator:!0}]),i=Y(()=>[{key:"checkout",label:"Checkout",icon:js},{key:"deleteBranch",label:"Delete Remote Branch",icon:Gr,separator:!0,danger:!0},{key:"fetch",label:"Fetch",icon:lg,separator:!0},{key:"pull",label:"Pull into Current",icon:pb},{key:"copyName",label:"Copy Branch Name",icon:gi,separator:!0}]),o=Y(()=>t.isLocal?s.value:i.value),a={checkout:()=>r("checkout"),createBranch:()=>r("createBranch"),deleteBranch:()=>r("deleteBranch"),rename:()=>r("rename"),merge:()=>r("merge"),rebase:()=>r("rebase"),push:()=>r("push"),pull:()=>r("pull"),fetch:()=>r("fetch"),copyName:()=>r("copyName")};function l(c){a[c]?.(),r("close")}return(c,u)=>{const h=Xo;return v(),Oe(h,{items:p(o),x:n.x,y:n.y,title:n.branchName,onAction:l,onClose:u[0]||(u[0]=f=>r("close"))},null,8,["items","x","y","title"])}}}),Fw=We({__name:"GitCommitMenu",props:{commit:{},x:{},y:{}},emits:["close","addTag","createBranch","checkout","cherryPick","revert","mergeInto","reset","copyHash","copySubject"],setup(n,{emit:e}){const t=e,r=Y(()=>[{key:"addTag",label:"Add Tag",icon:Sh},{key:"createBranch",label:"Create Branch",icon:Ll},{key:"checkout",label:"Checkout (detached HEAD)",icon:js,separator:!0},{key:"cherryPick",label:"Cherry Pick",icon:$b},{key:"revert",label:"Revert",icon:ng},{key:"mergeInto",label:"Merge into Current",icon:ig,separator:!0},{key:"reset",label:"Reset Current Branch to Here",icon:eg,danger:!0},{key:"copyHash",label:"Copy Commit Hash",icon:gi,separator:!0},{key:"copySubject",label:"Copy Commit Subject",icon:gi}]),s={addTag:()=>t("addTag"),createBranch:()=>t("createBranch"),checkout:()=>t("checkout"),cherryPick:()=>t("cherryPick"),revert:()=>t("revert"),mergeInto:()=>t("mergeInto"),reset:()=>t("reset"),copyHash:()=>t("copyHash"),copySubject:()=>t("copySubject")};function i(o){s[o]?.(),t("close")}return(o,a)=>{const l=Xo;return v(),Oe(l,{items:p(r),x:n.x,y:n.y,title:n.commit.shortHash,onAction:i,onClose:a[0]||(a[0]=c=>t("close"))},null,8,["items","x","y","title"])}}}),Uw=We({__name:"GitTagMenu",props:{tagName:{},x:{},y:{}},emits:["close","viewDetails","deleteTag","pushTag","copyName"],setup(n,{emit:e}){const t=e,r=[{key:"viewDetails",label:"View Details",icon:Sh},{key:"deleteTag",label:"Delete Tag",icon:Gr,separator:!0,danger:!0},{key:"pushTag",label:"Push Tag",icon:tg},{key:"copyName",label:"Copy Tag Name",icon:gi,separator:!0}],s={viewDetails:()=>t("viewDetails"),deleteTag:()=>t("deleteTag"),pushTag:()=>t("pushTag"),copyName:()=>t("copyName")};function i(o){s[o]?.()}return(o,a)=>{const l=Xo;return v(),Oe(l,{items:r,x:n.x,y:n.y,title:n.tagName,onClose:a[0]||(a[0]=c=>t("close")),onAction:i},null,8,["x","y","title"])}}}),Gw=We({__name:"GitStashMenu",props:{stashIndex:{},stashMessage:{},x:{},y:{}},emits:["close","apply","pop","drop","createBranch","copyName","copyHash"],setup(n,{emit:e}){const t=e,r=[{key:"apply",label:"Apply Stash",icon:fb},{key:"pop",label:"Pop Stash",icon:ng},{key:"createBranch",label:"Create Branch from Stash",icon:Jv,separator:!0},{key:"drop",label:"Drop Stash",icon:Gr,separator:!0,danger:!0},{key:"copyName",label:"Copy Stash Reference",icon:gi,separator:!0},{key:"copyHash",label:"Copy Stash Hash",icon:Mb}],s={apply:()=>t("apply"),pop:()=>t("pop"),drop:()=>t("drop"),createBranch:()=>t("createBranch"),copyName:()=>t("copyName"),copyHash:()=>t("copyHash")};function i(o){s[o]?.()}return(o,a)=>{const l=Xo;return v(),Oe(l,{items:r,x:n.x,y:n.y,title:n.stashMessage,onClose:a[0]||(a[0]=c=>t("close")),onAction:i},null,8,["x","y","title"])}}}),Hw=We({__name:"GitUncommittedMenu",props:{x:{},y:{}},emits:["close","stash","reset","clean"],setup(n,{emit:e}){const t=e,r=[{key:"stash",label:"Stash Uncommitted Changes",icon:db},{key:"reset",label:"Reset Working Directory",icon:js,separator:!0,danger:!0},{key:"clean",label:"Clean Untracked Files",icon:Gr,danger:!0}],s={stash:()=>t("stash"),reset:()=>t("reset"),clean:()=>t("clean")};function i(o){s[o]?.()}return(o,a)=>{const l=Xo;return v(),Oe(l,{items:r,x:n.x,y:n.y,title:"Uncommitted Changes",onClose:a[0]||(a[0]=c=>t("close")),onAction:i},null,8,["x","y"])}}}),Kw={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},Jw={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},eS={class:"text-sm font-mono text-retro-text"},tS={class:"p-4"},nS={key:0,class:"mb-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},rS={class:"flex justify-end gap-2 px-4 py-3 border-t border-retro-border"},sS=["disabled"],iS=["disabled"],xn=We({__name:"GitDialog",props:{title:{},visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null},confirmLabel:{default:"Confirm"},confirmDanger:{type:Boolean,default:!1},cancelLabel:{default:"Cancel"}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e;function s(i){i.key==="Escape"&&r("close"),i.key==="Enter"&&!t.loading&&(i.preventDefault(),r("confirm"))}return Ye(()=>t.visible,i=>{i?document.addEventListener("keydown",s):document.removeEventListener("keydown",s)}),zt(()=>{document.removeEventListener("keydown",s)}),(i,o)=>(v(),Oe(cr,{to:"body"},[se(Ur,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:bt(()=>[n.visible?(v(),b("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",role:"dialog","aria-modal":"true",onClick:o[3]||(o[3]=ln(a=>r("close"),["self"]))},[d("div",Kw,[d("div",Jw,[d("h3",eS,M(n.title),1),d("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close",onClick:o[0]||(o[0]=a=>r("close"))},[se(p(Yt),{class:"h-4 w-4"})])]),d("div",tS,[n.error?(v(),b("div",nS,M(n.error),1)):V("",!0),Gm(i.$slots,"default")]),d("div",rS,[d("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:n.loading,onClick:o[1]||(o[1]=a=>r("close"))},M(n.cancelLabel),9,sS),d("button",{type:"button",class:Pe(["px-3 py-1.5 text-xs font-mono rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",[n.confirmDanger?"text-retro-red bg-retro-red/10 border border-retro-red/30 hover:bg-retro-red/20":"text-retro-black bg-retro-cyan hover:bg-retro-cyan/80"]]),disabled:n.loading,onClick:o[2]||(o[2]=a=>r("confirm"))},M(n.loading?"Loading...":n.confirmLabel),11,iS)])])])):V("",!0)]),_:3})]))}}),Vl=mh("gitGraph",()=>{const n=R([]),e=R([]),t=R([]),r=R(new Set),s=R([]),i=R([]),o=R(0),a=R(!1),l=R(null),c=R(null),u=R(null),h=R(!1),f=R(null),m=R(!1),g=R(0),O=R(""),y=R([]),x=R(null),S=R(!1),Q=R(!1),T=R(!1),D=R(!1),K=8e3,I=R(null);let ue=null;function le(H){I.value=H,ue&&clearTimeout(ue),ue=setTimeout(()=>{I.value=null},K)}function oe(){I.value=null,ue&&(clearTimeout(ue),ue=null)}async function Z(H,ce,Ae,It){if(!x.value)return{success:!1,error:"No working directory set"};try{const vr=await $fetch(H,{method:It?.method??"POST",body:{workingDirectory:x.value,...ce}});return(It?.reloadGraph??!0)&&await Ut(x.value),{success:!0,data:vr}}catch(vr){const br=sa(vr,Ae);return le(br),{success:!1,error:br}}}const X=R(null),B=R(!1),q=R(!1),U=R(null),j=R([]),N=R([]),W=R(null),ve=R(null),te=R(null),he=R("inline"),C=R("list"),w=R("rounded"),_=R(!1),E=R({date:!0,author:!0,commit:!0}),z=R(0),F=R(0),ne=R(null),Qe=R(null),ke=R(null),qe=R(null),He=R(null),me=R(null),Ee=R(null),de=R(null),fe=R(null),J=R(null),Ce=R(null),ze=R(!1),je=new Map,Rt=10,Lt=Y(()=>{if(!O.value&&y.value.length===0)return n.value;let H=n.value;if(O.value){const ce=O.value.toLowerCase(),Ae=`${ce}:${n.value.length}`;if(je.has(Ae))H=je.get(Ae);else{if(H=qd(H,ce),je.size>=Rt){const It=je.keys().next().value;It&&je.delete(It)}je.set(Ae,H)}}if(y.value.length>0){const ce=new Set(y.value);H=Ax(H,ce)}return H}),pr=Y(()=>e.value.find(H=>H.isHead)||null);async function Ut(H){x.value=H,h.value=!0,f.value=null;try{const[ce,Ae,It,vr,br]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:H}}),$fetch("/api/git/status",{query:{workingDirectory:H}}),$fetch("/api/git/stash",{query:{workingDirectory:H}}).then(as=>as.stashes).catch(()=>[]),$fetch("/api/git/remotes",{query:{workingDirectory:H}}).then(as=>as.remotes).catch(()=>[]),$fetch("/api/git/state",{query:{workingDirectory:H}}).then(as=>as.state).catch(()=>null)]);n.value=ce.commits,e.value=ce.branches,t.value=ce.tags,r.value=new Set(ce.localBranches??[]),m.value=ce.hasMore,g.value=ce.totalCount,s.value=Ae.stagedFiles??[],i.value=Ae.unstagedFiles??[],o.value=(Ae.stagedCount??0)+(Ae.unstagedCount??0),j.value=It,N.value=vr,U.value=br,X.value=Date.now(),await $()}catch(ce){const Ae=ce instanceof Error?ce.message:"Failed to load git graph";f.value=Ae,n.value=[],e.value=[],t.value=[],s.value=[],i.value=[],o.value=0,j.value=[],N.value=[]}finally{h.value=!1}}async function tn(){if(x.value)try{const H=await $fetch("/api/git/status",{query:{workingDirectory:x.value}});s.value=H.stagedFiles??[],i.value=H.unstagedFiles??[],o.value=(H.stagedCount??0)+(H.unstagedCount??0)}catch(H){console.error("Failed to refresh uncommitted changes:",H)}}const Vt=R(!1);async function Wt(){if(!(!x.value||!m.value||h.value||Vt.value)){Vt.value=!0;try{const H=await $fetch("/api/git/log",{query:{workingDirectory:x.value,offset:n.value.length}});n.value=[...n.value,...H.commits],m.value=H.hasMore}catch(H){console.error("Failed to load more commits:",H)}finally{Vt.value=!1}}}async function dn(H){if(l.value=H,c.value=null,u.value=null,a.value=!1,S.value=!0,!x.value){S.value=!1;return}try{const ce=await $fetch("/api/git/show",{query:{workingDirectory:x.value,hash:H.hash}});c.value=ce.files,u.value=ce.stats}catch(ce){console.error("Failed to load commit details:",ce),c.value=[],u.value={additions:0,deletions:0,filesChanged:0},le("Failed to load commit details")}finally{S.value=!1}}function nr(){l.value=null,c.value=null,u.value=null,a.value=!1}function mr(){l.value=null,u.value=null,c.value=null,a.value=!0}function Xn(H){O.value=H,z.value=0,nn()}const Qt=Y(()=>O.value?qd(n.value,O.value).map(H=>H.hash):[]);function nn(){F.value=Qt.value.length}function ee(){Qt.value.length!==0&&(z.value=(z.value+1)%Qt.value.length,nn(),ie())}function pe(){Qt.value.length!==0&&(z.value=z.value<=0?Qt.value.length-1:z.value-1,nn(),ie())}function ie(){const H=Qt.value[z.value];if(H){const ce=n.value.find(Ae=>Ae.hash===H);ce&&dn(ce)}}function xe(H){const ce=y.value.indexOf(H);ce===-1?y.value.push(H):y.value.splice(ce,1)}function Re(){O.value="",y.value=[]}async function Ue(H){if(!x.value)return{success:!1,error:"No working directory set"};D.value=!0;try{const ce=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:x.value,branchName:H}});return ce.success&&await Ut(x.value),{success:ce.success,error:ce.error}}catch(ce){const Ae=ce instanceof Error?ce.message:"Failed to checkout branch";return le(Ae),{success:!1,error:Ae}}finally{D.value=!1}}async function Ge(H,ce){if(!x.value)return{success:!1,error:"No working directory set"};try{const Ae=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:x.value,branchName:H,createBranch:!0,fromCommit:ce}});return Ae.success&&await Ut(x.value),{success:Ae.success,error:Ae.error}}catch(Ae){return{success:!1,error:Ae instanceof Error?Ae.message:"Failed to create branch"}}}async function it(H,ce=!1){return Z("/api/git/branch",{branchName:H,force:ce},"Failed to delete branch",{method:"DELETE"})}async function $s(H){return Z("/api/git/branch",{branchName:H,remote:!0},"Failed to delete remote branch",{method:"DELETE"})}async function rr(H){if(!x.value)return{success:!1,error:"No working directory set"};Q.value=!0;try{return await $fetch("/api/git/stage",{method:"POST",body:{workingDirectory:x.value,files:H}}),await tn(),{success:!0}}catch(ce){const Ae=ce instanceof Error?ce.message:"Failed to stage files";return le(Ae),{success:!1,error:Ae}}finally{Q.value=!1}}async function zn(H){if(!x.value)return{success:!1,error:"No working directory set"};Q.value=!0;try{return await $fetch("/api/git/unstage",{method:"POST",body:{workingDirectory:x.value,files:H}}),await tn(),{success:!0}}catch(ce){const Ae=ce instanceof Error?ce.message:"Failed to unstage files";return le(Ae),{success:!1,error:Ae}}finally{Q.value=!1}}async function Cs(H){if(!x.value)return{success:!1,error:"No working directory set"};T.value=!0;try{return await $fetch("/api/git/commit",{method:"POST",body:{workingDirectory:x.value,message:H}}),await Ut(x.value),{success:!0}}catch(ce){const Ae=ce instanceof Error?ce.message:"Failed to commit changes";return le(Ae),{success:!1,error:Ae}}finally{T.value=!1}}async function wt(H,ce){return Z("/api/git/branch-rename",{oldName:H,newName:ce},"Failed to rename branch")}async function Nn(H,ce){return Z("/api/git/merge",{branch:H,...ce},"Failed to merge branch")}async function Qs(H){return Z("/api/git/rebase",{onto:H},"Failed to rebase branch")}async function ns(H,ce,Ae,It){return Z("/api/git/push",{branch:H,remote:ce,force:Ae,forceWithLease:It},"Failed to push branch")}async function Dr(H,ce,Ae,It){return Z("/api/git/pull",{branch:H,remote:ce,noFastForward:Ae,squash:It},"Failed to pull branch")}async function rs(H,ce,Ae){return Z("/api/git/fetch",{branch:H,remote:ce,...Ae},"Failed to fetch")}async function ss(H,ce,Ae){return Z("/api/git/cherry-pick",{hash:H,recordOrigin:ce,noCommit:Ae},"Failed to cherry-pick commit")}async function Ps(H){return Z("/api/git/revert",{hash:H},"Failed to revert commit")}async function rn(H,ce){return Z("/api/git/reset",{hash:H,mode:ce},"Failed to reset to commit")}async function Qn(H){if(!x.value)return{success:!1,error:"No working directory set"};try{return await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:x.value,branchName:H}}),await Ut(x.value),{success:!0}}catch(ce){const Ae=ce?.data?.message||ce?.statusMessage||ce?.message||"Failed to checkout commit";return le(Ae),{success:!1,error:Ae}}}async function Dt(H){try{const ce=H.message.split(`
63
+ `)[0];return await Ms(ce),{success:!0}}catch(ce){const Ae=ce?.message||"Failed to copy commit subject";return le(Ae),{success:!1,error:Ae}}}async function sn(H,ce,Ae,It,vr){return Z("/api/git/tag",{name:H,hash:ce,annotated:Ae,message:It,pushToRemote:vr},"Failed to create tag")}async function Pn(H,ce){return Z("/api/git/tag",{name:H,deleteFromRemote:ce},"Failed to delete tag",{method:"DELETE"})}async function Vn(H,ce){return Z("/api/git/tag-push",{name:H,remote:ce},"Failed to push tag")}async function Gt(H){if(!x.value)return{success:!1,error:"No working directory set"};try{return{success:!0,data:await $fetch(`/api/git/tag/${encodeURIComponent(H)}`,{query:{workingDirectory:x.value}})}}catch(ce){const Ae=sa(ce,"Failed to get tag detail");return le(Ae),{success:!1,error:Ae}}}async function sr(H){try{return await Ms(H),{success:!0}}catch(ce){const Ae=ce?.message||"Failed to copy tag name";return le(Ae),{success:!1,error:Ae}}}async function Tn(){if(!x.value)return{success:!1,error:"No working directory set"};try{const H=await $fetch("/api/git/stash",{query:{workingDirectory:x.value}});return j.value=H.stashes,{success:!0}}catch(H){const ce=sa(H,"Failed to load stashes");return le(ce),{success:!1,error:ce}}}async function is(H,ce){return Z("/api/git/stash-apply",{index:H,reinstateIndex:ce},"Failed to apply stash")}async function Zr(H,ce){return Z("/api/git/stash-pop",{index:H,reinstateIndex:ce},"Failed to pop stash")}async function os(H){return Z("/api/git/stash-drop",{index:H},"Failed to drop stash")}async function Be(H,ce){return Z("/api/git/stash-branch",{index:H,branchName:ce},"Failed to create branch from stash")}async function L(H,ce){return Z("/api/git/stash",{message:H,includeUntracked:ce},"Failed to stash changes")}async function ge(){if(!x.value)return{success:!1,error:"No working directory set"};try{const H=await $fetch("/api/git/remotes",{query:{workingDirectory:x.value}});return N.value=H.remotes,{success:!0}}catch(H){const ce=sa(H,"Failed to load remotes");return le(ce),{success:!1,error:ce}}}async function De(H,ce){return Z("/api/git/remote",{name:H,url:ce},"Failed to add remote")}async function lt(H,ce){return Z("/api/git/remote",{name:H,newUrl:ce},"Failed to edit remote",{method:"PUT"})}async function Pt(H){return Z("/api/git/remote",{name:H},"Failed to delete remote",{method:"DELETE"})}async function pt(H,ce){return Z("/api/git/fetch",{all:!0,prune:H,pruneTags:ce},"Failed to fetch all")}function gt(){he.value=he.value==="inline"?"bottom":"inline"}function Mt(){C.value=C.value==="list"?"tree":"list"}function Wn(H){w.value=H}function Ir(){_.value=!_.value}function $t(H){E.value={...E.value,[H]:!E.value[H]}}async function gr(H){if(ne.value=H,Qe.value=null,H&&x.value)try{const ce=await $fetch("/api/git/merge-base",{params:{workingDirectory:x.value,branch:H}});Qe.value=ce.mergeBase}catch{Qe.value=null}}async function Or(H,ce){if(ke.value=H,qe.value=null,He.value=ce??null,H&&x.value)try{const Ae=await $fetch("/api/git/merge-base",{params:{workingDirectory:x.value,branch:H,baseBranch:ce??void 0}});qe.value=Ae.mergeBase}catch{qe.value=null}}async function Li(H,ce){if(me.value=H,Ee.value=null,de.value=ce??null,H&&x.value)try{const Ae=await $fetch("/api/git/merge-base",{params:{workingDirectory:x.value,branch:H,baseBranch:ce??void 0}});Ee.value=Ae.mergeBase}catch{Ee.value=null}}async function Ts(H,ce,Ae){try{const It=await $fetch("/api/git/merge-base",{params:{workingDirectory:x.value,branch:H,baseBranch:ce??void 0}});Ae.value=It.mergeBase}catch{Ae.value=null}}async function $(){if(!x.value)return;const H=[];ne.value&&H.push(Ts(ne.value,void 0,Qe)),ke.value&&H.push(Ts(ke.value,He.value,qe)),me.value&&H.push(Ts(me.value,de.value,Ee)),H.length>0&&await Promise.all(H)}function k(H){const ce=n.value.find(Ae=>Ae.hash===H||Ae.shortHash===H);ce&&dn(ce)}async function A(H){return Z("/api/git/reset",{hash:"HEAD",mode:H},"Failed to reset working directory")}async function G(){return Z("/api/git/clean",{},"Failed to clean untracked files")}function re(H){ve.value=H}function ye(){ve.value=null}function Te(H){te.value=H}function Ze(){te.value=null}const et=R(null),Ot=R(null),Zt=R(!1),ea=Y(()=>!!W.value&&!!l.value);function Xr(H){W.value=H,H&&l.value&&Xe()}function Di(){W.value=null,et.value=null,Ot.value=null,Zt.value=!1}async function Xe(){if(!(!x.value||!l.value||!W.value)){Zt.value=!0;try{const H=W.value.hash,ce=l.value.hash,Ae=await $fetch("/api/git/diff",{query:{workingDirectory:x.value,from:H,to:ce}});et.value=Ae.files,Ot.value=Ae.stats}catch(H){console.error("Failed to load comparison:",H),le("Failed to load commit comparison"),et.value=null,Ot.value=null}finally{Zt.value=!1}}}async function Ms(H){navigator?.clipboard&&await navigator.clipboard.writeText(H)}async function Js(H,ce){fe.value=ce,J.value=H,Ce.value=null,ze.value=!0,await Iv()}function Bd(){fe.value=null,J.value=null,Ce.value=null,ze.value=!1}async function Iv(){if(!x.value||!J.value||!fe.value){ze.value=!1;return}ze.value=!0;try{const H=await $fetch("/api/git/file-diff",{query:{workingDirectory:x.value,commitHash:J.value,filePath:fe.value.path}});Ce.value=H}catch(H){console.error("Failed to load file diff:",H),le("Failed to load file diff"),Ce.value=null}finally{ze.value=!1}}function Xv(){n.value=[],e.value=[],t.value=[],r.value=new Set,s.value=[],i.value=[],o.value=0,a.value=!1,l.value=null,c.value=null,u.value=null,h.value=!1,f.value=null,m.value=!1,g.value=0,O.value="",y.value=[],x.value=null,X.value=null,B.value=!1,q.value=!1,U.value=null,Vt.value=!1,S.value=!1,Q.value=!1,T.value=!1,D.value=!1,j.value=[],N.value=[],W.value=null,et.value=null,Ot.value=null,Zt.value=!1,ve.value=null,te.value=null,he.value="inline",C.value="list",w.value="rounded",_.value=!1,E.value={date:!0,author:!0,commit:!0},z.value=0,F.value=0,ne.value=null,ke.value=null,qe.value=null,He.value=null,me.value=null,Ee.value=null,de.value=null,fe.value=null,J.value=null,Ce.value=null,ze.value=!1,oe(),je.clear()}async function zv(){if(!x.value||q.value||h.value)return!1;q.value=!0;try{const H=(await $fetch("/api/git/state",{query:{workingDirectory:x.value}})).state,ce=U.value;if(U.value=H,X.value=Date.now(),!ce)return!1;const Ae=ce.headCommit!==H.headCommit||ce.branchListHash!==H.branchListHash,It=ce.workingTreeHash!==H.workingTreeHash,vr=ce.stashListHash!==H.stashListHash;if(Ae){const[ls,ta,Wv]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:x.value}}),$fetch("/api/git/status",{query:{workingDirectory:x.value}}),$fetch("/api/git/stash",{query:{workingDirectory:x.value}}).then(jv=>jv.stashes).catch(()=>[])]);return n.value=ls.commits,e.value=ls.branches,t.value=ls.tags,r.value=new Set(ls.localBranches??[]),m.value=ls.hasMore,g.value=ls.totalCount,s.value=ta.stagedFiles??[],i.value=ta.unstagedFiles??[],o.value=(ta.stagedCount??0)+(ta.unstagedCount??0),j.value=Wv,await $(),!0}if(!It&&!vr)return!1;const[br,as]=await Promise.all([It?$fetch("/api/git/status",{query:{workingDirectory:x.value}}):Promise.resolve(null),vr?$fetch("/api/git/stash",{query:{workingDirectory:x.value}}).then(ls=>ls.stashes).catch(()=>[]):Promise.resolve(null)]);return br&&(s.value=br.stagedFiles??[],i.value=br.unstagedFiles??[],o.value=(br.stagedCount??0)+(br.unstagedCount??0)),as&&(j.value=as),!0}catch(H){return console.error("Failed to refresh git graph:",H),!1}finally{q.value=!1}}function Nv(){B.value=!0}function Vv(){B.value=!1}return{commits:Le(n),branches:Le(e),tags:Le(t),localBranchNames:Le(r),stagedFiles:Le(s),unstagedFiles:Le(i),uncommittedChangesCount:Le(o),isUncommittedChangesSelected:Le(a),selectedCommit:Le(l),selectedCommitFiles:Le(c),selectedCommitStats:Le(u),loading:Le(h),loadingMore:Le(Vt),error:Le(f),hasMore:Le(m),totalCount:Le(g),searchQuery:Le(O),filteredBranches:Le(y),workingDirectory:Le(x),stashes:Le(j),remotes:Le(N),comparisonCommit:Le(W),comparisonFiles:Le(et),comparisonStats:Le(Ot),comparisonLoading:Le(Zt),isComparing:ea,activeDialog:Le(ve),activeContextMenu:Le(te),detailViewPosition:Le(he),fileViewMode:Le(C),graphStyle:Le(w),muteNonAncestral:Le(_),columnVisibility:Le(E),searchResultIndex:Le(z),searchResultCount:Le(F),selectedFeatureId:Le(ne),featureMergeBase:Le(Qe),conversationBranch:Le(ke),conversationMergeBase:Le(qe),conversationBaseBranch:Le(He),previewBranch:Le(me),previewMergeBase:Le(Ee),previewBaseBranch:Le(de),diffViewerFile:Le(fe),diffViewerCommitHash:Le(J),diffViewerContent:Le(Ce),diffViewerLoading:Le(ze),lastRefreshTime:Le(X),isPollingActive:Le(B),isRefreshing:Le(q),isLoadingDetails:Le(S),isStaging:Le(Q),isCommitting:Le(T),isCheckingOut:Le(D),operationError:Le(I),filteredCommits:Lt,currentBranch:pr,searchResultHashes:Qt,loadGitGraph:Ut,loadMoreCommits:Wt,refreshUncommittedChanges:tn,selectCommit:dn,selectUncommittedChanges:mr,clearSelection:nr,setSearchQuery:Xn,toggleBranchFilter:xe,clearFilters:Re,nextSearchResult:ee,prevSearchResult:pe,checkoutBranch:Ue,createBranch:Ge,deleteLocalBranch:it,deleteRemoteBranch:$s,stageFiles:rr,unstageFiles:zn,commitChanges:Cs,reset:Xv,clearOperationError:oe,renameBranch:wt,mergeBranch:Nn,rebaseBranch:Qs,pushBranch:ns,pullBranch:Dr,fetchBranch:rs,cherryPickCommit:ss,revertCommit:Ps,resetToCommit:rn,checkoutCommit:Qn,copyCommitSubject:Dt,createTag:sn,deleteTag:Pn,pushTag:Vn,getTagDetail:Gt,copyTagName:sr,loadStashes:Tn,applyStash:is,popStash:Zr,dropStash:os,stashBranch:Be,stashChanges:L,loadRemotes:ge,addRemote:De,editRemote:lt,deleteRemote:Pt,fetchAll:pt,setActiveDialog:re,clearActiveDialog:ye,setActiveContextMenu:Te,clearActiveContextMenu:Ze,selectComparisonCommit:Xr,clearComparison:Di,loadComparisonData:Xe,copyToClipboard:Ms,toggleDetailViewPosition:gt,toggleFileViewMode:Mt,setGraphStyle:Wn,toggleMuteNonAncestral:Ir,toggleColumnVisibility:$t,navigateToCommit:k,resetWorking:A,cleanUntracked:G,setSelectedFeatureId:gr,setConversationBranch:Or,setPreviewBranch:Li,openFileDiff:Js,closeFileDiff:Bd,checkAndRefresh:zv,startPolling:Nv,stopPolling:Vv}});async function lf(){if(typeof window>"u")return{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};try{const n=await $fetch("/api/conversations");if(!n||!Array.isArray(n.conversations))return console.warn("[conversationStorage] Invalid data structure from server"),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};n.version!==Ka&&console.warn(`[conversationStorage] Storage version mismatch: ${n.version} vs ${Ka}`);const e=n.conversations.map(l=>{if(!l||typeof l!="object")return l;const c=l;return"claudeSessionId"in c&&!("providerSessionId"in c)?{...c,providerSessionId:c.claudeSessionId}:l}),r=(Array.isArray(n.archivedConversations)?n.archivedConversations:[]).map(l=>{if(!l||typeof l!="object")return l;const c=l;return"claudeSessionId"in c&&!("providerSessionId"in c)?{...c,providerSessionId:c.claudeSessionId}:l}),s=e.filter(sb),i=r.filter(ib),o=e.length-s.length,a=r.length-i.length;return o>0&&console.warn(`[conversationStorage] Discarded ${o} corrupted active conversation(s)`),a>0&&console.warn(`[conversationStorage] Discarded ${a} corrupted archive conversation(s)`),{conversations:s,archivedConversations:i,discardedConversations:o,discardedArchives:a}}catch(n){return console.error("[conversationStorage] Failed to load conversations:",n),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0}}}async function oS(n,e=[]){if(typeof window>"u")return!1;try{return await $fetch("/api/conversations",{method:"POST",body:{version:Ka,conversations:n,archivedConversations:e}}),!0}catch(t){return console.error("Failed to save conversations:",t),!1}}async function cf(n){if(typeof window>"u")return!1;try{return await $fetch("/api/conversations/update",{method:"POST",body:{version:Ka,conversation:n}}),!0}catch(e){return console.error("Failed to save conversation:",e),!1}}function aS(n){return n?n.map(e=>{switch(e.type){case"text":return e.text;case"tool_use":return`[${e.name}] ${e.inputSummary}`;case"tool_result":return e.isError?`Error: ${e.content.slice(0,100)}`:"";case"thinking":case"result_summary":case"session_init":return"";default:return""}}).filter(Boolean).join(`
64
+ `):""}const Jn=mh("chat",()=>{const n=R(!1),e=R(ob),t=R("ask"),r=R(""),s=R([]),i=R([]),o=R(null),a=R("active"),l=R(new Set),c=new Map,u=R(!1),h=R(0),f=new Map,m=1200,g=R(null),O=R(null);function y($){return $?c.get($)??null:null}function x($){let k=c.get($);return k||(k={session:null,pendingPermission:null,pendingPlanApproval:null,lastError:null,debugEvents:[]},c.set($,k)),k}const S=Y(()=>s.value.find($=>$.id===o.value)||null),Q=Y(()=>S.value?.messages??[]),T=Y(()=>(h.value,y(o.value)?.session??null)),D=Y(()=>(h.value,y(o.value)?.pendingPermission??null)),K=Y(()=>(h.value,y(o.value)?.pendingPlanApproval??null)),I=Y(()=>(h.value,y(o.value)?.lastError??null)),ue=Y(()=>(h.value,y(o.value)?.debugEvents??[])),le=Y(()=>T.value?.status==="streaming"),oe=Y(()=>S.value?.providerSessionId??""),Z=Y(()=>Q.value.length>0),X=Y(()=>Q.value[Q.value.length-1]||null);function B($){return l.value.has($)}const q=Y(()=>o.value?l.value.has(o.value):!1),U=Y(()=>s.value.length>0),j=Y(()=>i.value.length>0),N=Y(()=>s.value.length),W=Y(()=>N.value>=Id),ve=Y(()=>s.value),te=Y(()=>i.value),he=Y(()=>g.value&&s.value.find($=>$.id===g.value)||null);function C($){return g.value===$}function w($){a.value=$}async function _($){if(!(!$?.previewBranch||!$.worktreePath))try{const k=await $fetch("/api/chat/preview-sync",{method:"POST",body:{previewBranch:$.previewBranch,worktreePath:$.worktreePath}});if(!k.success)throw new Error(k.error||"Unknown preview sync failure")}catch(k){console.warn("[chat] Failed to sync preview branch after worktree update",{conversationId:$.id,previewBranch:$.previewBranch,worktreePath:$.worktreePath,error:k instanceof Error?k.message:String(k)})}}async function E($){if(B($))return{success:!1,error:"Cannot archive while this conversation is streaming"};if(s.value.findIndex(A=>A.id===$)===-1)return{success:!1,error:"Conversation not found"};try{const A=await $fetch(`/api/conversations/${$}/archive`,{method:"POST"});if(A.success&&A.archived){const G=f.get($);return G&&(clearTimeout(G),f.delete($)),c.delete($),s.value=Array.isArray(A.conversations)?A.conversations:s.value.filter(re=>re.id!==$),i.value=Array.isArray(A.archivedConversations)?A.archivedConversations:[A.archived,...i.value],Gt(),g.value===$&&(g.value=null),o.value===$&&(o.value=s.value[0]?.id??null),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:o.value}}).catch(re=>{console.error("Failed to save active conversation:",re)}),{success:!0}}return{success:!1,error:"Failed to archive conversation"}}catch(A){return{success:!1,error:A instanceof Error?A.message:"Failed to archive conversation"}}}async function z($,k){if(gr().atLimit)return{success:!1,error:`Cannot restore. Active conversations reached ${Xd}.`};if(!i.value.some(G=>G.id===$))return{success:!1,error:"Archived conversation not found"};try{const G=await $fetch(`/api/conversations/archives/${$}/restore`,{method:"POST",body:{baseBranch:k}});return G.success&&G.conversation?(s.value=Array.isArray(G.conversations)?G.conversations:[G.conversation,...s.value],Array.isArray(G.archivedConversations)?i.value=G.archivedConversations:i.value=i.value.filter(re=>re.id!==$),a.value="active",Tn(G.conversation.id),Vn(),Dt(),{success:!0,conversationId:G.conversation.id}):{success:!1,error:"Failed to restore archived conversation"}}catch(G){return{success:!1,error:G instanceof Error?G.message:"Failed to restore archived conversation"}}}async function F($){const k=i.value.findIndex(A=>A.id===$);if(k===-1)return{success:!1,error:"Archived conversation not found"};try{const A=await $fetch(`/api/conversations/archives/${$}`,{method:"DELETE"});return A.success?(Array.isArray(A.archivedConversations)?i.value=A.archivedConversations:i.value.splice(k,1),Gt(),{success:!0}):{success:!1,error:"Failed to delete archived conversation"}}catch{return i.value.splice(k,1),Dt(),{success:!0}}}async function ne(){if(!(typeof window>"u"))try{const $=await $fetch("/api/settings");if($){if(typeof $.panelWidth=="number"){const G=$.panelWidth;G>=zd&&G<=Nd&&(e.value=G)}typeof $.isPanelOpen=="boolean"&&(n.value=$.isPanelOpen),typeof $.activeConversationId=="string"&&(o.value=$.activeConversationId);const{useSettingsStore:k}=await Ns(async()=>{const{useSettingsStore:G}=await import("./CLPz4Oer.js").then(re=>re.s);return{useSettingsStore:G}},__vite__mapDeps([0,1,2]),import.meta.url),A=k();await A.hydrate(),t.value=A.permissionMode}}catch($){console.error("Failed to load chat settings:",$)}}function Qe($){t.value=$,typeof window<"u"&&Ns(async()=>{const{useSettingsStore:k}=await import("./CLPz4Oer.js").then(A=>A.s);return{useSettingsStore:k}},__vite__mapDeps([0,1,2]),import.meta.url).then(({useSettingsStore:k})=>{k().setPermissionMode($)})}function ke($,k){const A=k??o.value;if(!A)return;const G=x(A);G.pendingPermission=$,h.value++}function qe($){const k=$??o.value;if(!k)return;const A=c.get(k);A&&(A.pendingPermission=null,h.value++)}function He($,k){const A=k??o.value;if(!A)return;const G=x(A);G.pendingPlanApproval=$,h.value++}function me($){const k=$??o.value;if(!k)return;const A=c.get(k);A&&(A.pendingPlanApproval=null,h.value++)}function Ee(){n.value=!n.value,J()}function de(){n.value=!0,J()}function fe(){n.value=!1,J()}function J(){typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{isPanelOpen:n.value}}).catch($=>{console.error("Failed to save panel state:",$)})}function Ce($){const k=Math.max(zd,Math.min(Nd,$));e.value=k,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{panelWidth:k}}).catch(A=>{console.error("Failed to save panel width:",A)})}function ze($){r.value=$}function je($,k){const A=k??o.value;if(!A)return;const G=s.value.find(re=>re.id===A);G&&(G.providerSessionId=$)}function Rt($,k){const A=s.value.find(G=>G.id===$);A&&(A.worktreeBranch=k,A.lastCommitTime=new Date().toISOString())}async function Lt($){const k=s.value.find(G=>G.id===$);if(!k?.worktreeBranch)return null;const A=k.worktreeBranch.trim();if(!A)return null;try{const re=(await $fetch("/api/specs/features")).features.find(ye=>ye.id===A);return re?(k.featureId!==re.id&&(k.featureId=re.id,k.updatedAt=new Date().toISOString(),Dt()),re.id):null}catch(G){return console.warn("[chat] Failed to map branch to feature",{conversationId:$,branchName:A,error:G instanceof Error?G.message:String(G)}),null}}function pr($,k,A){const G=s.value.find(re=>re.id===$);G&&(G.providerId=k,G.providerModelKey=A)}function Ut($){const k=$??o.value;if(!k)return;const A=s.value.find(G=>G.id===k);A&&(A.providerSessionId="")}function tn($){return s.value.find(A=>A.id===$)?.providerSessionId??""}function Vt($){l.value.add($)}function Wt($){l.value.delete($)}function dn($,k){const A=k??o.value;if(!A)return;const G=s.value.find(re=>re.id===A);G&&G.messages.push($)}function nr($,k,A){const G={id:Vd(),role:"user",content:$,attachments:A&&A.length>0?A:void 0,timestamp:new Date().toISOString()};return dn(G,k),G}function mr($){const k={id:Vd(),role:"assistant",content:"",timestamp:new Date().toISOString(),status:"streaming"};return dn(k,$),k}function Xn($,k,A){const G=A??o.value;if(!G)return;const re=s.value.find(Te=>Te.id===G);if(!re)return;const ye=re.messages.findIndex(Te=>Te.id===$);ye!==-1&&(re.messages[ye]={...re.messages[ye],...k})}function Qt($,k){const A=s.value.find(re=>re.id===k);if(!A)return;const G=A.messages.findIndex(re=>re.id===$);G!==-1&&(A.messages[G]={...A.messages[G],content:"",status:"streaming",contentBlocks:[]})}function nn($,k,A){const G=A??o.value;if(!G)return;const re=s.value.find(Te=>Te.id===G);if(!re)return;const ye=re.messages.findIndex(Te=>Te.id===$);ye!==-1&&(re.messages[ye].content+=k)}function ee($,k,A){const G=A??o.value;if(!G)return;const re=s.value.find(Te=>Te.id===G);if(!re)return;const ye=re.messages.findIndex(Te=>Te.id===$);if(ye!==-1){const Te=re.messages[ye],Ze=Te.tools?[...Te.tools,k]:[k];re.messages[ye]={...Te,tools:Ze}}}function pe($,k,A,G){const re=G??o.value;if(!re)return;const ye=s.value.find(Ze=>Ze.id===re);if(!ye)return;const Te=ye.messages.findIndex(Ze=>Ze.id===$);if(Te!==-1){const Ze=ye.messages[Te];if(Ze.tools){const et=Ze.tools.findIndex(Ot=>Ot.id===k);if(et!==-1){const Ot=[...Ze.tools];Ot[et]={...Ot[et],...A},ye.messages[Te]={...Ze,tools:Ot}}}}sn(re,!1)}function ie($){$.contentBlocks&&($.content=aS($.contentBlocks))}function xe($,k){if($.type!==k.type)return!0;switch(k.type){case"text":return $.text!==k.text;case"tool_use":{const A=$;return A.name!==k.name||A.inputSummary!==k.inputSummary}case"tool_result":{const A=$;return A.content!==k.content||A.isError!==k.isError}default:return!1}}function Re($,k){const A=k??o.value;if(!A)return;const G=s.value.find(ye=>ye.id===A);if(!G)return;const re=G.messages.find(ye=>ye.id===$);re&&!re.contentBlocks&&(re.contentBlocks=[])}function Ue($,k,A){const G=A??o.value;if(!G)return;const re=s.value.find(Te=>Te.id===G);if(!re)return;const ye=re.messages.find(Te=>Te.id===$);ye&&(ye.contentBlocks||(ye.contentBlocks=[]),ye.contentBlocks.push(k),ie(ye))}function Ge($,k,A,G){const re=G??o.value;if(!re)return;const ye=s.value.find(Zt=>Zt.id===re);if(!ye)return;const Te=ye.messages.find(Zt=>Zt.id===$);if(!Te?.contentBlocks)return;const Ze=Te.contentBlocks.findIndex(Zt=>Zt.id===k);if(Ze===-1)return;const Ot={...Te.contentBlocks[Ze]};A(Ot),Te.contentBlocks[Ze]=Ot}function it($,k,A,G,re){const ye=G??o.value;if(!ye)return;const Te=s.value.find(Xr=>Xr.id===ye);if(!Te)return;const Ze=Te.messages.find(Xr=>Xr.id===$);if(!Ze?.contentBlocks)return;const et=Ze.contentBlocks.findIndex(Xr=>Xr.id===k);if(et===-1)return;const Ot=Ze.contentBlocks[et],Zt={...Ot};A(Zt),Ze.contentBlocks[et]=Zt,re?.syncContent!==!1&&xe(Ot,Zt)&&ie(Ze),sn(ye,!1)}function $s($,k,A){const G=A??o.value;if(!G)return;const re=s.value.find(Te=>Te.id===G);if(!re)return;const ye=re.messages.find(Te=>Te.id===$);ye&&(ye.contentBlocks||(ye.contentBlocks=[]),ye.contentBlocks.push(k),ie(ye),sn(G,!1))}function rr($,k,A){const G=A??o.value;if(!G)return null;const re=s.value.find(Te=>Te.id===G);if(!re)return null;const ye=re.messages.find(Te=>Te.id===$);return ye?.contentBlocks?ye.contentBlocks.find(Te=>Te.type==="tool_use"&&Te.toolUseId===k)??null:null}function zn($,k,A,G,re){const ye=s.value.find(Ze=>Ze.id===re);if(!ye)return;const Te=ye.messages.findIndex(Ze=>Ze.id===$);Te!==-1&&(ye.messages[Te]={...ye.messages[Te],content:A,contentBlocks:k,status:G},sn(re,!0))}function Cs($,k){const A=k??o.value;if(!A)return;const G=c.get(A);G?.session&&(G.session.status=$,h.value++)}function wt($,k){const A=k??o.value;if(!A)return;const G=x(A);G.session={sessionId:$,cwd:r.value,status:"streaming",startedAt:new Date().toISOString()},G.lastError=null,h.value++}function Nn($){const k=$??o.value;if(!k)return;const A=c.get(k);A?.session&&(A.session.status="idle",h.value++)}function Qs($,k){const A=k??o.value;if(!A)return;const G=x(A);G.session&&(G.session.status="error",G.session.error=$),G.lastError=$,h.value++}function ns($,k){if(!u.value)return;const A=k??o.value;if(!A)return;const G=x(A),re=(()=>{if(typeof $.payload=="string")return $.payload;try{return JSON.stringify($.payload,null,2)}catch{return String($.payload)}})(),ye=8e3,Te=300,Ze=re.length>ye?`${re.slice(0,ye)}
65
+ ... (truncated)`:re;G.debugEvents.push({id:`dbg-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,timestamp:new Date().toISOString(),direction:$.direction,channel:$.channel,eventType:$.eventType||"unknown",payload:Ze}),G.debugEvents.length>Te&&G.debugEvents.splice(0,G.debugEvents.length-Te),h.value++}function Dr($){u.value=$}function rs($){const k=$??o.value;if(!k)return;const A=c.get(k);A&&(A.debugEvents=[],h.value++)}function ss(){if(!o.value)return;const $=s.value.find(A=>A.id===o.value);$&&($.messages=[]);const k=o.value;c.delete(k),h.value++}function Ps($){const k=$??o.value;if(!k)return;const A=c.get(k);A&&(A.lastError=null,A.session&&(A.session.error=void 0),h.value++)}async function rn(){const $=await lf();if(s.value=$.conversations,i.value=$.archivedConversations,$.discardedArchives>0&&console.warn(`[chat] Skipped ${$.discardedArchives} corrupted archived conversation(s)`),Vn(),Gt(),!g.value){const k=s.value.find(A=>!!A.previewBranch&&!A.finalized);k&&(g.value=k.id)}if(o.value){const k=s.value.find(A=>A.id===o.value);k&&k.cwd?r.value=k.cwd:k||(o.value=null,n.value=!1)}}async function Qn(){const $=await lf(),k=new Map(s.value.map(re=>[re.id,re]));let A=0,G=0;for(const re of $.conversations){const ye=k.get(re.id);if(!ye)s.value.push(re),k.set(re.id,re),A++,console.log(`[chat] refresh: added new conversation ${re.id} (source=${re.source}, msgs=${re.messages.length})`);else if(re.source!=="user"&&(re.messages.length>ye.messages.length||re.updatedAt>(ye.updatedAt||""))){const Te=s.value.findIndex(Ze=>Ze.id===re.id);Te!==-1&&(s.value.splice(Te,1,re),console.log(`[chat] refresh: updated conversation ${re.id} (msgs: ${ye.messages.length} → ${re.messages.length}, updatedAt: ${ye.updatedAt} → ${re.updatedAt})`)),G++}else ye&&re.messages.length!==ye.messages.length&&console.log(`[chat] refresh: skipped update for ${re.id} (source=${re.source}, server msgs=${re.messages.length}, local msgs=${ye.messages.length})`)}return(A>0||G>0)&&Vn(),console.log(`[chat] refreshServerConversations: loaded=${$.conversations.length}, added=${A}, updated=${G}`),A+G}function Dt(){oS(s.value,i.value)}function sn($,k=!1){const A=s.value.find(G=>G.id===$);if(A)if(k){const G=f.get($);G&&(clearTimeout(G),f.delete($)),A.updatedAt=new Date().toISOString(),cf(A)}else{if(f.get($))return;const re=setTimeout(()=>{A.updatedAt=new Date().toISOString(),cf(A),f.delete($)},m);f.set($,re)}}function Pn($=!1){o.value&&sn(o.value,$)}function Vn(){const $=k=>{const A=new Date(k.updatedAt).getTime();return Number.isFinite(A)&&A>0?A:new Date(k.createdAt).getTime()};s.value.sort((k,A)=>$(A)-$(k))}function Gt(){i.value.sort(($,k)=>new Date(k.archivedAt).getTime()-new Date($.archivedAt).getTime())}async function sr($){if(gr().atLimit)return"";const A=ab();let G=null;if($?.featureId){const Ze=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:A,featureId:$.featureId,baseBranch:$.baseBranch}});if(!Ze.success&&Ze.error)throw new Error(Ze.error);G=Ze}let re=null;if(typeof window<"u")try{const{useSettingsStore:Ze}=await Ns(async()=>{const{useSettingsStore:Ot}=await import("./CLPz4Oer.js").then(Zt=>Zt.s);return{useSettingsStore:Ot}},__vite__mapDeps([0,1,2]),import.meta.url),et=Ze();await et.hydrate(),re=et.providerSelection}catch(Ze){console.warn("[chat] Failed to load provider selection for new conversation",Ze)}const ye=re||{providerId:Jm,modelKey:Km},Te={id:A,title:"New Conversation",messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),cwd:r.value||process.cwd?.()||"",featureId:$?.featureId,providerId:ye.providerId,providerModelKey:ye.modelKey};if(G?.success&&G.worktreePath&&G.branch&&(Te.worktreePath=G.worktreePath,Te.worktreeBranch=G.branch,Te.cwd=G.worktreePath,Te.hasWorktree=!0,G.baseBranch&&(Te.baseBranch=G.baseBranch)),s.value.unshift(Te),o.value=A,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:A}}).catch(Ze=>{console.error("Failed to save active conversation:",Ze)}),!$?.featureId)try{const Ze=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:A,baseBranch:$?.baseBranch}});if(Ze.success&&Ze.worktreePath&&Ze.branch){const et=s.value.find(Ot=>Ot.id===A);et&&(et.worktreePath=Ze.worktreePath,et.worktreeBranch=Ze.branch,et.cwd=Ze.worktreePath,et.hasWorktree=!0,Ze.baseBranch&&(et.baseBranch=Ze.baseBranch))}}catch(Ze){console.warn("[chat] Failed to create worktree for conversation",A,Ze)}return sn(A,!0),A}function Tn($){const k=s.value.find(A=>A.id===$);k&&(o.value=$,n.value=!0,k.cwd&&(r.value=k.cwd),!k.featureId&&k.worktreeBranch&&Lt($),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:$,isPanelOpen:!0}}).catch(A=>{console.error("Failed to save active conversation:",A)}))}async function is($){const k=s.value.findIndex(re=>re.id===$);if(k===-1)return;const A=s.value[k];if(g.value===$&&(g.value=null),A.hasWorktree&&A.worktreePath&&A.worktreeBranch)try{await $fetch("/api/chat/worktree",{method:"DELETE",body:{worktreePath:A.worktreePath,branch:A.worktreeBranch}})}catch(re){console.warn("[chat] Failed to clean up worktree for conversation",$,re)}s.value.splice(k,1),c.delete($);const G=f.get($);G&&(clearTimeout(G),f.delete($)),o.value===$&&(o.value=null,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:null}}).catch(re=>{console.error("Failed to clear active conversation:",re)})),Dt()}async function Zr($,k,A){const G=s.value.find(ye=>ye.id===$);if(!G)return{success:!1,error:"Conversation not found"};if(!G.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const re=A||G.baseBranch;try{const ye=await $fetch("/api/chat/finalize",{method:"POST",body:{conversationId:$,commitMessage:k,baseBranch:re,worktreePath:G.worktreePath,worktreeBranch:G.worktreeBranch,previewBranch:G.previewBranch}});return ye.success?(g.value===$&&(g.value=null),G.worktreePath=void 0,G.worktreeBranch=void 0,G.hasWorktree=!1,G.baseBranch=void 0,G.previewBranch=void 0,G.finalized=!0,G.updatedAt=new Date().toISOString(),Dt()):ye.rebaseInProgress&&await Be($,G.worktreePath,re||"main",k),ye}catch(ye){return{success:!1,error:ye instanceof Error?ye.message:String(ye)}}}async function os($,k){const A=s.value.find(re=>re.id===$);if(!A)return{success:!1,error:"Conversation not found"};if(!A.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const G=k||A.baseBranch;try{const re=await $fetch("/api/chat/rebase",{method:"POST",body:{conversationId:$,baseBranch:G,worktreePath:A.worktreePath}});return re.rebaseInProgress?await Be($,A.worktreePath,G||"main","","sync"):re.success&&(await _(A),A.baseBranch=G,Dt()),re}catch(re){return{success:!1,error:re instanceof Error?re.message:String(re)}}}async function Be($,k,A,G,re="finalize"){O.value={conversationId:$,worktreePath:k,baseBranch:A,commitMessage:G,files:[],resolvedFiles:new Set,loading:!0,error:null,mode:re};try{const ye=await $fetch("/api/rebase/conflicts",{params:{worktreePath:k}});O.value&&(O.value.files=ye.files,O.value.loading=!1)}catch(ye){O.value&&(O.value.error=ye instanceof Error?ye.message:String(ye),O.value.loading=!1)}}async function L($,k){if(!O.value)return!1;try{const A=await $fetch("/api/rebase/resolve",{method:"PUT",body:{worktreePath:O.value.worktreePath,filePath:$,content:k}});return A.success&&O.value&&O.value.resolvedFiles.add($),A.success}catch{return!1}}async function ge(){if(!O.value)return{success:!1,error:"No conflict resolution in progress"};const{conversationId:$,commitMessage:k,baseBranch:A,mode:G,worktreePath:re}=O.value,ye=G==="sync"?"/api/rebase/continue-sync":"/api/rebase/continue";try{const Te=s.value.find(et=>et.id===$),Ze=await $fetch(ye,{method:"POST",body:{conversationId:$,commitMessage:k,baseBranch:A,worktreePath:re,worktreeBranch:Te?.worktreeBranch,previewBranch:Te?.previewBranch}});if(Ze.success){if(G==="finalize"){g.value===$&&(g.value=null);const et=s.value.find(Ot=>Ot.id===$);et&&(et.worktreePath=void 0,et.worktreeBranch=void 0,et.hasWorktree=!1,et.baseBranch=void 0,et.previewBranch=void 0,et.finalized=!0,et.updatedAt=new Date().toISOString(),Dt())}else if(G==="sync"){const et=s.value.find(Ot=>Ot.id===$);et&&(await _(et),et.baseBranch=A,et.updatedAt=new Date().toISOString(),Dt())}O.value=null}else Ze.rebaseInProgress&&await Be($,re,A,k,G);return Ze}catch(Te){return{success:!1,error:Te instanceof Error?Te.message:String(Te)}}}async function De(){if(!O.value)return!1;try{const $=await $fetch("/api/rebase/abort",{method:"POST",body:{worktreePath:O.value.worktreePath}});return O.value=null,$.success}catch{return O.value=null,!1}}async function lt($){if(!O.value)return!1;const k=O.value.files.find(A=>A.path===$);if(!k)return!1;try{const A=await $fetch("/api/rebase/ai-resolve",{method:"POST",body:{worktreePath:O.value.worktreePath,filePath:$,conflictContent:k.content}});return A.success&&A.resolvedContent!==void 0?(k.content=A.resolvedContent,await L($,A.resolvedContent)):!1}catch{return!1}}async function Pt(){if(!O.value)return;const $=O.value.files.filter(k=>!O.value.resolvedFiles.has(k.path));for(const k of $)await lt(k.path)}async function pt($){const k=s.value.find(A=>A.id===$);if(!k)return{success:!1,error:"Conversation not found"};if(!k.hasWorktree||!k.worktreePath||!k.baseBranch)return{success:!1,error:"No worktree to preview"};try{const A=await $fetch("/api/chat/preview",{method:"POST",body:{conversationId:$,worktreePath:k.worktreePath,baseBranch:k.baseBranch}});return A.success&&A.previewBranch&&(k.previewBranch=A.previewBranch,g.value=$,k.updatedAt=new Date().toISOString(),Dt()),{success:A.success,error:A.error}}catch(A){return{success:!1,error:A instanceof Error?A.message:String(A)}}}async function gt($){const k=s.value.find(A=>A.id===$);if(!k)return{success:!1,error:"Conversation not found"};if(!k.previewBranch||!k.baseBranch)return g.value=null,{success:!1,error:"No active preview"};try{const A=await $fetch("/api/chat/preview",{method:"DELETE",body:{previewBranch:k.previewBranch,baseBranch:k.baseBranch}});return A.success&&(k.previewBranch=void 0,g.value=null,k.updatedAt=new Date().toISOString(),Dt()),{success:A.success,error:A.error}}catch(A){return{success:!1,error:A instanceof Error?A.message:String(A)}}}async function Mt($){if(g.value===$)return await gt($);if(g.value){const k=await gt(g.value);if(!k.success)return{success:!1,error:`Failed to end previous preview: ${k.error}`}}return await pt($)}function Wn($){const k=$.trim();if(!k)return null;const A=s.value.filter(G=>G.featureId===k?!0:G.worktreeBranch?.trim()===k);return A.length===0?null:A.sort((G,re)=>new Date(re.updatedAt).getTime()-new Date(G.updatedAt).getTime())[0]||null}function Ir($,k){const A=s.value.find(G=>G.id===$);A&&(A.title=k.trim(),A.updatedAt=new Date().toISOString(),Vn(),Dt())}function $t($){const k=o.value;if(!k)return;const A=s.value.find(re=>re.id===k);if(!A||A.title!=="New Conversation")return;const G=A.messages.find(re=>re.role==="user");G&&(G.content.trim().length>0?A.title=lb(G.content):G.attachments&&G.attachments.length>0&&(A.title=G.attachments.length===1?"[Image] New Conversation":`[${G.attachments.length} Images] New Conversation`))}function gr(){const $=s.value.length;return{atLimit:$>=Xd,nearLimit:$>=Id,count:$}}async function Or($,k){o.value||await sr();const A=nr($,void 0,k);return $t(),Pn(!0),A}function Li($,k,A){const G=A??o.value;nn($,k,G??void 0),G&&sn(G,!1)}function Ts($,k){const A=k??o.value;Xn($,{status:"complete"},A??void 0),A&&sn(A,!0)}return{messages:Q,session:T,isPanelOpen:n,panelWidth:Le(e),permissionMode:Le(t),pendingPermission:D,pendingPlanApproval:K,cwd:Le(r),lastError:I,debugEvents:ue,debugStreamEnabled:Le(u),providerSessionId:oe,conversations:Le(s),archivedConversations:Le(i),activeConversationId:Le(o),conversationViewMode:Le(a),conflictState:Le(O),previewingConversationId:Le(g),isStreaming:le,hasMessages:Z,lastMessage:X,isActiveConversationStreaming:q,hasConversations:U,hasArchivedConversations:j,activeConversation:S,conversationCount:N,isNearStorageLimit:W,sortedConversations:ve,sortedArchivedConversations:te,previewingConversation:he,streamingConversations:Le(l),initialize:ne,togglePanel:Ee,openPanel:de,closePanel:fe,setPanelWidth:Ce,setPermissionMode:Qe,setPendingPermission:ke,clearPendingPermission:qe,setPendingPlanApproval:He,clearPendingPlanApproval:me,setCwd:ze,setProviderSessionId:je,clearProviderSession:Ut,getProviderSessionId:tn,updateWorktreeBranch:Rt,setConversationProviderSelection:pr,startConversationStreaming:Vt,endConversationStreaming:Wt,isConversationStreaming:B,addMessage:dn,addUserMessage:nr,addAssistantMessage:mr,updateMessage:Xn,resetMessageForReplay:Qt,appendToMessage:nn,addToolToMessage:ee,updateToolInMessage:pe,initContentBlocks:Re,appendContentBlock:Ue,appendContentBlockWithSave:$s,updateBlockById:Ge,updateBlockWithSave:it,findToolUseBlock:rr,batchSetMessageBlocks:zn,syncContentFromBlocks:ie,setSessionStatus:Cs,startSession:wt,endSession:Nn,setSessionError:Qs,setDebugStreamEnabled:Dr,pushDebugEvent:ns,clearDebugEvents:rs,clearMessages:ss,clearError:Ps,loadConversations:rn,refreshServerConversations:Qn,saveAllConversations:Dt,saveCurrentConversation:Pn,saveConversation:sn,createConversation:sr,selectConversation:Tn,deleteConversation:is,archiveConversation:E,restoreArchivedConversation:z,deleteArchivedConversation:F,setConversationViewMode:w,findConversationByFeature:Wn,syncConversationFeatureFromBranch:Lt,renameConversation:Ir,checkStorageLimits:gr,finalizeConversation:Zr,rebaseConversation:os,resolveConflictFile:L,continueRebase:ge,abortRebase:De,aiResolveConflictFile:lt,aiResolveAllConflicts:Pt,previewConversation:pt,unpreviewConversation:gt,togglePreview:Mt,isConversationPreviewing:C,addUserMessageWithConversation:Or,appendToMessageWithSave:Li,completeMessageWithSave:Ts}});function lS(n={}){const e=Vl(),t=300,r=5e3,s=250;let i=null,o=null,a=null,l=null,c=null,u=!1,h=!1;const f=R(!1),m=R(!1);let g=n;function O(X){g=X}async function y(){const X=g.getScrollPosition?.()??0,B=await e.checkAndRefresh();return B&&g.setScrollPosition&&(await Gn(),g.setScrollPosition(X)),B}function x(){return f.value||!!e.activeContextMenu||!!e.activeDialog}async function S(){if(x()){m.value=!0;return}T()}async function Q(){if(u){h=!0;return}u=!0;try{await y()}finally{u=!1,h&&(h=!1,T())}}function T(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,Q()},s)}function D(X){if(typeof window>"u")return;if(a&&a.readyState===WebSocket.OPEN){a.send(JSON.stringify({type:"watch",workingDirectory:X}));return}l&&(clearTimeout(l),l=null);const q=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/git-watcher-ws`;a=new WebSocket(q),a.onopen=()=>{a.send(JSON.stringify({type:"watch",workingDirectory:X}))},a.onmessage=U=>{try{JSON.parse(U.data).type==="git_changed"&&S()}catch{}},a.onclose=()=>{a=null,e.isPollingActive&&c&&(l=setTimeout(()=>{c&&D(c)},r))},a.onerror=()=>{}}function K(){l&&(clearTimeout(l),l=null),a&&(a.close(),a=null)}function I(X){X&&(c=X),!e.isPollingActive&&(e.startPolling(),c&&D(c))}function ue(){K(),e.stopPolling()}function le(){f.value=!0,i&&(clearTimeout(i),i=null)}function oe(){i&&clearTimeout(i),i=setTimeout(async()=>{f.value=!1,m.value&&(m.value=!1,T())},t)}function Z(){ue(),i&&(clearTimeout(i),i=null),o&&(clearTimeout(o),o=null),u=!1,h=!1,c=null}return Ye(()=>[e.activeContextMenu,e.activeDialog],()=>{!e.activeContextMenu&&!e.activeDialog&&m.value&&!f.value&&(m.value=!1,T())}),{isUserInteracting:Le(f),isDeferredRefresh:Le(m),startPolling:I,stopPolling:ue,startInteraction:le,endInteraction:oe,cleanup:Z,setScrollCallbacks:O}}function cS(n){function e(s){if((s.ctrlKey||s.metaKey)&&s.key==="h"){s.preventDefault(),n.onScrollToHead();return}if(s.key==="Escape"){s.preventDefault(),n.onEscape();return}}function t(){document.addEventListener("keydown",e)}function r(){document.removeEventListener("keydown",e)}return{start:t,stop:r}}function uS(n){const e=R({visible:!1,branchName:"",loading:!1,error:null});async function t(){e.value.loading=!0,e.value.error=null;const te=await n.checkoutBranch(e.value.branchName);e.value.loading=!1,te.success?e.value.visible=!1:e.value.error=te.error||"Unknown error"}const r=R({visible:!1,fromCommit:"",loading:!1,error:null});async function s(te){r.value.loading=!0,r.value.error=null;const he=await n.createBranch(te.name,r.value.fromCommit);r.value.loading=!1,he.success?(te.checkout&&await n.checkoutBranch(te.name),r.value.visible=!1):r.value.error=he.error||"Unknown error"}const i=R({visible:!1,branchName:"",isLocal:!0,force:!1,loading:!1,error:null});async function o(te){i.value.loading=!0,i.value.error=null;const{branchName:he,isLocal:C}=i.value,w=te?.force??i.value.force,_=C?await n.deleteLocalBranch(he,w):await n.deleteRemoteBranch(he);i.value.loading=!1,_.success?i.value.visible=!1:i.value.error=_.error||"Unknown error"}const a=R({visible:!1,branchName:"",newName:"",loading:!1,error:null});async function l(){if(!a.value.newName.trim()){a.value.error="Branch name is required";return}a.value.loading=!0,a.value.error=null;const te=await n.renameBranch(a.value.branchName,a.value.newName.trim());a.value.loading=!1,te.success?a.value.visible=!1:a.value.error=te.error||"Unknown error"}const c=R({visible:!1,branchName:"",loading:!1,error:null});async function u(te){c.value.loading=!0,c.value.error=null;const he=await n.mergeBranch(c.value.branchName,te);c.value.loading=!1,he.success?c.value.visible=!1:c.value.error=he.error||"Unknown error"}const h=R({visible:!1,branchName:"",loading:!1,error:null});async function f(){h.value.loading=!0,h.value.error=null;const te=await n.rebaseBranch(h.value.branchName);h.value.loading=!1,te.success?h.value.visible=!1:h.value.error=te.error||"Unknown error"}const m=R({visible:!1,branchName:"",loading:!1,error:null});async function g(te){m.value.loading=!0,m.value.error=null;const he=await n.pushBranch(m.value.branchName,te.remote,te.force,te.forceWithLease);m.value.loading=!1,he.success?m.value.visible=!1:m.value.error=he.error||"Unknown error"}const O=R({visible:!1,branchName:"",loading:!1,error:null});async function y(te){O.value.loading=!0,O.value.error=null;const he=await n.pullBranch(O.value.branchName,te.remote,te.noFastForward,te.squash);O.value.loading=!1,he.success?O.value.visible=!1:O.value.error=he.error||"Unknown error"}const x=R({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function S(te){x.value.loading=!0,x.value.error=null;const he=await n.cherryPickCommit(x.value.commitHash,te.recordOrigin,te.noCommit);x.value.loading=!1,he.success?x.value.visible=!1:x.value.error=he.error||"Unknown error"}const Q=R({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function T(te){Q.value.loading=!0,Q.value.error=null;const he=await n.resetToCommit(Q.value.commitHash,te.mode);Q.value.loading=!1,he.success?Q.value.visible=!1:Q.value.error=he.error||"Unknown error"}const D=R({visible:!1,commitHash:"",loading:!1,error:null});async function K(te){D.value.loading=!0,D.value.error=null;const he=await n.createTag(te.name,D.value.commitHash,te.annotated,te.message,te.pushToRemote);D.value.loading=!1,he.success?D.value.visible=!1:D.value.error=he.error||"Unknown error"}const I=R({visible:!1,tagName:"",loading:!1,error:null});async function ue(te){I.value.loading=!0,I.value.error=null;const he=await n.deleteTag(I.value.tagName,te.deleteFromRemote?te.remote||"origin":void 0);I.value.loading=!1,he.success?I.value.visible=!1:I.value.error=he.error||"Unknown error"}const le=R({visible:!1,tagName:"",loading:!1,tagDetail:null}),oe=R({visible:!1,loading:!1,error:null});async function Z(te){oe.value.loading=!0,oe.value.error=null;const he=await n.stashChanges(te.message,te.includeUntracked);oe.value.loading=!1,he.success?oe.value.visible=!1:oe.value.error=he.error||"Unknown error"}const X=R({visible:!1,stashIndex:0,loading:!1,error:null}),B=R("");async function q(te){X.value.loading=!0,X.value.error=null;const he=await n.stashBranch(X.value.stashIndex,te);X.value.loading=!1,he.success?X.value.visible=!1:X.value.error=he.error||"Unknown error"}const U=R({visible:!1,loading:!1,error:null});async function j(te){U.value.loading=!0,U.value.error=null;const he=await n.resetWorking(te.mode);U.value.loading=!1,he.success?U.value.visible=!1:U.value.error=he.error||"Unknown error"}const N=R({visible:!1,loading:!1,error:null});async function W(){N.value.loading=!0,N.value.error=null;const te=await n.cleanUntracked();N.value.loading=!1,te.success?N.value.visible=!1:N.value.error=te.error||"Unknown error"}const ve=Y(()=>e.value.visible||r.value.visible||i.value.visible||a.value.visible||c.value.visible||h.value.visible||m.value.visible||O.value.visible||x.value.visible||Q.value.visible||D.value.visible||I.value.visible||le.value.visible||oe.value.visible||X.value.visible||U.value.visible||N.value.visible);return{checkoutDialog:e,confirmCheckout:t,createBranchDialog:r,confirmCreateBranch:s,deleteBranchDialog:i,confirmDeleteBranch:o,renameDialog:a,confirmRenameBranch:l,mergeDialog:c,confirmMerge:u,rebaseDialog:h,confirmRebase:f,pushDialog:m,confirmPush:g,pullDialog:O,confirmPull:y,cherryPickDialog:x,confirmCherryPick:S,resetDialog:Q,confirmReset:T,tagCreateDialog:D,confirmTagCreate:K,tagDeleteDialog:I,confirmTagDelete:ue,tagDetailDialog:le,stashDialog:oe,confirmStash:Z,stashBranchDialog:X,stashBranchInput:B,confirmStashBranch:q,resetWorkingDialog:U,confirmResetWorking:j,cleanUntrackedDialog:N,confirmCleanUntracked:W,isAnyDialogOpen:ve}}function hS(n,e){const t=R({visible:!1,x:0,y:0});function r(J,Ce){t.value={visible:!0,x:J,y:Ce},setTimeout(()=>{t.value.visible=!1},1500)}const s=R({visible:!1,branch:"",x:0,y:0,isCurrentBranch:!1,isLocal:!0,commitHash:""});function i(J){s.value={visible:!0,...J},n.setActiveContextMenu({type:"branch",props:J,position:{x:J.x,y:J.y}})}function o(){s.value.visible=!1,n.clearActiveContextMenu()}function a(){o(),e.checkoutDialog.value={visible:!0,branchName:s.value.branch,loading:!1,error:null}}function l(){const J=s.value.branch;o(),e.renameDialog.value={visible:!0,branchName:J,newName:J,loading:!1,error:null}}function c(){const{branch:J,isLocal:Ce}=s.value;o(),e.deleteBranchDialog.value={visible:!0,branchName:J,isLocal:Ce,force:!1,loading:!1,error:null}}function u(){const J=s.value.branch;o(),e.mergeDialog.value={visible:!0,branchName:J,loading:!1,error:null}}function h(){const J=s.value.branch;o(),e.rebaseDialog.value={visible:!0,branchName:J,loading:!1,error:null}}function f(){const J=s.value.branch;o(),e.pushDialog.value={visible:!0,branchName:J,loading:!1,error:null}}function m(){const J=s.value.branch;o(),e.pullDialog.value={visible:!0,branchName:J,loading:!1,error:null}}async function g(){const J=s.value.branch;o(),await n.fetchBranch(J)}async function O(){const J=s.value.branch;o(),await n.copyToClipboard(J),r(s.value.x,s.value.y)}function y(){o(),e.createBranchDialog.value={visible:!0,fromCommit:s.value.commitHash,loading:!1,error:null}}const x=R({visible:!1,commit:null,x:0,y:0});function S(J){x.value={visible:!0,commit:J.commit,x:J.x,y:J.y},n.setActiveContextMenu({type:"commit",props:J,position:{x:J.x,y:J.y}})}function Q(){x.value.visible=!1,n.clearActiveContextMenu()}function T(J){const Ce=x.value.commit;if(!Ce)return!1;Q();const ze=J(Ce);return ze&&typeof ze.then=="function"?ze.then(()=>!0):!0}function D(){T(J=>{e.tagCreateDialog.value={visible:!0,commitHash:J.hash,loading:!1,error:null}})}function K(){T(J=>{e.createBranchDialog.value={visible:!0,fromCommit:J.hash,loading:!1,error:null}})}function I(){T(J=>{e.checkoutDialog.value={visible:!0,branchName:J.hash,loading:!1,error:null}})}function ue(){T(J=>{e.cherryPickDialog.value={visible:!0,commitHash:J.hash,commitMessage:J.message,loading:!1,error:null}})}async function le(){await T(J=>n.revertCommit(J.hash))}function oe(){T(J=>{e.mergeDialog.value={visible:!0,branchName:J.shortHash,loading:!1,error:null}})}function Z(){T(J=>{e.resetDialog.value={visible:!0,commitHash:J.hash,commitMessage:J.message,loading:!1,error:null}})}async function X(){const{x:J,y:Ce}=x.value;await T(je=>n.copyToClipboard(je.hash))&&r(J,Ce)}async function B(){await T(J=>n.copyCommitSubject(J))}const q=R({visible:!1,tag:"",x:0,y:0,commitHash:""});function U(J){q.value={visible:!0,...J},n.setActiveContextMenu({type:"tag",props:J,position:{x:J.x,y:J.y}})}function j(){q.value.visible=!1,n.clearActiveContextMenu()}async function N(){const J=q.value.tag;j(),e.tagDetailDialog.value={visible:!0,tagName:J,loading:!0,tagDetail:null};const Ce=await n.getTagDetail(J);e.tagDetailDialog.value.loading=!1,Ce.success&&Ce.data&&(e.tagDetailDialog.value.tagDetail=Ce.data)}function W(){const J=q.value.tag;j(),e.tagDeleteDialog.value={visible:!0,tagName:J,loading:!1,error:null}}async function ve(){const J=q.value.tag;j(),await n.pushTag(J)}async function te(){const J=q.value.tag;j(),await n.copyToClipboard(J),r(q.value.x,q.value.y)}const he=R({visible:!1,x:0,y:0});function C(J){he.value={visible:!0,...J},n.setActiveContextMenu({type:"uncommitted",props:J,position:{x:J.x,y:J.y}})}function w(){he.value.visible=!1,n.clearActiveContextMenu()}function _(){w(),e.stashDialog.value={visible:!0,loading:!1,error:null}}function E(){w(),e.resetWorkingDialog.value={visible:!0,loading:!1,error:null}}function z(){w(),e.cleanUntrackedDialog.value={visible:!0,loading:!1,error:null}}const F=R({visible:!1,stash:null,x:0,y:0});function ne(J){F.value={visible:!0,stash:J.stash,x:J.x,y:J.y},n.setActiveContextMenu({type:"stash",props:J,position:{x:J.x,y:J.y}})}function Qe(){F.value.visible=!1,n.clearActiveContextMenu()}function ke(J){const Ce=F.value.stash;if(!Ce)return!1;Qe();const ze=J(Ce);return ze&&typeof ze.then=="function"?ze.then(()=>!0):!0}async function qe(){await ke(J=>n.applyStash(J.index))}async function He(){await ke(J=>n.popStash(J.index))}async function me(){await ke(J=>n.dropStash(J.index))}function Ee(){ke(J=>{e.stashBranchDialog.value={visible:!0,stashIndex:J.index,loading:!1,error:null}})}async function de(){const{x:J,y:Ce}=F.value;await ke(je=>n.copyToClipboard(`stash@{${je.index}}`))&&r(J,Ce)}async function fe(){const{x:J,y:Ce}=F.value;await ke(je=>n.copyToClipboard(je.hash))&&r(J,Ce)}return{copyFeedback:t,showCopyFeedback:r,branchMenu:s,handleBranchContextMenu:i,closeBranchMenu:o,handleBranchCheckout:a,handleBranchRename:l,handleBranchDelete:c,handleBranchMerge:u,handleBranchRebase:h,handleBranchPush:f,handleBranchPull:m,handleBranchFetch:g,handleBranchCopyName:O,handleBranchCreateBranch:y,commitMenu:x,handleCommitContextMenu:S,closeCommitMenu:Q,handleCommitAddTag:D,handleCommitCreateBranch:K,handleCommitCheckout:I,handleCommitCherryPick:ue,handleCommitRevert:le,handleCommitMergeInto:oe,handleCommitReset:Z,handleCommitCopyHash:X,handleCommitCopySubject:B,tagMenu:q,handleTagContextMenu:U,closeTagMenu:j,handleTagViewDetails:N,handleTagDelete:W,handleTagPush:ve,handleTagCopyName:te,uncommittedMenu:he,handleUncommittedContextMenu:C,closeUncommittedMenu:w,handleUncommittedStash:_,handleUncommittedReset:E,handleUncommittedClean:z,stashMenu:F,handleStashContextMenu:ne,closeStashMenu:Qe,handleStashApply:qe,handleStashPop:He,handleStashDrop:me,handleStashCreateBranch:Ee,handleStashCopyName:de,handleStashCopyHash:fe}}const dS={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},fS={class:"text-sm font-mono text-retro-cyan"},pS={class:"text-xs font-mono text-retro-text mt-1 truncate"},mS={class:"space-y-3"},gS={class:"flex items-start gap-2 cursor-pointer group"},OS={class:"flex items-start gap-2 cursor-pointer group"},vS=We({__name:"CherryPickDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e,r=R(!1),s=R(!1);function i(){t("confirm",{recordOrigin:r.value,noCommit:s.value})}function o(){r.value=!1,s.value=!1,t("close")}return(a,l)=>(v(),Oe(xn,{title:"Cherry-Pick Commit",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Cherry-Pick",onClose:o,onConfirm:i},{default:bt(()=>[d("div",dS,[l[2]||(l[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Commit",-1)),d("div",fS,M(n.commitHash.slice(0,7)),1),d("div",pS,M(n.commitMessage.split(`
66
+ `)[0]),1)]),d("div",mS,[d("label",gS,[tt(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>at(r)?r.value=c:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Zn,p(r)]]),l[3]||(l[3]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Record origin (-x) "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"},' Append "(cherry picked from commit ...)" to the commit message ')],-1))]),d("label",OS,[tt(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>at(s)?s.value=c:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Zn,p(s)]]),l[4]||(l[4]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," No commit "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Apply changes to the working directory without committing ")],-1))])])]),_:1},8,["visible","loading","error"]))}}),bS={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},xS={class:"text-sm font-mono text-retro-cyan"},yS={class:"mb-4"},kS={class:"flex items-start gap-2 cursor-pointer group"},wS=We({__name:"CreateBranchDialog",props:{visible:{type:Boolean},fromCommit:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e,r=R(""),s=R(!0),i=Y(()=>r.value.trim().length>0);function o(){i.value&&t("confirm",{name:r.value.trim(),checkout:s.value})}function a(){r.value="",s.value=!0,t("close")}return(l,c)=>(v(),Oe(xn,{title:"Create Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Create Branch",onClose:a,onConfirm:o},{default:bt(()=>[d("div",bS,[c[2]||(c[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"From",-1)),d("div",xS,M(n.fromCommit.slice(0,7)),1)]),d("div",yS,[c[3]||(c[3]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Branch name",-1)),tt(d("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>at(r)?r.value=u:null),type:"text",placeholder:"feature/my-branch",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[cn,p(r)]])]),d("label",kS,[tt(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>at(s)?s.value=u:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Zn,p(s)]]),c[4]||(c[4]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Switch to new branch "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Checkout the branch after creating it ")],-1))])]),_:1},8,["visible","loading","error"]))}}),SS=We({__name:"CleanUntrackedDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e;return(r,s)=>(v(),Oe(xn,{title:"Clean Untracked Files",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Clean","confirm-danger":"",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("confirm"))},{default:bt(()=>[...s[2]||(s[2]=[d("div",{class:"space-y-3"},[d("p",{class:"text-retro-text text-sm font-mono"}," Remove all untracked files and directories from the working tree. "),d("p",{class:"text-retro-muted text-xs font-mono"},[Ne(" This runs "),d("code",null,"git clean -fd"),Ne(" and cannot be undone. ")])],-1)])]),_:1},8,["visible","loading","error"]))}}),$S={class:"text-retro-text text-sm font-mono mb-2"},CS={class:"text-retro-cyan"},QS={class:"space-y-3 mt-4"},PS={class:"flex items-center gap-2 cursor-pointer"},TS=We({__name:"DeleteBranchDialog",props:{visible:{type:Boolean},branchName:{},isLocal:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R(!1);function i(){r("confirm",{force:s.value})}return Ye(()=>t.visible,o=>{o&&(s.value=!1)}),(o,a)=>(v(),Oe(xn,{title:"Delete Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Delete","confirm-danger":!0,onClose:a[1]||(a[1]=l=>r("close")),onConfirm:i},{default:bt(()=>[a[4]||(a[4]=d("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),d("p",$S,[Ne(" Delete "+M(n.isLocal?"local":"remote")+" branch ",1),d("span",CS,M(n.branchName),1),a[2]||(a[2]=Ne("? ",-1))]),d("div",QS,[d("label",PS,[tt(d("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>at(s)?s.value=l:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(s)]]),a[3]||(a[3]=d("span",{class:"text-retro-muted text-sm"},"Force delete (even if not fully merged)",-1))])])]),_:1},8,["visible","loading","error"]))}}),MS={class:"text-retro-text text-sm font-mono mb-4"},AS={class:"text-retro-cyan"},_S={class:"space-y-3"},RS={class:"flex items-center gap-2 cursor-pointer"},ES={class:"flex items-center gap-2 cursor-pointer"},BS={class:"flex items-center gap-2 cursor-pointer"},LS=We({__name:"MergeDialog",props:{visible:{type:Boolean},branchName:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R(!1),i=R(!1),o=R(!1);function a(){r("confirm",{noCommit:s.value,noFastForward:i.value,squash:o.value})}return Ye(()=>t.visible,l=>{l&&(s.value=!1,i.value=!1,o.value=!1)}),(l,c)=>(v(),Oe(xn,{title:"Merge Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Merge",onClose:c[3]||(c[3]=u=>r("close")),onConfirm:a},{default:bt(()=>[d("p",MS,[c[4]||(c[4]=Ne(" Merge ",-1)),d("span",AS,M(n.branchName),1),c[5]||(c[5]=Ne(" into current branch ",-1))]),d("div",_S,[d("label",RS,[tt(d("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>at(s)?s.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(s)]]),c[6]||(c[6]=d("span",{class:"text-retro-muted text-sm"},"No commit (stage changes only)",-1))]),d("label",ES,[tt(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>at(i)?i.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(i)]]),c[7]||(c[7]=d("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),d("label",BS,[tt(d("input",{"onUpdate:modelValue":c[2]||(c[2]=u=>at(o)?o.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(o)]]),c[8]||(c[8]=d("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),DS={class:"text-retro-text text-sm font-mono mb-4"},ZS={class:"text-retro-cyan"},IS={class:"space-y-3"},XS=["value"],zS={class:"flex items-center gap-2 cursor-pointer"},NS={class:"flex items-center gap-2 cursor-pointer"},VS=We({__name:"PullDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R("origin"),i=R(!1),o=R(!1);function a(){r("confirm",{remote:s.value,noFastForward:i.value,squash:o.value})}return Ye(()=>t.visible,l=>{l&&(s.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",i.value=!1,o.value=!1)}),(l,c)=>(v(),Oe(xn,{title:"Pull Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Pull",onClose:c[3]||(c[3]=u=>r("close")),onConfirm:a},{default:bt(()=>[d("p",DS,[c[4]||(c[4]=Ne(" Pull ",-1)),d("span",ZS,M(n.branchName),1),c[5]||(c[5]=Ne(" from remote ",-1))]),d("div",IS,[d("div",null,[c[6]||(c[6]=d("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),tt(d("select",{"onUpdate:modelValue":c[0]||(c[0]=u=>at(s)?s.value=u:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(v(!0),b(we,null,Fe(n.remotes,u=>(v(),b("option",{key:u,value:u},M(u),9,XS))),128))],512),[[Hs,p(s)]])]),d("label",zS,[tt(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>at(i)?i.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(i)]]),c[7]||(c[7]=d("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),d("label",NS,[tt(d("input",{"onUpdate:modelValue":c[2]||(c[2]=u=>at(o)?o.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(o)]]),c[8]||(c[8]=d("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),WS={class:"text-retro-text text-sm font-mono mb-4"},jS={class:"text-retro-cyan"},qS={class:"space-y-3"},YS=["value"],FS={class:"flex items-center gap-2 cursor-pointer"},US=["checked"],GS={class:"flex items-center gap-2 cursor-pointer"},HS=["checked"],KS={key:0,class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},JS=We({__name:"PushDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R("origin"),i=R(!1),o=R(!1);function a(u){i.value=u,u&&(o.value=!1)}function l(u){o.value=u,u&&(i.value=!1)}function c(){r("confirm",{remote:s.value,force:i.value,forceWithLease:o.value})}return Ye(()=>t.visible,u=>{u&&(s.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",i.value=!1,o.value=!1)}),(u,h)=>(v(),Oe(xn,{title:"Push Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Push",onClose:h[3]||(h[3]=f=>r("close")),onConfirm:c},{default:bt(()=>[d("p",WS,[h[4]||(h[4]=Ne(" Push ",-1)),d("span",jS,M(n.branchName),1),h[5]||(h[5]=Ne(" to remote ",-1))]),d("div",qS,[d("div",null,[h[6]||(h[6]=d("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),tt(d("select",{"onUpdate:modelValue":h[0]||(h[0]=f=>at(s)?s.value=f:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(v(!0),b(we,null,Fe(n.remotes,f=>(v(),b("option",{key:f,value:f},M(f),9,YS))),128))],512),[[Hs,p(s)]])]),d("label",FS,[d("input",{checked:p(i),type:"checkbox",class:"accent-retro-cyan",onChange:h[1]||(h[1]=f=>a(f.target.checked))},null,40,US),h[7]||(h[7]=d("span",{class:"text-retro-muted text-sm"},"Force push",-1))]),d("label",GS,[d("input",{checked:p(o),type:"checkbox",class:"accent-retro-cyan",onChange:h[2]||(h[2]=f=>l(f.target.checked))},null,40,HS),h[8]||(h[8]=d("span",{class:"text-retro-muted text-sm"},"Force with lease (safer force push)",-1))]),p(i)||p(o)?(v(),b("div",KS,M(p(i)?"Force push will overwrite remote history. Use with caution.":"Force with lease will reject the push if the remote has been updated since your last fetch."),1)):V("",!0)])]),_:1},8,["visible","loading","error"]))}}),e2={class:"text-retro-text text-sm font-mono mb-4"},t2={class:"text-retro-cyan"},n2={class:"text-retro-cyan"},r2={class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},s2={class:"text-retro-cyan"},i2={class:"text-retro-cyan"},o2=We({__name:"RebaseDialog",props:{visible:{type:Boolean},branchName:{},ontoBranch:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e;return(r,s)=>(v(),Oe(xn,{title:"Rebase Branch",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Rebase",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("confirm"))},{default:bt(()=>[d("p",e2,[s[2]||(s[2]=Ne(" Rebase ",-1)),d("span",t2,M(n.branchName),1),s[3]||(s[3]=Ne(" onto ",-1)),d("span",n2,M(n.ontoBranch),1)]),d("div",r2,[s[4]||(s[4]=Ne(" This will rewrite commit history. Commits from ",-1)),d("span",s2,M(n.branchName),1),s[5]||(s[5]=Ne(" will be replayed on top of ",-1)),d("span",i2,M(n.ontoBranch),1),s[6]||(s[6]=Ne(". ",-1))])]),_:1},8,["visible","loading","error"]))}}),a2={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},l2={class:"text-sm font-mono text-retro-cyan"},c2={class:"text-xs font-mono text-retro-text mt-1 truncate"},u2={class:"space-y-2"},h2=["value"],d2={key:0,class:"mt-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},f2=We({__name:"ResetDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e,r=R("mixed"),s=[{value:"soft",label:"Soft",description:"Move HEAD, keep staged changes and working directory"},{value:"mixed",label:"Mixed",description:"Move HEAD, reset staging area, keep working directory"},{value:"hard",label:"Hard",description:"Move HEAD, reset staging area and working directory (DESTRUCTIVE)"}];function i(){t("confirm",{mode:r.value})}function o(){r.value="mixed",t("close")}return(a,l)=>(v(),Oe(xn,{title:"Reset to Commit",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Reset","confirm-danger":p(r)==="hard",onClose:o,onConfirm:i},{default:bt(()=>[d("div",a2,[l[1]||(l[1]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Reset to",-1)),d("div",l2,M(n.commitHash.slice(0,7)),1),d("div",c2,M(n.commitMessage.split(`
67
+ `)[0]),1)]),d("div",u2,[l[2]||(l[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-2"},"Reset mode",-1)),(v(),b(we,null,Fe(s,c=>d("label",{key:c.value,class:Pe(["flex items-start gap-2 p-2 rounded cursor-pointer group border transition-colors",[p(r)===c.value?"border-retro-cyan bg-retro-cyan/5":"border-transparent hover:bg-retro-panel"]])},[tt(d("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>at(r)?r.value=u:null),type:"radio",name:"reset-mode",value:c.value,class:"mt-0.5 accent-retro-cyan"},null,8,h2),[[ru,p(r)]]),d("div",null,[d("span",{class:Pe(["text-sm font-mono transition-colors",[c.value==="hard"?"text-retro-red":"text-retro-text",p(r)===c.value?"text-retro-cyan":""]])},M(c.label),3),d("p",{class:Pe(["text-xs font-mono mt-0.5",c.value==="hard"?"text-retro-red/70":"text-retro-muted"])},M(c.description),3)])],2)),64))]),p(r)==="hard"?(v(),b("div",d2," Warning: Hard reset will permanently discard all uncommitted changes in your working directory and staging area. This action cannot be undone. ")):V("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),p2={class:"space-y-3"},m2={class:"flex items-start gap-2 cursor-pointer"},g2={class:"flex items-start gap-2 cursor-pointer"},O2={key:0,class:"mt-4 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},v2=We({__name:"ResetWorkingDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R("mixed"),i=Y(()=>s.value==="hard");function o(){r("confirm",{mode:s.value})}return Ye(()=>t.visible,a=>{a&&(s.value="mixed")}),(a,l)=>(v(),Oe(xn,{title:"Reset Working Directory",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Reset","confirm-danger":p(i),onClose:l[2]||(l[2]=c=>r("close")),onConfirm:o},{default:bt(()=>[l[5]||(l[5]=d("p",{class:"text-retro-text text-sm font-mono mb-4"}," Reset the working directory to HEAD. ",-1)),d("div",p2,[d("label",m2,[tt(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>at(s)?s.value=c:null),type:"radio",value:"mixed",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[ru,p(s)]]),l[3]||(l[3]=d("div",null,[d("span",{class:"text-retro-text text-sm font-mono"},"Mixed"),d("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area, keep working directory ")],-1))]),d("label",g2,[tt(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>at(s)?s.value=c:null),type:"radio",value:"hard",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[ru,p(s)]]),l[4]||(l[4]=d("div",null,[d("span",{class:"text-retro-text text-sm font-mono"},"Hard"),d("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area AND working directory (DESTRUCTIVE) ")],-1))])]),p(i)?(v(),b("div",O2," WARNING: Hard reset will permanently discard all uncommitted changes. This cannot be undone. ")):V("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),b2={class:"space-y-4"},x2={class:"flex items-center gap-2 cursor-pointer"},y2=We({__name:"StashDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R(""),i=R(!1);function o(){r("confirm",{message:s.value.trim()||void 0,includeUntracked:i.value})}return Ye(()=>t.visible,a=>{a&&(s.value="",i.value=!1)}),(a,l)=>(v(),Oe(xn,{title:"Stash Changes",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Stash",onClose:l[2]||(l[2]=c=>r("close")),onConfirm:o},{default:bt(()=>[l[5]||(l[5]=d("p",{class:"text-retro-text text-sm font-mono mb-4"}," Save uncommitted changes to the stash. ",-1)),d("div",b2,[d("div",null,[l[3]||(l[3]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message (optional)",-1)),tt(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>at(s)?s.value=c:null),type:"text",placeholder:"Stash description...",class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted/50 focus:outline-none focus:border-retro-cyan"},null,512),[[cn,p(s)]])]),d("label",x2,[tt(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>at(i)?i.value=c:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(i)]]),l[4]||(l[4]=d("span",{class:"text-retro-muted text-sm"},"Include untracked files",-1))])])]),_:1},8,["visible","loading","error"]))}}),k2={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},w2={class:"text-sm font-mono text-retro-cyan"},S2={class:"mb-4"},$2={class:"mb-3"},C2={class:"flex items-start gap-2 cursor-pointer group"},Q2={key:0,class:"mb-4"},P2={class:"space-y-2"},T2={class:"flex items-start gap-2 cursor-pointer group"},M2=["disabled"],A2={key:0,class:"ml-6"},_2=["value"],R2=We({__name:"TagCreateDialog",props:{visible:{type:Boolean},commitHash:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=e,r=R(""),s=R(!1),i=R(""),o=R(!1),a=R(""),l=Y(()=>r.value.trim().length>0);function c(){if(!l.value)return;const h={name:r.value.trim(),annotated:s.value};s.value&&i.value.trim()&&(h.message=i.value.trim()),o.value&&a.value&&(h.pushToRemote=a.value),t("confirm",h)}function u(){r.value="",s.value=!1,i.value="",o.value=!1,a.value="",t("close")}return Ye(()=>s.value,h=>{h||(i.value="")}),(h,f)=>(v(),Oe(xn,{title:"Create Tag",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Create Tag",onClose:u,onConfirm:c},{default:bt(()=>[d("div",k2,[f[5]||(f[5]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"At commit",-1)),d("div",w2,M(n.commitHash.slice(0,7)),1)]),d("div",S2,[f[6]||(f[6]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag name",-1)),tt(d("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>at(r)?r.value=m:null),type:"text",placeholder:"v1.0.0",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[cn,p(r)]])]),d("div",$2,[d("label",C2,[tt(d("input",{"onUpdate:modelValue":f[1]||(f[1]=m=>at(s)?s.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Zn,p(s)]]),f[7]||(f[7]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Annotated tag "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Create a full tag object with message and tagger info ")],-1))])]),p(s)?(v(),b("div",Q2,[f[8]||(f[8]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag message",-1)),tt(d("textarea",{"onUpdate:modelValue":f[2]||(f[2]=m=>at(i)?i.value=m:null),rows:"3",placeholder:"Release description...",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none"},null,512),[[cn,p(i)]])])):V("",!0),d("div",P2,[d("label",T2,[tt(d("input",{"onUpdate:modelValue":f[3]||(f[3]=m=>at(o)?o.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan",disabled:n.remotes.length===0},null,8,M2),[[Zn,p(o)]]),d("div",null,[d("span",{class:Pe(["text-sm font-mono transition-colors",n.remotes.length===0?"text-retro-muted":"text-retro-text group-hover:text-retro-cyan"])}," Push to remote ",2)])]),p(o)&&n.remotes.length>0?(v(),b("div",A2,[tt(d("select",{"onUpdate:modelValue":f[4]||(f[4]=m=>at(a)?a.value=m:null),class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[f[9]||(f[9]=d("option",{value:"",disabled:"",class:"text-retro-muted"},"Select remote",-1)),(v(!0),b(we,null,Fe(n.remotes,m=>(v(),b("option",{key:m,value:m},M(m),9,_2))),128))],512),[[Hs,p(a)]])])):V("",!0)])]),_:1},8,["visible","loading","error"]))}}),E2={class:"text-retro-text text-sm font-mono mb-2"},B2={class:"text-retro-cyan"},L2={class:"space-y-3 mt-4"},D2={class:"flex items-center gap-2 cursor-pointer"},Z2={key:0,class:"ml-6"},I2=["value"],X2=We({__name:"TagDeleteDialog",props:{visible:{type:Boolean},tagName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=e,s=R(!1),i=R("origin");function o(){r("confirm",{deleteFromRemote:s.value,remote:s.value?i.value:void 0})}return Ye(()=>t.visible,a=>{a&&(s.value=!1,i.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin")}),(a,l)=>(v(),Oe(xn,{title:"Delete Tag",visible:n.visible,loading:n.loading,error:n.error,"confirm-label":"Delete","confirm-danger":!0,onClose:l[2]||(l[2]=c=>r("close")),onConfirm:o},{default:bt(()=>[l[7]||(l[7]=d("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),d("p",E2,[l[3]||(l[3]=Ne(" Delete tag ",-1)),d("span",B2,M(n.tagName),1),l[4]||(l[4]=Ne("? ",-1))]),d("div",L2,[d("label",D2,[tt(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>at(s)?s.value=c:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Zn,p(s)]]),l[5]||(l[5]=d("span",{class:"text-retro-muted text-sm"},"Also delete from remote",-1))]),p(s)?(v(),b("div",Z2,[l[6]||(l[6]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Remote",-1)),tt(d("select",{"onUpdate:modelValue":l[1]||(l[1]=c=>at(i)?i.value=c:null),class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[(v(!0),b(we,null,Fe(n.remotes,c=>(v(),b("option",{key:c,value:c},M(c),9,I2))),128))],512),[[Hs,p(i)]])])):V("",!0)])]),_:1},8,["visible","loading","error"]))}}),z2={class:"mb-4"},N2={class:"text-retro-cyan text-sm font-mono"},V2={class:"mb-4"},W2={class:"text-retro-text text-sm font-mono"},j2={class:"mb-4"},q2={class:"text-retro-text text-sm font-mono break-all select-all"},Y2={class:"mb-4"},F2={class:"text-retro-text text-sm font-mono"},U2={class:"text-retro-muted"},G2={class:"mb-4"},H2={class:"text-retro-text text-sm font-mono"},K2={key:1,class:"mb-2"},J2={class:"p-2 text-sm font-mono text-retro-text bg-retro-panel border border-retro-border rounded whitespace-pre-wrap"},e$={key:1,class:"text-retro-muted text-sm font-mono text-center py-4"},t$=We({__name:"TagDetailDialog",props:{visible:{type:Boolean},tagName:{},tagDetail:{},loading:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){const t=e;return(r,s)=>(v(),Oe(xn,{title:"Tag Details",visible:n.visible,loading:n.loading,"confirm-label":"Close","cancel-label":"Close",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("close"))},{default:bt(()=>[d("div",z2,[s[2]||(s[2]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tag",-1)),d("p",N2,M(n.tagName),1)]),n.tagDetail?(v(),b(we,{key:0},[d("div",V2,[s[3]||(s[3]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Type",-1)),d("p",W2,M(n.tagDetail.isAnnotated?"Annotated":"Lightweight"),1)]),d("div",j2,[s[4]||(s[4]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Hash",-1)),d("p",q2,M(n.tagDetail.hash),1)]),n.tagDetail.tagger?(v(),b(we,{key:0},[d("div",Y2,[s[5]||(s[5]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tagger",-1)),d("p",F2,[Ne(M(n.tagDetail.tagger.name)+" ",1),d("span",U2,"<"+M(n.tagDetail.tagger.email)+">",1)])]),d("div",G2,[s[6]||(s[6]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Date",-1)),d("p",H2,M(n.tagDetail.tagger.date),1)])],64)):V("",!0),n.tagDetail.message?(v(),b("div",K2,[s[7]||(s[7]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message",-1)),d("div",J2,M(n.tagDetail.message),1)])):V("",!0)],64)):n.loading?(v(),b("div",e$," Loading tag details... ")):V("",!0)]),_:1},8,["visible","loading"]))}}),Eh=globalThis.setInterval,n$={class:"h-full flex flex-col bg-retro-dark",role:"region","aria-label":"Git Graph"},r$={key:0,class:"flex-1 flex flex-col items-center justify-center gap-3"},s$={key:1,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},i$={key:2,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},o$={class:"text-retro-red text-sm mb-4"},a$={key:3,class:"flex-1 flex items-center justify-center p-4"},l$={class:"flex-shrink-0 flex items-center gap-2 p-2 border-b border-retro-border"},c$={class:"relative"},u$={key:0,class:"absolute left-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-2 min-w-[200px]"},h$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},d$=["checked"],f$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},p$=["checked"],m$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},g$=["checked"],O$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},v$=["checked"],b$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},x$=["checked"],y$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},k$=["checked"],w$={class:"relative"},S$=["aria-expanded"],$$={key:0,class:"text-xs"},C$={key:0,class:"absolute right-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px] max-h-[400px] overflow-auto"},Q$=["checked","onChange"],P$={class:"text-sm text-retro-text truncate"},T$={key:0,class:"text-[10px] text-retro-cyan"},M$={class:"px-3 py-1 text-[10px] text-retro-orange font-semibold uppercase tracking-wider mt-1"},A$=["checked","onChange"],_$={class:"text-sm text-retro-text truncate"},R$={class:"relative"},E$={key:0,class:"absolute right-0 top-full mt-1 z-20"},B$=["title"],L$={class:"text-retro-muted text-sm"},D$={class:"text-retro-cyan font-mono"},Z$={class:"space-y-3"},I$={class:"text-retro-muted text-sm"},X$={class:"text-retro-cyan font-mono"},z$={class:"space-y-3"},N$={class:"text-retro-muted text-sm"},V$={class:"text-retro-magenta font-mono"},W$={key:0,class:"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2.5 text-sm bg-retro-red/90 text-white rounded-lg shadow-lg max-w-sm",role:"alert"},j$={class:"flex-1"},q$=5e3,Y$=We({__name:"GitGraph",props:{workingDirectory:{},isActive:{type:Boolean,default:!0}},setup(n){const e=n,t=Vl(),r=Jn(),s=lS(),i=uS(t),o=hS(t,i),{checkoutDialog:a,confirmCheckout:l,createBranchDialog:c,confirmCreateBranch:u,deleteBranchDialog:h,confirmDeleteBranch:f,renameDialog:m,confirmRenameBranch:g,mergeDialog:O,confirmMerge:y,rebaseDialog:x,confirmRebase:S,pushDialog:Q,confirmPush:T,pullDialog:D,confirmPull:K,cherryPickDialog:I,confirmCherryPick:ue,resetDialog:le,confirmReset:oe,tagCreateDialog:Z,confirmTagCreate:X,tagDeleteDialog:B,confirmTagDelete:q,tagDetailDialog:U,stashDialog:j,confirmStash:N,stashBranchDialog:W,stashBranchInput:ve,confirmStashBranch:te,resetWorkingDialog:he,confirmResetWorking:C,cleanUntrackedDialog:w,confirmCleanUntracked:_,isAnyDialogOpen:E}=i,{copyFeedback:z,branchMenu:F,handleBranchContextMenu:ne,closeBranchMenu:Qe,handleBranchCheckout:ke,handleBranchRename:qe,handleBranchDelete:He,handleBranchMerge:me,handleBranchRebase:Ee,handleBranchPush:de,handleBranchPull:fe,handleBranchFetch:J,handleBranchCopyName:Ce,handleBranchCreateBranch:ze,commitMenu:je,handleCommitContextMenu:Rt,closeCommitMenu:Lt,handleCommitAddTag:pr,handleCommitCreateBranch:Ut,handleCommitCheckout:tn,handleCommitCherryPick:Vt,handleCommitRevert:Wt,handleCommitMergeInto:dn,handleCommitReset:nr,handleCommitCopyHash:mr,handleCommitCopySubject:Xn,tagMenu:Qt,handleTagContextMenu:nn,closeTagMenu:ee,handleTagViewDetails:pe,handleTagDelete:ie,handleTagPush:xe,handleTagCopyName:Re,uncommittedMenu:Ue,closeUncommittedMenu:Ge,handleUncommittedStash:it,handleUncommittedReset:$s,handleUncommittedClean:rr,stashMenu:zn,handleStashContextMenu:Cs,closeStashMenu:wt,handleStashApply:Nn,handleStashPop:Qs,handleStashDrop:ns,handleStashCreateBranch:Dr,handleStashCopyName:rs,handleStashCopyHash:ss}=o,Ps=Y(()=>{const $=r.activeConversation?.worktreeBranch;return $?[$]:[]}),rn=Y(()=>{const $=[],k=t.selectedFeatureId;k&&$.push(k);const A=t.conversationBranch;return A&&!$.includes(A)&&$.push(A),$});Ye(()=>[r.activeConversation?.worktreeBranch,r.activeConversation?.baseBranch],([$,k])=>{t.setConversationBranch($??null,k??null)},{immediate:!0});const Qn=Y(()=>{const $=t.previewBranch;return $?[$]:[]});Ye(()=>[r.previewingConversation?.worktreeBranch,r.previewingConversation?.baseBranch],([$,k])=>{t.setPreviewBranch($??null,k??null)},{immediate:!0});const Dt=Y(()=>{const $={};return t.previewBranch&&t.previewMergeBase&&($[t.previewBranch]=t.previewMergeBase),$}),sn=Y(()=>{const $={};return t.selectedFeatureId&&t.featureMergeBase&&($[t.selectedFeatureId]=t.featureMergeBase),t.conversationBranch&&t.conversationMergeBase&&($[t.conversationBranch]=t.conversationMergeBase),$}),Pn=Y(()=>t.remotes.map($=>$.name)),Vn=R(null);Ye(()=>e.workingDirectory,async $=>{if($){await t.loadGitGraph($);const k=r.previewingConversation?.worktreeBranch;k&&await t.setPreviewBranch(k,r.previewingConversation?.baseBranch??null);const A=r.activeConversation?.worktreeBranch;A&&await t.setConversationBranch(A,r.activeConversation?.baseBranch??null)}},{immediate:!0}),Ye(()=>e.isActive,$=>{$&&t.commits.length>0&&!t.error?s.startPolling(e.workingDirectory):s.stopPolling()},{immediate:!0}),Ye(()=>t.commits.length,$=>{$>0&&e.isActive&&!t.error&&s.startPolling(e.workingDirectory)}),Ye(()=>Vn.value,$=>{$&&s.setScrollCallbacks({getScrollPosition:()=>$.getScrollPosition(),setScrollPosition:k=>$.setScrollPosition(k)})}),zt(()=>{s.cleanup(),t.reset()});const Gt=Y(()=>t.error?.includes("Not a Git repository")),sr=R(Date.now());let Tn=null;const is=()=>{Tn||(Tn=Eh(()=>{sr.value=Date.now()},q$))},Zr=()=>{Tn&&(clearInterval(Tn),Tn=null)};Tt(()=>{Ye(()=>e.isActive,$=>{$?(sr.value=Date.now(),is()):Zr()},{immediate:!0})}),zt(()=>{Zr()});const os=Y(()=>{const $=t.lastRefreshTime;if(!$)return null;const k=Math.floor((sr.value-$)/1e3);return t.isRefreshing?"Syncing...":k<5?"Just now":k<60?`${k}s ago`:`${Math.floor(k/60)}m ago`}),Be=R(!1),L=R(!1),ge=R(null);function De(){Be.value=!0,Gn(()=>ge.value?.focus())}function lt(){Be.value=!1,t.setSearchQuery("")}function Pt($){t.setSearchQuery($)}const pt=cS({onScrollToHead:()=>{const $=t.commits.find(k=>k.isHead);$&&t.selectCommit($)},onEscape:()=>{gt.value?gt.value=!1:L.value?L.value=!1:Mt.value?Mt.value=!1:Be.value?lt():t.isComparing?t.clearComparison():(t.selectedCommit||t.isUncommittedChangesSelected)&&t.clearSelection()}});Tt(()=>{pt.start()}),zt(()=>{pt.stop()});const gt=R(!1),Mt=R(!1);async function Wn(){await t.fetchAll(!0)}async function Ir($){await t.addRemote($.name,$.url)}async function $t($){await t.editRemote($.name,$.newUrl)}async function gr($){await t.deleteRemote($)}const Or=Y(()=>{const $=[],k={};for(const A of t.branches)if(t.localBranchNames.has(A.name))$.push(A);else{const G=A.name.indexOf("/");if(G>0){const re=A.name.substring(0,G);k[re]||(k[re]=[]),k[re].push(A)}else $.push(A)}return{local:$,remotes:k}});Ye(E,$=>{$?t.setActiveDialog({type:"generic",props:{}}):t.clearActiveDialog()});function Li($){t.selectedCommit?t.selectComparisonCommit($):t.selectCommit($)}function Ts($){t.navigateToCommit($)}return($,k)=>{const A=Nb,G=rx,re=Tx,ye=Ux,Te=mw,Ze=Zw,et=Yw,Ot=Fw,Zt=Uw,ea=Gw,Xr=Hw,Di=xn;return v(),b("div",n$,[p(t).loading&&p(t).commits.length===0?(v(),b("div",r$,[...k[43]||(k[43]=[d("div",{class:"w-6 h-6 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),d("div",{class:"text-retro-muted text-sm"},"Loading git history...",-1)])])):p(Gt)?(v(),b("div",s$,[se(p(ms),{class:"w-12 h-12 text-retro-yellow mb-4"}),k[44]||(k[44]=d("h3",{class:"text-retro-text font-semibold mb-2"},"Not a Git Repository",-1)),k[45]||(k[45]=d("p",{class:"text-retro-muted text-sm max-w-xs"},[Ne(" This directory is not initialized as a Git repository. Run "),d("code",{class:"text-retro-cyan"},"git init"),Ne(" to get started. ")],-1))])):p(t).error?(v(),b("div",i$,[se(p(ms),{class:"w-10 h-10 text-retro-red mb-3"}),d("p",o$,M(p(t).error),1),d("button",{class:"flex items-center gap-2 px-3 py-1.5 text-sm text-retro-text border border-retro-border rounded hover:border-retro-cyan hover:text-retro-cyan transition-colors",onClick:k[0]||(k[0]=Xe=>p(t).loadGitGraph(e.workingDirectory))},[se(p(js),{class:"w-4 h-4"}),k[46]||(k[46]=Ne(" Retry ",-1))])])):p(t).commits.length===0?(v(),b("div",a$,[...k[47]||(k[47]=[d("div",{class:"text-retro-muted text-center"},[d("p",null,"No commits found in this repository.")],-1)])])):(v(),b(we,{key:4},[p(Be)?(v(),Oe(A,{key:0,ref_key:"findWidgetRef",ref:ge,resultCount:p(t).searchResultHashes.length,currentIndex:p(t).searchResultIndex,onSearch:Pt,onNext:p(t).nextSearchResult,onPrev:p(t).prevSearchResult,onClose:lt},null,8,["resultCount","currentIndex","onNext","onPrev"])):V("",!0),d("div",l$,[d("button",{class:Pe(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(Be)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Find",title:"Find",onClick:k[1]||(k[1]=Xe=>p(Be)?lt():De())},[se(p(Vs),{class:"w-4 h-4"})],2),d("div",c$,[d("button",{class:Pe(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(gt)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Graph settings",title:"Settings",onClick:k[2]||(k[2]=Xe=>gt.value=!p(gt))},[se(p(hb),{class:"w-4 h-4"})],2),p(gt)?(v(),b("div",u$,[k[54]||(k[54]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mb-1"}," Graph Style ",-1)),d("label",h$,[d("input",{type:"radio",name:"graphStyle",value:"rounded",checked:p(t).graphStyle==="rounded",class:"accent-retro-cyan",onChange:k[3]||(k[3]=Xe=>p(t).setGraphStyle("rounded"))},null,40,d$),k[48]||(k[48]=d("span",{class:"text-sm text-retro-text"},"Rounded",-1))]),d("label",f$,[d("input",{type:"radio",name:"graphStyle",value:"angular",checked:p(t).graphStyle==="angular",class:"accent-retro-cyan",onChange:k[4]||(k[4]=Xe=>p(t).setGraphStyle("angular"))},null,40,p$),k[49]||(k[49]=d("span",{class:"text-sm text-retro-text"},"Angular",-1))]),k[55]||(k[55]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Display ",-1)),d("label",m$,[d("input",{type:"checkbox",checked:p(t).muteNonAncestral,class:"accent-retro-cyan",onChange:k[5]||(k[5]=Xe=>p(t).toggleMuteNonAncestral())},null,40,g$),k[50]||(k[50]=d("span",{class:"text-sm text-retro-text"},"Mute non-ancestral",-1))]),k[56]||(k[56]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Columns ",-1)),d("label",O$,[d("input",{type:"checkbox",checked:p(t).columnVisibility.commit!==!1,class:"accent-retro-cyan",onChange:k[6]||(k[6]=Xe=>p(t).toggleColumnVisibility("commit"))},null,40,v$),k[51]||(k[51]=d("span",{class:"text-sm text-retro-text"},"Hash",-1))]),d("label",b$,[d("input",{type:"checkbox",checked:p(t).columnVisibility.author!==!1,class:"accent-retro-cyan",onChange:k[7]||(k[7]=Xe=>p(t).toggleColumnVisibility("author"))},null,40,x$),k[52]||(k[52]=d("span",{class:"text-sm text-retro-text"},"Author",-1))]),d("label",y$,[d("input",{type:"checkbox",checked:p(t).columnVisibility.date!==!1,class:"accent-retro-cyan",onChange:k[8]||(k[8]=Xe=>p(t).toggleColumnVisibility("date"))},null,40,k$),k[53]||(k[53]=d("span",{class:"text-sm text-retro-text"},"Date",-1))])])):V("",!0)]),k[59]||(k[59]=d("span",{class:"flex-1"},null,-1)),d("div",w$,[d("button",{class:Pe(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(L)||p(t).filteredBranches.length>0?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Filter by branch","aria-expanded":p(L),onClick:k[9]||(k[9]=Xe=>L.value=!p(L))},[se(p(Tb),{class:"w-4 h-4"}),p(t).filteredBranches.length>0?(v(),b("span",$$," ("+M(p(t).filteredBranches.length)+") ",1)):V("",!0)],10,S$),p(L)?(v(),b("div",C$,[k[58]||(k[58]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border"}," Filter by Branch ",-1)),p(t).filteredBranches.length>0?(v(),b("button",{key:0,class:"w-full text-left px-3 py-1.5 text-sm text-retro-cyan hover:bg-retro-cyan/10",onClick:k[10]||(k[10]=Xe=>p(t).clearFilters())}," Clear All Filters ")):V("",!0),p(Or).local.length>0?(v(),b(we,{key:1},[k[57]||(k[57]=d("div",{class:"px-3 py-1 text-[10px] text-retro-green font-semibold uppercase tracking-wider mt-1"}," Local ",-1)),(v(!0),b(we,null,Fe(p(Or).local,Xe=>(v(),b("label",{key:Xe.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[d("input",{type:"checkbox",checked:p(t).filteredBranches.includes(Xe.name),class:"accent-retro-cyan",onChange:Ms=>p(t).toggleBranchFilter(Xe.name)},null,40,Q$),d("span",P$,M(Xe.name),1),Xe.isHead?(v(),b("span",T$,"(HEAD)")):V("",!0)]))),128))],64)):V("",!0),(v(!0),b(we,null,Fe(p(Or).remotes,(Xe,Ms)=>(v(),b(we,{key:Ms},[d("div",M$,M(Ms),1),(v(!0),b(we,null,Fe(Xe,Js=>(v(),b("label",{key:Js.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[d("input",{type:"checkbox",checked:p(t).filteredBranches.includes(Js.name),class:"accent-retro-cyan",onChange:Bd=>p(t).toggleBranchFilter(Js.name)},null,40,A$),d("span",_$,M(Js.name),1)]))),128))],64))),128))])):V("",!0)]),d("button",{class:Pe(["flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors",{"animate-spin":p(t).isRefreshing}]),"aria-label":"Refresh",title:"Refresh",onClick:k[11]||(k[11]=Xe=>p(t).loadGitGraph(e.workingDirectory))},[se(p(js),{class:"w-4 h-4"})],2),d("button",{class:"flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors","aria-label":"Fetch all remotes",title:"Fetch All",onClick:Wn},[se(p(lg),{class:"w-4 h-4"})]),d("div",R$,[d("button",{class:Pe(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(Mt)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Manage remotes",title:"Remotes",onClick:k[12]||(k[12]=Xe=>Mt.value=!p(Mt))},[se(p(cg),{class:"w-4 h-4"})],2),p(Mt)?(v(),b("div",E$,[se(G,{remotes:p(t).remotes,onAdd:Ir,onEdit:$t,onDelete:gr,onClose:k[13]||(k[13]=Xe=>Mt.value=!1)},null,8,["remotes"])])):V("",!0)]),p(os)&&e.isActive?(v(),b("div",{key:0,class:Pe(["flex items-center text-[10px] text-retro-muted",{"text-retro-cyan":p(t).isRefreshing}]),title:p(t).lastRefreshTime?`Last checked: ${new Date(p(t).lastRefreshTime).toLocaleTimeString()}`:"","aria-live":"polite","aria-atomic":"true"},[d("span",{class:Pe(["inline-block w-1.5 h-1.5 rounded-full mr-1",p(t).isRefreshing?"bg-retro-cyan animate-pulse":"bg-retro-muted/50"]),"aria-hidden":"true"},null,2),Ne(" "+M(p(os)),1)],10,B$)):V("",!0)]),d("div",{class:Pe(["flex-1 min-h-0 overflow-hidden",{"max-h-[50%]":p(t).selectedCommit||p(t).isUncommittedChangesSelected}])},[se(re,{ref_key:"commitListRef",ref:Vn,commits:p(t).filteredCommits,stashes:p(t).stashes,selectedCommit:p(t).selectedCommit,hasMore:p(t).hasMore,loading:p(t).loading,loadingMore:p(t).loadingMore,searchQuery:p(t).searchQuery,uncommittedChangesCount:p(t).uncommittedChangesCount,isUncommittedChangesSelected:p(t).isUncommittedChangesSelected,highlightBranches:p(Ps),featureHighlightBranches:p(rn),featureMergeBases:p(sn),previewHighlightBranches:p(Qn),previewMergeBases:p(Dt),currentBranchName:p(t).currentBranch?.name,localBranchNames:p(t).localBranchNames,graphStyle:p(t).graphStyle,muteNonAncestral:p(t).muteNonAncestral,columnVisibility:p(t).columnVisibility,onSelect:p(t).selectCommit,onLoadMore:p(t).loadMoreCommits,onBranchContextMenu:p(ne),onCommitContextMenu:p(Rt),onTagContextMenu:p(nn),onStashContextMenu:p(Cs),onCompareSelect:Li,onSelectUncommittedChanges:p(t).selectUncommittedChanges,onScrollStart:p(s).startInteraction,onScrollEnd:p(s).endInteraction},null,8,["commits","stashes","selectedCommit","hasMore","loading","loadingMore","searchQuery","uncommittedChangesCount","isUncommittedChangesSelected","highlightBranches","featureHighlightBranches","featureMergeBases","previewHighlightBranches","previewMergeBases","currentBranchName","localBranchNames","graphStyle","muteNonAncestral","columnVisibility","onSelect","onLoadMore","onBranchContextMenu","onCommitContextMenu","onTagContextMenu","onStashContextMenu","onSelectUncommittedChanges","onScrollStart","onScrollEnd"])],2),p(t).isComparing&&p(t).selectedCommit&&p(t).comparisonCommit?(v(),Oe(ye,{key:1,fromCommit:p(t).comparisonCommit,toCommit:p(t).selectedCommit,files:p(t).comparisonFiles,stats:p(t).comparisonStats,loading:p(t).comparisonLoading,onClose:p(t).clearComparison},null,8,["fromCommit","toCommit","files","stats","loading","onClose"])):p(t).selectedCommit?(v(),Oe(Te,{key:2,commit:p(t).selectedCommit,files:p(t).selectedCommitFiles,stats:p(t).selectedCommitStats,loading:p(t).isLoadingDetails,detailPosition:p(t).detailViewPosition,onClose:p(t).clearSelection,onNavigateToCommit:Ts,onTogglePosition:p(t).toggleDetailViewPosition,onOpenFileDiff:k[14]||(k[14]=Xe=>p(t).selectedCommit&&p(t).openFileDiff(p(t).selectedCommit.hash,Xe))},null,8,["commit","files","stats","loading","detailPosition","onClose","onTogglePosition"])):V("",!0),p(t).isUncommittedChangesSelected?(v(),Oe(Ze,{key:3,stagedFiles:p(t).stagedFiles,unstagedFiles:p(t).unstagedFiles,isStaging:p(t).isStaging,isCommitting:p(t).isCommitting,onClose:p(t).clearSelection,onStageFiles:k[15]||(k[15]=Xe=>p(t).stageFiles(Xe)),onUnstageFiles:k[16]||(k[16]=Xe=>p(t).unstageFiles(Xe)),onStageAll:k[17]||(k[17]=()=>p(t).stageFiles([])),onUnstageAll:k[18]||(k[18]=()=>p(t).unstageFiles([])),onCommit:k[19]||(k[19]=Xe=>p(t).commitChanges(Xe))},null,8,["stagedFiles","unstagedFiles","isStaging","isCommitting","onClose"])):V("",!0)],64)),p(F).visible?(v(),Oe(et,{key:5,branchName:p(F).branch,isCurrentBranch:p(F).isCurrentBranch,isLocal:p(F).isLocal,x:p(F).x,y:p(F).y,onClose:p(Qe),onCheckout:p(ke),onCreateBranch:p(ze),onDeleteBranch:p(He),onRename:p(qe),onMerge:p(me),onRebase:p(Ee),onPush:p(de),onPull:p(fe),onFetch:p(J),onCopyName:p(Ce)},null,8,["branchName","isCurrentBranch","isLocal","x","y","onClose","onCheckout","onCreateBranch","onDeleteBranch","onRename","onMerge","onRebase","onPush","onPull","onFetch","onCopyName"])):V("",!0),p(je).visible&&p(je).commit?(v(),Oe(Ot,{key:6,commit:p(je).commit,x:p(je).x,y:p(je).y,onClose:p(Lt),onAddTag:p(pr),onCreateBranch:p(Ut),onCheckout:p(tn),onCherryPick:p(Vt),onRevert:p(Wt),onMergeInto:p(dn),onReset:p(nr),onCopyHash:p(mr),onCopySubject:p(Xn)},null,8,["commit","x","y","onClose","onAddTag","onCreateBranch","onCheckout","onCherryPick","onRevert","onMergeInto","onReset","onCopyHash","onCopySubject"])):V("",!0),p(Qt).visible?(v(),Oe(Zt,{key:7,tagName:p(Qt).tag,x:p(Qt).x,y:p(Qt).y,onClose:p(ee),onViewDetails:p(pe),onDeleteTag:p(ie),onPushTag:p(xe),onCopyName:p(Re)},null,8,["tagName","x","y","onClose","onViewDetails","onDeleteTag","onPushTag","onCopyName"])):V("",!0),p(zn).visible&&p(zn).stash?(v(),Oe(ea,{key:8,stashIndex:p(zn).stash.index,stashMessage:p(zn).stash.message,x:p(zn).x,y:p(zn).y,onClose:p(wt),onApply:p(Nn),onPop:p(Qs),onDrop:p(ns),onCreateBranch:p(Dr),onCopyName:p(rs),onCopyHash:p(ss)},null,8,["stashIndex","stashMessage","x","y","onClose","onApply","onPop","onDrop","onCreateBranch","onCopyName","onCopyHash"])):V("",!0),p(Ue).visible?(v(),Oe(Xr,{key:9,x:p(Ue).x,y:p(Ue).y,onClose:p(Ge),onStash:p(it),onReset:p($s),onClean:p(rr)},null,8,["x","y","onClose","onStash","onReset","onClean"])):V("",!0),p(a).visible?(v(),Oe(Di,{key:10,title:"Checkout",visible:p(a).visible,loading:p(a).loading,error:p(a).error,confirmLabel:"Checkout",onClose:k[20]||(k[20]=Xe=>p(a).visible=!1),onConfirm:p(l)},{default:bt(()=>[d("p",L$,[k[60]||(k[60]=Ne(" Are you sure you want to checkout ",-1)),d("span",D$,M(p(a).branchName),1),k[61]||(k[61]=Ne("? ",-1))])]),_:1},8,["visible","loading","error","onConfirm"])):V("",!0),p(m).visible?(v(),Oe(Di,{key:11,title:"Rename Branch",visible:p(m).visible,loading:p(m).loading,error:p(m).error,confirmLabel:"Rename",onClose:k[23]||(k[23]=Xe=>p(m).visible=!1),onConfirm:p(g)},{default:bt(()=>[d("div",Z$,[d("p",I$,[k[62]||(k[62]=Ne(" Rename ",-1)),d("span",X$,M(p(m).branchName),1)]),tt(d("input",{"onUpdate:modelValue":k[21]||(k[21]=Xe=>p(m).newName=Xe),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"New branch name",onKeyup:k[22]||(k[22]=zs((...Xe)=>p(g)&&p(g)(...Xe),["enter"]))},null,544),[[cn,p(m).newName]])])]),_:1},8,["visible","loading","error","onConfirm"])):V("",!0),p(O).visible?(v(),Oe(LS,{key:12,visible:p(O).visible,branchName:p(O).branchName,loading:p(O).loading,error:p(O).error,onClose:k[24]||(k[24]=Xe=>p(O).visible=!1),onConfirm:p(y)},null,8,["visible","branchName","loading","error","onConfirm"])):V("",!0),p(h).visible?(v(),Oe(TS,{key:13,visible:p(h).visible,branchName:p(h).branchName,isLocal:p(h).isLocal,loading:p(h).loading,error:p(h).error,onClose:k[25]||(k[25]=Xe=>p(h).visible=!1),onConfirm:p(f)},null,8,["visible","branchName","isLocal","loading","error","onConfirm"])):V("",!0),p(Q).visible?(v(),Oe(JS,{key:14,visible:p(Q).visible,branchName:p(Q).branchName,remotes:p(Pn),loading:p(Q).loading,error:p(Q).error,onClose:k[26]||(k[26]=Xe=>p(Q).visible=!1),onConfirm:p(T)},null,8,["visible","branchName","remotes","loading","error","onConfirm"])):V("",!0),p(D).visible?(v(),Oe(VS,{key:15,visible:p(D).visible,branchName:p(D).branchName,remotes:p(Pn),loading:p(D).loading,error:p(D).error,onClose:k[27]||(k[27]=Xe=>p(D).visible=!1),onConfirm:p(K)},null,8,["visible","branchName","remotes","loading","error","onConfirm"])):V("",!0),p(x).visible?(v(),Oe(o2,{key:16,visible:p(x).visible,branchName:p(t).currentBranch?.name||"HEAD",ontoBranch:p(x).branchName,loading:p(x).loading,error:p(x).error,onClose:k[28]||(k[28]=Xe=>p(x).visible=!1),onConfirm:p(S)},null,8,["visible","branchName","ontoBranch","loading","error","onConfirm"])):V("",!0),p(I).visible?(v(),Oe(vS,{key:17,visible:p(I).visible,commitHash:p(I).commitHash,commitMessage:p(I).commitMessage,loading:p(I).loading,error:p(I).error,onClose:k[29]||(k[29]=Xe=>p(I).visible=!1),onConfirm:p(ue)},null,8,["visible","commitHash","commitMessage","loading","error","onConfirm"])):V("",!0),p(le).visible?(v(),Oe(f2,{key:18,visible:p(le).visible,commitHash:p(le).commitHash,commitMessage:p(le).commitMessage,loading:p(le).loading,error:p(le).error,onClose:k[30]||(k[30]=Xe=>p(le).visible=!1),onConfirm:p(oe)},null,8,["visible","commitHash","commitMessage","loading","error","onConfirm"])):V("",!0),p(Z).visible?(v(),Oe(R2,{key:19,visible:p(Z).visible,commitHash:p(Z).commitHash,remotes:p(Pn),loading:p(Z).loading,error:p(Z).error,onClose:k[31]||(k[31]=Xe=>p(Z).visible=!1),onConfirm:p(X)},null,8,["visible","commitHash","remotes","loading","error","onConfirm"])):V("",!0),p(B).visible?(v(),Oe(X2,{key:20,visible:p(B).visible,tagName:p(B).tagName,remotes:p(Pn),loading:p(B).loading,error:p(B).error,onClose:k[32]||(k[32]=Xe=>p(B).visible=!1),onConfirm:p(q)},null,8,["visible","tagName","remotes","loading","error","onConfirm"])):V("",!0),p(U).visible?(v(),Oe(t$,{key:21,visible:p(U).visible,tagName:p(U).tagName,tagDetail:p(U).tagDetail,loading:p(U).loading,onClose:k[33]||(k[33]=Xe=>p(U).visible=!1)},null,8,["visible","tagName","tagDetail","loading"])):V("",!0),p(c).visible?(v(),Oe(wS,{key:22,visible:p(c).visible,fromCommit:p(c).fromCommit,loading:p(c).loading,error:p(c).error,onClose:k[34]||(k[34]=Xe=>p(c).visible=!1),onConfirm:p(u)},null,8,["visible","fromCommit","loading","error","onConfirm"])):V("",!0),p(W).visible?(v(),Oe(Di,{key:23,title:"Create Branch from Stash",visible:p(W).visible,loading:p(W).loading,error:p(W).error,confirmLabel:"Create Branch",onClose:k[37]||(k[37]=Xe=>p(W).visible=!1),onConfirm:k[38]||(k[38]=Xe=>p(te)(p(ve)))},{default:bt(()=>[d("div",z$,[d("p",N$,[k[63]||(k[63]=Ne(" Create a new branch from ",-1)),d("span",V$,"stash@"+M("{")+M(p(W).stashIndex)+M("}"),1)]),tt(d("input",{"onUpdate:modelValue":k[35]||(k[35]=Xe=>at(ve)?ve.value=Xe:null),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"Branch name",onKeyup:k[36]||(k[36]=zs(Xe=>p(te)(p(ve)),["enter"]))},null,544),[[cn,p(ve)]])])]),_:1},8,["visible","loading","error"])):V("",!0),p(j).visible?(v(),Oe(y2,{key:24,visible:p(j).visible,loading:p(j).loading,error:p(j).error,onClose:k[39]||(k[39]=Xe=>p(j).visible=!1),onConfirm:p(N)},null,8,["visible","loading","error","onConfirm"])):V("",!0),p(he).visible?(v(),Oe(v2,{key:25,visible:p(he).visible,loading:p(he).loading,error:p(he).error,onClose:k[40]||(k[40]=Xe=>p(he).visible=!1),onConfirm:p(C)},null,8,["visible","loading","error","onConfirm"])):V("",!0),p(w).visible?(v(),Oe(SS,{key:26,visible:p(w).visible,loading:p(w).loading,error:p(w).error,onClose:k[41]||(k[41]=Xe=>p(w).visible=!1),onConfirm:p(_)},null,8,["visible","loading","error","onConfirm"])):V("",!0),(v(),Oe(cr,{to:"body"},[se(Ur,{name:"fade"},{default:bt(()=>[p(z).visible?(v(),b("div",{key:0,class:"fixed z-50 px-3 py-1.5 text-sm bg-retro-green text-retro-dark rounded shadow-lg",style:mn({left:`${p(z).x}px`,top:`${p(z).y-40}px`})}," Copied! ",4)):V("",!0)]),_:1})])),(v(),Oe(cr,{to:"body"},[se(Ur,{name:"fade"},{default:bt(()=>[p(t).operationError?(v(),b("div",W$,[se(p(ms),{class:"w-4 h-4 flex-shrink-0"}),d("span",j$,M(p(t).operationError),1),d("button",{class:"flex-shrink-0 p-0.5 hover:bg-white/20 rounded transition-colors",onClick:k[42]||(k[42]=Xe=>p(t).clearOperationError()),"aria-label":"Dismiss error"},[se(p(Yt),{class:"w-3.5 h-3.5"})])])):V("",!0)]),_:1})]))])}}}),F$=Do(Y$,[["__scopeId","data-v-52ace892"]]),U$=qv("/app-logo.svg"),G$={class:"flex items-start justify-between gap-2"},H$={class:"flex-1 min-w-0"},K$={class:"flex items-center gap-2"},J$={class:"font-mono text-sm text-retro-text truncate"},eC={class:"text-xs font-mono text-retro-muted mt-1 truncate"},tC={class:"flex items-center gap-1 flex-shrink-0"},nC={key:0,class:"inline-flex items-center gap-1 text-[10px] font-mono text-retro-red",title:"Critical traceability gaps"},rC={key:1,class:"inline-flex items-center gap-1 text-[10px] font-mono text-retro-yellow",title:"Major traceability gaps"},sC={key:2,class:"text-[10px] font-mono text-retro-muted mr-1",title:"Completed tasks / total tasks"},iC={key:3,class:"w-2 h-2 rounded-full bg-retro-green",title:"spec"},oC={key:4,class:"w-2 h-2 rounded-full bg-retro-cyan",title:"plan"},aC={key:5,class:"w-2 h-2 rounded-full bg-retro-yellow",title:"tasks"},lC={class:"flex flex-wrap items-center justify-between gap-1 mt-2"},cC={key:0,class:"flex items-center gap-1"},uC=["title","disabled","onClick"],hC=We({__name:"FeatureCard",props:{feature:{},skills:{},isActive:{type:Boolean},criticalAlerts:{},majorAlerts:{}},emits:["select","cascade","openChat","skill"],setup(n,{emit:e}){const t={DocumentCheckIcon:Sb,PuzzlePieceIcon:Wd,DocumentMagnifyingGlassIcon:Cb,WrenchScrewdriverIcon:Lb,SparklesIcon:Il,BeakerIcon:gb,ShieldCheckIcon:fg,CommandLineIcon:wb,CpuChipIcon:ug,LightBulbIcon:_b},r=n,s=e,i=Jn();function o(f){return t[f]||Wd}function a(f){return f.prerequisites.every(m=>r.feature.files.some(g=>g.filename===m))}function l(f){return f.prerequisites.filter(m=>!r.feature.files.some(g=>g.filename===m))}function c(f){return a(f)?`${f.name} (Shift+click: new conversation)`:`Requires: ${l(f).join(", ")}`}const u=Y(()=>{const f=i.findConversationByFeature(r.feature.id);return f?i.isConversationStreaming(f.id):!1}),h=Y(()=>r.isActive?["border-retro-cyan shadow-retro","feature-card-active","dark:bg-gradient-to-br dark:from-retro-cyan/10 dark:via-retro-panel dark:to-retro-magenta/5"]:["border-retro-border","feature-card-light","hover:border-retro-muted","dark:bg-gradient-to-br","dark:from-retro-panel dark:via-retro-panel dark:to-retro-cyan/5","dark:hover:from-retro-cyan/5 dark:hover:via-retro-panel dark:hover:to-retro-magenta/5"]);return(f,m)=>(v(),b("button",{type:"button",class:Pe(["w-full p-3 text-left rounded-lg border transition-all duration-200 group",p(h)]),onClick:m[5]||(m[5]=g=>s("select",n.feature.id))},[d("div",G$,[d("div",H$,[d("div",K$,[se(p(Oi),{class:Pe(["h-4 w-4 flex-shrink-0 transition-colors duration-200",n.isActive?"text-retro-cyan":"text-retro-muted group-hover:text-retro-cyan"])},null,8,["class"]),d("span",J$,M(n.feature.id),1)]),d("p",eC,M(n.feature.name),1)]),d("div",tC,[n.criticalAlerts>0?(v(),b("span",nC,[m[6]||(m[6]=d("span",{class:"w-1.5 h-1.5 rounded-full bg-retro-red"},null,-1)),Ne(" "+M(n.criticalAlerts),1)])):V("",!0),n.majorAlerts>0?(v(),b("span",rC,[m[7]||(m[7]=d("span",{class:"w-1.5 h-1.5 rounded-full bg-retro-yellow"},null,-1)),Ne(" "+M(n.majorAlerts),1)])):V("",!0),n.feature.hasTasks?(v(),b("span",sC,M(n.feature.completedTasks)+"/"+M(n.feature.totalTasks),1)):V("",!0),n.feature.hasSpec?(v(),b("span",iC)):V("",!0),n.feature.hasPlan?(v(),b("span",oC)):V("",!0),n.feature.hasTasks?(v(),b("span",aC)):V("",!0)])]),d("div",lC,[n.feature.hasSpec?(v(),b("div",cC,[d("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Clarify spec (Shift+click: new conversation)",onClick:m[0]||(m[0]=ln(g=>s("cascade",g,n.feature.id,"clarify"),["stop"]))},[se(p(kh),{class:"h-3.5 w-3.5"})]),d("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Plan → Tasks → Implement (Shift+click: new conversation)",onClick:m[1]||(m[1]=ln(g=>s("cascade",g,n.feature.id,"plan"),["stop"]))},[se(p(xh),{class:"h-3.5 w-3.5"})]),n.feature.hasPlan?(v(),b("button",{key:0,type:"button",class:"flex items-center justify-center p-1 bg-retro-yellow/20 text-retro-yellow rounded hover:bg-retro-yellow/30 transition-colors",title:"Tasks → Implement (Shift+click: new conversation)",onClick:m[2]||(m[2]=ln(g=>s("cascade",g,n.feature.id,"tasks"),["stop"]))},[se(p(dg),{class:"h-3.5 w-3.5"})])):V("",!0),n.feature.hasTasks?(v(),b("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-magenta/20 text-retro-magenta rounded hover:bg-retro-magenta/30 transition-colors",title:"Implement (Shift+click: new conversation)",onClick:m[3]||(m[3]=ln(g=>s("cascade",g,n.feature.id,"implement"),["stop"]))},[se(p(Bb),{class:"h-3.5 w-3.5"})])):V("",!0),n.skills.length>0?(v(),b(we,{key:2},[m[8]||(m[8]=d("div",{class:"w-px h-4 bg-retro-border mx-0.5"},null,-1)),(v(!0),b(we,null,Fe(n.skills,g=>(v(),b("button",{key:g.id,type:"button",class:Pe(["flex items-center justify-center p-1 rounded transition-colors",[a(g)&&!p(u)?"bg-retro-pink/20 text-retro-pink hover:bg-retro-pink/30":"bg-retro-subtle/10 text-retro-subtle cursor-not-allowed",p(u)?"animate-pulse":""]]),title:c(g),disabled:!a(g)||p(u),onClick:ln(O=>s("skill",O,n.feature.id,g.id),["stop"])},[(v(),Oe(mi(o(g.icon)),{class:"h-3.5 w-3.5"}))],10,uC))),128))],64)):V("",!0)])):V("",!0),n.feature.hasSpec?(v(),b("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-green/20 text-retro-green rounded hover:bg-retro-green/30 transition-colors",title:"Open new chat linked to this spec",onClick:m[4]||(m[4]=ln(g=>s("openChat",g,n.feature.id),["stop"]))},[se(p(xb),{class:"h-3.5 w-3.5"})])):V("",!0)])],2))}});let du=[],Ag=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?Ag:du).push(t=t+n[e])})();function dC(n){if(n<768)return!1;for(let e=0,t=du.length;;){let r=e+t>>1;if(n<du[r])t=r;else if(n>=Ag[r])e=r+1;else return!0;if(e==t)return!1}}function uf(n){return n>=127462&&n<=127487}const hf=8205;function fC(n,e,t=!0,r=!0){return(t?_g:pC)(n,e,r)}function _g(n,e,t){if(e==n.length)return e;e&&Rg(n.charCodeAt(e))&&Eg(n.charCodeAt(e-1))&&e--;let r=fc(n,e);for(e+=df(r);e<n.length;){let s=fc(n,e);if(r==hf||s==hf||t&&dC(s))e+=df(s),r=s;else if(uf(s)){let i=0,o=e-2;for(;o>=0&&uf(fc(n,o));)i++,o-=2;if(i%2==0)break;e+=2}else break}return e}function pC(n,e,t){for(;e>0;){let r=_g(n,e-2,t);if(r<e)return r;e--}return 0}function fc(n,e){let t=n.charCodeAt(e);if(!Eg(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Rg(r)?(t-55296<<10)+(r-56320)+65536:t}function Rg(n){return n>=56320&&n<57344}function Eg(n){return n>=55296&&n<56320}function df(n){return n<65536?1:2}class ct{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=bi(this,e,t);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(t,this.length,s,1),Cr.from(s,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=bi(this,e,t);let r=[];return this.decompose(e,t,r,0),Cr.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new io(this),i=new io(e);for(let o=t,a=t;;){if(s.next(o),i.next(o),o=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(a+=s.value.length,s.done||a>=r)return!0}}iter(e=1){return new io(this,e)}iterRange(e,t=this.length){return new Bg(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Lg(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ct.empty:e.length<=32?new At(e):Cr.from(At.split(e,[]))}}class At extends ct{constructor(e,t=mC(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,s){for(let i=0;;i++){let o=this.text[i],a=s+o.length;if((t?r:a)>=e)return new gC(s,a,r,o);s=a+1,r++}}decompose(e,t,r,s){let i=e<=0&&t>=this.length?this:new At(ff(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=r.pop(),a=Za(i.text,o.text.slice(),0,i.length);if(a.length<=32)r.push(new At(a,o.length+i.length));else{let l=a.length>>1;r.push(new At(a.slice(0,l)),new At(a.slice(l)))}}else r.push(i)}replace(e,t,r){if(!(r instanceof At))return super.replace(e,t,r);[e,t]=bi(this,e,t);let s=Za(this.text,Za(r.text,ff(this.text,0,e)),t),i=this.length+r.length-(t-e);return s.length<=32?new At(s,i):Cr.from(At.split(s,[]),i)}sliceString(e,t=this.length,r=`
68
+ `){[e,t]=bi(this,e,t);let s="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let a=this.text[o],l=i+a.length;i>e&&o&&(s+=r),e<l&&t>i&&(s+=a.slice(Math.max(0,e-i),t-i)),i=l+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(t.push(new At(r,s)),r=[],s=-1);return s>-1&&t.push(new At(r,s)),t}}class Cr extends ct{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,s){for(let i=0;;i++){let o=this.children[i],a=s+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,s);s=a+1,r=l+1}}decompose(e,t,r,s){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let a=this.children[i],l=o+a.length;if(e<=l&&t>=o){let c=s&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?r.push(a):a.decompose(e-o,t-o,r,c)}o=l+1}}replace(e,t,r){if([e,t]=bi(this,e,t),r.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let o=this.children[s],a=i+o.length;if(e>=i&&t<=a){let l=o.replace(e-i,t-i,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[s]=l,new Cr(u,this.length-(t-e)+r.length)}return super.replace(i,a,l)}i=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
69
+ `){[e,t]=bi(this,e,t);let s="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let a=this.children[i],l=o+a.length;o>e&&i&&(s+=r),e<l&&t>o&&(s+=a.sliceString(e-o,t-o,r)),o=l+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Cr))return 0;let r=0,[s,i,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,i+=t){if(s==o||i==a)return r;let l=this.children[s],c=e.children[i];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let g of e)g.flatten(m);return new At(m,t)}let s=Math.max(32,r>>5),i=s<<1,o=s>>1,a=[],l=0,c=-1,u=[];function h(m){let g;if(m.lines>i&&m instanceof Cr)for(let O of m.children)h(O);else m.lines>o&&(l>o||!l)?(f(),a.push(m)):m instanceof At&&l&&(g=u[u.length-1])instanceof At&&m.lines+g.lines<=32?(l+=m.lines,c+=m.length+1,u[u.length-1]=new At(g.text.concat(m.text),g.length+1+m.length)):(l+m.lines>s&&f(),l+=m.lines,c+=m.length+1,u.push(m))}function f(){l!=0&&(a.push(u.length==1?u[0]:Cr.from(u,c)),c=-1,l=u.length=0)}for(let m of e)h(m);return f(),a.length==1?a[0]:new Cr(a,t)}}ct.empty=new At([""],0);function mC(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Za(n,e,t=0,r=1e9){for(let s=0,i=0,o=!0;i<n.length&&s<=r;i++){let a=n[i],l=s+a.length;l>=t&&(l>r&&(a=a.slice(0,r-s)),s<t&&(a=a.slice(t-s)),o?(e[e.length-1]+=a,o=!1):e.push(a)),s=l+1}return e}function ff(n,e,t){return Za(n,[""],e,t)}class io{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof At?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],o=i>>1,a=s instanceof At?s.text.length:s.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
70
+ `,this;e--}else if(s instanceof At){let l=s.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=s.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof At?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Bg{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new io(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=r?s:t<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Lg{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ct.prototype[Symbol.iterator]=function(){return this.iter()},io.prototype[Symbol.iterator]=Bg.prototype[Symbol.iterator]=Lg.prototype[Symbol.iterator]=function(){return this});let gC=class{constructor(e,t,r,s){this.from=e,this.to=t,this.number=r,this.text=s}get length(){return this.to-this.from}};function bi(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function qt(n,e,t=!0,r=!0){return fC(n,e,t,r)}function OC(n){return n>=56320&&n<57344}function vC(n){return n>=55296&&n<56320}function kn(n,e){let t=n.charCodeAt(e);if(!vC(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return OC(r)?(t-55296<<10)+(r-56320)+65536:t}function Bh(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Qr(n){return n<65536?1:2}const fu=/\r\n?|\n/;var Jt=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Jt||(Jt={}));class Rr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,s=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(r,s,i),s+=i):s+=o,r+=i}}iterChangedRanges(e,t=!1){pu(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];s<0?e.push(r,s):e.push(s,r)}return new Rr(e)}composeDesc(e){return this.empty?e:e.empty?this:Dg(this,e)}mapDesc(e,t=!1){return e.empty?this:mu(this,e,t)}mapPos(e,t=-1,r=Jt.Simple){let s=0,i=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=s+a;if(l<0){if(c>e)return i+(e-s);i+=a}else{if(r!=Jt.Simple&&c>=e&&(r==Jt.TrackDel&&s<e&&c>e||r==Jt.TrackBefore&&s<e||r==Jt.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==s||t<0?i:i+l;i+=l}s=c}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,t=e){for(let r=0,s=0;r<this.sections.length&&s<=t;){let i=this.sections[r++],o=this.sections[r++],a=s+i;if(o>=0&&s<=t&&a>=e)return s<e&&a>t?"cover":!0;s=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Rr(e)}static create(e){return new Rr(e)}}class Xt extends Rr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return pu(this,(t,r,s,i,o)=>e=e.replace(s,s+(r-t),o),!1),e}mapDesc(e,t=!1){return mu(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let s=0,i=0;s<t.length;s+=2){let o=t[s],a=t[s+1];if(a>=0){t[s]=a,t[s+1]=o;let l=s>>1;for(;r.length<l;)r.push(ct.empty);r.push(o?e.slice(i,i+o):ct.empty)}i+=o}return new Xt(t,r)}compose(e){return this.empty?e:e.empty?this:Dg(this,e,!0)}map(e,t=!1){return e.empty?this:mu(this,e,t,!0)}iterChanges(e,t=!1){pu(this,e,t)}get desc(){return Rr.create(this.sections)}filter(e){let t=[],r=[],s=[],i=new po(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&i.len==0;){if(i.done)break e;let u=Math.min(i.len,l-a);an(s,u,-1);let h=i.ins==-1?-1:i.off==0?i.ins:0;an(t,u,h),h>0&&ps(r,t,i.text),i.forward(u),a+=u}let c=e[o++];for(;a<c;){if(i.done)break e;let u=Math.min(i.len,c-a);an(t,u,-1),an(s,u,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(u),a+=u}}return{changes:new Xt(t,r),filtered:Rr.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],s=this.sections[t+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let s=[],i=[],o=0,a=null;function l(u=!1){if(!u&&!s.length)return;o<t&&an(s,t-o,-1);let h=new Xt(s,i);a=a?a.compose(h.map(a)):h,s=[],i=[],o=0}function c(u){if(Array.isArray(u))for(let h of u)c(h);else if(u instanceof Xt){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:h,to:f=h,insert:m}=u;if(h>f||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let g=m?typeof m=="string"?ct.of(m.split(r||fu)):m:ct.empty,O=g.length;if(h==f&&O==0)return;h<o&&l(),h>o&&an(s,h-o,-1),an(s,f-h,O),ps(i,s,g),o=f}}return c(e),l(!a),a}static empty(e){return new Xt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(typeof i=="number")t.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)t.push(i[0],0);else{for(;r.length<s;)r.push(ct.empty);r[s]=ct.of(i.slice(1)),t.push(i[0],r[s].length)}}}return new Xt(t,r)}static createSet(e,t){return new Xt(e,t)}}function an(n,e,t,r=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:r?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function ps(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(ct.empty);n.push(t)}}function pu(n,e,t){let r=n.inserted;for(let s=0,i=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)s+=a,i+=a;else{let c=s,u=i,h=ct.empty;for(;c+=a,u+=l,l&&r&&(h=h.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(s,c,i,u,h),s=c,i=u}}}function mu(n,e,t,r=!1){let s=[],i=r?[]:null,o=new po(n),a=new po(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);an(s,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(an(s,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(an(s,0,o.ins),i&&ps(i,s,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let h=Math.min(u,a.len);c+=h,u-=h,a.forward(h)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;an(s,c,l<o.i?o.ins:0),i&&l<o.i&&ps(i,s,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return i?Xt.createSet(s,i):Rr.create(s);throw new Error("Mismatched change set lengths")}}}function Dg(n,e,t=!1){let r=[],s=t?[]:null,i=new po(n),o=new po(e);for(let a=!1;;){if(i.done&&o.done)return s?Xt.createSet(r,s):Rr.create(r);if(i.ins==0)an(r,i.len,0,a),i.next();else if(o.len==0&&!o.done)an(r,0,o.ins,a),s&&ps(s,r,o.text),o.next();else{if(i.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(i.len2,o.len),c=r.length;if(i.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;an(r,l,u,a),s&&u&&ps(s,r,o.text)}else o.ins==-1?(an(r,i.off?0:i.len,l,a),s&&ps(s,r,i.textBit(l))):(an(r,i.off?0:i.len,o.off?0:o.ins,a),s&&!o.off&&ps(s,r,o.text));a=(i.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),i.forward2(l),o.forward(l)}}}}class po{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?ct.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?ct.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ds{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Ds(r,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ae.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ae.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ae.range(e.anchor,e.head)}static create(e,t,r){return new Ds(e,t,r)}}class ae{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ae.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ae([this.main],0)}addRange(e,t=!0){return ae.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,ae.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ae(e.ranges.map(t=>Ds.fromJSON(t)),e.main)}static single(e,t=e){return new ae([ae.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let i=e[s];if(i.empty?i.from<=r:i.from<r)return ae.normalized(e.slice(),t);r=i.to}return new ae(e,t)}static cursor(e,t=0,r,s){return Ds.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(s??16777215)<<6)}static range(e,t,r,s){let i=(r??16777215)<<6|(s==null?7:Math.min(6,s));return t<e?Ds.create(t,e,48|i):Ds.create(e,t,(t>e?8:0)|i)}static normalized(e,t=0){let r=e[t];e.sort((s,i)=>s.from-i.from),t=e.indexOf(r);for(let s=1;s<e.length;s++){let i=e[s],o=e[s-1];if(i.empty?i.from<=o.to:i.from<o.to){let a=o.from,l=Math.max(i.to,o.to);s<=t&&t--,e.splice(--s,2,i.anchor>i.head?ae.range(l,a):ae.range(a,l))}}return new ae(e,t)}}function Zg(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Lh=0;class Me{constructor(e,t,r,s,i){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=s,this.id=Lh++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new Me(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Dh),!!e.static,e.enables)}of(e){return new Ia([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ia(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ia(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Dh(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Ia{constructor(e,t,r,s){this.dependencies=e,this.facet=t,this.type=r,this.value=s,this.id=Lh++}dynamicSlot(e){var t;let r=this.value,s=this.facet.compareInput,i=this.id,o=e[i]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:(((t=e[h.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||gu(h,u)){let m=r(h);if(a?!pf(m,h.values[o],s):!s(m,h.values[o]))return h.values[o]=m,1}return 0},reconfigure:(h,f)=>{let m,g=f.config.address[i];if(g!=null){let O=rl(f,g);if(this.dependencies.every(y=>y instanceof Me?f.facet(y)===h.facet(y):y instanceof Ft?f.field(y,!1)==h.field(y,!1):!0)||(a?pf(m=r(h),O,s):s(m=r(h),O)))return h.values[o]=O,0}else m=r(h);return h.values[o]=m,1}}}}function pf(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function gu(n,e){let t=!1;for(let r of e)oo(n,r)&1&&(t=!0);return t}function bC(n,e,t){let r=t.map(l=>n[l.id]),s=t.map(l=>l.type),i=r.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let h=rl(l,r[u]);if(s[u]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)oo(l,c);return l.values[o]=a(l),1},update(l,c){if(!gu(l,i))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=gu(l,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!u&&Dh(t,h))return l.values[o]=f,0;let m=a(l);return e.compare(m,f)?(l.values[o]=f,0):(l.values[o]=m,1)}}}const la=Me.define({static:!0});class Ft{constructor(e,t,r,s,i){this.id=e,this.createF=t,this.updateF=r,this.compareF=s,this.spec=i,this.provides=void 0}static define(e){let t=new Ft(Lh++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(la).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,s)=>{let i=r.values[t],o=this.updateF(i,s);return this.compareF(i,o)?0:(r.values[t]=o,1)},reconfigure:(r,s)=>{let i=r.facet(la),o=s.facet(la),a;return(a=i.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):s.config.address[this.id]!=null?(r.values[t]=s.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,la.of({field:this,create:e})]}get extension(){return this}}const Es={lowest:4,low:3,default:2,high:1,highest:0};function ji(n){return e=>new Ig(e,n)}const es={highest:ji(Es.highest),high:ji(Es.high),default:ji(Es.default),low:ji(Es.low),lowest:ji(Es.lowest)};class Ig{constructor(e,t){this.inner=e,this.prec=t}}class Wl{of(e){return new Ou(this,e)}reconfigure(e){return Wl.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ou{constructor(e,t){this.compartment=e,this.inner=t}}class nl{constructor(e,t,r,s,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let s=[],i=Object.create(null),o=new Map;for(let f of xC(e,t,o))f instanceof Ft?s.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of s)a[f.id]=c.length<<1,c.push(m=>f.slot(m));let u=r?.config.facets;for(let f in i){let m=i[f],g=m[0].facet,O=u&&u[f]||[];if(m.every(y=>y.type==0))if(a[g.id]=l.length<<1|1,Dh(O,m))l.push(r.facet(g));else{let y=g.combine(m.map(x=>x.value));l.push(r&&g.compare(y,r.facet(g))?r.facet(g):y)}else{for(let y of m)y.type==0?(a[y.id]=l.length<<1|1,l.push(y.value)):(a[y.id]=c.length<<1,c.push(x=>y.dynamicSlot(x)));a[g.id]=c.length<<1,c.push(y=>bC(y,g,m))}}let h=c.map(f=>f(a));return new nl(e,o,h,a,l,i)}}function xC(n,e,t){let r=[[],[],[],[],[]],s=new Map;function i(o,a){let l=s.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof Ou&&t.delete(o.compartment)}if(s.set(o,a),Array.isArray(o))for(let c of o)i(c,a);else if(o instanceof Ou){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),i(c,a)}else if(o instanceof Ig)i(o.inner,o.prec);else if(o instanceof Ft)r[a].push(o),o.provides&&i(o.provides,a);else if(o instanceof Ia)r[a].push(o),o.facet.extensions&&i(o.facet.extensions,Es.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(n,Es.default),r.reduce((o,a)=>o.concat(a))}function oo(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function rl(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Xg=Me.define(),vu=Me.define({combine:n=>n.some(e=>e),static:!0}),zg=Me.define({combine:n=>n.length?n[0]:void 0,static:!0}),Ng=Me.define(),Vg=Me.define(),Wg=Me.define(),jg=Me.define({combine:n=>n.length?n[0]:!1});class ts{constructor(e,t){this.type=e,this.value=t}static define(){return new yC}}class yC{of(e){return new ts(this,e)}}class kC{constructor(e){this.map=e}of(e){return new Ke(this,e)}}class Ke{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ke(this.type,t)}is(e){return this.type==e}static define(e={}){return new kC(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(t);i&&r.push(i)}return r}}Ke.reconfigure=Ke.define();Ke.appendConfig=Ke.define();class Et{constructor(e,t,r,s,i,o){this.startState=e,this.changes=t,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Zg(r,t.newLength),i.some(a=>a.type==Et.time)||(this.annotations=i.concat(Et.time.of(Date.now())))}static create(e,t,r,s,i,o){return new Et(e,t,r,s,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Et.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Et.time=ts.define();Et.userEvent=ts.define();Et.addToHistory=ts.define();Et.remote=ts.define();function wC(n,e){let t=[];for(let r=0,s=0;;){let i,o;if(r<n.length&&(s==e.length||e[s]>=n[r]))i=n[r++],o=n[r++];else if(s<e.length)i=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<i?t.push(i,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function qg(n,e,t){var r;let s,i,o;return t?(s=e.changes,i=Xt.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),i=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(i):(r=n.selection)===null||r===void 0?void 0:r.map(s),effects:Ke.mapEffects(n.effects,s).concat(Ke.mapEffects(e.effects,i)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function bu(n,e,t){let r=e.selection,s=ai(e.annotations);return e.userEvent&&(s=s.concat(Et.userEvent.of(e.userEvent))),{changes:e.changes instanceof Xt?e.changes:Xt.of(e.changes||[],t,n.facet(zg)),selection:r&&(r instanceof ae?r:ae.single(r.anchor,r.head)),effects:ai(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Yg(n,e,t){let r=bu(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(t=!1);let o=!!e[i].sequential;r=qg(r,bu(n,e[i],o?r.changes.newLength:n.doc.length),o)}let s=Et.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return $C(t?SC(s):s)}function SC(n){let e=n.startState,t=!0;for(let s of e.facet(Ng)){let i=s(n);if(i===!1){t=!1;break}Array.isArray(i)&&(t=t===!0?i:wC(t,i))}if(t!==!0){let s,i;if(t===!1)i=n.changes.invertedDesc,s=Xt.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,i=o.filtered.mapDesc(o.changes).invertedDesc}n=Et.create(e,s,n.selection&&n.selection.map(i),Ke.mapEffects(n.effects,i),n.annotations,n.scrollIntoView)}let r=e.facet(Vg);for(let s=r.length-1;s>=0;s--){let i=r[s](n);i instanceof Et?n=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Et?n=i[0]:n=Yg(e,ai(i),!1)}return n}function $C(n){let e=n.startState,t=e.facet(Wg),r=n;for(let s=t.length-1;s>=0;s--){let i=t[s](n);i&&Object.keys(i).length&&(r=qg(r,bu(e,i,n.changes.newLength),!0))}return r==n?n:Et.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const CC=[];function ai(n){return n==null?CC:Array.isArray(n)?n:[n]}var St=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(St||(St={}));const QC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let xu;try{xu=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function PC(n){if(xu)return xu.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||QC.test(t)))return!0}return!1}function TC(n){return e=>{if(!/\S/.test(e))return St.Space;if(PC(e))return St.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return St.Word;return St.Other}}class st{constructor(e,t,r,s,i,o){this.config=e,this.doc=t,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)oo(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return oo(this,r),rl(this,r)}update(...e){return Yg(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:s}=t;for(let a of e.effects)a.is(Wl.reconfigure)?(t&&(s=new Map,t.compartments.forEach((l,c)=>s.set(c,l)),t=null),s.set(a.value.compartment,a.value.extension)):a.is(Ke.reconfigure)?(t=null,r=a.value):a.is(Ke.appendConfig)&&(t=null,r=ai(r).concat(a.value));let i;t?i=e.startState.values.slice():(t=nl.resolve(r,s,this),i=new st(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(vu)?e.newSelection:e.newSelection.asSingle();new st(t,e.newDoc,o,i,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ae.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),s=this.changes(r.changes),i=[r.range],o=ai(r.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),u=c.map(s);for(let f=0;f<a;f++)i[f]=i[f].map(u);let h=s.mapDesc(c,!0);i.push(l.range.map(h)),s=s.compose(u),o=Ke.mapEffects(o,u).concat(Ke.mapEffects(ai(l.effects),h))}return{changes:s,selection:ae.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Xt?e:Xt.of(e,this.doc.length,this.facet(st.lineSeparator))}toText(e){return ct.of(e.split(this.facet(st.lineSeparator)||fu))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(oo(this,t),rl(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Ft&&this.config.address[s.id]!=null&&(t[r]=s.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let o=r[i],a=e[i];s.push(o.init(l=>o.spec.fromJSON(a,l)))}}return st.create({doc:e.doc,selection:ae.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=nl.resolve(e.extensions||[],new Map),r=e.doc instanceof ct?e.doc:ct.of((e.doc||"").split(t.staticFacet(st.lineSeparator)||fu)),s=e.selection?e.selection instanceof ae?e.selection:ae.single(e.selection.anchor,e.selection.head):ae.single(0);return Zg(s,r.length),t.staticFacet(vu)||(s=s.asSingle()),new st(t,r,s,t.dynamicSlots.map(()=>null),(i,o)=>o.create(i),null)}get tabSize(){return this.facet(st.tabSize)}get lineBreak(){return this.facet(st.lineSeparator)||`
71
+ `}get readOnly(){return this.facet(jg)}phrase(e,...t){for(let r of this.facet(st.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>t.length?r:t[i-1]})),e}languageDataAt(e,t,r=-1){let s=[];for(let i of this.facet(Xg))for(let o of i(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return TC(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=qt(t,o,!1);if(i(t.slice(l,o))!=St.Word)break;o=l}for(;a<s;){let l=qt(t,a);if(i(t.slice(a,l))!=St.Word)break;a=l}return o==a?null:ae.range(o+r,a+r)}}st.allowMultipleSelections=vu;st.tabSize=Me.define({combine:n=>n.length?n[0]:4});st.lineSeparator=zg;st.readOnly=jg;st.phrases=Me.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(s=>n[s]==e[s])}});st.languageData=Xg;st.changeFilter=Ng;st.transactionFilter=Vg;st.transactionExtender=Wg;Wl.reconfigure=Ke.define();function Br(n,e,t={}){let r={};for(let s of n)for(let i of Object.keys(s)){let o=s[i],a=r[i];if(a===void 0)r[i]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,i))r[i]=t[i](a,o);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class Os{eq(e){return this==e}range(e,t=e){return yu.create(e,t,this)}}Os.prototype.startSide=Os.prototype.endSide=0;Os.prototype.point=!1;Os.prototype.mapMode=Jt.TrackDel;function Zh(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let yu=class Fg{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Fg(e,t,r)}};function ku(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ih{constructor(e,t,r,s){this.from=e,this.to=t,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,s=0){let i=r?this.to:this.from;for(let o=s,a=i.length;;){if(o==a)return o;let l=o+a>>1,c=i[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,r,s){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,i);i<o;i++)if(s(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,t){let r=[],s=[],i=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,h=this.to[l]+e,f,m;if(u==h){let g=t.mapPos(u,c.startSide,c.mapMode);if(g==null||(f=m=g,c.startSide!=c.endSide&&(m=t.mapPos(u,c.endSide),m<f)))continue}else if(f=t.mapPos(u,c.startSide),m=t.mapPos(h,c.endSide),f>m||f==m&&c.startSide>0&&c.endSide<=0)continue;(m-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(a=Math.max(a,m-f)),r.push(c),s.push(f-o),i.push(m-o))}return{mapped:r.length?new Ih(s,i,r,a):null,pos:o}}}class rt{constructor(e,t,r,s){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=s}static create(e,t,r,s){return new rt(e,t,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(ku)),this.isEmpty)return t.length?rt.of(t):this;let a=new Ug(this,null,-1).goto(0),l=0,c=[],u=new Hr;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let h=t[l++];u.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||s>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||s>a.to||i<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(yu.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?rt.empty:this.nextLayer.update({add:c,filter:o,filterFrom:s,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],s=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)s=Math.max(s,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:h}=l.map(a,e);u&&(s=Math.max(s,u.maxPoint),t.push(u),r.push(h))}}let i=this.nextLayer.map(e);return t.length==0?i:new rt(r,t,i||rt.empty,s)}between(e,t,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let i=this.chunkPos[s],o=this.chunk[s];if(t>=i&&e<=i+o.length&&o.between(i,e-i,t-i,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return mo.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return mo.from(e).goto(t)}static compare(e,t,r,s,i=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),l=mf(o,a,r),c=new qi(o,l,i),u=new qi(a,l,i);r.iterGaps((h,f,m)=>gf(c,h,u,f,m,s)),r.empty&&r.length==0&&gf(c,0,u,0,0,s)}static eq(e,t,r=0,s){s==null&&(s=999999999);let i=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(i.length!=o.length)return!1;if(!i.length)return!0;let a=mf(i,o),l=new qi(i,a,0).goto(r),c=new qi(o,a,0).goto(r);for(;;){if(l.to!=c.to||!wu(l.active,c.active)||l.point&&(!c.point||!Zh(l.point,c.point)))return!1;if(l.to>s)return!0;l.next(),c.next()}}static spans(e,t,r,s,i=-1){let o=new qi(e,null,i).goto(t),a=t,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFrom<t?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,l);s.point(a,c,o.point,u,h,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(s.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new Hr;for(let s of e instanceof yu?[e]:t?MC(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return rt.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=rt.empty;s=s.nextLayer)t=new rt(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}rt.empty=new rt([],[],null,-1);function MC(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(ku(e,r)>0)return n.slice().sort(ku);e=r}return n}rt.empty.nextLayer=rt.empty;class Hr{finishChunk(e){this.chunks.push(new Ih(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Hr)).add(e,t,r)}addInner(e,t,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(rt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=rt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function mf(n,e,t){let r=new Map;for(let i of n)for(let o=0;o<i.chunk.length;o++)i.chunk[o].maxPoint<=0&&r.set(i.chunk[o],i.chunkPos[o]);let s=new Set;for(let i of e)for(let o=0;o<i.chunk.length;o++){let a=r.get(i.chunk[o]);a!=null&&(t?t.mapPos(a):a)==i.chunkPos[o]&&!t?.touchesRange(a,a+i.chunk[o].length)&&s.add(i.chunk[o])}return s}class Ug{constructor(e,t,r,s=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class mo{constructor(e){this.heap=e}static from(e,t=null,r=-1){let s=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&s.push(new Ug(o,t,r,i));return s.length==1?s[0]:new mo(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)pc(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)pc(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),pc(this.heap,0)}}}function pc(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let s=n[r];if(r+1<n.length&&s.compare(n[r+1])>=0&&(s=n[r+1],r++),t.compare(s)<0)break;n[r]=t,n[e]=s,e=r}}class qi{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=mo.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ca(this.active,e),ca(this.activeTo,e),ca(this.activeRank,e),this.minActive=Of(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:s,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||s-this.activeTo[t])>0;)t++;ua(this.active,t,r),ua(this.activeTo,t,s),ua(this.activeRank,t,i),e&&ua(e,t,this.cursor.from),this.minActive=Of(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&ca(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function gf(n,e,t,r,s,i){n.goto(e),t.goto(r);let o=r+s,a=r,l=r-e,c=!!i.boundChange;for(let u=!1;;){let h=n.to+l-t.to,f=h||n.endSide-t.endSide,m=f<0?n.to+l:t.to,g=Math.min(m,o);if(n.point||t.point?(n.point&&t.point&&Zh(n.point,t.point)&&wu(n.activeForPoint(n.to),t.activeForPoint(t.to))||i.comparePoint(a,g,n.point,t.point),u=!1):(u&&i.boundChange(a),g>a&&!wu(n.active,t.active)&&i.compareRange(a,g,n.active,t.active),c&&g<o&&(h||n.openEnd(m)!=t.openEnd(m))&&(u=!0)),m>o)break;a=m,f<=0&&n.next(),f>=0&&t.next()}}function wu(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Zh(n[t],e[t]))return!1;return!0}function ca(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function ua(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function Of(n,e){let t=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||n[s].endSide-n[t].endSide)<0&&(t=s,r=e[s]);return t}function ur(n,e,t=n.length){let r=0;for(let s=0;s<t&&s<n.length;)n.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=qt(n,s));return r}function Su(n,e,t,r){for(let s=0,i=0;;){if(i>=e)return s;if(s==n.length)break;i+=n.charCodeAt(s)==9?t-i%t:1,s=qt(n,s)}return r===!0?-1:n.length}const $u="ͼ",vf=typeof Symbol>"u"?"__"+$u:Symbol.for($u),Cu=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vs{constructor(e,t){this.rules=[];let{finish:r}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function i(o,a,l,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let m in a){let g=a[m];if(/&/.test(m))i(m.split(/,\s*/).map(O=>o.map(y=>O.replace(/&/,y))).reduce((O,y)=>O.concat(y)),g,l);else if(g&&typeof g=="object"){if(!h)throw new RangeError("The value of a property ("+m+") should be a primitive value.");i(s(m),g,u,f)}else g!=null&&u.push(m.replace(/_.*/,"").replace(/[A-Z]/g,O=>"-"+O.toLowerCase())+": "+g+";")}(u.length||f)&&l.push((r&&!h&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)i(s(o),e[o],this.rules)}getRules(){return this.rules.join(`
72
+ `)}static newName(){let e=bf[vf]||1;return bf[vf]=e+1,$u+e.toString(36)}static mount(e,t,r){let s=e[Cu],i=r&&r.nonce;s?i&&s.setNonce(i):s=new AC(e,i),s.mount(Array.isArray(t)?t:[t],e)}}let xf=new Map;class AC{constructor(e,t){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=xf.get(r);if(i)return e[Cu]=i;this.sheet=new s.CSSStyleSheet,xf.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Cu]=this}mount(e,t){let r=this.sheet,s=0,i=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<i&&l>-1&&(this.modules.splice(l,1),i--,l=-1),l==-1){if(this.modules.splice(i++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],s++)}else{for(;i<l;)s+=this.modules[i++].rules.length;s+=a.rules.length,i++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
73
+ `;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var bs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},go={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_C=typeof navigator<"u"&&/Mac/.test(navigator.platform),RC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Kt=0;Kt<10;Kt++)bs[48+Kt]=bs[96+Kt]=String(Kt);for(var Kt=1;Kt<=24;Kt++)bs[Kt+111]="F"+Kt;for(var Kt=65;Kt<=90;Kt++)bs[Kt]=String.fromCharCode(Kt+32),go[Kt]=String.fromCharCode(Kt);for(var mc in bs)go.hasOwnProperty(mc)||(go[mc]=bs[mc]);function EC(n){var e=_C&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||RC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?go:bs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function mt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];typeof s=="string"?n.setAttribute(r,s):s!=null&&(n[r]=s)}e++}for(;e<arguments.length;e++)Gg(n,arguments[e]);return n}function Gg(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Gg(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let pn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Qu=typeof document<"u"?document:{documentElement:{style:{}}};const Pu=/Edge\/(\d+)/.exec(pn.userAgent),Hg=/MSIE \d/.test(pn.userAgent),Tu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pn.userAgent),jl=!!(Hg||Tu||Pu),yf=!jl&&/gecko\/(\d+)/i.test(pn.userAgent),gc=!jl&&/Chrome\/(\d+)/.exec(pn.userAgent),BC="webkitFontSmoothing"in Qu.documentElement.style,Mu=!jl&&/Apple Computer/.test(pn.vendor),kf=Mu&&(/Mobile\/\w+/.test(pn.userAgent)||pn.maxTouchPoints>2);var _e={mac:kf||/Mac/.test(pn.platform),windows:/Win/.test(pn.platform),linux:/Linux|X11/.test(pn.platform),ie:jl,ie_version:Hg?Qu.documentMode||6:Tu?+Tu[1]:Pu?+Pu[1]:0,gecko:yf,gecko_version:yf?+(/Firefox\/(\d+)/.exec(pn.userAgent)||[0,0])[1]:0,chrome:!!gc,chrome_version:gc?+gc[1]:0,ios:kf,android:/Android\b/.test(pn.userAgent),webkit_version:BC?+(/\bAppleWebKit\/(\d+)/.exec(pn.userAgent)||[0,0])[1]:0,safari:Mu,safari_version:Mu?+(/\bVersion\/(\d+(\.\d+)?)/.exec(pn.userAgent)||[0,0])[1]:0,tabSize:Qu.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Xh(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const sl=Object.create(null);function zh(n,e,t){if(n==e)return!0;n||(n=sl),e||(e=sl);let r=Object.keys(n),s=Object.keys(e);if(r.length-0!=s.length-0)return!1;for(let i of r)if(i!=t&&(s.indexOf(i)==-1||n[i]!==e[i]))return!1;return!0}function LC(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function wf(n,e,t){let r=!1;if(e)for(let s in e)t&&s in t||(r=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(r=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return r}function DC(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class Lr{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var en=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(en||(en={}));class Ve extends Os{constructor(e,t,r,s){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new zo(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Ys(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:o}=Kg(e,t);r=(i?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Ys(e,r,s,t,e.widget||null,!0)}static line(e){return new No(e)}static set(e,t=!1){return rt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ve.none=rt.empty;class zo extends Ve{constructor(e){let{start:t,end:r}=Kg(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Xh(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||sl}eq(e){return this==e||e instanceof zo&&this.tagName==e.tagName&&zh(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}zo.prototype.point=!1;class No extends Ve{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof No&&this.spec.class==e.spec.class&&zh(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}No.prototype.mapMode=Jt.TrackBefore;No.prototype.point=!0;class Ys extends Ve{constructor(e,t,r,s,i,o){super(t,r,i,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?Jt.TrackBefore:Jt.TrackAfter:Jt.TrackDel}get type(){return this.startSide!=this.endSide?en.WidgetRange:this.startSide<=0?en.WidgetBefore:en.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ys&&ZC(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Ys.prototype.point=!0;function Kg(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function ZC(n,e){return n==e||!!(n&&e&&n.compare(e))}function li(n,e,t,r=0){let s=t.length-1;s>=0&&t[s]+r>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class Oo extends Os{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof Oo&&this.tagName==e.tagName&&zh(this.attributes,e.attributes)}static create(e){return new Oo(e.tagName,e.attributes||sl)}static set(e,t=!1){return rt.of(e,t)}}Oo.prototype.startSide=Oo.prototype.endSide=-1;function vo(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Au(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ao(n,e){if(!e.anchorNode)return!1;try{return Au(n,e.anchorNode)}catch{return!1}}function Xa(n){return n.nodeType==3?bo(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function lo(n,e,t,r){return t?Sf(n,e,t,r,-1)||Sf(n,e,t,r,1):!1}function xs(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function il(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function Sf(n,e,t,r,s){for(;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Kr(n))){if(n.nodeName=="DIV")return!1;let i=n.parentNode;if(!i||i.nodeType!=1)return!1;e=xs(n)+(s<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?Kr(n):0}else return!1}}function Kr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ol(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function IC(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Jg(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function XC(n,e,t,r,s,i,o,a){let l=n.ownerDocument,c=l.defaultView||window;for(let u=n,h=!1;u&&!h;)if(u.nodeType==1){let f,m=u==l.body,g=1,O=1;if(m)f=IC(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let S=u.getBoundingClientRect();({scaleX:g,scaleY:O}=Jg(u,S)),f={left:S.left,right:S.left+u.clientWidth*g,top:S.top,bottom:S.top+u.clientHeight*O}}let y=0,x=0;if(s=="nearest")e.top<f.top?(x=e.top-(f.top+o),t>0&&e.bottom>f.bottom+x&&(x=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(x=e.bottom-f.bottom+o,t<0&&e.top-x<f.top&&(x=e.top-(f.top+o)));else{let S=e.bottom-e.top,Q=f.bottom-f.top;x=(s=="center"&&S<=Q?e.top+S/2-Q/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-Q+o)-f.top}if(r=="nearest"?e.left<f.left?(y=e.left-(f.left+i),t>0&&e.right>f.right+y&&(y=e.right-f.right+i)):e.right>f.right&&(y=e.right-f.right+i,t<0&&e.left<f.left+y&&(y=e.left-(f.left+i))):y=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==a?e.left-i:e.right-(f.right-f.left)+i)-f.left,y||x)if(m)c.scrollBy(y,x);else{let S=0,Q=0;if(x){let T=u.scrollTop;u.scrollTop+=x/O,Q=(u.scrollTop-T)*O}if(y){let T=u.scrollLeft;u.scrollLeft+=y/g,S=(u.scrollLeft-T)*g}e={left:e.left-S,top:e.top-Q,right:e.right-S,bottom:e.bottom-Q},S&&Math.abs(S-y)<1&&(r="nearest"),Q&&Math.abs(Q-x)<1&&(s="nearest")}if(m)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function zC(n){let e=n.ownerDocument,t,r;for(let s=n.parentNode;s&&!(s==e.body||t&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:r}}class NC{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Kr(t):0),r,Math.min(e.focusOffset,r?Kr(r):0))}set(e,t,r,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=s}}let Rs=null;_e.safari&&_e.safari_version>=26&&(Rs=!1);function eO(n){if(n.setActive)return n.setActive();if(Rs)return n.focus(Rs);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Rs==null?{get preventScroll(){return Rs={preventScroll:!0},!0}}:void 0),!Rs){Rs=!1;for(let t=0;t<e.length;){let r=e[t++],s=e[t++],i=e[t++];r.scrollTop!=s&&(r.scrollTop=s),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let $f;function bo(n,e,t=e){let r=$f||($f=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function ci(n,e,t,r){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let i=new KeyboardEvent("keydown",s);i.synthetic=!0,n.dispatchEvent(i);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function VC(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function WC(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Kr(t));;)if(r){if(t.nodeType!=1)return!1;let s=t.childNodes[r-1];s.contentEditable=="false"?r--:(t=s,r=Kr(t))}else{if(t==n)return!0;r=xs(t),t=t.parentNode}}function tO(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function nO(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Kr(t)}else if(t.parentNode&&!il(t))r=xs(t),t=t.parentNode;else return null}}function rO(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!il(t))r=xs(t)+1,t=t.parentNode;else return null}}class lr{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new lr(e.parentNode,xs(e),t)}static after(e,t){return new lr(e.parentNode,xs(e)+1,t)}}var xt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(xt||(xt={}));const Fs=xt.LTR,Nh=xt.RTL;function sO(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const jC=sO("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),qC=sO("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),_u=Object.create(null),xr=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);_u[e]=t,_u[t]=-e}function iO(n){return n<=247?jC[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?qC[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const YC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Tr{get dir(){return this.level%2?Nh:Fs}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,s){let i=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(i<0||(s!=0?s<0?a.from<t:a.to>t:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}function oO(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],s=e[t];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!oO(r.inner,s.inner))return!1}return!0}const vt=[];function FC(n,e,t,r,s){for(let i=0;i<=r.length;i++){let o=i?r[i-1].to:e,a=i<r.length?r[i].from:t,l=i?256:s;for(let c=o,u=l,h=l;c<a;c++){let f=iO(n.charCodeAt(c));f==512?f=u:f==8&&h==4&&(f=16),vt[c]=f==4?2:f,f&7&&(h=f),u=f}for(let c=o,u=l,h=l;c<a;c++){let f=vt[c];if(f==128)c<a-1&&u==vt[c+1]&&u&24?f=vt[c]=u:vt[c]=256;else if(f==64){let m=c+1;for(;m<a&&vt[m]==64;)m++;let g=c&&u==8||m<t&&vt[m]==8?h==1?1:8:256;for(let O=c;O<m;O++)vt[O]=g;c=m-1}else f==8&&h==1&&(vt[c]=1);u=f,f&7&&(h=f)}}}function UC(n,e,t,r,s){let i=s==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:t;for(let h=c,f,m,g;h<u;h++)if(m=_u[f=n.charCodeAt(h)])if(m<0){for(let O=a-3;O>=0;O-=3)if(xr[O+1]==-m){let y=xr[O+2],x=y&2?s:y&4?y&1?i:s:0;x&&(vt[h]=vt[xr[O]]=x),a=O;break}}else{if(xr.length==189)break;xr[a++]=h,xr[a++]=f,xr[a++]=l}else if((g=vt[h])==2||g==1){let O=g==s;l=O?0:1;for(let y=a-3;y>=0;y-=3){let x=xr[y+2];if(x&2)break;if(O)xr[y+2]|=2;else{if(x&4)break;xr[y+2]|=4}}}}}function GC(n,e,t,r){for(let s=0,i=r;s<=t.length;s++){let o=s?t[s-1].to:n,a=s<t.length?t[s].from:e;for(let l=o;l<a;){let c=vt[l];if(c==256){let u=l+1;for(;;)if(u==a){if(s==t.length)break;u=t[s++].to,a=s<t.length?t[s].from:e}else if(vt[u]==256)u++;else break;let h=i==1,f=(u<e?vt[u]:r)==1,m=h==f?h?1:2:r;for(let g=u,O=s,y=O?t[O-1].to:n;g>l;)g==y&&(g=t[--O].from,y=O?t[O-1].to:n),vt[--g]=m;l=u}else i=c,l++}}}function Ru(n,e,t,r,s,i,o){let a=r%2?2:1;if(r%2==s%2)for(let l=e,c=0;l<t;){let u=!0,h=!1;if(c==i.length||l<i[c].from){let O=vt[l];O!=a&&(u=!1,h=O==16)}let f=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c<i.length&&g==i[c].from){if(h)break e;let O=i[c];if(!u)for(let y=O.to,x=c+1;;){if(y==t)break e;if(x<i.length&&i[x].from==y)y=i[x++].to;else{if(vt[y]==a)break e;break}}if(c++,f)f.push(O);else{O.from>l&&o.push(new Tr(l,O.from,m));let y=O.direction==Fs!=!(m%2);Eu(n,y?r+1:r,s,O.inner,O.from,O.to,o),l=O.to}g=O.to}else{if(g==t||(u?vt[g]!=a:vt[g]==a))break;g++}f?Ru(n,l,g,r+1,s,f,o):l<g&&o.push(new Tr(l,g,m)),l=g}else for(let l=t,c=i.length;l>e;){let u=!0,h=!1;if(!c||l>i[c-1].to){let O=vt[l-1];O!=a&&(u=!1,h=O==16)}let f=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c&&g==i[c-1].to){if(h)break e;let O=i[--c];if(!u)for(let y=O.from,x=c;;){if(y==e)break e;if(x&&i[x-1].to==y)y=i[--x].from;else{if(vt[y-1]==a)break e;break}}if(f)f.push(O);else{O.to<l&&o.push(new Tr(O.to,l,m));let y=O.direction==Fs!=!(m%2);Eu(n,y?r+1:r,s,O.inner,O.from,O.to,o),l=O.from}g=O.from}else{if(g==e||(u?vt[g-1]!=a:vt[g-1]==a))break;g--}f?Ru(n,g,l,r+1,s,f,o):g<l&&o.push(new Tr(g,l,m)),l=g}}function Eu(n,e,t,r,s,i,o){let a=e%2?2:1;FC(n,s,i,r,a),UC(n,s,i,r,a),GC(s,i,r,a),Ru(n,s,i,e,t,r,o)}function HC(n,e,t){if(!n)return[new Tr(0,0,e==Nh?1:0)];if(e==Fs&&!t.length&&!YC.test(n))return aO(n.length);if(t.length)for(;n.length>vt.length;)vt[vt.length]=256;let r=[],s=e==Fs?0:1;return Eu(n,s,s,t,0,n.length,r),r}function aO(n){return[new Tr(0,n,0)]}let lO="";function KC(n,e,t,r,s){var i;let o=r.head-n.from,a=Tr.find(e,o,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),l=e[a],c=l.side(s,t);if(o==c){let f=a+=s?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],o=l.side(!s,t),c=l.side(s,t)}let u=qt(n.text,o,l.forward(s,t));(u<l.from||u>l.to)&&(u=c),lO=n.text.slice(Math.min(o,u),Math.max(o,u));let h=a==(s?e.length-1:0)?null:e[a+(s?1:-1)];return h&&u==c&&h.level+(s?0:1)<l.level?ae.cursor(h.side(!s,t)+n.from,h.forward(s,t)?1:-1,h.level):ae.cursor(u+n.from,l.forward(s,t)?-1:1,l.level)}function JC(n,e,t){for(let r=e;r<t;r++){let s=iO(n.charCodeAt(r));if(s==1)return Fs;if(s==2||s==4)return Nh}return Fs}const cO=Me.define(),uO=Me.define(),hO=Me.define(),dO=Me.define(),Bu=Me.define(),fO=Me.define(),pO=Me.define(),Vh=Me.define(),Wh=Me.define(),mO=Me.define({combine:n=>n.some(e=>e)}),gO=Me.define({combine:n=>n.some(e=>e)}),OO=Me.define();class ui{constructor(e,t="nearest",r="nearest",s=5,i=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new ui(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ui(ae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ha=Ke.define({map:(n,e)=>n.map(e)}),vO=Ke.define();function $n(n,e,t){let r=n.facet(dO);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Wr=Me.define({combine:n=>n.length?n[0]:!0});let e5=0;const si=Me.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class _t{constructor(e,t,r,s,i){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(si.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(si.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:s,provide:i,decorations:o}=t||{};return new _t(e5++,e,r,s,a=>{let l=[];return o&&l.push(ql.of(c=>{let u=c.plugin(a);return u?o(u):Ve.none})),i&&l.push(i(a)),l})}static fromClass(e,t){return _t.define((r,s)=>new e(r,s),t)}}class Oc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if($n(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){$n(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){$n(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const bO=Me.define(),jh=Me.define(),ql=Me.define(),xO=Me.define(),qh=Me.define(),Vo=Me.define(),yO=Me.define();function Cf(n,e){let t=n.state.facet(yO);if(!t.length)return t;let r=t.map(i=>i instanceof Function?i(n):i),s=[];return rt.spans(r,e.from,e.to,{point(){},span(i,o,a,l){let c=i-e.from,u=o-e.from,h=s;for(let f=a.length-1;f>=0;f--,l--){let m=a[f].spec.bidiIsolate,g;if(m==null&&(m=JC(e.text,c,u)),l>0&&h.length&&(g=h[h.length-1]).to==c&&g.direction==m)g.to=u,h=g.inner;else{let O={from:c,to:u,direction:m,inner:[]};h.push(O),h=O.inner}}}}),s}const kO=Me.define();function Yh(n){let e=0,t=0,r=0,s=0;for(let i of n.state.facet(kO)){let o=i(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:r,bottom:s}}const Ji=Me.define();class jn{constructor(e,t,r,s){this.fromA=e,this.toA=t,this.fromB=r,this.toB=s}join(e){return new jn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let s=0,i=0,o=0;;){let a=s<e.length?e[s].fromB:1e9,l=i<t.length?t[i]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+o,h=c,f=u;for(;;)if(i<t.length&&t[i]<=h){let m=t[i+1];i+=2,h=Math.max(h,m);for(let g=s;g<e.length&&e[g].fromB<=h;g++)o=e[g].toA-e[g].toB;f=Math.max(f,m+o)}else if(s<e.length&&e[s].fromB<=h){let m=e[s++];h=Math.max(h,m.toB),f=Math.max(f,m.toA),o=m.toA-m.toB}else break;r.push(new jn(u,f,c,h))}return r}}class al{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Xt.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,o,a,l)=>s.push(new jn(i,o,a,l))),this.changedRanges=s}static create(e,t,r){return new al(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const t5=[];class Bt{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return t5}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&LC(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let s of this.children){if(s==e)return r;r+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let r=xs(this.dom),s=this.length?e>0:t>0;return new lr(this.parent.dom,r+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Fl)return e;return null}static get(e){return e.cmTile}}class Yl extends Bt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,s,i=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,s=r?r.nextSibling:t.firstChild,i&&s!=a.dom&&(i.written=!0),a.dom.parentNode==t)for(;s&&s!=a.dom;)s=Qf(s);else t.insertBefore(a.dom,s);r=a.dom}for(s=r?r.nextSibling:t.firstChild,i&&s&&(i.written=!0);s;)s=Qf(s);this.length=o}}function Qf(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Fl extends Yl{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Bt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,s=0,i=0;;)if(s==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&i++,s=t.pop()}else{let o=r.children[s++];if(o instanceof Yr)t.push(s),r=o,s=0;else{let a=i+o.length,l=e(o,i);if(l!==void 0)return l;i=a+o.breakAfter}}}resolveBlock(e,t){let r,s=-1,i,o=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<e||e==c&&(t<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,s=e-l),(c>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,o=e-l)}}),!r&&!i)throw new Error("No tile at position "+e);return r&&t<0||!i?{tile:r,offset:s}:{tile:i,offset:o}}}class Yr extends Yl{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new Yr(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class xi extends Yl{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let s=new xi(t||document.createElement("div"),e);return(!t||!r)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,t,r){let s=null,i=-1,o=null,a=-1;function l(u,h){for(let f=0,m=0;f<u.children.length&&m<=h;f++){let g=u.children[f],O=m+g.length;O>=h&&(g.isComposite()?l(g,h-m):(!o||o.isHidden&&(t>0||r&&r5(o,g)))&&(O>h||g.flags&32)?(o=g,a=h-m):(m<h||g.flags&16&&!g.isHidden)&&(s=g,i=h-m)),m=O}}l(this,e);let c=(t<0?s:o)||s||o;return c?{tile:c,offset:c==s?i:a}:null}coordsIn(e,t){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t):n5(this)}domIn(e,t){let r=this.resolveInline(e,t);if(r){let{tile:s,offset:i}=r;if(this.dom.contains(s.dom))return s.isText()?new lr(s.dom,Math.min(s.dom.nodeValue.length,i)):s.domPosFor(i,s.flags&16?1:s.flags&32?-1:t);let o=r.tile.parent,a=!1;for(let l of o.children){if(a)return new lr(l.dom,0);l==r.tile&&(a=!0)}}return new lr(this.dom,0)}}function n5(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Xa(e);return t[t.length-1]||null}function r5(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class Sn extends Yl{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new Sn(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Zs extends Bt{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,i=e,o=0;e==0&&t<0||e==r&&t>=0?_e.chrome||_e.gecko||(e?(s--,o=1):i<r&&(i++,o=-1)):t<0?s--:i<r&&i++;let a=bo(this.dom,s,i).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return _e.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?ol(l,o<0):l||null}static of(e,t){let r=new Zs(t||document.createTextNode(e),e);return t||(r.flags|=2),r}}class Us extends Bt{constructor(e,t,r,s){super(e,t,s),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let s=this.widget.coordsAt(this.dom,e,t);if(s)return s;if(r)return ol(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?i.length-1:0;o=i[l],!(e>0?l==0:l==i.length-1||o.top<o.bottom);l+=a?-1:1);return ol(o,!a)}}get overrideDOMText(){if(!this.length)return ct.empty;let{root:e}=this;if(!e)return ct.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,r,s,i){return i||(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new Us(i,r,e,s)}}class ll extends Bt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return ct.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class s5{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:s,index:i,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(s.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(i==s.children.length){if(!e&&!a.length)break;r&&r.leave(s),o=!!s.breakAfter,{tile:s,index:i}=a.pop(),i++}else{let l=s.children[i],c=l.breakAfter;(t>0?l.length<=e:l.length<e)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!c,i++,e-=l.length):(a.push({tile:s,index:i}),s=l,i=0,r&&l.isComposite()&&r.enter(l))}else if(i==s.length)o=!!s.breakAfter,{tile:s,index:i}=a.pop(),i++;else if(e){let l=Math.min(e,s.length-i);r&&r.skip(s,i,i+l),e-=l,i+=l}else break;return this.tile=s,this.index=i,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class i5{constructor(e,t,r,s){this.from=e,this.to=t,this.wrapper=r,this.rank=s}}class o5{constructor(e,t,r){this.cache=e,this.root=t,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,r,s){var i;this.flushBuffer();let o=this.ensureMarks(t,r),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new Zs(a.dom,a.text+e);l.parent=o}else o.append(s||Zs.of(e,(i=this.cache.find(Zs))===null||i===void 0?void 0:i.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let r=this.curLine;r.dom!=t.line.dom&&(r.setDOM(this.cache.reused.has(t.line)?vc(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let s=r;for(let a=t.marks.length-1;a>=0;a--){let l=t.marks[a],c=s.lastChild;if(c instanceof Sn&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(vc(l.dom)),s=c;else{if(this.cache.reused.get(l)){let h=Bt.get(l.dom);h&&h.setDOM(vc(l.dom))}let u=Sn.of(l.mark,l.dom);s.append(u),s=u}this.cache.reused.set(l,2)}let i=Bt.get(e.text);i&&this.cache.reused.set(i,2);let o=new Zs(e.text,e.text.nodeValue);o.flags|=8,s.append(o)}addInlineWidget(e,t,r){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let i=this.ensureMarks(t,r);!s&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=wO);let s=xi.start(e,t||((r=this.cache.find(xi))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let s=this.curLine;for(let i=e.length-1;i>=0;i--){let o=e[i],a;if(t>0&&(a=s.lastChild)&&a instanceof Sn&&a.mark.eq(o))s=a,t--;else{let l=Sn.of(o,(r=this.cache.find(Sn,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);s.append(l),s=l,t=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Pf(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_e.ios&&Pf(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(bc,0,32)||new Us(bc.toDOM(),0,bc,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new i5(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-t.rank||this.wrappers[r-1].to-t.to)<0;)r--;this.wrappers.splice(r,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let s=t.lastChild;if(r.from<this.pos&&s instanceof Yr&&s.wrapper.eq(r.wrapper))t=s;else{let i=Yr.of(r.wrapper,(e=this.cache.find(Yr,o=>o.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(ll,void 0,1);return r&&(r.flags=t),r||new ll(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class a5{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:i,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=s;let a=this.textOff=Math.min(e,s.length);return i?null:s.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}}const cl=[Us,xi,Zs,Sn,ll,Yr,Fl];for(let n=0;n<cl.length;n++)cl[n].bucket=n;class l5{constructor(e){this.view=e,this.buckets=cl.map(()=>[]),this.index=cl.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let s=e.bucket,i=this.buckets[s],o=this.index[s];for(let a=i.length-1;a>=0;a--){let l=(a+o)%i.length,c=i[l];if((!t||t(c))&&!this.reused.has(c))return i.splice(l,1),l<o&&this.index[s]--,this.reused.set(c,r),c}return null}findWidget(e,t,r){let s=this.buckets[0];if(s.length)for(let i=0,o=0;;i++){if(i==s.length){if(o)return null;o=1,i=0}let a=s[i];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return s.splice(i,1),i<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new Us(a.dom,t,e,a.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class c5{constructor(e,t,r,s,i){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new l5(e),this.text=new a5(e.state.doc),this.builder=new o5(this.cache,new Fl(e,e.contentDOM),rt.iter(r)),this.cache.reused.set(t,2),this.old=new s5(t),this.reuseWalker={skip:(o,a,l)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let s=0,i=0,o=0;;){let a=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>s){let c=l-s;this.preserve(c,!o,!a),s=l,i+=c}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,r),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(i,a.toB)),i=a.toB,s=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,r){let s=d5(this.old),i=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<o.length?Us.of(o.widget,this.view,l-a,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,s,i),i=s.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length?this.builder.addText(o.text,s,i,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),s,i)),i=s.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof ll)this.cache.add(o);else if(o instanceof Sn)this.builder.ensureLine(null),this.builder.addMark(o,s,i),this.cache.reused.set(o,1),i=s.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Sn&&s.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?s.length&&(s.length=i=0):o instanceof Sn&&(s.shift(),i=Math.min(i,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,s=this.builder,i=0,o=rt.spans(this.decorations,e,t,{point:(a,l,c,u,h,f)=>{if(c instanceof Ys){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=u.length,h>u.length)s.continueWidget(l-a);else{let m=c.widget||(c.block?yi.block:yi.inline),g=u5(c),O=this.cache.findWidget(m,l-a,g)||Us.of(m,this.view,l-a,g);c.block?(c.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(O)):(s.ensureLine(r),s.addInlineWidget(O,u,h))}r=null}else r=h5(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let h=a;h<l;){let f=this.text.next(Math.min(512,l-h));f==null?(s.addLineStartIfNotCovered(r),s.addBreak(),h++):(s.ensureLine(r),s.addText(f,c,h==a?u:c.length),h+=f.length),r=null}}});s.addLineStartIfNotCovered(r),this.openWidget=o>i,this.openMarks=o}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let s=e.parentNode;;s=s.parentNode){let i=Bt.get(s);if(s==this.view.contentDOM)break;i instanceof Sn?t.push(i):i?.isLine()?r=i:i instanceof Yr||(s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new xi(s,wO):r||t.push(Sn.of(new zo({tagName:s.nodeName.toLowerCase(),attributes:DC(s)}),s)))}return{line:r,marks:t}}}function Pf(n,e){let t=r=>{for(let s of r.children)if((e?s.isText():s.length)||t(s))return!0;return!1};return t(n)}function u5(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const wO={class:"cm-line"};function h5(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&Xh(t,n),r&&(n.class+=" "+r)),n}function d5(n){let e=[];for(let t=n.parents.length;t>1;t--){let r=t==n.parents.length?n.tile:n.parents[t].tile;r instanceof Sn&&e.push(r.mark)}return e}function vc(n){let e=Bt.get(n);return e&&e.setDOM(n.cloneNode()),n}class yi extends Lr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}yi.inline=new yi("span");yi.block=new yi("div");const bc=new class extends Lr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Tf{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ve.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Fl(e,e.contentDOM),this.updateInner([new jn(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:h})=>h<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!y5(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?p5(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:h}=this.hasComposition;r=new jn(u,h,e.changes.mapPos(u,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(_e.ie||_e.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=O5(o,this.decorations,e.changes);l.length&&(r=jn.extendWithRanges(r,l));let c=b5(a,this.blockWrappers,e.changes);return c.length&&(r=jn.extendWithRanges(r,c)),i&&!r.some(u=>u.fromA<=i.range.fromA&&u.toA>=i.range.toA)&&(r=i.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let o=this.tile,a=new c5(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,t),Lu(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=_e.chrome||_e.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||r.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let i of this.tile.children)i.isWidget()&&i.widget instanceof xc&&s.push(i.dom);r.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(vO)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,s=this.view.root.activeElement,i=s==r,o=!i&&!(this.view.state.facet(Wr)||r.tabIndex>-1)&&ao(r,this.view.observer.selectionRange)&&!(s&&r.contains(s));if(!(i||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),_e.gecko&&l.empty&&!this.hasComposition&&f5(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new lr(f,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!lo(c.node,c.offset,h.anchorNode,h.anchorOffset)||!lo(u.node,u.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{_e.android&&_e.chrome&&r.contains(h.focusNode)&&x5(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let f=vo(this.view.root);if(f)if(l.empty){if(_e.gecko){let m=m5(c.node,c.offset);if(m&&m!=3){let g=(m==1?nO:rO)(c.node,c.offset);g&&(c=new lr(g.node,g.offset))}}f.collapse(c.node,c.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let m=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),m.setEnd(u.node,u.offset),m.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(m)}o&&this.view.root.activeElement==r&&(r.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new lr(h.anchorNode,h.anchorOffset),this.impreciseHead=u.precise?null:new lr(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&lo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=vo(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(u.node,u.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(s,i)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=r.posAtStart;if(r.isComposite()){let i;if(e==r.dom)i=r.dom.childNodes[t];else{let o=Kr(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?i=e:i=e.nextSibling}if(i==r.dom.firstChild)return s;for(;i&&!Bt.get(i);)i=i.nextSibling;if(!i)return s+r.length;for(let o=0,a=s;;o++){let l=r.children[o];if(l.dom==i)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?s+t:s+(t?r.length:0):s}domAtPos(e,t){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(e,t):r.domIn(s,t)}inlineDOMNearPos(e,t){let r,s=-1,i=!1,o,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(i=!0)}else{let h=u+c.length;if(u<=e&&(r=c,s=e-u,i=h<e),h>=e&&!o&&(o=c,a=e-u,l=u>e),u>e&&o)return!0}}),!r&&!o?this.domAtPos(e,t):(i&&o?r=null:l&&r&&(o=null),r&&t<0||!o?r.domIn(s,t):o.domIn(a,t))}coordsAt(e,t){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof xc?null:r.coordsInWidget(s,t,!0):r.coordsIn(s,t)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function s(i,o){if(i.isComposite())for(let a of i.children){if(a.length>=o){let l=s(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(i.isText()&&o<i.length){let a=qt(i.text,o);if(a==o)return null;let l=bo(i.dom,o,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return s(t,r)}measureVisibleLineHeights(e){let t=[],{from:r,to:s}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==xt.LTR,c=0,u=(h,f,m)=>{for(let g=0;g<h.children.length&&!(f>s);g++){let O=h.children[g],y=f+O.length,x=O.dom.getBoundingClientRect(),{height:S}=x;if(m&&!g&&(c+=x.top-m.top),O instanceof Yr)y>r&&u(O,f,x);else if(f>=r&&(c>0&&t.push(-c),t.push(S+c),c=0,o)){let Q=O.dom.lastChild,T=Q?Xa(Q):[];if(T.length){let D=T[T.length-1],K=l?D.right-x.left:x.right-D.left;K>a&&(a=K,this.minWidth=i,this.minWidthFrom=f,this.minWidthTo=y)}}m&&g==h.children.length-1&&(c+=m.bottom-x.bottom),f=y+O.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?xt.RTL:xt.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Xa(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let t=document.createElement("div"),r,s,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=Xa(t.firstChild)[0];r=t.getBoundingClientRect().height,s=o&&o.width?o.width/27:7,i=o&&o.height?o.height:r,t.remove()}),{lineHeight:r,charWidth:s,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,s=0;;s++){let i=s==t.viewports.length?null:t.viewports[s],o=i?i.from-1:this.view.state.doc.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ve.replace({widget:new xc(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!i)break;r=i.to+1}return Ve.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ql).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(qh).map((i,o)=>{let a=typeof i=="function";return a&&(r=!0),a?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,t.push(rt.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(xO).map(i=>typeof i=="function"?i(this.view):i)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(OO))try{if(c(this.view,e.range,e))return!0}catch(u){$n(this.view.state,u,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),s;if(!r)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=Yh(this.view),o={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(XC(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==xt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(t.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Lu(this.tile)}}function Lu(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)Lu(r,e)}}function f5(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function SO(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=nO(t.focusNode,t.focusOffset),s=rO(t.focusNode,t.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let a=Bt.get(s.node);if(!a||a.isText()&&a.text!=s.node.nodeValue)i=s;else if(n.docView.lastCompositionAfterCursor){let l=Bt.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(i=s)}}if(n.docView.lastCompositionAfterCursor=i!=r,!i)return null;let o=e-i.offset;return{from:o,to:o+i.node.nodeValue.length,node:i.node}}function p5(n,e,t){let r=SO(n,t);if(!r)return null;let{node:s,from:i,to:o}=r,a=s.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new jn(l.mapPos(i),l.mapPos(o),i,o),text:s}}function m5(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let g5=class{constructor(){this.changes=[]}compareRange(e,t){li(e,t,this.changes)}comparePoint(e,t){li(e,t,this.changes)}boundChange(e){li(e,e,this.changes)}};function O5(n,e,t){let r=new g5;return rt.compare(n,e,t,r),r.changes}class v5{constructor(){this.changes=[]}compareRange(e,t){li(e,t,this.changes)}comparePoint(){}boundChange(e){li(e,e,this.changes)}}function b5(n,e,t){let r=new v5;return rt.compare(n,e,t,r),r.changes}function x5(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function y5(n,e){let t=!1;return e&&n.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(t=!0)}),t}class xc extends Lr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function k5(n,e,t=1){let r=n.charCategorizer(e),s=n.doc.lineAt(e),i=e-s.from;if(s.length==0)return ae.cursor(e);i==0?t=1:i==s.length&&(t=-1);let o=i,a=i;t<0?o=qt(s.text,i,!1):a=qt(s.text,i);let l=r(s.text.slice(o,a));for(;o>0;){let c=qt(s.text,o,!1);if(r(s.text.slice(c,o))!=l)break;o=c}for(;a<s.length;){let c=qt(s.text,a);if(r(s.text.slice(a,c))!=l)break;a=c}return ae.range(o+s.from,a+s.from)}function w5(n,e,t,r,s){let i=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,l=Math.floor((s-t.top-(n.defaultLineHeight-a)*.5)/a);i+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Su(o,i,n.state.tabSize)}function Du(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!s||i.type==en.Text&&(s.type!=i.type||(t<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function S5(n,e,t,r){let s=Du(n,e.head,e.assoc||-1),i=!r||s.type!=en.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(s.from),l=n.posAtCoords({x:t==(a==xt.LTR)?o.right-1:o.left+1,y:(i.top+i.bottom)/2});if(l!=null)return ae.cursor(l,t?-1:1)}return ae.cursor(t?s.to:s.from,t?-1:1)}function Mf(n,e,t,r){let s=n.state.doc.lineAt(e.head),i=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let a=e,l=null;;){let c=KC(s,i,o,a,t),u=lO;if(!c){if(s.number==(t?n.state.doc.lines:1))return a;u=`
74
+ `,s=n.state.doc.line(s.number+(t?1:-1)),i=n.bidiSpans(s),c=n.visualLineSide(s,!t)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function $5(n,e,t){let r=n.state.charCategorizer(e),s=r(t);return i=>{let o=r(i);return s==St.Space&&(s=o),s==o}}function C5(n,e,t,r){let s=e.head,i=t?1:-1;if(s==(t?n.state.doc.length:0))return ae.cursor(s,e.assoc);let o=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,(e.empty?e.assoc:0)||(t?1:-1)),u=n.documentTop;if(c)o==null&&(o=c.left-l.left),a=i<0?c.top:c.bottom;else{let g=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(l.right-l.left,n.defaultCharacterWidth*(s-g.from))),a=(i<0?g.top:g.bottom)+u}let h=l.left+o,f=r??n.viewState.heightOracle.textHeight>>1,m=Zu(n,{x:h,y:a+f*i},!1,i);return ae.cursor(m.pos,m.assoc,void 0,o)}function co(n,e,t){for(;;){let r=0;for(let s of n)s.between(e-1,e+1,(i,o,a)=>{if(e>i&&e<o){let l=r||t||(e-i<o-e?-1:1);e=l<0?i:o,r=l}});if(!r)return e}}function $O(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],i=null;if(s.empty){let o=co(n,s.from,0);o!=s.from&&(i=ae.cursor(o,-1))}else{let o=co(n,s.from,-1),a=co(n,s.to,1);(o!=s.from||a!=s.to)&&(i=ae.range(s.from==s.anchor?o:a,s.from==s.head?o:a))}i&&(t||(t=e.ranges.slice()),t[r]=i)}return t?ae.create(t,e.mainIndex):e}function yc(n,e,t){let r=co(n.state.facet(Vo).map(s=>s(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:ae.cursor(r,r<t.from?1:-1)}class Pr{constructor(e,t){this.pos=e,this.assoc=t}}function Zu(n,e,t,r){let s=n.contentDOM.getBoundingClientRect(),i=s.top+n.viewState.paddingTop,{x:o,y:a}=e,l=a-i,c;for(;;){if(l<0)return new Pr(0,1);if(l>n.viewState.docHeight)return new Pr(n.state.doc.length,-1);if(c=n.elementAtHeight(l),r==null)break;if(c.type==en.Text){if(r<0?c.to<n.viewport.from:c.from>n.viewport.to)break;let f=n.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(f&&(r<0?f.top<=l+i:f.bottom>=l+i))break}let h=n.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+h:c.top-h}if(n.viewport.from>=c.to||n.viewport.to<=c.from){if(t)return null;if(c.type==en.Text){let h=w5(n,s,c,o,a);return new Pr(h,h==c.from?1:-1)}}if(c.type!=en.Text)return l<(c.top+c.bottom)/2?new Pr(c.from,1):new Pr(c.to,-1);let u=n.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=n.docView.lineAt(c.from,-2)),new Q5(n,o,a,n.textDirectionAt(c.from)).scanTile(u,c.from)}class Q5{constructor(e,t,r,s){this.view=e,this.x=t,this.y=r,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Tr.find(s,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Tr.find(s,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:s}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+s.from<t)}scan(e,t){let r=0,s=e.length-1,i=new Set,o=this.bidiIn(e[0],e[s]),a,l,c=-1,u=1e9,h;e:for(;r<s;){let m=s-r,g=r+s>>1;t:if(i.has(g)){let y=r+Math.floor(Math.random()*m);for(let x=0;x<m;x++){if(!i.has(y)){g=y;break t}y++,y==s&&(y=r)}break e}i.add(g);let O=t(g);if(O)for(let y=0;y<O.length;y++){let x=O[y],S=0;if(x.bottom<this.y)(!a||a.bottom<x.bottom)&&(a=x),S=1;else if(x.top>this.y)(!l||l.top>x.top)&&(l=x),S=-1;else{let Q=x.left>this.x?this.x-x.left:x.right<this.x?this.x-x.right:0,T=Math.abs(Q);T<u&&(c=g,u=T,h=x),Q&&(S=Q<0==(this.baseDir==xt.LTR)?-1:1)}S==-1&&(!o||this.baseDirAt(e[g],1))?s=g:S==1&&(!o||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}if(!h){let m=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(m.top+m.bottom)/2,this.scan(e,t)}let f=(o?this.dirAt(e[c],1):this.baseDir)==xt.LTR;return{i:c,after:this.x>(h.left+h.right)/2==f}}scanText(e,t){let r=[];for(let i=0;i<e.length;i=qt(e.text,i))r.push(t+i);r.push(t+e.length);let s=this.scan(r,i=>{let o=r[i]-t,a=r[i+1]-t;return bo(e.dom,o,a).getClientRects()});return s.after?new Pr(r[s.i+1],-1):new Pr(r[s.i],1)}scanTile(e,t){if(!e.length)return new Pr(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a<e.children.length;a++)r.push(l+=e.children[a].length);let s=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:bo(l.dom,0,l.length)).getClientRects()}),i=e.children[s.i],o=r[s.i];return i.isText()?this.scanText(i,o):i.isComposite()?this.scanTile(i,o):s.after?new Pr(r[s.i+1],-1):new Pr(o,1)}}const eo="￿";class P5{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(st.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=eo}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let i=this.text.length;this.readNode(s);let o=Bt.get(s),a=s.nextSibling;if(a==t){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Bt.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:il(s))||il(a)&&(s.nodeName!="BR"||o?.isWidget())&&this.text.length>i)&&!M5(a,t)&&this.lineBreak(),s=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,a;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=s.exec(t))&&(i=a.index,o=a[0].length),this.append(t.slice(r,i<0?t.length:i)),i<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=i+o}}readNode(e){let t=Bt.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(T5(e,r.node,r.offset)?t:0))}}function T5(n,e,t){for(;;){if(!e||t<Kr(e))return!1;if(e==n)return!0;t=xs(e)+1,e=e.parentNode}}function M5(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=Bt.get(n);if(!r?.isWidget())return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class Af{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class A5{constructor(e,t,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=CO(e.docView.tile,t,r,0))){let a=i||o?[]:R5(e),l=new P5(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=E5(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!Au(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Au(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((_e.ios||_e.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let h=Math.min(l,c),f=Math.max(l,c),m=u.from-h,g=u.to-f;(m==0||m==1||h==0)&&(g==0||g==-1||f==e.state.doc.length)&&(l=0,c=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(ae.range(c,l)):this.newSel=ae.single(c,l)}}}function CO(n,e,t,r){if(n.isComposite()){let s=-1,i=-1,o=-1,a=-1;for(let l=0,c=r,u=r;l<n.children.length;l++){let h=n.children[l],f=c+h.length;if(c<e&&f>t)return CO(h,e,t,c);if(f>=e&&s==-1&&(s=l,i=c),c>t&&h.dom.parentNode==n.dom){o=l,a=u;break}u=f,c=f+h.breakAfter}return{from:i,to:a<0?r+n.length:a,startDOM:(s?n.children[s-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o<n.children.length&&o>=0?n.children[o].dom:null}}else return n.isText()?{from:r,to:r+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function QO(n,e){let t,{newSel:r}=e,s=n.state.selection.main,i=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=s.from,c=null;(i===8||_e.android&&e.text.length<a-o)&&(l=s.to,c="end");let u=PO(n.state.doc.sliceString(o,a,eo),e.text,l-o,c);u&&(_e.chrome&&i==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==eo+eo&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:ct.of(e.text.slice(u.from,u.toB).split(eo))})}else r&&(!n.hasFocus&&n.state.facet(Wr)||ul(r,s))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!s.empty&&r&&r.main.empty?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:(_e.mac||_e.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=ae.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:ct.of([t.insert.toString().replace("."," ")])}):t&&t.from>=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:n.state.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:n.state.toText(n.inputState.insertingText)}:_e.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
75
+ `&&n.lineWrapping&&(r&&(r=ae.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:ct.of([" "])}),t)return Fh(n,t,r,i);if(r&&!ul(r,s)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=$O(n.state.facet(Vo).map(l=>l(n)),r))),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function Fh(n,e,t,r=-1){if(_e.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(_e.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ci(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&ci(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&ci(n.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=_5(n,e,t));return n.state.facet(fO).some(l=>l(n,e.from,e.to,i,a))||n.dispatch(a()),!0}function _5(n,e,t){let r,s=n.state,i=s.selection.main,o=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let l=e.from<i.from?-1:1,c=l<0?i.from:i.to,u=co(s.facet(Vo).map(h=>h(n)),c,l);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:ae.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=i.from<e.from?s.sliceDoc(i.from,e.from):"",c=i.to>e.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let l=s.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let u=n.state.sliceDoc(e.from,e.to),h,f=t&&SO(n,t.main.head);if(f){let g=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-g}}else h=n.state.doc.lineAt(i.head);let m=i.to-e.to;r=s.changeByRange(g=>{if(g.from==i.from&&g.to==i.to)return{changes:l,range:c||g.map(l)};let O=g.to-m,y=O-u.length;if(n.state.sliceDoc(y,O)!=u||O>=h.from&&y<=h.to)return{range:g};let x=s.changes({from:y,to:O,insert:e.insert}),S=g.to-i.to;return{changes:x,range:c?ae.range(Math.max(0,c.anchor+S),Math.max(0,c.head+S)):g.map(x)}})}else r={changes:l,selection:c&&s.selection.replaceRange(c)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:a,scrollIntoView:!0})}function PO(n,e,t,r){let s=Math.min(n.length,e.length),i=0;for(;i<s&&n.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==s&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,i-Math.min(o,a));t-=o+l-i}if(o<i&&n.length<e.length){let l=t<=i&&t>=o?i-t:0;i-=l,a=i+(a-o),o=i}else if(a<i){let l=t<=i&&t>=a?i-t:0;i-=l,o=i+(o-a),a=i}return{from:i,toA:o,toB:a}}function R5(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}=n.observer.selectionRange;return t&&(e.push(new Af(t,r)),(s!=t||i!=r)&&e.push(new Af(s,i))),e}function E5(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?ae.single(t+e,r+e):null}function ul(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class B5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,_e.safari&&e.contentDOM.addEventListener("input",()=>null),_e.gecko&&G5(e.contentDOM.ownerDocument)}handleEvent(e){!V5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,t);for(let s of r.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=L5(e),r=this.handlers,s=this.view.contentDOM;for(let i in t)if(i!="scroll"){let o=!t[i].handlers.length,a=r[i];a&&o!=!a.handlers.length&&(s.removeEventListener(i,this.handleEvent),a=null),a||s.addEventListener(i,this.handleEvent,{passive:o})}for(let i in r)i!="scroll"&&!t[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&MO.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_e.android&&_e.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return _e.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=TO.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||D5.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ci(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:_e.safari&&!_e.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function _f(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(s){$n(t.state,s)}}}function L5(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let s=r.spec,i=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(i)for(let a in i){let l=i[a];l&&t(a).handlers.push(_f(r.value,l))}if(o)for(let a in o){let l=o[a];l&&t(a).observers.push(_f(r.value,l))}}for(let r in hr)t(r).handlers.push(hr[r]);for(let r in Kn)t(r).observers.push(Kn[r]);return e}const TO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],D5="dthko",MO=[16,17,18,20,91,92,224,225],da=6;function fa(n){return Math.max(0,n)*.7+8}function Z5(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class I5{constructor(e,t,r,s){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=zC(e.contentDOM),this.atoms=e.state.facet(Vo).map(o=>o(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(st.allowMultipleSelections)&&X5(e,t),this.dragging=N5(e,t)&&RO(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Z5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,s=0,i=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Yh(this.view);e.clientX-l.left<=s+da?t=-fa(s-e.clientX):e.clientX+l.right>=o-da&&(t=fa(e.clientX-o)),e.clientY-l.top<=i+da?r=-fa(i-e.clientY):e.clientY+l.bottom>=a-da&&(r=fa(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=$O(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function X5(n,e){let t=n.state.facet(cO);return t.length?t[0](e):_e.mac?e.metaKey:e.ctrlKey}function z5(n,e){let t=n.state.facet(uO);return t.length?t[0](e):_e.mac?!e.altKey:!e.ctrlKey}function N5(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=vo(n.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i<s.length;i++){let o=s[i];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function V5(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Bt.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const hr=Object.create(null),Kn=Object.create(null),AO=_e.ie&&_e.ie_version<15||_e.ios&&_e.webkit_version<604;function W5(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),_O(n,t.value)},50)}function Ul(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function _O(n,e){e=Ul(n.state,Vh,e);let{state:t}=n,r,s=1,i=t.toText(e),o=i.lines==t.selection.ranges.length;if(Iu!=null&&t.selection.ranges.every(l=>l.empty)&&Iu==i.toString()){let l=-1;r=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let h=t.toText((o?i.line(s++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:h},range:ae.cursor(c.from+h.length)}})}else o?r=t.changeByRange(l=>{let c=i.line(s++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ae.cursor(l.from+c.length)}}):r=t.replaceSelection(i);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Kn.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};hr.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Kn.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Kn.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};hr.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(hO))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=q5(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new I5(n,e,t,r)),r&&n.observer.ignore(()=>{eO(n.contentDOM);let i=n.root.activeElement;i&&!i.contains(n.contentDOM)&&i.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function Rf(n,e,t,r){if(r==1)return ae.cursor(e,t);if(r==2)return k5(n.state,e,t);{let s=n.docView.lineAt(e,t),i=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:i.from,a=s?s.posAtEnd:i.to;return a<n.state.doc.length&&a==i.to&&a++,ae.range(o,a)}}const j5=_e.ie&&_e.ie_version<=11;let Ef=null,Bf=0,Lf=0;function RO(n){if(!j5)return n.detail;let e=Ef,t=Lf;return Ef=n,Lf=Date.now(),Bf=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Bf+1)%3:1}function q5(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=RO(e),s=n.state.selection;return{update(i){i.docChanged&&(t.pos=i.changes.mapPos(t.pos),s=s.map(i.changes))},get(i,o,a){let l=n.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),c,u=Rf(n,l.pos,l.assoc,r);if(t.pos!=l.pos&&!o){let h=Rf(n,t.pos,t.assoc,r),f=Math.min(h.from,u.from),m=Math.max(h.to,u.to);u=f<u.from?ae.range(f,m):ae.range(m,f)}return o?s.replaceRange(s.main.extend(u.from,u.to)):a&&r==1&&s.ranges.length>1&&(c=Y5(s,l.pos))?c:a?s.addRange(u):ae.create([u])}}}function Y5(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:s}=n.ranges[t];if(r<=e&&s>=e)return ae.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}hr.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.tile.nearest(e.target);if(s&&s.isWidget()){let i=s.posAtStart,o=i+s.length;(i>=t.to||o<=t.from)&&(t=ae.range(i,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Ul(n.state,Wh,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};hr.dragend=n=>(n.inputState.draggedContent=null,!1);function Df(n,e,t,r){if(t=Ul(n.state,Vh,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=n.inputState,o=r&&i&&z5(n,e)?{from:i.from,to:i.to}:null,a={from:s,insert:t},l=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(s,-1),head:l.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}hr.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),s=0,i=()=>{++s==t.length&&Df(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=i,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),i()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Df(n,e,r,!0),!0}return!1};hr.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=AO?null:e.clipboardData;return t?(_O(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(W5(n),!1)};function F5(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function U5(n){let e=[],t=[],r=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:i}of n.selection.ranges){let o=n.doc.lineAt(i);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}r=!0}return{text:Ul(n,Wh,e.join(n.lineBreak)),ranges:t,linewise:r}}let Iu=null;hr.copy=hr.cut=(n,e)=>{if(!ao(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:r,linewise:s}=U5(n.state);if(!t&&!s)return!1;Iu=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=AO?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",t),!0):(F5(n,t),!1)};const EO=ts.define();function BO(n,e){let t=[];for(let r of n.facet(pO)){let s=r(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:EO.of(!0)}):null}function LO(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=BO(n.state,e);t?n.dispatch(t):n.update([])}},10)}Kn.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),LO(n)};Kn.blur=n=>{n.observer.clearSelectionRange(),LO(n)};Kn.compositionstart=Kn.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Kn.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,_e.chrome&&_e.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Kn.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};hr.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let i=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(i&&o.length){let a=o[0],l=n.posAtDOM(a.startContainer,a.startOffset),c=n.posAtDOM(a.endContainer,a.endOffset);return Fh(n,{from:l,to:c,insert:n.state.toText(i)},null),!0}}let s;if(_e.chrome&&_e.android&&(s=TO.find(i=>i.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return _e.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),_e.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Kn.compositionend(n,e),20),!1};const Zf=new Set;function G5(n){Zf.has(n)||(Zf.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const If=["pre-wrap","normal","pre-line","break-spaces"];let ki=!1;function Xf(){ki=!1}class H5{constructor(e){this.lineWrapping=e,this.doc=ct.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return If.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,r,s,i,o){let a=If.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=s,this.lineLength=i,l){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class K5{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class ar{constructor(e,t,r,s,i){this.from=e,this.length=t,this.top=r,this.height=s,this._content=i}get type(){return typeof this._content=="number"?en.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ys?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ar(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var kt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(kt||(kt={}));const za=.001;class On{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>za&&(ki=!0),this.height=e)}replace(e,t,r){return On.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,s){let i=this,o=r.doc;for(let a=s.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:h}=s[a],f=i.lineAt(l,kt.ByPosNoHeight,r.setDoc(t),0,0),m=f.to>=c?f:i.lineAt(c,kt.ByPosNoHeight,r,0,0);for(h+=m.to-c,c=m.to;a>0&&f.from<=s[a-1].toA;)l=s[a-1].fromA,u=s[a-1].fromB,a--,l<f.from&&(f=i.lineAt(l,kt.ByPosNoHeight,r,0,0));u+=f.from-l,l=f.from;let g=Uh.build(r.setDoc(o),e,u,h);i=hl(i,i.replace(l,c,g))}return i.updateHeight(r,0)}static empty(){return new En(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,s=0,i=0;for(;;)if(t==r)if(s>i*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,s-=a.size}else if(i>s*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,i-=a.size}else break;else if(s<i){let a=e[t++];a&&(s+=a.size)}else{let a=e[--r];a&&(i+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,r++),new eQ(On.of(e.slice(0,t)),o,On.of(e.slice(r)))}}function hl(n,e){return n==e?n:(n.constructor!=e.constructor&&(ki=!0),e)}On.prototype.size=1;const J5=Ve.replace({});class DO extends On{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new ar(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,r,s){return this.spaceAbove&&e<r+this.spaceAbove?new ar(s,0,r,this.spaceAbove,J5):this.mainBlock(r,s)}lineAt(e,t,r,s,i){let o=this.mainBlock(s,i);return this.spaceAbove?this.blockAt(0,r,s,i).join(o):o}forEachLine(e,t,r,s,i,o){e<=i+this.length&&t>=i&&o(this.lineAt(0,kt.ByPos,r,s,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class En extends DO{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new ar(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let s=r[0];return r.length==1&&(s instanceof En||s instanceof Ht&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Ht?s=new En(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):On.of(r)}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more?this.setMeasuredHeight(s):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ht extends On{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,i=s-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*i);o=l/i,this.length>i+1&&(a=(this.height-l)/(this.length-i-1))}else o=this.height/i;return{firstLine:r,lastLine:s,perLine:o,perChar:a}}blockAt(e,t,r,s){let{firstLine:i,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=t.doc.lineAt(c),h=a+u.length*l,f=Math.max(r,e-h/2);return new ar(u.from,u.length,f,h,0)}else{let c=Math.max(0,Math.min(o-i,Math.floor((e-r)/a))),{from:u,length:h}=t.doc.line(i+c);return new ar(u,h,r+a*c,a,0)}}lineAt(e,t,r,s,i){if(t==kt.ByHeight)return this.blockAt(e,r,s,i);if(t==kt.ByPosNoHeight){let{from:m,to:g}=r.doc.lineAt(e);return new ar(m,g-m,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,i),c=r.doc.lineAt(e),u=a+c.length*l,h=c.number-o,f=s+a*h+l*(c.from-i-h);return new ar(c.from,c.length,Math.max(s,Math.min(f,s+this.height-u)),u,0)}forEachLine(e,t,r,s,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,i);for(let u=e,h=s;u<=t;){let f=r.doc.lineAt(u);if(u==e){let g=f.number-a;h+=l*g+c*(e-i-g)}let m=l+c*f.length;o(new ar(f.from,f.length,h,m,0)),h+=m,u=f.to+1}}replace(e,t,r){let s=this.length-t;if(s>0){let i=r[r.length-1];i instanceof Ht?r[r.length-1]=new Ht(i.length+s):r.push(null,new Ht(s-1))}if(e>0){let i=r[0];i instanceof Ht?r[0]=new Ht(e+i.length):r.unshift(new Ht(e-1),null)}return On.of(r)}decomposeLeft(e,t){t.push(new Ht(e-1),null)}decomposeRight(e,t){t.push(null,new Ht(this.length-e-1))}updateHeight(e,t=0,r=!1,s){let i=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],a=Math.max(t,s.from),l=-1;for(s.from>t&&o.push(new Ht(s.from-t-1).updateHeight(e,t));a<=i&&s.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let h=s.heights[s.index++],f=0;h<0&&(f=-h,h=s.heights[s.index++]),l==-1?l=h:Math.abs(h-l)>=za&&(l=-2);let m=new En(u,h,f);m.outdated=!1,o.push(m),a+=u+1}a<=i&&o.push(null,new Ht(i-a).updateHeight(e,a));let c=On.of(o);return(l<0||Math.abs(c.height-this.height)>=za||Math.abs(l-this.heightMetrics(e,t).perLine)>=za)&&(ki=!0),hl(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class eQ extends On{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,s){let i=r+this.left.height;return e<i?this.left.blockAt(e,t,r,s):this.right.blockAt(e,t,i,s+this.left.length+this.break)}lineAt(e,t,r,s,i){let o=s+this.left.height,a=i+this.left.length+this.break,l=t==kt.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,t,r,s,i):this.right.lineAt(e,t,r,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=t==kt.ByPosNoHeight?kt.ByPosNoHeight:kt.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,s,i).join(c)}forEachLine(e,t,r,s,i,o){let a=s+this.left.height,l=i+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,r,s,i,o),t>=l&&this.right.forEachLine(e,t,r,a,l,o);else{let c=this.lineAt(l,kt.ByPos,r,s,i);e<c.from&&this.left.forEachLine(e,c.from-1,r,s,i,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,r,a,l,o)}}replace(e,t,r){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let a of r)i.push(a);if(e>0&&zf(i,o-1),t<this.length){let a=i.length;this.decomposeRight(t,i),zf(i,a)}return On.of(i)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?On.of(this.break?[e,null,t]:[e,t]):(this.left=hl(this.left,e),this.right=hl(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,s){let{left:i,right:o}=this,a=t+i.length+this.break,l=null;return s&&s.from<=t+i.length&&s.more?l=i=i.updateHeight(e,t,r,s):i.updateHeight(e,t,r),s&&s.from<=a+o.length&&s.more?l=o=o.updateHeight(e,a,r,s):o.updateHeight(e,a,r),l?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function zf(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof Ht&&(r=n[e+1])instanceof Ht&&n.splice(e-1,3,new Ht(t.length+1+r.length))}const tQ=5;class Uh{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof En?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new En(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new DO(o,s,r)):(o||i||s>=tQ)&&this.addLineDeco(s,i,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new En(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new Ht(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof En)return e;let t=new En(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof En)&&!this.isCovered?this.nodes.push(new En(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof En&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,t,r,s){let i=new Uh(r,e);return rt.spans(t,r,s,i,0),i.finish(r)}}function nQ(n,e,t){let r=new rQ;return rt.compare(n,e,t,r,0),r.changes}class rQ{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,s){(e<t||r&&r.heightRelevant||s&&s.heightRelevant)&&li(e,t,this.changes,5)}}function sQ(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,s=r.defaultView||window,i=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,h=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let f=u.getBoundingClientRect();i=Math.max(i,f.left),o=Math.min(o,f.right),a=Math.max(a,f.top),l=Math.min(c==n.parentNode?s.innerHeight:l,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:i-t.left,right:Math.max(i,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function iQ(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function oQ(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class kc{constructor(e,t,r,s){this.from=e,this.to=t,this.size=r,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],i=t[r];if(s.from!=i.from||s.to!=i.to||s.size!=i.size)return!1}return!0}draw(e,t){return Ve.replace({widget:new aQ(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class aQ extends Lr{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Nf{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Vf,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=xt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(jh).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new H5(t),this.stateDeco=Wf(e),this.heightMap=On.empty().applyChanges(this.stateDeco,ct.empty,this.heightOracle.setDoc(e.doc),[new jn(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ve.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let s=r?t.head:t.anchor;if(!e.some(({from:i,to:o})=>s>=i&&s<=o)){let{from:i,to:o}=this.lineBlockAt(s);e.push(new pa(i,o))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Vf:new Gh(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(to(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Wf(this.state);let s=e.changedRanges,i=jn.extendWithRanges(s,nQ(r,this.stateDeco,e?e.changes:Xt.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Xf(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=o||ki)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(gO)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?xt.RTL:xt.LTR;let o=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent==="refresh",a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:T,scaleY:D}=Jg(t,a);(T>.005&&Math.abs(this.scaleX-T)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=T,this.scaleY=D,c|=16,o=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=tO(e.scrollDOM);let g=(this.printing?oQ:sQ)(t,this.paddingTop),O=g.top-this.pixelViewport.top,y=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget&&!iQ(e.dom))return 0;let S=a.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(o=!0),o||s.lineWrapping&&Math.abs(S-this.contentDOMWidth)>s.charWidth){let{lineHeight:D,charWidth:K,textHeight:I}=e.docView.measureTextSize();o=D>0&&s.refresh(i,D,K,I,Math.max(5,S/K),T),o&&(e.docView.minWidth=0,c|=16)}O>0&&y>0?u=Math.max(O,y):O<0&&y<0&&(u=Math.min(O,y)),Xf();for(let D of this.viewports){let K=D.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(D);this.heightMap=(o?On.empty().applyChanges(this.stateDeco,ct.empty,this.heightOracle,[new jn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new K5(D.from,K))}ki&&(c|=2)}let Q=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return Q&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||Q)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new pa(s.lineAt(o-r*1e3,kt.ByHeight,i,0,0).from,s.lineAt(a+(1-r)*1e3,kt.ByHeight,i,0,0).to);if(t){let{head:c}=t.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=s.lineAt(c,kt.ByPos,i,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c<l.from?f=h.top:f=h.bottom-u,l=new pa(s.lineAt(f-1e3/2,kt.ByHeight,i,0,0).from,s.lineAt(f+u+1e3/2,kt.ByHeight,i,0,0).to)}}return l}mapViewport(e,t){let r=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new pa(this.heightMap.lineAt(r,kt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,kt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,kt.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,kt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||s<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||i>=a+Math.max(10,Math.min(r,250)))&&s>o-2*1e3&&i<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let s of e)t.touchesRange(s.from,s.to)||r.push(new kc(t.mapPos(s.from),t.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,i=s>>1,o=s<<1;if(this.defaultTextDirection!=xt.LTR&&!r)return[];let a=[],l=(u,h,f,m)=>{if(h-u<i)return;let g=this.state.selection.main,O=[g.from];g.empty||O.push(g.to);for(let x of O)if(x>u&&x<h){l(u,x-10,f,m),l(x+10,h,f,m);return}let y=cQ(e,x=>x.from>=f.from&&x.to<=f.to&&Math.abs(x.from-u)<i&&Math.abs(x.to-h)<i&&!O.some(S=>x.from<S&&x.to>S));if(!y){if(h<f.to&&t&&r&&t.visibleRanges.some(Q=>Q.from<=h&&Q.to>=h)){let Q=t.moveToLineBoundary(ae.cursor(h),!1,!0).head;Q>u&&(h=Q)}let x=this.gapSize(f,u,h,m),S=r||x<2e6?x:2e6;y=new kc(u,h,x,S)}a.push(y)},c=u=>{if(u.length<o||u.type!=en.Text)return;let h=lQ(u.from,u.to,this.stateDeco);if(h.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,m,g;if(r){let O=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,y,x;if(f!=null){let S=ga(h,f),Q=((this.visibleBottom-this.visibleTop)/2+O)/u.height;y=S-Q,x=S+Q}else y=(this.visibleTop-u.top-O)/u.height,x=(this.visibleBottom-u.top+O)/u.height;m=ma(h,y),g=ma(h,x)}else{let O=h.total*this.heightOracle.charWidth,y=s*this.heightOracle.charWidth,x=0;if(O>2e6)for(let K of e)K.from>=u.from&&K.from<u.to&&K.size!=K.displaySize&&K.from*this.heightOracle.charWidth+x<this.pixelViewport.left&&(x=K.size-K.displaySize);let S=this.pixelViewport.left+x,Q=this.pixelViewport.right+x,T,D;if(f!=null){let K=ga(h,f),I=((Q-S)/2+y)/O;T=K-I,D=K+I}else T=(S-y)/O,D=(Q+y)/O;m=ma(h,T),g=ma(h,D)}m>u.from&&l(u.from,m,u,h),g<u.to&&l(g,u.to,u,h)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,t,r,s){let i=ga(s,r)-ga(s,t);return this.heightOracle.lineWrapping?e.height*i:s.total*this.heightOracle.charWidth*i}updateLineGaps(e){kc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ve.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];rt.spans(t,this.viewport.from,this.viewport.to,{span(i,o){r.push({from:i,to:o})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i<r.length&&!(s&8);i++){let o=this.visibleRanges[i],a=r[i];(o.from!=a.from||o.to!=a.to)&&(s|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||to(this.heightMap.lineAt(e,kt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||to(this.heightMap.lineAt(this.scaler.fromDOM(e),kt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return to(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class pa{constructor(e,t){this.from=e,this.to=t}}function lQ(n,e,t){let r=[],s=n,i=0;return rt.spans(t,n,e,{span(){},point(o,a){o>s&&(r.push({from:s,to:o}),i+=o-s),s=a}},20),s<e&&(r.push({from:s,to:e}),i+=e-s),{total:i,ranges:r}}function ma({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let s=0;;s++){let{from:i,to:o}=e[s],a=o-i;if(r<=a)return i+r;r-=a}}function ga(n,e){let t=0;for(let{from:r,to:s}of n.ranges){if(e<=s){t+=e-r;break}t+=s-r}return t/n.total}function cQ(n,e){for(let t of n)if(e(t))return t}const Vf={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Wf(n){let e=n.facet(ql).filter(r=>typeof r!="function"),t=n.facet(qh).filter(r=>typeof r!="function");return t.length&&e.push(rt.join(t)),e}class Gh{constructor(e,t,r){let s=0,i=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,kt.ByPos,e,0,0).top,u=t.lineAt(l,kt.ByPos,e,0,0).bottom;return s+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let a of this.viewports)a.domTop=o+(a.top-i)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return s+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,s=i.domBottom}}fromDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return r+(e-s)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,s=i.domBottom}}eq(e){return e instanceof Gh?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function to(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new ar(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(s=>to(s,e)):n._content)}const Oa=Me.define({combine:n=>n.join(" ")}),Xu=Me.define({combine:n=>n.indexOf(!0)>-1}),zu=vs.newName(),ZO=vs.newName(),IO=vs.newName(),XO={"&light":"."+ZO,"&dark":"."+IO};function Nu(n,e,t){return new vs(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+r}})}const uQ=Nu("."+zu,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},XO),hQ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},wc=_e.ie&&_e.ie_version<=11;class dQ{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new NC,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(_e.ie&&_e.ie_version<=11||_e.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&_e.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_e.chrome&&_e.chrome_version<126)&&(this.editContext=new pQ(e),e.state.facet(Wr)&&(e.contentDOM.editContext=this.editContext.editContext)),wc&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(Wr)?r.root.activeElement!=this.dom:!ao(this.dom,s))return;let i=s.anchorNode&&r.docView.tile.nearest(s.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(_e.ie&&_e.ie_version<=11||_e.android&&_e.chrome)&&!r.state.selection.main.empty&&s.focusNode&&lo(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=vo(e.root);if(!t)return!1;let r=_e.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&fQ(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let s=ao(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&WC(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,hQ),wc&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),wc&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let s=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&ci(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,s=!1;for(let i of e){let o=this.readMutation(i);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:s}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),s=this.selectionChanged&&ao(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new A5(this.view,e,t,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,s=QO(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!ul(this.view.state.selection,t.newSel.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=jf(t,e.previousSibling||e.target.previousSibling,-1),s=jf(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Wr)!=e.state.facet(Wr)&&(e.view.contentDOM.editContext=e.state.facet(Wr)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function jf(n,e,t){for(;e;){let r=Bt.get(e);if(r&&r.parent==n)return r;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function qf(n,e){let t=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return lo(o.node,o.offset,s,i)&&([t,r,s,i]=[s,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}}function fQ(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return qf(n,s)}let t=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?qf(n,t):null}class pQ{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:o}=s,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&i<this.from?a=i:l==this.to&&i>this.to&&(l=i);let u=PO(e.state.sliceDoc(a,l),r.text,(c?s.from:s.to)-a,c?"end":null);if(!u){let f=ae.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ul(f,s)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:u.from+a,to:u.toA+a,insert:ct.of(r.text.slice(u.from,u.toB).split(`
76
+ `))};if((_e.mac||_e.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:ct.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Fh(e,h,ae.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,s.push(i)}t.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let o=i.underlineStyle,a=i.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;s.push(Ve.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:vO.of(Ve.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=vo(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,o,a,l,c)=>{if(r)return;let u=c.length-(o-i);if(s&&o>=s.to)if(s.from==i&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=u,this.to+=u;return}else s=null,this.revertPending(e.state);if(i+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),s&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class $e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||VC(e.parent)||document,this.viewState=new Nf(e.state||st.create(e)),e.scrollTo&&e.scrollTo.is(ha)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(si).map(s=>new Oc(s));for(let s of this.plugins)s.update(this);this.observer=new dQ(this),this.inputState=new B5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Tf(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Et?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,s,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(EO))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=BO(i,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(st.phrases)!=this.state.facet(st.phrases))return this.setState(i);s=al.create(this,i,e),s.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:m}=f.state.selection;h=new ui(m.empty?m:ae.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of f.effects)m.is(ha)&&(h=m.value.clip(this.state))}this.viewState.update(s,h),this.bidiCache=dl.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ji)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Oa)!=s.state.facet(Oa)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let f of this.state.facet(Bu))try{f(s)}catch(m){$n(this.state,m,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!QO(this,u)&&c.force&&ci(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Nf(e),this.plugins=e.facet(si).map(r=>new Oc(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Tf(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(si),r=e.state.facet(si);if(t!=r){let s=[];for(let i of r){let o=t.indexOf(i);if(o<0)s.push(new Oc(i));else{let a=this.plugins[o];a.mustUpdate=e,s.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){$n(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(tO(r))i=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(s);i=m.from,o=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(m=>{try{return m.read(this)}catch(g){return $n(this.state,g),Yf}}),h=al.create(this,this.state,[]),f=!1;h.flags|=l,t?t.flags|=l:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(u[m]!=Yf)try{let g=c[m];g.write&&g.write(u[m],this)}catch(g){$n(this.state,g)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let g=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o;if(g>1||g<-1){s=s+g,r.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Bu))a(t)}get themeClasses(){return zu+" "+(this.state.facet(Xu)?IO:ZO)+" "+this.state.facet(Oa)}updateAttrs(){let e=Ff(this,bO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Wr)?"true":"false",class:"cm-content",style:`${_e.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ff(this,jh,t);let r=this.observer.ignore(()=>{let s=wf(this.contentDOM,this.contentAttrs,t),i=wf(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let s of r.effects)if(s.is($e.announce)){t&&(this.announceDOM.textContent=""),t=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ji);let e=this.state.facet($e.cspNonce);vs.mount(this.root,this.styleModules.concat(uQ).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return yc(this,e,Mf(this,e,t,r))}moveByGroup(e,t){return yc(this,e,Mf(this,e,t,r=>$5(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[t?r.length-1:0];return ae.cursor(i.side(t,s)+e.from,i.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,r=!0){return S5(this,e,t,r)}moveVertically(e,t,r){return yc(this,e,C5(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=Zu(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Zu(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),o=i[Tr.find(i,e-s.from,-1,t)];return ol(r,o.dir==xt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(mO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>mQ)return aO(e.length);let t=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||oO(i.isolates,r=Cf(this,e))))return i.order;r||(r=Cf(this,e));let s=HC(e.text,t,r);return this.bidiCache.push(new dl(e.from,e.to,t,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_e.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{eO(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return ha.of(new ui(typeof e=="number"?ae.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return ha.of(new ui(ae.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return _t.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return _t.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=vs.newName(),s=[Oa.of(r),Ji.of(Nu(`.${r}`,e))];return t&&t.dark&&s.push(Xu.of(!0)),s}static baseTheme(e){return es.lowest(Ji.of(Nu("."+zu,e,XO)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),s=r&&Bt.get(r)||Bt.get(e);return((t=s?.root)===null||t===void 0?void 0:t.view)||null}}$e.styleModule=Ji;$e.inputHandler=fO;$e.clipboardInputFilter=Vh;$e.clipboardOutputFilter=Wh;$e.scrollHandler=OO;$e.focusChangeEffect=pO;$e.perLineTextDirection=mO;$e.exceptionSink=dO;$e.updateListener=Bu;$e.editable=Wr;$e.mouseSelectionStyle=hO;$e.dragMovesSelection=uO;$e.clickAddsSelectionRange=cO;$e.decorations=ql;$e.blockWrappers=xO;$e.outerDecorations=qh;$e.atomicRanges=Vo;$e.bidiIsolatedRanges=yO;$e.scrollMargins=kO;$e.darkTheme=Xu;$e.cspNonce=Me.define({combine:n=>n.length?n[0]:""});$e.contentAttributes=jh;$e.editorAttributes=bO;$e.lineWrapping=$e.contentAttributes.of({class:"cm-lineWrapping"});$e.announce=Ke.define();const mQ=4096,Yf={};class dl{constructor(e,t,r,s,i,o){this.from=e,this.to=t,this.dir=r,this.isolates=s,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:xt.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir==s&&!t.touchesRange(o.from,o.to)&&r.push(new dl(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function Ff(n,e,t){for(let r=n.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],o=typeof i=="function"?i(n):i;o&&Xh(o,t)}return t}const gQ=_e.mac?"mac":_e.windows?"win":_e.linux?"linux":"key";function OQ(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let s,i,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function va(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const vQ=es.default($e.domEventHandlers({keydown(n,e){return NO(zO(e.state),n,e,"editor")}})),Wo=Me.define({enables:vQ}),Uf=new WeakMap;function zO(n){let e=n.facet(Wo),t=Uf.get(e);return t||Uf.set(e,t=yQ(e.reduce((r,s)=>r.concat(s),[]))),t}function bQ(n,e,t){return NO(zO(n.state),e,n,t)}let fs=null;const xQ=4e3;function yQ(n,e=gQ){let t=Object.create(null),r=Object.create(null),s=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},i=(o,a,l,c,u)=>{var h,f;let m=t[o]||(t[o]=Object.create(null)),g=a.split(/ (?!$)/).map(x=>OQ(x,e));for(let x=1;x<g.length;x++){let S=g.slice(0,x).join(" ");s(S,!0),m[S]||(m[S]={preventDefault:!0,stopPropagation:!1,run:[Q=>{let T=fs={view:Q,prefix:S,scope:o};return setTimeout(()=>{fs==T&&(fs=null)},xQ),!0}]})}let O=g.join(" ");s(O,!1);let y=m[O]||(m[O]={preventDefault:!1,stopPropagation:!1,run:((f=(h=m._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&y.run.push(l),c&&(y.preventDefault=!0),u&&(y.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(m=>h(m,Vu))}let l=o[e]||o.key;if(l)for(let c of a)i(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&i(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let Vu=null;function NO(n,e,t,r){Vu=e;let s=EC(e),i=kn(s,0),o=Qr(i)==s.length&&s!=" ",a="",l=!1,c=!1,u=!1;fs&&fs.view==t&&fs.scope==r&&(a=fs.prefix+" ",MO.indexOf(e.keyCode)<0&&(c=!0,fs=null));let h=new Set,f=y=>{if(y){for(let x of y.run)if(!h.has(x)&&(h.add(x),x(t)))return y.stopPropagation&&(u=!0),!0;y.preventDefault&&(y.stopPropagation&&(u=!0),c=!0)}return!1},m=n[r],g,O;return m&&(f(m[a+va(s,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_e.windows&&e.ctrlKey&&e.altKey)&&!(_e.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=bs[e.keyCode])&&g!=s?(f(m[a+va(g,e,!0)])||e.shiftKey&&(O=go[e.keyCode])!=s&&O!=g&&f(m[a+va(O,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(m[a+va(s,e,!0)])&&(l=!0),!l&&f(m._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),Vu=null,l}class jo{constructor(e,t,r,s,i){this.className=e,this.left=t,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=VO(e);return[new jo(t,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return kQ(e,t,r)}}function VO(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==xt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Gf(n,e,t,r){let s=n.coordsAtPos(e,t*2);if(!s)return r;let i=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,a=n.posAtCoords({x:i.left+1,y:o}),l=n.posAtCoords({x:i.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function kQ(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),i=n.textDirection==xt.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),l=VO(n),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=a.right-(u?parseInt(u.paddingRight):0),m=Du(n,r,1),g=Du(n,s,-1),O=m.type==en.Text?m:null,y=g.type==en.Text?g:null;if(O&&(n.lineWrapping||m.widgetLineBreaks)&&(O=Gf(n,r,1,O)),y&&(n.lineWrapping||g.widgetLineBreaks)&&(y=Gf(n,s,-1,y)),O&&y&&O.from==y.from&&O.to==y.to)return S(Q(t.from,t.to,O));{let D=O?Q(t.from,null,O):T(m,!1),K=y?Q(null,t.to,y):T(g,!0),I=[];return(O||m).to<(y||g).from-(O&&y?1:0)||m.widgetLineBreaks>1&&D.bottom+n.defaultLineHeight/2<K.top?I.push(x(h,D.bottom,f,K.top)):D.bottom<K.top&&n.elementAtHeight((D.bottom+K.top)/2).type==en.Text&&(D.bottom=K.top=(D.bottom+K.top)/2),S(D).concat(I).concat(S(K))}function x(D,K,I,ue){return new jo(e,D-l.left,K-l.top,Math.max(0,I-D),ue-K)}function S({top:D,bottom:K,horizontal:I}){let ue=[];for(let le=0;le<I.length;le+=2)ue.push(x(I[le],D,I[le+1],K));return ue}function Q(D,K,I){let ue=1e9,le=-1e9,oe=[];function Z(q,U,j,N,W){let ve=n.coordsAtPos(q,q==I.to?-2:2),te=n.coordsAtPos(j,j==I.from?2:-2);!ve||!te||(ue=Math.min(ve.top,te.top,ue),le=Math.max(ve.bottom,te.bottom,le),W==xt.LTR?oe.push(i&&U?h:ve.left,i&&N?f:te.right):oe.push(!i&&N?h:te.left,!i&&U?f:ve.right))}let X=D??I.from,B=K??I.to;for(let q of n.visibleRanges)if(q.to>X&&q.from<B)for(let U=Math.max(q.from,X),j=Math.min(q.to,B);;){let N=n.state.doc.lineAt(U);for(let W of n.bidiSpans(N)){let ve=W.from+N.from,te=W.to+N.from;if(ve>=j)break;te>U&&Z(Math.max(ve,U),D==null&&ve<=X,Math.min(te,j),K==null&&te>=B,W.dir)}if(U=N.to+1,U>=j)break}return oe.length==0&&Z(X,D==null,B,K==null,n.textDirection),{top:ue,bottom:le,horizontal:oe}}function T(D,K){let I=a.top+(K?D.top:D.bottom);return{top:I,bottom:I,horizontal:[]}}}function wQ(n,e){return n.constructor==e.constructor&&n.eq(e)}class SQ{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Na)!=e.state.facet(Na)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Na);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!wQ(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[r].constructor&&s.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e,_e.safari&&_e.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Na=Me.define();function WO(n){return[_t.define(e=>new SQ(e,n)),Na.of(n)]}const xo=Me.define({combine(n){return Br(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function $Q(n={}){return[xo.of(n),CQ,QQ,PQ,gO.of(!0)]}function jO(n){return n.startState.facet(xo)!=n.state.facet(xo)}const CQ=WO({above:!0,markers(n){let{state:e}=n,t=e.facet(xo),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||t.drawRangeCursor){let o=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=s.empty?s:ae.cursor(s.head,s.head>s.anchor?-1:1);for(let l of jo.forRange(n,o,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=jO(n);return t&&Hf(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Hf(e.state,n)},class:"cm-cursorLayer"});function Hf(n,e){e.style.animationDuration=n.facet(xo).cursorBlinkRate+"ms"}const QQ=WO({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:jo.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||jO(n)},class:"cm-selectionLayer"}),PQ=es.highest($e.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),qO=Ke.define({map(n,e){return n==null?null:e.mapPos(n)}}),no=Ft.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(qO)?r.value:t,n)}}),TQ=_t.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(no);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(no)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(no),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(no)!=n&&this.view.dispatch({effects:qO.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function MQ(){return[no,TQ]}function Kf(n,e,t,r,s){e.lastIndex=0;for(let i=n.iterRange(t,r),o=t,a;!i.next().done;o+=i.value.length)if(!i.lineBreak)for(;a=e.exec(i.value);)s(o+a.index,a)}function AQ(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:s,to:i}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),i=Math.min(n.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class _Q{constructor(e){const{regexp:t,decoration:r,decorate:s,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(a,l,c,u)=>s(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let h=r(a,l,c);h&&u(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new Hr,r=t.add.bind(t);for(let{from:s,to:i}of AQ(e,this.maxLength))Kf(e.state.doc,this.regexp,s,i,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),s=Math.max(l,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),r,s):t}updateRange(e,t,r,s){for(let i of e.visibleRanges){let o=Math.max(i.from,r),a=Math.min(i.to,s);if(a>=o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(i.from,l.from),h=Math.min(i.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let f=[],m,g=(O,y,x)=>f.push(x.range(O,y));if(l==c)for(this.regexp.lastIndex=u-l.from;(m=this.regexp.exec(l.text))&&m.index<h-l.from;)this.addMatch(m,e,m.index+l.from,g);else Kf(e.state.doc,this.regexp,u,h,(O,y)=>this.addMatch(y,e,O,g));t=t.update({filterFrom:u,filterTo:h,filter:(O,y)=>O<u||y>h,add:f})}}return t}}const Wu=/x/.unicode!=null?"gu":"g",RQ=new RegExp(`[\0-\b
77
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Wu),EQ={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Sc=null;function BQ(){var n;if(Sc==null&&typeof document<"u"&&document.body){let e=document.body.style;Sc=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Sc||!1}const Va=Me.define({combine(n){let e=Br(n,{render:null,specialChars:RQ,addSpecialChars:null});return(e.replaceTabs=!BQ())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Wu)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Wu)),e}});function LQ(n={}){return[Va.of(n),DQ()]}let Jf=null;function DQ(){return Jf||(Jf=_t.fromClass(class{constructor(n){this.view=n,this.decorations=Ve.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Va)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new _Q({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:s}=t.state,i=kn(e[0],0);if(i==9){let o=s.lineAt(r),a=t.state.tabSize,l=ur(o.text,a,r-o.from);return Ve.replace({widget:new zQ((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Ve.replace({widget:new XQ(n,i)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Va);n.startState.facet(Va)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const ZQ="•";function IQ(n){return n>=32?ZQ:n==10?"␤":String.fromCharCode(9216+n)}class XQ extends Lr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=IQ(this.code),r=e.state.phrase("Control character")+" "+(EQ[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,t);if(s)return s;let i=document.createElement("span");return i.textContent=t,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class zQ extends Lr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function NQ(){return WQ}const VQ=Ve.line({class:"cm-activeLine"}),WQ=_t.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let s=n.lineBlockAt(r.head);s.from>e&&(t.push(VQ.range(s.from)),e=s.from)}return Ve.set(t)}},{decorations:n=>n.decorations}),ju=2e3;function jQ(n,e,t){let r=Math.min(e.line,t.line),s=Math.max(e.line,t.line),i=[];if(e.off>ju||t.off>ju||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=s;l++){let c=n.doc.line(l);c.length<=a&&i.push(ae.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=s;l++){let c=n.doc.line(l),u=Su(c.text,o,n.tabSize,!0);if(u<0)i.push(ae.cursor(c.to));else{let h=Su(c.text,a,n.tabSize);i.push(ae.range(c.from+u,c.from+h))}}}return i}function qQ(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function ep(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),s=t-r.from,i=s>ju?-1:s==r.length?qQ(n,e.clientX):ur(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:i,off:s}}function YQ(n,e){let t=ep(n,e),r=n.state.selection;return t?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(i);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(s.changes)}},get(s,i,o){let a=ep(n,s);if(!a)return r;let l=jQ(n.state,t,a);return l.length?o?ae.create(l.concat(r.ranges)):ae.create(l):r}}:null}function FQ(n){let e=(t=>t.altKey&&t.button==0);return $e.mouseSelectionStyle.of((t,r)=>e(r)?YQ(t,r):null)}const UQ={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},GQ={style:"cursor: crosshair"};function HQ(n={}){let[e,t]=UQ[n.key||"Alt"],r=_t.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[r,$e.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?GQ:null})]}const ba="-10000px";class YO{constructor(e,t,r,s){this.facet=t,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let i=null;this.tooltipViews=this.tooltips.map(o=>i=r(o,i))}update(e,t){var r;let s=e.state.facet(this.facet),i=s.filter(l=>l);if(s===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<i.length;l++){let c=i[l],u=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(u=h)}if(u<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let h=o[l]=this.tooltipViews[u];a&&(a[l]=t[u]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=s,this.tooltips=i,this.tooltipViews=o,!0}}function KQ(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const $c=Me.define({combine:n=>{var e,t,r;return{position:_e.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||KQ}}}),tp=new WeakMap,Hh=_t.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet($c);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new YO(n,Kh,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet($c);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=ba,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(_e.safari){let o=i.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(n=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=Yh(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet($c).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:s,scaleY:i}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,h=n.pos[a],f=n.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(t.top,r.top)||h.top>=Math.min(t.bottom,r.bottom)||h.right<Math.max(t.left,r.left)-.1||h.left>Math.min(t.right,r.right)+.1)){u.style.top=ba;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,O=f.right-f.left,y=(e=tp.get(c))!==null&&e!==void 0?e:f.bottom-f.top,x=c.offset||eP,S=this.view.textDirection==xt.LTR,Q=f.width>r.right-r.left?S?r.left:r.right-f.width:S?Math.max(r.left,Math.min(h.left-(m?14:0)+x.x,r.right-O)):Math.min(Math.max(r.left,h.left-O+(m?14:0)-x.x),r.right-O),T=this.above[a];!l.strictSide&&(T?h.top-y-g-x.y<r.top:h.bottom+y+g+x.y>r.bottom)&&T==r.bottom-h.bottom>h.top-r.top&&(T=this.above[a]=!T);let D=(T?h.top-r.top:r.bottom-h.bottom)-g;if(D<y&&c.resize!==!1){if(D<this.view.defaultLineHeight){u.style.top=ba;continue}tp.set(c,y),u.style.height=(y=D)/i+"px"}else u.style.height&&(u.style.height="");let K=T?h.top-y-g-x.y:h.bottom+g+x.y,I=Q+O;if(c.overlap!==!0)for(let ue of o)ue.left<I&&ue.right>Q&&ue.top<K+y&&ue.bottom>K&&(K=T?ue.top-y-2-g:ue.bottom+g+2);if(this.position=="absolute"?(u.style.top=(K-n.parent.top)/i+"px",np(u,(Q-n.parent.left)/s)):(u.style.top=K/i+"px",np(u,Q/s)),m){let ue=h.left+(S?x.x:-x.x)-(Q+14-7);m.style.left=ue/s+"px"}c.overlap!==!0&&o.push({left:Q,top:K,right:I,bottom:K+y}),u.classList.toggle("cm-tooltip-above",T),u.classList.toggle("cm-tooltip-below",!T),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=ba}},{eventObservers:{scroll(){this.maybeMeasure()}}});function np(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const JQ=$e.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),eP={x:0,y:0},Kh=Me.define({enables:[Hh,JQ]}),fl=Me.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Gl{static create(e){return new Gl(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new YO(e,fl,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const tP=Kh.compute([fl],n=>{let e=n.facet(fl);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:Gl.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class nP{constructor(e,t,r,s,i){this.view=e,this.source=t,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.tile.nearest(t.target);if(!r)return;let s,i=1;if(r.isWidget())s=r.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let a=e.coordsAtPos(s);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(s)).find(u=>u.from<=s&&u.to>=s),c=l&&l.dir==xt.RTL?-1:1;i=t.x<a.left?-c:c}let o=this.source(e,s,i);if(o?.then){let a=this.pending={pos:s};o.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>$n(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Hh),t=e?e.manager.tooltips.findIndex(r=>r.create==Gl.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!rP(i.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,a=(r=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!sP(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const xa=4;function rP(n,e){let{left:t,right:r,top:s,bottom:i}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();s=Math.min(a.top,s),i=Math.max(a.bottom,i)}return e.clientX>=t-xa&&e.clientX<=r+xa&&e.clientY>=s-xa&&e.clientY<=i+xa}function sP(n,e,t,r,s,i){let o=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>r||o.right<r||o.top>s||Math.min(o.bottom,a)<s)return!1;let l=n.posAtCoords({x:r,y:s},!1);return l>=e&&l<=t}function iP(n,e={}){let t=Ke.define(),r=Ft.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(i,o))),i.docChanged)){let o=[];for(let a of s){let l=i.changes.mapPos(a.pos,-1,Jt.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=i.changes.mapPos(c.end)),o.push(c)}}s=o}for(let o of i.effects)o.is(t)&&(s=o.value),o.is(oP)&&(s=[]);return s},provide:s=>fl.from(s)});return{active:r,extension:[r,_t.define(s=>new nP(s,n,r,t,e.hoverTime||300)),tP]}}function FO(n,e){let t=n.plugin(Hh);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const oP=Ke.define(),rp=Me.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Jh(n,e){let t=n.plugin(UO),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const UO=_t.fromClass(class{constructor(n){this.input=n.state.facet(yo),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(rp);this.top=new ya(n,!0,e.topContainer),this.bottom=new ya(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(rp);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ya(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ya(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(yo);if(t!=this.input){let r=t.filter(l=>l),s=[],i=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),s.push(u),(u.top?i:o).push(u)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>$e.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class ya{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=sp(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=sp(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function sp(n){let e=n.nextSibling;return n.remove(),e}const yo=Me.define({enables:UO});function aP(n,e){let t,r=new Promise(o=>t=o),s=o=>lP(o,e,t);n.state.field(Cc,!1)?n.dispatch({effects:GO.of(s)}):n.dispatch({effects:Ke.appendConfig.of(Cc.init(()=>[s]))});let i=HO.of(s);return{close:i,result:r.then(o=>((n.win.queueMicrotask||(l=>n.win.setTimeout(l,10)))(()=>{n.state.field(Cc).indexOf(s)>-1&&n.dispatch({effects:i})}),o))}}const Cc=Ft.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(GO)?n=[t.value].concat(n):t.is(HO)&&(n=n.filter(r=>r!=t.value));return n},provide:n=>yo.computeN([n],e=>e.field(n))}),GO=Ke.define(),HO=Ke.define();function lP(n,e,t){let r=e.content?e.content(n,()=>o(null)):null;if(!r){if(r=mt("form"),e.input){let a=mt("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(mt("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(mt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<s.length;a++){let l=s[a];l.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let i=mt("div",r,mt("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(i.className=e.class),i.classList.add("cm-dialog");function o(a){i.contains(i.ownerDocument.activeElement)&&n.focus(),t(a)}return{dom:i,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class Jr extends Os{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Jr.prototype.elementClass="";Jr.prototype.toDOM=void 0;Jr.prototype.mapMode=Jt.TrackBefore;Jr.prototype.startSide=Jr.prototype.endSide=-1;Jr.prototype.point=!0;const Wa=Me.define(),cP=Me.define(),uP={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>rt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},uo=Me.define();function hP(n){return[KO(),uo.of({...uP,...n})]}const ip=Me.define({combine:n=>n.some(e=>e)});function KO(n){return[dP]}const dP=_t.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(uo).map(e=>new ap(n,e)),this.fixed=!n.state.facet(ip);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(ip)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=rt.iter(this.view.state.facet(Wa),this.view.viewport.from),r=[],s=this.gutters.map(i=>new fP(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let o=!0;for(let a of i.type)if(a.type==en.Text&&o){qu(t,r,a.from);for(let l of s)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of s)l.widget(this.view,a)}else if(i.type==en.Text){qu(t,r,i.from);for(let o of s)o.line(this.view,i,r)}else if(i.widget)for(let o of s)o.widget(this.view,i);for(let i of s)i.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(uo),t=n.state.facet(uo),r=n.docChanged||n.heightChanged||n.viewportChanged||!rt.eq(n.startState.facet(Wa),n.state.facet(Wa),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(r=!0);else{r=!0;let s=[];for(let i of t){let o=e.indexOf(i);o<0?s.push(new ap(this.view,i)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>$e.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==xt.LTR?{left:r,right:s}:{right:r,left:s}})});function op(n){return Array.isArray(n)?n:[n]}function qu(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class fP{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=rt.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:s}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let a=new JO(e,o,i,r);s.elements.push(a),s.dom.appendChild(a.dom)}else s.elements[this.i].update(e,o,i,r);this.height=t.bottom,this.i++}line(e,t,r){let s=[];qu(this.cursor,s,t.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,t,s);i&&s.unshift(i);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),s=r?[r]:null;for(let i of e.state.facet(cP)){let o=i(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ap{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let l=i.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=s.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,s)&&s.preventDefault()});this.markers=op(t.markers(e)),t.initialSpacer&&(this.spacer=new JO(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=op(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!rt.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class JO{constructor(e,t,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,s)}update(e,t,r,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),pP(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,o=0;;){let a=o,l=i<t.length?t[i++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(s);let h=s.nextSibling;s.remove(),s=h}}if(!l)break;l.toDOM&&(c?s=s.nextSibling:this.dom.insertBefore(l.toDOM(e),s)),c&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function pP(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const mP=Me.define(),gP=Me.define(),ii=Me.define({combine(n){return Br(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let s in t){let i=r[s],o=t[s];r[s]=i?(a,l,c)=>i(a,l,c)||o(a,l,c):o}return r}})}});class Qc extends Jr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Pc(n,e){return n.state.facet(ii).formatNumber(e,n.state)}const OP=uo.compute([ii],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(mP)},lineMarker(e,t,r){return r.some(s=>s.toDOM)?null:new Qc(Pc(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let s of e.state.facet(gP)){let i=s(e,t,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(ii)!=e.state.facet(ii),initialSpacer(e){return new Qc(Pc(e,lp(e.state.doc.lines)))},updateSpacer(e,t){let r=Pc(t.view,lp(t.view.state.doc.lines));return r==e.number?e:new Qc(r)},domEventHandlers:n.facet(ii).domEventHandlers,side:"before"}));function vP(n={}){return[ii.of(n),KO(),OP]}function lp(n){let e=9;for(;e<n;)e=e*10+9;return e}const bP=new class extends Jr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},xP=Wa.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let s=n.doc.lineAt(r.head).from;s>t&&(t=s,e.push(bP.range(s)))}return rt.of(e)});function yP(){return xP}const e0=1024;let kP=0;class qn{constructor(e,t){this.from=e,this.to=t}}class Je{constructor(e={}){this.id=kP++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Nt.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}Je.closedBy=new Je({deserialize:n=>n.split(" ")});Je.openedBy=new Je({deserialize:n=>n.split(" ")});Je.group=new Je({deserialize:n=>n.split(" ")});Je.isolate=new Je({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Je.contextHash=new Je({perNode:!0});Je.lookAhead=new Je({perNode:!0});Je.mounted=new Je({perNode:!0});class hi{constructor(e,t,r,s=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=s}static get(e){return e&&e.props&&e.props[Je.mounted.id]}}const wP=Object.create(null);class Nt{constructor(e,t,r,s=0){this.name=e,this.props=t,this.id=r,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):wP,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Nt(e.name||"",t,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Je.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let s of r.split(" "))t[s]=e[r];return r=>{for(let s=r.prop(Je.group),i=-1;i<(s?s.length:0);i++){let o=t[i<0?r.name:s[i]];if(o)return o}}}}Nt.none=new Nt("",Object.create(null),0,8);class qo{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let s=null;for(let i of e){let o=i(r);if(o){s||(s=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in s&&(a=l.combine(s[l.id],a)),s[l.id]=a}}t.push(s?new Nt(r.name,s,r.id,r.flags):r)}return new qo(t)}}const ka=new WeakMap,cp=new WeakMap;var ht;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(ht||(ht={}));class ut{constructor(e,t,r,s,i){if(this.type=e,this.children=t,this.positions=r,this.length=s,this.props=null,i&&i.length){this.props=Object.create(null);for(let[o,a]of i)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=hi.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let s=r.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new pl(this.topNode,e)}cursorAt(e,t=0,r=0){let s=ka.get(this)||this.topNode,i=new pl(s);return i.moveTo(e,t),ka.set(this,i._tree),i}get topNode(){return new un(this,0,0,null)}resolve(e,t=0){let r=ko(ka.get(this)||this.topNode,e,t,!1);return ka.set(this,r),r}resolveInner(e,t=0){let r=ko(cp.get(this)||this.topNode,e,t,!0);return cp.set(this,r),r}resolveStack(e,t=0){return CP(this,e,t)}iterate(e){let{enter:t,leave:r,from:s=0,to:i=this.length}=e,o=e.mode||0,a=(o&ht.IncludeAnonymous)>0;for(let l=this.cursor(o|ht.IncludeAnonymous);;){let c=!1;if(l.from<=i&&l.to>=s&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:nd(Nt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,s)=>new ut(this.type,t,r,s,this.propValues),e.makeTree||((t,r,s)=>new ut(Nt.none,t,r,s)))}static build(e){return QP(e)}}ut.empty=new ut(Nt.none,[],[],0);class ed{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ed(this.buffer,this.index)}}class ys{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Nt.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],s=this.set.types[t],i=s.name;if(/\W/.test(i)&&!s.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,r,s,i){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(t0(i,s,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let s=this.buffer,i=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){i[l++]=s[a++],i[l++]=s[a++]-r;let c=i[l++]=s[a++]-r;i[l++]=s[a++]-e,o=Math.max(o,c)}return new ys(i,o,this.set)}}function t0(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function ko(n,e,t,r){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof un&&n.index<0?null:n.parent;if(!o)return n;n=o}let i=r?0:ht.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof un&&o.index<0&&((s=a.enter(e,t,i))===null||s===void 0?void 0:s.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,i);if(!o)return n;n=o}}class n0{cursor(e=0){return new pl(this,e)}getChild(e,t=null,r=null){let s=up(this,e,t,r);return s.length?s[0]:null}getChildren(e,t=null,r=null){return up(this,e,t,r)}resolve(e,t=0){return ko(this,e,t,!1)}resolveInner(e,t=0){return ko(this,e,t,!0)}matchContext(e){return Yu(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(r=t,t=s.prevSibling):t=s}return r}get node(){return this}get next(){return this.parent}}class un extends n0{constructor(e,t,r,s){super(),this._tree=e,this.from=t,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,s,i=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],h=l[e]+o.from,f;if(!(!(i&ht.EnterBracketed&&u instanceof ut&&(f=hi.get(u))&&!f.overlay&&f.bracketed&&r>=h&&r<=h+u.length)&&!t0(s,r,h,h+u.length))){if(u instanceof ys){if(i&ht.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,t,r-h,s);if(m>-1)return new Mr(new SP(o,u,e,h),null,m)}else if(i&ht.IncludeAnonymous||!u.type.isAnonymous||td(u)){let m;if(!(i&ht.IgnoreMounts)&&(m=hi.get(u))&&!m.overlay)return new un(m.tree,h,e,o);let g=new un(u,h,e,o);return i&ht.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?u.children.length-1:0,t,r,s,i)}}}if(i&ht.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let s;if(!(r&ht.IgnoreOverlays)&&(s=hi.get(this._tree))&&s.overlay){let i=e-this.from,o=r&ht.EnterBracketed&&s.bracketed;for(let{from:a,to:l}of s.overlay)if((t>0||o?a<=i:a<i)&&(t<0||o?l>=i:l>i))return new un(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function up(n,e,t,r){let s=n.cursor(),i=[];if(!s.firstChild())return i;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function Yu(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class SP{constructor(e,t,r,s){this.parent=e,this.buffer=t,this.index=r,this.start=s}}class Mr extends n0{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,r);return i<0?null:new Mr(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&ht.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new Mr(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Mr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Mr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let o=r.buffer[this.index+1];e.push(r.slice(s,i,o)),t.push(0)}return new ut(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function r0(n){if(!n.length)return null;let e=0,t=n[0];for(let i=1;i<n.length;i++){let o=n[i];(o.from>t.from||o.to<t.to)&&(t=o,e=i)}let r=t instanceof un&&t.index<0?null:t.parent,s=n.slice();return r?s[e]=r:s.splice(e,1),new $P(s,t)}class $P{constructor(e,t){this.heads=e,this.node=t}get next(){return r0(this.heads)}}function CP(n,e,t){let r=n.resolveInner(e,t),s=null;for(let i=r instanceof un?r:r.context.parent;i;i=i.parent)if(i.index<0){let o=i.parent;(s||(s=[r])).push(o.resolve(e,t)),i=o}else{let o=hi.get(i.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new un(o.tree,o.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(ko(a,e,t,!1))}}return s?r0(s):r}class pl{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~ht.EnterBracketed,e instanceof un)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof un?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&ht.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ht.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ht.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(s.buffer.buffer[i+3]<this.index)return!1;({index:t,parent:r}=s)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let i=t+e,o=e<0?-1:r._tree.children.length;i!=o;i+=e){let a=r._tree.children[i];if(this.mode&ht.IncludeAnonymous||a instanceof ys||!a.type.isAnonymous||td(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,r=i+1;break e}s=this.stack[--i]}for(let s=r;s<this.stack.length;s++)t=new Mr(this.buffer,t,this.stack[s]);return this.bufferNode=new Mr(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return Yu(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let s=e.length-1,i=this.stack.length-1;s>=0;i--){if(i<0)return Yu(this._tree,e,s);let o=r[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function td(n){return n.children.some(e=>e instanceof ys||!e.type.isAnonymous||td(e))}function QP(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:s=e0,reused:i=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new ed(t,t.length):t,l=r.types,c=0,u=0;function h(D,K,I,ue,le,oe){let{id:Z,start:X,end:B,size:q}=a,U=u,j=c;if(q<0)if(a.next(),q==-1){let he=i[Z];I.push(he),ue.push(X-D);return}else if(q==-3){c=Z;return}else if(q==-4){u=Z;return}else throw new RangeError(`Unrecognized record size: ${q}`);let N=l[Z],W,ve,te=X-D;if(B-X<=s&&(ve=y(a.pos-K,le))){let he=new Uint16Array(ve.size-ve.skip),C=a.pos-ve.size,w=he.length;for(;a.pos>C;)w=x(ve.start,he,w);W=new ys(he,B-ve.start,r),te=ve.start-D}else{let he=a.pos-q;a.next();let C=[],w=[],_=Z>=o?Z:-1,E=0,z=B;for(;a.pos>he;)_>=0&&a.id==_&&a.size>=0?(a.end<=z-s&&(g(C,w,X,E,a.end,z,_,U,j),E=C.length,z=a.end),a.next()):oe>2500?f(X,he,C,w):h(X,he,C,w,_,oe+1);if(_>=0&&E>0&&E<C.length&&g(C,w,X,E,X,z,_,U,j),C.reverse(),w.reverse(),_>-1&&E>0){let F=m(N,j);W=nd(N,C,w,0,C.length,0,B-X,F,F)}else W=O(N,C,w,B-X,U-B,j)}I.push(W),ue.push(te)}function f(D,K,I,ue){let le=[],oe=0,Z=-1;for(;a.pos>K;){let{id:X,start:B,end:q,size:U}=a;if(U>4)a.next();else{if(Z>-1&&B<Z)break;Z<0&&(Z=q-s),le.push(X,B,q),oe++,a.next()}}if(oe){let X=new Uint16Array(oe*4),B=le[le.length-2];for(let q=le.length-3,U=0;q>=0;q-=3)X[U++]=le[q],X[U++]=le[q+1]-B,X[U++]=le[q+2]-B,X[U++]=U;I.push(new ys(X,le[2]-B,r)),ue.push(B-D)}}function m(D,K){return(I,ue,le)=>{let oe=0,Z=I.length-1,X,B;if(Z>=0&&(X=I[Z])instanceof ut){if(!Z&&X.type==D&&X.length==le)return X;(B=X.prop(Je.lookAhead))&&(oe=ue[Z]+X.length+B)}return O(D,I,ue,le,oe,K)}}function g(D,K,I,ue,le,oe,Z,X,B){let q=[],U=[];for(;D.length>ue;)q.push(D.pop()),U.push(K.pop()+I-le);D.push(O(r.types[Z],q,U,oe-le,X-oe,B)),K.push(le-I)}function O(D,K,I,ue,le,oe,Z){if(oe){let X=[Je.contextHash,oe];Z=Z?[X].concat(Z):[X]}if(le>25){let X=[Je.lookAhead,le];Z=Z?[X].concat(Z):[X]}return new ut(D,K,I,ue,Z)}function y(D,K){let I=a.fork(),ue=0,le=0,oe=0,Z=I.end-s,X={size:0,start:0,skip:0};e:for(let B=I.pos-D;I.pos>B;){let q=I.size;if(I.id==K&&q>=0){X.size=ue,X.start=le,X.skip=oe,oe+=4,ue+=4,I.next();continue}let U=I.pos-q;if(q<0||U<B||I.start<Z)break;let j=I.id>=o?4:0,N=I.start;for(I.next();I.pos>U;){if(I.size<0)if(I.size==-3||I.size==-4)j+=4;else break e;else I.id>=o&&(j+=4);I.next()}le=N,ue+=q,oe+=j}return(K<0||ue==D)&&(X.size=ue,X.start=le,X.skip=oe),X.size>4?X:void 0}function x(D,K,I){let{id:ue,start:le,end:oe,size:Z}=a;if(a.next(),Z>=0&&ue<o){let X=I;if(Z>4){let B=a.pos-(Z-4);for(;a.pos>B;)I=x(D,K,I)}K[--I]=X,K[--I]=oe-D,K[--I]=le-D,K[--I]=ue}else Z==-3?c=ue:Z==-4&&(u=ue);return I}let S=[],Q=[];for(;a.pos>0;)h(n.start||0,n.bufferStart||0,S,Q,-1,0);let T=(e=n.length)!==null&&e!==void 0?e:S.length?Q[0]+S[0].length:0;return new ut(l[n.topID],S.reverse(),Q.reverse(),T)}const hp=new WeakMap;function ja(n,e){if(!n.isAnonymous||e instanceof ys||e.type!=n)return 1;let t=hp.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof ut)){t=1;break}t+=ja(n,r)}hp.set(e,t)}return t}function nd(n,e,t,r,s,i,o,a,l){let c=0;for(let g=r;g<s;g++)c+=ja(n,e[g]);let u=Math.ceil(c*1.5/8),h=[],f=[];function m(g,O,y,x,S){for(let Q=y;Q<x;){let T=Q,D=O[Q],K=ja(n,g[Q]);for(Q++;Q<x;Q++){let I=ja(n,g[Q]);if(K+I>=u)break;K+=I}if(Q==T+1){if(K>u){let I=g[T];m(I.children,I.positions,0,I.children.length,O[T]+S);continue}h.push(g[T])}else{let I=O[Q-1]+g[Q-1].length-D;h.push(nd(n,g,O,T,Q,D,I,null,l))}f.push(D+S-i)}}return m(e,t,r,s,0),(a||l)(h,f,o)}class s0{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof Mr?this.setBuffer(e.context.buffer,e.index,t):e instanceof un&&this.map.set(e.tree,t)}get(e){return e instanceof Mr?this.getBuffer(e.context.buffer,e.index):e instanceof un?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Fr{constructor(e,t,r,s,i=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=s,this.open=(i?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let s=[new Fr(0,e.length,e,0,!1,r)];for(let i of t)i.to>e.length&&s.push(i);return s}static applyChanges(e,t,r=128){if(!t.length)return e;let s=[],i=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,h=u?u.fromA:1e9;if(h-l>=r)for(;o&&o.from<h;){let f=o;if(l>=f.from||h<=f.to||c){let m=Math.max(f.from,l)-c,g=Math.min(f.to,h)-c;f=m>=g?null:new Fr(m,g,f.tree,f.offset+c,a>0,!!u)}if(f&&s.push(f),o.to>h)break;o=i<e.length?e[i++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return s}}class rd{startParse(e,t,r){return typeof e=="string"&&(e=new PP(e)),r=r?r.length?r.map(s=>new qn(s.from,s.to)):[new qn(0,0)]:[new qn(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let s=this.startParse(e,t,r);for(;;){let i=s.advance();if(i)return i}}}class PP{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function i0(n){return(e,t,r,s)=>new MP(e,n,t,r,s)}class dp{constructor(e,t,r,s,i,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=s,this.target=i,this.from=o}}function fp(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class TP{constructor(e,t,r,s,i,o,a,l){this.parser=e,this.predicate=t,this.mounts=r,this.index=s,this.start=i,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const Fu=new Je({perNode:!0});class MP{constructor(e,t,r,s,i){this.nest=t,this.input=r,this.fragments=s,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new ut(r.type,r.children,r.positions,r.length,r.propValues.concat([[Fu,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Je.mounted.id]=new hi(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new RP(this.fragments),t=null,r=null,s=new pl(new un(this.baseTree,this.ranges[0].from,0,null),ht.IncludeAnonymous|ht.IgnoreMounts);e:for(let i,o;;){let a=!0,l;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)a=!1;else if(e.hasNode(s)){if(t){let c=t.mounts.find(u=>u.frag.from<=s.from&&u.frag.to>=s.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,f=u.to+c.pos;h>=s.from&&f<=s.to&&!t.ranges.some(m=>m.from<f&&m.to>h)&&t.ranges.push({from:h,to:f})}}a=!1}else if(r&&(o=AP(r.ranges,s.from,s.to)))a=o!=2;else if(!s.type.isAnonymous&&(i=this.nest(s,this.input))&&(s.from<s.to||!i.overlay)){s.tree||(_P(s),t&&t.depth++,r&&r.depth++);let c=e.findMounts(s.from,i.parser);if(typeof i.overlay=="function")t=new TP(i.parser,i.overlay,c,this.inner.length,s.from,!!i.bracketed,s.tree,t);else{let u=gp(this.ranges,i.overlay||(s.from<s.to?[new qn(s.from,s.to)]:[]));u.length&&fp(u),(u.length||!i.overlay)&&this.inner.push(new dp(i.parser,u.length?i.parser.startParse(this.input,Op(c,u),u):i.parser.startParse(""),i.overlay?i.overlay.map(h=>new qn(h.from-s.from,h.to-s.from)):null,!!i.bracketed,s.tree,u.length?u[0].from:s.from)),i.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(s))&&(l===!0&&(l=new qn(s.from,s.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&s.firstChild())t&&t.depth++,r&&r.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let c=gp(this.ranges,t.ranges);c.length&&(fp(c),this.inner.splice(t.index,0,new dp(t.parser,t.parser.startParse(this.input,Op(t.mounts,c),c),t.ranges.map(u=>new qn(u.from-t.start,u.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function AP(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function pp(n,e,t,r,s,i){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),s.push(o-i)}}function _P(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let s=n.tree,i=s.children.indexOf(r),o=s.children[i],a=o.buffer,l=[i];function c(u,h,f,m,g,O){let y=t[O],x=[],S=[];pp(o,u,y,x,S,m);let Q=a[y+1],T=a[y+2];l.push(x.length);let D=O?c(y+4,a[y+3],o.set.types[a[y]],Q,T-Q,O-1):e.toTree();return x.push(D),S.push(Q-m),pp(o,a[y+3],h,x,S,m),new ut(f,x,S,g)}s.children[i]=c(0,a.length,Nt.none,0,o.length,t.length-1);for(let u of l){let h=n.tree.children[u],f=n.tree.positions[u];n.yield(new un(h,f+n.from,u,n._tree))}}class mp{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(ht.IncludeAnonymous|ht.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,ht.IgnoreOverlays|ht.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ut)t=t.children[0];else break}return!1}}let RP=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(Fu))!==null&&t!==void 0?t:r.to,this.inner=new mp(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Fu))!==null&&e!==void 0?e:t.to,this.inner=new mp(t.tree,-t.offset)}}findMounts(e,t){var r;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let i=this.inner.cursor.node;i;i=i.parent){let o=(r=i.tree)===null||r===void 0?void 0:r.prop(Je.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=i.to)break;l.tree==this.curFrag.tree&&s.push({frag:l,pos:i.from-l.offset,mount:o})}}}return s}};function gp(n,e){let t=null,r=e;for(let s=1,i=0;s<n.length;s++){let o=n[s-1].to,a=n[s].from;for(;i<r.length;i++){let l=r[i];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[i]=new qn(l.from,o),l.to>a&&t.splice(i+1,0,new qn(a,l.to))):l.to>a?t[i--]=new qn(a,l.to):t.splice(i--,1))}}return r}function EP(n,e,t,r){let s=0,i=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=s==n.length?1e9:o?n[s].to:n[s].from,h=i==e.length?1e9:a?e[i].to:e[i].from;if(o!=a){let f=Math.max(l,t),m=Math.min(u,h,r);f<m&&c.push(new qn(f,m))}if(l=Math.min(u,h),l==1e9)break;u==l&&(o?(o=!1,s++):o=!0),h==l&&(a?(a=!1,i++):a=!0)}return c}function Op(n,e){let t=[];for(let{pos:r,mount:s,frag:i}of n){let o=r+(s.overlay?s.overlay[0].from:0),a=o+s.tree.length,l=Math.max(i.from,o),c=Math.min(i.to,a);if(s.overlay){let u=s.overlay.map(f=>new qn(f.from+r,f.to+r)),h=EP(e,u,l,c);for(let f=0,m=l;;f++){let g=f==h.length,O=g?c:h[f].from;if(O>m&&t.push(new Fr(m,O,s.tree,-o,i.from>=m||i.openStart,i.to<=O||i.openEnd)),g)break;m=h[f].to}}else t.push(new Fr(l,c,s.tree,-o,i.from>=o||i.openStart,i.to<=a||i.openEnd))}return t}let BP=0;class Ln{constructor(e,t,r,s){this.name=e,this.set=t,this.base=r,this.modified=s,this.id=BP++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Ln&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new Ln(r,[],null,[]);if(s.set.push(s),t)for(let i of t.set)s.set.push(i);return s}static defineModifier(e){let t=new ml(e);return r=>r.modified.indexOf(t)>-1?r:ml.get(r.base||r,r.modified.concat(t).sort((s,i)=>s.id-i.id))}}let LP=0;class ml{constructor(e){this.name=e,this.instances=[],this.id=LP++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&DP(t,a.modified));if(r)return r;let s=[],i=new Ln(e.name,s,e,t);for(let a of t)a.instances.push(i);let o=ZP(t);for(let a of e.set)if(!a.modified.length)for(let l of o)s.push(ml.get(a,l));return i}}function DP(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function ZP(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function Ai(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let s of t.split(" "))if(s){let i=[],o=2,a=s;for(let h=0;;){if(a=="..."&&h>0&&h+3==s.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+s);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==s.length)break;let m=s[h++];if(h==s.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+s);a=s.slice(h)}let l=i.length-1,c=i[l];if(!c)throw new RangeError("Invalid path: "+s);let u=new wo(r,o,l>0?i.slice(0,l):null);e[c]=u.sort(e[c])}}return o0.add(e)}const o0=new Je({combine(n,e){let t,r,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let i=new wo(s.tags,s.mode,s.context);t?t.next=i:r=i,t=i}return r}});class wo{constructor(e,t,r,s){this.tags=e,this.mode=t,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}wo.empty=new wo([],2,null);function a0(n,e){let t=Object.create(null);for(let i of n)if(!Array.isArray(i.tag))t[i.tag.id]=i.class;else for(let o of i.tag)t[o.id]=i.class;let{scope:r,all:s=null}=e||{};return{style:i=>{let o=s;for(let a of i)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function IP(n,e){let t=null;for(let r of n){let s=r.style(e);s&&(t=t?t+" "+s:s)}return t}function XP(n,e,t,r=0,s=n.length){let i=new zP(r,Array.isArray(e)?e:[e],t);i.highlightRange(n.cursor(),r,s,"",i.highlighters),i.flush(s)}class zP{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,s,i){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(i=this.highlighters.filter(m=>!m.scope||m.scope(o)));let c=s,u=NP(e)||wo.empty,h=IP(i,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(s+=(s?" ":"")+h)),this.startSpan(Math.max(t,a),c),u.opaque)return;let f=e.tree&&e.tree.prop(Je.mounted);if(f&&f.overlay){let m=e.node.enter(f.overlay[0].from+a,1),g=this.highlighters.filter(y=>!y.scope||y.scope(f.tree.type)),O=e.firstChild();for(let y=0,x=a;;y++){let S=y<f.overlay.length?f.overlay[y]:null,Q=S?S.from+a:l,T=Math.max(t,x),D=Math.min(r,Q);if(T<D&&O)for(;e.from<D&&(this.highlightRange(e,T,D,s,i),this.startSpan(Math.min(D,e.to),c),!(e.to>=Q||!e.nextSibling())););if(!S||Q>r)break;x=S.to+a,x>t&&(this.highlightRange(m.cursor(),Math.max(t,S.from+a),Math.min(r,x),"",g),this.startSpan(Math.min(r,x),c))}O&&e.parent()}else if(e.firstChild()){f&&(s="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,s,i),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function NP(n){let e=n.type.prop(o0);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Se=Ln.define,wa=Se(),hs=Se(),vp=Se(hs),bp=Se(hs),ds=Se(),Sa=Se(ds),Tc=Se(ds),$r=Se(),As=Se($r),yr=Se(),kr=Se(),Uu=Se(),Yi=Se(Uu),$a=Se(),P={comment:wa,lineComment:Se(wa),blockComment:Se(wa),docComment:Se(wa),name:hs,variableName:Se(hs),typeName:vp,tagName:Se(vp),propertyName:bp,attributeName:Se(bp),className:Se(hs),labelName:Se(hs),namespace:Se(hs),macroName:Se(hs),literal:ds,string:Sa,docString:Se(Sa),character:Se(Sa),attributeValue:Se(Sa),number:Tc,integer:Se(Tc),float:Se(Tc),bool:Se(ds),regexp:Se(ds),escape:Se(ds),color:Se(ds),url:Se(ds),keyword:yr,self:Se(yr),null:Se(yr),atom:Se(yr),unit:Se(yr),modifier:Se(yr),operatorKeyword:Se(yr),controlKeyword:Se(yr),definitionKeyword:Se(yr),moduleKeyword:Se(yr),operator:kr,derefOperator:Se(kr),arithmeticOperator:Se(kr),logicOperator:Se(kr),bitwiseOperator:Se(kr),compareOperator:Se(kr),updateOperator:Se(kr),definitionOperator:Se(kr),typeOperator:Se(kr),controlOperator:Se(kr),punctuation:Uu,separator:Se(Uu),bracket:Yi,angleBracket:Se(Yi),squareBracket:Se(Yi),paren:Se(Yi),brace:Se(Yi),content:$r,heading:As,heading1:Se(As),heading2:Se(As),heading3:Se(As),heading4:Se(As),heading5:Se(As),heading6:Se(As),contentSeparator:Se($r),list:Se($r),quote:Se($r),emphasis:Se($r),strong:Se($r),link:Se($r),monospace:Se($r),strikethrough:Se($r),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:$a,documentMeta:Se($a),annotation:Se($a),processingInstruction:Se($a),definition:Ln.defineModifier("definition"),constant:Ln.defineModifier("constant"),function:Ln.defineModifier("function"),standard:Ln.defineModifier("standard"),local:Ln.defineModifier("local"),special:Ln.defineModifier("special")};for(let n in P){let e=P[n];e instanceof Ln&&(e.name=n)}a0([{tag:P.link,class:"tok-link"},{tag:P.heading,class:"tok-heading"},{tag:P.emphasis,class:"tok-emphasis"},{tag:P.strong,class:"tok-strong"},{tag:P.keyword,class:"tok-keyword"},{tag:P.atom,class:"tok-atom"},{tag:P.bool,class:"tok-bool"},{tag:P.url,class:"tok-url"},{tag:P.labelName,class:"tok-labelName"},{tag:P.inserted,class:"tok-inserted"},{tag:P.deleted,class:"tok-deleted"},{tag:P.literal,class:"tok-literal"},{tag:P.string,class:"tok-string"},{tag:P.number,class:"tok-number"},{tag:[P.regexp,P.escape,P.special(P.string)],class:"tok-string2"},{tag:P.variableName,class:"tok-variableName"},{tag:P.local(P.variableName),class:"tok-variableName tok-local"},{tag:P.definition(P.variableName),class:"tok-variableName tok-definition"},{tag:P.special(P.variableName),class:"tok-variableName2"},{tag:P.definition(P.propertyName),class:"tok-propertyName tok-definition"},{tag:P.typeName,class:"tok-typeName"},{tag:P.namespace,class:"tok-namespace"},{tag:P.className,class:"tok-className"},{tag:P.macroName,class:"tok-macroName"},{tag:P.propertyName,class:"tok-propertyName"},{tag:P.operator,class:"tok-operator"},{tag:P.comment,class:"tok-comment"},{tag:P.meta,class:"tok-meta"},{tag:P.invalid,class:"tok-invalid"},{tag:P.punctuation,class:"tok-punctuation"}]);var Mc;const Is=new Je;function sd(n){return Me.define({combine:n?e=>e.concat(n):void 0})}const id=new Je;class Yn{constructor(e,t,r=[],s=""){this.data=e,this.name=s,st.prototype.hasOwnProperty("tree")||Object.defineProperty(st.prototype,"tree",{get(){return yt(this)}}),this.parser=t,this.extension=[ks.of(this),st.languageData.of((i,o,a)=>{let l=xp(i,o,a),c=l.type.prop(Is);if(!c)return[];let u=i.facet(c),h=l.type.prop(id);if(h){let f=l.resolve(o-l.from,a);for(let m of h)if(m.test(f,i)){let g=i.facet(m.facet);return m.type=="replace"?g:g.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return xp(e,t,r).type.prop(Is)==this.data}findRegions(e){let t=e.facet(ks);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],s=(i,o)=>{if(i.prop(Is)==this.data){r.push({from:o,to:o+i.length});return}let a=i.prop(Je.mounted);if(a){if(a.tree.prop(Is)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+i.length});return}else if(a.overlay){let l=r.length;if(s(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<i.children.length;l++){let c=i.children[l];c instanceof ut&&s(c,i.positions[l]+o)}};return s(yt(e),0),r}get allowsNesting(){return!0}}Yn.setState=Ke.define();function xp(n,e,t){let r=n.facet(ks),s=yt(n).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,t,ht.ExcludeBuffers|ht.EnterBracketed))i.type.isTop&&(s=i);return s}class wi extends Yn{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=sd(e.languageData);return new wi(t,e.parser.configure({props:[Is.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new wi(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yt(n){let e=n.field(Yn.state,!1);return e?e.tree:ut.empty}class VP{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Fi=null;class So{constructor(e,t,r=[],s,i,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new So(e,t,[],ut.empty,0,r,[],null)}startParse(){return this.parser.startParse(new VP(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ut.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Fr.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Fr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Fi;Fi=this;try{return e()}finally{Fi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=yp(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:s,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,h,f)=>l.push({fromA:c,toA:u,fromB:h,toB:f})),r=Fr.applyChanges(r,l),s=ut.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&a.push({from:u,to:h})}}}return new So(this.parser,t,r,s,i,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=yp(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends rd{createParse(t,r,s){let i=s[0].from,o=s[s.length-1].to;return{parsedPos:i,advance(){let l=Fi;if(l){for(let c of s)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new ut(Nt.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Fi}}function yp(n,e,t){return Fr.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Si{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new Si(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=So.create(e.facet(ks).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Si(r)}}Yn.state=Ft.define({create:Si.init,update(n,e){for(let t of e.effects)if(t.is(Yn.setState))return t.value;return e.startState.facet(ks)!=e.state.facet(ks)?Si.init(e.state):n.apply(e)}});let l0=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(l0=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Ac=typeof navigator<"u"&&(!((Mc=navigator.scheduling)===null||Mc===void 0)&&Mc.isInputPending)?()=>navigator.scheduling.isInputPending():null,WP=_t.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Yn.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Yn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=l0(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(Yn.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Ac?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<s&&r.doc.length>s+1e3,l=i.context.work(()=>Ac&&Ac()||Date.now()>o,s+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Yn.setState.of(new Si(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>$n(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ks=Me.define({combine(n){return n.length?n[0]:null},enables:n=>[Yn.state,WP,$e.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class $o{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class gl{constructor(e,t,r,s,i,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=s,this.loadFunc=i,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new gl(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let s of e)if(s.filename&&s.filename.test(t))return s;let r=/\.([^.]+)$/.exec(t);if(r){for(let s of e)if(s.extensions.indexOf(r[1])>-1)return s}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let s of e)if(s.alias.some(i=>i==t))return s;if(r)for(let s of e)for(let i of s.alias){let o=t.indexOf(i);if(o>-1&&(i.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+i.length])))return s}return null}}const jP=Me.define(),Yo=Me.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ol(n){let e=n.facet(Yo);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Co(n,e){let t="",r=n.tabSize,s=n.facet(Yo)[0];if(s==" "){for(;e>=r;)t+=" ",e-=r;s=" "}for(let i=0;i<e;i++)t+=s;return t}function od(n,e){n instanceof st&&(n=new Hl(n));for(let r of n.state.facet(jP)){let s=r(n,e);if(s!==void 0)return s}let t=yt(n.state);return t.length>=e?qP(n,t,e):null}class Hl{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ol(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,t);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.countColumn(r,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,t=e.length){return ur(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let o=i(s);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Fo=new Je;function qP(n,e,t){let r=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=r.node){let i=[];for(let o=s;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)i.push(o);for(let o=i.length-1;o>=0;o--)r={node:i[o],next:r}}return c0(r,n,t)}function c0(n,e,t){for(let r=n;r;r=r.next){let s=FP(r.node);if(s)return s(ad.create(e,t,r))}return 0}function YP(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function FP(n){let e=n.type.prop(Fo);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(Je.closedBy))){let s=n.lastChild,i=s&&r.indexOf(s.name)>-1;return o=>u0(o,!0,1,void 0,i&&!YP(o)?s.from:void 0)}return n.parent==null?UP:null}function UP(){return 0}class ad extends Hl{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new ad(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(GP(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return c0(this.context.next,this.base,this.pos)}}function GP(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function HP(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,i=n.state.doc.lineAt(t.from),o=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(i.text.slice(t.to-i.from))[0].length;return{from:t.from,to:t.to+c}}a=l.to}}function KP({closing:n,align:e=!0,units:t=1}){return r=>u0(r,e,t,n)}function u0(n,e,t,r,s){let i=n.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==n.pos+o,l=e?HP(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const JP=n=>n.baseIndent;function qa({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const eT=200;function tT(){return st.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,s=t.lineAt(r);if(r>s.from+eT)return n;let i=t.sliceString(s.from,r);if(!e.some(c=>c.test(i)))return n;let{state:o}=n,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let h=od(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],m=Co(o,h);f!=m&&l.push({from:u.from,to:u.from+f.length,insert:m})}return l.length?[n,{changes:l,sequential:!0}]:n})}const h0=Me.define(),_i=new Je;function d0(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function nT(n,e,t){let r=yt(n);if(r.length<t)return null;let s=r.resolveStack(t,1),i=null;for(let o=s;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(i&&a.from<e)break;let l=a.type.prop(_i);if(l&&(a.to<r.length-50||r.length==n.doc.length||!rT(a))){let c=l(a,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(i=c)}}return i}function rT(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function vl(n,e,t){for(let r of n.facet(h0)){let s=r(n,e,t);if(s)return s}return nT(n,e,t)}function f0(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const Kl=Ke.define({map:f0}),Uo=Ke.define({map:f0});function p0(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const Gs=Ft.define({create(){return Ve.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,r)=>n=kp(n,t,r)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Kl)&&!sT(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(O0),s=r?Ve.replace({widget:new hT(r(e.state,t.value))}):wp;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(Uo)&&(n=n.update({filter:(r,s)=>t.value.from!=r||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=kp(n,e.selection.main.head)),n},provide:n=>$e.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,s)=>{t.push(r,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],s=n[t++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(wp.range(r,s))}return Ve.set(e,!0)}});function kp(n,e,t=e){let r=!1;return n.between(e,t,(s,i)=>{s<t&&i>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(s,i)=>s>=t||i<=e}):n}function bl(n,e,t){var r;let s=null;return(r=n.field(Gs,!1))===null||r===void 0||r.between(e,t,(i,o)=>{(!s||s.from>i)&&(s={from:i,to:o})}),s}function sT(n,e,t){let r=!1;return n.between(e,e,(s,i)=>{s==e&&i==t&&(r=!0)}),r}function m0(n,e){return n.field(Gs,!1)?e:e.concat(Ke.appendConfig.of(v0()))}const iT=n=>{for(let e of p0(n)){let t=vl(n.state,e.from,e.to);if(t)return n.dispatch({effects:m0(n.state,[Kl.of(t),g0(n,t)])}),!0}return!1},oT=n=>{if(!n.state.field(Gs,!1))return!1;let e=[];for(let t of p0(n)){let r=bl(n.state,t.from,t.to);r&&e.push(Uo.of(r),g0(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function g0(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return $e.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${s}.`)}const aT=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let s=n.lineBlockAt(r),i=vl(e,s.from,s.to);i&&t.push(Kl.of(i)),r=(i?n.lineBlockAt(i.to):s).to+1}return t.length&&n.dispatch({effects:m0(n.state,t)}),!!t.length},lT=n=>{let e=n.state.field(Gs,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,s)=>{t.push(Uo.of({from:r,to:s}))}),n.dispatch({effects:t}),!0},cT=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:iT},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:oT},{key:"Ctrl-Alt-[",run:aT},{key:"Ctrl-Alt-]",run:lT}],uT={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},O0=Me.define({combine(n){return Br(n,uT)}});function v0(n){return[Gs,pT]}function b0(n,e){let{state:t}=n,r=t.facet(O0),s=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=bl(n.state,a.from,a.to);l&&n.dispatch({effects:Uo.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",t.phrase("folded code")),i.title=t.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const wp=Ve.replace({widget:new class extends Lr{toDOM(n){return b0(n,null)}}});class hT extends Lr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return b0(e,this.value)}}const dT={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class _c extends Jr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function fT(n={}){let e={...dT,...n},t=new _c(e,!0),r=new _c(e,!1),s=_t.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ks)!=o.state.facet(ks)||o.startState.field(Gs,!1)!=o.state.field(Gs,!1)||yt(o.startState)!=yt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new Hr;for(let l of o.viewportLineBlocks){let c=bl(o.state,l.from,l.to)?r:vl(o.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:i}=e;return[s,hP({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(s))===null||a===void 0?void 0:a.markers)||rt.empty},initialSpacer(){return new _c(e,!1)},domEventHandlers:{...i,click:(o,a,l)=>{if(i.click&&i.click(o,a,l))return!0;let c=bl(o.state,a.from,a.to);if(c)return o.dispatch({effects:Uo.of(c)}),!0;let u=vl(o.state,a.from,a.to);return u?(o.dispatch({effects:Kl.of(u)}),!0):!1}}}),v0()]}const pT=$e.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Go{constructor(e,t){this.specs=e;let r;function s(a){let l=vs.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const i=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Yn?a=>a.prop(Is)==o.data:o?a=>a==o:void 0,this.style=a0(e.map(a=>({tag:a.tag,class:a.class||s(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=r?new vs(r):null,this.themeType=t.themeType}static define(e,t){return new Go(e,t||{})}}const Gu=Me.define(),x0=Me.define({combine(n){return n.length?[n[0]]:null}});function Rc(n){let e=n.facet(Gu);return e.length?e:n.facet(x0)}function y0(n,e){let t=[gT],r;return n instanceof Go&&(n.module&&t.push($e.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(x0.of(n)):r?t.push(Gu.computeN([$e.darkTheme],s=>s.facet($e.darkTheme)==(r=="dark")?[n]:[])):t.push(Gu.of(n)),t}class mT{constructor(e){this.markCache=Object.create(null),this.tree=yt(e.state),this.decorations=this.buildDeco(e,Rc(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=yt(e.state),r=Rc(e.state),s=r!=Rc(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!s&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ve.none;let r=new Hr;for(let{from:s,to:i}of e.visibleRanges)XP(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=Ve.mark({class:l})))},s,i);return r.finish()}}const gT=es.high(_t.fromClass(mT,{decorations:n=>n.decorations})),OT=Go.define([{tag:P.meta,color:"#404740"},{tag:P.link,textDecoration:"underline"},{tag:P.heading,textDecoration:"underline",fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strong,fontWeight:"bold"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.keyword,color:"#708"},{tag:[P.atom,P.bool,P.url,P.contentSeparator,P.labelName],color:"#219"},{tag:[P.literal,P.inserted],color:"#164"},{tag:[P.string,P.deleted],color:"#a11"},{tag:[P.regexp,P.escape,P.special(P.string)],color:"#e40"},{tag:P.definition(P.variableName),color:"#00f"},{tag:P.local(P.variableName),color:"#30a"},{tag:[P.typeName,P.namespace],color:"#085"},{tag:P.className,color:"#167"},{tag:[P.special(P.variableName),P.macroName],color:"#256"},{tag:P.definition(P.propertyName),color:"#00c"},{tag:P.comment,color:"#940"},{tag:P.invalid,color:"#f00"}]),vT=$e.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),k0=1e4,w0="()[]{}",S0=Me.define({combine(n){return Br(n,{afterCursor:!0,brackets:w0,maxScanDistance:k0,renderMatch:yT})}}),bT=Ve.mark({class:"cm-matchingBracket"}),xT=Ve.mark({class:"cm-nonmatchingBracket"});function yT(n){let e=[],t=n.matched?bT:xT;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function Sp(n){let e=[],t=n.facet(S0);for(let r of n.selection.ranges){if(!r.empty)continue;let s=Ar(n,r.head,-1,t)||r.head>0&&Ar(n,r.head-1,1,t)||t.afterCursor&&(Ar(n,r.head,1,t)||r.head<n.doc.length&&Ar(n,r.head+1,-1,t));s&&(e=e.concat(t.renderMatch(s,n)))}return Ve.set(e,!0)}const kT=_t.fromClass(class{constructor(n){this.paused=!1,this.decorations=Sp(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=Sp(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),wT=[kT,vT];function ST(n={}){return[S0.of(n),wT]}const $0=new Je;function Hu(n,e,t){let r=n.prop(e<0?Je.openedBy:Je.closedBy);if(r)return r;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Ku(n){let e=n.type.prop($0);return e?e(n.node):n}function Ar(n,e,t,r={}){let s=r.maxScanDistance||k0,i=r.brackets||w0,o=yt(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=Hu(l.type,t,i);if(c&&l.from<l.to){let u=Ku(l);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return $T(n,e,t,l,u,c,i)}}return CT(n,e,t,o,a.type,s,i)}function $T(n,e,t,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},c=0,u=a?.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&i.indexOf(u.type.name)>-1&&u.from<u.to){let h=Ku(u);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Hu(u.type,t,o))c++;else if(Hu(u.type,-t,o)){if(c==0){let h=Ku(u);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function CT(n,e,t,r,s,i,o){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=i;){let m=u.value;t<0&&(f+=m.length);let g=e+f*t;for(let O=t>0?0:m.length-1,y=t>0?m.length:-1;O!=y;O+=t){let x=o.indexOf(m[O]);if(!(x<0||r.resolveInner(g+O,1).type!=s))if(x%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:g+O,to:g+O+1},matched:x>>1==l>>1};h--}}t>0&&(f+=m.length)}return u.done?{start:c,matched:!1}:null}const QT=Object.create(null),$p=[Nt.none],Cp=[],Qp=Object.create(null),PT=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])PT[n]=TT(QT,e);function Ec(n,e){Cp.indexOf(n)>-1||(Cp.push(n),console.warn(e))}function TT(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||P[c];u?typeof u=="function"?l.length?l=l.map(u):Ec(c,`Modifier ${c} used at start of tag`):l.length?Ec(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Ec(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+t.map(a=>a.id),i=Qp[s];if(i)return i.id;let o=Qp[s]=Nt.define({id:$p.length,name:r,props:[Ai({[r]:t})]});return $p.push(o),o.id}xt.RTL,xt.LTR;const MT=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=cd(n.state,t.from);return r.line?AT(n):r.block?RT(n):!1};function ld(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(r(t.update(s)),!0):!1}}const AT=ld(LT,0),_T=ld(C0,0),RT=ld((n,e)=>C0(n,e,BT(e)),0);function cd(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ui=50;function ET(n,{open:e,close:t},r,s){let i=n.sliceDoc(r-Ui,r),o=n.sliceDoc(s,s+Ui),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(o)[0].length,c=i.length-a;if(i.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:s+l,margin:l&&1}};let u,h;s-r<=2*Ui?u=h=n.sliceDoc(r,s):(u=n.sliceDoc(r,r+Ui),h=n.sliceDoc(s-Ui,s));let f=/^\s*/.exec(u)[0].length,m=/\s*$/.exec(h)[0].length,g=h.length-m-t.length;return u.slice(f,f+e.length)==e&&h.slice(g,g+t.length)==t?{open:{pos:r+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:s-m-t.length,margin:/\s/.test(h.charAt(g-1))?1:0}}:null}function BT(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),s=t.to<=r.to?r:n.doc.lineAt(t.to);s.from>r.from&&s.from==t.to&&(s=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function C0(n,e,t=e.selection.ranges){let r=t.map(i=>cd(e,i.from).block);if(!r.every(i=>i))return null;let s=t.map((i,o)=>ET(e,r[o],i.from,i.to));if(n!=2&&!s.every(i=>i))return{changes:e.changes(t.map((i,o)=>s[o]?[]:[{from:i.from,insert:r[o].open+" "},{from:i.to,insert:" "+r[o].close}]))};if(n!=1&&s.some(i=>i)){let i=[];for(let o=0,a;o<s.length;o++)if(a=s[o]){let l=r[o],{open:c,close:u}=a;i.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:i}}return null}function LT(n,e,t=e.selection.ranges){let r=[],s=-1;e:for(let{from:i,to:o}of t){let a=r.length,l=1e9,c;for(let u=i;u<=o;){let h=e.doc.lineAt(u);if(c==null&&(c=cd(e,h.from).line,!c))continue e;if(h.from>s&&(i==o||o>h.from)){s=h.from;let f=/^\s*/.exec(h.text)[0].length,m=f==h.length,g=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:g,token:c,indent:f,empty:m,single:!1})}u=h.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}if(n!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:c,empty:u,single:h}of r)(h||!u)&&i.push({from:a.from+c,insert:l+" "});let o=e.changes(i);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,i.push({from:c,to:u})}return{changes:i}}return null}const Ju=ts.define(),DT=ts.define(),ZT=Me.define(),Q0=Me.define({combine(n){return Br(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,s)=>e(r,s)||t(r,s)})}}),P0=Ft.define({create(){return _r.empty},update(n,e){let t=e.state.facet(Q0),r=e.annotation(Ju);if(r){let l=Cn.fromTransaction(e,r.selection),c=r.side,u=c==0?n.undone:n.done;return l?u=xl(u,u.length,t.minDepth,l):u=A0(u,e.startState.selection),new _r(c==0?r.rest:u,c==0?u:r.rest)}let s=e.annotation(DT);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Et.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let i=Cn.fromTransaction(e),o=e.annotation(Et.time),a=e.annotation(Et.userEvent);return i?n=n.addChanges(i,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new _r(n.done.map(Cn.fromJSON),n.undone.map(Cn.fromJSON))}});function IT(n={}){return[P0,Q0.of(n),$e.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?T0:e.inputType=="historyRedo"?eh:null;return r?(e.preventDefault(),r(t)):!1}})]}function Jl(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let s=t.field(P0,!1);if(!s)return!1;let i=s.pop(n,t,e);return i?(r(i),!0):!1}}const T0=Jl(0,!1),eh=Jl(1,!1),XT=Jl(0,!0),zT=Jl(1,!0);class Cn{constructor(e,t,r,s,i){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new Cn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Cn(e.changes&&Xt.fromJSON(e.changes),[],e.mapped&&Rr.fromJSON(e.mapped),e.startSelection&&ae.fromJSON(e.startSelection),e.selectionsAfter.map(ae.fromJSON))}static fromTransaction(e,t){let r=Fn;for(let s of e.startState.facet(ZT)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new Cn(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Fn)}static selection(e){return new Cn(void 0,Fn,void 0,void 0,e)}}function xl(n,e,t,r){let s=e+1>t+20?e-t-1:0,i=n.slice(s,e);return i.push(r),i}function NT(n,e){let t=[],r=!1;return n.iterChangedRanges((s,i)=>t.push(s,i)),e.iterChangedRanges((s,i,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],u=t[l++];a>=c&&o<=u&&(r=!0)}}),r}function VT(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function M0(n,e){return n.length?e.length?n.concat(e):n:e}const Fn=[],WT=200;function A0(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-WT));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),xl(n,n.length-1,1e9,t.setSelAfter(r)))}else return[Cn.selection([e])]}function jT(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Bc(n,e){if(!n.length)return n;let t=n.length,r=Fn;for(;t;){let s=qT(n[t-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=n.slice(0,t);return i[t-1]=s,i}else e=s.mapped,t--,r=s.selectionsAfter}return r.length?[Cn.selection(r)]:Fn}function qT(n,e,t){let r=M0(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Fn,t);if(!n.changes)return Cn.selection(r);let s=n.changes.map(e),i=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(i):i;return new Cn(s,Ke.mapEffects(n.effects,e),o,n.startSelection.map(i),r)}const YT=/^(input\.type|delete)($|\.)/;class _r{constructor(e,t,r=0,s=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new _r(this.done,this.undone):this}addChanges(e,t,r,s,i){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||YT.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,NT(a.changes,e.changes))||r=="input.type.compose")?o=xl(o,o.length-1,s.minDepth,new Cn(e.changes.compose(a.changes),M0(Ke.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Fn)):o=xl(o,o.length,s.minDepth,e),new _r(o,Fn,t,r)}addSelection(e,t,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Fn;return i.length>0&&t-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&VT(i[i.length-1],e)?this:new _r(A0(this.done,e),this.undone,t,r)}addMapping(e){return new _r(Bc(this.done,e),Bc(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],o=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(r&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Ju.of({side:e,rest:jT(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=s.length==1?Fn:s.slice(0,s.length-1);return i.mapped&&(a=Bc(a,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Ju.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}_r.empty=new _r(Fn,Fn);const FT=[{key:"Mod-z",run:T0,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:eh,preventDefault:!0},{linux:"Ctrl-Shift-z",run:eh,preventDefault:!0},{key:"Mod-u",run:XT,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:zT,preventDefault:!0}];function Ri(n,e){return ae.create(n.ranges.map(e),n.mainIndex)}function dr(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function fr({state:n,dispatch:e},t){let r=Ri(n.selection,t);return r.eq(n.selection,!0)?!1:(e(dr(n,r)),!0)}function ec(n,e){return ae.cursor(e?n.to:n.from)}function _0(n,e){return fr(n,t=>t.empty?n.moveByChar(t,e):ec(t,e))}function hn(n){return n.textDirectionAt(n.state.selection.main.head)==xt.LTR}const R0=n=>_0(n,!hn(n)),E0=n=>_0(n,hn(n));function B0(n,e){return fr(n,t=>t.empty?n.moveByGroup(t,e):ec(t,e))}const UT=n=>B0(n,!hn(n)),GT=n=>B0(n,hn(n));function HT(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function tc(n,e,t){let r=yt(n).resolveInner(e.head),s=t?Je.closedBy:Je.openedBy;for(let l=e.head;;){let c=t?r.childAfter(l):r.childBefore(l);if(!c)break;HT(n,c,s)?r=c:l=t?c.to:c.from}let i=r.type.prop(s),o,a;return i&&(o=t?Ar(n,r.from,1):Ar(n,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,ae.cursor(a,t?-1:1)}const KT=n=>fr(n,e=>tc(n.state,e,!hn(n))),JT=n=>fr(n,e=>tc(n.state,e,hn(n)));function L0(n,e){return fr(n,t=>{if(!t.empty)return ec(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const D0=n=>L0(n,!1),Z0=n=>L0(n,!0);function I0(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,s;if(e){for(let i of n.state.facet($e.scrollMargins)){let o=i(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(r=Math.max(o?.bottom,r))}s=n.scrollDOM.clientHeight-t-r}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function X0(n,e){let t=I0(n),{state:r}=n,s=Ri(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):ec(o,e));if(s.eq(r.selection))return!1;let i;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(i=$e.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-l}))}return n.dispatch(dr(r,s),{effects:i}),!0}const Pp=n=>X0(n,!1),th=n=>X0(n,!0);function Ss(n,e,t){let r=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?r.to:r.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==r.from&&r.length){let i=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=ae.cursor(r.from+i))}return s}const e3=n=>fr(n,e=>Ss(n,e,!0)),t3=n=>fr(n,e=>Ss(n,e,!1)),n3=n=>fr(n,e=>Ss(n,e,!hn(n))),r3=n=>fr(n,e=>Ss(n,e,hn(n))),s3=n=>fr(n,e=>ae.cursor(n.lineBlockAt(e.head).from,1)),i3=n=>fr(n,e=>ae.cursor(n.lineBlockAt(e.head).to,-1));function o3(n,e,t){let r=!1,s=Ri(n.selection,i=>{let o=Ar(n,i.head,-1)||Ar(n,i.head,1)||i.head>0&&Ar(n,i.head-1,1)||i.head<n.doc.length&&Ar(n,i.head+1,-1);if(!o||!o.end)return i;r=!0;let a=o.start.from==i.head?o.end.to:o.end.from;return ae.cursor(a)});return r?(e(dr(n,s)),!0):!1}const a3=({state:n,dispatch:e})=>o3(n,e);function er(n,e){let t=Ri(n.state.selection,r=>{let s=e(r);return ae.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(dr(n.state,t)),!0)}function z0(n,e){return er(n,t=>n.moveByChar(t,e))}const N0=n=>z0(n,!hn(n)),V0=n=>z0(n,hn(n));function W0(n,e){return er(n,t=>n.moveByGroup(t,e))}const l3=n=>W0(n,!hn(n)),c3=n=>W0(n,hn(n)),u3=n=>er(n,e=>tc(n.state,e,!hn(n))),h3=n=>er(n,e=>tc(n.state,e,hn(n)));function j0(n,e){return er(n,t=>n.moveVertically(t,e))}const q0=n=>j0(n,!1),Y0=n=>j0(n,!0);function F0(n,e){return er(n,t=>n.moveVertically(t,e,I0(n).height))}const Tp=n=>F0(n,!1),Mp=n=>F0(n,!0),d3=n=>er(n,e=>Ss(n,e,!0)),f3=n=>er(n,e=>Ss(n,e,!1)),p3=n=>er(n,e=>Ss(n,e,!hn(n))),m3=n=>er(n,e=>Ss(n,e,hn(n))),g3=n=>er(n,e=>ae.cursor(n.lineBlockAt(e.head).from)),O3=n=>er(n,e=>ae.cursor(n.lineBlockAt(e.head).to)),Ap=({state:n,dispatch:e})=>(e(dr(n,{anchor:0})),!0),_p=({state:n,dispatch:e})=>(e(dr(n,{anchor:n.doc.length})),!0),Rp=({state:n,dispatch:e})=>(e(dr(n,{anchor:n.selection.main.anchor,head:0})),!0),Ep=({state:n,dispatch:e})=>(e(dr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),v3=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),b3=({state:n,dispatch:e})=>{let t=nc(n).map(({from:r,to:s})=>ae.range(r,Math.min(s+1,n.doc.length)));return e(n.update({selection:ae.create(t),userEvent:"select"})),!0},x3=({state:n,dispatch:e})=>{let t=Ri(n.selection,r=>{let s=yt(n),i=s.resolveStack(r.from,1);if(r.empty){let o=s.resolveStack(r.from,-1);o.node.from>=i.node.from&&o.node.to<=i.node.to&&(i=o)}for(let o=i;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return ae.range(a.to,a.from)}return r});return t.eq(n.selection)?!1:(e(dr(n,t)),!0)};function U0(n,e){let{state:t}=n,r=t.selection,s=t.selection.ranges.slice();for(let i of t.selection.ranges){let o=t.doc.lineAt(i.head);if(e?o.to<n.state.doc.length:o.from>0)for(let a=i;;){let l=n.moveVertically(a,e);if(l.head<o.from||l.head>o.to){s.some(c=>c.head==l.head)||s.push(l);break}else{if(l.head==a.head)break;a=l}}}return s.length==r.ranges.length?!1:(n.dispatch(dr(t,ae.create(s,s.length-1))),!0)}const y3=n=>U0(n,!1),k3=n=>U0(n,!0),w3=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=ae.create([t.main]):t.main.empty||(r=ae.create([ae.cursor(t.main.head)])),r?(e(dr(n,r)),!0):!1};function Ho(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,s=r.changeByRange(i=>{let{from:o,to:a}=i;if(o==a){let l=e(i);l<o?(t="delete.backward",l=Ca(n,l,!1)):l>o&&(t="delete.forward",l=Ca(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Ca(n,o,!1),a=Ca(n,a,!0);return o==a?{range:i}:{changes:{from:o,to:a},range:ae.cursor(o,o<i.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(r.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?$e.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Ca(n,e,t){if(n instanceof $e)for(let r of n.state.facet($e.atomicRanges).map(s=>s(n)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=t?i:s)});return e}const G0=(n,e,t)=>Ho(n,r=>{let s=r.from,{state:i}=n,o=i.doc.lineAt(s),a,l;if(t&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,s-o.from))){if(a[a.length-1]==" ")return s-1;let c=ur(a,i.tabSize),u=c%Ol(i)||Ol(i);for(let h=0;h<u&&a[a.length-1-h]==" ";h++)s--;l=s}else l=qt(o.text,s-o.from,e,e)+o.from,l==s&&o.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,s-o.from))&&(l=qt(o.text,l-o.from,!1,!1)+o.from);return l}),nh=n=>G0(n,!1,!0),H0=n=>G0(n,!0,!1),K0=(n,e)=>Ho(n,t=>{let r=t.head,{state:s}=n,i=s.doc.lineAt(r),o=s.charCategorizer(r);for(let a=null;;){if(r==(e?i.to:i.from)){r==t.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let l=qt(i.text,r-i.from,e)+i.from,c=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||r!=t.head)&&(a=u),r=l}return r}),J0=n=>K0(n,!1),S3=n=>K0(n,!0),$3=n=>Ho(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),C3=n=>Ho(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Q3=n=>Ho(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),P3=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ct.of(["",""])},range:ae.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},T3=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let s=r.from,i=n.doc.lineAt(s),o=s==i.from?s-1:qt(i.text,s-i.from,!1)+i.from,a=s==i.to?s+1:qt(i.text,s-i.from,!0)+i.from;return{changes:{from:o,to:a,insert:n.doc.slice(s,a).append(n.doc.slice(o,s))},range:ae.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function nc(n){let e=[],t=-1;for(let r of n.selection.ranges){let s=n.doc.lineAt(r.from),i=n.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=n.doc.lineAt(r.to-1)),t>=s.number){let o=e[e.length-1];o.to=i.to,o.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});t=i.number+1}return e}function e1(n,e,t){if(n.readOnly)return!1;let r=[],s=[];for(let i of nc(n)){if(t?i.to==n.doc.length:i.from==0)continue;let o=n.doc.lineAt(t?i.to+1:i.from-1),a=o.length+1;if(t){r.push({from:i.to,to:o.to},{from:i.from,insert:o.text+n.lineBreak});for(let l of i.ranges)s.push(ae.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:o.from,to:i.from},{from:i.to,insert:n.lineBreak+o.text});for(let l of i.ranges)s.push(ae.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:ae.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const M3=({state:n,dispatch:e})=>e1(n,e,!1),A3=({state:n,dispatch:e})=>e1(n,e,!0);function t1(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of nc(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});let s=n.changes(r);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const _3=({state:n,dispatch:e})=>t1(n,e,!1),R3=({state:n,dispatch:e})=>t1(n,e,!0),E3=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(nc(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Ri(e.selection,s=>{let i;if(n.lineWrapping){let o=n.lineBlockAt(s.head),a=n.coordsAtPos(s.head,s.assoc||1);a&&(i=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,i)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function B3(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=yt(n).resolveInner(e),r=t.childBefore(e),s=t.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(Je.closedBy))&&i.indexOf(s.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const Bp=n1(!1),L3=n1(!0);function n1(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:o}=s,a=e.doc.lineAt(i),l=!n&&i==o&&B3(e,i);n&&(i=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new Hl(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=od(c,i);for(u==null&&(u=ur(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:i,to:o}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let h=["",Co(e,u)];return l&&h.push(Co(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:o,insert:ct.of(h)},range:ae.cursor(i+1+h[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ud(n,e){let t=-1;return n.changeByRange(r=>{let s=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,s,r),t=a.number),o=a.to+1}let i=n.changes(s);return{changes:s,range:ae.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const D3=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Hl(n,{overrideIndentation:i=>{let o=t[i];return o??-1}}),s=ud(n,(i,o,a)=>{let l=od(r,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],u=Co(n,l);(c!=u||a.from<i.from+c.length)&&(t[i.from]=l,o.push({from:i.from,to:i.from+c.length,insert:u}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},Z3=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ud(n,(t,r)=>{r.push({from:t.from,insert:n.facet(Yo)})}),{userEvent:"input.indent"})),!0),I3=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ud(n,(t,r)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let i=ur(s,n.tabSize),o=0,a=Co(n,Math.max(0,i-Ol(n)));for(;o<s.length&&o<a.length&&s.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+s.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),X3=n=>(n.setTabFocusMode(),!0),z3=[{key:"Ctrl-b",run:R0,shift:N0,preventDefault:!0},{key:"Ctrl-f",run:E0,shift:V0},{key:"Ctrl-p",run:D0,shift:q0},{key:"Ctrl-n",run:Z0,shift:Y0},{key:"Ctrl-a",run:s3,shift:g3},{key:"Ctrl-e",run:i3,shift:O3},{key:"Ctrl-d",run:H0},{key:"Ctrl-h",run:nh},{key:"Ctrl-k",run:$3},{key:"Ctrl-Alt-h",run:J0},{key:"Ctrl-o",run:P3},{key:"Ctrl-t",run:T3},{key:"Ctrl-v",run:th}],N3=[{key:"ArrowLeft",run:R0,shift:N0,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:UT,shift:l3,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:n3,shift:p3,preventDefault:!0},{key:"ArrowRight",run:E0,shift:V0,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:GT,shift:c3,preventDefault:!0},{mac:"Cmd-ArrowRight",run:r3,shift:m3,preventDefault:!0},{key:"ArrowUp",run:D0,shift:q0,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ap,shift:Rp},{mac:"Ctrl-ArrowUp",run:Pp,shift:Tp},{key:"ArrowDown",run:Z0,shift:Y0,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_p,shift:Ep},{mac:"Ctrl-ArrowDown",run:th,shift:Mp},{key:"PageUp",run:Pp,shift:Tp},{key:"PageDown",run:th,shift:Mp},{key:"Home",run:t3,shift:f3,preventDefault:!0},{key:"Mod-Home",run:Ap,shift:Rp},{key:"End",run:e3,shift:d3,preventDefault:!0},{key:"Mod-End",run:_p,shift:Ep},{key:"Enter",run:Bp,shift:Bp},{key:"Mod-a",run:v3},{key:"Backspace",run:nh,shift:nh,preventDefault:!0},{key:"Delete",run:H0,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:J0,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:S3,preventDefault:!0},{mac:"Mod-Backspace",run:C3,preventDefault:!0},{mac:"Mod-Delete",run:Q3,preventDefault:!0}].concat(z3.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),V3=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KT,shift:u3},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:JT,shift:h3},{key:"Alt-ArrowUp",run:M3},{key:"Shift-Alt-ArrowUp",run:_3},{key:"Alt-ArrowDown",run:A3},{key:"Shift-Alt-ArrowDown",run:R3},{key:"Mod-Alt-ArrowUp",run:y3},{key:"Mod-Alt-ArrowDown",run:k3},{key:"Escape",run:w3},{key:"Mod-Enter",run:L3},{key:"Alt-l",mac:"Ctrl-l",run:b3},{key:"Mod-i",run:x3,preventDefault:!0},{key:"Mod-[",run:I3},{key:"Mod-]",run:Z3},{key:"Mod-Alt-\\",run:D3},{key:"Shift-Mod-k",run:E3},{key:"Shift-Mod-\\",run:a3},{key:"Mod-/",run:MT},{key:"Alt-A",run:_T},{key:"Ctrl-m",mac:"Shift-Alt-m",run:X3}].concat(N3),Lp=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class $i{constructor(e,t,r=0,s=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?a=>i(Lp(a)):Lp,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return kn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Bh(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Qr(e);let s=this.normalize(t);if(s.length)for(let i=0,o=r;;i++){let a=s.charCodeAt(i),l=this.match(a,o,this.bufferPos+this.bufferStart);if(i==s.length-1){if(l)return this.value=l,this;break}o==r&&i<t.length&&t.charCodeAt(i)==a&&o++}}}match(e,t,r){let s=null;for(let i=0;i<this.matches.length;i+=2){let o=this.matches[i],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[i+1],to:r}:(this.matches[i]++,a=!0)),a||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:t,to:r}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&($i.prototype[Symbol.iterator]=function(){return this});const r1={from:-1,to:-1,match:/.*/.exec("")},hd="gm"+(/x/.unicode==null?"":"u");class s1{constructor(e,t,r,s=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=r1,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new i1(e,t,r,s,i);this.re=new RegExp(t,hd+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=yl(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,s=r+t[0].length;if(this.matchPos=yl(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,t)))return this.value={from:r,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Lc=new WeakMap;class di{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let s=Lc.get(e);if(!s||s.from>=r||s.to<=t){let a=new di(t,e.sliceString(t,r));return Lc.set(e,a),a}if(s.from==t&&s.to==r)return s;let{text:i,from:o}=s;return o>t&&(i=e.sliceString(t,o)+i,o=t),s.to<r&&(i+=e.sliceString(s.to,r)),Lc.set(e,new di(o,i)),new di(t,i.slice(t-o,r-o))}}class i1{constructor(e,t,r,s,i){this.text=e,this.to=i,this.done=!1,this.value=r1,this.matchPos=yl(e,s),this.re=new RegExp(t,hd+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=di.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,s=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,t)))return this.value={from:r,to:s,match:t},this.matchPos=yl(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=di.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(s1.prototype[Symbol.iterator]=i1.prototype[Symbol.iterator]=function(){return this});function W3(n){try{return new RegExp(n,hd),!0}catch{return!1}}function yl(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}const j3=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:r,result:s}=aP(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return s.then(i=>{let o=i&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.elements.line.value);if(!o){n.dispatch({effects:r});return}let a=e.doc.lineAt(e.selection.main.head),[,l,c,u,h]=o,f=u?+u.slice(1):0,m=c?+c:a.number;if(c&&h){let y=m/100;l&&(y=y*(l=="-"?-1:1)+a.number/e.doc.lines),m=Math.round(e.doc.lines*y)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,m))),O=ae.cursor(g.from+Math.max(0,Math.min(f,g.length)));n.dispatch({effects:[r,$e.scrollIntoView(O.from,{y:"center"})],selection:O})}),!0},q3={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Y3=Me.define({combine(n){return Br(n,q3,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function F3(n){return[J3,K3]}const U3=Ve.mark({class:"cm-selectionMatch"}),G3=Ve.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Dp(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=St.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=St.Word)}function H3(n,e,t,r){return n(e.sliceDoc(t,t+1))==St.Word&&n(e.sliceDoc(r-1,r))==St.Word}const K3=_t.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Y3),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Ve.none;let s=r.main,i,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return Ve.none;let l=t.wordAt(s.head);if(!l)return Ve.none;o=t.charCategorizer(s.head),i=t.sliceDoc(l.from,l.to)}else{let l=s.to-s.from;if(l<e.minSelectionLength||l>200)return Ve.none;if(e.wholeWords){if(i=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Dp(o,t,s.from,s.to)&&H3(o,t,s.from,s.to)))return Ve.none}else if(i=t.sliceDoc(s.from,s.to),!i)return Ve.none}let a=[];for(let l of n.visibleRanges){let c=new $i(t.doc,i,l.from,l.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||Dp(o,t,u,h))&&(s.empty&&u<=s.from&&h>=s.to?a.push(G3.range(u,h)):(u>=s.to||h<=s.from)&&a.push(U3.range(u,h)),a.length>e.maxMatches))return Ve.none}}return Ve.set(a)}},{decorations:n=>n.decorations}),J3=$e.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),eM=({state:n,dispatch:e})=>{let{selection:t}=n,r=ae.create(t.ranges.map(s=>n.wordAt(s.head)||ae.cursor(s.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function tM(n,e){let{main:t,ranges:r}=n.selection,s=n.wordAt(t.head),i=s&&s.from==t.from&&s.to==t.to;for(let o=!1,a=new $i(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new $i(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(i){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const nM=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(i=>i.from===i.to))return eM({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(i=>n.sliceDoc(i.from,i.to)!=r))return!1;let s=tM(n,r);return s?(e(n.update({selection:n.selection.addRange(ae.range(s.from,s.to),!1),effects:$e.scrollIntoView(s.to)})),!0):!1},Ei=Me.define({combine(n){return Br(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new gM(e),scrollToMatch:e=>$e.scrollIntoView(e)})}});class o1{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||W3(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
78
+ `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new lM(this):new iM(this)}getCursor(e,t=0,r){let s=e.doc?e:st.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?ni(this,s,t,r):ti(this,s,t,r)}}class a1{constructor(e){this.spec=e}}function rM(n,e,t){return(r,s,i,o)=>{if(t&&!t(r,s,i,o))return!1;let a=r>=o&&s<=o+i.length?i.slice(r-o,s-o):e.doc.sliceString(r,s);return n(a,e,r,s)}}function ti(n,e,t,r){let s;return n.wholeWord&&(s=sM(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=rM(n.test,e,s)),new $i(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),s)}function sM(n,e){return(t,r,s,i)=>((i>t||i+s.length<r)&&(i=Math.max(0,t-2),s=n.sliceString(i,Math.min(n.length,r+2))),(e(kl(s,t-i))!=St.Word||e(wl(s,t-i))!=St.Word)&&(e(wl(s,r-i))!=St.Word||e(kl(s,r-i))!=St.Word))}class iM extends a1{constructor(e){super(e)}nextMatch(e,t,r){let s=ti(this.spec,e,r,e.doc.length).nextOverlapping();if(s.done){let i=Math.min(e.doc.length,t+this.spec.unquoted.length);s=ti(this.spec,e,0,i).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==r?null:s.value}prevMatchInRange(e,t,r){for(let s=r;;){let i=Math.max(t,s-1e4-this.spec.unquoted.length),o=ti(this.spec,e,i,s),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==t)return null;s-=1e4}}prevMatch(e,t,r){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=r)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=ti(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=t)return null;s.push(r.value)}return s}highlight(e,t,r,s){let i=ti(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function oM(n,e,t){return(r,s,i)=>(!t||t(r,s,i))&&n(i[0],e,r,s)}function ni(n,e,t,r){let s;return n.wholeWord&&(s=aM(e.charCategorizer(e.selection.main.head))),n.test&&(s=oM(n.test,e,s)),new s1(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,r)}function kl(n,e){return n.slice(qt(n,e,!1),e)}function wl(n,e){return n.slice(e,qt(n,e))}function aM(n){return(e,t,r)=>!r[0].length||(n(kl(r.input,r.index))!=St.Word||n(wl(r.input,r.index))!=St.Word)&&(n(wl(r.input,r.index+r[0].length))!=St.Word||n(kl(r.input,r.index+r[0].length))!=St.Word)}class lM extends a1{nextMatch(e,t,r){let s=ni(this.spec,e,r,e.doc.length).next();return s.done&&(s=ni(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,r){for(let s=1;;s++){let i=Math.max(t,r-s*1e4),o=ni(this.spec,e,i,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i<e.match.length)return e.match[i]+r.slice(s)}return t})}matchAll(e,t){let r=ni(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=t)return null;s.push(r.value)}return s}highlight(e,t,r,s){let i=ni(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const Qo=Ke.define(),dd=Ke.define(),gs=Ft.define({create(n){return new Dc(rh(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Qo)?n=new Dc(t.value.create(),n.panel):t.is(dd)&&(n=new Dc(n.query,t.value?fd:null));return n},provide:n=>yo.from(n,e=>e.panel)});class Dc{constructor(e,t){this.query=e,this.panel=t}}const cM=Ve.mark({class:"cm-searchMatch"}),uM=Ve.mark({class:"cm-searchMatch cm-searchMatch-selected"}),hM=_t.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(gs))}update(n){let e=n.state.field(gs);(e!=n.startState.field(gs)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ve.none;let{view:t}=this,r=new Hr;for(let s=0,i=t.visibleRanges,o=i.length;s<o;s++){let{from:a,to:l}=i[s];for(;s<o-1&&l>i[s+1].from-500;)l=i[++s].to;n.highlight(t.state,a,l,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);r.add(c,u,h?uM:cM)})}return r.finish()}},{decorations:n=>n.decorations});function Ko(n){return e=>{let t=e.state.field(gs,!1);return t&&t.query.spec.valid?n(e,t):u1(e)}}const Sl=Ko((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let s=ae.single(r.from,r.to),i=n.state.facet(Ei);return n.dispatch({selection:s,effects:[pd(n,r),i.scrollToMatch(s.main,n)],userEvent:"select.search"}),c1(n),!0}),$l=Ko((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,s=e.prevMatch(t,r,r);if(!s)return!1;let i=ae.single(s.from,s.to),o=n.state.facet(Ei);return n.dispatch({selection:i,effects:[pd(n,s),o.scrollToMatch(i.main,n)],userEvent:"select.search"}),c1(n),!0}),dM=Ko((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:ae.create(t.map(r=>ae.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),fM=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:s}=t.main,i=[],o=0;for(let a=new $i(n.doc,n.sliceDoc(r,s));!a.next().done;){if(i.length>1e3)return!1;a.value.from==r&&(o=i.length),i.push(ae.range(a.value.from,a.value.to))}return e(n.update({selection:ae.create(i,o),userEvent:"select.search.matches"})),!0},Zp=Ko((n,{query:e})=>{let{state:t}=n,{from:r,to:s}=t.selection.main;if(t.readOnly)return!1;let i=e.nextMatch(t,r,r);if(!i)return!1;let o=i,a=[],l,c,u=[];o.from==r&&o.to==s&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),u.push($e.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+".")));let h=n.state.changes(a);return o&&(l=ae.single(o.from,o.to).map(h),u.push(pd(n,o)),u.push(t.facet(Ei).scrollToMatch(l.main,n))),n.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0}),pM=Ko((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:i,to:o}=s;return{from:i,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:$e.announce.of(r),userEvent:"input.replace.all"}),!0});function fd(n){return n.state.facet(Ei).createPanel(n)}function rh(n,e){var t,r,s,i,o;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(Ei);return new o1({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:c.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function l1(n){let e=Jh(n,fd);return e&&e.dom.querySelector("[main-field]")}function c1(n){let e=l1(n);e&&e==n.root.activeElement&&e.select()}const u1=n=>{let e=n.state.field(gs,!1);if(e&&e.panel){let t=l1(n);if(t&&t!=n.root.activeElement){let r=rh(n.state,e.query.spec);r.valid&&n.dispatch({effects:Qo.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[dd.of(!0),e?Qo.of(rh(n.state,e.query.spec)):Ke.appendConfig.of(vM)]});return!0},h1=n=>{let e=n.state.field(gs,!1);if(!e||!e.panel)return!1;let t=Jh(n,fd);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:dd.of(!1)}),!0},mM=[{key:"Mod-f",run:u1,scope:"editor search-panel"},{key:"F3",run:Sl,shift:$l,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sl,shift:$l,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:h1,scope:"editor search-panel"},{key:"Mod-Shift-l",run:fM},{key:"Mod-Alt-g",run:j3},{key:"Mod-d",run:nM,preventDefault:!0}];class gM{constructor(e){this.view=e;let t=this.query=e.state.field(gs).query.spec;this.commit=this.commit.bind(this),this.searchField=mt("input",{value:t.search,placeholder:Mn(e,"Find"),"aria-label":Mn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=mt("input",{value:t.replace,placeholder:Mn(e,"Replace"),"aria-label":Mn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=mt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=mt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=mt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(s,i,o){return mt("button",{class:"cm-button",name:s,onclick:i,type:"button"},o)}this.dom=mt("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>Sl(e),[Mn(e,"next")]),r("prev",()=>$l(e),[Mn(e,"previous")]),r("select",()=>dM(e),[Mn(e,"all")]),mt("label",null,[this.caseField,Mn(e,"match case")]),mt("label",null,[this.reField,Mn(e,"regexp")]),mt("label",null,[this.wordField,Mn(e,"by word")]),...e.state.readOnly?[]:[mt("br"),this.replaceField,r("replace",()=>Zp(e),[Mn(e,"replace")]),r("replaceAll",()=>pM(e),[Mn(e,"replace all")])],mt("button",{name:"close",onclick:()=>h1(e),"aria-label":Mn(e,"close"),type:"button"},["×"])])}commit(){let e=new o1({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Qo.of(e)}))}keydown(e){bQ(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$l:Sl)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Zp(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Qo)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ei).top}}function Mn(n,e){return n.state.phrase(e)}const Qa=30,Pa=/[\s\.,:;?!]/;function pd(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,i=Math.max(r.from,e-Qa),o=Math.min(s,t+Qa),a=n.state.sliceDoc(i,o);if(i!=r.from){for(let l=0;l<Qa;l++)if(!Pa.test(a[l+1])&&Pa.test(a[l])){a=a.slice(l);break}}if(o!=s){for(let l=a.length-1;l>a.length-Qa;l--)if(!Pa.test(a[l-1])&&Pa.test(a[l])){a=a.slice(0,l);break}}return $e.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const OM=$e.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vM=[gs,es.low(hM),OM];class md{constructor(e,t,r,s){this.state=e,this.pos=t,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=yt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),s=t.text.slice(r-t.from,this.pos-t.from),i=s.search(f1(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Ip(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function bM(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let i=1;i<s.length;i++)t[s[i]]=!0}let r=Ip(e)+Ip(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function d1(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:bM(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:t}:null}}function xM(n,e){return t=>{for(let r=yt(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class Xp{constructor(e,t,r,s){this.completion=e,this.source=t,this.match=r,this.score=s}}function Ws(n){return n.selection.main.from}function f1(n,e){var t;let{source:r}=n,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?n:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const gd=ts.define();function yM(n,e,t,r){let{main:s}=n.selection,i=t-s.from,o=r-s.from;return{...n.changeByRange(a=>{if(a!=s&&t!=r&&n.sliceDoc(a.from+i,a.from+o)!=n.sliceDoc(t,r))return{range:a};let l=n.toText(e);return{changes:{from:a.from+i,to:r==s.from?a.to:a.from+o,insert:l},range:ae.cursor(a.from+i+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const zp=new WeakMap;function kM(n){if(!Array.isArray(n))return n;let e=zp.get(n);return e||zp.set(n,e=d1(n)),e}const Cl=Ke.define(),Po=Ke.define();class wM{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=kn(e,t),s=Qr(r);this.chars.push(r);let i=e.slice(t,t+s),o=i.toUpperCase();this.folded.push(kn(o==i?i.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:s,precise:i,byWord:o}=this;if(t.length==1){let S=kn(e,0),Q=Qr(S),T=Q==e.length?0:-100;if(S!=t[0])if(S==r[0])T+=-200;else return null;return this.ret(T,[0,Q])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let S=0,Q=Math.min(e.length,200);S<Q&&c<l;){let T=kn(e,S);(T==t[c]||T==r[c])&&(s[c++]=S),S+=Qr(T)}if(c<l)return null}let u=0,h=0,f=!1,m=0,g=-1,O=-1,y=/[a-z]/.test(e),x=!0;for(let S=0,Q=Math.min(e.length,200),T=0;S<Q&&h<l;){let D=kn(e,S);a<0&&(u<l&&D==t[u]&&(i[u++]=S),m<l&&(D==t[m]||D==r[m]?(m==0&&(g=S),O=S+1,m++):m=0));let K,I=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(K=Bh(D))!=K.toLowerCase()?1:K!=K.toUpperCase()?2:0;(!S||I==1&&y||T==0&&I!=0)&&(t[h]==D||r[h]==D&&(f=!0)?o[h++]=S:o.length&&(x=!1)),T=I,S+=Qr(D)}return h==l&&o[0]==0&&x?this.result(-100+(f?-200:0),o,e):m==l&&g==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[g,O]):h==l?this.result(-100+(f?-200:0)+-700+(x?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,r){let s=[],i=0;for(let o of t){let a=o+(this.astral?Qr(kn(r,o)):1);i&&s[i-1]==o?s[i-1]=a:(s[i++]=o,s[i++]=a)}return this.ret(e-r.length,s)}}class SM{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const jt=Me.define({combine(n){return Br(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:$M,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Np(e(r),t(r)),optionClass:(e,t)=>r=>Np(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Np(n,e){return n?e?n+" "+e:n:e}function $M(n,e,t,r,s,i){let o=n.textDirection==xt.RTL,a=o,l=!1,c="top",u,h,f=e.left-s.left,m=s.right-e.right,g=r.right-r.left,O=r.bottom-r.top;if(a&&f<Math.min(g,m)?a=!1:!a&&m<Math.min(g,f)&&(a=!0),g<=(a?f:m))u=Math.max(s.top,Math.min(t.top,s.bottom-O))-e.top,h=Math.min(400,a?f:m);else{l=!0,h=Math.min(400,(o?e.right:s.right-e.left)-30);let S=s.bottom-e.bottom;S>=O||S>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let y=(e.bottom-e.top)/i.offsetHeight,x=(e.right-e.left)/i.offsetWidth;return{style:`${c}: ${u/y}px; max-width: ${h/x}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function CM(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,s,i){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;c<i.length;){let u=i[c++],h=i[c++];u>l&&o.appendChild(document.createTextNode(a.slice(l,u)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(u,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function Zc(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class QM{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:i,selected:o}=s.open,a=e.state.facet(jt);this.optionContent=CM(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Zc(i.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,h;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(h=/-(\d+)$/.exec(u.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(jt).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Po.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:o,disabled:a}=r.open;(!s.open||s.open.options!=i)&&(this.range=Zc(i.length,o,e.state.facet(jt).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),a!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Zc(t.options.length,t.selected,this.view.state.facet(jt).maxRenderedOptions),this.showOptions(t.options,e.id));let r=this.updateSelectedOption(t.selected);if(r){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:i}=s;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(s);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,s)}).catch(a=>$n(this.view.state,a,"completion info")):(this.addInfoPane(o,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return t&&TM(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let o=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(i.bottom,t.bottom)-10||s.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(jt).positionInfo(this.view,t,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let i=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let f=typeof c=="string"?c:c.name;if(f!=i&&(o>r.from||r.from==0))if(i=f,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let m=s.appendChild(document.createElement("completion-section"));m.textContent=f}}const u=s.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let h=this.optionClass(a);h&&(u.className=h);for(let f of this.optionContent){let m=f(a,this.view.state,this.view,l);m&&u.appendChild(m)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function PM(n,e){return t=>new QM(t,n,e)}function TM(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),s=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/s:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/s)}function Vp(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function MM(n,e){let t=[],r=null,s=null,i=u=>{t.push(u);let{section:h}=u.completion;if(h){r||(r=[]);let f=typeof h=="string"?h:h.name;r.some(m=>m.name==f)||r.push(typeof h=="string"?{name:f}:h)}},o=e.facet(jt);for(let u of n)if(u.hasResult()){let h=u.result.getMatch;if(u.result.filter===!1)for(let f of u.result.options)i(new Xp(f,u.source,h?h(f):[],1e9-t.length));else{let f=e.sliceDoc(u.from,u.to),m,g=o.filterStrict?new SM(f):new wM(f);for(let O of u.result.options)if(m=g.match(O.label)){let y=O.displayLabel?h?h(O,m.matched):[]:m.matched,x=m.score+(O.boost||0);if(i(new Xp(O,u.source,y,x)),typeof O.section=="object"&&O.section.rank==="dynamic"){let{name:S}=O.section;s||(s=Object.create(null)),s[S]=Math.max(x,s[S]||-1e9)}}}}if(r){let u=Object.create(null),h=0,f=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?s[g.name]-s[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.name<g.name?-1:1);for(let m of r.sort(f))h-=1e5,u[m.name]=h;for(let m of t){let{section:g}=m.completion;g&&(m.score+=u[typeof g=="string"?g:g.name])}}let a=[],l=null,c=o.compareCompletions;for(let u of t.sort((h,f)=>f.score-h.score||c(h.completion,f.completion))){let h=u.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?a.push(u):Vp(u.completion)>Vp(l)&&(a[a.length-1]=u),l=u.completion}return a}class oi{constructor(e,t,r,s,i,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new oi(this.options,Wp(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,s,i,o){if(s&&!o&&e.some(c=>c.isPending))return s.setDisabled();let a=MM(e,t);if(!a.length)return s&&e.some(c=>c.isPending)?s.setDisabled():null;let l=t.facet(jt).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let c=s.options[s.selected].completion;for(let u=0;u<a.length;u++)if(a[u].completion==c){l=u;break}}return new oi(a,Wp(r,l),{pos:e.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:LM,above:i.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new oi(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new oi(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Ql{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Ql(EM,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(jt),i=(r.override||t.languageDataAt("autocomplete",Ws(t)).map(kM)).map(l=>(this.active.find(u=>u.source==l)||new Un(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((l,c)=>l==this.active[c])&&(i=this.active);let o=this.open,a=e.effects.some(l=>l.is(Od));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||i.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!AM(i,this.active)||a?o=oi.build(i,t,this.id,o,r,a):o&&o.disabled&&!i.some(l=>l.isPending)&&(o=null),!o&&i.every(l=>!l.isPending)&&i.some(l=>l.hasResult())&&(i=i.map(l=>l.hasResult()?new Un(l.source,0):l));for(let l of e.effects)l.is(m1)&&(o=o&&o.setSelected(l.value,this.id));return i==this.active&&o==this.open?this:new Ql(i,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?_M:RM}}function AM(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let s=t==n.length,i=r==e.length;if(s||i)return s==i;if(n[t++].result!=e[r++].result)return!1}}const _M={"aria-autocomplete":"list"},RM={};function Wp(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const EM=[];function p1(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(gd);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Un{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=p1(e,t),s=this;(r&8||r&16&&this.touches(e))&&(s=new Un(s.source,0)),r&4&&s.state==0&&(s=new Un(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(Cl))s=new Un(s.source,1,i.value);else if(i.is(Po))s=new Un(s.source,0);else if(i.is(Od))for(let o of i.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Ws(e.state))}}class fi extends Un{constructor(e,t,r,s,i,o){super(e,3,t),this.limit=r,this.result=s,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Ws(e.state);if(a>o||!s||t&2&&(Ws(e.startState)==this.from||a<this.limit))return new Un(this.source,t&4?1:0);let l=e.changes.mapPos(this.limit);return BM(s.validFor,e.state,i,o)?new fi(this.source,this.explicit,l,s,i,o):s.update&&(s=s.update(s,i,o,new md(e.state,a,!1)))?new fi(this.source,this.explicit,l,s,s.from,(r=s.to)!==null&&r!==void 0?r:Ws(e.state)):new Un(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new fi(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Un(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function BM(n,e,t,r){if(!n)return!1;let s=e.sliceDoc(t,r);return typeof n=="function"?n(s,t,r,e):f1(n,!0).test(s)}const Od=Ke.define({map(n,e){return n.map(t=>t.map(e))}}),m1=Ke.define(),wn=Ft.define({create(){return Ql.start()},update(n,e){return n.update(e)},provide:n=>[Kh.from(n,e=>e.tooltip),$e.contentAttributes.from(n,e=>e.attrs)]});function vd(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(wn).active.find(s=>s.source==e.source);return r instanceof fi?(typeof t=="string"?n.dispatch({...yM(n.state,t,r.from,r.to),annotations:gd.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const LM=PM(wn,vd);function Ta(n,e="option"){return t=>{let r=t.state.field(wn,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(jt).interactionDelay)return!1;let s=1,i;e=="page"&&(i=FO(t,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+s*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:m1.of(a)}),!0}}const DM=n=>{let e=n.state.field(wn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(jt).interactionDelay?!1:vd(n,e.open.options[e.open.selected])},Ic=n=>n.state.field(wn,!1)?(n.dispatch({effects:Cl.of(!0)}),!0):!1,ZM=n=>{let e=n.state.field(wn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Po.of(null)}),!0)};class IM{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const XM=50,zM=1e3,NM=_t.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(wn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(wn),t=n.state.facet(jt);if(!n.selectionSet&&!n.docChanged&&n.startState.field(wn)==e)return;let r=n.transactions.some(i=>{let o=p1(i,t);return o&8||(i.selection||i.docChanged)&&!(o&3)});for(let i=0;i<this.running.length;i++){let o=this.running[i];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>XM&&Date.now()-o.time>zM){for(let a of o.context.abortListeners)try{a()}catch(l){$n(this.view.state,l)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(i=>i.effects.some(o=>o.is(Cl)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of n.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(wn);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jt).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Ws(e),r=new md(e,t,n.explicit,this.view),s=new IM(n,r);this.running.push(s),Promise.resolve(n.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Po.of(null)}),$n(this.view.state,i)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jt).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(jt),r=this.view.state.field(wn);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let a=Ws(i.updates.length?i.updates[0].startState:this.view.state),l=Math.min(a,i.done.from+(i.active.explicit?0:1)),c=new fi(i.active.source,i.active.explicit,l,i.done,i.done.from,(n=i.done.to)!==null&&n!==void 0?n:a);for(let u of i.updates)c=c.update(u,t);if(c.hasResult()){e.push(c);continue}}let o=r.active.find(a=>a.source==i.active.source);if(o&&o.isPending)if(i.done==null){let a=new Un(i.active.source,0);for(let l of i.updates)a=a.update(l,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Od.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(wn,!1);if(e&&e.tooltip&&this.view.state.facet(jt).closeOnBlur){let t=e.open&&FO(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Po.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Cl.of(!1)}),20),this.composing=0}}}),VM=typeof navigator=="object"&&/Win/.test(navigator.platform),WM=es.highest($e.domEventHandlers({keydown(n,e){let t=e.state.field(wn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(VM&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],s=t.active.find(o=>o.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(n.key)>-1&&vd(e,r),!1}})),g1=$e.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class jM{constructor(e,t,r,s){this.field=e,this.line=t,this.from=r,this.to=s}}class bd{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,Jt.TrackDel),r=e.mapPos(this.to,1,Jt.TrackDel);return t==null||r==null?null:new bd(this.field,t,r)}}class xd{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],s=[t],i=e.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let h=0;h<u;h++)c+=e.facet(Yo);s.push(t+c.length-u),l=c+l.slice(u)}r.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new bd(l.field,s[l.line]+l.from,s[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],s=[],i;for(let o of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=i[1]?+i[1]:null,l=i[2]||i[3]||"",c=-1,u=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h<t.length;h++)(a!=null?t[h].seq==a:u&&t[h].name==u)&&(c=h);if(c<0){let h=0;for(;h<t.length&&(a==null||t[h].seq!=null&&t[h].seq<a);)h++;t.splice(h,0,{seq:a,name:u}),c=h;for(let f of s)f.field>=c&&f.field++}for(let h of s)if(h.line==r.length&&h.from>i.index){let f=i[2]?3+(i[1]||"").length:2;h.from-=f,h.to-=f}s.push(new jM(c,r.length,i.index,i.index+u.length)),o=o.slice(0,i.index)+l+o.slice(i.index+i[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of s)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new xd(r,s)}}let qM=Ve.widget({widget:new class extends Lr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),YM=Ve.mark({class:"cm-snippetField"});class Bi{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ve.set(e.map(r=>(r.from==r.to?qM:YM).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;t.push(s)}return new Bi(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const Jo=Ke.define({map(n,e){return n&&n.map(e)}}),FM=Ke.define(),To=Ft.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Jo))return t.value;if(t.is(FM)&&n)return new Bi(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>$e.decorations.from(n,e=>e?e.deco:Ve.none)});function yd(n,e){return ae.create(n.filter(t=>t.field==e).map(t=>ae.range(t.from,t.to)))}function UM(n){let e=xd.parse(n);return(t,r,s,i)=>{let{text:o,ranges:a}=e.instantiate(t.state,s),{main:l}=t.state.selection,c={changes:{from:s,to:i==l.from?l.to:i,insert:ct.of(o)},scrollIntoView:!0,annotations:r?[gd.of(r),Et.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=yd(a,0)),a.some(u=>u.field>0)){let u=new Bi(a,0),h=c.effects=[Jo.of(u)];t.state.field(To,!1)===void 0&&h.push(Ke.appendConfig.of([To,eA,tA,g1]))}t.dispatch(t.state.update(c))}}function O1(n){return({state:e,dispatch:t})=>{let r=e.field(To,!1);if(!r||n<0&&r.active==0)return!1;let s=r.active+n,i=n>0&&!r.ranges.some(o=>o.field==s+n);return t(e.update({selection:yd(r.ranges,s),effects:Jo.of(i?null:new Bi(r.ranges,s)),scrollIntoView:!0})),!0}}const GM=({state:n,dispatch:e})=>n.field(To,!1)?(e(n.update({effects:Jo.of(null)})),!0):!1,HM=O1(1),KM=O1(-1),JM=[{key:"Tab",run:HM,shift:KM},{key:"Escape",run:GM}],jp=Me.define({combine(n){return n.length?n[0]:JM}}),eA=es.highest(Wo.compute([jp],n=>n.facet(jp)));function yn(n,e){return{...e,apply:UM(n)}}const tA=$e.domEventHandlers({mousedown(n,e){let t=e.state.field(To,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==t.active?!1:(e.dispatch({selection:yd(t.ranges,s.field),effects:Jo.of(t.ranges.some(i=>i.field>s.field)?new Bi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Mo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Xs=Ke.define({map(n,e){let t=e.mapPos(n,-1,Jt.TrackAfter);return t??void 0}}),kd=new class extends Os{};kd.startSide=1;kd.endSide=-1;const v1=Ft.define({create(){return rt.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(Xs)&&(n=n.update({add:[kd.range(t.value,t.value+1)]}));return n}});function nA(){return[sA,v1]}const Xc="()[]{}<>«»»«[]{}";function b1(n){for(let e=0;e<Xc.length;e+=2)if(Xc.charCodeAt(e)==n)return Xc.charAt(e+1);return Bh(n<128?n:n+1)}function x1(n,e){return n.languageDataAt("closeBrackets",e)[0]||Mo}const rA=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),sA=$e.inputHandler.of((n,e,t,r)=>{if((rA?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(r.length>2||r.length==2&&Qr(kn(r,0))==1||e!=s.from||t!=s.to)return!1;let i=aA(n.state,r);return i?(n.dispatch(i),!0):!1}),iA=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=x1(n,n.selection.main.head).brackets||Mo.brackets,s=null,i=n.changeByRange(o=>{if(o.empty){let a=lA(n.doc,o.head);for(let l of r)if(l==a&&rc(n.doc,o.head)==b1(kn(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:ae.cursor(o.head-l.length)}}return{range:s=o}});return s||e(n.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},oA=[{key:"Backspace",run:iA}];function aA(n,e){let t=x1(n,n.selection.main.head),r=t.brackets||Mo.brackets;for(let s of r){let i=b1(kn(s,0));if(e==s)return i==s?hA(n,s,r.indexOf(s+s+s)>-1,t):cA(n,s,i,t.before||Mo.before);if(e==i&&y1(n,n.selection.main.from))return uA(n,s,i)}return null}function y1(n,e){let t=!1;return n.field(v1).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function rc(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Qr(kn(t,0)))}function lA(n,e){let t=n.sliceString(e-2,e);return Qr(kn(t,0))==t.length?t:t.slice(1)}function cA(n,e,t,r){let s=null,i=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Xs.of(o.to+e.length),range:ae.range(o.anchor+e.length,o.head+e.length)};let a=rc(n.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Xs.of(o.head+e.length),range:ae.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function uA(n,e,t){let r=null,s=n.changeByRange(i=>i.empty&&rc(n.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:ae.cursor(i.head+t.length)}:r={range:i});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function hA(n,e,t,r){let s=r.stringPrefixes||Mo.stringPrefixes,i=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Xs.of(a.to+e.length),range:ae.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=rc(n.doc,l),u;if(c==e){if(qp(n,l))return{changes:{insert:e+e,from:l},effects:Xs.of(l+e.length),range:ae.cursor(l+e.length)};if(y1(n,l)){let f=t&&n.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:ae.cursor(l+f.length)}}}else{if(t&&n.sliceDoc(l-2*e.length,l)==e+e&&(u=Yp(n,l-2*e.length,s))>-1&&qp(n,u))return{changes:{insert:e+e+e+e,from:l},effects:Xs.of(l+e.length),range:ae.cursor(l+e.length)};if(n.charCategorizer(l)(c)!=St.Word&&Yp(n,l,s)>-1&&!dA(n,l,e,s))return{changes:{insert:e+e,from:l},effects:Xs.of(l+e.length),range:ae.cursor(l+e.length)}}return{range:i=a}});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function qp(n,e){let t=yt(n).resolveInner(e+1);return t.parent&&t.from==e}function dA(n,e,t,r){let s=yt(n).resolveInner(e,-1),i=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+i)),l=a.indexOf(t);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=s.firstChild;for(;u&&u.from==s.from&&u.to-u.from>t.length+l;){if(n.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=s.to==e&&s.parent;if(!c)break;s=c}return!1}function Yp(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=St.Word)return e;for(let s of t){let i=e-s.length;if(n.sliceDoc(i,e)==s&&r(n.sliceDoc(i-1,i))!=St.Word)return i}return-1}function fA(n={}){return[WM,wn,jt.of(n),NM,pA,g1]}const k1=[{key:"Ctrl-Space",run:Ic},{mac:"Alt-`",run:Ic},{mac:"Alt-i",run:Ic},{key:"Escape",run:ZM},{key:"ArrowDown",run:Ta(!0)},{key:"ArrowUp",run:Ta(!1)},{key:"PageDown",run:Ta(!0,"page")},{key:"PageUp",run:Ta(!1,"page")},{key:"Enter",run:DM}],pA=es.highest(Wo.computeN([jt],n=>n.facet(jt).defaultKeymap?[k1]:[]));class Fp{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class Bs{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let s=r.facet(Ao).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new Hr,a=[],l=0,c=r.doc.iter(),u=0,h=r.doc.length;for(let m=0;;){let g=m==i.length?null:i[m];if(!g&&!a.length)break;let O,y;if(a.length)O=l,y=a.reduce((Q,T)=>Math.min(Q,T.to),g&&g.from>O?g.from:1e8);else{if(O=g.from,O>h)break;y=g.to,a.push(g),m++}for(;m<i.length;){let Q=i[m];if(Q.from==O&&(Q.to>Q.from||Q.to==O))a.push(Q),m++,y=Math.min(Q.to,y);else{y=Math.min(Q.from,y);break}}y=Math.min(y,h);let x=!1;if(a.some(Q=>Q.from==O&&(Q.to==y||y==h))&&(x=O==y,!x&&y-O<10)){let Q=O-(u+c.value.length);Q>0&&(c.next(Q),u=O);for(let T=O;;){if(T>=y){x=!0;break}if(!c.lineBreak&&u+c.value.length>T)break;T=u+c.value.length,u+=c.value.length,c.next()}}let S=QA(a);if(x)o.add(O,O,Ve.widget({widget:new wA(S),diagnostics:a.slice()}));else{let Q=a.reduce((T,D)=>D.markClass?T+" "+D.markClass:T,"");o.add(O,y,Ve.mark({class:"cm-lintRange cm-lintRange-"+S+Q,diagnostics:a.slice(),inclusiveEnd:a.some(T=>T.to>y)}))}if(l=y,l==h)break;for(let Q=0;Q<a.length;Q++)a[Q].to<=l&&a.splice(Q--,1)}let f=o.finish();return new Bs(f,t,ws(f))}}function ws(n,e=null,t=0){let r=null;return n.between(t,1e9,(s,i,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new Fp(s,i,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new Fp(r.from,i,r.diagnostic)}}),r}function mA(n,e){let t=e.pos,r=e.end||t,s=n.state.facet(Ao).hideOn(n,t,r);if(s!=null)return s;let i=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(w1))||n.changes.touchesRange(i.from,Math.max(i.to,r)))}function gA(n,e){return n.field(Dn,!1)?e:e.concat(Ke.appendConfig.of(PA))}const w1=Ke.define(),wd=Ke.define(),S1=Ke.define(),Dn=Ft.define({create(){return new Bs(Ve.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,s=n.panel;if(n.selected){let i=e.changes.mapPos(n.selected.from,1);r=ws(t,n.selected.diagnostic,i)||ws(t,null,i)}!t.size&&s&&e.state.facet(Ao).autoPanel&&(s=null),n=new Bs(t,s,r)}for(let t of e.effects)if(t.is(w1)){let r=e.state.facet(Ao).autoPanel?t.value.length?_o.open:null:n.panel;n=Bs.init(t.value,r,e.state)}else t.is(wd)?n=new Bs(n.diagnostics,t.value?_o.open:null,n.selected):t.is(S1)&&(n=new Bs(n.diagnostics,n.panel,t.value));return n},provide:n=>[yo.from(n,e=>e.panel),$e.decorations.from(n,e=>e.diagnostics)]}),OA=Ve.mark({class:"cm-lintRange cm-lintRange-active"});function vA(n,e,t){let{diagnostics:r}=n.state.field(Dn),s,i=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:u})=>{if(e>=l&&e<=c&&(l==c||(e>l||t>0)&&(e<c||t<0)))return s=u.diagnostics,i=l,o=c,!1});let a=n.state.facet(Ao).tooltipFilter;return s&&a&&(s=a(s,n.state)),s?{pos:i,end:o,above:n.state.doc.lineAt(i).to<o,create(){return{dom:bA(n,s)}}}:null}function bA(n,e){return mt("ul",{class:"cm-tooltip-lint"},e.map(t=>C1(n,t,!1)))}const xA=n=>{let e=n.state.field(Dn,!1);(!e||!e.panel)&&n.dispatch({effects:gA(n.state,[wd.of(!0)])});let t=Jh(n,_o.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Up=n=>{let e=n.state.field(Dn,!1);return!e||!e.panel?!1:(n.dispatch({effects:wd.of(!1)}),!0)},yA=n=>{let e=n.state.field(Dn,!1);if(!e)return!1;let t=n.state.selection.main,r=ws(e.diagnostics,null,t.to+1);return!r&&(r=ws(e.diagnostics,null,0),!r||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},kA=[{key:"Mod-Shift-m",run:xA,preventDefault:!0},{key:"F8",run:yA}],Ao=Me.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Br(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Gp,tooltipFilter:Gp,needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t,hideOn:(e,t)=>e?t?(r,s,i)=>e(r,s,i)||t(r,s,i):e:t,autoPanel:(e,t)=>e||t})}}});function Gp(n,e){return n?e?(t,r)=>e(n(t,r),r):n:e}function $1(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let s=t[r];if(/[a-zA-Z]/.test(s)&&!e.some(i=>i.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function C1(n,e,t){var r;let s=t?$1(e.actions):[];return mt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},mt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,o)=>{let a=!1,l=m=>{if(m.preventDefault(),a)return;a=!0;let g=ws(n.state.field(Dn).diagnostics,e);g&&i.apply(n,g.from,g.to)},{name:c}=i,u=s[o]?c.indexOf(s[o]):-1,h=u<0?c:[c.slice(0,u),mt("u",c.slice(u,u+1)),c.slice(u+1)],f=i.markClass?" "+i.markClass:"";return mt("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${s[o]})"`}.`},h)}),e.source&&mt("div",{class:"cm-diagnosticSource"},e.source))}class wA extends Lr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return mt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Hp{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=C1(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _o{constructor(e){this.view=e,this.items=[];let t=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)Up(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],o=$1(i.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==s.keyCode){let l=ws(this.view.state.field(Dn).diagnostics,i);l&&i.actions[a].apply(e,l.from,l.to)}}else return;s.preventDefault()}},r=s=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(s.target)&&this.moveSelection(i)};this.list=mt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=mt("div",{class:"cm-panel-lint"},this.list,mt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Up(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Dn).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Dn),r=0,s=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let h=-1,f;for(let m=r;m<this.items.length;m++)if(this.items[m].diagnostic==u){h=m;break}h<0?(f=new Hp(this.view,u),this.items.splice(r,0,f),s=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),s=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),i=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Hp(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Dn),r=ws(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:S1.of(r)})}static open(e){return new _o(e)}}function SA(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Ma(n){return SA(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const $A=$e.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Ma("#d11")},".cm-lintRange-warning":{backgroundImage:Ma("orange")},".cm-lintRange-info":{backgroundImage:Ma("#999")},".cm-lintRange-hint":{backgroundImage:Ma("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function CA(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function QA(n){let e="hint",t=1;for(let r of n){let s=CA(r.severity);s>t&&(t=s,e=r.severity)}return e}const PA=[Dn,$e.decorations.compute([Dn],n=>{let{selected:e,panel:t}=n.field(Dn);return!e||!t||e.from==e.to?Ve.none:Ve.set([OA.range(e.from,e.to)])}),iP(vA,{hideOn:mA}),$A],TA=[vP(),yP(),LQ(),IT(),fT(),$Q(),MQ(),st.allowMultipleSelections.of(!0),tT(),y0(OT,{fallback:!0}),ST(),nA(),fA(),FQ(),HQ(),NQ(),F3(),Wo.of([...oA,...V3,...mM,...FT,...cT,...k1,...kA])];class Pl{static create(e,t,r,s,i){let o=s+(s<<8)+e+(t<<4)|0;return new Pl(e,t,r,o,i,[],[])}constructor(e,t,r,s,i,o,a){this.type=e,this.value=t,this.from=r,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[Je.contextHash,s]]}addChild(e,t){e.prop(Je.contextHash)!=this.hash&&(e=new ut(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new ut(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(s,i,o)=>new ut(Nt.none,s,i,o,this.hashProp)})}}var be;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(be||(be={}));class MA{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class AA{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ho(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let s=t;s<e;s++)r+=this.text.charCodeAt(s)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function Kp(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==be.OrderedList?Cd:$d)(t,e,!1);return r>0&&(n.type!=be.BulletList||Sd(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const Q1={[be.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(ot(be.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(tr(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[be.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[be.OrderedList]:Kp,[be.BulletList]:Kp,[be.Document](){return!0}};function tr(n){return n==32||n==9||n==10||n==13}function ho(n,e=0){for(;e<n.length&&tr(n.charCodeAt(e));)e++;return e}function Jp(n,e,t){for(;e>t&&tr(n.charCodeAt(e-1));)e--;return e}function P1(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function T1(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function Sd(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let s=n.pos+1;s<n.text.length;s++){let i=n.text.charCodeAt(s);if(i==n.next)r++;else if(!tr(i))return-1}return t&&n.next==45&&_1(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(L1.SetextHeading)>-1||r<3?-1:1}function M1(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function $d(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||tr(n.text.charCodeAt(n.pos+1)))&&(!t||M1(e,be.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function Cd(n,e,t){let r=n.pos,s=n.next;for(;s>=48&&s<=57;){r++;if(r==n.text.length)return-1;s=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||s!=46&&s!=41||r<n.text.length-1&&!tr(n.text.charCodeAt(r+1))||t&&!M1(e,be.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function A1(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function _1(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&tr(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const sh=/^[ \t]*$/,R1=/-->/,E1=/\?>/,ih=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,R1],[/^\s*<\?/,E1],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,sh],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,sh]];function B1(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let s=0,i=ih.length-(t?1:0);s<i;s++)if(ih[s][0].test(r))return s;return-1}function em(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function cs(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==be.CodeText?n[r].to=t:n.push(ot(be.CodeText,e,t))}const Aa={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),s=n.lineStart+r,i=n.lineStart+e.text.length,o=[],a=[];for(cs(o,s,i);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){cs(a,n.lineStart-1,n.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<t)break;{if(a.length){for(let c of a)c.type==be.CodeText?cs(o,c.from,c.to):o.push(c);a=[]}cs(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c);i=n.lineStart+e.text.length;let l=n.lineStart+e.findColumn(e.baseIndent+4);l<i&&cs(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=be.CodeText),a.length&&(e.markers=a.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-s).finish(be.CodeBlock,i-s),s),!0},FencedCode(n,e){let t=P1(e);if(t<0)return!1;let r=n.lineStart+e.pos,s=e.next,i=t-e.pos,o=e.skipSpace(t),a=Jp(e.text,e.text.length,o),l=[ot(be.CodeMark,r,r+i)];o<a&&l.push(ot(be.CodeInfo,n.lineStart+o,n.lineStart+a));for(let c=!0,u=!0,h=!1;n.nextLine()&&e.depth>=n.stack.length;c=!1){let f=e.pos;if(e.indent-e.baseIndent<4)for(;f<e.text.length&&e.text.charCodeAt(f)==s;)f++;if(f-e.pos>=i&&e.skipSpace(f)==e.text.length){for(let m of e.markers)l.push(m);u&&h&&cs(l,n.lineStart-1,n.lineStart),l.push(ot(be.CodeMark,n.lineStart+e.pos,n.lineStart+f)),n.nextLine();break}else{h=!0,c||(cs(l,n.lineStart-1,n.lineStart),u=!1);for(let O of e.markers)l.push(O);let m=n.lineStart+e.basePos,g=n.lineStart+e.text.length;m<g&&(cs(l,m,g),u=!1)}}return n.addNode(n.buffer.writeElements(l,-r).finish(be.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=T1(e);return t<0?!1:(n.startContext(be.Blockquote,e.pos),n.addNode(be.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(Sd(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(be.HorizontalRule,t),!0},BulletList(n,e){let t=$d(e,n,!1);if(t<0)return!1;n.block.type!=be.BulletList&&n.startContext(be.BulletList,e.basePos,e.next);let r=em(e,e.pos+1);return n.startContext(be.ListItem,e.basePos,r-e.baseIndent),n.addNode(be.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=Cd(e,n,!1);if(t<0)return!1;n.block.type!=be.OrderedList&&n.startContext(be.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=em(e,e.pos+t);return n.startContext(be.ListItem,e.basePos,r-e.baseIndent),n.addNode(be.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=A1(e);if(t<0)return!1;let r=e.pos,s=n.lineStart+r,i=Jp(e.text,e.text.length,r),o=i;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==r||!tr(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=n.buffer.write(be.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,o),s+t+1),-s);o<e.text.length&&a.write(be.HeaderMark,o-r,i-r);let l=a.finish(be.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(l,s),!0},HTMLBlock(n,e){let t=B1(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,s=ih[t][1],i=[],o=s!=sh;for(;!s.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let c of e.markers)i.push(c)}o&&n.nextLine();let a=s==R1?be.CommentBlock:s==E1?be.ProcessingInstructionBlock:be.HTMLBlock,l=n.prevLineEnd();return n.addNode(n.buffer.writeElements(i,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class _A{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let s=r.content+`
79
+ `+t.scrub(),i=this.advance(s);return i>-1&&i<s.length?this.complete(e,r,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&ho(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,ot(be.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(j1(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ot(be.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(V1(e,ho(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=ho(e,this.pos),r=0;if(t>this.pos){let s=W1(e,t,this.start);if(s){let i=zc(e,s.to-this.start);i>0&&(this.nextStage(s),r=i)}}return r||(r=zc(e,this.pos)),r>0&&r<e.length?r:-1}else return zc(e,this.pos)}}}function zc(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!tr(t))return-1}return e}class RA{nextLine(e,t,r){let s=t.depth<e.stack.length?-1:_1(t),i=t.next;if(s<0)return!1;let o=ot(be.HeaderMark,e.lineStart+t.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(r,ot(i==61?be.SetextHeading1:be.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}}const L1={LinkReference(n,e){return e.content.charCodeAt(0)==91?new _A(e):null},SetextHeading(){return new RA}},EA=[(n,e)=>A1(e)>=0,(n,e)=>P1(e)>=0,(n,e)=>T1(e)>=0,(n,e)=>$d(e,n,!0)>=0,(n,e)=>Cd(e,n,!0)>=0,(n,e)=>Sd(e,n,!0)>=0,(n,e)=>B1(e,n,!0)>=0],BA={text:"",end:0};class LA{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.line=new AA,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=Pl.create(be.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new IA(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!s||e.markers[r].from<s.end);){let i=e.markers[r++];this.addNode(i.type,i.from,i.to)}if(!s)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let s=r(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}let t=new MA(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let s=r(this,t);s&&t.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
80
+ `+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=q1(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=BA;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<t.end;){s++;let i=this.ranges[s].from,o=this.lineChunkAt(i);t.end=i+o.length,t.text=t.text.slice(0,this.ranges[s-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],i=this.parser.skipContextMarkup[s.type];if(!i)throw new Error("Unhandled block context "+be[s.type]);let o=this.line.markers.length;if(!i(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
81
+ `?"":t;else{let s=t.indexOf(`
82
+ `);r=s<0?t:t.slice(0,s)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=Pl.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new ut(this.parser.nodeSet.types[e],Ci,Ci,(r??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(ah(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?D1(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=ah(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(be.Paragraph,e.content.length),e.start)}elt(e,t,r,s){return typeof e=="string"?ot(this.parser.getNodeType(e),t,r,s):new X1(e,t)}get buffer(){return new I1(this.parser.nodeSet)}}function D1(n,e,t,r,s){let i=n[e].to,o=[],a=[],l=t.from+r;function c(u,h){for(;h?u>=i:u>i;){let f=n[e+1].from-i;r+=f,u+=f,e++,i=n[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let h=u.from+r,f,m=s.get(u.tree);m?f=m:u.to+r>i?(f=D1(n,e,u,r,s),c(u.to+r,!1)):f=u.toTree(),o.push(f),a.push(h-l)}return c(t.to+r,!1),new ut(t.type,o,a,t.to+r-l,t.tree?t.tree.propValues:void 0)}class sc extends rd{constructor(e,t,r,s,i,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=s,this.endLeafBlock=i,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,r){let s=new LA(this,e,t,r);for(let i of this.wrappers)s=i(s,e,t,r);return s}configure(e){let t=oh(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:s}=this,i=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),h=this.wrappers;if(Gi(t.defineNodes)){s=Object.assign({},s);let f=r.types.slice(),m;for(let g of t.defineNodes){let{name:O,block:y,composite:x,style:S}=typeof g=="string"?{name:g}:g;if(f.some(D=>D.name==O))continue;x&&(s[f.length]=(D,K,I)=>x(K,I,D.value));let Q=f.length,T=x?["Block","BlockContext"]:y?Q>=be.ATXHeading1&&Q<=be.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(Nt.define({id:Q,name:O,props:T&&[[Je.group,T]]})),S&&(m||(m={}),Array.isArray(S)||S instanceof Ln?m[O]=S:Object.assign(m,S))}r=new qo(f),m&&(r=r.extend(Ai(m)))}if(Gi(t.props)&&(r=r.extend(...t.props)),Gi(t.remove))for(let f of t.remove){let m=this.blockNames.indexOf(f),g=this.inlineNames.indexOf(f);m>-1&&(i[m]=o[m]=void 0),g>-1&&(l[g]=void 0)}if(Gi(t.parseBlock))for(let f of t.parseBlock){let m=a.indexOf(f.name);if(m>-1)i[m]=f.parse,o[m]=f.leaf;else{let g=f.before?_a(a,f.before):f.after?_a(a,f.after)+1:a.length-1;i.splice(g,0,f.parse),o.splice(g,0,f.leaf),a.splice(g,0,f.name)}f.endLeaf&&u.push(f.endLeaf)}if(Gi(t.parseInline))for(let f of t.parseInline){let m=c.indexOf(f.name);if(m>-1)l[m]=f.parse;else{let g=f.before?_a(c,f.before):f.after?_a(c,f.after)+1:c.length-1;l.splice(g,0,f.parse),c.splice(g,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new sc(r,i,o,a,u,s,l,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new Qd(this,e,t);e:for(let s=t;s<r.end;){let i=r.char(s);for(let o of this.inlineParsers)if(o){let a=o(r,i,s);if(a>=0){s=a;continue e}}s++}return r.resolveMarkers(0)}}function Gi(n){return n!=null&&n.length>0}function oh(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=oh(n[0]);if(n.length==1)return e;let t=oh(n.slice(1));if(!t||!e)return e||t;let r=(o,a)=>(o||Ci).concat(a||Ci),s=e.wrap,i=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:s?i?(o,a,l,c)=>s(i(o,a,l,c),a,l,c):s:i}}function _a(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let Z1=[Nt.none];for(let n=1,e;e=be[n];n++)Z1[n]=Nt.define({id:n,name:e,props:n>=be.Escape?[]:[[Je.group,n in Q1?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Ci=[];class I1{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,r,s=0){return this.content.push(e,t,r,4+s*4),this}writeElements(e,t=0){for(let r of e)r.writeTo(this,t);return this}finish(e,t){return ut.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Ro=class{constructor(e,t,r,s=Ci){this.type=e,this.from=t,this.to=r,this.children=s}writeTo(e,t){let r=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-r)}toTree(e){return new I1(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class X1{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Ci}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function ot(n,e,t,r){return new Ro(n,e,t,r)}const z1={resolve:"Emphasis",mark:"EmphasisMark"},N1={resolve:"Emphasis",mark:"EmphasisMark"},Ls={},Tl={};class Bn{constructor(e,t,r,s){this.type=e,this.from=t,this.to=r,this.side=s}}const tm="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Eo=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Eo=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Nc={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let r=n.char(t+1);for(let s=0;s<tm.length;s++)if(tm.charCodeAt(s)==r)return n.append(ot(be.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return r?n.append(ot(be.Entity,t,t+1+r[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let r=t+1;for(;r<n.end&&n.char(r)==96;)r++;let s=r-t,i=0;for(;r<n.end;r++)if(n.char(r)==96){if(i++,i==s&&n.char(r+1)!=96)return n.append(ot(be.InlineCode,t,r+1,[ot(be.CodeMark,t,t+s),ot(be.CodeMark,r+1-s,r+1)]))}else i=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let r=n.slice(t+1,n.end),s=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(s)return n.append(ot(be.Autolink,t,t+1+s[0].length,[ot(be.LinkMark,t,t+1),ot(be.URL,t+1,t+s[0].length),ot(be.LinkMark,t+s[0].length,t+1+s[0].length)]));let i=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(i)return n.append(ot(be.Comment,t,t+1+i[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return n.append(ot(be.ProcessingInstruction,t,t+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?n.append(ot(be.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let r=t+1;for(;n.char(r)==e;)r++;let s=n.slice(t-1,t),i=n.slice(r,r+1),o=Eo.test(s),a=Eo.test(i),l=/\s|^$/.test(s),c=/\s|^$/.test(i),u=!c&&(!a||l||o),h=!l&&(!o||c||a),f=u&&(e==42||!h||o),m=h&&(e==42||!u||a);return n.append(new Bn(e==95?z1:N1,t,r,(f?1:0)|(m?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(ot(be.HardBreak,t,t+2));if(e==32){let r=t+1;for(;n.char(r)==32;)r++;if(n.char(r)==10&&r>=t+2)return n.append(ot(be.HardBreak,t,r+1))}return-1},Link(n,e,t){return e==91?n.append(new Bn(Ls,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Bn(Tl,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let r=n.parts.length-1;r>=0;r--){let s=n.parts[r];if(s instanceof Bn&&(s.type==Ls||s.type==Tl)){if(!s.side||n.skipSpace(s.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[r]=null,-1;let i=n.takeContent(r),o=n.parts[r]=DA(n,i,s.type==Ls?be.Link:be.Image,s.from,t+1);if(s.type==Ls)for(let a=0;a<r;a++){let l=n.parts[a];l instanceof Bn&&l.type==Ls&&(l.side=0)}return o.to}}return-1}};function DA(n,e,t,r,s){let{text:i}=n,o=n.char(s),a=s;if(e.unshift(ot(be.LinkMark,r,r+(t==be.Image?2:1))),e.push(ot(be.LinkMark,s-1,s)),o==40){let l=n.skipSpace(s+1),c=V1(i,l-n.offset,n.offset),u;c&&(l=n.skipSpace(c.to),l!=c.to&&(u=W1(i,l-n.offset,n.offset),u&&(l=n.skipSpace(u.to)))),n.char(l)==41&&(e.push(ot(be.LinkMark,s,s+1)),a=l+1,c&&e.push(c),u&&e.push(u),e.push(ot(be.LinkMark,l,a)))}else if(o==91){let l=j1(i,s-n.offset,n.offset,!1);l&&(e.push(l),a=l.to)}return ot(t,r,a,e)}function V1(n,e,t){if(n.charCodeAt(e)==60){for(let s=e+1;s<n.length;s++){let i=n.charCodeAt(s);if(i==62)return ot(be.URL,e+t,s+1+t);if(i==60||i==10)return!1}return null}else{let s=0,i=e;for(let o=!1;i<n.length;i++){let a=n.charCodeAt(i);if(tr(a))break;if(o)o=!1;else if(a==40)s++;else if(a==41){if(!s)break;s--}else a==92&&(o=!0)}return i>e?ot(be.URL,e+t,i+t):i==n.length?null:!1}}function W1(n,e,t){let r=n.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let s=r==40?41:r;for(let i=e+1,o=!1;i<n.length;i++){let a=n.charCodeAt(i);if(o)o=!1;else{if(a==s)return ot(be.LinkTitle,e+t,i+1+t);a==92&&(o=!0)}}return null}function j1(n,e,t,r){for(let s=!1,i=e+1,o=Math.min(n.length,i+999);i<o;i++){let a=n.charCodeAt(i);if(s)s=!1;else{if(a==93)return r?!1:ot(be.LinkLabel,e+t,i+1+t);if(r&&!tr(a)&&(r=!1),a==91)return!1;a==92&&(s=!0)}}return null}class Qd{constructor(e,t,r){this.parser=e,this.text=t,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,r,s,i){return this.append(new Bn(e,t,r,(s?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Bn&&(t.type==Ls||t.type==Tl))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let s=this.parts[r];if(!(s instanceof Bn&&s.type.resolve&&s.side&2))continue;let i=s.type==z1||s.type==N1,o=s.to-s.from,a,l=r-1;for(;l>=e;l--){let O=this.parts[l];if(O instanceof Bn&&O.side&1&&O.type==s.type&&!(i&&(s.side&1||O.side&2)&&(O.to-O.from+o)%3==0&&((O.to-O.from)%3||o%3))){a=O;break}}if(!a)continue;let c=s.type.resolve,u=[],h=a.from,f=s.to;if(i){let O=Math.min(2,a.to-a.from,o);h=a.to-O,f=s.from+O,c=O==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,h,a.to));for(let O=l+1;O<r;O++)this.parts[O]instanceof Ro&&u.push(this.parts[O]),this.parts[O]=null;s.type.mark&&u.push(this.elt(s.type.mark,s.from,f));let m=this.elt(c,h,f,u);this.parts[l]=i&&a.from!=h?new Bn(a.type,a.from,h,a.side):null,(this.parts[r]=i&&s.to!=f?new Bn(s.type,f,s.to,s.side):null)?this.parts.splice(r,0,m):this.parts[r]=m}let t=[];for(let r=e;r<this.parts.length;r++){let s=this.parts[r];s instanceof Ro&&t.push(s)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let r=this.parts[t];if(r instanceof Bn&&r.type==e&&r.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Bn?t:null}skipSpace(e){return ho(this.text,e-this.offset)+this.offset}elt(e,t,r,s){return typeof e=="string"?ot(this.parser.getNodeType(e),t,r,s):new X1(e,t)}}Qd.linkStart=Ls;Qd.imageStart=Tl;function ah(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),r=0;for(let s of e){for(;r<t.length&&t[r].to<s.to;)r++;if(r<t.length&&t[r].from<s.from){let i=t[r];i instanceof Ro&&(t[r]=new Ro(i.type,i.from,i.to,ah(i.children,[s])))}else t.splice(r++,0,s)}return t}const ZA=[be.CodeBlock,be.ListItem,be.OrderedList,be.BulletList];let IA=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let i=this.fragment.to;for(;i>0&&this.input.read(i-1,i)!=`
83
+ `;)i--;this.fragmentEnd=i?i-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let s=e+this.fragment.offset;for(;r.to<=s;)if(!r.parent())return!1;for(;;){if(r.from>=s)return this.fragment.from<=t;if(!r.childAfter(s))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Je.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,l=o,c=a;for(;;){if(t.to-r>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=q1(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let h=new ut(e.parser.nodeSet.types[be.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,u)}if(t.type.is("Block")&&(ZA.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=l,a=c),l=t.to-r,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}};function q1(n,e){let t=n;for(let r=1;r<e.length;r++){let s=e[r-1].to,i=e[r].from;s<n&&(t-=i-s)}return t}const XA=Ai({"Blockquote/...":P.quote,HorizontalRule:P.contentSeparator,"ATXHeading1/... SetextHeading1/...":P.heading1,"ATXHeading2/... SetextHeading2/...":P.heading2,"ATXHeading3/...":P.heading3,"ATXHeading4/...":P.heading4,"ATXHeading5/...":P.heading5,"ATXHeading6/...":P.heading6,"Comment CommentBlock":P.comment,Escape:P.escape,Entity:P.character,"Emphasis/...":P.emphasis,"StrongEmphasis/...":P.strong,"Link/... Image/...":P.link,"OrderedList/... BulletList/...":P.list,"BlockQuote/...":P.quote,"InlineCode CodeText":P.monospace,"URL Autolink":P.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":P.processingInstruction,"CodeInfo LinkLabel":P.labelName,LinkTitle:P.string,Paragraph:P.content}),zA=new sc(new qo(Z1).extend(XA),Object.keys(Aa).map(n=>Aa[n]),Object.keys(Aa).map(n=>L1[n]),Object.keys(Aa),EA,Q1,Object.keys(Nc).map(n=>Nc[n]),Object.keys(Nc),[]);function NA(n,e,t){let r=[];for(let s=n.firstChild,i=e;;s=s.nextSibling){let o=s?s.from:t;if(o>i&&r.push({from:i,to:o}),!s)break;i=s.to}return r}function VA(n){let{codeParser:e,htmlParser:t}=n;return{wrap:i0((s,i)=>{let o=s.type.id;if(e&&(o==be.CodeBlock||o==be.FencedCode)){let a="";if(o==be.FencedCode){let c=s.node.getChild(be.CodeInfo);c&&(a=i.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==be.CodeText,bracketed:o==be.FencedCode}}else if(t&&(o==be.HTMLBlock||o==be.HTMLTag||o==be.CommentBlock))return{parser:t,overlay:NA(s.node,s.from,s.to)};return null})}}const WA={resolve:"Strikethrough",mark:"StrikethroughMark"},jA={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":P.strikethrough}},{name:"StrikethroughMark",style:P.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let r=n.slice(t-1,t),s=n.slice(t+2,t+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=Eo.test(r),l=Eo.test(s);return n.addDelimiter(WA,t,t+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function fo(n,e,t=0,r,s=0){let i=0,o=!0,a=-1,l=-1,c=!1,u=()=>{r.push(n.elt("TableCell",s+a,s+l,n.parser.parseInline(e.slice(a,l),s+a)))};for(let h=t;h<e.length;h++){let f=e.charCodeAt(h);f==124&&!c?((!o||a>-1)&&i++,o=!1,r&&(a>-1&&u(),r.push(n.elt("TableDelimiter",h+s,h+s+1))),a=l=-1):(c||f!=32&&f!=9)&&(a<0&&(a=h),l=h+1),c=!c&&f==92}return a>-1&&(i++,r&&u()),i}function nm(n,e){for(let t=e;t<n.length;t++){let r=n.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}const Y1=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class rm{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let s;if((t.next==45||t.next==58||t.next==124)&&Y1.test(s=t.text.slice(t.pos))){let i=[];fo(e,r.content,0,i,r.start)==fo(e,s,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,i),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let s=[];fo(e,t.text,t.pos,s,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,s))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const qA={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":P.heading}},"TableRow",{name:"TableCell",style:P.content},{name:"TableDelimiter",style:P.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return nm(e.content,0)?new rm:null},endLeaf(n,e,t){if(t.parsers.some(s=>s instanceof rm)||!nm(e.text,e.basePos))return!1;let r=n.peekLine();return Y1.test(r)&&fo(n,e.text,e.basePos)==fo(n,r,e.basePos)},before:"SetextHeading"}]};class YA{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const FA={defineNodes:[{name:"Task",block:!0,style:P.list},{name:"TaskMarker",style:P.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new YA:null},after:"SetextHeading"}]},sm=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,im=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,UA=/[\w-]+\.[\w-]+($|\/)/,om=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,am=/\/[a-zA-Z\d@.]+/gy;function lm(n,e,t,r){let s=0;for(let i=e;i<t;i++)n[i]==r&&s++;return s}function GA(n,e){im.lastIndex=e;let t=im.exec(n);if(!t||UA.exec(t[0])[0].indexOf("_")>-1)return-1;let r=e+t[0].length;for(;;){let s=n[r-1],i;if(/[?!.,:*_~]/.test(s)||s==")"&&lm(n,e,r,")")>lm(n,e,r,"("))r--;else if(s==";"&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,r))))r=e+i.index;else break}return r}function cm(n,e){om.lastIndex=e;let t=om.exec(n);if(!t)return-1;let r=t[0][t[0].length-1];return r=="_"||r=="-"?-1:e+t[0].length-(r=="."?1:0)}const HA={parseInline:[{name:"Autolink",parse(n,e,t){let r=t-n.offset;if(r&&/\w/.test(n.text[r-1]))return-1;sm.lastIndex=r;let s=sm.exec(n.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=GA(n.text,r+s[0].length),i>-1&&n.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(r,i));i=r+o[0].length}}else s[3]?i=cm(n.text,r):(i=cm(n.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(am.lastIndex=i,s=am.exec(n.text),s&&(i=s.index+s[0].length)));return i<0?-1:(n.addElement(n.elt("URL",t,i+n.offset)),i+n.offset)}}]},KA=[qA,FA,jA,HA];function F1(n,e,t){return(r,s,i)=>{if(s!=n||r.char(i+1)==n)return-1;let o=[r.elt(t,i,i+1)];for(let a=i+1;a<r.end;a++){let l=r.char(a);if(l==n)return r.addElement(r.elt(e,i,a+1,o.concat(r.elt(t,a,a+1))));if(l==92&&o.push(r.elt("Escape",a,a+++2)),tr(l))break}return-1}}const JA={defineNodes:[{name:"Superscript",style:P.special(P.content)},{name:"SuperscriptMark",style:P.processingInstruction}],parseInline:[{name:"Superscript",parse:F1(94,"Superscript","SuperscriptMark")}]},e_={defineNodes:[{name:"Subscript",style:P.special(P.content)},{name:"SubscriptMark",style:P.processingInstruction}],parseInline:[{name:"Subscript",parse:F1(126,"Subscript","SubscriptMark")}]},t_={defineNodes:[{name:"Emoji",style:P.character}],parseInline:[{name:"Emoji",parse(n,e,t){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+r[0].length))}}]};var um={};class Ml{constructor(e,t,r,s,i,o,a,l,c,u=0,h){this.p=e,this.stack=t,this.state=r,this.reducePos=s,this.pos=i,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let s=e.parser.context;return new Ml(e,[],t,r,r,0,[],0,s?new hm(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,s=e&65535,{parser:i}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=i.dynamicPrecedence(s);if(a&&(this.score+=a),r==0){this.pushState(i.getGoto(this.state,s,!0),this.reducePos),s<i.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(s,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let h=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-h;if(s<i.minRepeatTerm||e&131072){let m=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,c,m,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=i.getGoto(m,s,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(s,c)}storeNode(e,t,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==r)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,t,r,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=s}}shift(e,t,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:o}=this.p;this.pos=s;let a=o.stateFlag(i,1);!a&&(s>r||t<=o.maxNode)&&(this.reducePos=s),this.pushState(i,a?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,s,4)}else this.pos=s,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,s,4)}apply(e,t,r,s){e&65536?this.reduce(e):this.shift(e,t,r,s)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new Ml(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new n_(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let i=0,o;i<t.length;i+=2)(o=t[i+1])!=this.state&&this.p.parser.hasAction(o,e)&&s.push(t[i],o);if(this.stack.length<120)for(let i=0;s.length<8&&i<t.length;i+=2){let o=t[i+1];s.some((a,l)=>l&1&&a==o)||s.push(t[i],o)}t=s}let r=[];for(let s=0;s<t.length&&r.length<4;s+=2){let i=t[s+1];if(i==this.state)continue;let o=this.split();o.pushState(i,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[s],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,s=t&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(s,i)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-i;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,i+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new hm(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class hm{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class n_{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class Al{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Al(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Al(this.stack,this.pos,this.index)}}function ro(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,s=0;r<n.length;){let i=0;for(;;){let o=n.charCodeAt(r++),a=!1;if(o==126){i=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),i+=l,a)break;i*=46}t?t[s++]=i:t=new e(i)}return t}class Ya{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const dm=new Ya;class r_{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=dm,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!s)return null;let o=this.ranges[--s];i-=r.from-o.to,r=o}for(;t<0?i>r.to:i>=r.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];i+=o.from-r.to,r=o}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,s;if(t>=0&&t<this.chunk.length)r=this.pos+e,s=this.chunk.charCodeAt(t);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=dm,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return r}}class pi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;U1(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}pi.prototype.contextual=pi.prototype.fallback=pi.prototype.extend=!1;class _l{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?ro(e):e}token(e,t){let r=e.pos,s=0;for(;;){let i=e.next<0,o=e.resolveOffset(1,1);if(U1(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(i||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(r,e.token),e.acceptToken(this.elseToken,s))}}_l.prototype.contextual=pi.prototype.fallback=pi.prototype.extend=!1;class In{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function U1(n,e,t,r,s,i){let o=0,a=1<<r,{dialect:l}=t.p.parser;e:for(;(a&n[o])!=0;){let c=n[o+1];for(let m=o+3;m<c;m+=2)if((n[m+1]&a)>0){let g=n[m];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||s_(g,e.token.value,s,i))){e.acceptToken(g);break}}let u=e.next,h=0,f=n[o+2];if(e.next<0&&f>h&&n[c+f*3-3]==65535){o=n[c+f*3-1];continue e}for(;h<f;){let m=h+f>>1,g=c+m+(m<<1),O=n[g],y=n[g+1]||65536;if(u<O)f=m;else if(u>=y)h=m+1;else{o=n[g+2],e.advance();continue e}}break}}function fm(n,e,t){for(let r=e,s;(s=n[r])!=65535;r++)if(s==t)return r-e;return-1}function s_(n,e,t,r){let s=fm(t,r,e);return s<0||fm(t,r,n)<s}const An=typeof process<"u"&&um&&/\bparse\b/.test(um.LOG);let Vc=null;function pm(n,e,t){let r=n.cursor(ht.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class i_{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?pm(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?pm(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],s=this.index[t];if(s==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[s],o=this.start[t]+r.positions[s];if(o>e)return this.nextStart=o,null;if(i instanceof ut){if(o==e){if(o<this.safeFrom)return null;let a=o+i.length;if(a<=this.safeTo){let l=i.prop(Je.lookAhead);if(!l||a+l<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class o_{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ya)}getActions(e){let t=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,o=s.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<i.length;c++){if((1<<c&o)==0)continue;let u=i[c],h=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||h.start!=e.pos||h.mask!=o||h.context!=a)&&(this.updateCachedToken(h,u,e),h.mask=o,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!u.extend&&(r=h,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Ya,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ya,{pos:r,p:s}=e;return t.start=r,t.end=Math.min(r+1,s.stream.end),t.value=r==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,r){let s=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let o=0;o<i.specialized.length;o++)if(i.specialized[o]==e.value){let a=i.specializers[o](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,r,s){for(let i=0;i<s;i+=3)if(this.actions[i]==e)return s;return this.actions[s++]=e,this.actions[s++]=t,this.actions[s++]=r,s}addActions(e,t,r,s){let{state:i}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(i,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Vr(a,c+2);else{s==0&&a[c+1]==2&&(s=this.putAction(Vr(a,c+2),t,r,s));break}a[c]==t&&(s=this.putAction(Vr(a,c+1),t,r,s))}return s}}class a_{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new r_(t,s),this.tokens=new o_(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[Ml.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new i_(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)r.push(a);else{if(this.advanceStack(a,r,e))continue;{s||(s=[],i=[]),s.push(a);let l=this.tokens.getMainToken(a);i.push(l.value,l.end)}}break}}if(!r.length){let o=s&&c_(s);if(o)return An&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw An&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(o)return An&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let s=e.pos,{parser:i}=this,o=An?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(s);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?i.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(Je.contextHash)||0)==u))return e.useNode(h,f),An&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(h.type.id)})`),!0;if(!(h instanceof ut)||h.children.length==0||h.positions[0]>0)break;let m=h.children[0];if(m instanceof ut&&h.positions[0]==0)h=m;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),An&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],h=l[c++],f=l[c++],m=c==l.length||!r,g=m?e:e.split(),O=this.tokens.mainToken;if(g.apply(u,h,O?O.start:g.pos,f),An&&console.log(o+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${i.getName(u&65535)}`} for ${i.getName(h)} @ ${s}${g==e?"":", split"})`),m)return!0;g.pos>s?t.push(g):r.push(g)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return mm(e,t),!0}}runRecovery(e,t,r){let s=null,i=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],c=t[(o<<1)+1],u=An?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),An&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=u;for(let m=0;m<10&&h.forceReduce()&&(An&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));m++)An&&(f=this.stackID(h)+" -> ");for(let m of a.recoverByInsert(l))An&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),An&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),mm(a,r)):(!s||s.score<h.score)&&(s=h)}return s}stackToTree(e){return e.close(),ut.build({buffer:Al.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Vc||(Vc=new WeakMap)).get(e);return t||Vc.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function mm(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class l_{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Wc=n=>n;class G1{constructor(e){this.start=e.start,this.shift=e.shift||Wc,this.reduce=e.reduce||Wc,this.reuse=e.reuse||Wc,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Qi extends rd{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),s=[];for(let a=0;a<t.length;a++)s.push([]);function i(a,l,c){s[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=Je[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)i(u,l,a[c++]);else{let h=a[c+-u];for(let f=-u;f>0;f--)i(a[c++],l,h);c++}}}this.nodeSet=new qo(t.map((a,l)=>Nt.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:s[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=e0;let o=ro(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(gm),this.states=ro(e.states,Uint32Array),this.data=ro(e.stateData),this.goto=ro(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new pi(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let s=new a_(this,e,t,r);for(let i of this.wrappers)s=i(s,e,t,r);return s}getGoto(e,t,r=!1){let s=this.goto;if(t>=s[0])return-1;for(let i=s[t+1];;){let o=s[i++],a=o&1,l=s[i++];if(a&&r)return l;for(let c=i+(o>>1);i<c;i++)if(s[i]==e)return l;if(a)return-1}}hasAction(e,t){let r=this.data;for(let s=0;s<2;s++)for(let i=this.stateSlot(e,s?2:1),o;;i+=3){if((o=r[i])==65535)if(r[i+1]==1)o=r[i=Vr(r,i+2)];else{if(r[i+1]==2)return Vr(r,i+2);break}if(o==t||o==0)return Vr(r,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),s=r?t(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Vr(this.data,i+2);else break;s=t(Vr(this.data,i+1))}return s}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Vr(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];t.some((i,o)=>o&1&&i==s)||t.push(this.data[r],s)}}return t}configure(e){let t=Object.assign(Object.create(Qi.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(a=>a.from==r.external);if(!i)return r;let o=Object.assign(Object.assign({},r),{external:i.to});return t.specializers[s]=gm(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let i of e.split(" ")){let o=t.indexOf(i);o>=0&&(r[o]=!0)}let s=null;for(let i=0;i<t.length;i++)if(!r[i])for(let o=this.dialects[t[i]],a;(a=this.data[o++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[a]=1;return new l_(e,r,s)}static deserialize(e){return new Qi(e)}}function Vr(n,e){return n[e]|n[e+1]<<16}function c_(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function gm(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const u_=55,h_=1,d_=56,f_=2,p_=57,m_=3,Om=4,g_=5,Pd=6,H1=7,K1=8,J1=9,ev=10,O_=11,v_=12,b_=13,jc=58,x_=14,y_=15,vm=59,tv=21,k_=23,nv=24,w_=25,lh=27,rv=28,S_=29,$_=32,C_=35,Q_=37,P_=38,T_=0,M_=1,A_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},__={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},bm={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function R_(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let xm=null,ym=null,km=0;function ch(n,e){let t=n.pos+e;if(km==t&&ym==n)return xm;let r=n.peek(e),s="";for(;R_(r);)s+=String.fromCharCode(r),r=n.peek(++e);return ym=n,km=t,xm=s?s.toLowerCase():r==E_||r==B_?void 0:null}const sv=60,Rl=62,Td=47,E_=63,B_=33,L_=45;function wm(n,e){this.name=n,this.parent=e}const D_=[Pd,ev,H1,K1,J1],Z_=new G1({start:null,shift(n,e,t,r){return D_.indexOf(e)>-1?new wm(ch(r,1)||"",n):n},reduce(n,e){return e==tv&&n?n.parent:n},reuse(n,e,t,r){let s=e.type.id;return s==Pd||s==Q_?new wm(ch(r,1)||"",n):n},strict:!1}),I_=new In((n,e)=>{if(n.next!=sv){n.next<0&&e.context&&n.acceptToken(jc);return}n.advance();let t=n.next==Td;t&&n.advance();let r=ch(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?y_:x_);let s=e.context?e.context.name:null;if(t){if(r==s)return n.acceptToken(O_);if(s&&__[s])return n.acceptToken(jc,-2);if(e.dialectEnabled(T_))return n.acceptToken(v_);for(let i=e.context;i;i=i.parent)if(i.name==r)return;n.acceptToken(b_)}else{if(r=="script")return n.acceptToken(H1);if(r=="style")return n.acceptToken(K1);if(r=="textarea")return n.acceptToken(J1);if(A_.hasOwnProperty(r))return n.acceptToken(ev);s&&bm[s]&&bm[s][r]?n.acceptToken(jc,-1):n.acceptToken(Pd)}},{contextual:!0}),X_=new In(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(vm);break}if(n.next==L_)e++;else if(n.next==Rl&&e>=2){t>=3&&n.acceptToken(vm,-2);break}else e=0;n.advance()}});function z_(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const N_=new In((n,e)=>{if(n.next==Td&&n.peek(1)==Rl){let t=e.dialectEnabled(M_)||z_(e.context);n.acceptToken(t?g_:Om,2)}else n.next==Rl&&n.acceptToken(Om,1)});function Md(n,e,t){let r=2+n.length;return new In(s=>{for(let i=0,o=0,a=0;;a++){if(s.next<0){a&&s.acceptToken(e);break}if(i==0&&s.next==sv||i==1&&s.next==Td||i>=2&&i<r&&s.next==n.charCodeAt(i-2))i++,o++;else if(i==r&&s.next==Rl){a>o?s.acceptToken(e,-o):s.acceptToken(t,-(o-2));break}else if((s.next==10||s.next==13)&&a){s.acceptToken(e,1);break}else i=o=0;s.advance()}})}const V_=Md("script",u_,h_),W_=Md("style",d_,f_),j_=Md("textarea",p_,m_),q_=Ai({"Text RawText IncompleteTag IncompleteCloseTag":P.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":P.angleBracket,TagName:P.tagName,"MismatchedCloseTag/TagName":[P.tagName,P.invalid],AttributeName:P.attributeName,"AttributeValue UnquotedAttributeValue":P.attributeValue,Is:P.definitionOperator,"EntityReference CharacterReference":P.character,Comment:P.blockComment,ProcessingInst:P.processingInstruction,DoctypeDecl:P.documentMeta}),Y_=Qi.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'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gaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:Z_,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[q_],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(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6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[V_,W_,j_,N_,I_,X_,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function iv(n,e){let t=Object.create(null);for(let r of n.getChildren(nv)){let s=r.getChild(w_),i=r.getChild(lh)||r.getChild(rv);s&&(t[e.read(s.from,s.to)]=i?i.type.id==lh?e.read(i.from+1,i.to-1):e.read(i.from,i.to):"")}return t}function Sm(n,e){let t=n.getChild(k_);return t?e.read(t.from,t.to):" "}function qc(n,e,t){let r;for(let s of t)if(!s.attrs||s.attrs(r||(r=iv(n.node.parent.firstChild,e))))return{parser:s.parser,bracketed:!0};return null}function ov(n=[],e=[]){let t=[],r=[],s=[],i=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?r:a.tag=="textarea"?s:i).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return i0((a,l)=>{let c=a.type.id;if(c==S_)return qc(a,l,t);if(c==$_)return qc(a,l,r);if(c==C_)return qc(a,l,s);if(c==tv&&i.length){let u=a.node,h=u.firstChild,f=h&&Sm(h,l),m;if(f){for(let g of i)if(g.tag==f&&(!g.attrs||g.attrs(m||(m=iv(h,l))))){let O=u.lastChild,y=O.type.id==P_?O.from:u.to;if(y>h.to)return{parser:g.parser,overlay:[{from:h.to,to:y}]}}}}if(o&&c==nv){let u=a.node,h;if(h=u.firstChild){let f=o[l.read(h.from,h.to)];if(f)for(let m of f){if(m.tagName&&m.tagName!=Sm(u.parent,l))continue;let g=u.lastChild;if(g.type.id==lh){let O=g.from+1,y=g.lastChild,x=g.to-(y&&y.isError?0:1);if(x>O)return{parser:m.parser,overlay:[{from:O,to:x}],bracketed:!0}}else if(g.type.id==rv)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const F_=122,$m=1,U_=123,G_=124,av=2,H_=125,K_=3,J_=4,lv=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],e4=58,t4=40,cv=95,n4=91,Fa=45,r4=46,s4=35,i4=37,o4=38,a4=92,l4=10,c4=42;function Bo(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function Ad(n){return n>=48&&n<=57}function Cm(n){return Ad(n)||n>=97&&n<=102||n>=65&&n<=70}const uv=(n,e,t)=>(r,s)=>{for(let i=!1,o=0,a=0;;a++){let{next:l}=r;if(Bo(l)||l==Fa||l==cv||i&&Ad(l))!i&&(l!=Fa||a>0)&&(i=!0),o===a&&l==Fa&&o++,r.advance();else if(l==a4&&r.peek(1)!=l4){if(r.advance(),Cm(r.next)){do r.advance();while(Cm(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();i=!0}else{i&&r.acceptToken(o==2&&s.canShift(av)?e:l==t4?t:n);break}}},u4=new In(uv(U_,av,G_)),h4=new In(uv(H_,K_,J_)),d4=new In(n=>{if(lv.includes(n.peek(-1))){let{next:e}=n;(Bo(e)||e==cv||e==s4||e==r4||e==c4||e==n4||e==e4&&Bo(n.peek(1))||e==Fa||e==o4)&&n.acceptToken(F_)}}),f4=new In(n=>{if(!lv.includes(n.peek(-1))){let{next:e}=n;if(e==i4&&(n.advance(),n.acceptToken($m)),Bo(e)){do n.advance();while(Bo(n.next)||Ad(n.next));n.acceptToken($m)}}}),p4=Ai({"AtKeyword import charset namespace keyframes media supports":P.definitionKeyword,"from to selector":P.keyword,NamespaceName:P.namespace,KeyframeName:P.labelName,KeyframeRangeName:P.operatorKeyword,TagName:P.tagName,ClassName:P.className,PseudoClassName:P.constant(P.className),IdName:P.labelName,"FeatureName PropertyName":P.propertyName,AttributeName:P.attributeName,NumberLiteral:P.number,KeywordQuery:P.keyword,UnaryQueryOp:P.operatorKeyword,"CallTag ValueName":P.atom,VariableName:P.variableName,Callee:P.operatorKeyword,Unit:P.unit,"UniversalSelector NestingSelector":P.definitionOperator,"MatchOp CompareOp":P.compareOperator,"ChildOp SiblingOp, LogicOp":P.logicOperator,BinOp:P.arithmeticOperator,Important:P.modifier,Comment:P.blockComment,ColorLiteral:P.color,"ParenthesizedContent StringLiteral":P.string,":":P.punctuation,"PseudoOp #":P.derefOperator,"; ,":P.separator,"( )":P.paren,"[ ]":P.squareBracket,"{ }":P.brace}),m4={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},g4={__proto__:null,or:98,and:98,not:106,only:106,layer:170},O4={__proto__:null,selector:112,layer:166},v4={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":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$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[p4],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy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_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[d4,f4,u4,h4,1,2,3,4,new _l("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:n=>m4[n]||-1},{term:125,get:n=>g4[n]||-1},{term:4,get:n=>O4[n]||-1},{term:25,get:n=>v4[n]||-1},{term:123,get:n=>b4[n]||-1}],tokenPrec:1963});let Yc=null;function Fc(){if(!Yc&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let r in n)r!="cssText"&&r!="cssFloat"&&typeof n[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));Yc=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return Yc||[]}const Qm=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),Pm=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),y4=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),k4=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),Nr=/^(\w[\w-]*|-\w[\w-]*|)$/,w4=/^-(-[\w-]*)?$/;function S4(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let r=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const Tm=new s0,$4=["Declaration"];function C4(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function hv(n,e,t){if(e.to-e.from>4096){let r=Tm.get(e);if(r)return r;let s=[],i=new Set,o=e.cursor(ht.IncludeAnonymous);if(o.firstChild())do for(let a of hv(n,o.node,t))i.has(a.label)||(i.add(a.label),s.push(a));while(o.nextSibling());return Tm.set(e,s),s}else{let r=[],s=new Set;return e.cursor().iterate(i=>{var o;if(t(i)&&i.matchContext($4)&&((o=i.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(i.from,i.to);s.has(a)||(s.add(a),r.push({label:a,type:"variable"}))}}),r}}const Q4=n=>e=>{let{state:t,pos:r}=e,s=yt(t).resolveInner(r,-1),i=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(i||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Fc(),validFor:Nr};if(s.name=="ValueName")return{from:s.from,options:Pm,validFor:Nr};if(s.name=="PseudoClassName")return{from:s.from,options:Qm,validFor:Nr};if(n(s)||(e.explicit||i)&&S4(s,t.doc))return{from:n(s)||i?s.from:r,options:hv(t.doc,C4(s),n),validFor:w4};if(s.name=="TagName"){for(let{parent:l}=s;l;l=l.parent)if(l.name=="Block")return{from:s.from,options:Fc(),validFor:Nr};return{from:s.from,options:y4,validFor:Nr}}if(s.name=="AtKeyword")return{from:s.from,options:k4,validFor:Nr};if(!e.explicit)return null;let o=s.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:Qm,validFor:Nr}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:Pm,validFor:Nr}:o.name=="Block"||o.name=="Styles"?{from:r,options:Fc(),validFor:Nr}:null},P4=Q4(n=>n.name=="VariableName"),El=wi.define({name:"css",parser:x4.configure({props:[Fo.add({Declaration:qa()}),_i.add({"Block KeyframeList":d0})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function T4(){return new $o(El,El.data.of({autocomplete:P4}))}const M4=316,A4=317,Mm=1,_4=2,R4=3,E4=4,B4=318,L4=320,D4=321,Z4=5,I4=6,X4=0,uh=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],dv=125,z4=59,hh=47,N4=42,V4=43,W4=45,j4=60,q4=44,Y4=63,F4=46,U4=91,G4=new G1({start:!1,shift(n,e){return e==Z4||e==I4||e==L4?n:e==D4},strict:!1}),H4=new In((n,e)=>{let{next:t}=n;(t==dv||t==-1||e.context)&&n.acceptToken(B4)},{contextual:!0,fallback:!0}),K4=new In((n,e)=>{let{next:t}=n,r;uh.indexOf(t)>-1||t==hh&&((r=n.peek(1))==hh||r==N4)||t!=dv&&t!=z4&&t!=-1&&!e.context&&n.acceptToken(M4)},{contextual:!0}),J4=new In((n,e)=>{n.next==U4&&!e.context&&n.acceptToken(A4)},{contextual:!0}),eR=new In((n,e)=>{let{next:t}=n;if(t==V4||t==W4){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(Mm);n.acceptToken(r?Mm:_4)}}else t==Y4&&n.peek(1)==F4&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(R4))},{contextual:!0});function Uc(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const tR=new In((n,e)=>{if(n.next!=j4||!e.dialectEnabled(X4)||(n.advance(),n.next==hh))return;let t=0;for(;uh.indexOf(n.next)>-1;)n.advance(),t++;if(Uc(n.next,!0)){for(n.advance(),t++;Uc(n.next,!1);)n.advance(),t++;for(;uh.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==q4)return;for(let r=0;;r++){if(r==7){if(!Uc(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(E4,-t)}),nR=Ai({"get set async static":P.modifier,"for while do if else switch try catch finally return throw break continue default case defer":P.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":P.operatorKeyword,"let var const using function class extends":P.definitionKeyword,"import export from":P.moduleKeyword,"with debugger new":P.keyword,TemplateString:P.special(P.string),super:P.atom,BooleanLiteral:P.bool,this:P.self,null:P.null,Star:P.modifier,VariableName:P.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":P.function(P.variableName),VariableDefinition:P.definition(P.variableName),Label:P.labelName,PropertyName:P.propertyName,PrivatePropertyName:P.special(P.propertyName),"CallExpression/MemberExpression/PropertyName":P.function(P.propertyName),"FunctionDeclaration/VariableDefinition":P.function(P.definition(P.variableName)),"ClassDeclaration/VariableDefinition":P.definition(P.className),"NewExpression/VariableName":P.className,PropertyDefinition:P.definition(P.propertyName),PrivatePropertyDefinition:P.definition(P.special(P.propertyName)),UpdateOp:P.updateOperator,"LineComment Hashbang":P.lineComment,BlockComment:P.blockComment,Number:P.number,String:P.string,Escape:P.escape,ArithOp:P.arithmeticOperator,LogicOp:P.logicOperator,BitOp:P.bitwiseOperator,CompareOp:P.compareOperator,RegExp:P.regexp,Equals:P.definitionOperator,Arrow:P.function(P.punctuation),": Spread":P.punctuation,"( )":P.paren,"[ ]":P.squareBracket,"{ }":P.brace,"InterpolationStart InterpolationEnd":P.special(P.brace),".":P.derefOperator,", ;":P.separator,"@":P.meta,TypeName:P.typeName,TypeDefinition:P.definition(P.typeName),"type enum interface implements namespace module declare":P.definitionKeyword,"abstract global Privacy readonly override":P.modifier,"is keyof unique infer asserts":P.operatorKeyword,JSXAttributeValue:P.attributeValue,JSXText:P.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":P.angleBracket,"JSXIdentifier JSXNameSpacedName":P.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":P.attributeName,"JSXBuiltin/JSXIdentifier":P.standard(P.tagName)}),rR={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},sR={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},iR={__proto__:null,"<":193},oR=Qi.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#J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R1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:G4,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[nR],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#B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#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[K4,J4,eR,tR,2,3,4,5,6,7,8,9,10,11,12,13,14,H4,new _l("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new _l("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>rR[n]||-1},{term:343,get:n=>sR[n]||-1},{term:95,get:n=>iR[n]||-1}],tokenPrec:15201}),fv=[yn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),yn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),yn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),yn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),yn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),yn(`try {
84
+ \${}
85
+ } catch (\${error}) {
86
+ \${}
87
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),yn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),yn(`if (\${}) {
88
+ \${}
89
+ } else {
90
+ \${}
91
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),yn(`class \${name} {
92
+ constructor(\${params}) {
93
+ \${}
94
+ }
95
+ }`,{label:"class",detail:"definition",type:"keyword"}),yn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),yn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],aR=fv.concat([yn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),yn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),yn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Am=new s0,pv=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Hi(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const lR=["FunctionDeclaration"],cR={FunctionDeclaration:Hi("function"),ClassDeclaration:Hi("class"),ClassExpression:()=>!0,EnumDeclaration:Hi("constant"),TypeAliasDeclaration:Hi("type"),NamespaceDeclaration:Hi("namespace"),VariableDefinition(n,e){n.matchContext(lR)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function mv(n,e){let t=Am.get(e);if(t)return t;let r=[],s=!0;function i(o,a){let l=n.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(ht.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let a=cR[o.name];if(a&&a(o,i)||pv.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of mv(n,o.node))r.push(a);return!1}}),Am.set(e,r),r}const _m=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,gv=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function uR(n){let e=yt(n.state).resolveInner(n.pos,-1);if(gv.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&_m.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)pv.has(s.name)&&(r=r.concat(mv(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:_m}}const Er=wi.define({name:"javascript",parser:oR.configure({props:[Fo.add({IfStatement:qa({except:/^\s*({|else\b)/}),TryStatement:qa({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:JP,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:KP({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":qa({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),_i.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":d0,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Ov={test:n=>/^JSX/.test(n.name),facet:sd({commentTokens:{block:{open:"{/*",close:"*/}"}}})},vv=Er.configure({dialect:"ts"},"typescript"),bv=Er.configure({dialect:"jsx",props:[id.add(n=>n.isTop?[Ov]:void 0)]}),xv=Er.configure({dialect:"jsx ts",props:[id.add(n=>n.isTop?[Ov]:void 0)]},"typescript");let yv=n=>({label:n,type:"keyword"});const kv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(yv),hR=kv.concat(["declare","implements","private","protected","public"].map(yv));function dR(n={}){let e=n.jsx?n.typescript?xv:bv:n.typescript?vv:Er,t=n.typescript?aR.concat(hR):fv.concat(kv);return new $o(e,[Er.data.of({autocomplete:xM(gv,d1(t))}),Er.data.of({autocomplete:uR}),n.jsx?mR:[]])}function fR(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function Rm(n,e,t=n.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const pR=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),mR=$e.inputHandler.of((n,e,t,r,s)=>{if((pR?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Er.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c;let{head:u}=l,h=yt(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&h.name=="JSXStartCloseTag"){let m=h.parent,g=m.parent;if(g&&m.from==u-2&&((f=Rm(o.doc,g.firstChild,u))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let O=`${f}>`;return{range:ae.cursor(u+O.length,-1),changes:{from:u,insert:O}}}}else if(r==">"){let m=fR(h);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Rm(o.doc,m,u)))return{range:l,changes:{from:u,insert:`</${f}>`}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ki=["_blank","_self","_top","_parent"],Gc=["ascii","utf-8","utf-16","latin1","latin1"],Hc=["get","post","put","delete"],Kc=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],_n=["true","false"],Ie={},gR={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ki,hreflang:null}},abbr:Ie,address:Ie,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ie,aside:Ie,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ie,base:{attrs:{href:null,target:Ki}},bdi:Ie,bdo:Ie,blockquote:{attrs:{cite:null}},body:Ie,br:Ie,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Kc,formmethod:Hc,formnovalidate:["novalidate"],formtarget:Ki,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ie,center:Ie,cite:Ie,code:Ie,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ie,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ie,div:Ie,dl:Ie,dt:Ie,em:Ie,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ie,figure:Ie,footer:Ie,form:{attrs:{action:null,name:null,"accept-charset":Gc,autocomplete:["on","off"],enctype:Kc,method:Hc,novalidate:["novalidate"],target:Ki}},h1:Ie,h2:Ie,h3:Ie,h4:Ie,h5:Ie,h6:Ie,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ie,hgroup:Ie,hr:Ie,html:{attrs:{manifest:null}},i:Ie,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Kc,formmethod:Hc,formnovalidate:["novalidate"],formtarget:Ki,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ie,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ie,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ie,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Gc,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ie,noscript:Ie,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ie,param:{attrs:{name:null,value:null}},pre:Ie,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ie,rt:Ie,ruby:Ie,samp:Ie,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Gc}},section:Ie,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ie,source:{attrs:{src:null,type:null,media:null}},span:Ie,strong:Ie,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ie,summary:Ie,sup:Ie,table:Ie,tbody:Ie,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ie,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ie,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ie,time:{attrs:{datetime:null}},title:Ie,tr:Ie,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ie,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ie},wv={accesskey:null,class:null,contenteditable:_n,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:_n,autocorrect:_n,autocapitalize:_n,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":_n,"aria-autocomplete":["inline","list","both","none"],"aria-busy":_n,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":_n,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":_n,"aria-hidden":_n,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":_n,"aria-multiselectable":_n,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":_n,"aria-relevant":null,"aria-required":_n,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Sv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of Sv)wv[n]=null;class Lo{constructor(e,t){this.tags={...gR,...e},this.globalAttrs={...wv,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Lo.default=new Lo;function Pi(n,e,t=n.length){if(!e)return"";let r=e.firstChild,s=r&&r.getChild("TagName");return s?n.sliceString(s.from,Math.min(s.to,t)):""}function Ti(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function $v(n,e,t){let r=t.tags[Pi(n,Ti(e))];return r?.children||t.allTags}function _d(n,e){let t=[];for(let r=Ti(e);r&&!r.type.isTop;r=Ti(r.parent)){let s=Pi(n,r);if(s&&r.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(s)}return t}const Cv=/^[:\-\.\w\u00b7-\uffff]*$/;function Em(n,e,t,r,s){let i=/\s*>/.test(n.sliceDoc(s,s+5))?"":">",o=Ti(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:s,options:$v(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(_d(n.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+i,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Bm(n,e,t,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:_d(n.doc,e).map((i,o)=>({label:i,apply:i+s,type:"type",boost:99-o})),validFor:Cv}}function OR(n,e,t,r){let s=[],i=0;for(let o of $v(n.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of _d(n.doc,t))s.push({label:"</"+o+">",type:"type",boost:99-i++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function vR(n,e,t,r,s){let i=Ti(t),o=i?e.tags[Pi(n.doc,i)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:s,options:l.map(c=>({label:c,type:"property"})),validFor:Cv}}function bR(n,e,t,r,s){var i;let o=(i=t.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),a=[],l;if(o){let c=n.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=Ti(t),f=h?e.tags[Pi(n.doc,h)]:null;u=f?.attrs&&f.attrs[c]}if(u){let h=n.sliceDoc(r,s).toLowerCase(),f='"',m='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",m=n.sliceDoc(s,s+1)==h[0]?"":h[0],h=h.slice(1),r++):l=/^[^\s<>='"]*$/;for(let g of u)a.push({label:g,apply:f+g+m,type:"constant"})}}return{from:r,to:s,options:a,validFor:l}}function Qv(n,e){let{state:t,pos:r}=e,s=yt(t).resolveInner(r,-1),i=s.resolve(r);for(let o=r,a;i==s&&(a=s.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;i=s=a,o=l.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Bm(t,s,s.from,r):Em(t,n,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?Em(t,n,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Bm(t,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?vR(t,n,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?bR(t,n,s,s.name=="Is"?r:s.from,r):e.explicit&&(i.name=="Element"||i.name=="Text"||i.name=="Document")?OR(t,n,s,r):null}function xR(n){return Qv(Lo.default,n)}function yR(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new Lo(e,t):Lo.default;return s=>Qv(r,s)}const kR=Er.parser.configure({top:"SingleExpression"}),Pv=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:vv.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:bv.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:xv.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:kR},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Er.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:El.parser}],Tv=[{name:"style",parser:El.parser.configure({top:"Styles"})}].concat(Sv.map(n=>({name:n,parser:Er.parser}))),Mv=wi.define({name:"html",parser:Y_.configure({props:[Fo.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;e=r=s}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),_i.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),$0.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Ua=Mv.configure({wrap:ov(Pv,Tv)});function wR(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=ov((n.nestedLanguages||[]).concat(Pv),(n.nestedAttributes||[]).concat(Tv)));let r=t?Mv.configure({wrap:t,dialect:e}):e?Ua.configure({dialect:e}):Ua;return new $o(r,[Ua.data.of({autocomplete:yR(n)}),n.autoCloseTags!==!1?SR:[],dR().support,T4().support])}const Lm=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),SR=$e.inputHandler.of((n,e,t,r,s)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Ua.isActiveAt(n.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c,u,h;let f=o.doc.sliceString(l.from-1,l.to)==r,{head:m}=l,g=yt(o).resolveInner(m,-1),O;if(f&&r==">"&&g.name=="EndTag"){let y=g.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(O=Pi(o.doc,y.parent,m))&&!Lm.has(O)){let x=m+(o.doc.sliceString(m,m+1)===">"?1:0),S=`</${O}>`;return{range:l,changes:{from:m,to:x,insert:S}}}}else if(f&&r=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==m-2&&((h=y.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(O=Pi(o.doc,y,m))&&!Lm.has(O)){let x=m+(o.doc.sliceString(m,m+1)===">"?1:0),S=`${O}>`;return{range:ae.cursor(m+S.length,-1),changes:{from:m,to:x,insert:S}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Av=sd({commentTokens:{block:{open:"<!--",close:"-->"}}}),_v=new Je,Rv=zA.configure({props:[_i.add(n=>!n.is("Block")||n.is("Document")||dh(n)!=null||$R(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),_v.add(dh),Fo.add({Document:()=>null}),Is.add({Document:Av})]});function dh(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function $R(n){return n.name=="OrderedList"||n.name=="BulletList"}function CR(n,e){let t=n;for(;;){let r=t.nextSibling,s;if(!r||(s=dh(r.type))!=null&&s<=e)break;t=r}return t.to}const QR=h0.of((n,e,t)=>{for(let r=yt(n).resolveInner(t,-1);r&&!(r.from<e);r=r.parent){let s=r.type.prop(_v);if(s==null)continue;let i=CR(r,s);if(i>t)return{from:t,to:i}}return null});function Rd(n){return new Yn(Av,n,[],"markdown")}const PR=Rd(Rv),TR=Rv.configure([KA,e_,JA,t_,{props:[_i.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Bl=Rd(TR);function MR(n,e){return t=>{if(t&&n){let r=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?r=n(t):r=gl.matchLanguageName(n,t,!0),r instanceof gl)return r.support?r.support.language.parser:So.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class Jc{constructor(e,t,r,s,i,o,a){this.node=e,this.from=t,this.to=r,this.spaceBefore=s,this.spaceAfter=i,this.type=o,this.item=a}blank(e,t=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(t?this.spaceAfter:"")}}marker(e,t){let r=this.node.name=="OrderedList"?String(+Bv(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Ev(n,e){let t=[],r=[];for(let s=n;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&t.push(s)}for(let s=t.length-1;s>=0;s--){let i=t[s],o,a=e.lineAt(i.from),l=i.from-a.from;if(i.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new Jc(i,l,l+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new Jc(i.parent,l,l+u,o[1],c,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),r.push(new Jc(i.parent,l,l+u,o[1],c,h,i))}}return r}function Bv(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function eu(n,e,t,r=0){for(let s=-1,i=n;;){if(i.name=="ListItem"){let a=Bv(i,e),l=+a[2];if(s>=0){if(l!=s+1)return;t.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(s+2+r)})}s=l}let o=i.nextSibling;if(!o)break;i=o}}function Ed(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(Yo)!=" ")return n;let r=ur(n,4,t),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+n.slice(t)}const AR=(n={})=>({state:e,dispatch:t})=>{let r=yt(e),{doc:s}=e,i=null,o=e.changeByRange(a=>{if(!a.empty||!Bl.isActiveAt(e,a.from,-1)&&!Bl.isActiveAt(e,a.from,1))return i={range:a};let l=a.from,c=s.lineAt(l),u=Ev(r.resolveInner(l,-1),s);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return i={range:a};let h=u[u.length-1];if(h.to-h.spaceAfter.length>l-c.from)return i={range:a};let f=l>=h.to-h.spaceAfter.length&&!/\S/.test(c.text.slice(h.to));if(h.item&&f){let x=h.node.firstChild,S=h.node.getChild("ListItem","ListItem");if(x.to>=l||S&&S.to<l||c.from>0&&!/[^\s>]/.test(s.lineAt(c.from-1).text)||n.nonTightLists===!1){let Q=u.length>1?u[u.length-2]:null,T,D="";Q&&Q.item?(T=c.from+Q.from,D=Q.marker(s,1)):T=c.from+(Q?Q.to:0);let K=[{from:T,to:l,insert:D}];return h.node.name=="OrderedList"&&eu(h.item,s,K,-2),Q&&Q.node.name=="OrderedList"&&eu(Q.item,s,K),{range:ae.cursor(T+D.length),changes:K}}else{let Q=Zm(u,e,c);return{range:ae.cursor(l+Q.length+1),changes:{from:c.from,insert:Q+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&c.from){let x=s.lineAt(c.from-1),S=/>\s*$/.exec(x.text);if(S&&S.index==h.from){let Q=e.changes([{from:x.from+S.index,to:x.to},{from:c.from+h.from,to:c.to}]);return{range:a.map(Q),changes:Q}}}let m=[];h.node.name=="OrderedList"&&eu(h.item,s,m);let g=h.item&&h.item.from<c.from,O="";if(!g||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=h.to)for(let x=0,S=u.length-1;x<=S;x++)O+=x==S&&!g?u[x].marker(s,1):u[x].blank(x<S?ur(c.text,4,u[x+1].from)-O.length:null);let y=l;for(;y>c.from&&/\s/.test(c.text.charAt(y-c.from-1));)y--;return O=Ed(O,e),RR(h.node,e.doc)&&(O=Zm(u,e,c)+e.lineBreak+O),m.push({from:y,to:l,insert:e.lineBreak+O}),{range:ae.cursor(y+O.length+1),changes:m}});return i?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},_R=AR();function Dm(n){return n.name=="QuoteMark"||n.name=="ListMark"}function RR(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,r=n.getChild("ListItem","ListItem");if(!r)return!1;let s=e.lineAt(t.to),i=e.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}function Zm(n,e,t){let r="";for(let s=0,i=n.length-2;s<=i;s++)r+=n[s].blank(s<i?ur(t.text,4,n[s+1].from)-r.length:null,s<i);return Ed(r,e)}function ER(n,e){let t=n.resolveInner(e,-1),r=e;Dm(t)&&(r=t.from,t=t.parent);for(let s;s=t.childBefore(r);)if(Dm(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")t=s.lastChild,r=t.to;else break;return t}const BR=({state:n,dispatch:e})=>{let t=yt(n),r=null,s=n.changeByRange(i=>{let o=i.from,{doc:a}=n;if(i.empty&&Bl.isActiveAt(n,i.from)){let l=a.lineAt(o),c=Ev(ER(t,o),a);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:ae.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let m=u.blank(ur(l.text,4,u.to)-ur(l.text,4,u.from));return f==l.from&&(m=Ed(m,n)),{range:ae.cursor(f+m.length),changes:{from:f,to:l.from+u.to,insert:m}}}if(f<o)return{range:ae.cursor(f),changes:{from:f,to:o}}}}}return r={range:i}});return r?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},LR=[{key:"Enter",run:_R},{key:"Backspace",run:BR}],Lv=wR({matchClosingTags:!1});function DR(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:r=!0,base:{parser:s}=PR,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=Lv}=n;if(!(s instanceof sc))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=n.extensions?[n.extensions]:[],c=[a.support,QR],u;o&&c.push(zR),t instanceof $o?(c.push(t.support),u=t.language):t&&(u=t);let h=e||u?MR(e,u):void 0;l.push(VA({codeParser:h,htmlParser:a.language.parser})),r&&c.push(es.high(Wo.of(LR)));let f=Rd(s.configure(l));return i&&c.push(f.data.of({autocomplete:ZR})),new $o(f,c)}function ZR(n){let{state:e,pos:t}=n,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!r)return null;let s=yt(e).resolveInner(t,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:t-r[0].length,to:t,options:IR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let tu=null;function IR(){if(tu)return tu;let n=xR(new md(st.create({extensions:Lv}),0,!0));return tu=n?n.options:[]}const XR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,zR=$e.domEventHandlers({paste:(n,e)=>{var t;let{main:r}=e.state.selection;if(r.empty)return!1;let s=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!Bl.isActiveAt(e.state,r.from,1)))return!1;let i=yt(e.state),o=!1;return i.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||XR.test(a.name))&&(o=!0)},leave:a=>{a.to<r.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),NR="#e5c07b",Im="#e06c75",VR="#56b6c2",WR="#ffffff",Ga="#abb2bf",fh="#7d8799",jR="#61afef",qR="#98c379",Xm="#d19a66",YR="#c678dd",FR="#21252b",zm="#2c313a",Nm="#282c34",nu="#353a42",UR="#3E4451",Vm="#528bff",GR=$e.theme({"&":{color:Ga,backgroundColor:Nm},".cm-content":{caretColor:Vm},".cm-cursor, .cm-dropCursor":{borderLeftColor:Vm},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:UR},".cm-panels":{backgroundColor:FR,color:Ga},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Nm,color:fh,border:"none"},".cm-activeLineGutter":{backgroundColor:zm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:nu},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nu,borderBottomColor:nu},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:zm,color:Ga}}},{dark:!0}),HR=Go.define([{tag:P.keyword,color:YR},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:Im},{tag:[P.function(P.variableName),P.labelName],color:jR},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:Xm},{tag:[P.definition(P.name),P.separator],color:Ga},{tag:[P.typeName,P.className,P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:NR},{tag:[P.operator,P.operatorKeyword,P.url,P.escape,P.regexp,P.link,P.special(P.string)],color:VR},{tag:[P.meta,P.comment],color:fh},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.link,color:fh,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:Im},{tag:[P.atom,P.bool,P.special(P.variableName)],color:Xm},{tag:[P.processingInstruction,P.string,P.inserted],color:qR},{tag:P.invalid,color:WR}]),KR=[GR,y0(HR)],JR=We({__name:"MarkdownCodeEditor",props:{modelValue:{},readOnly:{type:Boolean,default:!1},lineToReveal:{default:null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,s=R(null);let i=null,o=!1,a=null;const l=Ke.define(),c=Ke.define(),u=Ft.define({create(){return Ve.none},update(g,O){let y=g.map(O.changes);for(const x of O.effects)if(x.is(c)&&(y=Ve.none),x.is(l)){const S=Math.max(1,Math.min(x.value,O.state.doc.lines)),Q=O.state.doc.line(S);y=Ve.set([Ve.line({class:"cm-target-line"}).range(Q.from)])}return y},provide:g=>$e.decorations.from(g)});function h(){i&&(a&&clearTimeout(a),a=setTimeout(()=>{i&&i.dispatch({effects:c.of(void 0)})},1600))}function f(g){if(!i)return;const O=Math.max(1,Math.min(g,i.state.doc.lines)),y=i.state.doc.line(O);i.dispatch({selection:{anchor:y.from},effects:[$e.scrollIntoView(y.from,{y:"center"}),l.of(O)]}),i.focus(),h()}function m(g,O){return st.create({doc:g,extensions:[TA,DR(),KR,$e.lineWrapping,u,$e.updateListener.of(y=>{!y.docChanged||o||r("update:modelValue",y.state.doc.toString())}),$e.theme({"&":{height:"100%",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",fontSize:"13px",backgroundColor:"rgb(var(--color-retro-black))",color:"rgb(var(--color-retro-text))"},".cm-scroller":{overflow:"auto",lineHeight:"1.6"},".cm-gutters":{backgroundColor:"rgb(var(--color-retro-dark))",color:"rgb(var(--color-retro-subtle))",borderRight:"1px solid rgb(var(--color-retro-border))"},".cm-content":{caretColor:"rgb(var(--color-retro-cyan))",padding:"12px 0"},".cm-activeLine":{backgroundColor:"rgba(34, 211, 238, 0.08)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(34, 211, 238, 0.22)"}}),st.readOnly.of(O)]})}return Tt(()=>{s.value&&(i=new $e({state:m(t.modelValue,t.readOnly),parent:s.value}),t.lineToReveal&&f(t.lineToReveal))}),Ye(()=>t.modelValue,g=>{if(!i)return;const O=i.state.doc.toString();O!==g&&(o=!0,i.dispatch({changes:{from:0,to:O.length,insert:g}}),o=!1)}),Ye(()=>t.lineToReveal,g=>{g&&f(g)}),Yv(()=>{a&&clearTimeout(a),i&&(i.destroy(),i=null)}),(g,O)=>(v(),b("div",{ref_key:"rootRef",ref:s,class:"h-full w-full"},null,512))}}),eE=Do(JR,[["__scopeId","data-v-d77d4160"]]);function ic(){function n(e){const t=dt.parse(e);return Mg.sanitize(t)}return{renderMarkdown:n}}const tE={class:"fixed inset-0 z-50 flex items-center justify-center"},nE={class:"relative w-[96vw] h-[94vh] bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},rE={class:"flex-shrink-0 flex items-center justify-between px-4 h-12 border-b border-retro-border bg-retro-dark"},sE={class:"flex items-center gap-3 min-w-0"},iE={class:"text-sm font-mono font-bold text-retro-cyan truncate"},oE={class:"text-xs font-mono text-retro-subtle"},aE={class:"flex items-center gap-2"},lE=["disabled"],cE={class:"flex-shrink-0 flex items-center gap-0 border-b border-retro-border bg-retro-dark overflow-x-auto"},uE=["onClick"],hE={class:"flex-1 min-h-0 overflow-y-auto"},dE={key:0,class:"p-5 max-w-6xl mx-auto"},fE={key:0,class:"flex items-center justify-center py-12"},pE={key:1,class:"flex flex-col items-center justify-center py-12 text-center px-4"},mE={class:"text-sm font-mono text-retro-red"},gE={key:2,class:"space-y-4"},OE={key:0,class:"rounded border border-retro-cyan/40 bg-retro-cyan/10 px-3 py-2 text-xs font-mono text-retro-cyan"},vE={class:"grid grid-cols-2 lg:grid-cols-5 gap-2"},bE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},xE={class:"text-sm font-mono text-retro-text"},yE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},kE={class:"text-sm font-mono text-retro-cyan"},wE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},SE={class:"text-sm font-mono text-retro-yellow"},$E={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},CE={class:"text-sm font-mono text-retro-green"},QE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},PE={class:"text-sm font-mono text-retro-text"},TE={class:"rounded border border-retro-border bg-retro-panel px-3 py-3"},ME={class:"flex items-center justify-between gap-2 mb-2"},AE={class:"text-[11px] font-mono text-retro-subtle"},_E={key:0,class:"text-xs font-mono text-retro-green"},RE={key:1,class:"space-y-2"},EE={class:"uppercase tracking-wide mr-2"},BE={class:"rounded border border-retro-border bg-retro-panel p-3 overflow-x-auto"},LE={class:"min-w-[760px]"},DE={class:"text-retro-text"},ZE=["disabled","onClick"],IE=["disabled","onClick"],XE=["disabled","onClick"],zE={class:"text-retro-muted"},NE={key:1,class:"flex items-center justify-center py-12"},VE={key:2,class:"flex flex-col items-center justify-center py-12 text-center px-4"},WE={class:"text-sm font-mono text-retro-red"},jE={key:3,class:"flex flex-col items-center justify-center py-12 text-center"},qE={key:4,class:"h-full flex flex-col"},YE=["innerHTML"],FE=We({__name:"SpecViewerModal",props:{feature:{}},emits:["close"],setup(n,{emit:e}){const t=n,r=e,s=Zo(),{renderMarkdown:i}=ic(),o=R(t.feature.files[0]?.filename||""),a=R("document"),l=R(""),c=R(!1),u=R(null),h=R(!1),f=R(""),m=R(!1),g=R(null),O=R(null),y=R(!1),x=R(null),S=R(null),Q=Y(()=>{const N={critical:0,major:1,minor:2};return[...S.value?.alerts??[]].sort((W,ve)=>N[W.severity]-N[ve.severity])});function T(N){return N.status==="covered"?"text-retro-green border-retro-green/40 bg-retro-green/10":N.status==="partial"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-red border-retro-red/40 bg-retro-red/10"}function D(N){return N.severity==="critical"?"text-retro-red border-retro-red/40 bg-retro-red/10":N.severity==="major"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10"}async function K(){y.value=!0,x.value=null;try{S.value=await $fetch(`/api/specs/traceability/${t.feature.id}`)}catch{x.value="Failed to load traceability data",S.value=null}finally{y.value=!1}}async function I(N=o.value){if(N){c.value=!0,u.value=null;try{const W=`/api/specs/${t.feature.id}/${N}`,ve=await $fetch(W);l.value=ve.content}catch{u.value="Failed to load file",l.value=""}finally{c.value=!1}}}function ue(){I()}const le=Y(()=>l.value?i(l.value):"");function oe(N){O.value=null,a.value="document",h.value&&(h.value=!1),o.value=N,I()}function Z(){h.value&&q(),a.value="traceability",!S.value&&!y.value&&K()}async function X(N,W,ve){W&&(o.value!==N?(o.value=N,await I(N)):l.value||await I(N),a.value="document",h.value=!0,f.value=l.value,g.value=null,O.value={filename:N,line:W,requirementId:ve},await Gn(),g.value=W)}function B(){f.value=l.value,g.value=null,h.value=!0}function q(){h.value=!1,f.value=""}async function U(){m.value=!0;try{const N=`/api/specs/${t.feature.id}/${o.value}`;await $fetch(N,{method:"PUT",body:{content:f.value}}),l.value=f.value,h.value=!1,s.success("Saved")}catch{s.error("Failed to save")}finally{m.value=!1}}function j(N){N.key==="Escape"&&(h.value?q():r("close"))}return Tt(()=>{window.addEventListener("keydown",j),I(),K()}),zt(()=>{window.removeEventListener("keydown",j)}),(N,W)=>{const ve=eE;return v(),Oe(cr,{to:"body"},[d("div",tE,[d("div",{class:"absolute inset-0 bg-black/80",onClick:W[0]||(W[0]=te=>r("close"))}),d("div",nE,[d("div",rE,[d("div",sE,[d("span",iE,M(n.feature.name),1),d("span",oE,M(n.feature.id),1)]),d("div",aE,[p(h)?(v(),b(we,{key:0},[d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-muted transition-colors",onClick:q}," Cancel "),d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-cyan text-retro-cyan hover:bg-retro-cyan/10 transition-colors disabled:opacity-50",disabled:p(m),onClick:U},M(p(m)?"Saving...":"Save"),9,lE)],64)):p(a)==="document"&&p(l)&&!p(c)&&!p(u)?(v(),b("button",{key:1,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Edit",onClick:B},[se(p(yh),{class:"h-4 w-4"})])):V("",!0),d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (ESC)",onClick:W[1]||(W[1]=te=>r("close"))},[se(p(Yt),{class:"h-4 w-4"})])])]),d("div",cE,[d("button",{type:"button",class:Pe(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap flex items-center gap-1",[p(a)==="traceability"?"border-retro-magenta text-retro-magenta bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:Z},[se(p(vb),{class:"h-3.5 w-3.5"}),W[3]||(W[3]=Ne(" Traceability ",-1))],2),(v(!0),b(we,null,Fe(n.feature.files,te=>(v(),b("button",{key:te.filename,type:"button",class:Pe(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap",[p(a)==="document"&&p(o)===te.filename?"border-retro-cyan text-retro-cyan bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:he=>oe(te.filename)},M(te.label),11,uE))),128))]),d("div",hE,[p(a)==="traceability"?(v(),b("div",dE,[p(y)?(v(),b("div",fE,[...W[4]||(W[4]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading traceability...",-1)])])):p(x)?(v(),b("div",pE,[d("p",mE,M(p(x)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:K}," Retry ")])):p(S)?(v(),b("div",gE,[p(O)?(v(),b("div",OE," Jump target: "+M(p(O).requirementId)+" → "+M(p(O).filename)+":"+M(p(O).line),1)):V("",!0),d("div",vE,[d("div",bE,[W[5]||(W[5]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"FR total",-1)),d("p",xE,M(p(S).summary.frTotal),1)]),d("div",yE,[W[6]||(W[6]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Plan coverage",-1)),d("p",kE,M(p(S).summary.frWithPlan)+"/"+M(p(S).summary.frTotal),1)]),d("div",wE,[W[7]||(W[7]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task mapping",-1)),d("p",SE,M(p(S).summary.frWithTasks)+"/"+M(p(S).summary.frTotal),1)]),d("div",$E,[W[8]||(W[8]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Fully covered",-1)),d("p",CE,M(p(S).summary.frFullyCovered)+"/"+M(p(S).summary.frTotal),1)]),d("div",QE,[W[9]||(W[9]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task progress",-1)),d("p",PE,M(p(S).summary.taskCompleted)+"/"+M(p(S).summary.taskTotal),1)])]),d("div",TE,[d("div",ME,[W[10]||(W[10]=d("h3",{class:"text-xs font-mono text-retro-text"},"Gap Alerts",-1)),d("span",AE,M(p(Q).length)+" issues",1)]),p(Q).length===0?(v(),b("div",_E," No traceability gaps detected. ")):(v(),b("div",RE,[(v(!0),b(we,null,Fe(p(Q),te=>(v(),b("div",{key:te.id,class:Pe(["rounded border px-2.5 py-2 text-xs font-mono",D(te)])},[d("span",EE,M(te.severity),1),d("span",null,M(te.message),1)],2))),128))]))]),d("div",BE,[d("div",LE,[W[11]||(W[11]=d("div",{class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 text-[11px] font-mono text-retro-subtle px-2 pb-2 border-b border-retro-border"},[d("span",null,"Requirement"),d("span",null,"Spec"),d("span",null,"Plan"),d("span",null,"Tasks"),d("span",null,"Progress")],-1)),(v(!0),b(we,null,Fe(p(S).requirements,te=>(v(),b("div",{key:te.id,class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 items-center px-2 py-2 border-b border-retro-border/60 text-xs font-mono"},[d("span",DE,M(te.id),1),d("button",{type:"button",class:"h-6 rounded border border-retro-green/40 bg-retro-green/10 flex items-center px-2 text-retro-green disabled:opacity-50 disabled:cursor-not-allowed",disabled:!te.locations.specLine,onClick:he=>X("spec.md",te.locations.specLine,te.id)},[d("span",null,M(te.locations.specLine?`L${te.locations.specLine}`:"Defined"),1)],8,ZE),d("button",{type:"button",class:Pe(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",te.inPlan?"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10":"text-retro-subtle border-retro-border bg-retro-black/50"]),disabled:!te.locations.planLine,onClick:he=>X("plan.md",te.locations.planLine,te.id)},[d("span",null,M(te.locations.planLine?`L${te.locations.planLine}`:te.inPlan?"Linked":"Missing"),1)],10,IE),d("button",{type:"button",class:Pe(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",T(te)]),disabled:te.locations.taskLines.length===0,onClick:he=>X("tasks.md",te.locations.taskLines[0],te.id)},[d("span",null,M(te.locations.taskLines.length>0?`L${te.locations.taskLines[0]}`:te.inTasks?"Mapped":"Missing"),1)],10,XE),d("span",zE,M(te.taskCompleted)+"/"+M(te.taskTotal),1)]))),128))])])])):V("",!0)])):p(c)?(v(),b("div",NE,[...W[12]||(W[12]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading...",-1)])])):p(u)?(v(),b("div",VE,[d("p",WE,M(p(u)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:ue}," Retry ")])):n.feature.files.length===0?(v(),b("div",jE,[...W[13]||(W[13]=[d("p",{class:"text-sm font-mono text-retro-muted"},"No spec files found",-1),d("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," This feature directory has no .md files ",-1)])])):p(h)?(v(),b("div",qE,[se(ve,{modelValue:p(f),"onUpdate:modelValue":W[2]||(W[2]=te=>at(f)?f.value=te:null),"line-to-reveal":p(g),class:"flex-1"},null,8,["modelValue","line-to-reveal"])])):(v(),b("div",{key:5,class:"spec-markdown p-6 text-sm font-mono text-retro-text max-w-4xl mx-auto",innerHTML:p(le)},null,8,YE))])])])])}}}),UE={class:"w-full max-w-2xl rounded-xl border border-retro-border/80 bg-retro-black shadow-[0_24px_70px_rgba(0,0,0,0.55)] overflow-hidden"},GE={class:"flex items-center justify-between px-4 py-2 border-b border-retro-border/60 bg-retro-dark/70"},HE={class:"flex items-center gap-2 px-4 py-3 border-b border-retro-border/60"},KE={class:"flex items-center justify-between px-4 py-1.5 border-b border-retro-border/40 bg-retro-dark/30 text-[10px] font-mono text-retro-subtle"},JE={class:"flex items-center gap-3"},eB={class:"inline-flex items-center gap-1"},tB={key:0},nB={key:0,class:"truncate max-w-[42%]"},rB={class:"max-h-[58vh] overflow-y-auto"},sB={key:0,class:"px-4 py-3 text-xs font-mono text-retro-subtle animate-pulse"},iB={key:1,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},oB={key:2,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},aB={key:3,class:"px-4 py-3 text-xs font-mono text-retro-red"},lB={key:4,class:"py-2 px-2 space-y-2"},cB=["onMouseenter","onClick"],uB={class:"flex items-center justify-between gap-3 text-[10px] font-mono"},hB={class:"text-retro-cyan/90"},dB={class:"text-retro-subtle truncate"},fB=["innerHTML"],pB={key:5,class:"px-4 py-3 text-xs font-mono text-retro-subtle"},mB={class:"flex items-center justify-between gap-3 px-4 py-2 border-t border-retro-border/60 bg-retro-dark/50 text-[11px] font-mono text-retro-subtle"},gB={key:0,class:"text-retro-yellow"},OB={key:0,class:"px-4 pb-3 text-xs font-mono text-retro-red flex items-center gap-2"},vB=400,bB=We({__name:"FeatureSearchModal",props:{availableFeatureIds:{}},emits:["close","select"],setup(n,{emit:e}){const t=n,r=e,{renderMarkdown:s}=ic(),i=R(""),o=R(!1),a=R(!1),l=R(null),c=R(null),u=R(null),h=R(null),f=R([]),m=R(-1),g=R(null),O=R([]);let y=null,x=0;const S=Y(()=>i.value.trim()),Q=Y(()=>{const U=S.value.toLowerCase().split(/\s+/).map(j=>j.trim()).filter(j=>j.length>=2);return Array.from(new Set(U)).slice(0,8)}),T=Y(()=>l.value||c.value?"error":!S.value&&a.value?"empty-query":f.value.length>0?"results":a.value&&!o.value?"no-results":"idle");function D(U){return{featureId:U.chunk.featureId,sourcePath:U.chunk.sourcePath,headingHierarchy:U.chunk.headingHierarchy,snippet:U.chunk.content,matchType:U.matchType,score:U.score,lineStart:U.chunk.lineStart,lineEnd:U.chunk.lineEnd}}async function K(){const U=S.value;if(c.value=null,!U){a.value=!0,u.value=null,h.value=null,l.value=null,f.value=[],m.value=-1;return}const j=++x;a.value=!0,l.value=null,o.value=!0;try{const N=await $fetch("/api/specs/search",{query:{q:U,mode:"keyword",limit:20}});if(j!==x)return;u.value=N.warning??null,h.value=N.searchTime,f.value=N.results.map(D),m.value=f.value.length>0?0:-1}catch(N){if(j!==x)return;const W=N instanceof Error?N.message:"Failed to search specs";l.value=W,h.value=null,f.value=[],m.value=-1}finally{j===x&&(o.value=!1)}}Ye(i,()=>{l.value=null,c.value=null,y&&clearTimeout(y),y=setTimeout(()=>{K()},vB)}),Ye(f,()=>{O.value=[]}),Ye(m,async U=>{U<0||(await Gn(),O.value[U]?.scrollIntoView({block:"nearest"}))});function I(){r("close")}function ue(U){const j=f.value[U];if(j){if(!t.availableFeatureIds.includes(j.featureId)){c.value="Feature unavailable";return}r("select",j.featureId),r("close")}}function le(U){if(f.value.length===0)return;if(m.value<0){m.value=0;return}const j=m.value+U;if(j<0){m.value=f.value.length-1;return}if(j>=f.value.length){m.value=0;return}m.value=j}function oe(U){if(U.key==="ArrowDown"){U.preventDefault(),le(1);return}if(U.key==="ArrowUp"){U.preventDefault(),le(-1);return}if(U.key==="Enter"){U.preventDefault(),m.value>=0&&ue(m.value);return}U.key==="Escape"&&(U.preventDefault(),I())}function Z(U){U.target===U.currentTarget&&I()}function X(U,j){if(!j){O.value[U]=null;return}if(j instanceof HTMLElement){O.value[U]=j;return}const N=j.$el;O.value[U]=N instanceof HTMLElement?N:null}function B(){K()}function q(U){const j=U.trim();if(!j)return"";const N=j.length>700?`${j.slice(0,700)}...`:j,W=s(N);if(Q.value.length===0)return W;const ve=Q.value.map(he=>he.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),te=new RegExp(`(${ve.join("|")})`,"gi");return W.split(/(<[^>]+>)/g).map(he=>he.startsWith("<")?he:he.replace(te,"<mark>$1</mark>")).join("")}return Tt(()=>{Gn(()=>{g.value?.focus()})}),zt(()=>{y&&clearTimeout(y)}),(U,j)=>(v(),Oe(cr,{to:"body"},[se(Ur,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:bt(()=>[d("div",{class:"fixed inset-0 z-50 flex items-start justify-center pt-16 px-4 bg-black/75 backdrop-blur-[1px]",onClick:Z},[se(Ur,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0 translate-y-2 scale-[0.99]","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-1 scale-[0.995]"},{default:bt(()=>[d("div",UE,[d("div",GE,[j[1]||(j[1]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"inline-flex items-center rounded px-2 py-0.5 text-[10px] font-mono border border-retro-cyan/50 text-retro-cyan bg-retro-cyan/10"}," Command Palette "),d("span",{class:"text-[10px] font-mono text-retro-subtle"},"Global spec search")],-1)),d("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (Escape)",onClick:I},[se(p(Yt),{class:"h-4 w-4"})])]),d("div",HE,[se(p(Vs),{class:"h-4 w-4 text-retro-cyan"}),tt(d("input",{ref_key:"inputRef",ref:g,"onUpdate:modelValue":j[0]||(j[0]=N=>at(i)?i.value=N:null),type:"text",placeholder:"Search specs across all features...",class:"flex-1 bg-transparent text-sm font-mono text-retro-text placeholder:text-retro-subtle focus:outline-none",onKeydown:oe},null,544),[[cn,p(i)]]),j[2]||(j[2]=d("span",{class:"text-[10px] font-mono text-retro-subtle border border-retro-border/60 rounded px-1.5 py-0.5"},"400ms",-1))]),d("div",KE,[d("div",JE,[d("span",eB,[se(p(Oi),{class:"h-3.5 w-3.5"}),Ne(" "+M(p(f).length)+" results ",1)]),p(h)!==null?(v(),b("span",tB,M(p(h))+"ms",1)):V("",!0)]),p(S)?(v(),b("span",nB,"“"+M(p(S))+"”",1)):V("",!0)]),d("div",rB,[p(o)?(v(),b("div",sB," Searching... ")):p(T)==="empty-query"?(v(),b("div",iB," Enter a search term to search across all feature specs. ")):p(T)==="no-results"?(v(),b("div",oB," No matching features found. ")):p(T)==="error"?(v(),b("div",aB,[d("p",null,M(p(c)||p(l)),1),p(l)?(v(),b("button",{key:0,type:"button",class:"mt-2 px-2 py-1 rounded border border-retro-border text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:B}," Retry ")):V("",!0)])):p(f).length>0?(v(),b("ul",lB,[(v(!0),b(we,null,Fe(p(f),(N,W)=>(v(),b("li",{key:`${N.featureId}:${N.sourcePath}:${W}`},[d("button",{type:"button",ref_for:!0,ref:ve=>X(W,ve),class:Pe(["w-full text-left px-4 py-3 min-h-[132px] rounded-lg border border-retro-border/40 border-l-2 transition-colors",W===p(m)?"border-retro-cyan bg-retro-panel/95 text-retro-text shadow-[0_0_0_1px_rgba(34,211,238,0.18)]":"text-retro-muted hover:text-retro-text hover:bg-retro-panel/90"]),onMouseenter:ve=>m.value=W,onClick:ve=>ue(W)},[d("div",uB,[d("span",hB,M(N.featureId),1),d("span",dB,M(N.sourcePath)+":"+M(N.lineStart)+"-"+M(N.lineEnd),1)]),d("div",{class:"snippet-markdown mt-2 max-h-20 overflow-hidden text-xs text-retro-text",innerHTML:q(N.snippet)},null,8,fB),j[3]||(j[3]=d("div",{class:"mt-2 text-[10px] font-mono text-retro-subtle"}," Select feature ",-1))],42,cB)]))),128))])):(v(),b("div",pB," Start typing to search. "))]),d("div",mB,[j[4]||(j[4]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"↑↓ move"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Enter select"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Esc close")],-1)),p(u)?(v(),b("span",gB,M(p(u)),1)):V("",!0)]),p(c)?(v(),b("div",OB,[se(p(ms),{class:"h-3.5 w-3.5"}),d("span",null,M(p(c)),1)])):V("",!0)])]),_:1})])]),_:1})]))}}),xB=Do(bB,[["__scopeId","data-v-5199b408"]]);function yB(n){return/^\/speckit\.(clarify|plan|tasks|implement)(\s|$)/.test(n)}function kB(n=Date.now,e=Math.random){return`req-${n()}-${e().toString(36).slice(2,8)}`}function Wm(n=Date.now){return`session-${n()}`}function Ha(n,e=!1){const t={};return(!e||n?.hasWorktree)&&n?.worktreePath&&(t.cwd=n.worktreePath,t.worktreeBranch=n.worktreeBranch),n?.featureId&&(t.featureId=n.featureId),Object.keys(t).length>0?t:void 0}function jm(n){if(n.file_path)return String(n.file_path);if(n.path)return String(n.path);if(n.command)return String(n.command).slice(0,50);if(n.pattern)return String(n.pattern);for(const e of Object.values(n))if(typeof e=="string"&&e.length<100)return e;return""}function qm(n,e="Permission"){const t=n||"",r=t.match(/write to (.+?)(?:[\s,?]|$)/i),s=t.match(/read (.+?)(?:[\s,?]|$)/i),i=t.match(/run (.+?)(?:[?,]|$)/i);return r?.[1]?{tool:"Write",description:t,filePath:r[1].trim()}:s?.[1]?{tool:"Read",description:t,filePath:s[1].trim()}:i?.[1]?{tool:"Bash",description:t,command:i[1].trim()}:{tool:e,description:t}}const Ct=new Map;let Ra=0;const us=new Map,Ea=new Set,wB=3e4,Dv=18e4,SB=Math.round(Dv/1e3);function $B(n){switch(n){case 1e3:return"Normal closure";case 1001:return"Endpoint is going away (server shutdown or page navigation)";case 1002:return"Protocol error";case 1003:return"Unsupported data";case 1005:return"No status code received from peer (close frame had no code)";case 1006:return"Abnormal closure (connection dropped without close frame)";case 1007:return"Invalid payload data";case 1008:return"Policy violation";case 1009:return"Message too big";case 1010:return"Missing required extension";case 1011:return"Internal server error";case 1012:return"Service restart";case 1013:return"Try again later (temporary overload)";case 1015:return"TLS handshake failure";default:return n>=4e3&&n<=4999?"Application-specific close code":"Unknown close code"}}function CB(n,e){const t=[];return n.reason?t.push(n.reason):t.push($B(n.code)),e?.lastServerError?t.push(`Last server error: ${e.lastServerError}`):e?.lastSocketError&&t.push(`Last socket error: ${e.lastSocketError}`),t.push(`wasClean: ${n.wasClean?"yes":"no"}`),t.join(" | ")}function oc(){const n=Jn(),e=Dl();Ra++;function t(){return typeof document>"u"||typeof document.hasFocus!="function"?!1:document.visibilityState==="visible"&&document.hasFocus()}function r(C){const _=n.conversations.find(E=>E.id===C)?.title?.trim()||"Chat";return new Notification("Spec Cat",{body:`${_} response completed.`,tag:`chat-complete-${C}`})}async function s(C){if(!(typeof window>"u"||typeof Notification>"u")&&!t()){if(Notification.permission==="granted"){r(C);return}if(Notification.permission==="default")try{await Notification.requestPermission()==="granted"&&r(C)}catch(w){console.warn("[useChatStream] Failed to request browser notification permission:",w)}}}function i(){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws`}function o(C){C.healthCheckInterval&&(clearInterval(C.healthCheckInterval),C.healthCheckInterval=null)}function a(C){o(C),C.lastMessageTime=Date.now(),C.healthCheckInterval=Eh(()=>{const w=C.conversationId;if(C.ws.readyState!==WebSocket.OPEN){console.warn(`[useChatStream] Health check: WebSocket not open for ${w}`),o(C),n.isConversationStreaming(w)&&(h(C.currentMessageId,w,"error"),n.updateMessage(C.currentMessageId,{status:"error"},w),n.setSessionError("Connection lost during streaming",w),n.endSession(w),n.endConversationStreaming(w)),Ct.delete(w);return}if(n.isConversationStreaming(w)){const _=Date.now()-C.lastMessageTime;_>Dv&&(console.warn(`[useChatStream] Health check: streaming timeout for ${w} (${Math.round(_/1e3)}s)`),o(C),h(C.currentMessageId,w,"error"),n.updateMessage(C.currentMessageId,{status:"error"},w),n.setSessionError(`Streaming timed out — no response from server for ${SB} seconds`,w),n.endSession(w),n.endConversationStreaming(w),C.ws.close(),Ct.delete(w))}},wB)}function l(C,w){return n.conversations.find(E=>E.id===C)?.messages.find(E=>E.id===w)?.status}function c(C,w=!0){const _=Ct.get(C);_&&(o(_),w&&_.ws.readyState===WebSocket.OPEN&&_.ws.close(),Ct.delete(C))}function u(C,w,_){!_||!C.currentTextBlockId||(n.updateBlockWithSave(C.currentMessageId,C.currentTextBlockId,E=>{E.type==="text"&&(E.text+=_)},w,{syncContent:!1}),n.appendToMessage(C.currentMessageId,_,w))}function h(C,w,_){const z=n.conversations.find(F=>F.id===w)?.messages.find(F=>F.id===C);if(z?.contentBlocks)for(const F of z.contentBlocks)F.type==="tool_use"&&(F.status==="running"||F.status==="pending")&&n.updateBlockById(C,F.id,ne=>{ne.type==="tool_use"&&(ne.status=_)},w)}async function f(C){try{(await m(C)).send(JSON.stringify({type:"reset_context"})),n.clearProviderSession(C),console.log("[useChatStream] Context reset requested for conversation:",C)}catch(w){throw console.error("[useChatStream] Failed to reset context:",w),w}}function m(C){return new Promise((w,_)=>{let E=!1;const z=He=>{E||(E=!0,w(He))},F=He=>{E||(E=!0,_(He))},ne=Ct.get(C);if(ne&&ne.ws.readyState===WebSocket.OPEN){z(ne.ws);return}ne&&(ne.ws.close(),Ct.delete(C));const Qe=i(),ke=new WebSocket(Qe),qe={ws:ke,currentMessageId:"",conversationId:C,activeTools:new Map,currentTextBlockId:null,currentThinkingBlockId:null,healthCheckInterval:null,lastMessageTime:Date.now(),lastServerError:null,lastSocketError:null,isReplaying:!1,replayBuffer:[]};Ct.set(C,qe),ke.onopen=()=>{z(ke)},ke.onerror=He=>{console.error(`[useChatStream] WebSocket error for conversation ${C}:`,He);const me=Ct.get(C);me&&me.ws!==ke||(me&&(me.lastSocketError="Browser reported a WebSocket transport error (network/proxy/server)"),n.isConversationStreaming(C)&&(me?.currentMessageId&&(h(me.currentMessageId,C,"error"),n.updateMessage(me.currentMessageId,{status:"error"},C)),n.setSessionError("Connection error during streaming",C),n.endSession(C),n.endConversationStreaming(C)),Ct.delete(C),F(new Error("WebSocket connection failed. Server may be unavailable.")))},ke.onclose=He=>{const me=Ct.get(C);if(!(me&&me.ws!==ke)){if(me&&o(me),Ct.delete(C),us.delete(C),!E){F(new Error(`WebSocket closed before connection was established (code: ${He.code})`));return}if(n.isConversationStreaming(C)){me?.currentMessageId&&(h(me.currentMessageId,C,"error"),n.updateMessage(me.currentMessageId,{status:"error"},C));const Ee=CB(He,me);n.setSessionError(`Connection closed: ${Ee} (code: ${He.code})`,C),n.endSession(C),n.endConversationStreaming(C)}}},ke.onmessage=He=>{const me=Ct.get(C);me&&me.ws!==ke||x(He.data,C)}})}async function g(C,w=3){for(let _=0;_<w;_++){const E=n.conversations.find(z=>z.id===C);if(E)return E;_<w-1&&await new Promise(z=>setTimeout(z,100))}console.error("[useChatStream] Conversation not found after retries:",C)}function O(C,w){return`${C}:${w}`}function y(C,w){const _=n.conversations.find(z=>z.id===C);if(!_)return null;const E=_.messages.findIndex(z=>z.id===w);if(E<=0)return null;for(let z=E-1;z>=0;z--){const F=_.messages[z];if(F.role==="user"&&F.content.trim().length>0)return F.content}return null}async function x(C,w){const _=Ct.get(w);if(_){_.lastMessageTime=Date.now();try{n.pushDebugEvent({direction:"in",channel:"ws",eventType:"ws.raw",payload:C},w);const E=JSON.parse(C);if(n.pushDebugEvent({direction:"in",channel:"ws",eventType:E.type,payload:E},w),_.isReplaying&&((E.type==="ui_event"||E.type==="done"||E.type==="error")&&_.replayBuffer.push(E),E.type!=="replay_end"))return;if(E.type==="error"){console.error(`[useChatStream] Server error for ${w}:`,E.error);const z=E.error||"Unknown server error";_.lastServerError=z;const F=/codex cannot access session files|failed to clean up stale arg0 temp dirs: Permission denied|failed to initialize rollout recorder: Permission denied|failed to create session: Permission denied|\/\.codex\/.*permission denied/i.test(z);if(/state db missing rollout path for thread/i.test(z)&&!F){const Qe=O(w,_.currentMessageId);if(!Ea.has(Qe)){const ke=y(w,_.currentMessageId);if(ke){Ea.add(Qe),n.setProviderSessionId("",w),le(_.currentMessageId,`
96
+
97
+ > **Session Reset**: Codex resume state was corrupted. Retrying once with a fresh session...
98
+
99
+ `,w);try{const qe=n.conversations.find(me=>me.id===w),He=Ha(qe);await oe(ke,_.currentMessageId,w,He);return}catch(qe){console.error(`[useChatStream] Rollout-path recovery retry failed for ${w}:`,qe)}}}}o(_),h(_.currentMessageId,w,"error"),n.updateMessage(_.currentMessageId,{status:"error"},w),/state db missing rollout path for thread/i.test(z)&&n.setProviderSessionId("",w),Ea.delete(O(w,_.currentMessageId)),n.setSessionError(z,w),n.endSession(w),n.endConversationStreaming(w),B(w),n.saveConversation(w,!0),c(w);return}if(E.type==="done"){o(_);const z=l(w,_.currentMessageId);if(Ea.delete(O(w,_.currentMessageId)),E.denied){h(_.currentMessageId,w,"error"),n.updateMessage(_.currentMessageId,{status:"stopped"},w),n.endSession(w),n.endConversationStreaming(w),B(w),n.clearPendingPermission(w),_.activeTools.clear(),n.saveConversation(w,!0);return}if(z==="error"||z==="stopped"){h(_.currentMessageId,w,"error"),n.endSession(w),n.endConversationStreaming(w),B(w),n.clearPendingPermission(w),_.activeTools.clear(),n.saveConversation(w,!0);return}h(_.currentMessageId,w,"complete"),n.completeMessageWithSave(_.currentMessageId,w),n.endSession(w),n.endConversationStreaming(w),s(w);const F=await g(w),ne=F?.hasWorktree&&F.worktreePath?$fetch("/api/chat/worktree-commit",{method:"POST",body:{worktreePath:F.worktreePath,conversationId:w,previousBranch:F.worktreeBranch}}).then(ke=>F.previewBranch&&F.worktreePath?$fetch("/api/chat/preview-sync",{method:"POST",body:{previewBranch:F.previewBranch,worktreePath:F.worktreePath}}).then(qe=>{if(!qe.success)throw new Error(qe.error||"Unknown preview sync failure");return ke}):ke).then(async ke=>{if(ke?.success&&ke.currentBranch!==F.worktreeBranch){const qe=F.worktreeBranch||"unknown";n.updateWorktreeBranch(w,ke.currentBranch);const He=await n.syncConversationFeatureFromBranch(w),me=ke.deletedPreviousBranch?` and deleted \`${qe}\``:"",Ee=He?` and linked to feature \`${He}\``:"";le(_.currentMessageId,`
100
+
101
+ > **Branch changed**: AI switched from \`${qe}\` to \`${ke.currentBranch}\`${me}${Ee}
102
+
103
+ `,w)}else ke?.success&&F.worktreeBranch&&n.updateWorktreeBranch(w,F.worktreeBranch);return n.saveConversation(w,!1),ke}).catch(ke=>{console.warn("[useChatStream] Auto-commit/preview-sync failed:",ke)}):Promise.resolve(),Qe=us.get(w);if(Qe&&Qe.queue.length>0){const ke=Qe.queue.shift(),qe=Qe.featureId;ne.then(()=>{setTimeout(()=>{q(w,qe,ke)},1500)}),Qe.queue.length===0&&us.delete(w)}n.clearPendingPermission(w),n.saveConversation(w,!0),_.activeTools.clear();return}if(E.type==="pong")return;if(E.type==="session_reset"){console.warn(`[useChatStream] Session reset for ${w}:`,E.reason),n.setProviderSessionId("",w),le(_.currentMessageId,`
104
+
105
+ > **Session Reset**: Previous session could not be resumed. Retrying with a fresh session...
106
+
107
+ `,w);return}if(E.type==="worktree_recovered"){console.log(`[useChatStream] Worktree recovered for ${w}`),le(_.currentMessageId,`
108
+
109
+ > **Worktree recovered**: The work directory was restored after a system restart.
110
+
111
+ `,w);return}if(E.type==="context_reset"){console.log(`[useChatStream] Context reset confirmed for ${w}`);return}if(E.type==="aborted"){console.log(`[useChatStream] Abort confirmed for ${w}`);return}if(E.type==="subscribed"){console.log(`[useChatStream] Subscribed to ${w}`,E.jobId?`(job: ${E.jobId}, status: ${E.jobStatus})`:"(no active job)"),E.jobId||(n.endSession(w),n.endConversationStreaming(w));return}if(E.type==="replay_start"){console.log(`[useChatStream] Replay start for ${w}: ${E.eventCount} events from job ${E.jobId}`),_.isReplaying=!0,_.replayBuffer=[];return}if(E.type==="replay_end"){console.log(`[useChatStream] Replay end for ${w}: nextCursor=${E.nextCursor}`),K(_,w),_.isReplaying=!1,_.replayBuffer=[];return}if(E.type==="notification"){T(E);return}if(E.type==="permission_request"){o(_),n.endConversationStreaming(w);const z=qm(E.description||"",E.tool||"Permission");n.setPendingPermission(z,w);let F=`
112
+
113
+ **Permission Required**: ${z.tool}`;z.filePath&&(F+=` - ${z.filePath}`),le(_.currentMessageId,F+`
114
+ `,w);return}if(E.type==="permission_prompt"&&E.text){o(_),n.endConversationStreaming(w);const z=qm(E.text,"Permission");n.setPendingPermission(z,w);const F=`
115
+
116
+ **${z.tool}**: ${z.filePath||z.command||z.description}
117
+ `;le(_.currentMessageId,F,w);return}E.type==="ui_event"&&E.event?D(E.event,w):E.type==="provider_json"&&E.data}catch(E){console.error(`[useChatStream] Failed to parse WebSocket message for ${w}:`,E,"Raw data:",C?.slice(0,200)),h(_.currentMessageId,w,"error"),n.updateMessage(_.currentMessageId,{status:"error"},w),n.setSessionError(`Failed to parse server response: ${E instanceof Error?E.message:"Invalid JSON"}`,w),n.endSession(w),n.endConversationStreaming(w),B(w),n.saveConversation(w,!0),c(w)}}}let S=null;const Q=500;function T(C){const w=C.notificationEvent,_=C.source;console.log(`[useChatStream] Global notification: ${w}`,{jobId:C.jobId,conversationId:C.conversationId,source:_,status:C.status}),(w==="job_created"&&_!=="user"||w==="job_completed"||w==="job_persisted")&&(S&&clearTimeout(S),S=setTimeout(()=>{S=null,n.refreshServerConversations()},Q))}function D(C,w){const _=Ct.get(w);if(_)switch(n.pushDebugEvent({direction:"in",channel:"ui",eventType:C.type,payload:C},w),C.sessionId&&n.setProviderSessionId(C.sessionId,w),C.type){case"session_init":{ue(_.currentMessageId,w);const E={id:ir(),type:"session_init",model:C.model,tools:C.tools,permissionMode:C.permissionMode,cwd:C.cwd};n.appendContentBlockWithSave(_.currentMessageId,E,w);break}case"block_start":{ue(_.currentMessageId,w);const E=C.blockId||ir();if(C.blockType==="text"){const z={id:E,type:"text",text:C.text||""};n.appendContentBlockWithSave(_.currentMessageId,z,w),_.currentTextBlockId=E}else if(C.blockType==="thinking"){const z={id:E,type:"thinking",thinking:C.thinking||""};n.appendContentBlockWithSave(_.currentMessageId,z,w),_.currentThinkingBlockId=E}else if(C.blockType==="tool_use"&&C.toolUseId&&C.name){const z={id:E,type:"tool_use",toolUseId:C.toolUseId,name:C.name,input:{},inputSummary:"",status:"running"};n.appendContentBlockWithSave(_.currentMessageId,z,w),_.activeTools.set(C.index??0,{blockId:E,toolUseId:C.toolUseId,name:C.name,inputJson:""})}break}case"block_delta":{if(C.text&&_.currentTextBlockId&&u(_,w,C.text),C.thinking&&_.currentThinkingBlockId&&n.updateBlockWithSave(_.currentMessageId,_.currentThinkingBlockId,E=>{E.type==="thinking"&&(E.thinking+=C.thinking)},w,{syncContent:!1}),C.partialJson&&C.index!==void 0){const E=_.activeTools.get(C.index);E&&(E.inputJson+=C.partialJson)}break}case"block_end":{if(_.currentTextBlockId&&(_.currentTextBlockId=null),_.currentThinkingBlockId&&(_.currentThinkingBlockId=null),C.index!==void 0){const E=_.activeTools.get(C.index);if(E){let z={};try{z=JSON.parse(E.inputJson)}catch{}if(E.name==="ExitPlanMode"){const F={allowedPrompts:z.allowedPrompts};n.setPendingPlanApproval(F,w)}n.updateBlockWithSave(_.currentMessageId,E.blockId,F=>{if(F.type==="tool_use"){const ne=F;ne.input=z,ne.inputSummary=jm(z),ne.status="pending"}},w)}}break}case"tool_result":{ue(_.currentMessageId,w);const E=n.findToolUseBlock(_.currentMessageId,C.toolUseId,w);E&&E.type==="tool_use"&&n.updateBlockById(_.currentMessageId,E.id,F=>{F.type==="tool_use"&&(F.status=C.isError?"error":"complete")},w);const z={id:ir(),type:"tool_result",toolUseId:C.toolUseId,content:C.content||"",isError:!!C.isError};n.appendContentBlockWithSave(_.currentMessageId,z,w);break}case"permission_request":{o(_),n.endConversationStreaming(w);const E={tool:C.tool,description:C.description,input:C.input,tools:C.tools};n.setPendingPermission(E,w);let z=`
118
+
119
+ **Permission Required**: ${E.tool}`;le(_.currentMessageId,z+`
120
+ `,w);break}case"turn_result":{if(C.subtype!=="success"&&(n.updateMessage(_.currentMessageId,{status:"error"},w),B(w),C.subtype==="max_turns"?n.setSessionError("Maximum conversation turns reached. Please start a new conversation.",w):n.setSessionError("Provider reported an execution error.",w)),C.subtype==="success"&&C.usage){ue(_.currentMessageId,w);const E={id:ir(),type:"result_summary",totalCostUsd:C.totalCostUsd??0,durationMs:C.durationMs??0,numTurns:C.numTurns??0,usage:C.usage};n.appendContentBlockWithSave(_.currentMessageId,E,w)}break}case"error":{n.updateMessage(_.currentMessageId,{status:"error"},w),n.setSessionError(C.error,w);break}}}function K(C,w){const _=C.replayBuffer;if(_.length===0)return;const E=[];let z="",F=null,ne=null;const Qe=new Map;let ke="streaming",qe=!1;for(const He of _){if(He.type==="done"){He.denied?(I(E,"error"),ke="stopped"):ke==="error"||ke==="stopped"?I(E,"error"):(I(E,"complete"),ke="complete"),qe=!0;continue}if(He.type==="error"){I(E,"error"),ke="error";continue}if(He.type!=="ui_event"||!He.event)continue;const me=He.event;switch(me.sessionId&&n.setProviderSessionId(me.sessionId,w),me.type){case"session_init":{const Ee={id:ir(),type:"session_init",model:me.model,tools:me.tools,permissionMode:me.permissionMode,cwd:me.cwd};E.push(Ee);break}case"block_start":{const Ee=me.blockId||ir();if(me.blockType==="text"){const de={id:Ee,type:"text",text:me.text||""};E.push(de),F=Ee,me.text&&(z+=me.text)}else if(me.blockType==="thinking"){const de={id:Ee,type:"thinking",thinking:me.thinking||""};E.push(de),ne=Ee}else if(me.blockType==="tool_use"&&me.toolUseId&&me.name){const de={id:Ee,type:"tool_use",toolUseId:me.toolUseId,name:me.name,input:{},inputSummary:"",status:"running"};E.push(de),Qe.set(me.index??0,{blockId:Ee,toolUseId:me.toolUseId,name:me.name,inputJson:""})}break}case"block_delta":{if(me.text&&F){const Ee=E.find(de=>de.id===F);Ee&&Ee.type==="text"&&(Ee.text+=me.text,z+=me.text)}if(me.thinking&&ne){const Ee=E.find(de=>de.id===ne);Ee&&Ee.type==="thinking"&&(Ee.thinking+=me.thinking)}if(me.partialJson&&me.index!==void 0){const Ee=Qe.get(me.index);Ee&&(Ee.inputJson+=me.partialJson)}break}case"block_end":{if(F&&(F=null),ne&&(ne=null),me.index!==void 0){const Ee=Qe.get(me.index);if(Ee){let de={};try{de=JSON.parse(Ee.inputJson)}catch{}const fe=E.find(J=>J.id===Ee.blockId);if(fe&&fe.type==="tool_use"){const J=fe;J.input=de,J.inputSummary=jm(de),J.status="pending"}}}break}case"tool_result":{const Ee=E.find(fe=>fe.type==="tool_use"&&fe.toolUseId===me.toolUseId);Ee&&Ee.type==="tool_use"&&(Ee.status=me.isError?"error":"complete");const de={id:ir(),type:"tool_result",toolUseId:me.toolUseId,content:me.content||"",isError:!!me.isError};E.push(de);break}case"turn_result":{if(me.subtype!=="success"&&(ke="error"),me.subtype==="success"&&me.usage){const Ee={id:ir(),type:"result_summary",totalCostUsd:me.totalCostUsd??0,durationMs:me.durationMs??0,numTurns:me.numTurns??0,usage:me.usage};E.push(Ee)}break}case"error":{ke="error";break}}}n.batchSetMessageBlocks(C.currentMessageId,E,z,ke,w),C.currentTextBlockId=F,C.currentThinkingBlockId=ne,C.activeTools=Qe,qe&&(o(C),n.endSession(w),n.endConversationStreaming(w),s(w)),console.log(`[useChatStream] Replay batch processed: ${_.length} events → ${E.length} blocks, status=${ke}`)}function I(C,w){for(const _ of C)if(_.type==="tool_use"){const E=_;(E.status==="running"||E.status==="pending")&&(E.status=w)}}function ue(C,w){n.initContentBlocks(C,w)}function le(C,w,_){ue(C,_);const E={id:ir(),type:"text",text:w};n.appendContentBlockWithSave(C,E,_)}async function oe(C,w,_,E){if(typeof window>"u")return;const z=kB();try{const F=await m(_),ne=Ct.get(_);ne&&(ne.currentMessageId=w,ne.activeTools.clear(),ne.currentTextBlockId=null,ne.currentThinkingBlockId=null,a(ne)),yB(C)&&n.setProviderSessionId("",_);const ke=n.getProviderSessionId(_),qe=n.conversations.find(de=>de.id===_),He=qe?.providerId||e.providerSelection.providerId||Jm,me=qe?.providerModelKey||e.providerSelection.modelKey||Km;qe&&(!qe.providerId||!qe.providerModelKey)&&(n.setConversationProviderSelection(_,He,me),n.saveConversation(_,!0));const Ee={type:"chat",message:C,attachments:E?.attachments,requestId:z,sessionId:ke||void 0,permissionMode:n.permissionMode,conversationId:_,cwd:E?.cwd,worktreeBranch:E?.worktreeBranch,featureId:E?.featureId,providerId:He,providerModelKey:me};n.pushDebugEvent({direction:"out",channel:"ws",eventType:"chat",payload:Ee},_),F.send(JSON.stringify(Ee))}catch(F){n.updateMessage(w,{status:"error"},_),n.setSessionError(F.message||"Connection failed",_),n.endSession(_),n.endConversationStreaming(_),n.saveConversation(_,!0),c(_)}}function Z(C,w){const _=w??n.activeConversationId;if(!_)return;const E=Ct.get(_);if(!E||E.ws.readyState!==WebSocket.OPEN)return;const z={type:"permission_response",allow:C};n.pushDebugEvent({direction:"out",channel:"ws",eventType:"permission_response",payload:z},_),E.ws.send(JSON.stringify(z)),C&&(n.startConversationStreaming(_),a(E));const F=C?"Allowed":"Denied";le(E.currentMessageId,`${F}
121
+ `,_),n.clearPendingPermission(_)}function X(C,w,_){us.set(w,{featureId:C,queue:[..._]})}function B(C){C?us.delete(C):us.clear()}async function q(C,w,_){n.activeConversationId!==C&&n.selectConversation(C);const E=n.conversations.find(Qe=>Qe.id===C);let z;if(_.startsWith("skill:")){const Qe=_.replace("skill:","");try{z=(await $fetch(`/api/skills/${Qe}/prompt`,{method:"POST",body:{featureId:w,cwd:E?.worktreePath}})).prompt}catch(ke){console.error(`[useChatStream] Failed to render skill prompt for ${Qe}:`,ke);return}}else z=`/speckit.${_} ${w}`;n.addUserMessage(z,C),n.saveConversation(C,!0);const F=n.addAssistantMessage(C);n.startSession(Wm(),C),n.startConversationStreaming(C);const ne=Ha(E);await oe(z,F.id,C,ne)}async function U(C,w,_=0){if(!(typeof window>"u"))try{const E=await m(C),z=Ct.get(C);z&&(z.currentMessageId=w,z.activeTools.clear(),z.currentTextBlockId=null,z.currentThinkingBlockId=null,a(z)),n.startConversationStreaming(C);const F={type:"subscribe",conversationId:C,cursor:_};n.pushDebugEvent({direction:"out",channel:"ws",eventType:"subscribe",payload:F},C),E.send(JSON.stringify(F))}catch(E){console.error(`[useChatStream] Failed to subscribe to ${C}:`,E),n.setSessionError(E.message||"Subscribe failed",C)}}function j(C){const w=C??n.activeConversationId;if(!w)return;const _=Ct.get(w);if(_){if(_.ws.readyState===WebSocket.OPEN){const E={type:"abort"};n.pushDebugEvent({direction:"out",channel:"ws",eventType:"abort",payload:E},w),_.ws.send(JSON.stringify(E)),_.ws.close()}_.currentMessageId&&(h(_.currentMessageId,w,"error"),n.updateMessage(_.currentMessageId,{status:"stopped"},w),n.endSession(w),n.saveConversation(w,!0)),Ct.delete(w)}n.endConversationStreaming(w),n.clearPendingPermission(w),B(w)}function N(C){const w=Ct.get(C);w&&(o(w),w.ws.close(),Ct.delete(C)),us.delete(C)}function W(){for(const[C,w]of Ct)o(w),w.ws.close(),Ct.delete(C);us.clear()}async function ve(C){const w=C??n.activeConversationId;if(!w)return;n.clearPendingPlanApproval(w),n.setPermissionMode("auto");const _="Approved. Proceed with the implementation.";n.addUserMessage(_,w),n.saveConversation(w,!0);const E=n.addAssistantMessage(w);n.startSession(Wm(),w),n.startConversationStreaming(w);const z=n.conversations.find(ne=>ne.id===w),F=Ha(z,!0);await oe(_,E.id,w,F)}function te(C){const w=C??n.activeConversationId;w&&n.clearPendingPlanApproval(w)}async function he(C){if(typeof window>"u")return!1;try{const w=await $fetch("/api/jobs",{params:{conversationId:C}}),E=w.find(ne=>ne.status==="running"||ne.status==="waiting_permission"||ne.status==="queued")||[...w].sort((ne,Qe)=>Qe.eventCount-ne.eventCount).find(ne=>ne.eventCount>0),z=n.conversations.find(ne=>ne.id===C);if(!z)return!1;const F=[...z.messages].reverse().find(ne=>ne.role==="assistant");return E?F?(console.log("[useChatStream] Resuming streaming for",C,"job:",E.id,"status:",E.status,"events:",E.eventCount),n.resetMessageForReplay(F.id,C),n.startSession(`resume-${Date.now()}`,C),await U(C,F.id,0),!0):!1:(F&&F.status==="streaming"&&(n.updateMessage(F.id,{status:"error"},C),n.setSessionError("Streaming was interrupted (server job no longer active)",C)),!1)}catch(w){return console.error("[useChatStream] Failed to resume streaming:",w),!1}}return zt(()=>{Ra--,Ra<=0&&(Ra=0,W())}),{sendMessage:oe,sendPermissionResponse:Z,subscribe:U,tryResumeStreaming:he,approvePlan:ve,rejectPlan:te,abort:j,disconnect:W,disconnectConversation:N,enableCascade:X,disableCascade:B,resetContext:f}}const QB={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},PB={class:"px-4 py-3 border-b border-retro-border flex items-center justify-between"},TB=["disabled"],MB={class:"px-4 py-4 space-y-3"},AB={class:"relative"},_B=["disabled"],RB={key:0,value:""},EB=["value"],BB={key:0,class:"text-xs font-mono text-retro-red"},LB={key:1,class:"text-xs font-mono text-retro-muted"},DB={class:"px-4 py-3 border-t border-retro-border flex items-center gap-2 justify-end"},ZB=["disabled"],IB=["disabled"],ph=We({__name:"NewConversationModal",props:{show:{type:Boolean},creating:{type:Boolean}},emits:["close","create"],setup(n,{emit:e}){const t=gh(),r=n,s=e,i=R([]),o=R(""),a=R(!1),l=R(""),c=Y(()=>!a.value&&!r.creating&&o.value.length>0&&i.value.length>0);async function u(){a.value=!0,l.value="";try{await t.initialize();const f=await $fetch("/api/git/branches",{query:{excludeSc:!0,workingDirectory:t.workingDirectory}}),m=f.branches.filter(O=>!O.isRemote).map(O=>O.name);if(i.value=m,!m.length){o.value="",l.value="No local branches available for chat creation.";return}const g=(f.current&&m.includes(f.current)?f.current:"")||(m.includes("main")?"main":"")||(m.includes("master")?"master":"")||m[0];o.value=g}catch(f){i.value=[],o.value="",l.value=f instanceof Error?f.message:"Failed to load branches"}finally{a.value=!1}}Ye(()=>r.show,f=>{f&&u()});function h(){c.value&&s("create",o.value)}return(f,m)=>(v(),Oe(cr,{to:"body"},[se(Ur,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:bt(()=>[n.show?(v(),b("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:m[3]||(m[3]=ln(g=>s("close"),["self"]))},[d("div",QB,[d("div",PB,[m[4]||(m[4]=d("h3",{class:"text-sm font-mono text-retro-text font-semibold"},"New Conversation",-1)),d("button",{type:"button",class:"p-1 text-retro-muted hover:text-retro-text transition-colors",disabled:n.creating,onClick:m[0]||(m[0]=g=>s("close"))},[se(p(Yt),{class:"w-4 h-4"})],8,TB)]),d("div",MB,[m[5]||(m[5]=d("label",{class:"block text-xs font-mono text-retro-muted"},"Base Branch",-1)),d("div",AB,[tt(d("select",{"onUpdate:modelValue":m[1]||(m[1]=g=>o.value=g),disabled:a.value||n.creating||i.value.length===0,class:"w-full appearance-none bg-retro-black border border-retro-border rounded px-2 py-1.5 pr-7 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan disabled:opacity-40"},[a.value?(v(),b("option",RB,"Loading branches...")):V("",!0),(v(!0),b(we,null,Fe(i.value,g=>(v(),b("option",{key:g,value:g},M(g),9,EB))),128))],8,_B),[[Hs,o.value]]),se(p(bh),{class:"absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})]),l.value?(v(),b("p",BB,M(l.value),1)):(v(),b("p",LB," The conversation worktree will be created from the selected branch. "))]),d("div",DB,[d("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",disabled:n.creating,onClick:m[2]||(m[2]=g=>s("close"))}," Cancel ",8,ZB),d("button",{type:"button",disabled:!c.value,class:"px-3 py-1.5 text-xs font-mono rounded border bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:h},M(n.creating?"Creating...":"Create"),9,IB)])])])):V("",!0)]),_:1})]))}}),XB={class:"h-full flex flex-col bg-retro-black"},zB={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border"},NB={class:"flex items-center gap-1"},VB={class:"flex-shrink-0 px-3 pt-3"},WB={class:"relative"},jB={class:"flex-1 overflow-y-auto p-3"},qB={class:"space-y-2"},YB={key:0,class:"flex items-center justify-center py-12"},FB={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},UB={key:2,class:"flex flex-col items-center justify-center py-12 text-center"},GB=We({__name:"FeaturesPanel",setup(n){const e=Jn(),t=Vl(),{sendMessage:r,enableCascade:s}=oc(),i=Zo(),o=R("features"),a=R(null),l=R(null),c=R([]),u=R([]),h=R(!1),f=R({}),m=R(!1),g=R(null),O=R(!1),y=R(!1),x=R(!1),S=R(null),Q=R(""),T=R("");let D=null;Ye(Q,de=>{D&&clearTimeout(D),D=setTimeout(()=>{T.value=de},300)});const K=Y(()=>{const de=T.value.trim().toLowerCase();return de?c.value.filter(fe=>fe.name.toLowerCase().includes(de)||fe.id.toLowerCase().includes(de)):c.value}),I=R({}),ue=Y(()=>{const de=e.activeConversation;if(!de)return null;if(de.featureId)return de.featureId;const fe=de.worktreeBranch?.trim();return fe&&c.value.some(J=>J.id===fe)?fe:null}),le=Y(()=>ue.value||a.value);Ye(()=>e.activeConversationId,()=>{a.value=null;const de=ue.value;t.setSelectedFeatureId(de),de&&Gn(()=>{const fe=I.value[de];fe&&fe.scrollIntoView({behavior:"auto",block:"nearest"})})}),Ye(a,de=>{de&&Gn(()=>{const fe=I.value[de];fe&&fe.scrollIntoView({behavior:"auto",block:"nearest"})})});async function oe(){h.value=!0;try{const de=await $fetch("/api/specs/features");c.value=de.features,Z(de.features)}catch{i.error("Failed to load features"),c.value=[],f.value={}}finally{h.value=!1}}async function Z(de){if(de.length===0){f.value={};return}const fe=await Promise.allSettled(de.map(async Ce=>{const ze=await $fetch(`/api/specs/traceability/${Ce.id}`),je=ze.alerts.filter(Lt=>Lt.severity==="critical").length,Rt=ze.alerts.filter(Lt=>Lt.severity==="major").length;return{featureId:Ce.id,critical:je,major:Rt}})),J={};for(const Ce of fe)Ce.status==="fulfilled"&&(J[Ce.value.featureId]={critical:Ce.value.critical,major:Ce.value.major});f.value=J}async function X(){try{const de=await $fetch("/api/skills");u.value=de.skills}catch{u.value=[]}}Tt(()=>{oe(),X(),window.addEventListener("keydown",U)}),zt(()=>{window.removeEventListener("keydown",U)});function B(de,fe={}){if(a.value=de,l.value=null,o.value="files",t.setSelectedFeatureId(de),fe.openViewer!==!1){const J=c.value.find(Ce=>Ce.id===de);J&&(g.value=J,m.value=!0)}}function q(){m.value=!1,g.value=null}function U(de){(de.ctrlKey||de.metaKey)&&de.key.toLowerCase()==="k"&&(de.preventDefault(),O.value||(O.value=!0))}function j(){O.value=!1}function N(de){B(de,{openViewer:!1}),O.value=!1}function W(){O.value=!0}const ve=Y(()=>c.value.map(de=>de.id));function te(de){return f.value[de]??{critical:0,major:0}}const he={plan:["tasks","implement"],tasks:["implement"],implement:[],clarify:[],analyze:[]},C={analyze:["skill:better-spec"]};async function w(de,fe,J){if(de.startsWith("skill:")){const Ce=de.replace("skill:",""),ze=J?e.conversations.find(Rt=>Rt.id===J):null;return(await $fetch(`/api/skills/${Ce}/prompt`,{method:"POST",body:{featureId:fe,cwd:ze?.worktreePath}})).prompt}return`/speckit.${de} ${fe}`}function _(de,fe){if(fe)return null;const J=e.findConversationByFeature(de);return J&&!e.isConversationStreaming(J.id)&&!J.finalized?(e.selectConversation(J.id),J.id):null}function E(de){const fe=e.findConversationByFeature(de);return fe&&fe.finalized?(i.error(`This feature has a finalized conversation "${fe.title}". Please archive it first to start a new conversation.`),e.selectConversation(fe.id),!0):!1}async function z(de,fe,J){const Ce=await e.createConversation({featureId:de,baseBranch:J});if(!Ce)throw new Error("Failed to create conversation");return e.renameConversation(Ce,fe),e.selectConversation(Ce),Ce}async function F(de,fe){e.addUserMessage(fe,de),e.saveConversation(de,!0);const J=e.conversations.find(je=>je.id===de),Ce=e.addAssistantMessage(de);e.startSession(`session-${Date.now()}`,de),e.startConversationStreaming(de);const ze={};J?.worktreePath&&(ze.cwd=J.worktreePath,ze.worktreeBranch=J.worktreeBranch),J?.featureId&&(ze.featureId=J.featureId),await r(fe,Ce.id,de,Object.keys(ze).length>0?ze:void 0)}async function ne(de,fe,J){const Ce=C[fe];let ze;if(Ce&&Ce.length>0){const je=[...Ce.slice(1),fe,...he[fe]||[]];s(de,J,je);const Rt=Ce[0];try{ze=await w(Rt,de,J)}catch(Lt){i.error(Lt instanceof Error?Lt.message:"Failed to resolve prerequisite step");return}}else{const je=he[fe]||[];je.length>0&&s(de,J,je),ze=`/speckit.${fe} ${de}`}await F(J,ze)}async function Qe(de,fe,J){const Ce=de.shiftKey;if(!Ce&&E(fe))return;const ze=_(fe,Ce);if(ze){try{await ne(fe,J,ze)}catch(je){i.error(je instanceof Error?je.message:"Failed to run cascade action")}return}S.value={type:"cascade",featureId:fe,command:J,title:`${J}: ${fe}`},y.value=!0}async function ke(de,fe){E(fe)||(S.value={type:"open-chat",featureId:fe,title:`spec: ${fe}`},y.value=!0)}async function qe(de,fe,J){let Ce;try{const ze=e.conversations.find(je=>je.id===J);Ce=await $fetch(`/api/skills/${fe}/prompt`,{method:"POST",body:{featureId:de,cwd:ze?.worktreePath}})}catch(ze){throw new Error(ze instanceof Error?ze.message:"Failed to render skill prompt")}await F(J,Ce.prompt)}async function He(de,fe,J){const Ce=de.shiftKey;if(!Ce&&E(fe))return;const ze=_(fe,Ce);if(ze){try{await qe(fe,J,ze)}catch(je){i.error(je instanceof Error?je.message:"Failed to run skill")}return}S.value={type:"skill",featureId:fe,skillId:J,title:`skill: ${J} — ${fe}`},y.value=!0}function me(){y.value=!1,S.value=null}async function Ee(de){if(S.value){x.value=!0;try{const fe=S.value,J=await z(fe.featureId,fe.title,de);fe.type==="cascade"?await ne(fe.featureId,fe.command,J):fe.type==="skill"&&await qe(fe.featureId,fe.skillId,J),y.value=!1,S.value=null}catch(fe){i.error(fe instanceof Error?fe.message:"Failed to create conversation")}finally{x.value=!1}}}return(de,fe)=>{const J=hC,Ce=FE,ze=xB;return v(),b("div",XB,[d("div",zB,[fe[2]||(fe[2]=d("div",{class:"flex items-center gap-2 min-w-0"},null,-1)),d("div",NB,[d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Search (Ctrl/Cmd+K)",onClick:W},[se(p(Vs),{class:"h-4 w-4"})]),d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Refresh",onClick:oe},[se(p(js),{class:Pe(["h-4 w-4",{"animate-spin":p(h)}])},null,8,["class"])])])]),d("div",VB,[d("div",WB,[se(p(Vs),{class:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-retro-subtle"}),tt(d("input",{"onUpdate:modelValue":fe[0]||(fe[0]=je=>at(Q)?Q.value=je:null),type:"text",placeholder:"Search features...",class:"w-full pl-8 pr-3 py-1.5 text-xs font-mono rounded border border-retro-border bg-retro-panel text-retro-text placeholder:text-retro-subtle focus:outline-none focus:border-retro-cyan transition-colors"},null,512),[[cn,p(Q)]])])]),d("div",jB,[d("div",qB,[(v(!0),b(we,null,Fe(p(K),je=>(v(),b("div",{key:je.id,ref_for:!0,ref:Rt=>{p(I)[je.id]=Rt}},[se(J,{feature:je,skills:p(u),"is-active":p(le)===je.id,"critical-alerts":te(je.id).critical,"major-alerts":te(je.id).major,onSelect:fe[1]||(fe[1]=Rt=>B(Rt,{openViewer:!0})),onCascade:Qe,onOpenChat:ke,onSkill:He},null,8,["feature","skills","is-active","critical-alerts","major-alerts"])]))),128))]),p(h)&&p(c).length===0?(v(),b("div",YB,[...fe[3]||(fe[3]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading features...",-1)])])):V("",!0),!p(h)&&p(c).length>0&&p(K).length===0?(v(),b("div",FB,[se(p(Vs),{class:"h-10 w-10 text-retro-subtle mb-3"}),fe[4]||(fe[4]=d("p",{class:"text-sm font-mono text-retro-muted"},"No matching features",-1)),fe[5]||(fe[5]=d("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," Try a different search term ",-1))])):V("",!0),!p(h)&&p(c).length===0?(v(),b("div",UB,[se(p(Pb),{class:"h-10 w-10 text-retro-subtle mb-3"}),fe[6]||(fe[6]=d("p",{class:"text-sm font-mono text-retro-muted"},"No features found",-1)),fe[7]||(fe[7]=d("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," Create a feature in specs/ to get started ",-1))])):V("",!0)]),p(m)&&p(g)?(v(),Oe(Ce,{key:0,feature:p(g),onClose:q},null,8,["feature"])):V("",!0),p(O)?(v(),Oe(ze,{key:1,"available-feature-ids":p(ve),onClose:j,onSelect:N},null,8,["available-feature-ids"])):V("",!0),se(ph,{show:p(y),creating:p(x),onClose:me,onCreate:Ee},null,8,["show","creating"])])}}}),HB={class:"h-full flex flex-col bg-retro-black"},KB={class:"flex-shrink-0 px-3 py-2 border-b border-retro-border space-y-2"},JB={class:"flex items-center justify-between gap-2"},e7={class:"flex items-center gap-1"},t7={class:"relative"},n7=["placeholder"],r7={key:0,class:"flex-shrink-0 flex items-center gap-2 px-3 py-2 bg-retro-yellow/10 border-b border-retro-yellow/30 text-xs"},s7={class:"text-retro-yellow font-mono"},i7={class:"flex-1 overflow-y-auto p-2"},o7={key:0,class:"space-y-1"},a7={key:1,class:"text-center py-6 text-retro-muted"},l7={class:"font-mono text-xs"},c7={key:1,class:"text-center py-8 text-retro-muted"},u7={key:0,class:"space-y-2"},h7={class:"flex items-start justify-between gap-2"},d7={class:"min-w-0"},f7={class:"text-sm font-mono text-retro-text truncate"},p7={class:"text-xs text-retro-muted mt-1 truncate"},m7={class:"text-xs text-retro-muted/70 mt-1"},g7={class:"text-xs text-retro-muted/70"},O7={class:"flex items-center gap-1 flex-shrink-0"},v7=["onClick"],b7=["onClick"],x7={key:1,class:"text-center py-6 text-retro-muted"},y7={class:"font-mono text-xs"},k7={key:1,class:"text-center py-8 text-retro-muted"},w7=We({__name:"ConversationsPanel",setup(n){const e=Jn(),t=Zo(),r=R(""),s=R(""),i=R(!1),o=R(!1),a=R(!1),l=R(!1),c=R(null);let u=null;Ye(r,j=>{u&&clearTimeout(u),u=setTimeout(()=>{s.value=j},180)},{immediate:!0}),zt(()=>{u&&(clearTimeout(u),u=null)});const h=new Map,f=new Map;Ye(()=>e.sortedConversations.map(j=>j.id),j=>{const N=new Set(j);for(const W of h.keys())N.has(W)||h.delete(W)},{immediate:!0}),Ye(()=>e.sortedArchivedConversations.map(j=>j.id),j=>{const N=new Set(j);for(const W of f.keys())N.has(W)||f.delete(W)},{immediate:!0});function m(j){const N=j.messages[j.messages.length-1];return[j.updatedAt,j.title,j.messages.length,N?.id||"",N?.content?.length||0].join("|")}function g(j){const N=j.messages[j.messages.length-1];return[j.updatedAt,j.archivedAt,j.title,j.messages.length,N?.id||"",N?.content?.length||0].join("|")}function O(j){const N=m(j),W=h.get(j.id);if(W&&W.signature===N)return W.text;const ve=[j.title,...j.messages.map(te=>te.content||"")].join(`
122
+ `).toLowerCase();return h.set(j.id,{signature:N,text:ve}),ve}function y(j){const N=g(j),W=f.get(j.id);if(W&&W.signature===N)return W.text;const ve=[j.title,...j.messages.map(te=>te.content||"")].join(`
123
+ `).toLowerCase();return f.set(j.id,{signature:N,text:ve}),ve}const x=Y(()=>e.conversationViewMode==="archive"),S=Y(()=>{const j=e.sortedConversations;if(!s.value.trim())return j;const N=s.value.toLowerCase().trim();return j.filter(W=>O(W).includes(N))}),Q=Y(()=>{const j=e.sortedArchivedConversations;if(!s.value.trim())return j;const N=s.value.toLowerCase().trim();return j.filter(W=>y(W).includes(N))}),T=Y(()=>e.previewingConversationId);async function D(){if(e.checkStorageLimits().atLimit){t.error("Delete or archive a conversation first (limit: 100).");return}i.value=!0}async function K(j){o.value=!0;try{if(!await e.createConversation({baseBranch:j})){t.error("Failed to create conversation");return}i.value=!1}catch(N){t.error(N instanceof Error?N.message:"Failed to create conversation")}finally{o.value=!1}}function I(j){e.selectConversation(j),e.setConversationViewMode("active")}async function ue(j){const N=await e.archiveConversation(j);if(!N.success){t.error(N.error||"Failed to archive conversation");return}t.success("Conversation archived")}async function le(j){c.value=j,a.value=!0}function oe(){a.value=!1,c.value=null}async function Z(j){if(c.value){l.value=!0;try{const N=await e.restoreArchivedConversation(c.value,j);if(!N.success){t.error(N.error||"Failed to restore archived conversation");return}t.success("Archived conversation restored"),a.value=!1,c.value=null}finally{l.value=!1}}}async function X(j){const N=await e.deleteArchivedConversation(j);if(!N.success){t.error(N.error||"Failed to delete archived conversation");return}t.success("Archived conversation deleted")}function B(j,N){e.renameConversation(j,N)}function q(j){return new Date(j).toLocaleString()}function U(j){if(!j.length)return"No messages";const W=(j[j.length-1].content||"").trim();return W?W.length>80?`${W.slice(0,80)}...`:W:"No messages"}return(j,N)=>(v(),b("div",HB,[d("div",KB,[d("div",JB,[d("button",{onClick:D,class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"New conversation","aria-label":"New conversation"},[se(p(Ll),{class:"w-4 h-4"})]),d("div",e7,[d("button",{onClick:N[0]||(N[0]=W=>p(e).setConversationViewMode("active")),class:Pe(["p-1.5 rounded transition-colors",x.value?"text-retro-muted hover:text-retro-cyan hover:bg-retro-panel":"text-retro-cyan bg-retro-cyan/10"]),title:"Active conversations","aria-label":"Active conversations"},[se(p(bb),{class:"w-4 h-4"})],2),d("button",{onClick:N[1]||(N[1]=W=>p(e).setConversationViewMode("archive")),class:Pe(["p-1.5 rounded transition-colors",x.value?"text-retro-cyan bg-retro-cyan/10":"text-retro-muted hover:text-retro-cyan hover:bg-retro-panel"]),title:"Archived conversations","aria-label":"Archived conversations"},[se(p(Zd),{class:"w-4 h-4"})],2)])]),d("div",t7,[se(p(Vs),{class:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted"}),tt(d("input",{"onUpdate:modelValue":N[2]||(N[2]=W=>r.value=W),type:"text",placeholder:x.value?"Search archive...":"Search conversations...",class:"w-full pl-8 pr-3 py-1.5 text-xs font-mono bg-retro-black border border-retro-border rounded focus:border-retro-cyan focus:outline-none focus:ring-1 focus:ring-retro-cyan text-retro-text placeholder-retro-muted"},null,8,n7),[[cn,r.value]])])]),p(e).isNearStorageLimit?(v(),b("div",r7,[se(p(ms),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),d("p",s7,M(p(e).conversationCount)+" active conversations. Limit is 100. ",1)])):V("",!0),d("div",i7,[x.value?(v(),b(we,{key:1},[p(e).hasArchivedConversations?(v(),b("div",u7,[Q.value.length>0?(v(!0),b(we,{key:0},Fe(Q.value,(W,ve,te,he)=>{const C=[W.id,W.title,W.updatedAt,W.archivedAt,W.messages.length];if(he&&he.key===W.id&&Ld(he,C))return he;const w=(v(),b("div",{key:W.id,onClick:_=>le(W.id),onKeydown:[zs(ln(_=>le(W.id),["prevent"]),["enter"]),zs(ln(_=>le(W.id),["prevent"]),["space"])],class:"w-full text-left p-3 rounded border border-retro-border hover:border-retro-cyan/50 hover:bg-retro-cyan/5 transition-colors",role:"button",tabindex:"0"},[d("div",h7,[d("div",d7,[d("h3",f7,M(W.title),1),d("p",p7,M(U(W.messages)),1),d("p",m7," Archived: "+M(q(W.archivedAt)),1),d("p",g7," Updated: "+M(q(W.updatedAt)),1)]),d("div",O7,[d("button",{onClick:ln(_=>le(W.id),["stop"]),class:"inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border border-retro-cyan/40 text-retro-cyan rounded hover:bg-retro-cyan/10 transition-colors",title:"Restore archived conversation"},[se(p(Zd),{class:"w-3.5 h-3.5"}),N[9]||(N[9]=Ne(" Restore ",-1))],8,v7),d("button",{onClick:ln(_=>X(W.id),["stop"]),class:"inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border border-red-400/40 text-red-300 rounded hover:bg-red-500/10 transition-colors",title:"Delete archived conversation"},[se(p(Gr),{class:"w-3.5 h-3.5"}),N[10]||(N[10]=Ne(" Delete ",-1))],8,b7)])])],40,["onClick","onKeydown"]));return w.memo=C,w},N,5),128)):(v(),b("div",x7,[d("p",y7,'No archived results for "'+M(r.value)+'"',1)]))])):(v(),b("div",k7,[...N[11]||(N[11]=[d("p",{class:"font-mono text-sm"},"No archived conversations",-1),d("p",{class:"text-xs mt-1"},"Archived conversations will appear here",-1)])]))],64)):(v(),b(we,{key:0},[p(e).hasConversations?(v(),b("div",o7,[S.value.length>0?(v(!0),b(we,{key:0},Fe(S.value,(W,ve,te,he)=>{const C=[W.id,W.title,W.updatedAt,W.messages.length,W.finalized,W.id===p(e).activeConversationId,p(e).isConversationStreaming(W.id),T.value===W.id];if(he&&he.key===W.id&&Ld(he,C))return he;const w=(v(),b("div",{key:W.id},[se(eb,{conversation:W,"is-active":W.id===p(e).activeConversationId,"is-streaming":p(e).isConversationStreaming(W.id),"is-previewing":T.value===W.id,onSelect:_=>I(W.id),onArchive:_=>ue(W.id),onRename:_=>B(W.id,_)},null,8,["conversation","is-active","is-streaming","is-previewing","onSelect","onArchive","onRename"])]));return w.memo=C,w},N,3),128)):(v(),b("div",a7,[d("p",l7,'No results for "'+M(r.value)+'"',1)]))])):(v(),b("div",c7,[...N[8]||(N[8]=[d("p",{class:"font-mono text-sm"},"No conversations",-1),d("p",{class:"text-xs mt-1"},'Click "New" to start',-1)])]))],64))]),se(ph,{show:i.value,creating:o.value,onClose:N[7]||(N[7]=W=>i.value=!1),onCreate:K},null,8,["show","creating"]),se(ph,{show:a.value,creating:l.value,onClose:oe,onCreate:Z},null,8,["show","creating"])]))}}),S7={mobile:768,tablet:1024};function $7(n,e){return n<e.mobile?"mobile":n<e.tablet?"tablet":"desktop"}const Zv=mh("layout",{state:()=>({currentViewport:"desktop",chatFullscreen:!1}),getters:{isMobile:n=>n.currentViewport==="mobile",isTablet:n=>n.currentViewport==="tablet",isDesktop:n=>n.currentViewport==="desktop",isChatFullscreen:n=>n.chatFullscreen},actions:{updateViewport(n){this.currentViewport=$7(n,S7)},toggleChatFullscreen(){this.chatFullscreen=!this.chatFullscreen},setChatFullscreen(n){this.chatFullscreen=n}}});function C7(){const n=R(null),e=R(!0);let t=null,r="smooth";const s=50;function i(){const f=n.value;return f?f.scrollHeight-f.scrollTop-f.clientHeight<s:!0}function o(){e.value=i()}function a(f="smooth"){if(r=f,t!==null)return;t=(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):g=>setTimeout(()=>g(Date.now()),16))(()=>{t=null,Gn(()=>{const g=n.value;g&&g.scrollTo({top:g.scrollHeight,behavior:r})})})}function l(f="smooth"){a(f),e.value=!0}function c(f="smooth"){e.value&&a(f)}function u(){e.value=!0}function h(){e.value=!1}return{containerRef:n,shouldAutoScroll:Le(e),onScroll:o,scrollToBottom:a,forceScrollToBottom:l,maybeScrollToBottom:c,enableAutoScroll:u,disableAutoScroll:h}}function Q7(n){if(!n)return null;if(n instanceof HTMLElement)return n;if(typeof n=="object"&&"$el"in n){const e=n.$el;return e instanceof HTMLElement?e:null}return null}function P7(n){const{allMessages:e,containerRef:t,estimateItemHeight:r=120,overscan:s=6}=n,i=R(0),o=R(0),a=R(new Map),l=new Map;let c=null;function u(S,Q){if(!Number.isFinite(Q)||Q<=0)return;const T=Math.ceil(Q);if(a.value.get(S)===T)return;const D=new Map(a.value);D.set(S,T),a.value=D}function h(S,Q){u(S,Q.getBoundingClientRect().height)}function f(S,Q){const T=l.get(S);T&&c&&c.unobserve(T),T&&delete T.dataset.virtualMessageId,l.delete(S);const D=Q7(Q);D&&(D.dataset.virtualMessageId=S,l.set(S,D),h(S,D),c&&c.observe(D))}function m(){const S=t.value;S&&(i.value=S.scrollTop)}const g=Y(()=>{const S=e.value,Q=new Array(S.length);let T=0;for(let D=0;D<S.length;D++)Q[D]=T,T+=a.value.get(S[D].id)??r;return{offsets:Q,totalHeight:T}});function O(S,Q){let T=0,D=S.length-1,K=S.length;for(;T<=D;){const I=Math.floor((T+D)/2);S[I]>=Q?(K=I,D=I-1):T=I+1}return K===S.length?Math.max(0,S.length-1):K}const y=Y(()=>{const S=e.value;if(S.length===0)return[];const{offsets:Q}=g.value,T=i.value,D=T+Math.max(o.value,1),K=O(Q,Math.max(0,T-r));let I=K;for(;I<S.length&&Q[I]<D;)I++;const ue=Math.max(0,K-s),le=Math.min(S.length,I+s),oe=[];for(let Z=ue;Z<le;Z++)oe.push({message:S[Z],index:Z,top:Q[Z]});return oe}),x=Y(()=>g.value.totalHeight);return Tt(()=>{const S=t.value;S&&(o.value=S.clientHeight,i.value=S.scrollTop),c=new ResizeObserver(Q=>{for(const T of Q){const D=T.target;if(t.value&&D===t.value){o.value=T.contentRect.height;continue}const K=D.dataset.virtualMessageId;K&&u(K,T.contentRect.height)}}),t.value&&c.observe(t.value);for(const[Q,T]of l)T.dataset.virtualMessageId=Q,c.observe(T),h(Q,T)}),zt(()=>{c&&(c.disconnect(),c=null),l.clear()}),{visibleItems:y,totalHeight:x,onVirtualScroll:m,setItemRef:f}}const T7=["innerHTML"],M7=We({__name:"ChatTextBlock",props:{block:{}},setup(n){const e=n,{renderMarkdown:t}=ic(),r=Y(()=>t(e.block.text));return(s,i)=>n.block.text.trim()?(v(),b("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:p(r)},null,8,T7)):V("",!0)}}),A7={class:"my-1 border border-retro-border/30 rounded bg-retro-dark/30"},_7={key:0,class:"text-retro-muted/80 truncate min-w-0"},R7={class:"ml-auto text-retro-muted/60 text-[10px]"},E7={key:0,class:"px-3 pb-2 text-xs font-mono text-retro-muted whitespace-pre-wrap max-h-60 overflow-y-auto scrollbar-custom border-t border-retro-border/20"},B7=We({__name:"ChatThinkingBlock",props:{block:{}},setup(n){const e=n,t=R(!1),r=Y(()=>e.block.thinking.split(`
124
+ `).length),s=Y(()=>e.block.thinking.length>0&&e.block.thinking.length<=240&&r.value<=6),i=Y(()=>{const o=e.block.thinking.replace(/\s+/g," ").trim();return o?o.length>140?`${o.slice(0,140)}...`:o:""});return Ye(()=>e.block.id,()=>{t.value=s.value},{immediate:!0}),(o,a)=>(v(),b("div",A7,[d("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-yellow transition-colors",onClick:a[0]||(a[0]=l=>t.value=!p(t))},[se(p(vh),{class:Pe(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":p(t)}])},null,8,["class"]),a[1]||(a[1]=d("span",{class:"text-retro-yellow"},"Thinking",-1)),!p(t)&&p(i)?(v(),b("span",_7,M(p(i)),1)):V("",!0),d("span",R7,M(p(r))+" lines · "+M(n.block.thinking.length)+" chars ",1)]),p(t)?(v(),b("div",E7,M(n.block.thinking),1)):V("",!0)]))}}),L7={class:"my-2 border border-retro-border/40 rounded bg-retro-dark/30"},D7={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},Z7={class:"text-retro-muted"},I7={class:"text-retro-cyan font-bold"},X7={class:"text-retro-muted truncate"},z7={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},N7={key:0,class:"mt-2"},V7={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-36 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},W7={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},j7={key:0,class:"flex items-start gap-2"},q7={class:"text-retro-cyan break-all"},Y7={key:1,class:"flex items-start gap-2"},F7={class:"text-retro-cyan break-all whitespace-pre-wrap"},U7={key:2,class:"flex items-start gap-2"},G7={key:1,class:"mt-2"},H7={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-52 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},K7={key:0,class:"text-[10px] text-retro-muted mt-1"},J7={key:2,class:"mt-2"},eL={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},tL={key:0,class:"text-[10px] text-retro-muted mt-1"},nL={key:3,class:"mt-2"},rL={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},sL={key:0,class:"text-[10px] text-retro-muted mt-1"},iL={class:"mt-2"},oL={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom"},aL={key:4,class:"mt-3"},lL={class:"space-y-2"},cL={key:0,class:"text-[11px] font-mono text-retro-yellow mb-1"},uL={key:1,class:"text-xs font-mono text-retro-text whitespace-pre-wrap"},hL={key:2,class:"mt-2 space-y-1"},dL={key:0,class:"text-retro-muted/80"},fL={key:1,class:"px-3 pb-2 border-t border-retro-border/20"},pL={class:"mb-1 text-[10px] text-retro-muted"},mL={class:"text-retro-green"},gL={class:"text-retro-red"},OL={class:"space-y-0.5"},vL={class:"whitespace-pre-wrap"},bL={class:"whitespace-pre-wrap"},xL=We({__name:"ChatToolBlock",props:{block:{},result:{}},setup(n){const e=n,t=R(!1),r=R(!1);function s(z,F){for(const ne of F){const Qe=z[ne];if(typeof Qe=="string"&&Qe.trim())return Qe}return""}function i(z,F){for(const ne of F){const Qe=z[ne];if(typeof Qe=="number"&&Number.isFinite(Qe))return Qe;if(typeof Qe=="string"&&Qe.trim()){const ke=Number(Qe);if(Number.isFinite(ke))return ke}}return null}function o(z,F=14,ne=1400){if(!z)return{text:"",truncated:!1};const Qe=z.split(`
125
+ `);let ke=Qe.slice(0,F).join(`
126
+ `),qe=Qe.length>F;return ke.length>ne&&(ke=ke.slice(0,ne),qe=!0),{text:ke,truncated:qe}}const a=Y(()=>e.block.name.toLowerCase()),l=Y(()=>a.value.replace(/[^a-z0-9]/g,"")),c=Y(()=>l.value==="requestuserinput"||l.value==="askuserquestion"),u=Y(()=>a.value==="read"),h=Y(()=>a.value==="write"),f=Y(()=>a.value==="edit"||a.value==="multiedit"),m=Y(()=>["bash","exec","execcommand","runcommand"].includes(a.value)),g=Y(()=>e.block.status==="running"||e.block.status==="error"||h.value||f.value||c.value),O=Y(()=>{if(!c.value)return[];const z=e.block.input.questions;if(Array.isArray(z))return z.map(ne=>ne&&typeof ne=="object"?ne:null).filter(ne=>!!ne);const F={header:s(e.block.input,["header","title"]),id:s(e.block.input,["id"]),question:s(e.block.input,["question"]),prompt:s(e.block.input,["prompt"]),message:s(e.block.input,["message","text","description"]),options:Array.isArray(e.block.input.options)?e.block.input.options:void 0};return!F.question&&!F.prompt&&!F.message&&!F.header?[]:[F]});function y(z,F=120){const ne=z.replace(/\s+/g," ").trim();return ne?ne.length>F?`${ne.slice(0,F)}...`:ne:""}const x=Y(()=>{const z=O.value[0];return z?y(z.question||z.prompt||z.message||z.header||""):""}),S=Y(()=>s(e.block.input,["file_path","path","file","filepath","target_file"])),Q=Y(()=>{const z=i(e.block.input,["offset","start_line","line"]),F=i(e.block.input,["limit","lines","line_count"]),ne=i(e.block.input,["end_line"]);return z!==null&&F!==null?`from line ${z}, ${F} lines`:z!==null&&ne!==null?`lines ${z}-${ne}`:z!==null?`from line ${z}`:F!==null?`${F} lines`:""}),T=Y(()=>s(e.block.input,["content","text","new_content"])),D=Y(()=>s(e.block.input,["old_string","oldText","old"])),K=Y(()=>s(e.block.input,["new_string","newText","new","replacement"])),I=Y(()=>s(e.block.input,["cmd","command","script","chars"])),ue=Y(()=>o(T.value)),le=Y(()=>o(D.value,10,1e3)),oe=Y(()=>o(K.value,10,1e3)),Z=Y(()=>{if(c.value)return x.value||"Prompting user for clarification";if(u.value){if(S.value&&Q.value)return`Read ${S.value} (${Q.value})`;if(S.value)return`Read ${S.value}`}return h.value&&S.value?`Write ${S.value}`:f.value&&S.value?`Edit ${S.value}`:m.value&&I.value?`$ ${I.value}`:e.block.inputSummary}),X=Y(()=>{switch(e.block.status){case"running":return"[RUN]";case"pending":return"[WAIT]";case"complete":return"[OK]";case"error":return"[ERR]"}}),B=Y(()=>Object.entries(e.block.input).filter(([F,ne])=>ne==null||typeof ne=="string"&&(!ne.trim()||ne.length>90)?!1:!["content","new_content","text","old_string","new_string"].includes(F)).slice(0,6).map(([F,ne])=>`${F}=${JSON.stringify(ne)}`)),q=Y(()=>{switch(e.block.status){case"running":return"text-retro-yellow";case"pending":return"text-retro-muted";case"complete":return"text-retro-green";case"error":return"text-retro-red"}}),U=Y(()=>e.result?.content??""),j=Y(()=>e.result?.isError??!1),N=Y(()=>U.value.length),W=Y(()=>U.value.split(`
127
+ `)),ve=Y(()=>r.value?W.value:W.value.slice(0,6)),te=Y(()=>!U.value||!/^diff --git\s|\+\+\+\s|---\s|@@\s/m.test(U.value)?!1:/^[+\- ]/.test(W.value.find(F=>F.length>0)||"")||W.value.some(F=>F.startsWith("@@"))),he=Y(()=>{if(!te.value)return{added:0,removed:0};let z=0,F=0;for(const ne of W.value)ne.startsWith("+++")||ne.startsWith("---")||(ne.startsWith("+")&&(z+=1),ne.startsWith("-")&&(F+=1));return{added:z,removed:F}}),C=Y(()=>U.value?U.value.split(`
128
+ `).slice(0,3).join(`
129
+ `):""),w=Y(()=>U.value?W.value.length>6||U.value.length>320:!1),_=Y(()=>U.value.trim().length>0);function E(z){return z.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":z.startsWith("+")&&!z.startsWith("+++")?"text-retro-green bg-retro-green/10":z.startsWith("-")&&!z.startsWith("---")?"text-retro-red bg-retro-red/10":z.startsWith("diff --git")||z.startsWith("index ")||z.startsWith("---")||z.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return Ye(()=>e.block.id,()=>{t.value=g.value,r.value=!1},{immediate:!0}),Ye(()=>e.block.status,z=>{(z==="running"||z==="error")&&(t.value=!0)}),(z,F)=>(v(),b("div",L7,[d("button",{class:"flex items-center gap-2 w-full px-3 py-2 text-xs font-mono hover:bg-retro-dark/40 transition-colors text-left",onClick:F[0]||(F[0]=ne=>t.value=!p(t))},[n.block.status==="running"?(v(),b("span",D7)):n.block.status==="pending"?(v(),Oe(p(ag),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):n.block.status==="complete"?(v(),Oe(p(Zl),{key:2,class:Pe(["w-3.5 h-3.5 flex-shrink-0",p(q)])},null,8,["class"])):(v(),Oe(p(Mi),{key:3,class:Pe(["w-3.5 h-3.5 flex-shrink-0",p(q)])},null,8,["class"])),d("span",Z7,M(p(X)),1),d("span",I7,M(n.block.name),1),d("span",X7,M(p(Z)||n.block.inputSummary),1),se(p(vh),{class:Pe(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":p(t)}])},null,8,["class"])]),p(t)?(v(),b("div",z7,[p(B).length>0?(v(),b("div",N7,[F[5]||(F[5]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Args",-1)),d("pre",V7,M(p(B).join(`
130
+ `)),1)])):V("",!0),d("div",W7,[p(S)?(v(),b("div",j7,[F[6]||(F[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",q7,M(p(S)),1)])):V("",!0),p(m)&&p(I)?(v(),b("div",Y7,[F[7]||(F[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",F7,M(p(I)),1)])):V("",!0),p(u)&&p(Q)?(v(),b("div",U7,[F[8]||(F[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,M(p(Q)),1)])):V("",!0)]),p(h)&&p(ue).text?(v(),b("div",G7,[F[9]||(F[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",H7,M(p(ue).text),1),p(ue).truncated?(v(),b("div",K7,"Truncated preview")):V("",!0)])):V("",!0),p(f)&&p(le).text?(v(),b("div",J7,[F[10]||(F[10]=d("div",{class:"text-[11px] font-mono text-retro-yellow mb-1"},"Before",-1)),d("pre",eL,M(p(le).text),1),p(le).truncated?(v(),b("div",tL,"Truncated preview")):V("",!0)])):V("",!0),p(f)&&p(oe).text?(v(),b("div",nL,[F[11]||(F[11]=d("div",{class:"text-[11px] font-mono text-retro-green mb-1"},"After",-1)),d("pre",rL,M(p(oe).text),1),p(oe).truncated?(v(),b("div",sL,"Truncated preview")):V("",!0)])):V("",!0),d("details",iL,[F[12]||(F[12]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",oL,M(JSON.stringify(n.block.input,null,2)),1)]),p(c)&&p(O).length>0?(v(),b("div",aL,[F[13]||(F[13]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",lL,[(v(!0),b(we,null,Fe(p(O),(ne,Qe)=>(v(),b("div",{key:`${ne.id||"q"}-${Qe}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[ne.header?(v(),b("div",cL,M(ne.header),1)):V("",!0),ne.question||ne.prompt||ne.message?(v(),b("div",uL,M(ne.question||ne.prompt||ne.message),1)):V("",!0),Array.isArray(ne.options)&&ne.options.length>0?(v(),b("div",hL,[(v(!0),b(we,null,Fe(ne.options,(ke,qe)=>(v(),b("div",{key:`${ne.id||"q"}-opt-${qe}`,class:"text-xs font-mono text-retro-muted"},[Ne(M(ke.label||`Option ${qe+1}`)+" ",1),ke.description?(v(),b("span",dL," - "+M(ke.description),1)):V("",!0)]))),128))])):V("",!0)]))),128))])])):V("",!0)])):V("",!0),p(_)?(v(),b("div",fL,[d("div",{class:Pe(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",p(j)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:mn(p(r)?"max-height: 20rem":"")},[p(te)?(v(),b(we,{key:0},[d("div",pL,[F[14]||(F[14]=Ne(" Diff · ",-1)),d("span",mL,"+"+M(p(he).added),1),F[15]||(F[15]=Ne(" / ",-1)),d("span",gL,"-"+M(p(he).removed),1)]),d("div",OL,[(v(!0),b(we,null,Fe(p(ve),(ne,Qe)=>(v(),b("div",{key:`diff-${Qe}`,class:Pe(["px-1 rounded whitespace-pre-wrap break-all",E(ne)])},M(ne||" "),3))),128))]),!p(r)&&p(w)?(v(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:F[1]||(F[1]=ln(ne=>r.value=!0,["stop"]))}," Show full diff ("+M(p(N))+" chars) ",1)):p(w)?(v(),b("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:F[2]||(F[2]=ln(ne=>r.value=!1,["stop"]))}," Collapse diff ")):V("",!0)],64)):!p(r)&&p(w)?(v(),b(we,{key:1},[d("pre",vL,M(p(C)),1),d("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:F[3]||(F[3]=ln(ne=>r.value=!0,["stop"]))}," Show full ("+M(p(N))+" chars) ",1)],64)):(v(),b(we,{key:2},[d("pre",bL,M(p(U)),1),p(w)?(v(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:F[4]||(F[4]=ln(ne=>r.value=!1,["stop"]))}," Collapse ")):V("",!0)],64))],6)])):V("",!0)]))}}),yL={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},kL={class:"flex items-center gap-1"},wL={class:"flex items-center gap-1"},SL=We({__name:"ChatResultSummary",props:{block:{}},setup(n){const e=n,t=Y(()=>{const i=Math.round(e.block.durationMs/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}),r=Y(()=>`$${e.block.totalCostUsd.toFixed(4)}`),s=Y(()=>{const{inputTokens:i,outputTokens:o}=e.block.usage;return`${i.toLocaleString()} in / ${o.toLocaleString()} out`});return(i,o)=>(v(),b("div",yL,[d("span",kL,[o[0]||(o[0]=d("span",{class:"text-retro-muted/60"},"time",-1)),Ne(" "+M(p(t)),1)]),d("span",wL,[o[1]||(o[1]=d("span",{class:"text-retro-muted/60"},"cost",-1)),Ne(" "+M(p(r)),1)]),d("span",null,M(p(s)),1),d("span",null,M(n.block.numTurns)+" turn"+M(n.block.numTurns!==1?"s":""),1)]))}}),$L={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},CL={class:"text-retro-cyan"},QL={key:0,class:"text-retro-border"},PL={key:1},TL=We({__name:"ChatSessionInit",props:{block:{}},setup(n){return(e,t)=>(v(),b("div",$L,[d("span",CL,M(n.block.model),1),t[0]||(t[0]=d("span",{class:"text-retro-border"},"|",-1)),d("span",null,M(n.block.tools.length)+" tools",1),n.block.permissionMode?(v(),b("span",QL,"|")):V("",!0),n.block.permissionMode?(v(),b("span",PL,M(n.block.permissionMode),1)):V("",!0)]))}}),ML=We({__name:"ChatContentBlock",props:{block:{},toolResultsByUseId:{}},setup(n){const e=n,t=Y(()=>{if(e.block.type==="tool_use")return e.toolResultsByUseId.get(e.block.toolUseId)});return(r,s)=>{const i=M7,o=B7,a=xL,l=SL,c=TL;return n.block.type==="text"?(v(),Oe(i,{key:0,block:n.block},null,8,["block"])):n.block.type==="thinking"?(v(),Oe(o,{key:1,block:n.block},null,8,["block"])):n.block.type==="tool_use"?(v(),Oe(a,{key:2,block:n.block,result:p(t)},null,8,["block","result"])):n.block.type==="result_summary"?(v(),Oe(l,{key:3,block:n.block},null,8,["block"])):n.block.type==="session_init"?(v(),Oe(c,{key:4,block:n.block},null,8,["block"])):V("",!0)}}}),AL={class:"flex-1 min-w-0"},_L={class:"flex items-center gap-2 mb-1"},RL={class:"text-xs font-mono text-retro-muted"},EL={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},BL={key:1,class:"text-xs font-mono text-retro-muted"},LL={key:2,class:"text-xs font-mono text-retro-red"},DL={key:1,class:"mb-2 flex flex-wrap gap-2"},ZL=["href","download"],IL=["src","alt"],XL={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},zL=["innerHTML"],NL={key:3,class:"text-xs font-mono text-retro-muted italic"},VL={key:4,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},WL=We({__name:"ChatMessage",props:{message:{}},setup(n){const e=n,{renderMarkdown:t}=ic(),r=Y(()=>e.message.role==="user"),s=Y(()=>e.message.status==="streaming"),i=Y(()=>e.message.status==="error"),o=Y(()=>e.message.status==="stopped"),a=Y(()=>cb(e.message)),l=Y(()=>{const O=new Map;for(const y of e.message.contentBlocks??[])y.type==="tool_result"&&O.set(y.toolUseId,y);return O}),c=Y(()=>{if(!e.message.contentBlocks)return[];const O=e.message.contentBlocks.filter(x=>x.type!=="tool_result"),y=[];for(const x of O){const S=y.length>0?y[y.length-1]:null;if(S?.type==="text"&&x.type==="text"){const Q=S.text||"",T=x.text||"";S.text=`${Q}${T}`;continue}if(S?.type==="thinking"&&x.type==="thinking"){const Q=S.thinking||"",T=x.thinking||"";S.thinking=`${Q}${T}`;continue}y.push({...x})}return y}),u=Y(()=>a.value&&c.value.length>0),h=Y(()=>e.message.content.trim().length>0),f=Y(()=>e.message.attachments??[]),m=O=>new Date(O).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),g=Y(()=>t(e.message.content));return(O,y)=>{const x=ML;return v(),b("div",{class:Pe(["flex gap-3 p-3",[p(r)?"bg-retro-dark/50":"bg-transparent",p(i)?"border-l-2 border-retro-red":""]])},[d("div",{class:Pe(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",p(r)?"bg-retro-cyan/20":"bg-retro-green/20"])},[p(r)?(v(),Oe(p(iu),{key:0,class:"w-4 h-4 text-retro-cyan"})):(v(),Oe(p(ug),{key:1,class:"w-4 h-4 text-retro-green"}))],2),d("div",AL,[d("div",_L,[d("span",{class:Pe(["text-xs font-mono",p(r)?"text-retro-cyan":"text-retro-green"])},M(p(r)?"You":"Assistant"),3),d("span",RL,M(m(n.message.timestamp)),1),p(s)?(v(),b("span",EL," typing... ")):V("",!0),p(o)?(v(),b("span",BL," (stopped) ")):V("",!0),p(i)?(v(),b("span",LL," (error) ")):V("",!0)]),p(u)?(v(!0),b(we,{key:0},Fe(p(c),S=>(v(),Oe(x,{key:S.id,block:S,"tool-results-by-use-id":p(l)},null,8,["block","tool-results-by-use-id"]))),128)):V("",!0),p(r)&&p(f).length>0?(v(),b("div",DL,[(v(!0),b(we,null,Fe(p(f),S=>(v(),b("a",{key:S.id,href:S.dataUrl,download:S.name,target:"_blank",rel:"noopener noreferrer",class:"w-28 rounded border border-retro-border/70 bg-retro-black/70 p-1 hover:border-retro-cyan/60"},[d("img",{src:S.dataUrl,alt:S.name,class:"h-20 w-full rounded object-cover"},null,8,IL),d("div",XL,M(S.name),1)],8,ZL))),128))])):V("",!0),!p(u)&&p(h)?(v(),b("div",{key:2,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:p(g)},null,8,zL)):V("",!0),!p(u)&&!p(h)&&!p(r)&&!p(s)?(v(),b("div",NL," (no visible response content) ")):V("",!0),p(s)?(v(),b("span",VL)):V("",!0)])],2)}}}),jL={key:0,class:"flex flex-col items-center justify-center h-full p-8 text-center"},qL={key:1,class:"relative"},YL={class:"sticky bottom-0"},FL={key:0,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50 backdrop-blur-sm"},UL={key:1,class:"px-4 py-2.5 bg-retro-red/20 border-t border-retro-red/50"},GL={class:"flex items-start gap-2"},HL={class:"flex-1 min-w-0"},KL={class:"flex items-center justify-between gap-2 mb-0.5"},JL={class:"text-xs font-mono text-retro-red/80 break-words whitespace-pre-wrap"},eD={key:2,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50"},tD=We({__name:"ChatMessages",setup(n){const e=Jn(),{containerRef:t,onScroll:r,maybeScrollToBottom:s,scrollToBottom:i,forceScrollToBottom:o}=C7(),{visibleItems:a,totalHeight:l,onVirtualScroll:c,setItemRef:u}=P7({allMessages:Y(()=>e.messages),containerRef:t});function h(){r(),c()}const f=Y(()=>e.isActiveConversationStreaming),m=Y(()=>{const S=e.lastMessage;return!S||S.role!=="assistant"?null:S.status}),g=R(!1);function O(S){const Q=S.contentBlocks;return!Q||Q.length===0?"":Q.map(T=>{switch(T.type){case"tool_use":return`u:${T.id}:${T.status}:${T.inputSummary}`;case"tool_result":return`r:${T.id}:${T.toolUseId}:${T.isError?1:0}:${T.content.length}`;case"text":return`t:${T.id}:${T.text.length}`;case"thinking":return`k:${T.id}:${T.thinking.length}`;case"result_summary":return`s:${T.id}:${T.numTurns}:${T.durationMs}`;case"session_init":return`i:${T.id}:${T.model}:${T.tools.length}`;default:return""}}).join("|")}const y=R(null);function x(){if(y.value&&(y.value(),y.value=null),!t.value||typeof ResizeObserver>"u")return;const S=new ResizeObserver(()=>{s("instant")});S.observe(t.value),y.value=()=>{S.disconnect()}}return Tt(()=>{i("instant"),x()}),zt(()=>{y.value&&y.value()}),Ye(()=>e.activeConversationId,()=>{g.value=!1,i("instant")}),Ye(t,()=>{x()}),Ye(()=>[e.activeConversationId,e.messages.length],([S,Q])=>{!S||Q===0||g.value||(g.value=!0,o("instant"))},{immediate:!0}),Ye(()=>e.messages.length,()=>{s("instant")}),Ye(()=>e.lastMessage?.content,()=>{s("instant")}),Ye([f,()=>e.lastError],()=>{s("instant")}),Ye(l,()=>{s("instant")}),(S,Q)=>(v(),b("div",{ref_key:"containerRef",ref:t,class:"flex-1 overflow-y-auto",onScroll:h},[p(e).hasMessages?(v(),b("div",qL,[d("div",{class:"relative",style:mn({height:`${p(l)}px`})},[(v(!0),b(we,null,Fe(p(a),T=>(v(),b("div",{key:T.message.id,class:"absolute left-0 right-0 border-b border-retro-border/30",style:mn({transform:`translateY(${T.top}px)`})},[d("div",{ref_for:!0,ref:D=>p(u)(T.message.id,D)},[Um([T.message.id,T.message.status,T.message.content,T.message.contentBlocks?.length||0,O(T.message),T.message.tools?.length||0],()=>se(WL,{message:T.message},null,8,["message"]),Q,0)],512)],4))),128))],4)])):(v(),b("div",jL,[...Q[2]||(Q[2]=[d("div",{class:"text-retro-muted text-sm font-mono mb-2"}," No messages yet ",-1),d("div",{class:"text-retro-muted text-xs font-mono"}," Send a message to start chatting ",-1)])])),d("div",YL,[p(f)&&!p(e).lastError?(v(),b("div",FL,[...Q[3]||(Q[3]=[Hm('<div class="flex items-center gap-2"><div class="flex gap-1"><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:0ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:150ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:300ms;"></span></div><span class="text-xs font-mono text-retro-muted">Processing...</span></div>',1)])])):V("",!0),p(e).lastError?(v(),b("div",UL,[d("div",GL,[se(p(Mi),{class:"w-4 h-4 text-retro-red flex-shrink-0 mt-0.5"}),d("div",HL,[d("div",KL,[Q[4]||(Q[4]=d("p",{class:"text-xs font-mono font-semibold text-retro-red"},"Error",-1)),d("button",{class:"text-xs font-mono text-retro-red/60 hover:text-retro-red underline",onClick:Q[1]||(Q[1]=T=>p(e).clearError())}," Dismiss ")]),d("p",JL,M(p(e).lastError),1),Q[5]||(Q[5]=d("p",{class:"text-xs font-mono text-retro-muted mt-1"}," Check browser console (F12) for more details ",-1))])])])):p(m)==="stopped"?(v(),b("div",eD,[...Q[6]||(Q[6]=[d("div",{class:"flex items-center gap-2"},[d("span",{class:"w-2 h-2 rounded-full bg-retro-muted"}),d("span",{class:"text-xs font-mono text-retro-muted"},"Stopped")],-1)])])):V("",!0)])],544))}});function nD(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z","clip-rule":"evenodd"})])}function Ym(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z","clip-rule":"evenodd"})])}function rD(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function sD(n,e){return v(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd"})])}const iD={class:"flex-shrink-0 flex-grow-0 border-t border-retro-border bg-retro-dark p-3"},oD={class:"flex items-center gap-2 mb-2"},aD={class:"relative min-w-0 flex-1 max-w-[154px] model-selector"},lD=["disabled"],cD={class:"truncate text-left"},uD={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[220px] max-w-[280px]"},hD={key:0,class:"px-3 py-1.5 text-xs font-mono text-retro-muted"},dD={class:"px-3 py-1 text-[11px] font-mono uppercase tracking-wide text-retro-cyan/80 select-none"},fD=["disabled","onClick"],pD={class:"truncate"},mD={class:"relative mode-selector"},gD={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[140px]"},OD=["onClick"],vD={class:"text-xs font-mono text-retro-muted"},bD={key:0,class:"mb-3 p-3 bg-retro-yellow/10 border border-retro-yellow/50 rounded"},xD={class:"flex items-center justify-between gap-3"},yD={class:"flex-1 min-w-0"},kD={class:"text-xs font-mono text-retro-text truncate"},wD={class:"text-retro-cyan"},SD={key:0,class:"text-retro-muted"},$D={key:1,class:"text-retro-muted"},CD={key:1,class:"mb-3 p-3 bg-retro-cyan/10 border border-retro-cyan/50 rounded"},QD={key:2,class:"mb-2 flex flex-wrap gap-2"},PD=["src","alt"],TD={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},MD={class:"truncate text-[10px] font-mono text-retro-muted/80"},AD=["onClick"],_D={class:"flex gap-2 items-start"},RD=["disabled"],ED={class:"flex-1 relative min-h-[40px]"},BD=["disabled","placeholder"],LD=["disabled"],Fm=4,DD=5*1024*1024,ZD=We({__name:"ChatInput",props:{disabled:{type:Boolean}},setup(n){const e=n,t=Jn(),r=Dl(),{sendMessage:s,sendPermissionResponse:i,approvePlan:o,rejectPlan:a,abort:l,resetContext:c}=oc(),u=R(""),h=R(null),f=R(null),m=R(!1),g=R(!1),O=R(!1),y=R([]);let x=null;const S=R(null),{data:Q,pending:T}=su("chat-input-ai-providers",()=>$fetch("/api/ai/providers"),{server:!1,default:()=>({providers:[]})}),D=Y(()=>Q.value?.providers??[]),K=Y(()=>t.permissionMode==="ask"||t.permissionMode==="plan"),I=Y(()=>{const ee=new Map;for(const ie of D.value)for(const xe of ie.models)ee.set(xe.label,(ee.get(xe.label)??0)+1);return D.value.flatMap(ie=>ie.models.map(xe=>{const Re=ie.capabilities.streaming&&(!K.value||ie.capabilities.permissions),Ue=(ee.get(xe.label)??0)>1;return{key:`${ie.id}::${xe.key}`,providerId:ie.id,providerName:ie.name,modelKey:xe.key,modelLabel:xe.label,label:Ue?`${xe.label} · ${ie.name}`:xe.label,compatible:Re}})).sort((ie,xe)=>ie.modelLabel.localeCompare(xe.modelLabel,void 0,{sensitivity:"base"})||ie.providerName.localeCompare(xe.providerName,void 0,{sensitivity:"base"}))}),ue=Y(()=>{const ee=new Map;for(const xe of I.value){const Re=ee.get(xe.providerId);if(Re){Re.options.push(xe);continue}ee.set(xe.providerId,{providerId:xe.providerId,providerName:xe.providerName,options:[xe]})}const pe=new Map([["codex",0],["claude",1]]),ie=Array.from(ee.values());return ie.sort((xe,Re)=>{const Ue=pe.get(xe.providerId)??99,Ge=pe.get(Re.providerId)??99;return Ue!==Ge?Ue-Ge:xe.providerName.localeCompare(Re.providerName,void 0,{sensitivity:"base"})}),ie});function le(ee){return`${ee.providerId}::${ee.modelKey}`}const oe=Y(()=>{const ee=t.activeConversation;return ee?.providerId&&ee.providerModelKey?{providerId:ee.providerId,modelKey:ee.providerModelKey}:S.value?S.value:r.providerSelection}),Z=Y(()=>le(oe.value)),X=Y(()=>I.value.find(ee=>ee.key===Z.value)||null),B=Y(()=>X.value?.label||"Select model");function q(ee,pe){t.setConversationProviderSelection(ee,pe.providerId,pe.modelKey),t.clearProviderSession(ee),t.saveConversation(ee,!0)}function U(ee){S.value&&(q(ee,S.value),S.value=null)}function j(ee){if(!ee||!ee.compatible)return;const pe={providerId:ee.providerId,modelKey:ee.modelKey},ie=t.activeConversationId;if(ie){q(ie,pe),S.value=null,O.value=!1;return}S.value=pe,O.value=!1}const N={plan:xh,ask:kh,auto:og,bypass:wh},W={plan:"text-retro-cyan",ask:"text-retro-green",auto:"text-retro-yellow",bypass:"text-retro-red"};function ve(ee){t.setPermissionMode(ee),g.value=!1}function te(ee){const pe=ee.target;pe.closest(".mode-selector")||(g.value=!1),pe.closest(".model-selector")||(O.value=!1)}Tt(()=>{document.addEventListener("click",te),r.hydrate()}),zt(()=>{document.removeEventListener("click",te),x!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(x),x=null)});const he=Y(()=>(u.value.trim().length>0||y.value.length>0)&&!t.isActiveConversationStreaming&&!m.value&&!t.pendingPermission&&!_.value),C=Y(()=>t.isActiveConversationStreaming&&!t.pendingPermission),w=Y(()=>t.pendingPermission!==null),_=Y(()=>t.pendingPlanApproval!==null);function E(){i(!0,t.activeConversationId)}function z(){i(!1,t.activeConversationId)}function F(){o(t.activeConversationId)}function ne(){a(t.activeConversationId)}function Qe(){y.value=[],f.value&&(f.value.value="")}function ke(ee){y.value=y.value.filter(pe=>pe.id!==ee)}function qe(ee){return ee<1024?`${ee} B`:ee<1024*1024?`${(ee/1024).toFixed(1)} KB`:`${(ee/(1024*1024)).toFixed(1)} MB`}function He(ee){return new Promise((pe,ie)=>{const xe=new FileReader;xe.onload=()=>{typeof xe.result=="string"?pe(xe.result):ie(new Error("Failed to read image"))},xe.onerror=()=>ie(xe.error||new Error("Failed to read image")),xe.readAsDataURL(ee)})}async function me(ee){const pe=ee.target,ie=pe.files?Array.from(pe.files):[];if(ie.length===0)return;const{useToast:xe}=await Ns(async()=>{const{useToast:Ge}=await import("./CLPz4Oer.js").then(it=>it.c);return{useToast:Ge}},__vite__mapDeps([0,1,2]),import.meta.url),Re=xe();let Ue=Fm-y.value.length;if(Ue<=0){Re.warning(`You can attach up to ${Fm} images per message.`),pe.value="";return}for(const Ge of ie){if(Ue<=0)break;if(!Ge.type.startsWith("image/")){Re.warning(`Skipped "${Ge.name}": only image files are supported.`);continue}if(Ge.size>DD){Re.warning(`Skipped "${Ge.name}": max size is 5 MB.`);continue}try{const it=await He(Ge);y.value.push({id:`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:Ge.name,mimeType:Ge.type,size:Ge.size,dataUrl:it}),Ue--}catch{Re.error(`Failed to attach "${Ge.name}".`)}}pe.value=""}const Ee=Y(()=>{if(t.isActiveConversationStreaming||m.value)return!1;const ee=t.lastMessage;return ee?.role==="assistant"&&ee?.status==="error"});function de(ee){const pe=ee.instructionFiles.length>0?ee.instructionFiles.map(xe=>{const Re=xe.source==="cwd"?"cwd":"ancestor",Ue=xe.mtime?` (mtime: ${xe.mtime})`:"";return`- \`${xe.path}\` [${Re}] - ${xe.hint}${Ue}`}):["- (none detected from current cwd ancestry)"],ie=ee.specContext.files.length>0?ee.specContext.files.map(xe=>`- \`${xe}\``):["- (none)"];return["## Context Snapshot","",`- Time: ${ee.generatedAt}`,`- Session state: **${ee.sessionState}**`,`- Provider session ID: \`${ee.providerSessionId??"(empty)"}\``,`- Provider: \`${ee.providerId}\` / \`${ee.providerModelKey}\``,`- Permission mode: \`${ee.permissionMode}\``,`- CWD (requested): \`${ee.requestedCwd}\``,`- CWD (effective): \`${ee.effectiveCwd}\``,`- Feature: \`${ee.featureId??"(none)"}\``,"","### Spec Context Injection",`- Active on next turn: **${ee.specContext.active?"yes":"no"}**`,`- Reason: ${ee.specContext.reason}`,...ie,"","### Detected Instruction Files",...pe].join(`
131
+ `)}function fe(ee){return(ee.match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(ie=>ie.startsWith('"')&&ie.endsWith('"')||ie.startsWith("'")&&ie.endsWith("'")?ie.slice(1,-1):ie)}function J(ee){const pe=ee.match(/^\/(?:spec-search|specsearch)\b(.*)$/i);if(!pe)return null;const ie=fe(pe[1]?.trim()??""),xe=[],Re={q:""};for(let Ue=0;Ue<ie.length;Ue++){const Ge=ie[Ue];if(Ge==="--mode"&&ie[Ue+1]){const it=ie[++Ue];(it==="keyword"||it==="semantic"||it==="hybrid")&&(Re.mode=it);continue}if(Ge.startsWith("--mode=")){const it=Ge.slice(7);(it==="keyword"||it==="semantic"||it==="hybrid")&&(Re.mode=it);continue}if(Ge==="--feature"&&ie[Ue+1]){Re.featureId=ie[++Ue];continue}if(Ge.startsWith("--feature=")){Re.featureId=Ge.slice(10);continue}if(Ge==="--file-type"&&ie[Ue+1]){Re.fileType=ie[++Ue];continue}if(Ge.startsWith("--file-type=")){Re.fileType=Ge.slice(12);continue}if(Ge==="--limit"&&ie[Ue+1]){const it=Number.parseInt(ie[++Ue],10);Number.isFinite(it)&&it>0&&(Re.limit=it);continue}if(Ge.startsWith("--limit=")){const it=Number.parseInt(Ge.slice(8),10);Number.isFinite(it)&&it>0&&(Re.limit=it);continue}xe.push(Ge)}return Re.q=xe.join(" ").trim(),Re}function Ce(ee,pe=1400){const ie=ee.trim();return ie.length<=pe?ie:`${ie.slice(0,pe)}
132
+ ...`}function ze(ee,pe){const ie=[];if(ie.push("## Spec Search Results"),ie.push(""),ie.push(`- Query: \`${ee.q}\``),ie.push(`- Mode: \`${pe.mode}\``),ee.featureId&&ie.push(`- Feature filter: \`${ee.featureId}\``),ee.fileType&&ie.push(`- File type filter: \`${ee.fileType}\``),ie.push(`- Hits: **${pe.totalCount}** (${pe.searchTime}ms)`),pe.warning&&ie.push(`- Warning: ${pe.warning}`),pe.results.length===0)return ie.push(""),ie.push("No matching indexed chunks were found."),ie.join(`
133
+ `);ie.push("");for(const[xe,Re]of pe.results.entries()){const Ue=Re.chunk;ie.push(`### ${xe+1}. \`${Ue.sourcePath}:${Ue.lineStart}\``),ie.push(`- Match: \`${Re.matchType}\` (score: ${Re.score.toFixed(3)})`),Ue.headingHierarchy.length>0&&ie.push(`- Headings: ${Ue.headingHierarchy.join(" > ")}`),ie.push(""),ie.push(Ce(Ue.content)),ie.push("")}return ie.join(`
134
+ `)}async function je(ee){const pe=t.activeConversationId??await t.createConversation(),ie=t.addAssistantMessage(pe);if(!ee.q){t.updateMessage(ie.id,{content:["Usage: `/spec-search <query> [--mode keyword|semantic|hybrid] [--feature <feature-id>] [--file-type <type>] [--limit <n>]`","","Examples:","- `/spec-search FR-001`",'- `/spec-search "indexing indicator" --mode hybrid --feature 008-spec-search --limit 5`'].join(`
135
+ `),status:"complete"},pe);return}const xe=t.activeConversation,Re={q:ee.q,mode:ee.mode??"hybrid",featureId:ee.featureId??xe?.featureId,fileType:ee.fileType,limit:String(ee.limit??5)};try{const Ue=await $fetch("/api/specs/search",{query:Re});t.updateMessage(ie.id,{content:ze({...ee,mode:Re.mode,featureId:Re.featureId},Ue),status:"complete"},pe)}catch(Ue){const Ge=Ue instanceof Error?Ue.message:"Failed to run spec search";t.updateMessage(ie.id,{content:`Spec search failed: ${Ge}`,status:"error"},pe)}}async function Rt(){const ee=t.activeConversation,pe={permissionMode:t.permissionMode};ee?.hasWorktree&&ee.worktreePath?pe.cwd=ee.worktreePath:ee?.cwd&&(pe.cwd=ee.cwd),ee?.featureId&&(pe.featureId=ee.featureId),ee?.providerId&&(pe.providerId=ee.providerId),ee?.providerModelKey&&(pe.providerModelKey=ee.providerModelKey),ee?.providerSessionId&&(pe.providerSessionId=ee.providerSessionId);const ie=await $fetch("/api/chat/context",{query:pe}),xe=t.activeConversationId??await t.createConversation(),Re=t.addAssistantMessage(xe);t.updateMessage(Re.id,{content:de(ie),status:"complete"},xe)}function Lt(ee=[]){const pe=Ha(t.activeConversation,!0)??{};return ee.length>0?{...pe,attachments:ee}:Object.keys(pe).length>0?pe:void 0}function pr(ee){const pe=t.addAssistantMessage(ee);return t.startSession(`session-${Date.now()}`,ee),t.startConversationStreaming(ee),t.saveConversation(ee,!0),pe}function Ut(ee,pe,ie,xe){const Re=ie instanceof Error?ie.message:xe;t.setSessionError(Re,ee),t.updateMessage(pe,{status:"error"},ee),t.endSession(ee),t.endConversationStreaming(ee)}async function tn(){const ee=u.value.trim(),pe=[...y.value];if(ee.length===0&&pe.length===0||t.isActiveConversationStreaming||m.value||e.disabled)return;const ie=!!t.activeConversationId;let xe=null,Re=null;if(ee==="/reset"||ee==="/reset-context"||ee==="/new"||ee==="/clear"){await Wt();return}if(ee==="/context"||ee==="/ctx"){await Rt(),u.value="",Qe(),Qt();return}const Ue=J(ee);if(Ue){await je(Ue),u.value="",Qe(),Qt();return}m.value=!0,u.value="",Qe(),Qt();try{if(await t.addUserMessageWithConversation(ee,pe),xe=t.activeConversationId,!xe)throw new Error("Failed to create or select a conversation");ie||U(xe);const Ge=pr(xe);Re=Ge.id,await s(ee,Ge.id,xe,Lt(pe))}catch(Ge){if(xe&&Re)Ut(xe,Re,Ge,"Failed to send message");else{const it=Ge instanceof Error?Ge.message:"Failed to send message";t.setSessionError(it)}}finally{m.value=!1}}async function Vt(){try{l(t.activeConversationId)}catch{}}async function Wt(){if(t.activeConversationId){u.value="",Qe(),Qt(),m.value=!0;try{await c(t.activeConversationId);const ee=t.addAssistantMessage(t.activeConversationId);t.updateMessage(ee.id,{content:"✨ **Context cleared** — The AI conversation context has been reset. Starting fresh from here.",status:"complete"},t.activeConversationId);const{useToast:pe}=await Ns(async()=>{const{useToast:xe}=await import("./CLPz4Oer.js").then(Re=>Re.c);return{useToast:xe}},__vite__mapDeps([0,1,2]),import.meta.url);pe().success("AI context has been reset. The conversation will start fresh.")}catch(ee){console.error("Failed to reset context:",ee);const{useToast:pe}=await Ns(async()=>{const{useToast:xe}=await import("./CLPz4Oer.js").then(Re=>Re.c);return{useToast:xe}},__vite__mapDeps([0,1,2]),import.meta.url);pe().error("Failed to reset context. Please try again.")}finally{m.value=!1}}}async function dn(){const ee=t.messages;let pe=null;for(let Re=ee.length-1;Re>=0;Re--)if(ee[Re].role==="user"){pe={content:ee[Re].content,attachments:ee[Re].attachments??[]};break}if(!pe||!t.activeConversationId)return;const ie=t.activeConversationId;t.clearError(),m.value=!0;let xe=null;try{const Re=pr(ie);xe=Re.id,await s(pe.content,Re.id,ie,Lt(pe.attachments))}catch(Re){if(xe)Ut(ie,xe,Re,"Failed to retry message");else{const Ue=Re instanceof Error?Re.message:"Failed to retry message";t.setSessionError(Ue,ie)}}finally{m.value=!1}}function nr(ee){ee.key==="Enter"&&!ee.shiftKey&&(ee.preventDefault(),tn())}function mr(){const ee=h.value;if(ee){if(!u.value.trim()){ee.style.height="";return}ee.style.height="auto",ee.style.height=Math.min(ee.scrollHeight,200)+"px"}}function Xn(){if(x!==null)return;x=(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):pe=>setTimeout(()=>pe(Date.now()),16))(()=>{x=null,mr()})}function Qt(){const ee=h.value;ee&&(ee.style.height="")}function nn(){Gn(()=>{h.value?.focus()})}return Ye(u,Xn),Ye(()=>t.isActiveConversationStreaming,(ee,pe)=>{pe&&!ee&&nn()}),Ye(()=>t.activeConversationId,()=>{t.activeConversationId&&(S.value=null),Qe(),nn()}),(ee,pe)=>(v(),b("div",iD,[d("div",oD,[d("div",aD,[d("button",{disabled:n.disabled||p(t).isActiveConversationStreaming||p(w)||p(_)||p(T)||p(I).length===0,class:"flex items-center justify-between gap-1.5 w-full px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono text-retro-muted transition-colors disabled:opacity-60 disabled:cursor-not-allowed",onClick:pe[0]||(pe[0]=ie=>O.value=!p(O))},[d("span",cD,M(p(B)),1),se(p(Ym),{class:"w-3 h-3 flex-shrink-0"})],8,lD),p(O)?(v(),b("div",uD,[p(I).length===0?(v(),b("div",hD," Loading models... ")):V("",!0),(v(!0),b(we,null,Fe(p(ue),ie=>(v(),b("div",{key:ie.providerId,class:"py-0.5"},[d("div",dD,M(ie.providerName),1),(v(!0),b(we,null,Fe(ie.options,xe=>(v(),b("button",{key:xe.key,disabled:!xe.compatible,class:Pe(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors disabled:opacity-50 disabled:cursor-not-allowed",p(Z)===xe.key?"bg-retro-panel text-retro-text":"text-retro-muted"]),onClick:Re=>j(xe)},[d("span",pD,M(xe.modelLabel)+M(xe.compatible?"":" (unsupported for current permission mode)"),1)],10,fD))),128))]))),128))])):V("",!0)]),d("div",mD,[d("button",{class:Pe(["flex items-center gap-1.5 px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono transition-colors",W[p(t).permissionMode]]),onClick:pe[1]||(pe[1]=ie=>g.value=!p(g))},[(v(),Oe(mi(N[p(t).permissionMode]),{class:"w-4 h-4"})),d("span",null,M(p(ri)[p(t).permissionMode]),1),se(p(Ym),{class:"w-3 h-3"})],2),p(g)?(v(),b("div",gD,[(v(),b(we,null,Fe(["plan","ask","auto","bypass"],ie=>d("button",{key:ie,class:Pe(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors",[W[ie],p(t).permissionMode===ie?"bg-retro-panel":""]]),onClick:xe=>ve(ie)},[(v(),Oe(mi(N[ie]),{class:"w-4 h-4"})),d("span",null,M(p(ri)[ie]),1)],10,OD)),64))])):V("",!0)]),d("span",vD,M(p(t).permissionMode==="plan"?"Plan only":p(t).permissionMode==="ask"?"Ask before actions":p(t).permissionMode==="auto"?"Auto approve":"All permissions"),1)]),p(w)?(v(),b("div",bD,[d("div",xD,[d("div",yD,[pe[4]||(pe[4]=d("div",{class:"text-xs font-mono text-retro-yellow font-bold mb-1"}," Permission Required ",-1)),d("div",kD,[d("span",wD,M(p(t).pendingPermission?.tool),1),p(t).pendingPermission?.filePath?(v(),b("span",SD," - "+M(p(t).pendingPermission.filePath),1)):p(t).pendingPermission?.command?(v(),b("span",$D," - "+M(p(t).pendingPermission.command),1)):V("",!0)])]),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:E}," Allow "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:z}," Deny ")])])])):V("",!0),p(_)?(v(),b("div",CD,[d("div",{class:"flex items-center justify-between gap-3"},[pe[5]||(pe[5]=d("div",{class:"flex-1 min-w-0"},[d("div",{class:"text-xs font-mono text-retro-cyan font-bold mb-1"}," Plan Ready for Review "),d("div",{class:"text-xs font-mono text-retro-muted"}," Approve to switch to Auto mode and start implementation. ")],-1)),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:F}," Approve & Implement "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:ne}," Reject ")])])])):V("",!0),p(y).length>0?(v(),b("div",QD,[(v(!0),b(we,null,Fe(p(y),ie=>(v(),b("div",{key:ie.id,class:"relative w-24 rounded border border-retro-border/70 bg-retro-black/80 p-1"},[d("img",{src:ie.dataUrl,alt:ie.name,class:"h-16 w-full rounded object-cover"},null,8,PD),d("div",TD,M(ie.name),1),d("div",MD,M(qe(ie.size)),1),d("button",{class:"absolute -right-2 -top-2 rounded-full border border-retro-border bg-retro-panel p-0.5 text-retro-red hover:bg-retro-red/20",type:"button",onClick:xe=>ke(ie.id)},[se(p(Yt),{class:"h-3 w-3"})],8,AD)]))),128))])):V("",!0),d("div",_D,[d("input",{ref_key:"fileInputRef",ref:f,type:"file",accept:"image/*",multiple:"",class:"hidden",onChange:me},null,544),d("button",{class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-panel/70 text-retro-muted hover:text-retro-cyan hover:bg-retro-panel disabled:opacity-50 disabled:cursor-not-allowed transition-colors",type:"button",title:"Attach images",disabled:n.disabled||p(t).isActiveConversationStreaming||p(w)||p(_),onClick:pe[2]||(pe[2]=ie=>p(f)?.click())},[se(p(Eb),{class:"w-5 h-5"})],8,RD),d("div",ED,[tt(d("textarea",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":pe[3]||(pe[3]=ie=>at(u)?u.value=ie:null),disabled:n.disabled||p(t).isActiveConversationStreaming||p(w)||p(_),placeholder:n.disabled?"This conversation is finalized (read-only)":"Type a message...",rows:"1",class:"w-full h-full min-h-[40px] px-3 py-2 bg-retro-black border border-retro-border rounded text-sm font-mono text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan disabled:opacity-50 disabled:cursor-not-allowed resize-none overflow-hidden",onKeydown:nr},null,40,BD),[[cn,p(u)]])]),p(Ee)?(v(),b("button",{key:0,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-yellow/20 text-retro-yellow hover:bg-retro-yellow/30 transition-colors",title:"Retry last message",onClick:dn},[se(p(nD),{class:"w-5 h-5"})])):V("",!0),!p(C)&&!p(w)?(v(),b("button",{key:1,disabled:!p(he),class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-cyan/20 text-retro-cyan hover:bg-retro-cyan/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:tn},[se(p(rD),{class:"w-5 h-5"})],8,LD)):p(C)?(v(),b("button",{key:2,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-red/20 text-retro-red hover:bg-retro-red/30 transition-colors",onClick:Vt},[se(p(sD),{class:"w-5 h-5"})])):V("",!0)]),pe[6]||(pe[6]=d("div",{class:"mt-1 text-xs font-mono text-retro-muted"}," Press Enter to send, Shift+Enter for new line. Slash commands: `/context`, `/reset`, `/new`, `/clear`, `/spec-search`. You can attach up to 4 images (5 MB each). ",-1))]))}}),ID={class:"h-64 border-t border-retro-border bg-retro-dark/50 flex flex-col"},XD={class:"h-9 flex items-center justify-between px-3 border-b border-retro-border/40"},zD={key:0,class:"flex-1 flex items-center justify-center text-xs font-mono text-retro-muted"},ND={key:1,class:"flex-1 overflow-y-auto scrollbar-custom"},VD={class:"flex items-center gap-2 text-[10px] font-mono"},WD={class:"text-retro-muted"},jD={class:"text-retro-muted"},qD={class:"text-retro-green truncate"},YD={class:"mt-1 text-[11px] font-mono text-retro-text whitespace-pre-wrap break-words"},FD=We({__name:"ChatDebugPanel",setup(n){const e=Jn(),{debugEvents:t}=Fv(e);function r(i){return new Date(i).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function s(i){return i==="in"?"text-retro-cyan":i==="out"?"text-retro-yellow":"text-retro-muted"}return(i,o)=>(v(),b("div",ID,[d("div",XD,[o[1]||(o[1]=d("div",{class:"text-[11px] font-mono text-retro-text"}," Debug Stream (CLI/Provider) ",-1)),d("button",{class:"p-1 rounded hover:bg-retro-panel transition-colors",title:"Clear debug events",onClick:o[0]||(o[0]=a=>p(e).clearDebugEvents())},[se(p(Gr),{class:"w-3.5 h-3.5 text-retro-muted"})])]),p(t).length===0?(v(),b("div",zD," No debug events yet ")):(v(),b("div",ND,[(v(!0),b(we,null,Fe(p(t),a=>(v(),b("div",{key:a.id,class:"px-3 py-2 border-b border-retro-border/20"},[d("div",VD,[d("span",WD,M(r(a.timestamp)),1),d("span",{class:Pe(s(a.direction))},M(a.direction.toUpperCase()),3),d("span",jD,M(a.channel),1),d("span",qD,M(a.eventType),1)]),d("pre",YD,M(a.payload),1)]))),128))]))]))}}),UD={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},GD={class:"flex items-center justify-between"},HD={class:"space-y-1 text-xs font-mono"},KD={class:"flex items-center gap-2"},JD={class:"relative"},e8=["disabled"],t8=["value"],n8=["value"],r8={class:"flex items-center gap-2"},s8={class:"text-retro-text"},i8={class:"relative"},o8=["disabled"],a8=["disabled"],l8={class:"flex items-center gap-2"},c8=["disabled"],u8=["disabled"],h8=We({__name:"FinalizeConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(n,{emit:e}){const t=n,r=e,s=R(""),i=R(null),o=R(!1),a=R(!1),l=R(t.baseBranch),c=R([]),u=R(!1),h=gh();async function f(){a.value=!0;try{const g=await $fetch("/api/chat/generate-commit-message",{method:"POST",body:{conversationId:t.worktreePath.split("/").pop()?.replace("sc-","")||"",worktreePath:t.worktreePath}});g.success&&g.message&&(s.value=g.message)}catch{}finally{a.value=!1}}Tt(async()=>{const g=(async()=>{try{const y=t.worktreePath.split("/").pop()||"",x=await $fetch(`/api/commits/${encodeURIComponent(y)}`,{params:{workingDirectory:t.worktreePath}});i.value=x.aheadCount}catch{i.value=null}})(),O=(async()=>{u.value=!0;try{await h.initialize();const y=await $fetch("/api/git/branches",{query:{workingDirectory:h.workingDirectory}});c.value=y.branches.filter(x=>!x.isRemote&&!x.name.startsWith("sc/")).map(x=>x.name),c.value.length>0&&!c.value.includes(l.value)&&(l.value=c.value.includes("main")?"main":c.value.includes("master")?"master":c.value[0])}catch{c.value=[]}finally{u.value=!1}})();await Promise.all([g,O])});function m(){s.value.trim()&&(o.value=!0,r("confirm",s.value.trim(),l.value))}return(g,O)=>(v(),b("div",UD,[d("div",GD,[O[4]||(O[4]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Finalize ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:O[0]||(O[0]=y=>r("cancel"))},[se(p(Yt),{class:"w-4 h-4"})])]),d("div",HD,[d("div",KD,[O[5]||(O[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",JD,[tt(d("select",{"onUpdate:modelValue":O[1]||(O[1]=y=>l.value=y),disabled:o.value||u.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[u.value?(v(),b("option",{key:0,value:n.baseBranch},M(n.baseBranch),9,t8)):V("",!0),(v(!0),b(we,null,Fe(c.value,y=>(v(),b("option",{key:y,value:y},M(y),9,n8))),128))],8,e8),[[Hs,l.value]]),se(p(bh),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",r8,[O[6]||(O[6]=d("span",{class:"text-retro-muted"},"commits:",-1)),d("span",s8,M(i.value!==null?i.value:"..."),1)])]),d("div",i8,[tt(d("textarea",{"onUpdate:modelValue":O[2]||(O[2]=y=>s.value=y),placeholder:"Squash commit message...",rows:"2",class:"w-full px-2 py-1.5 pr-8 text-xs font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan resize-none",disabled:o.value||a.value},null,8,o8),[[cn,s.value]]),d("button",{type:"button",disabled:o.value||a.value,class:"absolute right-1.5 top-1.5 p-0.5 rounded text-retro-muted hover:text-retro-cyan transition-colors disabled:opacity-40",title:"Generate commit message",onClick:f},[se(p(Il),{class:Pe(["w-4 h-4",{"animate-spin":a.value}])},null,8,["class"])],8,a8)]),d("div",l8,[d("button",{type:"button",disabled:!s.value.trim()||o.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:m},[se(p(Oh),{class:"w-3.5 h-3.5"}),Ne(" "+M(o.value?"Finalizing...":"Confirm"),1)],8,c8),d("button",{type:"button",disabled:o.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:O[3]||(O[3]=y=>r("cancel"))}," Cancel ",8,u8)])]))}}),d8={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},f8={class:"flex items-center justify-between"},p8={class:"space-y-1 text-xs font-mono"},m8={class:"flex items-center gap-2"},g8={class:"text-retro-cyan"},O8={class:"flex items-center gap-2"},v8={class:"relative"},b8=["disabled"],x8=["value"],y8=["value"],k8={class:"flex items-center gap-2"},w8={class:"text-retro-text"},S8={class:"flex items-center gap-2"},$8=["disabled"],C8=["disabled"],Q8=We({__name:"RebaseConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(n,{emit:e}){const t=n,r=e,s=R(null),i=R(!1),o=R(t.baseBranch),a=R([]),l=R(!1),c=gh();async function u(f){try{const m=await $fetch("/api/chat/compare",{params:{worktreePath:t.worktreePath,baseBranch:f}});s.value=m.ahead}catch{s.value=null}}Tt(async()=>{const f=u(o.value),m=(async()=>{l.value=!0;try{await c.initialize();const g=await $fetch("/api/git/branches",{query:{workingDirectory:c.workingDirectory}});a.value=g.branches.filter(O=>!O.isRemote&&!O.name.startsWith("sc/")).map(O=>O.name),a.value.length>0&&!a.value.includes(o.value)&&(o.value=a.value.includes("main")?"main":a.value.includes("master")?"master":a.value[0])}catch{a.value=[]}finally{l.value=!1}})();await Promise.all([f,m])}),Ye(o,f=>{u(f)});function h(){i.value=!0,r("confirm",o.value)}return(f,m)=>(v(),b("div",d8,[d("div",f8,[m[3]||(m[3]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Rebase Worktree ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:m[0]||(m[0]=g=>r("cancel"))},[se(p(Yt),{class:"w-4 h-4"})])]),d("div",p8,[d("div",m8,[m[4]||(m[4]=d("span",{class:"text-retro-muted"},"worktree:",-1)),d("span",g8,M(n.worktreeBranch),1)]),d("div",O8,[m[5]||(m[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",v8,[tt(d("select",{"onUpdate:modelValue":m[1]||(m[1]=g=>o.value=g),disabled:i.value||l.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[l.value?(v(),b("option",{key:0,value:n.baseBranch},M(n.baseBranch),9,x8)):V("",!0),(v(!0),b(we,null,Fe(a.value,g=>(v(),b("option",{key:g,value:g},M(g),9,y8))),128))],8,b8),[[Hs,o.value]]),se(p(bh),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",k8,[m[6]||(m[6]=d("span",{class:"text-retro-muted"},"commits ahead:",-1)),d("span",w8,M(s.value!==null?s.value:"..."),1)])]),d("div",S8,[d("button",{type:"button",disabled:i.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:h},[se(p(Oh),{class:"w-3.5 h-3.5"}),Ne(" "+M(i.value?"Rebasing...":"Confirm"),1)],8,$8),d("button",{type:"button",disabled:i.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:m[2]||(m[2]=g=>r("cancel"))}," Cancel ",8,C8)])]))}}),P8={class:"flex-1 flex flex-col overflow-hidden"},T8={class:"flex-shrink-0 px-4 py-2 border-b border-retro-border flex items-center justify-between bg-retro-dark"},M8={class:"text-xs font-mono text-retro-text truncate"},A8={class:"flex items-center gap-2 flex-shrink-0"},_8=["title"],R8=["disabled"],E8=["disabled"],B8={key:5,class:"text-xs font-mono text-retro-green"},L8={key:6,class:"text-[11px] font-mono text-retro-muted"},D8={key:0,class:"flex items-center justify-center h-full text-retro-muted text-xs font-mono"},Z8=["innerHTML"],I8=["value","readonly"],X8={key:2,class:"flex-shrink-0 px-4 py-2 border-t border-retro-border bg-retro-yellow/10 text-retro-yellow text-xs font-mono"},z8=We({__name:"ConflictFileEditor",props:{file:{},resolved:{type:Boolean},aiResolving:{type:Boolean}},emits:["resolve","aiResolve"],setup(n,{emit:e}){const t=n,r=e,s=R(t.file.content),i=R(!1),o=R(""),a=R(!1);Ye(()=>t.file.path,()=>{s.value=t.file.content,i.value=!1,m()}),Ye(()=>t.file.content,()=>{i.value||(s.value=t.file.content,m())});const l=/^<{7}\s.*\n([\s\S]*?)^={7}\n([\s\S]*?)^>{7}\s.*\n/gm,c=/^<{7}[^\n]*\n([\s\S]*?)^={7}[^\n]*\n([\s\S]*?)^>{7}[^\n]*\n?/gm,u=Y(()=>/^<{7}\s/m.test(s.value)),h=Y(()=>x(s.value).length);function f(oe){const Z=oe.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",sh:"bash",zsh:"bash",sql:"sql",graphql:"graphql",xml:"xml",svg:"xml",toml:"toml",ini:"ini",dockerfile:"dockerfile"}[Z]||"text"}async function m(){a.value=!0;try{const{codeToHtml:oe}=await Ns(async()=>{const{codeToHtml:ve}=await import("./Bk4uZfKR.js");return{codeToHtml:ve}},__vite__mapDeps([3,1,2]),import.meta.url),Z=f(t.file.path),B=s.value.split(`
136
+ `);let q="",U=!1,j=!1,N=0,W=-1;for(const ve of B){N++;const te=/^<{7}\s/.test(ve),he=/^={7}$/.test(ve),C=/^>{7}\s/.test(ve);if(te){W++,U=!0,j=!1,q+=`<div class="conflict-line conflict-marker-line" data-line="${N}"><span class="line-number">${N}</span><span class="line-content conflict-marker">${g(ve)}</span></div>
137
+ `,t.resolved||(q+=T(W));continue}if(he&&U){U=!1,j=!0,q+=`<div class="conflict-line conflict-marker-line" data-line="${N}"><span class="line-number">${N}</span><span class="line-content conflict-marker">${g(ve)}</span></div>
138
+ `;continue}if(C){j=!1,q+=`<div class="conflict-line conflict-marker-line" data-line="${N}"><span class="line-number">${N}</span><span class="line-content conflict-marker">${g(ve)}</span></div>
139
+ `;continue}let w=g(ve);try{const z=(await oe(ve||" ",{lang:Z,theme:"vitesse-dark"})).match(/<code[^>]*><span class="line">(.*?)<\/span><\/code>/s);z&&(w=z[1])}catch{}let _="";U?_="conflict-ours":j&&(_="conflict-theirs"),q+=`<div class="conflict-line ${_}" data-line="${N}"><span class="line-number">${N}</span><span class="line-content">${w}</span></div>
140
+ `}o.value=q}catch{const oe=s.value.split(`
141
+ `);o.value=oe.map((Z,X)=>{const B=X+1;return`<div class="conflict-line" data-line="${B}"><span class="line-number">${B}</span><span class="line-content">${g(Z)}</span></div>`}).join(`
142
+ `)}finally{a.value=!1}}function g(oe){return oe.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function O(){Q("ours")}function y(){Q("theirs")}function x(oe){const Z=[],X=new RegExp(c.source,c.flags);let B=null,q=0;for(;(B=X.exec(oe))!==null;)Z.push({index:q,start:B.index,end:X.lastIndex,ours:B[1]??"",theirs:B[2]??""}),q++;return Z}function S(oe,Z){return oe?Z?oe.endsWith(`
143
+ `)||Z.startsWith(`
144
+ `)?`${oe}${Z}`:`${oe}
145
+ ${Z}`:oe:Z}function Q(oe,Z){const X=s.value,B=x(X);if(B.length){if(typeof Z=="number"){const q=B.find(j=>j.index===Z);if(!q)return;const U=oe==="ours"?q.ours:oe==="theirs"?q.theirs:S(q.ours,q.theirs);s.value=X.slice(0,q.start)+U+X.slice(q.end)}else s.value=X.replace(l,(q,U,j)=>oe==="ours"?U:oe==="theirs"?j:S(U,j));m()}}function T(oe){return`<div class="conflict-inline-actions" data-conflict-controls="${oe}">
146
+ <button type="button" class="conflict-inline-button conflict-inline-button-ours" data-conflict-index="${oe}" data-conflict-action="ours">Accept Ours</button>
147
+ <button type="button" class="conflict-inline-button conflict-inline-button-theirs" data-conflict-index="${oe}" data-conflict-action="theirs">Accept Theirs</button>
148
+ <button type="button" class="conflict-inline-button conflict-inline-button-both" data-conflict-index="${oe}" data-conflict-action="both">Accept Both</button>
149
+ </div>
150
+ `}function D(oe){const Z=oe.target?.closest("button[data-conflict-action]");if(!Z||t.resolved)return;const X=Z.dataset.conflictAction,B=Z.dataset.conflictIndex;if(!X||B===void 0)return;const q=Number.parseInt(B,10);Number.isNaN(q)||Q(X,q)}function K(){u.value||r("resolve",t.file.path,s.value)}function I(){r("aiResolve",t.file.path)}function ue(){i.value=!i.value,i.value||m()}function le(oe){const Z=oe.target;s.value=Z.value}return Tt(()=>{m()}),(oe,Z)=>(v(),b("div",P8,[d("div",T8,[d("span",M8,M(n.file.path),1),d("div",A8,[n.resolved?V("",!0):(v(),b("button",{key:0,type:"button",class:Pe(["px-2 py-0.5 text-xs font-mono rounded border transition-colors",i.value?"border-retro-yellow/50 text-retro-yellow hover:bg-retro-yellow/10":"border-retro-subtle/50 text-retro-muted hover:bg-retro-subtle/10"]),title:i.value?"Switch to highlighted view":"Switch to edit mode",onClick:ue},[i.value?(v(),Oe(p(hg),{key:0,class:"w-3.5 h-3.5 inline-block"})):(v(),Oe(p(yh),{key:1,class:"w-3.5 h-3.5 inline-block"}))],10,_8)),!n.resolved&&u.value?(v(),b("button",{key:1,type:"button",disabled:n.aiResolving,class:"flex items-center gap-1 px-2 py-0.5 text-xs font-mono rounded border border-retro-orange/50 text-retro-orange hover:bg-retro-orange/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:I},[se(p(Il),{class:"w-3.5 h-3.5"}),Ne(" "+M(n.aiResolving?"Resolving...":"AI Resolve"),1)],8,R8)):V("",!0),!n.resolved&&u.value?(v(),b("button",{key:2,type:"button",class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/10 transition-colors",onClick:O}," Accept All Ours ")):V("",!0),!n.resolved&&u.value?(v(),b("button",{key:3,type:"button",class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-magenta/50 text-retro-magenta hover:bg-retro-magenta/10 transition-colors",onClick:y}," Accept All Theirs ")):V("",!0),n.resolved?V("",!0):(v(),b("button",{key:4,type:"button",disabled:u.value,class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-green/50 text-retro-green hover:bg-retro-green/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:K}," Mark Resolved ",8,E8)),n.resolved?(v(),b("span",B8," Resolved ")):h.value>0?(v(),b("span",L8,M(h.value)+" conflict "+M(h.value===1?"block":"blocks"),1)):V("",!0)])]),i.value?V("",!0):(v(),b("div",{key:0,class:Pe(["flex-1 overflow-auto bg-retro-black conflict-viewer",{"opacity-60":n.resolved}]),onClick:D},[a.value?(v(),b("div",D8," Highlighting... ")):(v(),b("div",{key:1,class:"conflict-code",innerHTML:o.value},null,8,Z8))],2)),i.value?(v(),b("textarea",{key:1,value:s.value,readonly:n.resolved,class:Pe(["flex-1 w-full p-4 font-mono text-xs bg-retro-black text-retro-text resize-none focus:outline-none leading-relaxed",{"opacity-60":n.resolved}]),spellcheck:"false",onInput:le},null,42,I8)):V("",!0),u.value&&!n.resolved?(v(),b("div",X8," File still contains conflict markers. Remove all <<<<<<<, =======, >>>>>>> markers to resolve. ")):V("",!0)]))}}),N8={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60"},V8={class:"w-full max-w-5xl mx-4 my-8 h-[80vh] bg-retro-dark border border-retro-border rounded-lg shadow-xl flex flex-col overflow-hidden"},W8={class:"flex-shrink-0 px-4 py-3 border-b border-retro-border flex items-center justify-between"},j8={class:"flex items-center gap-3"},q8={class:"text-xs font-mono text-retro-muted"},Y8={class:"flex items-center gap-2"},F8=["disabled"],U8=["disabled"],G8=["disabled"],H8={key:0,class:"flex-1 flex items-center justify-center text-retro-muted text-sm font-mono"},K8={key:1,class:"flex-1 flex items-center justify-center text-retro-red text-sm font-mono"},J8={key:2,class:"flex-1 flex overflow-hidden"},eZ={class:"w-64 flex-shrink-0 border-r border-retro-border overflow-y-auto bg-retro-dark"},tZ={class:"py-1"},nZ=["onClick"],rZ={key:1,class:"flex-1 flex items-center justify-center text-retro-muted text-sm font-mono"},sZ=We({__name:"ConflictResolutionModal",emits:["close"],setup(n,{emit:e}){const t=e,r=Jn(),s=R(null),i=R(!1),o=R(!1),a=R(null),l=R(!1),c=Y(()=>r.conflictState?.files??[]),u=Y(()=>r.conflictState?.resolvedFiles??new Set),h=Y(()=>c.value.length),f=Y(()=>u.value.size),m=Y(()=>h.value>0&&f.value>=h.value),g=Y(()=>h.value-f.value),O=Y(()=>s.value?c.value.find(I=>I.path===s.value)??null:null);function y(I){return u.value.has(I)}function x(I){s.value=I}async function S(I,ue){await r.resolveConflictFile(I,ue)}async function Q(I){a.value=I,await r.aiResolveConflictFile(I),a.value=null}async function T(){l.value=!0,await r.aiResolveAllConflicts(),l.value=!1}async function D(){i.value=!0;const I=await r.continueRebase();i.value=!1,I.success&&t("close")}async function K(){o.value=!0,await r.abortRebase(),o.value=!1,t("close")}return(I,ue)=>(v(),Oe(cr,{to:"body"},[se(Ur,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:bt(()=>[p(r).conflictState?(v(),b("div",N8,[d("div",V8,[d("div",W8,[d("div",j8,[se(p(ms),{class:"w-5 h-5 text-retro-yellow"}),ue[0]||(ue[0]=d("h3",{class:"text-sm font-mono text-retro-text font-semibold"},"Resolve Rebase Conflicts",-1)),d("span",q8,M(f.value)+"/"+M(h.value)+" resolved ",1)]),d("div",Y8,[g.value>0?(v(),b("button",{key:0,type:"button",disabled:l.value||i.value||o.value,class:"flex items-center gap-1 px-3 py-1.5 text-xs font-mono rounded border transition-colors bg-retro-orange/10 border-retro-orange/50 text-retro-orange hover:bg-retro-orange/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:T},[se(p(Il),{class:"w-3.5 h-3.5"}),Ne(" "+M(l.value?"AI Resolving...":`AI Resolve All (${g.value})`),1)],8,F8)):V("",!0),d("button",{type:"button",disabled:!m.value||i.value||o.value,class:"flex items-center gap-1 px-3 py-1.5 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:D},M(i.value?"Continuing...":"Continue Rebase"),9,U8),d("button",{type:"button",disabled:i.value||o.value,class:"px-3 py-1.5 text-xs font-mono rounded border border-retro-red/50 text-retro-red hover:bg-retro-red/10 transition-colors disabled:opacity-40",onClick:K},M(o.value?"Aborting...":"Abort"),9,G8)])]),p(r).conflictState?.loading?(v(),b("div",H8," Loading conflict files... ")):p(r).conflictState?.error?(v(),b("div",K8,M(p(r).conflictState.error),1)):(v(),b("div",J8,[d("div",eZ,[d("div",tZ,[(v(!0),b(we,null,Fe(c.value,le=>(v(),b("button",{key:le.path,type:"button",class:Pe(["w-full text-left px-3 py-2 text-xs font-mono flex items-center gap-2 transition-colors hover:bg-retro-panel",{"bg-retro-panel":s.value===le.path}]),onClick:oe=>x(le.path)},[y(le.path)?(v(),Oe(p(Zl),{key:0,class:"w-3.5 h-3.5 text-retro-green flex-shrink-0"})):(v(),Oe(p(Mi),{key:1,class:"w-3.5 h-3.5 text-retro-yellow flex-shrink-0"})),d("span",{class:Pe(["truncate",y(le.path)?"text-retro-green":"text-retro-yellow"])},M(le.path),3)],10,nZ))),128))])]),O.value?(v(),Oe(z8,{key:0,file:O.value,resolved:y(O.value.path),"ai-resolving":a.value===O.value.path||l.value,onResolve:S,onAiResolve:Q},null,8,["file","resolved","ai-resolving"])):(v(),b("div",rZ," Select a file to resolve "))]))])])):V("",!0)]),_:1})]))}}),iZ={key:0,class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},oZ={class:"flex items-center justify-between p-4 border-b border-retro-border"},aZ={class:"flex items-center gap-2"},lZ={class:"p-4"},cZ={class:"mt-2 text-sm text-retro-text font-mono truncate"},uZ={class:"flex justify-end gap-3 p-4 border-t border-retro-border"},hZ=We({__name:"DeleteConfirmModal",props:{show:{type:Boolean},title:{}},emits:["confirm","cancel"],setup(n,{emit:e}){const t=e;function r(s){s.target===s.currentTarget&&t("cancel")}return(s,i)=>(v(),Oe(cr,{to:"body"},[se(Ur,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:bt(()=>[n.show?(v(),b("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:r},[se(Ur,{"enter-active-class":"transition-all duration-200","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition-all duration-200","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:bt(()=>[n.show?(v(),b("div",iZ,[d("div",oZ,[d("div",aZ,[se(p(ms),{class:"w-5 h-5 text-retro-red"}),i[3]||(i[3]=d("h3",{class:"text-lg font-mono text-retro-text"},"Delete Conversation",-1))]),d("button",{onClick:i[0]||(i[0]=o=>t("cancel")),class:"p-1 hover:bg-retro-panel rounded transition-colors"},[se(p(Yt),{class:"w-5 h-5 text-retro-muted"})])]),d("div",lZ,[i[4]||(i[4]=d("p",{class:"text-sm text-retro-muted font-mono"}," Are you sure you want to delete this conversation? ",-1)),d("p",cZ,' "'+M(n.title)+'" ',1),i[5]||(i[5]=d("p",{class:"mt-3 text-xs text-retro-muted"}," This action cannot be undone. ",-1))]),d("div",uZ,[d("button",{onClick:i[1]||(i[1]=o=>t("cancel")),class:"px-4 py-2 text-sm font-mono text-retro-muted border border-retro-border rounded hover:bg-retro-panel transition-colors"}," Cancel "),d("button",{onClick:i[2]||(i[2]=o=>t("confirm")),class:"px-4 py-2 text-sm font-mono text-white bg-retro-red/80 border border-retro-red rounded hover:bg-retro-red transition-colors"}," Delete ")])])):V("",!0)]),_:1})])):V("",!0)]),_:1})]))}}),dZ={class:"h-full flex flex-col bg-retro-black"},fZ={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},pZ={class:"flex items-center gap-2 min-w-0"},mZ={class:"text-xs font-mono text-retro-text truncate"},gZ={class:"flex items-center gap-1"},OZ=["disabled","title"],vZ=["title"],bZ=["title"],xZ=["disabled"],yZ={key:4,class:"flex-shrink-0 px-4 py-2 border-b border-retro-border bg-retro-green/10 text-retro-green text-xs font-mono text-center"},kZ={class:"flex-1 min-h-0 flex flex-col"},wZ=We({__name:"ChatPanel",setup(n){const e=Jn(),t=Zv(),{disconnectConversation:r}=oc();Tt(async()=>{try{const N=await $fetch("/api/cwd");e.setCwd(N.cwd)}catch{}});const s=Y(()=>e.activeConversation?.title||"New Chat"),i=R(!1),o=Y(()=>t.isChatFullscreen),a=R(!1);Ye(a,N=>{e.setDebugStreamEnabled(N)}),zt(()=>{e.setDebugStreamEnabled(!1)});function l(){t.toggleChatFullscreen()}async function c(){i.value=!1;const N=e.activeConversationId;N&&(r(N),await e.deleteConversation(N)),e.clearMessages()}function u(){e.hasMessages&&(i.value=!0)}function h(){i.value=!1}const f=R(!1),m=R(null),g=Y(()=>e.activeConversation?.finalized===!0),O=Y(()=>g.value),y=R(null),x=R(!1);async function S(){const N=e.activeConversation;if(!N?.worktreePath||!N?.baseBranch){y.value=null;return}x.value=!0;try{const W=await $fetch("/api/chat/compare",{params:{worktreePath:N.worktreePath,baseBranch:N.baseBranch}});y.value=W}catch{y.value=null}finally{x.value=!1}}Ye(()=>[e.activeConversationId,e.activeConversation?.worktreePath,e.activeConversation?.baseBranch,e.activeConversation?.lastCommitTime],()=>{S()},{immediate:!0});const Q=Y(()=>y.value?y.value.ahead===0&&y.value.behind===0:!1),T=Y(()=>{const N=e.activeConversation;return N?.hasWorktree&&!N?.finalized}),D=Y(()=>{const N=e.activeConversation;return!!N?.hasWorktree&&!N?.finalized&&!e.isActiveConversationStreaming&&!Q.value});function K(){f.value=!0,m.value=null}async function I(N,W){const ve=e.activeConversationId;if(!ve)return;const te=await e.finalizeConversation(ve,N,W);if(f.value=!1,te.success)m.value={type:"success",message:`Merged to ${W}`},setTimeout(()=>{m.value=null},5e3);else if(te.rebaseInProgress)m.value=null;else{const he=te.conflictFiles?.length?`Conflict in: ${te.conflictFiles.join(", ")}`:te.error||"Finalize failed";m.value={type:"error",message:he}}}function ue(){f.value=!1}function le(){if(!e.conflictState&&e.activeConversation?.hasWorktree){const N=e.activeConversation?.baseBranch||"main";m.value={type:"success",message:`Rebased onto ${N}`},setTimeout(()=>{m.value=null},5e3)}else m.value=null}const oe=R(!1),Z=Y(()=>!!e.activeConversation?.previewBranch);async function X(){const N=e.activeConversationId;if(!N)return;oe.value=!0,m.value=null;const W=Z.value,ve=await e.togglePreview(N);if(ve.success){const te=W?`Switched back to ${e.activeConversation?.baseBranch}`:"Preview active — main worktree updated";m.value={type:"success",message:te},setTimeout(()=>{m.value=null},3e3)}else m.value={type:"error",message:ve.error||"Preview toggle failed"};oe.value=!1}const B=R(!1);function q(){B.value=!0,m.value=null}async function U(N){const W=e.activeConversationId;if(!W)return;const ve=await e.rebaseConversation(W,N);B.value=!1,ve.success?(m.value={type:"success",message:`Rebased onto ${N}`},setTimeout(()=>{m.value=null},5e3)):ve.rebaseInProgress?m.value=null:m.value={type:"error",message:ve.error||"Rebase failed"}}function j(){B.value=!1}return(N,W)=>(v(),b("div",dZ,[d("div",fZ,[d("div",pZ,[d("span",mZ,M(p(s)),1)]),d("div",gZ,[p(T)?(v(),b("button",{key:0,disabled:p(oe),class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:p(Z)?"End preview: switch back to base branch":"Preview: test worktree changes in main worktree",onClick:X},[p(Z)?(v(),Oe(p(Qb),{key:0,class:"w-4 h-4 text-retro-cyan"})):(v(),Oe(p(hg),{key:1,class:"w-4 h-4"}))],8,OZ)):V("",!0),p(D)?(v(),b("button",{key:1,class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Rebase: sync worktree onto target base branch",onClick:q},[...W[2]||(W[2]=[Hm('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle cx="7" cy="4.5" r="1.5" fill="currentColor"></circle><circle cx="18" cy="20" r="1.5" fill="currentColor"></circle><circle cx="12" cy="7" r="1.4" fill="currentColor" opacity="0.9"></circle><path d="M7 6V16M7 16L4.5 13.5M7 16L9.5 13.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.4 7H12.5C15.5376 7 18 9.46243 18 12.5V18.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.5 16L18 18.5L20.5 16" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>',1)])])):V("",!0),p(D)?(v(),b("button",{key:2,class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Finalize: squash & merge to base branch",onClick:K},[se(p(Zl),{class:"w-4 h-4"})])):V("",!0),d("button",{class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:p(o)?"Exit fullscreen chat":"Fullscreen chat",onClick:l},[p(o)?(v(),Oe(p(rg),{key:0,class:"w-4 h-4"})):(v(),Oe(p(sg),{key:1,class:"w-4 h-4"}))],8,vZ),d("button",{class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:p(a)?"Hide debug stream":"Show debug stream",onClick:W[0]||(W[0]=ve=>a.value=!p(a))},[se(p(Ob),{class:Pe(["w-4 h-4",p(a)?"text-retro-cyan":""])},null,8,["class"])],8,bZ),d("button",{disabled:!p(e).hasMessages,class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"New conversation",onClick:u},[se(p(Gr),{class:"w-4 h-4"})],8,xZ)])]),se(hZ,{show:p(i),title:p(s),onConfirm:c,onCancel:h},null,8,["show","title"]),p(f)&&p(e).activeConversation?.hasWorktree?(v(),Oe(h8,{key:0,"base-branch":p(e).activeConversation.baseBranch||"main","worktree-branch":p(e).activeConversation.worktreeBranch||"","worktree-path":p(e).activeConversation.worktreePath||"",onConfirm:I,onCancel:ue},null,8,["base-branch","worktree-branch","worktree-path"])):V("",!0),p(B)&&p(e).activeConversation?.hasWorktree?(v(),Oe(Q8,{key:1,"base-branch":p(e).activeConversation.baseBranch||"main","worktree-branch":p(e).activeConversation.worktreeBranch||"","worktree-path":p(e).activeConversation.worktreePath||"",onConfirm:U,onCancel:j},null,8,["base-branch","worktree-branch","worktree-path"])):V("",!0),p(e).conflictState?(v(),Oe(sZ,{key:2,onClose:le})):V("",!0),p(m)?(v(),b("div",{key:3,class:Pe(["flex-shrink-0 px-4 py-2 border-b border-retro-border text-xs font-mono",p(m).type==="success"?"bg-retro-green/10 text-retro-green":"bg-retro-red/10 text-retro-red"])},[Ne(M(p(m).message)+" ",1),p(m).type==="error"?(v(),b("button",{key:0,class:"ml-2 underline hover:no-underline",onClick:W[1]||(W[1]=ve=>m.value=null)}," dismiss ")):V("",!0)],2)):V("",!0),p(g)?(v(),b("div",yZ," This conversation has been finalized and is read-only. ")):V("",!0),d("div",kZ,[se(tD,{class:"flex-1 overflow-hidden"}),p(a)?(v(),Oe(FD,{key:0})):V("",!0)]),se(ZD,{disabled:p(O)},null,8,["disabled"])]))}}),SZ={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},$Z={class:"flex items-center gap-2 min-w-0"},CZ=["title"],QZ={class:"text-retro-text font-mono text-sm truncate"},PZ={class:"text-retro-muted"},TZ={class:"text-retro-text"},MZ={class:"text-retro-muted font-mono text-xs flex-shrink-0"},AZ={class:"flex-1 overflow-auto"},_Z={key:0,class:"flex items-center justify-center gap-2 text-retro-muted text-sm py-8"},RZ={key:1,class:"flex items-center justify-center text-retro-muted text-sm py-8"},EZ={key:2,class:"flex items-center justify-center text-retro-muted text-sm py-8"},BZ={key:3,class:"w-full text-xs font-mono border-collapse diff-table"},LZ={key:0,class:"diff-warning"},DZ={key:0,colspan:"3",class:"diff-hunk-header px-4 py-1"},ZZ={class:"diff-line-num select-none text-right px-2 w-12"},IZ={class:"diff-line-num select-none text-right px-2 w-12 border-r border-retro-border"},XZ={class:"diff-line-content px-3 whitespace-pre-wrap break-all"},zZ={key:0,class:"diff-sign"},NZ={key:1,class:"diff-sign"},VZ={key:2,class:"diff-sign"},WZ={key:4,class:"flex items-center justify-center text-retro-muted text-sm py-8"},jZ=We({__name:"GitFileDiffViewer",props:{file:{},commitHash:{},content:{},loading:{type:Boolean}},emits:["close"],setup(n,{emit:e}){const t=n,r=e,s=R(null),i=Y(()=>t.commitHash.substring(0,7)),o=Y(()=>vi[t.file.status]||{label:t.file.status,colorClass:"text-retro-muted"}),a=Y(()=>t.file.status==="R"&&t.file.oldPath);function l(c){c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),r("close"))}return Tt(()=>{s.value?.focus()}),(c,u)=>(v(),b("div",{ref_key:"containerRef",ref:s,tabindex:0,onKeydown:l,class:"flex flex-col h-full bg-retro-dark focus:outline-none","aria-label":"File diff viewer",role:"region"},[d("div",SZ,[d("div",$Z,[d("span",{class:Pe(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",o.value.colorClass]),title:o.value.label},M(n.file.status),11,CZ),d("span",QZ,[a.value&&n.file.oldPath?(v(),b(we,{key:0},[d("span",PZ,M(n.file.oldPath),1),u[1]||(u[1]=d("span",{class:"text-retro-yellow mx-1"},"→",-1)),d("span",TZ,M(n.file.path),1)],64)):(v(),b(we,{key:1},[Ne(M(n.file.path),1)],64))]),d("span",MZ," @ "+M(i.value),1)]),d("button",{onClick:u[0]||(u[0]=h=>r("close")),class:"p-1 hover:bg-retro-dark rounded transition-colors flex-shrink-0 focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close diff viewer",title:"Close (Esc)"},[se(p(Yt),{class:"w-5 h-5 text-retro-muted hover:text-retro-text"})])]),d("div",AZ,[n.loading?(v(),b("div",_Z,[...u[2]||(u[2]=[d("div",{class:"w-4 h-4 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),Ne(" Loading diff... ",-1)])])):n.content&&n.content.binary?(v(),b("div",RZ,[...u[3]||(u[3]=[d("span",{class:"bg-retro-panel px-4 py-2 rounded font-mono"}," Binary file — cannot display diff ",-1)])])):n.content&&n.content.lines.length===0?(v(),b("div",EZ,[...u[4]||(u[4]=[d("span",{class:"bg-retro-panel px-4 py-2 rounded font-mono"}," No changes in this file ",-1)])])):n.content?(v(),b("table",BZ,[d("tbody",null,[n.content.truncated?(v(),b("tr",LZ,[...u[5]||(u[5]=[d("td",{colspan:"3",class:"px-4 py-2 text-retro-yellow bg-retro-panel text-center"}," Diff truncated — file has more than 10,000 lines ",-1)])])):V("",!0),(v(!0),b(we,null,Fe(n.content.lines,(h,f)=>(v(),b("tr",{key:f,class:Pe({"diff-add":h.type==="add","diff-delete":h.type==="delete","diff-context":h.type==="context","diff-header":h.type==="header"})},[h.type==="header"?(v(),b("td",DZ,M(h.content),1)):(v(),b(we,{key:1},[d("td",ZZ,M(h.oldLineNumber??""),1),d("td",IZ,M(h.newLineNumber??""),1),d("td",XZ,[h.type==="add"?(v(),b("span",zZ,"+")):h.type==="delete"?(v(),b("span",NZ,"-")):(v(),b("span",VZ," ")),Ne(" "+M(h.content),1)])],64))],2))),128))])])):(v(),b("div",WZ," Failed to load diff content. "))])],544))}}),qZ=Do(jZ,[["__scopeId","data-v-74bf9bf3"]]),YZ={class:"fixed inset-0 z-50 flex items-center justify-center"},FZ={class:"relative w-[90vw] max-w-lg bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},UZ={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},GZ={class:"flex items-center gap-2"},HZ={class:"text-sm font-mono text-retro-text"},KZ={class:"p-6 overflow-y-auto max-h-[70vh] space-y-6"},JZ={key:0},e6={class:"space-y-6"},t6={class:"space-y-1.5"},n6=["value","checked","onChange"],r6={class:"flex-1"},s6={class:"text-sm font-mono text-retro-text"},i6={class:"text-xs text-retro-muted leading-tight"},o6={class:"text-xs font-mono text-retro-muted"},a6={class:"text-xs text-retro-muted mb-3"},l6=["disabled"],c6={class:"space-y-1.5"},u6=["value","checked","onChange"],h6={class:"flex-1"},d6={class:"text-sm font-mono text-retro-text"},f6={class:"text-xs text-retro-muted leading-tight"},p6={key:1,class:"space-y-4"},m6={class:"space-y-1.5"},g6=["checked"],O6=["checked"],v6={class:"flex items-center justify-between px-3 py-2 rounded border border-retro-border bg-retro-panel"},b6={class:"text-xs font-mono text-retro-cyan"},x6=We({__name:"SettingsModal",emits:["close"],setup(n,{emit:e}){const t=e,r=Dl(),s=Uv(),i=Zo(),o=R("main"),a=R(!1),l=Y(()=>s.public.appVersion||"unknown"),c=[{value:"dark",label:"Dark",description:"Retro terminal theme with dark backgrounds"},{value:"light",label:"Light",description:"Bright theme for well-lit environments"}],u=[{value:"plan",label:ri.plan,description:na.plan,icon:xh,color:"text-retro-cyan"},{value:"ask",label:ri.ask,description:na.ask,icon:kh,color:"text-retro-green"},{value:"auto",label:ri.auto,description:na.auto,icon:og,color:"text-retro-yellow"},{value:"bypass",label:ri.bypass,description:na.bypass,icon:wh,color:"text-retro-red"}],{data:h,pending:f,error:m}=su("ai-providers",()=>$fetch("/api/ai/providers"),{server:!1}),g=Y(()=>h.value?.providers??[]),O=Y(()=>{const B=m.value;return B?B instanceof Error?B.message:String(B):null}),{data:y,refresh:x}=su("spec-search-status",()=>$fetch("/api/specs/status"),{server:!1,default:()=>null}),S=Y(()=>{const B=y.value;return B?B.isIndexing?`Indexing (${B.currentJob||"running"})`:B.schedulerActive?`Indexed ${B.fileCount} files / ${B.chunkCount} chunks`:"Scheduler inactive":"Status unavailable"});Tt(()=>{r.hydrate()});const Q=B=>{r.setProviderSelection(B),i.success("Settings saved")},T=()=>{o.value="provider"},D=()=>{o.value="main"},K=B=>{r.setTheme(B),i.success("Settings saved")},I=B=>{r.setPermissionMode(B),i.success("Settings saved")},ue=B=>{r.setAutoGenerateCommitMessages(B),i.success("Settings saved")},le=()=>{t("close")},oe=async()=>{if(!a.value){a.value=!0;try{const B=await $fetch("/api/specs/reindex",{method:"POST",body:{}});!B.success&&B.status==="already-indexing"?i.info("Spec index is already running"):i.success("Spec reindex started"),await x()}catch(B){i.error(B instanceof Error?B.message:"Failed to start spec reindex")}finally{a.value=!1}}},Z=B=>{B.key==="Escape"&&t("close")};Tt(()=>{window.addEventListener("keydown",Z)}),zt(()=>{window.removeEventListener("keydown",Z)});let X=null;return Tt(()=>{X=Eh(()=>{x()},5e3)}),zt(()=>{X&&clearInterval(X)}),(B,q)=>(v(),Oe(cr,{to:"body"},[d("div",YZ,[d("div",{class:"absolute inset-0 bg-black/70",onClick:le}),d("div",FZ,[d("div",UZ,[d("div",GZ,[o.value==="provider"?(v(),b("button",{key:0,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Back",onClick:D},[se(p(mb),{class:"h-4 w-4"})])):V("",!0),d("h2",HZ,M(o.value==="provider"?"AI Provider Settings":"Settings"),1)]),d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close",onClick:q[0]||(q[0]=U=>t("close"))},[se(p(Yt),{class:"h-4 w-4"})])]),d("div",KZ,[o.value==="main"?(v(),b("section",JZ,[d("div",e6,[d("section",null,[q[3]||(q[3]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Theme",-1)),q[4]||(q[4]=d("p",{class:"text-xs text-retro-muted mb-3"}," Choose between dark and light appearance. ",-1)),d("div",t6,[(v(),b(we,null,Fe(c,U=>d("label",{key:U.value,class:Pe(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[p(r).theme===U.value?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[d("input",{type:"radio",name:"theme",value:U.value,checked:p(r).theme===U.value,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:j=>K(U.value)},null,40,n6),d("div",r6,[d("div",s6,M(U.label),1),d("div",i6,M(U.description),1)])],2)),64))])]),q[11]||(q[11]=d("div",{class:"border-t border-retro-border"},null,-1)),d("section",null,[q[6]||(q[6]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"AI Provider",-1)),q[7]||(q[7]=d("p",{class:"text-xs text-retro-muted mb-3"}," Configure provider and model settings for new conversations. ",-1)),d("button",{type:"button",class:"w-full flex items-center justify-between px-3 py-2 rounded border border-retro-border bg-retro-panel hover:border-retro-muted transition-colors",onClick:T},[q[5]||(q[5]=d("span",{class:"text-sm font-mono text-retro-text"},"Provider Settings",-1)),d("span",o6,M(p(r).providerSelection.providerId)+" / "+M(p(r).providerSelection.modelKey),1)])]),q[12]||(q[12]=d("div",{class:"border-t border-retro-border"},null,-1)),d("section",null,[q[8]||(q[8]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Spec Search Index",-1)),d("p",a6,M(S.value),1),d("button",{type:"button",class:"w-full flex items-center justify-center px-3 py-2 rounded border border-retro-border bg-retro-panel text-retro-text hover:border-retro-muted transition-colors disabled:opacity-60",disabled:a.value||p(y)?.isIndexing,onClick:oe},M(a.value?"Starting reindex...":"Reindex Specs"),9,l6)]),q[13]||(q[13]=d("div",{class:"border-t border-retro-border"},null,-1)),d("section",null,[q[9]||(q[9]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Default Permission Mode",-1)),q[10]||(q[10]=d("p",{class:"text-xs text-retro-muted mb-3"}," Set the default permission mode for all new chat conversations. ",-1)),d("div",c6,[(v(),b(we,null,Fe(u,U=>d("label",{key:U.value,class:Pe(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[p(r).permissionMode===U.value?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[d("input",{type:"radio",name:"permission-mode",value:U.value,checked:p(r).permissionMode===U.value,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:j=>I(U.value)},null,40,u6),(v(),Oe(mi(U.icon),{class:Pe(["w-4 h-4 flex-shrink-0",U.color])},null,8,["class"])),d("div",h6,[d("div",d6,M(U.label),1),d("div",f6,M(U.description),1)])],2)),64))])]),q[14]||(q[14]=d("div",{class:"border-t border-retro-border"},null,-1))])])):(v(),b("section",p6,[q[15]||(q[15]=d("div",null,[d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"AI Provider"),d("p",{class:"text-xs text-retro-muted mb-3"}," Choose which registered provider and model powers new conversations. ")],-1)),se(ub,{providers:g.value,selected:p(r).providerSelection,permissionMode:p(r).permissionMode,pending:p(f),errorMessage:O.value,onSelect:Q},null,8,["providers","selected","permissionMode","pending","errorMessage"])])),q[23]||(q[23]=d("div",{class:"border-t border-retro-border"},null,-1)),d("section",null,[q[18]||(q[18]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Commit Messages",-1)),q[19]||(q[19]=d("p",{class:"text-xs text-retro-muted mb-3"}," Choose whether to use AI to generate commit messages automatically. ",-1)),d("div",m6,[d("label",{class:Pe(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[p(r).autoGenerateCommitMessages?"border-retro-border bg-retro-panel hover:border-retro-muted":"border-retro-cyan bg-retro-cyan/10"]])},[d("input",{type:"radio",name:"commit-messages",value:!1,checked:!p(r).autoGenerateCommitMessages,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:q[1]||(q[1]=U=>ue(!1))},null,40,g6),q[16]||(q[16]=d("div",{class:"flex-1"},[d("div",{class:"text-sm font-mono text-retro-text"},"Template (Recommended)"),d("div",{class:"text-xs text-retro-muted leading-tight"},"Simple template-based messages. No token usage.")],-1))],2),d("label",{class:Pe(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[p(r).autoGenerateCommitMessages?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[d("input",{type:"radio",name:"commit-messages",value:!0,checked:p(r).autoGenerateCommitMessages,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:q[2]||(q[2]=U=>ue(!0))},null,40,O6),q[17]||(q[17]=d("div",{class:"flex-1"},[d("div",{class:"text-sm font-mono text-retro-text"},"AI-Generated"),d("div",{class:"text-xs text-retro-muted leading-tight"},"Uses Claude Haiku to create meaningful commit messages. ~300-500 tokens per commit.")],-1))],2)])]),q[24]||(q[24]=d("div",{class:"border-t border-retro-border"},null,-1)),d("section",null,[q[21]||(q[21]=d("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Spec-Cat",-1)),q[22]||(q[22]=d("p",{class:"text-xs text-retro-muted mb-3"}," Application version. ",-1)),d("div",v6,[q[20]||(q[20]=d("span",{class:"text-sm font-mono text-retro-text"},"Version",-1)),d("span",b6,M(l.value),1)])])])])])]))}}),y6={class:"fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm"},k6={class:"flex-1 text-sm font-mono text-retro-text"},w6=["onClick"],S6=We({__name:"ToastContainer",setup(n){const{toasts:e,remove:t}=Zo(),r={success:{bg:"bg-retro-green/20",icon:"text-retro-green",border:"border-retro-green/50"},error:{bg:"bg-retro-red/20",icon:"text-retro-red",border:"border-retro-red/50"},info:{bg:"bg-retro-cyan/20",icon:"text-retro-cyan",border:"border-retro-cyan/50"},warning:{bg:"bg-retro-yellow/20",icon:"text-retro-yellow",border:"border-retro-yellow/50"}},s=i=>{switch(i){case"success":return Zl;case"error":return Mi;case"warning":return ms;default:return Ab}};return(i,o)=>(v(),Oe(cr,{to:"body"},[d("div",y6,[se(Gv,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-x-4","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-4"},{default:bt(()=>[(v(!0),b(we,null,Fe(p(e),a=>(v(),b("div",{key:a.id,class:Pe(["flex items-start gap-3 p-3 rounded-lg border shadow-lg",[r[a.type].bg,r[a.type].border]])},[(v(),Oe(mi(s(a.type)),{class:Pe(["h-5 w-5 flex-shrink-0 mt-0.5",r[a.type].icon])},null,8,["class"])),d("p",k6,M(a.message),1),d("button",{type:"button",class:"p-0.5 rounded text-retro-muted hover:text-retro-text transition-colors",onClick:l=>p(t)(a.id)},[se(p(Yt),{class:"h-4 w-4"})],8,w6)],2))),128))]),_:1})])]))}});let on=null,ei=null,_s=null;const $6=5e3,C6=500;let Rn=null;const Ba=new Map;function Q6(){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws`}function P6(){const n=Jn();async function e(){console.log("[GlobalNotifications] Executing debounced refresh");const m=await n.refreshServerConversations();console.log("[GlobalNotifications] Refresh result:",m);for(const[g,O]of Ba)Ba.delete(g),r(g,O)}function t(){_s&&clearTimeout(_s),_s=setTimeout(()=>{_s=null,e()},C6)}function r(m,g){if(!on||on.readyState!==WebSocket.OPEN)return;const O=n.conversations.find(S=>S.id===m);if(!O){console.warn("[GlobalNotifications] Conversation not found for streaming:",m);return}O.messages.length===0&&g&&n.addUserMessage(g,m);const y=[...O.messages].reverse().find(S=>S.role==="assistant");if(y){n.resetMessageForReplay(y.id,m),n.startConversationStreaming(m),Rn={conversationId:m,messageId:y.id,currentTextBlockId:null,isReplaying:!1,replayBuffer:[]},on.send(JSON.stringify({type:"subscribe",conversationId:m,cursor:0})),console.log("[GlobalNotifications] Resumed server job streaming (existing msg):",m);return}const x=n.addAssistantMessage(m);n.initContentBlocks(x.id,m),n.startConversationStreaming(m),Rn={conversationId:m,messageId:x.id,currentTextBlockId:null,isReplaying:!1,replayBuffer:[]},on.send(JSON.stringify({type:"subscribe",conversationId:m,cursor:0})),console.log("[GlobalNotifications] Subscribed to server job streaming:",m)}function s(m){try{const g=JSON.parse(m.data);if(g.type==="notification"){i(g);return}Rn&&o(g)}catch{}}function i(m){if(console.log("[GlobalNotifications] Received:",m.notificationEvent,m.conversationId),m.notificationEvent==="job_created"&&m.source!=="user"){Ba.set(m.conversationId,m.message||""),t();return}if(m.notificationEvent==="job_persisted"){Rn?.conversationId===m.conversationId&&(n.endConversationStreaming(m.conversationId),Rn=null),Ba.delete(m.conversationId),t();return}m.notificationEvent}function o(m){const g=Rn,O=g.conversationId;if(m.type==="replay_start"){g.isReplaying=!0,g.replayBuffer=[];return}if(m.type==="replay_end"){a(g),g.isReplaying=!1,g.replayBuffer=[];return}if(g.isReplaying){(m.type==="ui_event"||m.type==="done"||m.type==="error")&&g.replayBuffer.push(m);return}if(m.type==="ui_event"&&m.event){l(g,m.event,O);return}if(m.type!=="done"&&m.type==="error"){n.updateMessage(g.messageId,{status:"error"},O),n.setSessionError(m.error||"Server job error",O),n.endConversationStreaming(O),Rn=null;return}}function a(m){const g=[];let O="",y=null;for(const x of m.replayBuffer){if(x.type!=="ui_event"||!x.event)continue;const S=x.event;switch(S.type){case"block_start":if(S.blockType==="text"){const Q=S.blockId||ir();g.push({id:Q,type:"text",text:S.text||""}),y=Q,S.text&&(O+=S.text)}break;case"block_delta":if(S.text&&y){const Q=g.find(T=>T.id===y);Q&&(Q.text+=S.text,O+=S.text)}break;case"block_end":y&&(y=null);break}}g.length>0&&n.batchSetMessageBlocks(m.messageId,g,O,"streaming",m.conversationId),m.currentTextBlockId=y,console.log(`[GlobalNotifications] Replay batch: ${m.replayBuffer.length} events → ${g.length} text blocks`)}function l(m,g,O){switch(g.type){case"block_start":{if(g.blockType==="text"){const y=g.blockId||ir(),x={id:y,type:"text",text:g.text||""};n.appendContentBlock(m.messageId,x,O),m.currentTextBlockId=y,g.text&&n.appendToMessage(m.messageId,g.text,O)}break}case"block_delta":{g.text&&m.currentTextBlockId&&(n.updateBlockById(m.messageId,m.currentTextBlockId,y=>{y.type==="text"&&(y.text+=g.text)},O),n.appendToMessage(m.messageId,g.text,O));break}case"block_end":{m.currentTextBlockId&&(m.currentTextBlockId=null);break}}}function c(){if(typeof window>"u"||on&&(on.readyState===WebSocket.OPEN||on.readyState===WebSocket.CONNECTING))return;const m=Q6();on=new WebSocket(m),on.onopen=()=>{console.log("[GlobalNotifications] WebSocket connected")},on.onmessage=s,on.onclose=g=>{console.log("[GlobalNotifications] WebSocket closed",{code:g.code,reason:g.reason}),on=null,Rn&&(n.endConversationStreaming(Rn.conversationId),Rn=null),u()},on.onerror=g=>{console.warn("[GlobalNotifications] WebSocket error",g)}}function u(){ei||(ei=setTimeout(()=>{ei=null,c()},$6))}function h(){ei&&(clearTimeout(ei),ei=null),_s&&(clearTimeout(_s),_s=null),Rn&&(n.endConversationStreaming(Rn.conversationId),Rn=null),on&&(on.close(),on=null)}async function f(){try{const g=(await $fetch("/api/jobs")).filter(O=>O.source!=="user"&&(O.status==="running"||O.status==="waiting_permission"||O.status==="queued"||O.status==="completed"&&O.eventCount>0));if(g.length===0)return;await n.refreshServerConversations();for(const O of g){if(n.isConversationStreaming(O.conversationId))continue;const y=n.conversations.find(S=>S.id===O.conversationId);if(!y)continue;const x=[...y.messages].reverse().find(S=>S.role==="assistant");x&&(x.status==="complete"||x.status==="error"||x.status==="stopped")||(console.log("[GlobalNotifications] Resuming active server job:",O.id,"for conversation:",O.conversationId),r(O.conversationId,""))}}catch(m){console.warn("[GlobalNotifications] Failed to check for active server jobs:",m)}}return Tt(()=>{c(),f()}),zt(()=>{h()}),{connect:c,disconnect:h}}const T6={class:"flex h-screen min-w-[320px] overflow-x-auto bg-retro-black text-retro-text"},M6={class:"flex flex-col overflow-hidden",style:{flex:"3"}},A6={class:"flex-shrink-0 h-14 flex items-center justify-between px-4 border-b border-retro-border bg-retro-panel"},_6={class:"flex items-center gap-2 min-w-0"},R6={key:0,class:"text-xs text-retro-muted font-mono truncate"},E6={class:"flex items-center gap-1"},B6=["title"],L6={class:"flex-1 min-h-0 overflow-y-auto"},D6={class:"relative flex min-w-0",style:{flex:"7"}},Z6={key:0,class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"2"}},I6={key:1,class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"2"}},X6={key:2,class:"absolute inset-0 z-30 flex flex-col overflow-hidden border-l border-retro-border bg-retro-black"},J6=We({__name:"default",setup(n){const e=Zv(),t=Dl(),r=Jn(),s=Vl(),{isDark:i,toggleTheme:o}=tb(),{tryResumeStreaming:a}=oc();P6();const l=Y(()=>s.diffViewerFile!==null),c=Y(()=>e.isChatFullscreen),u=Y(()=>c.value),h=Y(()=>c.value?7:3),f=R(!1),m=R(""),g=Y(()=>{if(!m.value)return"";const x=m.value.replace(/\/+$/,"").split("/");return x[x.length-1]||""}),O=Y(()=>g.value?`spec cat :: ${g.value}`:"spec cat");Hv(()=>({title:O.value}));const y=()=>{typeof window<"u"&&e.updateViewport(window.innerWidth)};return Tt(async()=>{typeof window<"u"&&(e.updateViewport(window.innerWidth),window.addEventListener("resize",y)),await t.hydrate(),await r.initialize(),await r.loadConversations(),r.activeConversationId&&a(r.activeConversationId);try{const x=await $fetch("/api/cwd");m.value=x.cwd}catch{m.value=""}}),zt(()=>{typeof window<"u"&&window.removeEventListener("resize",y)}),(x,S)=>{const Q=F$;return v(),b("div",T6,[d("div",M6,[d("div",A6,[d("div",_6,[S[4]||(S[4]=d("img",{alt:"SpecCat",src:U$,class:"w-5 h-5 text-retro-cyan mb-1"},null,-1)),S[5]||(S[5]=d("span",{class:"text-sm font-bold text-retro-cyan font-mono uppercase tracking-wider flex-shrink-0"},"SPECCAT",-1)),g.value?(v(),b("span",R6,"/ "+M(g.value),1)):V("",!0)]),d("div",E6,[d("button",{type:"button",class:"p-2 rounded transition-colors text-retro-muted hover:text-retro-text hover:bg-retro-panel",title:p(i)?"Switch to light theme":"Switch to dark theme",onClick:S[0]||(S[0]=(...T)=>p(o)&&p(o)(...T))},[p(i)?(v(),Oe(p(nb),{key:0,class:"w-5 h-5"})):(v(),Oe(p(rb),{key:1,class:"w-5 h-5"}))],8,B6),d("button",{type:"button",class:"p-2 rounded transition-colors text-retro-muted hover:text-retro-text hover:bg-retro-panel",title:"Settings",onClick:S[1]||(S[1]=T=>f.value=!0)},[se(p(cg),{class:"w-5 h-5"})])])]),d("div",L6,[se(Q,{"working-directory":m.value},null,8,["working-directory"])])]),d("div",D6,[u.value?V("",!0):(v(),b("div",Z6,[se(GB)])),u.value?V("",!0):(v(),b("div",I6,[se(w7)])),d("div",{class:"flex flex-col overflow-hidden border-l border-retro-border",style:mn({flex:h.value})},[se(wZ)],4),l.value?(v(),b("div",X6,[se(qZ,{file:p(s).diffViewerFile,"commit-hash":p(s).diffViewerCommitHash,content:p(s).diffViewerContent,loading:p(s).diffViewerLoading,onClose:S[2]||(S[2]=T=>p(s).closeFileDiff())},null,8,["file","commit-hash","content","loading"])])):V("",!0)]),f.value?(v(),Oe(x6,{key:0,onClose:S[3]||(S[3]=T=>f.value=!1)})):V("",!0),se(S6),Gm(x.$slots,"default")])}}});export{J6 as default};