@dylanpiercey/work 0.0.31 → 0.0.32

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 (155) hide show
  1. package/dist/index.mjs +285 -285
  2. package/dist/public/assets/{_qs4Ln4Rg2.js → _3wpK6Da62.js} +2 -2
  3. package/dist/public/assets/{_qs4Ln4Rg2.js.map → _3wpK6Da62.js.map} +1 -1
  4. package/dist/public/assets/{_S8j4yHoF.js → _5wEIhz7a.js} +2 -2
  5. package/dist/public/assets/{_S8j4yHoF.js.map → _5wEIhz7a.js.map} +1 -1
  6. package/dist/public/assets/{_y_rhG45O.js → _6akhJ5Fn.js} +2 -2
  7. package/dist/public/assets/{_y_rhG45O.js.map → _6akhJ5Fn.js.map} +1 -1
  8. package/dist/public/assets/{_ZpADOd1b2.js → _B-1aqB9k2.js} +2 -2
  9. package/dist/public/assets/{_ZpADOd1b2.js.map → _B-1aqB9k2.js.map} +1 -1
  10. package/dist/public/assets/{_DAjnTl6J.js → _B4wJxefZ.js} +2 -2
  11. package/dist/public/assets/{_DAjnTl6J.js.map → _B4wJxefZ.js.map} +1 -1
  12. package/dist/public/assets/{_CIo7EE2m.js → _BBxOP5gd.js} +2 -2
  13. package/dist/public/assets/{_CIo7EE2m.js.map → _BBxOP5gd.js.map} +1 -1
  14. package/dist/public/assets/{_DQtWh9mf.js → _BIa9rsaF.js} +2 -2
  15. package/dist/public/assets/{_DQtWh9mf.js.map → _BIa9rsaF.js.map} +1 -1
  16. package/dist/public/assets/{_D8lfT6ai2.js → _BJ9jTSsT2.js} +2 -2
  17. package/dist/public/assets/{_D8lfT6ai2.js.map → _BJ9jTSsT2.js.map} +1 -1
  18. package/dist/public/assets/{_MpKNpArX.js → _BKlDC-Tb.js} +2 -2
  19. package/dist/public/assets/{_MpKNpArX.js.map → _BKlDC-Tb.js.map} +1 -1
  20. package/dist/public/assets/{_DWKvGn_N.js → _BL2e2Eo7.js} +2 -2
  21. package/dist/public/assets/{_DWKvGn_N.js.map → _BL2e2Eo7.js.map} +1 -1
  22. package/dist/public/assets/{_CVhtozPf.js → _BMs4fTHh.js} +2 -2
  23. package/dist/public/assets/{_CVhtozPf.js.map → _BMs4fTHh.js.map} +1 -1
  24. package/dist/public/assets/{_DmjWQ4d2.js → _BTAS1Dpg.js} +2 -2
  25. package/dist/public/assets/{_DmjWQ4d2.js.map → _BTAS1Dpg.js.map} +1 -1
  26. package/dist/public/assets/{_swr2EwEY.js → _BTe9kCin.js} +2 -2
  27. package/dist/public/assets/{_swr2EwEY.js.map → _BTe9kCin.js.map} +1 -1
  28. package/dist/public/assets/{_-PDLoMF12.js → _BbQFjjyq2.js} +2 -2
  29. package/dist/public/assets/{_-PDLoMF12.js.map → _BbQFjjyq2.js.map} +1 -1
  30. package/dist/public/assets/{_DCXRfyXu.js → _BiVQf6zi.js} +2 -2
  31. package/dist/public/assets/{_DCXRfyXu.js.map → _BiVQf6zi.js.map} +1 -1
  32. package/dist/public/assets/{_68tkSWB0.js → _BkJ_AQhK.js} +2 -2
  33. package/dist/public/assets/{_68tkSWB0.js.map → _BkJ_AQhK.js.map} +1 -1
  34. package/dist/public/assets/{_panznFin.js → _Bx-q9uoN.js} +2 -2
  35. package/dist/public/assets/{_panznFin.js.map → _Bx-q9uoN.js.map} +1 -1
  36. package/dist/public/assets/{_D78KjvOU.js → _BxUEtXoQ.js} +2 -2
  37. package/dist/public/assets/{_D78KjvOU.js.map → _BxUEtXoQ.js.map} +1 -1
  38. package/dist/public/assets/{_Bjqxmegr.js → _BzD2dIYX.js} +2 -2
  39. package/dist/public/assets/{_Bjqxmegr.js.map → _BzD2dIYX.js.map} +1 -1
  40. package/dist/public/assets/{_D8pWUCwe.js → _C-nqelds.js} +2 -2
  41. package/dist/public/assets/{_D8pWUCwe.js.map → _C-nqelds.js.map} +1 -1
  42. package/dist/public/assets/{_BTAL_hF4.js → _C0Y8EhIC.js} +2 -2
  43. package/dist/public/assets/{_BTAL_hF4.js.map → _C0Y8EhIC.js.map} +1 -1
  44. package/dist/public/assets/{_CTr-8dOb.js → _C2yKcodx.js} +2 -2
  45. package/dist/public/assets/{_CTr-8dOb.js.map → _C2yKcodx.js.map} +1 -1
  46. package/dist/public/assets/{_DuT1d3b7.js → _C8uWyBcH.js} +2 -2
  47. package/dist/public/assets/{_DuT1d3b7.js.map → _C8uWyBcH.js.map} +1 -1
  48. package/dist/public/assets/{_D3e_oWUH.js → _CBDHZ0hg.js} +2 -2
  49. package/dist/public/assets/{_D3e_oWUH.js.map → _CBDHZ0hg.js.map} +1 -1
  50. package/dist/public/assets/{_BLd6EDeA.js → _CVUfJEVu.js} +2 -2
  51. package/dist/public/assets/{_BLd6EDeA.js.map → _CVUfJEVu.js.map} +1 -1
  52. package/dist/public/assets/{_BfXqwnv1.js → _CX2w84Lb.js} +2 -2
  53. package/dist/public/assets/{_BfXqwnv1.js.map → _CX2w84Lb.js.map} +1 -1
  54. package/dist/public/assets/{_BrcHeNpA2.js → _CX8l12E-2.js} +2 -2
  55. package/dist/public/assets/{_BrcHeNpA2.js.map → _CX8l12E-2.js.map} +1 -1
  56. package/dist/public/assets/{_NLqR1tDd.js → _CXJCHFX0.js} +2 -2
  57. package/dist/public/assets/{_NLqR1tDd.js.map → _CXJCHFX0.js.map} +1 -1
  58. package/dist/public/assets/{_CAq-lrFG.js → _C_bKIJI8.js} +2 -2
  59. package/dist/public/assets/{_CAq-lrFG.js.map → _C_bKIJI8.js.map} +1 -1
  60. package/dist/public/assets/{_eDBMsbht2.js → _CcrWJ_AF2.js} +2 -2
  61. package/dist/public/assets/{_eDBMsbht2.js.map → _CcrWJ_AF2.js.map} +1 -1
  62. package/dist/public/assets/{_BWhBQNy22.js → _CjCTUQV22.js} +2 -2
  63. package/dist/public/assets/{_BWhBQNy22.js.map → _CjCTUQV22.js.map} +1 -1
  64. package/dist/public/assets/{_DxCjYI2X.js → _CkkpgSfP.js} +2 -2
  65. package/dist/public/assets/{_DxCjYI2X.js.map → _CkkpgSfP.js.map} +1 -1
  66. package/dist/public/assets/{_C1kRr9Kc2.js → _CzJm-Kgs2.js} +2 -2
  67. package/dist/public/assets/{_C1kRr9Kc2.js.map → _CzJm-Kgs2.js.map} +1 -1
  68. package/dist/public/assets/{_BfTs8fRs2.js → _Cze2fV8u2.js} +2 -2
  69. package/dist/public/assets/{_BfTs8fRs2.js.map → _Cze2fV8u2.js.map} +1 -1
  70. package/dist/public/assets/{_b2WV0_P-.js → _D-a9DwIr.js} +2 -2
  71. package/dist/public/assets/{_b2WV0_P-.js.map → _D-a9DwIr.js.map} +1 -1
  72. package/dist/public/assets/{_B6Pa0t142.js → _D7PYIcBv2.js} +2 -2
  73. package/dist/public/assets/{_B6Pa0t142.js.map → _D7PYIcBv2.js.map} +1 -1
  74. package/dist/public/assets/{_B53Hw8eV.js → _DCrRdWzm.js} +2 -2
  75. package/dist/public/assets/{_B53Hw8eV.js.map → _DCrRdWzm.js.map} +1 -1
  76. package/dist/public/assets/{_CZrjQzIL.js → _DD4eXl6W.js} +2 -2
  77. package/dist/public/assets/{_CZrjQzIL.js.map → _DD4eXl6W.js.map} +1 -1
  78. package/dist/public/assets/{_q3Nmk9QB2.js → _DJmEj4P02.js} +2 -2
  79. package/dist/public/assets/{_q3Nmk9QB2.js.map → _DJmEj4P02.js.map} +1 -1
  80. package/dist/public/assets/{_DwPmjIla.js → _DNiAR62k.js} +2 -2
  81. package/dist/public/assets/{_DwPmjIla.js.map → _DNiAR62k.js.map} +1 -1
  82. package/dist/public/assets/{_DpQWjwUv2.js → _DNm3GBFg2.js} +2 -2
  83. package/dist/public/assets/{_DpQWjwUv2.js.map → _DNm3GBFg2.js.map} +1 -1
  84. package/dist/public/assets/{_BwkuLumM2.js → _DPsop69P2.js} +2 -2
  85. package/dist/public/assets/{_BwkuLumM2.js.map → _DPsop69P2.js.map} +1 -1
  86. package/dist/public/assets/{_C9CrsbjF.js → _DQ6NSm2p.js} +2 -2
  87. package/dist/public/assets/{_C9CrsbjF.js.map → _DQ6NSm2p.js.map} +1 -1
  88. package/dist/public/assets/{_Blov0sJd.js → _DZU3Q5Te.js} +2 -2
  89. package/dist/public/assets/{_Blov0sJd.js.map → _DZU3Q5Te.js.map} +1 -1
  90. package/dist/public/assets/{_DXL4wTUz.js → _DZiGlTtq.js} +2 -2
  91. package/dist/public/assets/{_DXL4wTUz.js.map → _DZiGlTtq.js.map} +1 -1
  92. package/dist/public/assets/{_3dvXM10f.js → _Da1JjXN5.js} +2 -2
  93. package/dist/public/assets/{_3dvXM10f.js.map → _Da1JjXN5.js.map} +1 -1
  94. package/dist/public/assets/{_CnrRSwgo.js → _DkvEBzS7.js} +2 -2
  95. package/dist/public/assets/{_CnrRSwgo.js.map → _DkvEBzS7.js.map} +1 -1
  96. package/dist/public/assets/{_BAq6EcWp2.js → _Dl2UteFV2.js} +2 -2
  97. package/dist/public/assets/{_BAq6EcWp2.js.map → _Dl2UteFV2.js.map} +1 -1
  98. package/dist/public/assets/{_Dvz6tufK2.js → _Dn6wx3eB2.js} +2 -2
  99. package/dist/public/assets/{_Dvz6tufK2.js.map → _Dn6wx3eB2.js.map} +1 -1
  100. package/dist/public/assets/{_6RgCMzRh2.js → _DnGHFVcU2.js} +2 -2
  101. package/dist/public/assets/{_6RgCMzRh2.js.map → _DnGHFVcU2.js.map} +1 -1
  102. package/dist/public/assets/{_C8UrJJCG2.js → _Docc3wCS2.js} +2 -2
  103. package/dist/public/assets/{_C8UrJJCG2.js.map → _Docc3wCS2.js.map} +1 -1
  104. package/dist/public/assets/{_BYFGGkPh2.js → _Dsl39Q0T2.js} +2 -2
  105. package/dist/public/assets/{_BYFGGkPh2.js.map → _Dsl39Q0T2.js.map} +1 -1
  106. package/dist/public/assets/{_Bl9m4QYG2.js → _DsxNYA3W2.js} +2 -2
  107. package/dist/public/assets/{_Bl9m4QYG2.js.map → _DsxNYA3W2.js.map} +1 -1
  108. package/dist/public/assets/{_CthC5WB8.js → _DtJBxo8X.js} +2 -2
  109. package/dist/public/assets/{_CthC5WB8.js.map → _DtJBxo8X.js.map} +1 -1
  110. package/dist/public/assets/{_CgrjRmW8.js → _DvvBPEVw.js} +2 -2
  111. package/dist/public/assets/{_CgrjRmW8.js.map → _DvvBPEVw.js.map} +1 -1
  112. package/dist/public/assets/{_O8f0F-Db2.js → _DyTukt_u2.js} +2 -2
  113. package/dist/public/assets/{_O8f0F-Db2.js.map → _DyTukt_u2.js.map} +1 -1
  114. package/dist/public/assets/{_CxypEce-2.js → _GlgJPuKL2.js} +2 -2
  115. package/dist/public/assets/{_CxypEce-2.js.map → _GlgJPuKL2.js.map} +1 -1
  116. package/dist/public/assets/{_DM4b41za.js → _J7lGcvlZ.js} +2 -2
  117. package/dist/public/assets/{_DM4b41za.js.map → _J7lGcvlZ.js.map} +1 -1
  118. package/dist/public/assets/{_CpNZLYpm.js → _Obxt4Dxo.js} +2 -2
  119. package/dist/public/assets/{_CpNZLYpm.js.map → _Obxt4Dxo.js.map} +1 -1
  120. package/dist/public/assets/{_Dl1jb9Oh.js → _WXOM1NgB.js} +2 -2
  121. package/dist/public/assets/{_Dl1jb9Oh.js.map → _WXOM1NgB.js.map} +1 -1
  122. package/dist/public/assets/{_BaHrjjdk.js → _XQgJphFX.js} +2 -2
  123. package/dist/public/assets/{_BaHrjjdk.js.map → _XQgJphFX.js.map} +1 -1
  124. package/dist/public/assets/{_laNEHHov.js → _YirxLGS4.js} +2 -2
  125. package/dist/public/assets/{_laNEHHov.js.map → _YirxLGS4.js.map} +1 -1
  126. package/dist/public/assets/{_DFSNy_p5.js → _aTZInOPC.js} +2 -2
  127. package/dist/public/assets/{_DFSNy_p5.js.map → _aTZInOPC.js.map} +1 -1
  128. package/dist/public/assets/{_KvAucFiW2.js → _d9P0yprv2.js} +2 -2
  129. package/dist/public/assets/{_KvAucFiW2.js.map → _d9P0yprv2.js.map} +1 -1
  130. package/dist/public/assets/{_Bk9DvADq.js → _h5G2RGPq.js} +2 -2
  131. package/dist/public/assets/{_Bk9DvADq.js.map → _h5G2RGPq.js.map} +1 -1
  132. package/dist/public/assets/{_BpKubHaQ2.js → _hbd3yHWy2.js} +2 -2
  133. package/dist/public/assets/{_BpKubHaQ2.js.map → _hbd3yHWy2.js.map} +1 -1
  134. package/dist/public/assets/{_BE1sAJ-G.js → _kDIR2NR8.js} +2 -2
  135. package/dist/public/assets/{_BE1sAJ-G.js.map → _kDIR2NR8.js.map} +1 -1
  136. package/dist/public/assets/{_PiE5epFe.js → _lkmVA5Jl.js} +2 -2
  137. package/dist/public/assets/{_PiE5epFe.js.map → _lkmVA5Jl.js.map} +1 -1
  138. package/dist/public/assets/{_C9Gfc8HD2.js → _oy1NiP692.js} +2 -2
  139. package/dist/public/assets/{_C9Gfc8HD2.js.map → _oy1NiP692.js.map} +1 -1
  140. package/dist/public/assets/{_DDQkL3qU.js → _q1aoVAj_.js} +2 -2
  141. package/dist/public/assets/{_DDQkL3qU.js.map → _q1aoVAj_.js.map} +1 -1
  142. package/dist/public/assets/{_2dFS9eoW.js → _rpwoQqaU.js} +2 -2
  143. package/dist/public/assets/{_2dFS9eoW.js.map → _rpwoQqaU.js.map} +1 -1
  144. package/dist/public/assets/{_BGM6toVZ.js → _toGhOk4U.js} +2 -2
  145. package/dist/public/assets/{_BGM6toVZ.js.map → _toGhOk4U.js.map} +1 -1
  146. package/dist/public/assets/{_CNqFHPtk.js → _xDXEaiYG.js} +2 -2
  147. package/dist/public/assets/{_CNqFHPtk.js.map → _xDXEaiYG.js.map} +1 -1
  148. package/dist/public/assets/{_DLdVt2YY.js → _y5S8OwPt.js} +2 -2
  149. package/dist/public/assets/{_DLdVt2YY.js.map → _y5S8OwPt.js.map} +1 -1
  150. package/dist/public/assets/{index-MrlyfSPt.js → index-BkF_8voS.js} +9 -9
  151. package/dist/public/assets/index-BkF_8voS.js.map +1 -0
  152. package/dist/public/assets/index-EQUqrgoE.css +1 -0
  153. package/package.json +1 -1
  154. package/dist/public/assets/index-C3FftwCj.css +0 -1
  155. package/dist/public/assets/index-MrlyfSPt.js.map +0 -1
@@ -1,12 +1,12 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_CnrRSwgo.js","assets/_D78KjvOU.js","assets/_BGM6toVZ.js","assets/_DFSNy_p5.js","assets/_CgrjRmW8.js","assets/_Dl1jb9Oh.js","assets/_swr2EwEY.js","assets/_CIo7EE2m.js","assets/_Bjqxmegr.js","assets/_68tkSWB0.js","assets/_laNEHHov.js","assets/_DuT1d3b7.js","assets/_BXeXVLqQ.js","assets/_DCXRfyXu.js","assets/_B6Pa0t142.js","assets/_-PDLoMF12.js","assets/_BWhBQNy22.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_DpQWjwUv2.js","assets/_Bl9m4QYG2.js","assets/_qs4Ln4Rg2.js","assets/_ZpADOd1b2.js","assets/_DDQkL3qU.js","assets/_CpNZLYpm.js","assets/_CAq-lrFG.js","assets/_DwPmjIla.js","assets/_CNqFHPtk.js","assets/_DWKvGn_N.js","assets/_DxCjYI2X.js","assets/_CVhtozPf.js","assets/_PiE5epFe.js","assets/_DmjWQ4d2.js","assets/_Blov0sJd.js","assets/_Bk9DvADq.js","assets/_panznFin.js","assets/_2dFS9eoW.js","assets/_D3e_oWUH.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_C9Gfc8HD2.js","assets/_C1kRr9Kc2.js","assets/_Dvz6tufK2.js","assets/_BAq6EcWp2.js","assets/_BfTs8fRs2.js","assets/_BpKubHaQ2.js","assets/_BrcHeNpA2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_BE1sAJ-G.js","assets/_b2WV0_P-.js","assets/_B53Hw8eV.js","assets/_3dvXM10f.js","assets/_BLd6EDeA.js","assets/_DLdVt2YY.js","assets/_CthC5WB8.js","assets/_CTr-8dOb.js","assets/_DXL4wTUz.js","assets/_DM4b41za.js","assets/_DVTAwKKz.js","assets/_y_rhG45O.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_BTAL_hF4.js","assets/_D8lfT6ai2.js","assets/_CxypEce-2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_O8f0F-Db2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_q3Nmk9QB2.js","assets/_C9CrsbjF.js","assets/_BaHrjjdk.js","assets/_D8pWUCwe.js","assets/_DAjnTl6J.js","assets/_Bj61d0ZC2.js","assets/_BfXqwnv1.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_DQtWh9mf.js","assets/_MpKNpArX.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_CZrjQzIL.js","assets/_NLqR1tDd.js","assets/_S8j4yHoF.js","assets/_6RgCMzRh2.js","assets/_C8UrJJCG2.js","assets/_KvAucFiW2.js","assets/_BwkuLumM2.js","assets/_eDBMsbht2.js","assets/_BYFGGkPh2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
2
- var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(Ve)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Re());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Le(r.$,r.F)),i===48&&(r[a(c++)]=Re());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,ce={},E=/[\p{L}\p{N}]/gu,le=``,ue={},de={},D=xe((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(ht(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&Qt(t,e,r[t[n]=i],pt)}}),fe=xe((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||We(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),Ge(l))}}),pe=xe((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=be(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if(Qt(a,e,l||(t?t(a):void 0),$t),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);Qt(a[i],`a`,e,pt),e.f&&et(e.e,e.f,a[i].Aa)}}else l?.f&&et(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?xt:St)(e,`a`,(r?n[0]:n)||{},de[e.a.tagName]),(e.Ia||e.Ea)&&Te(e,Zt);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),O=xe(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=ht(``,n,r,i)();return(n,r)=>{let i=n[t],a=Ne(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=pt(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Ue:Be),_||(f.textContent=``));for(let e of u)We(e,f,v);return}if(p)p.forEach(Ue);else for(let e=g;e<d;e++)Ue(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)We(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:We(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=en,typeof t==`string`?Se(e,(e,r)=>n(e[t],[e,r])):Se(e,(e,r)=>n(t(e,r),[e,r]))});function me(e,t){return t?e:``}function he(e,t){return t||t===0?ge(e)+`:`+ge(t+``):``}function ge(e){return n.test(e)?e.replace(n,r):e}function _e(e){return/^on[A-Z-]/.test(e)}function ve(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ye(e){return e!=null&&e!==!1}function be(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function xe(e){return o=1,e}function Se(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Ce(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);we(a)}function we(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Te(e,t){d.push(t,e)}function Ee(){let e=d;try{s=1,Oe()}finally{c++,s=0,f=[],d=[]}p(e)}function De(e,t){h=1,xe(),p=e(p),m=t(m)}function Oe(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function ke(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Te(n,Me):Me(n))}function Ae(e,t){return je(e),((e.A||={})[t]||=new AbortController).signal}function je(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function Me(e){e.abort()}function Ne(e){return e?Array.isArray(e)?e:[e]:[]}function Pe(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function Fe(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function k(e,t,n){e[1+t]===void 0&&g(t,eee),e[1+t]=n||null}function eee(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Ie(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Le(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Re(){return v++}function ze(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function Be(e){e.N?.D?.delete(e),b(e)}function Ve(e){e.Z?.forEach(He,e);for(let t in e.A)ke(e,t)}function He(e){e.delete(this)}function Ue(e){Be(e),At(e.S,e.K)}function We(e,t,n){jt(t,n,e.S,e.K)}function Ge(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,jt(t,null,e.S,e.K)}function Ke(){x||(x=1,queueMicrotask(qe))}function qe(){requestAnimationFrame(Je),Ee()}function Je(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,Ee()}),S.port2.postMessage(0)}function A(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(Ke(),Ce(r,t,e)),i)}function Ye(e,t){let n=a(e),r=a(e+1),i=A(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function j(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function M(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Ce(i,t,e,0,i[r])}}function Xe(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Ne(e[n]);r.length&&Ce(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Ze(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Ne(e[i]);if(e.H<c&&a.length){let c=e[t];Ce(e,()=>{let t=Qe(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&($e(e,r),$e(n,r))}else for(let t of Ne(e[i]))$e(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Qe(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Ne(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function $e(e,t){e&&e.H>0&&e.H<c&&t(e)}function N(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Ce(a,n,-1)};return o._=n,o}function et(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&je(n,r)}function P(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Ce(i,e[i[r]||0],-1)}}function F(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),et(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&L(r,i),i}function tt(e,t,n){e[a(t)].T=t=>n(e,t)}function nt({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function I(e,t){return L(e,t),e=>{Te(e,t)}}function*rt(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*rt(r,t,n);else{let r=e[t[n]];n?yield*rt(r,t,n-1):yield typeof r==`function`?r():r}}}function it(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>rt(t,e).next().value;return n[Symbol.iterator]=()=>rt(t,e),n}}function at(e,...t){return L(e,it(...t))}function ot(e,t,n){C=e,ne(0,t,n)}function st(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ft(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=Fe(a,c),u&&(b[u]=a,Pe(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ft(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),ct(r)},r})})};if(t){r(t);for(let e in t)ct(ae(e))}else n({configurable:!0,set:r})}function ct(e){try{T=1,p(e.m([]),1)}finally{T=0}}function L(e,t){return ie[e]=t}function lt(e,t){return L(e,e=>n=>t(e,n)),t}function ut(e,t){return t=a(t),L(e,e=>()=>e[t])}function dt(e,t,n,r){let i=Le(e);return i._=t.e||n,ft(i,n?.F),t.b?.(i,r.namespaceURI),i}function ft(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function pt(e,t,n,r){return mt(t,dt(e,t,n,r))}function mt(e,t){return e.c&&Ce(t,e.c,-1),t}function ht(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((ce[r]||={})[1+t]||=_t(t,r))(e,n)}:e=>{ot(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function gt(e,t,n,r,i,a){return L(e,ht(e,t,n,r,i,a))}function _t(e,t){let{firstChild:n,lastChild:r}=Ie(e,t),i=document.createElementNS(t,`t`);return jt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{ot(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);ot(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function vt(e){return e||e===0?e+``:``}function R(e,t,n){yt(e,t,Ot(n))}function yt(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function z(e,t){yt(e,`class`,i(t,` `,me)||void 0)}function bt(e,t){yt(e,`style`,i(t,`;`,he)||void 0)}function B(e,t){let n=vt(t);e.data!==n&&(e.data=n)}function xt(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||Ct(i,t,n))||i.removeAttribute(t)}Tt(e,t,n,r)}function St(e,t,n,r){xt(e,t,n,r),Et(e,t,n?.content)}function Ct(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function wt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||Ct(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=_e(e)?`on-${ve(e)}`:e;r[t]||(o[t]=n[e])}Tt(e,t,o,i)}function Tt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:z(i,s);break;case`style`:bt(i,s);break;default:_e(r)?(a||=e[`I`+t]={})[ve(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||R(i,r,s)}}}function Et(e,t,n){let r=tee(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&(Qt(e,t,r,pt),r?.f&&et(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function Dt(e,t){let n=e[t],r=e[`I`+t];ue[e[`F`+t]]?.(e,t);for(let e in r)k(n,e,r[e])}function tee(e){let t=be(e);if(t&&t.a)return t}function Ot(e){if(ye(e))return e===!0?``:e+``}function kt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),Ae(e,r).onabort=()=>t.onDestroy?.())}function At(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function jt(e,t,n,r){if(e.isConnected)e.insertBefore(Mt(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Mt(e,t){return e===t?e:jt(new DocumentFragment,null,e,t)}function Nt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(E)?.length;for(;a&&E.test(r);)a--;return a?r.length:E.lastIndex}return-1}function Pt(e,t,n){let r=e[t],i=Ot(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Lt(r,t)}}function Ft(e,t,n,r,i=Pt){let a=e[t],o=Ot(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Lt(a,o):i(e,t,o)}function It(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Ut(n,Gt,r=>{let i=e[`E`+t];i&&(le=r?.inputType,i(n.value),Ee(),Lt(n,e[`G`+t]),le=``)})}function Lt(e,t){if(e.value!==t){let n=Nt(le,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function Rt(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Yt):Yt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=Ht(i,o)),e.defaultSelected=t)}r!==void 0&&Vt(i,r,o)},e)}function zt(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Yt):Yt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Vt(i,s,o),e):Rt(e,t,s)}function Bt(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=Ht(n,a);Vt(n,i,a),r(o),Ee()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Ut(n,qt,r),ree(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Vt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function Ht(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function nee(e,t,n){e.H===c&&(e[t].open=ye(n))}function ree(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Ut(e,t,n){e._=n,g(`input`,iee),e.form&&g(`reset`,Wt),T&&t(e)&&queueMicrotask(n)}function iee(e){e.target._?.(e)}function Wt(e){let t=[];for(let n of e.target.elements)n._&&Jt(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Gt(e){return e.value!==e.defaultValue}function Kt(e){return e.checked!==e.defaultChecked}function qt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function Jt(e){return e.options?qt(e):Gt(e)||Kt(e)}function Yt(e){return Ot(e)||``}function Xt(e,t){let n=ze(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,Be(n)),l.add(d),Qt(e,n.C,n.E,pt),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function Zt(e){Dt(e,`a`)}function Qt(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(Be(a),i.textContent=``),s&&We(s,o,null)):a?(s?We(s,o,a.S):o.insertBefore(i,a.S),Ue(a)):s&&(We(s,o,i),i.remove())}function $t(e,t,n,r){let i=dt(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):mt(t,i),i}function en(e,t){return t}var tn=[],nn=Symbol();function rn(e){return e[Symbol.iterator]=an,e[nn]=tn,e}function*an(){yield this,yield*this[nn]}var on={boot:`_a`},V={icon:`_b`,btn:`_c`,primary:`_d`,danger:`_e`,armed:`_f`,chip:`_g`,lane:`_h`,pr:`_i`,draft:`_j`,dim:`_k`,mono:`_l`,spacer:`_m`,dot:`_n`,working:`_o`,waiting:`_p`,idle:`_q`,off:`_r`,splitBtn:`_s`,splitPrimary:`_t _s`,splitGrow:`_u`,spin:`_v`,workSpin:`_w`};async function sn(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function cn(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var ln=[`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`],aee=1e4,oee=4e4,see=8e3,cee=5e3,lee=6e4,un,dn,fn=null,pn,mn,hn,gn,_n=0;function vn(e){dn&&e!==dn&&location.reload(),dn=e}async function yn(){try{vn((await sn(`/api/boot`)).boot)}catch{}}function bn(){clearTimeout(mn),clearTimeout(hn),hn=setTimeout(xn,oee),_n&&(_n=0,clearInterval(gn),gn=void 0)}function xn(){Sn(),!_n&&(_n=Date.now(),gn=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-_n>lee&&(_n=Date.now(),wn()),Cn(),yn(),sn(`/api/status`).then(e=>{un.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},cee))}function Sn(){clearTimeout(mn),clearTimeout(hn),fn?.close(),fn=null}function Cn(){for(let e of[`workspaces.changed`,`sessions.changed`])un.dispatchEvent(new MessageEvent(e,{data:null}))}function wn(){if(fn)return;let e=fn=new EventSource(`/api/events`);clearTimeout(mn),mn=setTimeout(xn,see),e.addEventListener(`hello`,e=>{bn(),vn(JSON.parse(e.data||`{}`).boot)}),e.addEventListener(`ping`,bn);for(let t of ln)e.addEventListener(t,e=>{bn(),un.dispatchEvent(new MessageEvent(t,{data:JSON.parse(e.data||`null`)}))})}function Tn(){return un||(un=new EventTarget,wn(),yn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(pn),wn(),yn(),Cn()):(clearTimeout(pn),pn=setTimeout(()=>{_n||Sn()},aee))})),un}var En=null,Dn=null,On=null,kn=new EventTarget;function An(e,t){kn.addEventListener(`intent`,e,{signal:t})}function jn(e,t){En={workspaceId:e,pr:t},kn.dispatchEvent(new Event(`intent`))}function Mn(e){if(En?.workspaceId!==e)return!1;let t=En.pr;return En=null,{pr:t}}function Nn(e,t){Dn=[e,t],kn.dispatchEvent(new Event(`intent`))}function Pn(e){if(Dn?.[0]!==e)return null;let t=Dn[1];return Dn=null,t}function Fn(e){On=e,kn.dispatchEvent(new Event(`intent`))}function In(e){return On===e&&(On=null,!0)}function Ln(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Rn=new Map,zn=new Set,Bn;function Vn(e){for(let[t,n]of Object.entries(e))zn.has(t)||Rn.set(t,n);typeof window<`u`&&(Bn??=Promise.resolve())}function Hn(e){return Rn.get(e)??null}function Un(e,t){zn.add(e),t===null?Rn.delete(e):Rn.set(e,t),Wn(e,t)}function Wn(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function Gn(e){Un(`last-workspace`,e)}function Kn(){return Hn(`side-nav`)!==`0`}function qn(e){Un(`side-nav`,e?`1`:`0`)}function Jn(e){return Hn(`tab:${e}`)}function Yn(e,t){Un(`tab:${e}`,t)}function Xn(){return Hn(`diff-tree`)!==`0`}function Zn(e){Un(`diff-tree`,e?`1`:`0`)}function Qn(){return Hn(`diff-uncommitted`)===`1`}function $n(e){Un(`diff-uncommitted`,e?`1`:`0`)}function er(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function tr(){return er()?(await ar()).pushManager.getSubscription():null}async function nr(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await ar(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await sn(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:or(n)})}return await sn(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function rr(){let e=await tr();e&&(await sn(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function ir(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function ar(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function or(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function sr(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function cr(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function lr(){return typeof navigator<`u`&&navigator.standalone===!0}function ur(e){if(!lr()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var dr={toast:`_H`,toastFloat:`_I`,toastInline:`_J`,toastError:`_K`,toastTitle:`_L`,toastWarn:`_M`,toastInfo:`_N`,toastBody:`_O`,toastContent:`_P`,toastActions:`_Q`,toastDismiss:`_R _eg`},fr=`<div><div><!><!></div><!></div>`,pr=` D D%b%l%l`,uee=I(`v0`,e=>k(e.a,`click`,function(){e._._.o?.()})),mr=e=>{z(e.a,dr.toastDismiss),uee(e)},hr=pe(0),gr=F(26,e=>hr(e,e._._.n),e=>e._._),_r=D(1,`<!><!><!>`,`b%`,gr),vr=N(4,0,e=>_r(e,+!e._.m)),yr=e=>{vr._(e),xr._(e),z(e.a,dr.toastActions)},br=D(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,mr),xr=N(4,0,e=>br(e,+!e._.o)),Sr=pe(1),Cr=N(3,0,e=>Sr(e,e._.l)),wr=e=>{Cr._(e),z(e.a,dr.toastContent)},Tr=N(2,0,e=>B(e.b,e._.j)),Er=e=>{Tr._(e),z(e.a,dr.toastTitle)},Dr=M(22,e=>z(e.a,[dr.toast,e.u,e.v,e.k]),2),Or=j(20,Dr),kr=(e,t)=>{R(e.a,`role`,t===`error`?`alert`:`status`),Or(e,{error:dr.toastError,warn:dr.toastWarn,info:dr.toastInfo}[t])},Ar=(e,t)=>kr(e,t||`error`),jr=j(21,Dr),Mr=M(19,I(`v1`,e=>kt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`[data-palette]:not([data-inline])`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Nr=j(18,e=>{jr(e,{float:dr.toastFloat,inline:dr.toastInline}[e.s]),Mr(e)}),Pr=(e,t)=>Nr(e,t||`float`),Fr=j(10,Dr),Ir=I(`v2`,e=>Dt(e,`a`)),Lr=j(16,e=>{wt(e,`a`,e.q,{class:1,role:1}),Ir(e)});function Rr(e){z(e.b,dr.toastBody)}var zr=D(2,`<strong> </strong>`,` D `,Er),Br=j(9,e=>{zr(e,+!e.j),Tr(e)}),Vr=D(3,`<div><!></div>`,` D%`,wr),Hr=j(11,e=>{Vr(e,+!e.l),Cr(e)}),Ur=D(4,`<div><!><!></div>`,` D%b%`,yr),Wr=M(15,e=>Ur(e,e.m||e.o?0:1)),Gr=j(12,e=>{qr(e,e.m?.content),Wr(e),vr(e)}),Kr=j(14,e=>{Wr(e),Mr(e),xr(e)}),qr=j(13,P(gr));function Jr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:Xr(n,a)?400+o:r.includes(n)?300:Xr(n,r)?100:-1}function Yr(e,t,n){return e?t.map(t=>({repo:t,score:Jr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function Xr(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function Zr(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function Qr(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var $r={paletteBackdrop:`_be`,palette:`_bf`,inline:`_bg`,rows:`_bh`,rowWrap:`_bi`,row:`_bj`,rowMore:`_bk`,hi:`_bl`,archived:`_bm`,cmdRow:`_bn`,onboard:`_bo`,rowName:`_bp`,rowNameText:`_bq`,rowStats:`_br`,open:`_bs`,stat:`_bt`,rowRepos:`_bu`,paletteFoot:`_bv`,hint:`_bw`,archivedLink:`_bx`,newSessionPop:`_by`},ei=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,ti=` D l`,dee=(e,t)=>{R(e.a,`width`,t),R(e.a,`height`,t)},ni=(e,t)=>dee(e,t??15),ri=(e,t)=>z(e.a,[V.icon,t]),ii=(e,t)=>R(e.b,`d`,t),ai=ei,oi=(e=>`/${e}&`)(ti);function si(e){ii(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var ci=(e,t)=>ni(e.a,t),li=(e,t)=>ri(e.a,t),ui=ei,di=(e=>`/${e}&`)(ti);function fi(e){ii(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var pi=(e,t)=>ni(e.a,t),mi=(e,t)=>ri(e.a,t),hi=ei,gi=(e=>`/${e}&`)(ti);function _i(e){ii(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var vi=(e,t)=>ni(e.a,t),yi=(e,t)=>ri(e.a,t),bi=`<!><!><!>`,xi={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},Si=N(0,1,e=>ni(e.a,e._.d)),Ci=e=>{Si._(e),wi._(e),ii(e.a,`M5 7L10 12L5 17 M13 17H20`)},wi=N(0,1,e=>ri(e.a,e._.f)),Ti=N(0,0,e=>z(e.a,[V.icon,e._.f])),Ei=e=>{Ti._(e),Di._(e),Oi._(e)},Di=N(0,0,e=>{R(e.a,`width`,e._.g),R(e.a,`height`,e._.g)}),Oi=N(0,0,e=>R(e.b,`d`,e._.h)),ki=j(6,Di),Ai=j(3,e=>{ki(e,e.d??15),Si(e)}),ji=D(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,Ei,ei,(e=>`/${e}&`)(ti),Ci),Mi=j(7,e=>{ji(e,+!e.h),Oi(e)}),Ni=(e,t)=>Mi(e,xi[t]),Pi=j(5,e=>{Ti(e),wi(e)}),Fi=`<!><!><div data-palette role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,Ii=`b%b D%b b b%b Db b%m`,Li=(e,t)=>{R(e.a,`value`,t),B(e.b,t)},Ri=(e,t)=>Li(e,t[0]),zi=e=>z(e.a,V.mono),Bi=(e,t)=>B(e.b,t),Vi=(e,t)=>Bi(e,t[0]?.worktree),Hi=e=>z(e.a,V.chip),Ui=e=>z(e.a,[V.chip,$r.open]),Wi=N(8,0,e=>{R(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),B(e.b,e._.u),B(e.c,e._.u===1?``:`s`)}),Gi=e=>{Wi._(e),z(e.a,[V.chip,$r.stat])},Ki=N(9,0,e=>R(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
3
- `))),qi=e=>{Ki._(e),Ji._(e),z(e.a,[V.chip,$r.stat])},Ji=N(9,0,e=>B(e.b,e._.s)),Yi=M(2,e=>R(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),Xi=N(7,0,e=>{B(e.b,e._.o),Yi(e)}),Zi=e=>{Xi._(e),Qi._(e),$i._(e),z(e.a,[V.chip,$r.stat])},Qi=N(7,0,Yi),$i=N(7,0,Yi),ea=e=>z(e.a,$r.rowName),ta=N(1,1,e=>B(e.b,e._.h)),na=e=>{ta._(e),z(e.a,[$r.rowName,$r.cmdRow])},ra=e=>z(e.a,$r.onboard),ia=M(2,e=>B(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),aa=N(5,0,ia),oa=I(`o8`,e=>k(e.a,`click`,function(){zo(e._,!e._.af)})),sa=e=>{aa._(e),ca._(e),z(e.a,$r.archivedLink),oa(e)},ca=N(5,0,ia),la=N(8,0,e=>zt(e,`b`,e._.aa?.preferredAgent,Jo(e))),ua=I(`o9`,e=>Bt(e,`b`)),da=e=>{la._(e),pa._(e),z(e.a,V.dim),ua(e)},fa=O(1,`<option> </option>`,` D `,0,Ri),pa=N(8,0,e=>fa(e,[e._.ad,e=>e])),ma=I(`o4`,e=>k(e.a,`click`,function(){fo(e._,!1)})),ha=e=>{z(e.a,$r.paletteBackdrop),ma(e)},ga=I(`o5`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),_a=e=>{e.b,Ai(e.b,14),Pi(e.b),ga(e)},va=j(4,e=>{Ni(e.b,e.e),B(e.c,e.e)}),ya=O(6,(e=>`<button>${e}<!></button>`)(bi),(e=>` D/${e}&%l`)(`b%c`),_a,(e,t)=>va(e,t[0])),ba=F(59,e=>ya(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),xa=(e,t)=>{R(e.e,`popovertarget`,t),R(e.g,`id`,t)},Sa=I(`o6`,e=>{k(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),k(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),k(e.e,`click`,function(e){e.stopPropagation()}),k(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),Ca=e=>{ba(e),z(e.a,$r.rowMore),si(e.b),ci(e.b,13),li(e.b),z(e.c,$r.rowMore),fi(e.d),pi(e.d,13),mi(e.d),z(e.e,$r.rowMore),_i(e.f),vi(e.f,13),yi(e.f),z(e.g,$r.newSessionPop),xa(e,nt(e)),Sa(e)},wa=D(4,`<span>open</span>`,` `,Ui),Ta=M(21,e=>wa(e,e._.j===e._._.v?0:1)),Ea=F(57,Ta,e=>e._._),Da=e=>{Ea(e),Aa(e),Ma._(e),Na._(e),Pa._(e),La._(e),z(e.a,$r.rowName),z(e.c,$r.rowNameText),z(e.g,$r.rowStats),z(e.k,$r.rowRepos)},Oa=(e,t)=>{z(e.b,[V.dot,V[Zr(t)]]),za(e,t?.repos),Va(e,t?.agents),Ha(e,t?.working),Ua(e,t?.waiting),Ga(e,t?.ports)},ka=M(22,e=>Oa(e,e._._.a6[e._.j])),Aa=F(58,ka,e=>e._._),ja=D(5,`<span>archived</span>`,` `,Hi),Ma=N(1,2,e=>ja(e,+!e._.g)),Na=N(1,2,e=>{ka(e),Ta(e)}),Pa=N(1,2,e=>B(e.d,e._.k)),Fa=O(10,`<span> </span>`,` D `,zi,Vi),Ia=M(13,e=>Fa(e,[e.m||e._.l,`full_name`])),La=N(1,2,Ia),Ra=(e,t)=>Ja(e,t?.length),za=j(12,e=>{Ra(e,(e.m||[]).flatMap(e=>e.prs||[])),Ia(e)}),Ba=D(7,`<span> </span>`,` D `,Zi),Va=j(14,e=>{Ba(e,+!e.o),Xi(e)}),Ha=j(15,Qi),Ua=j(16,$i),Wa=D(9,`<span>:<!></span>`,` Db%`,qi),Ga=j(17,e=>{Ka(e,e.r?.length),Wa(e,+!(e.r||[]).length),Ki(e)}),Ka=j(18,Ji),qa=D(8,`<span><!> PR<!></span>`,` D%c%`,Gi),Ja=j(20,e=>{qa(e,+!e.u),Wi(e)}),Ya=M(13,e=>z(e.b,[$r.row,{[$r.hi]:e.m===e._.as,[$r.archived]:e.f===`ws`&&e.g}]),3),Xa=Xe(4,Ya),Za=I(`o7`,e=>{k(e.b,`click`,function(){e._.au(e.e)}),k(e.b,`mouseenter`,function(){Ro(e._,e.m)})}),Qa=e=>{Xa._(e),z(e.a,$r.rowWrap),Za(e)},$a=D(1,`<span>+ New workspace</span>`,` `,ea,`<span>▸ <!></span>`,` Db%`,na,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,Da),eo=D(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto></div>`)(ai,ui,hi),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(oi,di,gi),Ca),to=j(5,e=>{$a(e,e.f===`new`?0:e.f===`cmd`?1:2),eo(e,e.f===`ws`?0:1),Ya(e)}),no=j(6,e=>{Ya(e),Ma(e)}),ro=j(12,Ya),io=(e,t)=>{ao(e,t[0]),ro(e,t[1])},ao=j(4,e=>{to(e,e.e?.kind),no(e,e.e?.archived),oo(e,e.e?.label),so(e,e.e?.ws)}),oo=j(7,ta),so=j(8,e=>{co(e,e.i?.id),lo(e,e.i?.name),uo(e,e.i?.repos)}),co=j(9,Na),lo=j(10,Pa),uo=j(11,La),fo=Ye(19),po=M(13,e=>fo(e,e.l,e.m)),mo=j(11,po),ho=j(12,po),go=O(4,`<li><div><button></button><!></div></li>`,`D D b%`,Qa,io),_o=M(55,I(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&Ro(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),vo=j(51,e=>{yee(e,e.ap.length),go(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),_o(e)}),yo=M(50,e=>vo(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),bo=j(46,yo),xo=j(49,yo),So=M(48,e=>xo(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&Xr(e.a8||``,t.label))),5),Co=D(5,`<button> </button>`,` D `,sa),wo=M(45,e=>Co(e,e.ai&&!e.a8?0:1)),To=Ye(34,e=>{Ft(e,`d`,e.a8||``,Xo(e)),bo(e,Yo(e)),So(e),yo(e),wo(e)}),Eo=M(16,e=>To(e,e.o,e.p)),Do=j(14,Eo),Oo=j(15,Eo),ko=D(8,`<label><select aria-label="Preferred agent"></select></label>`,` D `,da),Ao=Ye(36,e=>{jo(e,e.aa?.preferredAgent),Mo(e,e.aa?.agents),ko(e,+!e.aa),la(e)}),jo=j(38,So),Mo=j(39,pa),No=M(19,e=>Ao(e,e.r,e.s)),Po=j(17,e=>{Oee(e,e.r?.agents),No(e)}),Fo=j(18,No),Io=j(54,e=>{_o(e),Xa(e)}),Lo=M(53,e=>Io(e,Math.min(e.ae,e.aq-1))),Ro=A(40,Lo),zo=A(41,e=>{yo(e),aa(e)}),Bo=I(`o10`,e=>{It(e,`d`),k(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),Ro(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),Ro(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function Vo(e){z(e.e,$r.rows),z(e.g,$r.paletteFoot),z(e.h,$r.hint),Ro(e,0),zo(e,!1),Bo(e)}var Ho=j(42,yo),Uo=j(43,e=>{pee(e,e.ah?.length),yo(e)}),Wo=j(47,So),Go=M(22,e=>Wo(e,e.u.find(t=>t.id===e.v))),fee=j(20,e=>{Dee(e,e.u?.length),Ho(e,e.u.filter(e=>e.status===`active`)),Uo(e,e.u.filter(e=>e.status===`archived`)),Go(e)}),pee=j(44,e=>{wo(e),ca(e)}),mee=P(Ea),hee=j(21,e=>{Go(e),_o(e),mee(e)}),gee=j(23,So),_ee=j(24,So),vee=j(25,So),yee=j(52,Lo),bee=j(56),Ko=M(28,e=>bee(e,Zo(e))),xee=j(26,Ko),See=j(27,Ko),Cee=D(0,`<div></div>`,` `,ha),wee=D(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ra),qo=M(31,e=>wee(e,e.a3&&!e.a4?0:1)),Tee=I(`o11`,e=>k(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),fo(e,!1)))}))),Eee=j(29,e=>{z(e.b,[$r.palette,{[$r.inline]:e.a3}]),R(e.b,`data-inline`,e.a3?``:void 0),Cee(e,+!!e.a3),qo(e),Tee(e)}),Dee=j(30,qo),Oee=j(33,P(ba)),kee=j(32,P(Aa));function Jo(e){return function(t){Ao(e._,{...e._.aa,preferredAgent:t}),sn(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function Yo(e){return t=>t.filter(t=>Xr(e.a8||``,t.name))}function Xo(e){return function(t){To(e,t),Ro(e,0)}}function Zo(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}L(`o1`,Jo),L(`o2`,Yo),L(`o0`,Xo),L(`o3`,Zo);var Qo={page:`_S`,body:`_T`,content:`_U`,pageHead:`_V`,backBtn:`_W`,pageHeadText:`_X`,pageMeta:`_Y`,actions:`_Z`,barPrimary:`_0`,iconBtn:`_1 _eg`,spinning:`_2 _eh`,field:`_3`,section:`_4`,reposHead:`_5`,curRepos:`_6`,curRepo:`_7`,curFull:`_8`,curBase:`_9`,curRemove:`__`,emptyNote:`_ba`,steps:`_bb`,active:`_bc`,stepDone:`_bd`},$o=ei,es=(e=>`/${e}&`)(ti);function ts(e){ii(e.a,`M15 6L9 12L15 18`)}var ns=(e,t)=>ni(e.a,t),rs=(e,t)=>ri(e.a,t),is=ei,as=(e=>`/${e}&`)(ti);function os(e){ii(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var ss=(e,t)=>ni(e.a,t),cs=(e,t)=>ri(e.a,t),ls={addRepo:`_cZ`,repoResults:`_c0`,resultWrap:`_c1`,hi:`_c2`,resultRow:`_c3`,resultBranch:`_c4`,on:`_c5`,branchPick:`_c6`,branchList:`_c7`,resultPlus:`_c8`,repoName:`_c9`,emptyNote:`_c_`},us=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,ds=` D b%b%l`,fs=null,ps=e=>z(e.a,ls.emptyNote),ms=e=>{z(e.a,ls.emptyNote),z(e.b,V.spin)},hs=e=>z(e.a,ls.emptyNote),gs=I(`q7`,e=>k(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),_s=e=>{z(e.a,ls.resultRow),z(e.b,[ls.repoName,V.mono]),gs(e)},vs=j(4,e=>B(e.c,e.e)),ys=(e,t)=>vs(e,t[0]),bs=F(35,e=>Ft(e,`a`,e._._._._._.a0,Dc(e)),e=>e._._._._._),xs=I(`q6`,e=>It(e,`a`)),Ss=e=>{bs(e),xs(e)},Cs=O(2,`<li><button><span> </span></button></li>`,`D D D `,_s,ys),ws=(e,t)=>{Ms(e,t?.length),Cs(e,[t,e=>e])},Ts=M(6,e=>ws(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),Es=F(33,Ts,e=>e._._._._),Ds=e=>{Es(e),ks(e),As(e),z(e.b,ls.branchList)},Os=D(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,Ss),ks=F(34,e=>Os(e,e._._._._.z>8?0:1),e=>e._._._._),As=F(35,Ts,e=>e._._._._),js=D(3,`<li><p>No branches match.</p></li>`,`D `,ps),Ms=(e,t)=>js(e,+!!t),Ns=D(0,`<p><span></span> Loading branches…</p>`,` D `,ms,`<!><!><ul><!><!></ul>`,`b%b D%b%`,Ds),Ps=F(33,e=>Ns(e,+!!e._._._.y),e=>e._._._),Fs=e=>{Ps(e),z(e.a,ls.branchPick)},Is=M(12,e=>z(e.a,[ls.resultWrap,{[ls.hi]:e.l===e._._.r}])),Ls=F(30,Is,e=>e._._),Rs=I(`q8`,e=>{k(e.a,`mouseenter`,function(){cc(e._._,e.l)}),k(e.b,`click`,function(){e._._.a1(e.j)}),k(e.f,`click`,function(){e._._.a2(e.j)})}),zs=e=>{Ls(e),Hs(e),z(e.b,ls.resultRow),_i(e.c),vi(e.c,12),yi(e.c,ls.resultPlus),z(e.d,ls.repoName),Rs(e)},Bs=D(6,`<div></div>`,` `,Fs),Vs=M(10,e=>{z(e.f,[ls.resultBranch,{[ls.on]:e._._.w===e.j}]),Bs(e,e._._.w===e.j?0:1)}),Hs=F(32,Vs,e=>e._._),Us=j(11,Is),Ws=j(9,e=>{B(e.e,e.j),R(e.f,`title`,`Pick a base branch for ${e.j}`),R(e.f,`aria-label`,`Pick a base branch for ${e.j}`),Vs(e)}),Gs=O(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(hi),(e=>`D D D/${e}& D m l%l`)(gi),zs,(e,t)=>{Ws(e,t[0]?.nameWithOwner),Us(e,t[1])}),Ks=N(3,0,e=>Gs(e,[e._.t,`nameWithOwner`])),qs=e=>{Ks._(e),z(e.a,ls.repoResults)},Js=N(3,1,e=>B(e.b,e._.o)),Ys=e=>{Js._(e),z(e.a,ls.emptyNote)},Xs=Ye(8),Zs=M(8,e=>Xs(e,e.g,e.h)),Qs=j(6,Zs),$s=j(7,Zs),ec=j(19,e=>{xc(e,e.t?.length),Ks(e)}),tc=M(16,e=>ec(e,e.n&&e.o?Yr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),nc=D(2,`<p>Loading repos…</p>`,` `,hs),rc=M(15,e=>nc(e,e.o&&!e.n?0:1)),ic=D(3,`<ul></ul>`,` `,qs,`<p>No repos match "<!>".</p>`,` Db%`,Ys),ac=M(21,e=>ic(e,e.u?0:e.o&&e.n?1:2),2),oc=A(13,e=>{tc(e),rc(e),ac(e)}),sc=A(14,e=>{Ft(e,`b`,e.o,Oc(e)),tc(e),rc(e),ac(e),Js(e)}),cc=A(17,P(Ls)),lc=j(28),uc=M(23,e=>lc(e,kc(e))),dc=P(Hs),fc=A(22,e=>{uc(e),dc(e)}),pc=P(Ps,Es),mc=A(24,e=>{Cc(e,e.y?.length),pc(e)}),hc=A(26,P(As,bs)),gc=I(`q9`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),cc(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),cc(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),sc(e,``))})});function _c(e){z(e.a,ls.addRepo),oc(e,null),sc(e,``),cc(e,0),fc(e,null),mc(e,null),hc(e,``),gc(e)}var vc=I(`q10`,e=>kt(e,{onMount:function(){fs&&oc(e,fs),e.s(!1)}})),yc=j(18,e=>{ee(e,Ac(e)),vc(e)}),bc=j(9,e=>{yc(e,jc(e)),uc(e)}),xc=j(20,ac),Sc=j(10,tc),Cc=j(25,P(ks)),wc=j(27),Tc=j(11,e=>wc(e,Mc(e))),Ec=(e,t)=>R(e.b,`disabled`,t);function Dc(e){return t=>{hc(e._._._._._,t)}}function Oc(e){return function(t){sc(e,t),cc(e,0)}}function kc(e){return async t=>{if(e.w===t){fc(e,null);return}fc(e,t),mc(e,null),hc(e,``);try{let n=await sn(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&mc(e,n.branches)}catch(t){fc(e,null),e.j?.(String(t.message||t))}}}function Ac(e){return()=>e.s(!0)}function jc(e){return async t=>{t&&Xs(e,!0);try{let n=await sn(`/api/repos${t?`?refresh`:``}`);fs=n,oc(e,n)}catch(t){e.j?.(String(t.message||t))}t&&Xs(e,!1)}}function Mc(e){return(t,n)=>{sc(e,``),fc(e,null),e.l(t,n)}}L(`q1`,Dc),L(`q0`,Oc),L(`q5`,kc),L(`q2`,Ac),L(`q3`,jc),L(`q4`,Mc);var Nc=((e,t,n)=>`<div role=region><div><div><header><button type=button title=Cancel aria-label=Cancel>${e}</button><div><h1>New workspace</h1><p>Name the space and pick repos to work in.</p></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div><h2>Repos</h2><button title="Refresh repo list" aria-label="Refresh repo list">${t}</button></div><ul><!><!></ul>${n}</section><!><div><button type=button> </button></div></div></div></div>`)($o,is,us),Pc=((e,t,n)=>` D D D D D/${e}&l D b m%b Db l D Db D/${t}&m D%b%l0${n}&l%b D D p`)(es,as,ds),Fc=e=>z(e.a,Qo.stepDone),Ic=e=>z(e.a,V.spin),Lc=e=>z(e.a,Qo.emptyNote),Rc=N(3,0,e=>B(e.b,e._.i)),zc=e=>{Rc._(e),z(e.a,[Qo.curBase,V.mono])},Bc=D(1,`<span></span>`,` `,Ic,`<span>✓</span>`,` `,Fc),Vc=F(54,e=>{z(e.a,{[Qo.active]:e.M===e._._.ab-1}),Bc(e,e.M===e._._.ab-1?0:1)},e=>e._._),Hc=Vc,Uc=(e,t)=>B(e.c,t),Wc=O(0,`<li><!><!></li>`,` D%b%`,Hc,(e,t)=>Uc(e,t[0])),Gc=N(21,0,e=>Wc(e,[e._.aa])),Kc=e=>{Gc._(e),z(e.a,Qo.steps)},qc=F(52,e=>B(e.a,e._._.a9),e=>e._._),Jc=gt(`m9`,` `,` `,qc),Yc=e=>{Rr(e.a),Hr(e.a,Jc(e)),Pr(e.a,`inline`),Kr(e.a,Il(e)),Gr(e.a),Fr(e.a),Ar(e.a),Br(e.a),Lr(e.a,{})},Xc=Xe(17,e=>R(e.e,`disabled`,e._.a7)),Zc=I(`m10`,e=>k(e.e,`click`,function(){e._.al(e.h)})),Qc=e=>{Xc._(e),z(e.a,Qo.curRepo),z(e.b,Qo.curFull),z(e.e,Qo.curRemove),Zc(e)},$c=j(7,e=>{B(e.c,e.h),R(e.e,`title`,`Remove ${e.h}`)}),el=D(3,`<span title="Base branch">⎇ <!></span>`,` Db%`,zc),tl=j(8,e=>{el(e,+!e.i),Rc(e)}),nl=(e,t)=>{$c(e,t[0]?.fullName),tl(e,t[0]?.baseBranch)},rl=it(50),il=j(48),al=M(45,e=>il(e,Ll(e)),5),ol=M(34,e=>R(e.x,`disabled`,e.a7||!e.a3.trim())),sl=A(29,e=>{Ft(e,`l`,e.a3,Rl(e)),al(e),ol(e)}),cl=A(30,e=>{z(e.o,[Qo.iconBtn,{[Qo.spinning]:e.a4}]),R(e.o,`disabled`,e.a4)}),ll=j(46,e=>Tc(e.t,zl(e))),ul=j(47),dl=O(17,`<li><span> </span><!><button>×</button></li>`,` D D l%b `,Qc,nl),fl=A(31,e=>{Sc(e.t,new Set(e.a5.map(e=>e.fullName))),Ol(e,e.a5?.length),ll(e,Bl(e)),ul(e,Vl(e)),dl(e,[e.a5,`fullName`]),al(e)}),pl=M(44,I(`m13`,e=>kt(e,{busy:e.a7,onMount:function(){let t=new AbortController;return Tn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.ah([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),ml=D(21,`<ul></ul>`,` `,Kc),hl=M(38,e=>ml(e,e.a7&&e.ab?0:1)),gl=A(33,e=>{R(e.e,`disabled`,e.a7),R(e.l,`disabled`,e.a7),Ec(e.t,e.a7),B(e.y,e.a7?`Creating…`:`Create workspace`),pl(e),hl(e),ol(e),Xc(e)}),_l=D(9,fr,(e=>`/${e}&`)(pr),Yc),vl=P(qc),yl=A(35,e=>{_l(e,+!e.a9),vl(e)}),bl=j(43,e=>{pl(e),al(e)}),xl=M(42,e=>bl(e,Hl(e)),2),Sl=A(36,e=>{Al(e,e.aa?.length),xl(e),Gc(e)}),Cl=(e,t)=>{jl(e,t.op),Ml(e,t.last)},wl=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},Tl=I(`m12`,e=>{k(e.a,`keydown`,function(t){t.key===`Escape`&&!e.a7&&(t.preventDefault(),e.a2?.())}),k(e.e,`click`,function(){e.a2?.()}),It(e,`l`),k(e.o,`click`,function(){rl(e)()}),k(e.x,`click`,function(){e.am()})});function El(e){z(e.a,Qo.page),z(e.b,Qo.body),z(e.c,Qo.content),z(e.d,Qo.pageHead),z(e.e,[Qo.iconBtn,Qo.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,Qo.pageHeadText),z(e.i,Qo.pageMeta),z(e.k,Qo.field),z(e.m,Qo.section),z(e.n,Qo.reposHead),os(e.p),ss(e.p,14),cs(e.p),z(e.q,Qo.curRepos),tt(e,19,Pl),_c(e.t),bc(e.t,Wl(e)),$s(e.t,Ul(e)),Qs(e.t),z(e.w,Qo.actions),z(e.x,[V.btn,V.primary,Qo.barPrimary]),sl(e,``),cl(e,!1),fl(e,[]),gl(e,!1),yl(e,null),Sl(e,[]),Cl(e,{last:0,op:``}),wl(e,nt(e)),Tl(e)}var Dl=D(18,`<li>No repos yet — search below to add one (or create empty).</li>`,` `,Lc),Ol=j(32,e=>Dl(e,+!!e.a6)),kl=P(Vc),Al=j(37,e=>{hl(e),kl(e)}),jl=j(40,e=>{xl(e),al(e)}),Ml=j(41,e=>{xl(e),al(e)}),Nl=j(27,al),Pl=lt(`m11`,j(50)),Fl=j(28);function Il(e){return function(){yl(e._,null)}}function Ll(e){return async()=>{gl(e,!0),yl(e,null),Sl(e,[]),e.ae=Math.random().toString(36).slice(2,10);try{e.af=(await sn(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await sn(`/api/progress?since=${e.af}&op=${e.ae}`);e.ah(t.messages)}catch{}},800);try{let t=await sn(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.a3,repos:e.a5,opId:e.ae})});gl(e,!1),e.a1?.(t)}catch(t){gl(e,!1),yl(e,String(t.message||t))}finally{clearInterval(t)}}}function Rl(e){return t=>{sl(e,t)}}function zl(e){return function(t,n){e.ak(t,n)}}function Bl(e){return(t,n)=>{!t||e.a5.some(e=>e.fullName===t)||fl(e,e.a5.concat({fullName:t,baseBranch:n}))}}function Vl(e){return t=>{fl(e,e.a5.filter(e=>e.fullName!==t))}}function Hl(e){return t=>{for(let n of t)n.op===e.ae&&(n.seq&&n.seq<=e.af||(n.seq&&(e.af=n.seq),Sl(e,e.aa.concat(n.message))))}}function Ul(e){return function(t){cl(e,t)}}function Wl(e){return function(t){yl(e,t)}}L(`m5`,Il),L(`m4`,Ll),L(`m0`,Rl),L(`m6`,zl),L(`m2`,Bl),L(`m3`,Vl),L(`m1`,Hl),L(`m8`,Ul),L(`m7`,Wl);var Gl={workView:`_y`,sideWrap:`_z`,sideHidden:`_A`,navPage:`_B`,mainCol:`_C`,termArea:`_D`,asBar:`_E`,padInline:`_F`,emptySess:`_G`},Kl={iconBtn:`_cI _eg`,spinning:`_cJ _eh`,navToggle:`_cK _eg`,notifyBtn:`_cL _eg`,sideNav:`_cM`,pageHead:`_cN`,pageHeadActions:`_cO`,sectionLabel:`_cP`,newSpaceBtn:`_cQ`,page:`_cR`,sideList:`_cS`,sideRail:`_cT`,sideFoot:`_cU`,footSpacer:`_cV`,on:`_cW`,closed:`_cX`,railPop:`_cY`},ql=ei,Jl=(e=>`/${e}&`)(ti);function Yl(e){ii(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var Xl=(e,t)=>ni(e.a,t),Zl=(e,t)=>ri(e.a,t),Ql=ei,$l=(e=>`/${e}&`)(ti);function eu(e){ii(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var tu=(e,t)=>ni(e.a,t),nu=(e,t)=>ri(e.a,t),ru={railBtn:`_ew _eg`,current:`_ex`,railDot:`_ey`,ws:`_ez`,railPopWs:`_eA`,wsRow:`_eB`,wsBtn:`_eC`,wsText:`_eD`,wsName:`_eE`,wsMeta:`_eF`,wsOpenHint:`_eG`,statusDot:`_eH`,pageCard:`_eI`,sessTitle:`_eJ`,sessActions:`_eK`,sessRenameDot:`_eL`,sessRename:`_eM`,rowIcon:`_eN`,close:`_eO`,sess:`_eP`,armed:`_eQ`,sessions:`_eR`,sessBtn:`_eS`,sessIcon:`_eT`,newSessionPop:`_eU`},iu=ei,au=(e=>`/${e}&`)(ti);function ou(e){ii(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var su=(e,t)=>ni(e.a,t),cu=(e,t)=>ri(e.a,t),lu={sideChips:`_e_`,prBtn:`_fa`,portChip:`_fb`,portOpen:`_fc`,portKill:`_fd`,rejected:`_fe`,armed:`_ff`},uu=`<!><!><!>`,du=M(9,e=>z(e.d,[lu.portKill,{[lu.armed]:e._._.h===e.i}])),fu=M(10,e=>R(e.d,`title`,e._._.h===e.i?`Really kill ${e.g}?`:`Kill ${e.g} (pid ${e.i})`),2),pu=F(15,e=>{du(e),fu(e)},e=>e._._),mu=I(`r3`,e=>{k(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.h}`,`_blank`,`noopener`)}),k(e.d,`click`,function(){e._._.h===e.i?(Uu(e._._,null),fetch(`/api/procs/${e.i}`,{method:`DELETE`}).catch(()=>{})):e._._.k(e.i)})}),hu=e=>{pu(e),z(e.a,[V.chip,lu.portChip]),z(e.b,lu.portOpen),mu(e)},gu=j(6,e=>{R(e.a,`title`,e.g),fu(e)}),_u=j(7,e=>{R(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.h}`),B(e.c,e.h)}),vu=j(8,e=>{du(e),fu(e)}),yu=(e,t)=>{gu(e,t[0]?.cmd),_u(e,t[0]?.port),vu(e,t[0]?.pid)},bu=M(12,e=>B(e.b,e._._.d(e._.c))),xu=F(4,bu,e=>e._._),Su=I(`r2`,e=>k(e.a,`click`,function(){e._._._.g?.(e._.e,e.l)})),Cu=e=>{xu(e),wu._(e),Eu._(e),Su(e)},wu=Xe(0,bu),Tu=M(10,e=>R(e.a,`title`,`${e._.e} — ${e.j}${e.h===`APPROVED`?` (approved)`:e.h===`CHANGES_REQUESTED`?` (changes requested)`:``}`),2),Eu=Xe(0,Tu),Du=M(8,e=>z(e.a,[V.chip,V.pr,lu.prBtn,{[V.draft]:e.g,[lu.rejected]:e.h===`CHANGES_REQUESTED`}])),Ou=j(6,Du),ku=j(7,e=>{B(e.d,e.h===`APPROVED`?` ✓`:e.h===`CHANGES_REQUESTED`?` ✗`:``),Du(e),Tu(e)}),Au=j(9,Tu),ju=j(11,e=>B(e.c,e.l)),Mu=O(0,`<button type=button><!>#<!><!></button>`,` D%c%b%`,Cu,(e,t)=>{Ou(e,t[0]?.isDraft),ku(e,t[0]?.reviewDecision),Au(e,t[0]?.title),ju(e,t[0]?.number)}),Nu=(e,t)=>Mu(e,[t||[],`number`]),Pu=(e,t)=>Fu(e,t[0]),Fu=j(2,e=>{Nu(e,e.c?.prs),Iu(e,e.c?.worktree),wu(e)}),Iu=j(4,Eu),Lu=j(3,P(xu)),Ru=O(1,`<!><!><!>`,`b%`,0,Pu),zu=N(0,0,e=>{Lu(e,rd(e)),Ru(e,[e._.l,`full_name`])}),Bu=e=>{zu._(e),Hu._(e),z(e.a,lu.sideChips)},Vu=O(2,`<span><button type=button>:<!></button><button type=button>×</button></span>`,` D Db%l `,hu,yu),Hu=N(0,0,e=>Vu(e,[e._.m,`port`])),Uu=A(7,P(pu)),Wu=(e,t)=>qu(e,t.timer);function Gu(e){Uu(e,null),Wu(e,{timer:0})}var Ku=j(10),qu=j(9,e=>Ku(e,id(e))),Ju=D(0,`<div><!><!></div>`,` D%b%`,Bu),Yu=M(14,e=>Ju(e,e.l.some(e=>(e.prs||[]).length)||e.n?0:1)),Xu=j(11,e=>{Yu(e),zu(e)}),Zu=(e,t)=>Xu(e,t||[]),Qu=j(12,e=>{$u(e,e.m.length),Hu(e)}),$u=j(13,Yu),ed=(e,t)=>Qu(e,t||[]),td=(e,t)=>{Zu(e,t?.repos),ed(e,t?.ports)},nd=j(6);function rd(e){return t=>{if(e._.l.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.l.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function id(e){return t=>{clearTimeout(e.j),Uu(e,t),e.j=setTimeout(()=>{Uu(e,null)},3500)}}L(`r1`,rd),L(`r0`,id);var ad=`<!><!><!>`,od=N(7,0,e=>B(e.b,e._.u)),sd=e=>{od._(e),z(e.a,ru.wsMeta)},cd=F(48,e=>Ft(e,`c`,e._._._._.a2,mp(e)),e=>e._._._._),ld=I(`s8`,e=>{It(e,`c`),k(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._._._.a4(e._.c)):t.key===`Escape`&&(t.preventDefault(),zf(e._._._._,null))}),k(e.c,`blur`,function(){e._._._._.a4(e._.c)}),kt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),ud=e=>{cd(e),dd._(e),fd._(e),e.b,Ai(e.b,13),Pi(e.b,ru.sessIcon),z(e.c,ru.sessRename),ld(e)},dd=N(0,0,e=>z(e.a,[V.dot,V[Qr(e._.g)],ru.sessRenameDot])),fd=N(0,0,e=>Ni(e.b,e._.h)),pd=M(9,e=>{z(e.i,[ru.close,{[ru.armed]:e._._._._.x===e._.d}]),R(e.i,`title`,e._._._._.x===e._.d?`Really kill this session?`:`Kill session`)}),md=F(46,pd,e=>e._._._._),hd=I(`s9`,e=>{k(e.a,`click`,function(){e._._._._.u?.(e._.d)}),k(e.g,`click`,function(){zf(e._._._._,e._.d),Vf(e._._._._,e._.i||e._.h)}),k(e.i,`click`,function(){e._._._._.x===e._.d?(Pf(e._._._._,null),e._._._._.v?.(e._.d)):e._._._._.a0(e._.d)})}),gd=e=>{md(e),_d._(e),vd._(e),bd._(e),xd._(e),z(e.a,ru.sessBtn),e.c,Ai(e.c,13),Pi(e.c,ru.sessIcon),z(e.d,ru.sessTitle),z(e.f,ru.sessActions),z(e.g,ru.rowIcon),ou(e.h),su(e.h,12),cu(e.h),hd(e)},_d=N(0,1,pd),vd=N(0,1,e=>z(e.b,[V.dot,V[Qr(e._.g)]])),yd=M(10,e=>B(e.e,e._.i||e._.h)),bd=N(0,1,e=>{Ni(e.c,e._.h),yd(e)}),xd=N(0,1,yd),Sd=M(4,e=>z(e.a,[ru.sess,{[ru.current]:e.d===e._._._.t}])),Cd=F(44,Sd,e=>e._._._),wd=e=>{Cd(e),Dd(e)},Td=D(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(bi),(e=>` b/${e}& b`)(`b%c`),ud,((e,t)=>`<button><span></span>${e}<span> </span></button><div><button title="Rename session">${t}</button><button>×</button></div>`)(bi,iu),((e,t)=>` D b/${e}& D m D D/${t}&l l`)(`b%c`,au),gd),Ed=M(5,e=>Td(e,e._._._.a1===e.d?0:1)),Dd=F(47,Ed,e=>e._._._),Od=j(3,e=>{Sd(e),Ed(e),_d(e)}),kd=(e,t)=>Ad(e,t[0]),Ad=j(2,e=>{Od(e,e.c?.id),jd(e,e.c?.state),Md(e,e.c?.agent),Nd(e,e.c?.title)}),jd=j(6,e=>{vd(e),dd(e)}),Md=j(7,e=>{bd(e),fd(e)}),Nd=j(8,xd),Pd=I(`s5`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.r?.(e.e)})),Fd=e=>{e.b,Ai(e.b,14),Pi(e.b),Pd(e)},Id=j(4,e=>{Ni(e.b,e.e),B(e.c,e.e)}),Ld=O(2,(e=>`<button>${e}<!></button>`)(bi),(e=>` D/${e}&%l`)(`b%c`),Fd,(e,t)=>Id(e,t[0])),Rd=F(43,e=>Ld(e,[[...e._._._._.s||[],`shell`],e=>e]),e=>e._._._._),zd=(e,t)=>{R(e.a,`popovertarget`,t),R(e.c,`id`,t)},Bd=I(`s6`,e=>k(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),Vd=e=>{Rd(e),z(e.a,ru.rowIcon),e.b,Ni(e.b,`shell`),Ai(e.b,12),Pi(e.b),z(e.c,ru.newSessionPop),zd(e,nt(e)),Bd(e)},Hd=I(`s4`,e=>k(e.a,`click`,function(){e._._._._.p?.()})),Ud=D(0,(e=>`<button title="Review changes">${e}</button>`)(ai),(e=>` D/${e}&l`)(oi),e=>{z(e.a,ru.rowIcon),si(e.b),ci(e.b,12),li(e.b),Hd(e)}),Wd=F(41,e=>Ud(e,+!e._._._.p),e=>e._._._),Gd=I(`s7`,e=>k(e.b,`click`,function(){e._._._.q?.()})),Kd=e=>{Wd(e),Jd(e),z(e.b,ru.rowIcon),fi(e.c),pi(e.c,12),mi(e.c),Gd(e)},qd=D(3,(e=>`<button title="New session">${e}</button><div popover=auto></div>`)(bi),(e=>` D/${e}&l b`)(`b%c`),Vd),Jd=F(42,e=>qd(e,+!e._._._.r),e=>e._._._),Yd=F(36,e=>B(e.b,e._._._.j?`Open`:``),e=>e._._._),Xd=e=>{Yd(e),z(e.a,ru.wsOpenHint)},Zd=M(21,e=>z(e.a,[ru.ws,{[ru.current]:e._._.j,[ru.railPopWs]:e._._.n,[ru.pageCard]:e._._.o}]),2),Qd=F(36,Zd,e=>e._._),$d=I(`s10`,e=>k(e.c,`click`,function(){e._._.k()})),ef=e=>{Qd(e),rf(e),af(e),lf(e),uf(e),df(e),ff._(e),gf._(e),z(e.b,ru.wsRow),z(e.c,ru.wsBtn),z(e.e,ru.wsText),z(e.f,ru.wsName),z(e.k,ru.sessions),Gu(e.m),$d(e)},tf=O(11,`<div></div>`,` `,wd,kd),nf=(e,t)=>{_f(e,t.length),vf(e,t[0]?.title),yf(e,t[0]?.agent),tf(e,[t.length>1?t:[],`id`])},rf=F(38,e=>nf(e,e._._.m||[]),e=>e._._),af=F(39,Zd,e=>e._._),of=D(7,`<span> </span>`,` D `,sd),sf=D(8,`<span> </span>`,` D `,Xd),cf=D(9,(e=>`<!><!><button title="Manage workspace">${e}</button><!><!>`)(ui),(e=>`b%b D/${e}&l%c`)(di),Kd),lf=F(40,e=>{of(e,+!e._._.o),sf(e,+!e._._.o),cf(e,+!!e._._.o),Zd(e)},e=>e._._),uf=F(45,e=>nd(e.m,e._._.w),e=>e._._),df=F(49,e=>B(e.g,e._._.a6),e=>e._._),ff=N(0,1,e=>td(e.m,e._.b)),pf=j(20,od),mf=M(19,e=>pf(e,e.o===0?e.s:e.o===1?`${e.q||e.r} · ${e.s}`:`${e.o} sessions · ${e.s}`),3),hf=j(18,mf),gf=N(0,1,e=>{z(e.d,[V.dot,V[e._.c],ru.statusDot]),hf(e,e._.c===`working`?`Working`:e._.c===`waiting`?`Needs you`:e._.c===`idle`?`Idle`:`Off`)}),_f=j(14,mf),vf=j(16,mf),yf=j(17,mf),bf=F(36,e=>z(e.a,[ru.railBtn,{[ru.current]:e._._.j}]),e=>e._._),xf=I(`s3`,e=>k(e.a,`click`,function(){e._._.k()})),Sf=e=>{bf(e),Cf(e),wf(e),Tf._(e),xf(e)},Cf=F(37,e=>B(e.b,(e._._.l??0)+1),e=>e._._),wf=F(49,e=>R(e.a,`title`,e._._.a6),e=>e._._),Tf=N(0,0,e=>z(e.c,[V.dot,V[e._.c],ru.railDot])),Ef=j(2,e=>{Tf(e),gf(e)}),Df=j(1,e=>{Ef(e,Zr(e.b)),ff(e)}),Of=M(3,e=>Df(e,e._.h[e._.f])),kf=N(0,0,Of),Af=e=>{kf._(e),jf._(e),Nf._(e)},jf=N(0,0,Of),Mf=D(0,`<button> <span></span></button>`,` D b `,Sf,(e=>`<section><div><button><span></span><span><span> </span><!></span><!></button><!></div><div><!>${e}</div></section>`)(uu),(e=>` D D D b D D l%l%l%l D%b/${e}&m`)(`b%c`),ef),Nf=N(0,0,e=>Mf(e,+!e._.i)),Pf=A(23,P(md)),Ff=(e,t)=>Wf(e,t.timer),If=j(30),Lf=M(29,e=>If(e,hp(e)),2),Rf=P(Dd),zf=A(27,e=>{Lf(e),Rf(e)}),Bf=P(cd),Vf=A(28,e=>{Lf(e),Bf(e)});function Hf(e){Pf(e,null),Ff(e,{timer:0}),zf(e,null),Vf(e,``)}var Uf=j(26),Wf=j(25,e=>Uf(e,gp(e))),Gf=j(3,Lf),Kf=D(0,`<!><!><!>`,`b%`,Af),qf=(e,t)=>{Jf(e,t?.name),Kf(e,+!t)},Jf=j(32,P(wf,df)),Yf=M(6,e=>qf(e,e.e.find(t=>t.id===e.f))),Xf=j(4,Yf),Zf=j(5,e=>{Yf(e),kf(e)}),Qf=j(7,jf),$f=j(8,Nf),ep=j(9,P(bf,Qd,Yd)),tp=j(10),np=j(11,P(Cf)),rp=j(12,P(rf)),ip=j(13,P(af)),ap=j(14,P(lf)),op=j(15,P(Wd)),sp=j(16),cp=j(17,P(Jd)),lp=j(18,P(Rd)),up=j(19,P(Cd)),dp=j(20),fp=j(21),pp=j(22,P(uf));function mp(e){return t=>{Vf(e._._._._,t)}}function hp(e){return t=>{if(e.a1!==t.id)return;let n=e.a2.trim();zf(e,null),n&&e.d?.(t,n)}}function gp(e){return t=>{clearTimeout(e.z),Pf(e,t),e.z=setTimeout(()=>{Pf(e,null)},3500)}}L(`s0`,mp),L(`s2`,hp),L(`s1`,gp);var _p=ei,vp=(e=>`/${e}&`)(ti);function yp(e){ii(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var bp=(e,t)=>ni(e.a,t),xp=(e,t)=>ri(e.a,t),Sp=ei,Cp=(e=>`/${e}&`)(ti);function wp(e){ii(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Tp=(e,t)=>ni(e.a,t),Ep=(e,t)=>ri(e.a,t),Dp=ei,Op=(e=>`/${e}&`)(ti);function kp(e){ii(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var Ap=(e,t)=>ni(e.a,t),jp=(e,t)=>ri(e.a,t),Aee=`<aside><!><div></div><!><div></div></aside>`,jee=` D%b b%b l`,Mee=e=>{kp(e.a),Ap(e.a,15),jp(e.a)},Nee=e=>{wp(e.a),Tp(e.a,15),Ep(e.a)},Pee=e=>z(e.a,Kl.sectionLabel),Fee=e=>z(e.a,Kl.sectionLabel),Mp=F(64,e=>{z(e.a,[Kl.notifyBtn,{[Kl.on]:e._._.ac}]),R(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Iee=I(`t22`,e=>k(e.a,`click`,function(){e._._.af()})),Lee=e=>{Mp(e),Yl(e.b),Xl(e.b,15),Zl(e.b),Iee(e)},Np=F(64,e=>{z(e.a,[Kl.notifyBtn,{[Kl.on]:e._._.ac}]),R(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Ree=I(`t17`,e=>k(e.a,`click`,function(){e._._.af()})),zee=e=>{Np(e),Yl(e.b),Xl(e.b,16),Zl(e.b),Ree(e)},Bee=D(0,Sp,(e=>`/${e}&`)(Cp),Nee,Dp,(e=>`/${e}&`)(Op),Mee),Pp=N(4,1,e=>{R(e.a,`title`,e._.ab?`Collapse sidebar`:`Expand sidebar`),Bee(e,+!e._.ab)}),Vee=D(2,(e=>`<button>${e}</button>`)(ql),(e=>` D/${e}&l`)(Jl),Lee),Hee=I(`t23`,e=>{k(e.a,`click`,function(){kh(e._,!e._.ab),qn(e._.ab)}),k(e.d,`click`,function(){e._.ae(),e._.s?.()}),k(e.f,`click`,function(){e._.ae(),e._.a2?.()})}),Uee=e=>{Pp._(e),z(e.a,Kl.navToggle),z(e.b,[V.spacer,Kl.footSpacer]),z(e.d,Kl.iconBtn),eu(e.e),tu(e.e,15),nu(e.e),z(e.f,Kl.iconBtn),yp(e.g),bp(e.g,16),xp(e.g),Vee(e,+!er()),Hee(e)},Wee=I(`t21`,e=>k(e.a,`click`,function(){e._.ae(),e._.a2?.()})),Gee=e=>{z(e.a,Kl.newSpaceBtn),yp(e.b),bp(e.b,16),xp(e.b),Wee(e)},Fp=M(7,e=>op(e.b,Jh(e)),4),Ip=F(53,Fp,e=>e._._),Kee=I(`t20`,e=>{k(e.a,`mouseenter`,function(){e._.i()}),k(e.a,`mouseleave`,function(){e._.j()})}),qee=e=>{Ip(e),Lp(e),zp(e),Bp(e),Hp(e),Up(e),Wp(e),qp(e),Jp(e),Yp(e),Xp(e),Zp(e),$p._(e),tm._(e),nm._(e),z(e.a,Kl.railPop),Hf(e.b),ip(e.b,!0),sp(e.b,Yh(e)),$f(e.b),np(e.b),ap(e.b),Kee(e)},Lp=F(54,e=>lp(e.b,e._._.v),e=>e._._),Rp=M(3,e=>cp(e.b,Xh(e))),zp=F(55,Rp,e=>e._._),Bp=F(56,Fp,e=>e._._),Vp=M(5,e=>rp(e.b,e.c===e._._.a5&&e._._.y?e._._.y:e._._.aj[e.c]?.sessions||[]),3),Hp=F(57,Vp,e=>e._._),Up=F(58,e=>Gf(e.b,e._._.a0),e=>e._._),Wp=F(59,e=>fp(e.b,e._._.a1),e=>e._._),Gp=M(4,e=>ep(e.b,e.c===e._._.a5)),Kp=M(6,e=>up(e.b,e.c===e._._.a5&&e._._.a9===`term`?e._._.a7:null),3),qp=F(60,e=>{tp(e.b,$h(e)),pp(e.b,Qh(e)),dp(e.b,Zh(e)),Gp(e),Fp(e),Vp(e),Kp(e)},e=>e._._),Jp=F(61,Kp,e=>e._._),Yp=F(62,e=>{Fp(e),Kp(e)},e=>e._._),Xp=F(67,e=>Xf(e.b,e._._.ai),e=>e._._),Zp=F(68,e=>{Qf(e.b,e._._.aj),Vp(e)},e=>e._._),Qp=j(2,e=>{Zf(e.b,e.c),Gp(e),Rp(e),Fp(e),Vp(e),Kp(e)}),$p=N(1,0,e=>Qp(e,e._.d)),em=M(8,e=>bt(e.a,`top:${e._.e}px;left:${e._.f}px`)),tm=N(1,0,em),nm=N(1,0,em),rm=M(4,e=>ep(e.b,e.d===e._._.a5)),im=F(60,e=>{tp(e.b,eg(e)),rm(e)},e=>e._._),am=I(`t19`,e=>{k(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();mm(e._,{id:e.d,top:r.top,left:r.right+8})}),k(e.a,`mouseleave`,function(){e._.j()})}),om=e=>{im(e),sm(e),cm(e),Hf(e.b),$f(e.b,!0),Gf(e.b),rp(e.b),ip(e.b),ap(e.b),op(e.b),sp(e.b),cp(e.b),lp(e.b),up(e.b),dp(e.b),fp(e.b),pp(e.b),am(e)},sm=F(67,e=>Xf(e.b,e._._.ai),e=>e._._),cm=F(68,e=>Qf(e.b,e._._.aj),e=>e._._),lm=(e,t)=>np(e.b,t),um=j(3,e=>{Zf(e.b,e.d),rm(e)}),dm=O(0,(e=>`<span>${e}</span>`)(ad),(e=>` D/${e}&l`)(`b%c`),om,(e,t)=>{um(e,t[0]),lm(e,t[1])}),fm=N(3,0,e=>dm(e,[e._.ag,e=>e])),pm=D(1,(e=>`<div>${e}</div>`)(ad),(e=>` D/${e}&l`)(`b%c`),qee),mm=A(2,e=>{_m(e,e.c?.id),vm(e,e.c?.top),ym(e,e.c?.left),pm(e,+!e.c)}),hm=(e,t)=>Sm(e,t.timer),gm=e=>{fm._(e),z(e.a,Kl.sideRail),mm(e,null),hm(e,{timer:0})},_m=j(3,$p),vm=j(4,tm),ym=j(5,nm),bm=j(8),xm=j(9),Sm=j(7,e=>{bm(e,tg(e)),xm(e,ng(e))}),Cm=M(11,e=>op(e.c,rg(e)),4),wm=Xe(2,Cm),Tm=e=>{wm._(e),Em._(e),Om._(e),km._(e),jm._(e),Mm._(e),Nm._(e),zm._(e),Bm._(e),Vm._(e),Hm._(e),Um._(e),Wm._(e),Gm._(e),Km._(e),Hf(e.c),sp(e.c,ig(e)),$f(e.c),np(e.c),ip(e.c)},Em=Xe(2,e=>lp(e.c,e._.v)),Dm=M(6,e=>cp(e.c,ag(e)),2),Om=Xe(2,Dm),km=Xe(2,Cm),Am=M(8,e=>rp(e.c,e.e===e._.a5&&e._.y?e._.y:e._.aj[e.e]?.sessions||[]),3),jm=Xe(2,Am),Mm=Xe(2,e=>Gf(e.c,e._.a0)),Nm=Xe(2,e=>fp(e.c,e._.a1)),Pm=D(0,`<h2>Current</h2>`,` `,Fee),Fm=M(7,e=>Pm(e,e._.al&&e.e===e._.a5?0:1),2),Im=D(1,`<h2>Other spaces</h2>`,` `,Pee),Lm=M(10,e=>Im(e,e._.al&&e.e!==e._.a5&&e.e===e._.ap?0:1),3),Rm=M(9,e=>up(e.c,e.e===e._.a5&&e._.a9===`term`?e._.a7:null),3),zm=Ze(2,31,4,e=>{ep(e.c,e.e===e._.a5),tp(e.c,cg(e)),pp(e.c,sg(e)),dp(e.c,og(e)),Fm(e),Lm(e),Cm(e),Am(e),Rm(e)}),Bm=Xe(2,Rm),Vm=Xe(2,e=>{Cm(e),Rm(e)}),Hm=Xe(2,Dm),Um=Xe(2,e=>Xf(e.c,e._.ai)),Wm=Xe(2,e=>{Qf(e.c,e._.aj),Am(e)}),Gm=Xe(2,e=>{ap(e.c,e._.al),Fm(e),Lm(e)}),Km=Ze(2,51,4,Lm),qm=j(4,e=>{Zf(e.c,e.e),Fm(e),Lm(e),Dm(e),Cm(e),Am(e),Rm(e)}),Jm=(e,t)=>qm(e,t[0]),Ym=D(2,(e=>`<button>${e}</button>`)(ql),(e=>` D/${e}&l`)(Jl),zee),Xm=I(`t18`,e=>k(e.d,`click`,function(){e._.ae(),e._.s?.()})),Zm=e=>{z(e.a,Kl.pageHead),z(e.b,Kl.pageHeadActions),z(e.d,Kl.iconBtn),eu(e.e),tu(e.e,16),nu(e.e),Ym(e,+!er()),Xm(e)},Qm=P(sm,Xp),$m=j(44,e=>{Um(e),Qm(e)}),eh=M(30,e=>$m(e,e.q||[e.a3])),th=j(29,e=>{dh(e,e.a3?.id),eh(e)}),nh=O(2,(e=>`<!><!><!>${e}<!>`)(ad),(e=>`b%b%b/${e}&b`)(`b%c`),Tm,Jm),rh=(e,t)=>nh(e,[t,e=>e]),ih=M(50,e=>rh(e,e.al?[e.a5,...e.an]:e.ag),3),ah=j(49,e=>{Hh(e,e.an?.[0]),ih(e)}),oh=M(43,e=>ah(e,e.ag.filter(t=>t!==e.a5))),sh=j(42,e=>{oh(e),ih(e),fm(e)}),ch=M(32,e=>sh(e,e.q?.length?e.q.filter(e=>e.status===`active`).map(e=>e.id):[e.a5])),lh=M(46,e=>e.aj[e.a5]),uh=P(im,qp),dh=j(31,e=>{ch(e),lh(e),oh(e),ih(e),zm(e),uh(e)}),fh=th,ph=P(Jp),mh=Ye(33,e=>{Bm(e),ph(e)}),hh=M(10,e=>mh(e,e.i,e.j)),gh=j(8,hh),_h=j(9,hh),vh=j(40,Hm),yh=D(1,(e=>`<header><h1>Workspaces</h1><div><!><button title=Usage>${e}</button></div></header>`)(Ql),(e=>` Db D%b D/${e}&n`)($l),Zm),bh=D(4,(e=>`<button title="New workspace">${e} New workspace</button>`)(_p),(e=>` D/${e}&l`)(vp),Gee,((e,t)=>`<button></button><div></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button>`)(Ql,_p),((e,t)=>` b b%b D/${e}&l D/${t}&l`)($l,vp),Uee),xh=M(48,e=>z(e.a,[Kl.sideNav,{[Kl.closed]:!e.ab,[Kl.page]:e.al}])),Sh=j(47,e=>{yh(e,+!e.al),bh(e,+!e.al),ih(e),xh(e),Gm(e)}),Ch=P(Yp),wh=Ye(35,e=>{R(e.a,`hidden`,e.a9===`diff`||e.a9===`manage`||e.a9===`usage`),vh(e,lg(e)),Sh(e,e.a9===`nav`),Vm(e),Ch(e)}),Th=M(13,e=>wh(e,e.l,e.m)),Eh=j(11,Th),Dh=j(12,Th),Oh=D(3,`<div></div><!><!>`,` b%`,gm),kh=A(37,e=>{Oh(e,+!!e.ab),xh(e),Pp(e)}),Ah=j(41),jh=M(39,e=>Ah(e,ug(e))),Mh=P(Np,Mp),Nh=A(38,e=>{jh(e),Mh(e)}),Ph=I(`t25`,e=>kt(e,{onMount:function(){er()&&tr().then(t=>{Nh(e,!!t)})}}));function Fh(e){z(e.c,Kl.sideList),z(e.e,Kl.sideFoot),kh(e,Kn()),Nh(e,!1),Ph(e)}var Ih=j(14,jh),Lh=j(15,I(`t24`,e=>{e.p&&kh(e,Kn())})),Rh=j(16,e=>{ch(e),eh(e)}),zh=P(cm,Zp),Bh=j(45,e=>{lh(e),Wm(e),zh(e)}),Vh=(e,t)=>Bh(e,t||{}),Hh=j(51,Km),Uh=j(18),Wh=P(Ip),Jee=j(19,e=>{wm(e),Wh(e)}),Yee=j(20),Xee=P(Lp),Zee=j(21,e=>{Em(e),Xee(e)}),Qee=P(zp),$ee=j(22,e=>{Om(e),Qee(e)}),ete=P(Bp),tte=j(23,e=>{km(e),ete(e)}),nte=P(Hp),rte=j(24,e=>{jm(e),nte(e)}),ite=j(25),ate=P(Up),ote=j(26,e=>{Mm(e),ate(e)}),Gh=P(Wp),Kh=j(27,e=>{Nm(e),Gh(e)}),qh=j(28);function Jh(e){return function(){mm(e._,null),e.c===e._._.a5?e._._.a9===`diff`?wh(e._._,`term`):e._._.x?.():(jn(e.c),e._._.t?.(e.c))}}function Yh(e){return function(){mm(e._,null),e._._.u?.(e.c)}}function Xh(e){return function(t){mm(e._,null),e._._.w(e.c,t)}}function Zh(e){return function(t){mm(e._,null),e.c===e._._.a5?(mh(e._._,t),wh(e._._,`term`)):e._._.z?.(e.c,t)}}function Qh(e){return function(t,n){mm(e._,null);let r=`${t}/${n}`;e.c===e._._.a5?e._._.x?.(r):(jn(e.c,r),e._._.t?.(e.c))}}function $h(e){return function(){mm(e._,null),e.c!==e._._.a5&&e._._.t?.(e.c)}}function eg(e){return function(){e.d!==e._._.a5&&e._._.t?.(e.d)}}function tg(e){return()=>clearTimeout(e.h)}function ng(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{mm(e,null)},150)}}function rg(e){return function(){e.e===e._.a5?e._.a9===`diff`?wh(e._,`term`):e._.x?.():(jn(e.e),e._.t?.(e.e))}}function ig(e){return function(){e._.u?.(e.e)}}function ag(e){return function(t){e._.ae(),e._.w(e.e,t)}}function og(e){return function(t){e.e===e._.a5?(mh(e._,t),wh(e._,`term`)):e._.z?.(e.e,t)}}function sg(e){return function(t,n){let r=`${t}/${n}`;e.e===e._.a5?e._.x?.(r):(jn(e.e,r),e._.t?.(e.e))}}function cg(e){return function(){e.e===e._.a5?e._.ae():(e._.ae(),e._.t?.(e.e))}}function lg(e){return()=>{e.a9===`nav`&&wh(e,`term`)}}function ug(e){return async()=>{try{e.ac?(await rr(),Nh(e,!1)):(Nh(e,await nr()),e.ac||e.o?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){Nh(e,!1),e.o?.(`Notifications failed: ${String(t.message||t)}`)}}}L(`t14`,Jh),L(`t12`,Yh),L(`t13`,Xh),L(`t16`,Zh),L(`t15`,Qh),L(`t11`,$h),L(`t10`,eg),L(`t8`,tg),L(`t9`,ng),L(`t5`,rg),L(`t3`,ig),L(`t4`,ag),L(`t7`,og),L(`t6`,sg),L(`t2`,cg),L(`t0`,lg),L(`t1`,ug);async function dg(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function fg(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function pg(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var mg=null;function hg(){return mg}function gg(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(_g(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function _g(e){if(!/[*?]/.test(e))return t=>Xr(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>Xr(e,t)}}var vg=3;function yg(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(bg(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=Sg(a,e.line_start,e.line_end,e.side),n=Cg(t);r.push(``),r.push(wg(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(wg(e.text))}}return r.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_DkvEBzS7.js","assets/_BxUEtXoQ.js","assets/_toGhOk4U.js","assets/_aTZInOPC.js","assets/_DvvBPEVw.js","assets/_WXOM1NgB.js","assets/_BTe9kCin.js","assets/_BBxOP5gd.js","assets/_BzD2dIYX.js","assets/_BkJ_AQhK.js","assets/_YirxLGS4.js","assets/_C8uWyBcH.js","assets/_BXeXVLqQ.js","assets/_BiVQf6zi.js","assets/_D7PYIcBv2.js","assets/_BbQFjjyq2.js","assets/_CjCTUQV22.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_DNm3GBFg2.js","assets/_DsxNYA3W2.js","assets/_3wpK6Da62.js","assets/_B-1aqB9k2.js","assets/_q1aoVAj_.js","assets/_Obxt4Dxo.js","assets/_C_bKIJI8.js","assets/_DNiAR62k.js","assets/_xDXEaiYG.js","assets/_BL2e2Eo7.js","assets/_CkkpgSfP.js","assets/_BMs4fTHh.js","assets/_lkmVA5Jl.js","assets/_BTAS1Dpg.js","assets/_DZU3Q5Te.js","assets/_h5G2RGPq.js","assets/_Bx-q9uoN.js","assets/_rpwoQqaU.js","assets/_CBDHZ0hg.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_oy1NiP692.js","assets/_CzJm-Kgs2.js","assets/_Dn6wx3eB2.js","assets/_Dl2UteFV2.js","assets/_Cze2fV8u2.js","assets/_hbd3yHWy2.js","assets/_CX8l12E-2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_kDIR2NR8.js","assets/_D-a9DwIr.js","assets/_DCrRdWzm.js","assets/_Da1JjXN5.js","assets/_CVUfJEVu.js","assets/_y5S8OwPt.js","assets/_DtJBxo8X.js","assets/_C2yKcodx.js","assets/_DZiGlTtq.js","assets/_J7lGcvlZ.js","assets/_DVTAwKKz.js","assets/_6akhJ5Fn.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_C0Y8EhIC.js","assets/_BJ9jTSsT2.js","assets/_GlgJPuKL2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_DyTukt_u2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_DJmEj4P02.js","assets/_DQ6NSm2p.js","assets/_XQgJphFX.js","assets/_C-nqelds.js","assets/_B4wJxefZ.js","assets/_Bj61d0ZC2.js","assets/_CX2w84Lb.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_BIa9rsaF.js","assets/_BKlDC-Tb.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_DD4eXl6W.js","assets/_CXJCHFX0.js","assets/_5wEIhz7a.js","assets/_DnGHFVcU2.js","assets/_Docc3wCS2.js","assets/_d9P0yprv2.js","assets/_DPsop69P2.js","assets/_CcrWJ_AF2.js","assets/_Dsl39Q0T2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(Ve)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Re());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Le(r.$,r.F)),i===48&&(r[a(c++)]=Re());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,ce={},E=/[\p{L}\p{N}]/gu,le=``,ue={},de={},D=xe((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(ht(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&Qt(t,e,r[t[n]=i],pt)}}),fe=xe((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||We(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),Ge(l))}}),pe=xe((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=be(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if(Qt(a,e,l||(t?t(a):void 0),$t),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);Qt(a[i],`a`,e,pt),e.f&&et(e.e,e.f,a[i].Aa)}}else l?.f&&et(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?xt:St)(e,`a`,(r?n[0]:n)||{},de[e.a.tagName]),(e.Ia||e.Ea)&&Te(e,Zt);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),O=xe(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=ht(``,n,r,i)();return(n,r)=>{let i=n[t],a=Ne(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=pt(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Ue:Be),_||(f.textContent=``));for(let e of u)We(e,f,v);return}if(p)p.forEach(Ue);else for(let e=g;e<d;e++)Ue(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)We(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:We(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=en,typeof t==`string`?Se(e,(e,r)=>n(e[t],[e,r])):Se(e,(e,r)=>n(t(e,r),[e,r]))});function me(e,t){return t?e:``}function he(e,t){return t||t===0?ge(e)+`:`+ge(t+``):``}function ge(e){return n.test(e)?e.replace(n,r):e}function _e(e){return/^on[A-Z-]/.test(e)}function ve(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ye(e){return e!=null&&e!==!1}function be(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function xe(e){return o=1,e}function Se(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Ce(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);we(a)}function we(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Te(e,t){d.push(t,e)}function Ee(){let e=d;try{s=1,Oe()}finally{c++,s=0,f=[],d=[]}p(e)}function De(e,t){h=1,xe(),p=e(p),m=t(m)}function Oe(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function ke(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Te(n,Me):Me(n))}function Ae(e,t){return je(e),((e.A||={})[t]||=new AbortController).signal}function je(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function Me(e){e.abort()}function Ne(e){return e?Array.isArray(e)?e:[e]:[]}function Pe(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function Fe(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function k(e,t,n){e[1+t]===void 0&&g(t,eee),e[1+t]=n||null}function eee(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Ie(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Le(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Re(){return v++}function ze(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function Be(e){e.N?.D?.delete(e),b(e)}function Ve(e){e.Z?.forEach(He,e);for(let t in e.A)ke(e,t)}function He(e){e.delete(this)}function Ue(e){Be(e),At(e.S,e.K)}function We(e,t,n){jt(t,n,e.S,e.K)}function Ge(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,jt(t,null,e.S,e.K)}function Ke(){x||(x=1,queueMicrotask(qe))}function qe(){requestAnimationFrame(Je),Ee()}function Je(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,Ee()}),S.port2.postMessage(0)}function A(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(Ke(),Ce(r,t,e)),i)}function Ye(e,t){let n=a(e),r=a(e+1),i=A(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function j(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function M(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Ce(i,t,e,0,i[r])}}function Xe(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Ne(e[n]);r.length&&Ce(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Ze(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Ne(e[i]);if(e.H<c&&a.length){let c=e[t];Ce(e,()=>{let t=Qe(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&($e(e,r),$e(n,r))}else for(let t of Ne(e[i]))$e(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Qe(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Ne(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function $e(e,t){e&&e.H>0&&e.H<c&&t(e)}function N(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Ce(a,n,-1)};return o._=n,o}function et(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&je(n,r)}function P(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Ce(i,e[i[r]||0],-1)}}function F(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),et(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&L(r,i),i}function tt(e,t,n){e[a(t)].T=t=>n(e,t)}function nt({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function I(e,t){return L(e,t),e=>{Te(e,t)}}function*rt(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*rt(r,t,n);else{let r=e[t[n]];n?yield*rt(r,t,n-1):yield typeof r==`function`?r():r}}}function it(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>rt(t,e).next().value;return n[Symbol.iterator]=()=>rt(t,e),n}}function at(e,...t){return L(e,it(...t))}function ot(e,t,n){C=e,ne(0,t,n)}function st(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ft(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=Fe(a,c),u&&(b[u]=a,Pe(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ft(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),ct(r)},r})})};if(t){r(t);for(let e in t)ct(ae(e))}else n({configurable:!0,set:r})}function ct(e){try{T=1,p(e.m([]),1)}finally{T=0}}function L(e,t){return ie[e]=t}function lt(e,t){return L(e,e=>n=>t(e,n)),t}function ut(e,t){return t=a(t),L(e,e=>()=>e[t])}function dt(e,t,n,r){let i=Le(e);return i._=t.e||n,ft(i,n?.F),t.b?.(i,r.namespaceURI),i}function ft(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function pt(e,t,n,r){return mt(t,dt(e,t,n,r))}function mt(e,t){return e.c&&Ce(t,e.c,-1),t}function ht(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((ce[r]||={})[1+t]||=_t(t,r))(e,n)}:e=>{ot(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function gt(e,t,n,r,i,a){return L(e,ht(e,t,n,r,i,a))}function _t(e,t){let{firstChild:n,lastChild:r}=Ie(e,t),i=document.createElementNS(t,`t`);return jt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{ot(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);ot(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function vt(e){return e||e===0?e+``:``}function R(e,t,n){yt(e,t,Ot(n))}function yt(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function z(e,t){yt(e,`class`,i(t,` `,me)||void 0)}function bt(e,t){yt(e,`style`,i(t,`;`,he)||void 0)}function B(e,t){let n=vt(t);e.data!==n&&(e.data=n)}function xt(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||Ct(i,t,n))||i.removeAttribute(t)}Tt(e,t,n,r)}function St(e,t,n,r){xt(e,t,n,r),Et(e,t,n?.content)}function Ct(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function wt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||Ct(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=_e(e)?`on-${ve(e)}`:e;r[t]||(o[t]=n[e])}Tt(e,t,o,i)}function Tt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:z(i,s);break;case`style`:bt(i,s);break;default:_e(r)?(a||=e[`I`+t]={})[ve(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||R(i,r,s)}}}function Et(e,t,n){let r=tee(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&(Qt(e,t,r,pt),r?.f&&et(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function Dt(e,t){let n=e[t],r=e[`I`+t];ue[e[`F`+t]]?.(e,t);for(let e in r)k(n,e,r[e])}function tee(e){let t=be(e);if(t&&t.a)return t}function Ot(e){if(ye(e))return e===!0?``:e+``}function kt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),Ae(e,r).onabort=()=>t.onDestroy?.())}function At(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function jt(e,t,n,r){if(e.isConnected)e.insertBefore(Mt(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Mt(e,t){return e===t?e:jt(new DocumentFragment,null,e,t)}function Nt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(E)?.length;for(;a&&E.test(r);)a--;return a?r.length:E.lastIndex}return-1}function Pt(e,t,n){let r=e[t],i=Ot(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Lt(r,t)}}function Ft(e,t,n,r,i=Pt){let a=e[t],o=Ot(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Lt(a,o):i(e,t,o)}function It(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Ut(n,Gt,r=>{let i=e[`E`+t];i&&(le=r?.inputType,i(n.value),Ee(),Lt(n,e[`G`+t]),le=``)})}function Lt(e,t){if(e.value!==t){let n=Nt(le,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function Rt(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Yt):Yt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=Ht(i,o)),e.defaultSelected=t)}r!==void 0&&Vt(i,r,o)},e)}function zt(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Yt):Yt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Vt(i,s,o),e):Rt(e,t,s)}function Bt(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=Ht(n,a);Vt(n,i,a),r(o),Ee()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Ut(n,qt,r),ree(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Vt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function Ht(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function nee(e,t,n){e.H===c&&(e[t].open=ye(n))}function ree(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Ut(e,t,n){e._=n,g(`input`,iee),e.form&&g(`reset`,Wt),T&&t(e)&&queueMicrotask(n)}function iee(e){e.target._?.(e)}function Wt(e){let t=[];for(let n of e.target.elements)n._&&Jt(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Gt(e){return e.value!==e.defaultValue}function Kt(e){return e.checked!==e.defaultChecked}function qt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function Jt(e){return e.options?qt(e):Gt(e)||Kt(e)}function Yt(e){return Ot(e)||``}function Xt(e,t){let n=ze(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,Be(n)),l.add(d),Qt(e,n.C,n.E,pt),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function Zt(e){Dt(e,`a`)}function Qt(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(Be(a),i.textContent=``),s&&We(s,o,null)):a?(s?We(s,o,a.S):o.insertBefore(i,a.S),Ue(a)):s&&(We(s,o,i),i.remove())}function $t(e,t,n,r){let i=dt(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):mt(t,i),i}function en(e,t){return t}var tn=[],nn=Symbol();function rn(e){return e[Symbol.iterator]=an,e[nn]=tn,e}function*an(){yield this,yield*this[nn]}var on={boot:`_a`},V={icon:`_b`,btn:`_c`,primary:`_d`,danger:`_e`,armed:`_f`,chip:`_g`,lane:`_h`,pr:`_i`,draft:`_j`,dim:`_k`,mono:`_l`,spacer:`_m`,dot:`_n`,working:`_o`,waiting:`_p`,idle:`_q`,off:`_r`,splitBtn:`_s`,splitPrimary:`_t _s`,splitGrow:`_u`,spin:`_v`,workSpin:`_w`};async function sn(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function cn(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var ln=[`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`],aee=1e4,oee=4e4,see=8e3,cee=5e3,lee=6e4,un,dn,fn=null,pn,mn,hn,gn,_n=0;function vn(e){dn&&e!==dn&&location.reload(),dn=e}async function yn(){try{vn((await sn(`/api/boot`)).boot)}catch{}}function bn(){clearTimeout(mn),clearTimeout(hn),hn=setTimeout(xn,oee),_n&&(_n=0,clearInterval(gn),gn=void 0)}function xn(){Sn(),!_n&&(_n=Date.now(),gn=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-_n>lee&&(_n=Date.now(),wn()),Cn(),yn(),sn(`/api/status`).then(e=>{un.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},cee))}function Sn(){clearTimeout(mn),clearTimeout(hn),fn?.close(),fn=null}function Cn(){for(let e of[`workspaces.changed`,`sessions.changed`])un.dispatchEvent(new MessageEvent(e,{data:null}))}function wn(){if(fn)return;let e=fn=new EventSource(`/api/events`);clearTimeout(mn),mn=setTimeout(xn,see),e.addEventListener(`hello`,e=>{bn(),vn(JSON.parse(e.data||`{}`).boot)}),e.addEventListener(`ping`,bn);for(let t of ln)e.addEventListener(t,e=>{bn(),un.dispatchEvent(new MessageEvent(t,{data:JSON.parse(e.data||`null`)}))})}function Tn(){return un||(un=new EventTarget,wn(),yn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(pn),wn(),yn(),Cn()):(clearTimeout(pn),pn=setTimeout(()=>{_n||Sn()},aee))})),un}var En=null,Dn=null,On=null,kn=new EventTarget;function An(e,t){kn.addEventListener(`intent`,e,{signal:t})}function jn(e,t){En={workspaceId:e,pr:t},kn.dispatchEvent(new Event(`intent`))}function Mn(e){if(En?.workspaceId!==e)return!1;let t=En.pr;return En=null,{pr:t}}function Nn(e,t){Dn=[e,t],kn.dispatchEvent(new Event(`intent`))}function Pn(e){if(Dn?.[0]!==e)return null;let t=Dn[1];return Dn=null,t}function Fn(e){On=e,kn.dispatchEvent(new Event(`intent`))}function In(e){return On===e&&(On=null,!0)}function Ln(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Rn=new Map,zn=new Set,Bn;function Vn(e){for(let[t,n]of Object.entries(e))zn.has(t)||Rn.set(t,n);typeof window<`u`&&(Bn??=Promise.resolve())}function Hn(e){return Rn.get(e)??null}function Un(e,t){zn.add(e),t===null?Rn.delete(e):Rn.set(e,t),Wn(e,t)}function Wn(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function Gn(e){Un(`last-workspace`,e)}function Kn(){return Hn(`side-nav`)!==`0`}function qn(e){Un(`side-nav`,e?`1`:`0`)}function Jn(e){return Hn(`tab:${e}`)}function Yn(e,t){Un(`tab:${e}`,t)}function Xn(){return Hn(`diff-tree`)!==`0`}function Zn(e){Un(`diff-tree`,e?`1`:`0`)}function Qn(){return Hn(`diff-uncommitted`)===`1`}function $n(e){Un(`diff-uncommitted`,e?`1`:`0`)}function er(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function tr(){return er()?(await ar()).pushManager.getSubscription():null}async function nr(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await ar(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await sn(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:or(n)})}return await sn(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function rr(){let e=await tr();e&&(await sn(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function ir(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function ar(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function or(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function sr(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function cr(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function lr(){return typeof navigator<`u`&&navigator.standalone===!0}function ur(e){if(!lr()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var dr={toast:`_2`,toastFloat:`_3`,toastInline:`_4`,toastError:`_5`,toastTitle:`_6`,toastWarn:`_7`,toastInfo:`_8`,toastBody:`_9`,toastContent:`__`,toastActions:`_ba`,toastDismiss:`_bb _cb`},fr=`<div><div><!><!></div><!></div>`,pr=` D D%b%l%l`,uee=I(`v0`,e=>k(e.a,`click`,function(){e._._.o?.()})),mr=e=>{z(e.a,dr.toastDismiss),uee(e)},hr=pe(0),gr=F(26,e=>hr(e,e._._.n),e=>e._._),_r=D(1,`<!><!><!>`,`b%`,gr),vr=N(4,0,e=>_r(e,+!e._.m)),yr=e=>{vr._(e),xr._(e),z(e.a,dr.toastActions)},br=D(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,mr),xr=N(4,0,e=>br(e,+!e._.o)),Sr=pe(1),Cr=N(3,0,e=>Sr(e,e._.l)),wr=e=>{Cr._(e),z(e.a,dr.toastContent)},Tr=N(2,0,e=>B(e.b,e._.j)),Er=e=>{Tr._(e),z(e.a,dr.toastTitle)},Dr=M(22,e=>z(e.a,[dr.toast,e.u,e.v,e.k]),2),Or=j(20,Dr),kr=(e,t)=>{R(e.a,`role`,t===`error`?`alert`:`status`),Or(e,{error:dr.toastError,warn:dr.toastWarn,info:dr.toastInfo}[t])},Ar=(e,t)=>kr(e,t||`error`),jr=j(21,Dr),Mr=M(19,I(`v1`,e=>kt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`[data-palette]:not([data-inline])`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Nr=j(18,e=>{jr(e,{float:dr.toastFloat,inline:dr.toastInline}[e.s]),Mr(e)}),Pr=(e,t)=>Nr(e,t||`float`),Fr=j(10,Dr),Ir=I(`v2`,e=>Dt(e,`a`)),Lr=j(16,e=>{wt(e,`a`,e.q,{class:1,role:1}),Ir(e)});function Rr(e){z(e.b,dr.toastBody)}var zr=D(2,`<strong> </strong>`,` D `,Er),Br=j(9,e=>{zr(e,+!e.j),Tr(e)}),Vr=D(3,`<div><!></div>`,` D%`,wr),Hr=j(11,e=>{Vr(e,+!e.l),Cr(e)}),Ur=D(4,`<div><!><!></div>`,` D%b%`,yr),Wr=M(15,e=>Ur(e,e.m||e.o?0:1)),Gr=j(12,e=>{qr(e,e.m?.content),Wr(e),vr(e)}),Kr=j(14,e=>{Wr(e),Mr(e),xr(e)}),qr=j(13,P(gr));function Jr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:Xr(n,a)?400+o:r.includes(n)?300:Xr(n,r)?100:-1}function Yr(e,t,n){return e?t.map(t=>({repo:t,score:Jr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function Xr(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function Zr(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function Qr(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var $r={paletteBackdrop:`_y`,palette:`_z`,inline:`_A`,rows:`_B`,rowWrap:`_C`,row:`_D`,rowMore:`_E`,hi:`_F`,archived:`_G`,cmdRow:`_H`,onboard:`_I`,rowName:`_J`,rowNameText:`_K`,rowStats:`_L`,open:`_M`,stat:`_N`,rowRepos:`_O`,paletteFoot:`_P`,hint:`_Q`,archivedLink:`_R`,newSessionPop:`_S`},ei=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,ti=` D l`,dee=(e,t)=>{R(e.a,`width`,t),R(e.a,`height`,t)},ni=(e,t)=>dee(e,t??15),ri=(e,t)=>z(e.a,[V.icon,t]),ii=(e,t)=>R(e.b,`d`,t),ai=ei,oi=(e=>`/${e}&`)(ti);function si(e){ii(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var ci=(e,t)=>ni(e.a,t),li=(e,t)=>ri(e.a,t),ui=ei,di=(e=>`/${e}&`)(ti);function fi(e){ii(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var pi=(e,t)=>ni(e.a,t),mi=(e,t)=>ri(e.a,t),hi=ei,gi=(e=>`/${e}&`)(ti);function _i(e){ii(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var vi=(e,t)=>ni(e.a,t),yi=(e,t)=>ri(e.a,t),bi=`<!><!><!>`,xi={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},Si=N(0,1,e=>ni(e.a,e._.d)),Ci=e=>{Si._(e),wi._(e),ii(e.a,`M5 7L10 12L5 17 M13 17H20`)},wi=N(0,1,e=>ri(e.a,e._.f)),Ti=N(0,0,e=>z(e.a,[V.icon,e._.f])),Ei=e=>{Ti._(e),Di._(e),Oi._(e)},Di=N(0,0,e=>{R(e.a,`width`,e._.g),R(e.a,`height`,e._.g)}),Oi=N(0,0,e=>R(e.b,`d`,e._.h)),ki=j(6,Di),Ai=j(3,e=>{ki(e,e.d??15),Si(e)}),ji=D(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,Ei,ei,(e=>`/${e}&`)(ti),Ci),Mi=j(7,e=>{ji(e,+!e.h),Oi(e)}),Ni=(e,t)=>Mi(e,xi[t]),Pi=j(5,e=>{Ti(e),wi(e)}),Fi=`<!><!><div data-palette role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,Ii=`b%b D%b b b%b Db b%m`,Li=(e,t)=>{R(e.a,`value`,t),B(e.b,t)},Ri=(e,t)=>Li(e,t[0]),zi=e=>z(e.a,V.mono),Bi=(e,t)=>B(e.b,t),Vi=(e,t)=>Bi(e,t[0]?.worktree),Hi=e=>z(e.a,V.chip),Ui=e=>z(e.a,[V.chip,$r.open]),Wi=N(8,0,e=>{R(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),B(e.b,e._.u),B(e.c,e._.u===1?``:`s`)}),Gi=e=>{Wi._(e),z(e.a,[V.chip,$r.stat])},Ki=N(9,0,e=>R(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
3
+ `))),qi=e=>{Ki._(e),Ji._(e),z(e.a,[V.chip,$r.stat])},Ji=N(9,0,e=>B(e.b,e._.s)),Yi=M(2,e=>R(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),Xi=N(7,0,e=>{B(e.b,e._.o),Yi(e)}),Zi=e=>{Xi._(e),Qi._(e),$i._(e),z(e.a,[V.chip,$r.stat])},Qi=N(7,0,Yi),$i=N(7,0,Yi),ea=e=>z(e.a,$r.rowName),ta=N(1,1,e=>B(e.b,e._.h)),na=e=>{ta._(e),z(e.a,[$r.rowName,$r.cmdRow])},ra=e=>z(e.a,$r.onboard),ia=M(2,e=>B(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),aa=N(5,0,ia),oa=I(`o8`,e=>k(e.a,`click`,function(){zo(e._,!e._.af)})),sa=e=>{aa._(e),ca._(e),z(e.a,$r.archivedLink),oa(e)},ca=N(5,0,ia),la=N(8,0,e=>zt(e,`b`,e._.aa?.preferredAgent,Jo(e))),ua=I(`o9`,e=>Bt(e,`b`)),da=e=>{la._(e),pa._(e),z(e.a,V.dim),ua(e)},fa=O(1,`<option> </option>`,` D `,0,Ri),pa=N(8,0,e=>fa(e,[e._.ad,e=>e])),ma=I(`o4`,e=>k(e.a,`click`,function(){fo(e._,!1)})),ha=e=>{z(e.a,$r.paletteBackdrop),ma(e)},ga=I(`o5`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),_a=e=>{e.b,Ai(e.b,14),Pi(e.b),ga(e)},va=j(4,e=>{Ni(e.b,e.e),B(e.c,e.e)}),ya=O(6,(e=>`<button>${e}<!></button>`)(bi),(e=>` D/${e}&%l`)(`b%c`),_a,(e,t)=>va(e,t[0])),ba=F(59,e=>ya(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),xa=(e,t)=>{R(e.e,`popovertarget`,t),R(e.g,`id`,t)},Sa=I(`o6`,e=>{k(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),k(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),k(e.e,`click`,function(e){e.stopPropagation()}),k(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),Ca=e=>{ba(e),z(e.a,$r.rowMore),si(e.b),ci(e.b,13),li(e.b),z(e.c,$r.rowMore),fi(e.d),pi(e.d,13),mi(e.d),z(e.e,$r.rowMore),_i(e.f),vi(e.f,13),yi(e.f),z(e.g,$r.newSessionPop),xa(e,nt(e)),Sa(e)},wa=D(4,`<span>open</span>`,` `,Ui),Ta=M(21,e=>wa(e,e._.j===e._._.v?0:1)),Ea=F(57,Ta,e=>e._._),Da=e=>{Ea(e),Aa(e),Ma._(e),Na._(e),Pa._(e),La._(e),z(e.a,$r.rowName),z(e.c,$r.rowNameText),z(e.g,$r.rowStats),z(e.k,$r.rowRepos)},Oa=(e,t)=>{z(e.b,[V.dot,V[Zr(t)]]),za(e,t?.repos),Va(e,t?.agents),Ha(e,t?.working),Ua(e,t?.waiting),Ga(e,t?.ports)},ka=M(22,e=>Oa(e,e._._.a6[e._.j])),Aa=F(58,ka,e=>e._._),ja=D(5,`<span>archived</span>`,` `,Hi),Ma=N(1,2,e=>ja(e,+!e._.g)),Na=N(1,2,e=>{ka(e),Ta(e)}),Pa=N(1,2,e=>B(e.d,e._.k)),Fa=O(10,`<span> </span>`,` D `,zi,Vi),Ia=M(13,e=>Fa(e,[e.m||e._.l,`full_name`])),La=N(1,2,Ia),Ra=(e,t)=>Ja(e,t?.length),za=j(12,e=>{Ra(e,(e.m||[]).flatMap(e=>e.prs||[])),Ia(e)}),Ba=D(7,`<span> </span>`,` D `,Zi),Va=j(14,e=>{Ba(e,+!e.o),Xi(e)}),Ha=j(15,Qi),Ua=j(16,$i),Wa=D(9,`<span>:<!></span>`,` Db%`,qi),Ga=j(17,e=>{Ka(e,e.r?.length),Wa(e,+!(e.r||[]).length),Ki(e)}),Ka=j(18,Ji),qa=D(8,`<span><!> PR<!></span>`,` D%c%`,Gi),Ja=j(20,e=>{qa(e,+!e.u),Wi(e)}),Ya=M(13,e=>z(e.b,[$r.row,{[$r.hi]:e.m===e._.as,[$r.archived]:e.f===`ws`&&e.g}]),3),Xa=Xe(4,Ya),Za=I(`o7`,e=>{k(e.b,`click`,function(){e._.au(e.e)}),k(e.b,`mouseenter`,function(){Ro(e._,e.m)})}),Qa=e=>{Xa._(e),z(e.a,$r.rowWrap),Za(e)},$a=D(1,`<span>+ New workspace</span>`,` `,ea,`<span>▸ <!></span>`,` Db%`,na,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,Da),eo=D(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto></div>`)(ai,ui,hi),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(oi,di,gi),Ca),to=j(5,e=>{$a(e,e.f===`new`?0:e.f===`cmd`?1:2),eo(e,e.f===`ws`?0:1),Ya(e)}),no=j(6,e=>{Ya(e),Ma(e)}),ro=j(12,Ya),io=(e,t)=>{ao(e,t[0]),ro(e,t[1])},ao=j(4,e=>{to(e,e.e?.kind),no(e,e.e?.archived),oo(e,e.e?.label),so(e,e.e?.ws)}),oo=j(7,ta),so=j(8,e=>{co(e,e.i?.id),lo(e,e.i?.name),uo(e,e.i?.repos)}),co=j(9,Na),lo=j(10,Pa),uo=j(11,La),fo=Ye(19),po=M(13,e=>fo(e,e.l,e.m)),mo=j(11,po),ho=j(12,po),go=O(4,`<li><div><button></button><!></div></li>`,`D D b%`,Qa,io),_o=M(55,I(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&Ro(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),vo=j(51,e=>{yee(e,e.ap.length),go(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),_o(e)}),yo=M(50,e=>vo(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),bo=j(46,yo),xo=j(49,yo),So=M(48,e=>xo(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&Xr(e.a8||``,t.label))),5),Co=D(5,`<button> </button>`,` D `,sa),wo=M(45,e=>Co(e,e.ai&&!e.a8?0:1)),To=Ye(34,e=>{Ft(e,`d`,e.a8||``,Xo(e)),bo(e,Yo(e)),So(e),yo(e),wo(e)}),Eo=M(16,e=>To(e,e.o,e.p)),Do=j(14,Eo),Oo=j(15,Eo),ko=D(8,`<label><select aria-label="Preferred agent"></select></label>`,` D `,da),Ao=Ye(36,e=>{jo(e,e.aa?.preferredAgent),Mo(e,e.aa?.agents),ko(e,+!e.aa),la(e)}),jo=j(38,So),Mo=j(39,pa),No=M(19,e=>Ao(e,e.r,e.s)),Po=j(17,e=>{Oee(e,e.r?.agents),No(e)}),Fo=j(18,No),Io=j(54,e=>{_o(e),Xa(e)}),Lo=M(53,e=>Io(e,Math.min(e.ae,e.aq-1))),Ro=A(40,Lo),zo=A(41,e=>{yo(e),aa(e)}),Bo=I(`o10`,e=>{It(e,`d`),k(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),Ro(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),Ro(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function Vo(e){z(e.e,$r.rows),z(e.g,$r.paletteFoot),z(e.h,$r.hint),Ro(e,0),zo(e,!1),Bo(e)}var Ho=j(42,yo),Uo=j(43,e=>{pee(e,e.ah?.length),yo(e)}),Wo=j(47,So),Go=M(22,e=>Wo(e,e.u.find(t=>t.id===e.v))),fee=j(20,e=>{Dee(e,e.u?.length),Ho(e,e.u.filter(e=>e.status===`active`)),Uo(e,e.u.filter(e=>e.status===`archived`)),Go(e)}),pee=j(44,e=>{wo(e),ca(e)}),mee=P(Ea),hee=j(21,e=>{Go(e),_o(e),mee(e)}),gee=j(23,So),_ee=j(24,So),vee=j(25,So),yee=j(52,Lo),bee=j(56),Ko=M(28,e=>bee(e,Zo(e))),xee=j(26,Ko),See=j(27,Ko),Cee=D(0,`<div></div>`,` `,ha),wee=D(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ra),qo=M(31,e=>wee(e,e.a3&&!e.a4?0:1)),Tee=I(`o11`,e=>k(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),fo(e,!1)))}))),Eee=j(29,e=>{z(e.b,[$r.palette,{[$r.inline]:e.a3}]),R(e.b,`data-inline`,e.a3?``:void 0),Cee(e,+!!e.a3),qo(e),Tee(e)}),Dee=j(30,qo),Oee=j(33,P(ba)),kee=j(32,P(Aa));function Jo(e){return function(t){Ao(e._,{...e._.aa,preferredAgent:t}),sn(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function Yo(e){return t=>t.filter(t=>Xr(e.a8||``,t.name))}function Xo(e){return function(t){To(e,t),Ro(e,0)}}function Zo(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}L(`o1`,Jo),L(`o2`,Yo),L(`o0`,Xo),L(`o3`,Zo);var Qo={page:`_bc`,body:`_bd`,content:`_be`,pageHead:`_bf`,backBtn:`_bg`,pageHeadText:`_bh`,pageMeta:`_bi`,actions:`_bj`,barPrimary:`_bk`,iconBtn:`_bl _cb`,spinning:`_bm _cc`,field:`_bn`,section:`_bo`,reposHead:`_bp`,curRepos:`_bq`,curRepo:`_br`,curFull:`_bs`,curBase:`_bt`,curRemove:`_bu`,emptyNote:`_bv`,steps:`_bw`,active:`_bx`,stepDone:`_by`},$o=ei,es=(e=>`/${e}&`)(ti);function ts(e){ii(e.a,`M15 6L9 12L15 18`)}var ns=(e,t)=>ni(e.a,t),rs=(e,t)=>ri(e.a,t),is=ei,as=(e=>`/${e}&`)(ti);function os(e){ii(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var ss=(e,t)=>ni(e.a,t),cs=(e,t)=>ri(e.a,t),ls={addRepo:`_d8`,repoResults:`_d9`,resultWrap:`_d_`,hi:`_ea`,resultRow:`_eb`,resultBranch:`_ec`,on:`_ed`,branchPick:`_ee`,branchList:`_ef`,resultPlus:`_eg`,repoName:`_eh`,emptyNote:`_ei`},us=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,ds=` D b%b%l`,fs=null,ps=e=>z(e.a,ls.emptyNote),ms=e=>{z(e.a,ls.emptyNote),z(e.b,V.spin)},hs=e=>z(e.a,ls.emptyNote),gs=I(`q7`,e=>k(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),_s=e=>{z(e.a,ls.resultRow),z(e.b,[ls.repoName,V.mono]),gs(e)},vs=j(4,e=>B(e.c,e.e)),ys=(e,t)=>vs(e,t[0]),bs=F(35,e=>Ft(e,`a`,e._._._._._.a0,Dc(e)),e=>e._._._._._),xs=I(`q6`,e=>It(e,`a`)),Ss=e=>{bs(e),xs(e)},Cs=O(2,`<li><button><span> </span></button></li>`,`D D D `,_s,ys),ws=(e,t)=>{Ms(e,t?.length),Cs(e,[t,e=>e])},Ts=M(6,e=>ws(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),Es=F(33,Ts,e=>e._._._._),Ds=e=>{Es(e),ks(e),As(e),z(e.b,ls.branchList)},Os=D(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,Ss),ks=F(34,e=>Os(e,e._._._._.z>8?0:1),e=>e._._._._),As=F(35,Ts,e=>e._._._._),js=D(3,`<li><p>No branches match.</p></li>`,`D `,ps),Ms=(e,t)=>js(e,+!!t),Ns=D(0,`<p><span></span> Loading branches…</p>`,` D `,ms,`<!><!><ul><!><!></ul>`,`b%b D%b%`,Ds),Ps=F(33,e=>Ns(e,+!!e._._._.y),e=>e._._._),Fs=e=>{Ps(e),z(e.a,ls.branchPick)},Is=M(12,e=>z(e.a,[ls.resultWrap,{[ls.hi]:e.l===e._._.r}])),Ls=F(30,Is,e=>e._._),Rs=I(`q8`,e=>{k(e.a,`mouseenter`,function(){cc(e._._,e.l)}),k(e.b,`click`,function(){e._._.a1(e.j)}),k(e.f,`click`,function(){e._._.a2(e.j)})}),zs=e=>{Ls(e),Hs(e),z(e.b,ls.resultRow),_i(e.c),vi(e.c,12),yi(e.c,ls.resultPlus),z(e.d,ls.repoName),Rs(e)},Bs=D(6,`<div></div>`,` `,Fs),Vs=M(10,e=>{z(e.f,[ls.resultBranch,{[ls.on]:e._._.w===e.j}]),Bs(e,e._._.w===e.j?0:1)}),Hs=F(32,Vs,e=>e._._),Us=j(11,Is),Ws=j(9,e=>{B(e.e,e.j),R(e.f,`title`,`Pick a base branch for ${e.j}`),R(e.f,`aria-label`,`Pick a base branch for ${e.j}`),Vs(e)}),Gs=O(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(hi),(e=>`D D D/${e}& D m l%l`)(gi),zs,(e,t)=>{Ws(e,t[0]?.nameWithOwner),Us(e,t[1])}),Ks=N(3,0,e=>Gs(e,[e._.t,`nameWithOwner`])),qs=e=>{Ks._(e),z(e.a,ls.repoResults)},Js=N(3,1,e=>B(e.b,e._.o)),Ys=e=>{Js._(e),z(e.a,ls.emptyNote)},Xs=Ye(8),Zs=M(8,e=>Xs(e,e.g,e.h)),Qs=j(6,Zs),$s=j(7,Zs),ec=j(19,e=>{xc(e,e.t?.length),Ks(e)}),tc=M(16,e=>ec(e,e.n&&e.o?Yr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),nc=D(2,`<p>Loading repos…</p>`,` `,hs),rc=M(15,e=>nc(e,e.o&&!e.n?0:1)),ic=D(3,`<ul></ul>`,` `,qs,`<p>No repos match "<!>".</p>`,` Db%`,Ys),ac=M(21,e=>ic(e,e.u?0:e.o&&e.n?1:2),2),oc=A(13,e=>{tc(e),rc(e),ac(e)}),sc=A(14,e=>{Ft(e,`b`,e.o,Oc(e)),tc(e),rc(e),ac(e),Js(e)}),cc=A(17,P(Ls)),lc=j(28),uc=M(23,e=>lc(e,kc(e))),dc=P(Hs),fc=A(22,e=>{uc(e),dc(e)}),pc=P(Ps,Es),mc=A(24,e=>{Cc(e,e.y?.length),pc(e)}),hc=A(26,P(As,bs)),gc=I(`q9`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),cc(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),cc(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),sc(e,``))})});function _c(e){z(e.a,ls.addRepo),oc(e,null),sc(e,``),cc(e,0),fc(e,null),mc(e,null),hc(e,``),gc(e)}var vc=I(`q10`,e=>kt(e,{onMount:function(){fs&&oc(e,fs),e.s(!1)}})),yc=j(18,e=>{ee(e,Ac(e)),vc(e)}),bc=j(9,e=>{yc(e,jc(e)),uc(e)}),xc=j(20,ac),Sc=j(10,tc),Cc=j(25,P(ks)),wc=j(27),Tc=j(11,e=>wc(e,Mc(e))),Ec=(e,t)=>R(e.b,`disabled`,t);function Dc(e){return t=>{hc(e._._._._._,t)}}function Oc(e){return function(t){sc(e,t),cc(e,0)}}function kc(e){return async t=>{if(e.w===t){fc(e,null);return}fc(e,t),mc(e,null),hc(e,``);try{let n=await sn(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&mc(e,n.branches)}catch(t){fc(e,null),e.j?.(String(t.message||t))}}}function Ac(e){return()=>e.s(!0)}function jc(e){return async t=>{t&&Xs(e,!0);try{let n=await sn(`/api/repos${t?`?refresh`:``}`);fs=n,oc(e,n)}catch(t){e.j?.(String(t.message||t))}t&&Xs(e,!1)}}function Mc(e){return(t,n)=>{sc(e,``),fc(e,null),e.l(t,n)}}L(`q1`,Dc),L(`q0`,Oc),L(`q5`,kc),L(`q2`,Ac),L(`q3`,jc),L(`q4`,Mc);var Nc=((e,t,n)=>`<div role=region><div><div><header><button type=button title=Cancel aria-label=Cancel>${e}</button><div><h1>New workspace</h1><p>Name the space and pick repos to work in.</p></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div><h2>Repos</h2><button title="Refresh repo list" aria-label="Refresh repo list">${t}</button></div><ul><!><!></ul>${n}</section><!><div><button type=button> </button></div></div></div></div>`)($o,is,us),Pc=((e,t,n)=>` D D D D D/${e}&l D b m%b Db l D Db D/${t}&m D%b%l0${n}&l%b D D p`)(es,as,ds),Fc=e=>z(e.a,Qo.stepDone),Ic=e=>z(e.a,V.spin),Lc=e=>z(e.a,Qo.emptyNote),Rc=N(3,0,e=>B(e.b,e._.i)),zc=e=>{Rc._(e),z(e.a,[Qo.curBase,V.mono])},Bc=D(1,`<span></span>`,` `,Ic,`<span>✓</span>`,` `,Fc),Vc=F(54,e=>{z(e.a,{[Qo.active]:e.M===e._._.ab-1}),Bc(e,e.M===e._._.ab-1?0:1)},e=>e._._),Hc=Vc,Uc=(e,t)=>B(e.c,t),Wc=O(0,`<li><!><!></li>`,` D%b%`,Hc,(e,t)=>Uc(e,t[0])),Gc=N(21,0,e=>Wc(e,[e._.aa])),Kc=e=>{Gc._(e),z(e.a,Qo.steps)},qc=F(52,e=>B(e.a,e._._.a9),e=>e._._),Jc=gt(`m9`,` `,` `,qc),Yc=e=>{Rr(e.a),Hr(e.a,Jc(e)),Pr(e.a,`inline`),Kr(e.a,Il(e)),Gr(e.a),Fr(e.a),Ar(e.a),Br(e.a),Lr(e.a,{})},Xc=Xe(17,e=>R(e.e,`disabled`,e._.a7)),Zc=I(`m10`,e=>k(e.e,`click`,function(){e._.al(e.h)})),Qc=e=>{Xc._(e),z(e.a,Qo.curRepo),z(e.b,Qo.curFull),z(e.e,Qo.curRemove),Zc(e)},$c=j(7,e=>{B(e.c,e.h),R(e.e,`title`,`Remove ${e.h}`)}),el=D(3,`<span title="Base branch">⎇ <!></span>`,` Db%`,zc),tl=j(8,e=>{el(e,+!e.i),Rc(e)}),nl=(e,t)=>{$c(e,t[0]?.fullName),tl(e,t[0]?.baseBranch)},rl=it(50),il=j(48),al=M(45,e=>il(e,Ll(e)),5),ol=M(34,e=>R(e.x,`disabled`,e.a7||!e.a3.trim())),sl=A(29,e=>{Ft(e,`l`,e.a3,Rl(e)),al(e),ol(e)}),cl=A(30,e=>{z(e.o,[Qo.iconBtn,{[Qo.spinning]:e.a4}]),R(e.o,`disabled`,e.a4)}),ll=j(46,e=>Tc(e.t,zl(e))),ul=j(47),dl=O(17,`<li><span> </span><!><button>×</button></li>`,` D D l%b `,Qc,nl),fl=A(31,e=>{Sc(e.t,new Set(e.a5.map(e=>e.fullName))),Ol(e,e.a5?.length),ll(e,Bl(e)),ul(e,Vl(e)),dl(e,[e.a5,`fullName`]),al(e)}),pl=M(44,I(`m13`,e=>kt(e,{busy:e.a7,onMount:function(){let t=new AbortController;return Tn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.ah([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),ml=D(21,`<ul></ul>`,` `,Kc),hl=M(38,e=>ml(e,e.a7&&e.ab?0:1)),gl=A(33,e=>{R(e.e,`disabled`,e.a7),R(e.l,`disabled`,e.a7),Ec(e.t,e.a7),B(e.y,e.a7?`Creating…`:`Create workspace`),pl(e),hl(e),ol(e),Xc(e)}),_l=D(9,fr,(e=>`/${e}&`)(pr),Yc),vl=P(qc),yl=A(35,e=>{_l(e,+!e.a9),vl(e)}),bl=j(43,e=>{pl(e),al(e)}),xl=M(42,e=>bl(e,Hl(e)),2),Sl=A(36,e=>{Al(e,e.aa?.length),xl(e),Gc(e)}),Cl=(e,t)=>{jl(e,t.op),Ml(e,t.last)},wl=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},Tl=I(`m12`,e=>{k(e.a,`keydown`,function(t){t.key===`Escape`&&!e.a7&&(t.preventDefault(),e.a2?.())}),k(e.e,`click`,function(){e.a2?.()}),It(e,`l`),k(e.o,`click`,function(){rl(e)()}),k(e.x,`click`,function(){e.am()})});function El(e){z(e.a,Qo.page),z(e.b,Qo.body),z(e.c,Qo.content),z(e.d,Qo.pageHead),z(e.e,[Qo.iconBtn,Qo.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,Qo.pageHeadText),z(e.i,Qo.pageMeta),z(e.k,Qo.field),z(e.m,Qo.section),z(e.n,Qo.reposHead),os(e.p),ss(e.p,14),cs(e.p),z(e.q,Qo.curRepos),tt(e,19,Pl),_c(e.t),bc(e.t,Wl(e)),$s(e.t,Ul(e)),Qs(e.t),z(e.w,Qo.actions),z(e.x,[V.btn,V.primary,Qo.barPrimary]),sl(e,``),cl(e,!1),fl(e,[]),gl(e,!1),yl(e,null),Sl(e,[]),Cl(e,{last:0,op:``}),wl(e,nt(e)),Tl(e)}var Dl=D(18,`<li>No repos yet — search below to add one (or create empty).</li>`,` `,Lc),Ol=j(32,e=>Dl(e,+!!e.a6)),kl=P(Vc),Al=j(37,e=>{hl(e),kl(e)}),jl=j(40,e=>{xl(e),al(e)}),Ml=j(41,e=>{xl(e),al(e)}),Nl=j(27,al),Pl=lt(`m11`,j(50)),Fl=j(28);function Il(e){return function(){yl(e._,null)}}function Ll(e){return async()=>{gl(e,!0),yl(e,null),Sl(e,[]),e.ae=Math.random().toString(36).slice(2,10);try{e.af=(await sn(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await sn(`/api/progress?since=${e.af}&op=${e.ae}`);e.ah(t.messages)}catch{}},800);try{let t=await sn(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.a3,repos:e.a5,opId:e.ae})});gl(e,!1),e.a1?.(t)}catch(t){gl(e,!1),yl(e,String(t.message||t))}finally{clearInterval(t)}}}function Rl(e){return t=>{sl(e,t)}}function zl(e){return function(t,n){e.ak(t,n)}}function Bl(e){return(t,n)=>{!t||e.a5.some(e=>e.fullName===t)||fl(e,e.a5.concat({fullName:t,baseBranch:n}))}}function Vl(e){return t=>{fl(e,e.a5.filter(e=>e.fullName!==t))}}function Hl(e){return t=>{for(let n of t)n.op===e.ae&&(n.seq&&n.seq<=e.af||(n.seq&&(e.af=n.seq),Sl(e,e.aa.concat(n.message))))}}function Ul(e){return function(t){cl(e,t)}}function Wl(e){return function(t){yl(e,t)}}L(`m5`,Il),L(`m4`,Ll),L(`m0`,Rl),L(`m6`,zl),L(`m2`,Bl),L(`m3`,Vl),L(`m1`,Hl),L(`m8`,Ul),L(`m7`,Wl);var Gl={workView:`_T`,sideWrap:`_U`,sideHidden:`_V`,navPage:`_W`,mainCol:`_X`,termArea:`_Y`,asBar:`_Z`,padInline:`_0`,emptySess:`_1`},Kl={iconBtn:`_ce _cb`,spinning:`_cf _cc`,navToggle:`_cg _cb`,notifyBtn:`_ch _cb`,sideNav:`_ci`,pageHead:`_cj`,pageHeadActions:`_ck`,sectionLabel:`_cl`,newSpaceBtn:`_cm`,page:`_cn`,sideList:`_co`,sideRail:`_cp`,sideFoot:`_cq`,footSpacer:`_cr`,on:`_cs`,closed:`_ct`,railPop:`_cu`},ql=ei,Jl=(e=>`/${e}&`)(ti);function Yl(e){ii(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var Xl=(e,t)=>ni(e.a,t),Zl=(e,t)=>ri(e.a,t),Ql=ei,$l=(e=>`/${e}&`)(ti);function eu(e){ii(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var tu=(e,t)=>ni(e.a,t),nu=(e,t)=>ri(e.a,t),ru={railBtn:`_et _cb`,current:`_eu`,railDot:`_ev`,ws:`_ew`,railPopWs:`_ex`,wsRow:`_ey`,wsBtn:`_ez`,wsActions:`_eA`,newSessionPop:`_eB`,rowIcon:`_eC`,wsText:`_eD`,wsName:`_eE`,wsMeta:`_eF`,wsOpenHint:`_eG`,statusDot:`_eH`,pageCard:`_eI`,sessTitle:`_eJ`,sessActions:`_eK`,sessRenameDot:`_eL`,sessRename:`_eM`,close:`_eN`,sess:`_eO`,armed:`_eP`,sessions:`_eQ`,sessBtn:`_eR`,sessIcon:`_eS`},iu=ei,au=(e=>`/${e}&`)(ti);function ou(e){ii(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var su=(e,t)=>ni(e.a,t),cu=(e,t)=>ri(e.a,t),lu={sideChips:`_fa`,prBtn:`_fb`,portChip:`_fc`,portOpen:`_fd`,portKill:`_fe`,rejected:`_ff`,armed:`_fg`},uu=`<!><!><!>`,du=M(9,e=>z(e.d,[lu.portKill,{[lu.armed]:e._._.h===e.i}])),fu=M(10,e=>R(e.d,`title`,e._._.h===e.i?`Really kill ${e.g}?`:`Kill ${e.g} (pid ${e.i})`),2),pu=F(15,e=>{du(e),fu(e)},e=>e._._),mu=I(`r3`,e=>{k(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.h}`,`_blank`,`noopener`)}),k(e.d,`click`,function(){e._._.h===e.i?(Uu(e._._,null),fetch(`/api/procs/${e.i}`,{method:`DELETE`}).catch(()=>{})):e._._.k(e.i)})}),hu=e=>{pu(e),z(e.a,[V.chip,lu.portChip]),z(e.b,lu.portOpen),mu(e)},gu=j(6,e=>{R(e.a,`title`,e.g),fu(e)}),_u=j(7,e=>{R(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.h}`),B(e.c,e.h)}),vu=j(8,e=>{du(e),fu(e)}),yu=(e,t)=>{gu(e,t[0]?.cmd),_u(e,t[0]?.port),vu(e,t[0]?.pid)},bu=M(12,e=>B(e.b,e._._.d(e._.c))),xu=F(4,bu,e=>e._._),Su=I(`r2`,e=>k(e.a,`click`,function(){e._._._.g?.(e._.e,e.l)})),Cu=e=>{xu(e),wu._(e),Eu._(e),Su(e)},wu=Xe(0,bu),Tu=M(10,e=>R(e.a,`title`,`${e._.e} — ${e.j}${e.h===`APPROVED`?` (approved)`:e.h===`CHANGES_REQUESTED`?` (changes requested)`:``}`),2),Eu=Xe(0,Tu),Du=M(8,e=>z(e.a,[V.chip,V.pr,lu.prBtn,{[V.draft]:e.g,[lu.rejected]:e.h===`CHANGES_REQUESTED`}])),Ou=j(6,Du),ku=j(7,e=>{B(e.d,e.h===`APPROVED`?` ✓`:e.h===`CHANGES_REQUESTED`?` ✗`:``),Du(e),Tu(e)}),Au=j(9,Tu),ju=j(11,e=>B(e.c,e.l)),Mu=O(0,`<button type=button><!>#<!><!></button>`,` D%c%b%`,Cu,(e,t)=>{Ou(e,t[0]?.isDraft),ku(e,t[0]?.reviewDecision),Au(e,t[0]?.title),ju(e,t[0]?.number)}),Nu=(e,t)=>Mu(e,[t||[],`number`]),Pu=(e,t)=>Fu(e,t[0]),Fu=j(2,e=>{Nu(e,e.c?.prs),Iu(e,e.c?.worktree),wu(e)}),Iu=j(4,Eu),Lu=j(3,P(xu)),Ru=O(1,`<!><!><!>`,`b%`,0,Pu),zu=N(0,0,e=>{Lu(e,rd(e)),Ru(e,[e._.l,`full_name`])}),Bu=e=>{zu._(e),Hu._(e),z(e.a,lu.sideChips)},Vu=O(2,`<span><button type=button>:<!></button><button type=button>×</button></span>`,` D Db%l `,hu,yu),Hu=N(0,0,e=>Vu(e,[e._.m,`port`])),Uu=A(7,P(pu)),Wu=(e,t)=>qu(e,t.timer);function Gu(e){Uu(e,null),Wu(e,{timer:0})}var Ku=j(10),qu=j(9,e=>Ku(e,id(e))),Ju=D(0,`<div><!><!></div>`,` D%b%`,Bu),Yu=M(14,e=>Ju(e,e.l.some(e=>(e.prs||[]).length)||e.n?0:1)),Xu=j(11,e=>{Yu(e),zu(e)}),Zu=(e,t)=>Xu(e,t||[]),Qu=j(12,e=>{$u(e,e.m.length),Hu(e)}),$u=j(13,Yu),ed=(e,t)=>Qu(e,t||[]),td=(e,t)=>{Zu(e,t?.repos),ed(e,t?.ports)},nd=j(6);function rd(e){return t=>{if(e._.l.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.l.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function id(e){return t=>{clearTimeout(e.j),Uu(e,t),e.j=setTimeout(()=>{Uu(e,null)},3500)}}L(`r1`,rd),L(`r0`,id);var ad=`<!><!><!>`,od=N(7,0,e=>B(e.b,e._.u)),sd=e=>{od._(e),z(e.a,ru.wsMeta)},cd=F(48,e=>Ft(e,`c`,e._._._._.a2,mp(e)),e=>e._._._._),ld=I(`s8`,e=>{It(e,`c`),k(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._._._.a4(e._.c)):t.key===`Escape`&&(t.preventDefault(),zf(e._._._._,null))}),k(e.c,`blur`,function(){e._._._._.a4(e._.c)}),kt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),ud=e=>{cd(e),dd._(e),fd._(e),e.b,Ai(e.b,13),Pi(e.b,ru.sessIcon),z(e.c,ru.sessRename),ld(e)},dd=N(0,0,e=>z(e.a,[V.dot,V[Qr(e._.g)],ru.sessRenameDot])),fd=N(0,0,e=>Ni(e.b,e._.h)),pd=M(9,e=>{z(e.i,[ru.close,{[ru.armed]:e._._._._.x===e._.d}]),R(e.i,`title`,e._._._._.x===e._.d?`Really kill this session?`:`Kill session`)}),md=F(46,pd,e=>e._._._._),hd=I(`s9`,e=>{k(e.a,`click`,function(){e._._._._.u?.(e._.d)}),k(e.g,`click`,function(){zf(e._._._._,e._.d),Vf(e._._._._,e._.i||e._.h)}),k(e.i,`click`,function(){e._._._._.x===e._.d?(Pf(e._._._._,null),e._._._._.v?.(e._.d)):e._._._._.a0(e._.d)})}),gd=e=>{md(e),_d._(e),vd._(e),bd._(e),xd._(e),z(e.a,ru.sessBtn),e.c,Ai(e.c,13),Pi(e.c,ru.sessIcon),z(e.d,ru.sessTitle),z(e.f,ru.sessActions),z(e.g,ru.rowIcon),ou(e.h),su(e.h,12),cu(e.h),hd(e)},_d=N(0,1,pd),vd=N(0,1,e=>z(e.b,[V.dot,V[Qr(e._.g)]])),yd=M(10,e=>B(e.e,e._.i||e._.h)),bd=N(0,1,e=>{Ni(e.c,e._.h),yd(e)}),xd=N(0,1,yd),Sd=M(4,e=>z(e.a,[ru.sess,{[ru.current]:e.d===e._._._.t}])),Cd=F(44,Sd,e=>e._._._),wd=e=>{Cd(e),Dd(e)},Td=D(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(bi),(e=>` b/${e}& b`)(`b%c`),ud,((e,t)=>`<button><span></span>${e}<span> </span></button><div><button title="Rename session">${t}</button><button>×</button></div>`)(bi,iu),((e,t)=>` D b/${e}& D m D D/${t}&l l`)(`b%c`,au),gd),Ed=M(5,e=>Td(e,e._._._.a1===e.d?0:1)),Dd=F(47,Ed,e=>e._._._),Od=j(3,e=>{Sd(e),Ed(e),_d(e)}),kd=(e,t)=>Ad(e,t[0]),Ad=j(2,e=>{Od(e,e.c?.id),jd(e,e.c?.state),Md(e,e.c?.agent),Nd(e,e.c?.title)}),jd=j(6,e=>{vd(e),dd(e)}),Md=j(7,e=>{bd(e),fd(e)}),Nd=j(8,xd),Pd=I(`s5`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.r?.(e.e)})),Fd=e=>{e.b,Ai(e.b,14),Pi(e.b),Pd(e)},Id=j(4,e=>{Ni(e.b,e.e),B(e.c,e.e)}),Ld=O(2,(e=>`<button>${e}<!></button>`)(bi),(e=>` D/${e}&%l`)(`b%c`),Fd,(e,t)=>Id(e,t[0])),Rd=F(43,e=>Ld(e,[[...e._._._._.s||[],`shell`],e=>e]),e=>e._._._._),zd=(e,t)=>{R(e.a,`popovertarget`,t),R(e.c,`id`,t)},Bd=I(`s6`,e=>k(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),Vd=e=>{Rd(e),z(e.a,ru.rowIcon),e.b,Ni(e.b,`shell`),Ai(e.b,12),Pi(e.b),z(e.c,ru.newSessionPop),zd(e,nt(e)),Bd(e)},Hd=I(`s4`,e=>k(e.a,`click`,function(){e._._._._.p?.()})),Ud=D(1,(e=>`<button title="Review changes">${e}</button>`)(ai),(e=>` D/${e}&l`)(oi),e=>{z(e.a,ru.rowIcon),si(e.b),ci(e.b,12),li(e.b),Hd(e)}),Wd=F(41,e=>Ud(e,+!e._._._.p),e=>e._._._),Gd=I(`s7`,e=>k(e.c,`click`,function(){e._._._.q?.()})),Kd=e=>{Wd(e),Jd(e),z(e.a,ru.wsActions),z(e.c,ru.rowIcon),fi(e.d),pi(e.d,12),mi(e.d),Gd(e)},qd=D(4,(e=>`<button title="New session">${e}</button><div popover=auto></div>`)(bi),(e=>` D/${e}&l b`)(`b%c`),Vd),Jd=F(42,e=>qd(e,+!e._._._.r),e=>e._._._),Yd=F(36,e=>B(e.b,e._._._.j?`Open`:``),e=>e._._._),Xd=e=>{Yd(e),z(e.a,ru.wsOpenHint)},Zd=M(21,e=>z(e.a,[ru.ws,{[ru.current]:e._._.j,[ru.railPopWs]:e._._.n,[ru.pageCard]:e._._.o}]),2),Qd=F(36,Zd,e=>e._._),$d=I(`s10`,e=>{k(e.a,`click`,function(t){t.target?.closest(`button, input, a, [popover]`)||e._._.k()}),k(e.c,`click`,function(){e._._.k()})}),ef=e=>{Qd(e),rf(e),af(e),lf(e),uf(e),df(e),ff._(e),gf._(e),z(e.b,ru.wsRow),z(e.c,ru.wsBtn),z(e.e,ru.wsText),z(e.f,ru.wsName),z(e.k,ru.sessions),Gu(e.m),$d(e)},tf=O(11,`<div></div>`,` `,wd,kd),nf=(e,t)=>{_f(e,t.length),vf(e,t[0]?.title),yf(e,t[0]?.agent),tf(e,[t.length>1?t:[],`id`])},rf=F(38,e=>nf(e,e._._.m||[]),e=>e._._),af=F(39,Zd,e=>e._._),of=D(7,`<span> </span>`,` D `,sd),sf=D(8,`<span> </span>`,` D `,Xd),cf=D(9,(e=>`<div><!><button title="Manage workspace">${e}</button><!></div>`)(ui),(e=>` D%b D/${e}&l%l`)(di),Kd),lf=F(40,e=>{of(e,+!e._._.o),sf(e,+!e._._.o),cf(e,+!!e._._.o),Zd(e)},e=>e._._),uf=F(45,e=>nd(e.m,e._._.w),e=>e._._),df=F(49,e=>B(e.g,e._._.a6),e=>e._._),ff=N(0,1,e=>td(e.m,e._.b)),pf=j(20,od),mf=M(19,e=>pf(e,e.o===0?e.s:e.o===1?`${e.q||e.r} · ${e.s}`:`${e.o} sessions · ${e.s}`),3),hf=j(18,mf),gf=N(0,1,e=>{z(e.d,[V.dot,V[e._.c],ru.statusDot]),hf(e,e._.c===`working`?`Working`:e._.c===`waiting`?`Needs you`:e._.c===`idle`?`Idle`:`Off`)}),_f=j(14,mf),vf=j(16,mf),yf=j(17,mf),bf=F(36,e=>z(e.a,[ru.railBtn,{[ru.current]:e._._.j}]),e=>e._._),xf=I(`s3`,e=>k(e.a,`click`,function(){e._._.k()})),Sf=e=>{bf(e),Cf(e),wf(e),Tf._(e),xf(e)},Cf=F(37,e=>B(e.b,(e._._.l??0)+1),e=>e._._),wf=F(49,e=>R(e.a,`title`,e._._.a6),e=>e._._),Tf=N(0,0,e=>z(e.c,[V.dot,V[e._.c],ru.railDot])),Ef=j(2,e=>{Tf(e),gf(e)}),Df=j(1,e=>{Ef(e,Zr(e.b)),ff(e)}),Of=M(3,e=>Df(e,e._.h[e._.f])),kf=N(0,0,Of),Af=e=>{kf._(e),jf._(e),Nf._(e)},jf=N(0,0,Of),Mf=D(0,`<button> <span></span></button>`,` D b `,Sf,(e=>`<section><div><button><span></span><span><span> </span><!></span><!></button><!></div><div><!>${e}</div></section>`)(uu),(e=>` D D D b D D l%l%l%l D%b/${e}&m`)(`b%c`),ef),Nf=N(0,0,e=>Mf(e,+!e._.i)),Pf=A(23,P(md)),Ff=(e,t)=>Wf(e,t.timer),If=j(30),Lf=M(29,e=>If(e,hp(e)),2),Rf=P(Dd),zf=A(27,e=>{Lf(e),Rf(e)}),Bf=P(cd),Vf=A(28,e=>{Lf(e),Bf(e)});function Hf(e){Pf(e,null),Ff(e,{timer:0}),zf(e,null),Vf(e,``)}var Uf=j(26),Wf=j(25,e=>Uf(e,gp(e))),Gf=j(3,Lf),Kf=D(0,`<!><!><!>`,`b%`,Af),qf=(e,t)=>{Jf(e,t?.name),Kf(e,+!t)},Jf=j(32,P(wf,df)),Yf=M(6,e=>qf(e,e.e.find(t=>t.id===e.f))),Xf=j(4,Yf),Zf=j(5,e=>{Yf(e),kf(e)}),Qf=j(7,jf),$f=j(8,Nf),ep=j(9,P(bf,Qd,Yd)),tp=j(10),np=j(11,P(Cf)),rp=j(12,P(rf)),ip=j(13,P(af)),ap=j(14,P(lf)),op=j(15,P(Wd)),sp=j(16),cp=j(17,P(Jd)),lp=j(18,P(Rd)),up=j(19,P(Cd)),dp=j(20),fp=j(21),pp=j(22,P(uf));function mp(e){return t=>{Vf(e._._._._,t)}}function hp(e){return t=>{if(e.a1!==t.id)return;let n=e.a2.trim();zf(e,null),n&&e.d?.(t,n)}}function gp(e){return t=>{clearTimeout(e.z),Pf(e,t),e.z=setTimeout(()=>{Pf(e,null)},3500)}}L(`s0`,mp),L(`s2`,hp),L(`s1`,gp);var _p=ei,vp=(e=>`/${e}&`)(ti);function yp(e){ii(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var bp=(e,t)=>ni(e.a,t),xp=(e,t)=>ri(e.a,t),Sp=ei,Cp=(e=>`/${e}&`)(ti);function wp(e){ii(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Tp=(e,t)=>ni(e.a,t),Ep=(e,t)=>ri(e.a,t),Dp=ei,Op=(e=>`/${e}&`)(ti);function kp(e){ii(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var Ap=(e,t)=>ni(e.a,t),jp=(e,t)=>ri(e.a,t),Aee=`<aside><!><div></div><!><div></div></aside>`,jee=` D%b b%b l`,Mee=e=>{kp(e.a),Ap(e.a,15),jp(e.a)},Nee=e=>{wp(e.a),Tp(e.a,15),Ep(e.a)},Pee=e=>z(e.a,Kl.sectionLabel),Fee=e=>z(e.a,Kl.sectionLabel),Mp=F(64,e=>{z(e.a,[Kl.notifyBtn,{[Kl.on]:e._._.ac}]),R(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Iee=I(`t22`,e=>k(e.a,`click`,function(){e._._.af()})),Lee=e=>{Mp(e),Yl(e.b),Xl(e.b,15),Zl(e.b),Iee(e)},Np=F(64,e=>{z(e.a,[Kl.notifyBtn,{[Kl.on]:e._._.ac}]),R(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Ree=I(`t17`,e=>k(e.a,`click`,function(){e._._.af()})),zee=e=>{Np(e),Yl(e.b),Xl(e.b,16),Zl(e.b),Ree(e)},Bee=D(0,Sp,(e=>`/${e}&`)(Cp),Nee,Dp,(e=>`/${e}&`)(Op),Mee),Pp=N(4,1,e=>{R(e.a,`title`,e._.ab?`Collapse sidebar`:`Expand sidebar`),Bee(e,+!e._.ab)}),Vee=D(2,(e=>`<button>${e}</button>`)(ql),(e=>` D/${e}&l`)(Jl),Lee),Hee=I(`t23`,e=>{k(e.a,`click`,function(){kh(e._,!e._.ab),qn(e._.ab)}),k(e.d,`click`,function(){e._.ae(),e._.s?.()}),k(e.f,`click`,function(){e._.ae(),e._.a2?.()})}),Uee=e=>{Pp._(e),z(e.a,Kl.navToggle),z(e.b,[V.spacer,Kl.footSpacer]),z(e.d,Kl.iconBtn),eu(e.e),tu(e.e,15),nu(e.e),z(e.f,Kl.iconBtn),yp(e.g),bp(e.g,16),xp(e.g),Vee(e,+!er()),Hee(e)},Wee=I(`t21`,e=>k(e.a,`click`,function(){e._.ae(),e._.a2?.()})),Gee=e=>{z(e.a,Kl.newSpaceBtn),yp(e.b),bp(e.b,16),xp(e.b),Wee(e)},Fp=M(7,e=>op(e.b,Jh(e)),4),Ip=F(53,Fp,e=>e._._),Kee=I(`t20`,e=>{k(e.a,`mouseenter`,function(){e._.i()}),k(e.a,`mouseleave`,function(){e._.j()})}),qee=e=>{Ip(e),Lp(e),zp(e),Bp(e),Hp(e),Up(e),Wp(e),qp(e),Jp(e),Yp(e),Xp(e),Zp(e),$p._(e),tm._(e),nm._(e),z(e.a,Kl.railPop),Hf(e.b),ip(e.b,!0),sp(e.b,Yh(e)),$f(e.b),np(e.b),ap(e.b),Kee(e)},Lp=F(54,e=>lp(e.b,e._._.v),e=>e._._),Rp=M(3,e=>cp(e.b,Xh(e))),zp=F(55,Rp,e=>e._._),Bp=F(56,Fp,e=>e._._),Vp=M(5,e=>rp(e.b,e.c===e._._.a5&&e._._.y?e._._.y:e._._.aj[e.c]?.sessions||[]),3),Hp=F(57,Vp,e=>e._._),Up=F(58,e=>Gf(e.b,e._._.a0),e=>e._._),Wp=F(59,e=>fp(e.b,e._._.a1),e=>e._._),Gp=M(4,e=>ep(e.b,e.c===e._._.a5)),Kp=M(6,e=>up(e.b,e.c===e._._.a5&&e._._.a9===`term`?e._._.a7:null),3),qp=F(60,e=>{tp(e.b,$h(e)),pp(e.b,Qh(e)),dp(e.b,Zh(e)),Gp(e),Fp(e),Vp(e),Kp(e)},e=>e._._),Jp=F(61,Kp,e=>e._._),Yp=F(62,e=>{Fp(e),Kp(e)},e=>e._._),Xp=F(67,e=>Xf(e.b,e._._.ai),e=>e._._),Zp=F(68,e=>{Qf(e.b,e._._.aj),Vp(e)},e=>e._._),Qp=j(2,e=>{Zf(e.b,e.c),Gp(e),Rp(e),Fp(e),Vp(e),Kp(e)}),$p=N(1,0,e=>Qp(e,e._.d)),em=M(8,e=>bt(e.a,`top:${e._.e}px;left:${e._.f}px`)),tm=N(1,0,em),nm=N(1,0,em),rm=M(4,e=>ep(e.b,e.d===e._._.a5)),im=F(60,e=>{tp(e.b,eg(e)),rm(e)},e=>e._._),am=I(`t19`,e=>{k(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();mm(e._,{id:e.d,top:r.top,left:r.right+8})}),k(e.a,`mouseleave`,function(){e._.j()})}),om=e=>{im(e),sm(e),cm(e),Hf(e.b),$f(e.b,!0),Gf(e.b),rp(e.b),ip(e.b),ap(e.b),op(e.b),sp(e.b),cp(e.b),lp(e.b),up(e.b),dp(e.b),fp(e.b),pp(e.b),am(e)},sm=F(67,e=>Xf(e.b,e._._.ai),e=>e._._),cm=F(68,e=>Qf(e.b,e._._.aj),e=>e._._),lm=(e,t)=>np(e.b,t),um=j(3,e=>{Zf(e.b,e.d),rm(e)}),dm=O(0,(e=>`<span>${e}</span>`)(ad),(e=>` D/${e}&l`)(`b%c`),om,(e,t)=>{um(e,t[0]),lm(e,t[1])}),fm=N(3,0,e=>dm(e,[e._.ag,e=>e])),pm=D(1,(e=>`<div>${e}</div>`)(ad),(e=>` D/${e}&l`)(`b%c`),qee),mm=A(2,e=>{_m(e,e.c?.id),vm(e,e.c?.top),ym(e,e.c?.left),pm(e,+!e.c)}),hm=(e,t)=>Sm(e,t.timer),gm=e=>{fm._(e),z(e.a,Kl.sideRail),mm(e,null),hm(e,{timer:0})},_m=j(3,$p),vm=j(4,tm),ym=j(5,nm),bm=j(8),xm=j(9),Sm=j(7,e=>{bm(e,tg(e)),xm(e,ng(e))}),Cm=M(11,e=>op(e.c,rg(e)),4),wm=Xe(2,Cm),Tm=e=>{wm._(e),Em._(e),Om._(e),km._(e),jm._(e),Mm._(e),Nm._(e),zm._(e),Bm._(e),Vm._(e),Hm._(e),Um._(e),Wm._(e),Gm._(e),Km._(e),Hf(e.c),sp(e.c,ig(e)),$f(e.c),np(e.c),ip(e.c)},Em=Xe(2,e=>lp(e.c,e._.v)),Dm=M(6,e=>cp(e.c,ag(e)),2),Om=Xe(2,Dm),km=Xe(2,Cm),Am=M(8,e=>rp(e.c,e.e===e._.a5&&e._.y?e._.y:e._.aj[e.e]?.sessions||[]),3),jm=Xe(2,Am),Mm=Xe(2,e=>Gf(e.c,e._.a0)),Nm=Xe(2,e=>fp(e.c,e._.a1)),Pm=D(0,`<h2>Current</h2>`,` `,Fee),Fm=M(7,e=>Pm(e,e._.al&&e.e===e._.a5?0:1),2),Im=D(1,`<h2>Other spaces</h2>`,` `,Pee),Lm=M(10,e=>Im(e,e._.al&&e.e!==e._.a5&&e.e===e._.ap?0:1),3),Rm=M(9,e=>up(e.c,e.e===e._.a5&&e._.a9===`term`?e._.a7:null),3),zm=Ze(2,31,4,e=>{ep(e.c,e.e===e._.a5),tp(e.c,cg(e)),pp(e.c,sg(e)),dp(e.c,og(e)),Fm(e),Lm(e),Cm(e),Am(e),Rm(e)}),Bm=Xe(2,Rm),Vm=Xe(2,e=>{Cm(e),Rm(e)}),Hm=Xe(2,Dm),Um=Xe(2,e=>Xf(e.c,e._.ai)),Wm=Xe(2,e=>{Qf(e.c,e._.aj),Am(e)}),Gm=Xe(2,e=>{ap(e.c,e._.al),Fm(e),Lm(e)}),Km=Ze(2,51,4,Lm),qm=j(4,e=>{Zf(e.c,e.e),Fm(e),Lm(e),Dm(e),Cm(e),Am(e),Rm(e)}),Jm=(e,t)=>qm(e,t[0]),Ym=D(2,(e=>`<button>${e}</button>`)(ql),(e=>` D/${e}&l`)(Jl),zee),Xm=I(`t18`,e=>k(e.d,`click`,function(){e._.ae(),e._.s?.()})),Zm=e=>{z(e.a,Kl.pageHead),z(e.b,Kl.pageHeadActions),z(e.d,Kl.iconBtn),eu(e.e),tu(e.e,16),nu(e.e),Ym(e,+!er()),Xm(e)},Qm=P(sm,Xp),$m=j(44,e=>{Um(e),Qm(e)}),eh=M(30,e=>$m(e,e.q||[e.a3])),th=j(29,e=>{dh(e,e.a3?.id),eh(e)}),nh=O(2,(e=>`<!><!><!>${e}<!>`)(ad),(e=>`b%b%b/${e}&b`)(`b%c`),Tm,Jm),rh=(e,t)=>nh(e,[t,e=>e]),ih=M(50,e=>rh(e,e.al?[e.a5,...e.an]:e.ag),3),ah=j(49,e=>{Hh(e,e.an?.[0]),ih(e)}),oh=M(43,e=>ah(e,e.ag.filter(t=>t!==e.a5))),sh=j(42,e=>{oh(e),ih(e),fm(e)}),ch=M(32,e=>sh(e,e.q?.length?e.q.filter(e=>e.status===`active`).map(e=>e.id):[e.a5])),lh=M(46,e=>e.aj[e.a5]),uh=P(im,qp),dh=j(31,e=>{ch(e),lh(e),oh(e),ih(e),zm(e),uh(e)}),fh=th,ph=P(Jp),mh=Ye(33,e=>{Bm(e),ph(e)}),hh=M(10,e=>mh(e,e.i,e.j)),gh=j(8,hh),_h=j(9,hh),vh=j(40,Hm),yh=D(1,(e=>`<header><h1>Workspaces</h1><div><!><button title=Usage>${e}</button></div></header>`)(Ql),(e=>` Db D%b D/${e}&n`)($l),Zm),bh=D(4,(e=>`<button title="New workspace">${e} New workspace</button>`)(_p),(e=>` D/${e}&l`)(vp),Gee,((e,t)=>`<button></button><div></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button>`)(Ql,_p),((e,t)=>` b b%b D/${e}&l D/${t}&l`)($l,vp),Uee),xh=M(48,e=>z(e.a,[Kl.sideNav,{[Kl.closed]:!e.ab,[Kl.page]:e.al}])),Sh=j(47,e=>{yh(e,+!e.al),bh(e,+!e.al),ih(e),xh(e),Gm(e)}),Ch=P(Yp),wh=Ye(35,e=>{R(e.a,`hidden`,e.a9===`diff`||e.a9===`manage`||e.a9===`usage`),vh(e,lg(e)),Sh(e,e.a9===`nav`),Vm(e),Ch(e)}),Th=M(13,e=>wh(e,e.l,e.m)),Eh=j(11,Th),Dh=j(12,Th),Oh=D(3,`<div></div><!><!>`,` b%`,gm),kh=A(37,e=>{Oh(e,+!!e.ab),xh(e),Pp(e)}),Ah=j(41),jh=M(39,e=>Ah(e,ug(e))),Mh=P(Np,Mp),Nh=A(38,e=>{jh(e),Mh(e)}),Ph=I(`t25`,e=>kt(e,{onMount:function(){er()&&tr().then(t=>{Nh(e,!!t)})}}));function Fh(e){z(e.c,Kl.sideList),z(e.e,Kl.sideFoot),kh(e,Kn()),Nh(e,!1),Ph(e)}var Ih=j(14,jh),Lh=j(15,I(`t24`,e=>{e.p&&kh(e,Kn())})),Rh=j(16,e=>{ch(e),eh(e)}),zh=P(cm,Zp),Bh=j(45,e=>{lh(e),Wm(e),zh(e)}),Vh=(e,t)=>Bh(e,t||{}),Hh=j(51,Km),Uh=j(18),Wh=P(Ip),Jee=j(19,e=>{wm(e),Wh(e)}),Yee=j(20),Xee=P(Lp),Zee=j(21,e=>{Em(e),Xee(e)}),Qee=P(zp),$ee=j(22,e=>{Om(e),Qee(e)}),ete=P(Bp),tte=j(23,e=>{km(e),ete(e)}),nte=P(Hp),rte=j(24,e=>{jm(e),nte(e)}),ite=j(25),ate=P(Up),ote=j(26,e=>{Mm(e),ate(e)}),Gh=P(Wp),Kh=j(27,e=>{Nm(e),Gh(e)}),qh=j(28);function Jh(e){return function(){mm(e._,null),e.c===e._._.a5?e._._.a9===`diff`?wh(e._._,`term`):e._._.x?.():(jn(e.c),e._._.t?.(e.c))}}function Yh(e){return function(){mm(e._,null),e._._.u?.(e.c)}}function Xh(e){return function(t){mm(e._,null),e._._.w(e.c,t)}}function Zh(e){return function(t){mm(e._,null),e.c===e._._.a5?(mh(e._._,t),wh(e._._,`term`)):e._._.z?.(e.c,t)}}function Qh(e){return function(t,n){mm(e._,null);let r=`${t}/${n}`;e.c===e._._.a5?e._._.x?.(r):(jn(e.c,r),e._._.t?.(e.c))}}function $h(e){return function(){mm(e._,null),e.c!==e._._.a5&&e._._.t?.(e.c)}}function eg(e){return function(){e.d!==e._._.a5&&e._._.t?.(e.d)}}function tg(e){return()=>clearTimeout(e.h)}function ng(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{mm(e,null)},150)}}function rg(e){return function(){e.e===e._.a5?e._.a9===`diff`?wh(e._,`term`):e._.x?.():(jn(e.e),e._.t?.(e.e))}}function ig(e){return function(){e._.u?.(e.e)}}function ag(e){return function(t){e._.ae(),e._.w(e.e,t)}}function og(e){return function(t){e.e===e._.a5?(mh(e._,t),wh(e._,`term`)):e._.z?.(e.e,t)}}function sg(e){return function(t,n){let r=`${t}/${n}`;e.e===e._.a5?e._.x?.(r):(jn(e.e,r),e._.t?.(e.e))}}function cg(e){return function(){e.e===e._.a5?e._.ae():(e._.ae(),e._.t?.(e.e))}}function lg(e){return()=>{e.a9===`nav`&&wh(e,`term`)}}function ug(e){return async()=>{try{e.ac?(await rr(),Nh(e,!1)):(Nh(e,await nr()),e.ac||e.o?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){Nh(e,!1),e.o?.(`Notifications failed: ${String(t.message||t)}`)}}}L(`t14`,Jh),L(`t12`,Yh),L(`t13`,Xh),L(`t16`,Zh),L(`t15`,Qh),L(`t11`,$h),L(`t10`,eg),L(`t8`,tg),L(`t9`,ng),L(`t5`,rg),L(`t3`,ig),L(`t4`,ag),L(`t7`,og),L(`t6`,sg),L(`t2`,cg),L(`t0`,lg),L(`t1`,ug);async function dg(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function fg(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function pg(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var mg=null;function hg(){return mg}function gg(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(_g(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function _g(e){if(!/[*?]/.test(e))return t=>Xr(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>Xr(e,t)}}var vg=3;function yg(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(bg(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=Sg(a,e.line_start,e.line_end,e.side),n=Cg(t);r.push(``),r.push(wg(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(wg(e.text))}}return r.join(`
4
4
  `)}function bg(e,t){if(!t?.head)return`${e}/`;let n=xg(t.head),r=xg(t.baseSha),i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``} — \`${i}\` ${n} vs \`${t.base}\` ${r}`}function xg(e,t=12){return e.slice(0,t)}function Sg(e,t,n,r){let i=e.split(`
5
5
  `),a=Math.max(1,t-vg),o=Math.min(i.length,n+vg),s=r===`deletions`?`-`:`+`,c=[];for(let e=a;e<=o;e++){let r=e>=t&&e<=n?s:` `;c.push(`${r}${String(e).padStart(4)} | ${i[e-1]??``}`)}return c.join(`
6
6
  `)}function Cg(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function wg(e){return e.split(`
7
7
  `).map(e=>e&&` ${e}`).join(`
8
- `)}function Tg(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var H={iconBtn:`_da _eg`,spinning:`_db _eh`,diffView:`_dc`,treeToggle:`_dd _eg`,diffTools:`_de`,on:`_df`,diffCol:`_dg`,diffHead:`_dh`,backBtn:`_di`,headText:`_dj`,pageTitle:`_dk`,headWithSend:`_dl`,findBtn:`_dm`,diffMain:`_dn`,toastMeta:`_do`,diffStats:`_dp`,scope:`_dq`,scopeOpt:`_dr`,scopeOn:`_ds`,scopeChip:`_dt`,repoSection:`_du`,repoSep:`_dv`,repoWorktree:`_dw _l`,repoTitle:`_dx _k`,repoMeta:`_dy`,files:`_dz`,file:`_dA`,diffWait:`_dB`,treeChev:`_dC`,status:`_dD`,path:`_dE`,centerPad:`_dF`,filesBtn:`_dG`,diffPad:`_dH`},Eg={headActions:`_ej`},Dg=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,Og=` D D l%l`,kg=(e,t)=>R(e.a,`value`,t),Ag=M(7,e=>B(e.b,e.f||e.g)),jg=j(5,Ag),Mg=j(6,Ag),Ng=(e,t)=>{kg(e,t[0]?.id),jg(e,t[0]?.title),Mg(e,t[0]?.agent)},Pg=N(3,1,e=>{R(e.b,`disabled`,e._.k),B(e.c,e._.k?`Sending…`:`Send to`),R(e.d,`disabled`,e._.k)}),Fg=I(`g2`,e=>{k(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){qg(e._,!0);try{await e._.i(e._.s)}finally{qg(e._,!1)}}})()}),Bt(e,`d`)}),Ig=e=>{Pg._(e),Lg._(e),zg._(e),z(e.a,V.splitPrimary),Fg(e)},Lg=N(3,1,e=>zt(e,`d`,e._.l,s_(e))),Rg=O(3,`<option> </option>`,` D `,0,Ng),zg=N(3,1,e=>Rg(e,[e._.m,`id`])),Bg=M(2,e=>B(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),Vg=N(3,0,e=>{R(e.a,`disabled`,e._.k),Bg(e)}),Hg=I(`g1`,e=>k(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){qg(e._,!0);try{await e._.i(e._.s)}finally{qg(e._,!1)}}})()})),Ug=e=>{Vg._(e),Wg._(e),Gg._(e),z(e.a,[V.btn,V.primary]),Hg(e)},Wg=N(3,0,Bg),Gg=N(3,0,Bg),Kg=A(9,e=>B(e.c,e.j?`Copied ✓`:`Copy`)),qg=A(10,e=>{Vg(e),Pg(e)}),Jg=j(18),Yg=M(13,e=>Jg(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),Xg=A(11,e=>{Yg(e),Lg(e)}),Zg=I(`g3`,e=>k(e.b,`click`,function(){(async()=>{await e.h()&&(Kg(e,!0),setTimeout(()=>{Kg(e,!1)},1500))})()}));function Qg(e){z(e.a,Eg.headActions),z(e.b,V.btn),Kg(e,!1),qg(e,!1),Xg(e,null),Zg(e)}var $g=j(12,e=>{e_(e,e.m[0]?.title),t_(e,e.m[0]?.agent),r_(e,e.m.length),Yg(e),zg(e)}),e_=j(16,Wg),t_=j(17,Gg),n_=D(3,`<button type=button> </button>`,` D `,Ug,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,Ig),r_=(e,t)=>n_(e,t===1?0:t?1:2),i_=(e,t)=>$g(e,t||[]),a_=j(7),o_=j(8);function s_(e){return t=>{Xg(e._,t)}}L(`g0`,s_);var c_=ei,l_=(e=>`/${e}&`)(ti);function u_(e){ii(e.a,`M17 17L21 21 M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z`)}var d_=(e,t)=>ni(e.a,t),f_=(e,t)=>ri(e.a,t),p_={wrap:`_ek`,fileFilter:`_el`},m_=`<div><input type=search placeholder="Filter files… (globs, !excludes)" aria-label="Filter files"></div>`,h_=` D l`,g_=M(18,e=>Ft(e,`b`,e.l,M_(e))),__=j(11,g_),v_=M(10,e=>__(e,(e.j??e.h)||``)),y_=j(17,g_),b_=M(16,e=>y_(e,N_(e))),x_=j(15,b_),S_=M(14,e=>x_(e,P_(e)),2),C_=Ye(7,e=>{v_(e),S_(e)}),w_=M(6,e=>C_(e,e.e,e.f)),T_=j(4,w_),E_=j(5,w_),D_=A(9,e=>{v_(e),S_(e)}),O_=(e,t)=>j_(e,t.timer),k_=I(`j3`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function A_(e){z(e.a,p_.wrap),z(e.b,p_.fileFilter),D_(e,null),O_(e,{timer:0}),k_(e)}var j_=j(13,e=>{S_(e),b_(e)});function M_(e){return function(t){e.r(t)}}function N_(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,D_(e,null),C_(e,``);return}D_(e,t),e.n=setTimeout(e.p,150)}}function P_(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;D_(e,null),C_(e,t)}}L(`j0`,M_),L(`j2`,N_),L(`j1`,P_);var F_=200,I_=40;function L_(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=F_)break;(r?t.path:t.path.toLowerCase()).includes(i)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path});let e=new Set;R_(t,t.new,`additions`,i,r,e,a),R_(t,t.old,`deletions`,i,r,e,a)}return a}function R_(e,t,n,r,i,a,o){if(!t||o.length>=F_)return;let s=0,c=t.split(`
9
- `);for(let t=0;t<c.length;t++){if(o.length>=F_||s>=I_)return;let l=c[t],u=(i?l:l.toLowerCase()).indexOf(r);u<0||n===`deletions`&&a.has(l)||(n===`additions`&&a.add(l),s++,o.push({key:e.key,path:e.path,repo:e.repo,line:t+1,side:n,preview:z_(l,u,r.length)}))}}function z_(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var B_=`search-mark`,V_=`mark.${B_}`,H_=`mark.${B_}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${B_} *,mark.${B_} *::before,mark.${B_} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${B_}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,U_={query:``,hit:null},W_=new Map;function G_(e,t){U_.query=e,U_.hit=t;for(let[e,t]of W_)nv(e,U_.query,U_.hit?.key===t?U_.hit:null);t&&requestAnimationFrame(()=>{for(let[e,n]of W_)n===t.key&&K_(e,t)})}function K_(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return;let r=n.querySelector(`mark.search-mark.active`);if(r){r.scrollIntoView({block:`center`});return}if(t.line<1)return;let i=[...n.querySelectorAll(`[data-line="${t.line}"]`)],a=t.side||`additions`;(i.find(e=>Z_(e)===a)??i[0])?.scrollIntoView({block:`center`})}function q_(e,t){let n=t&&U_.hit?.key===t?U_.hit:null;nv(e,U_.query,n),n&&requestAnimationFrame(()=>K_(e,n))}function J_(e,t){return W_.set(e,t),q_(e,t),()=>{W_.delete(e)}}function Y_(e){q_(e,W_.get(e))}function X_(e){for(let t of[...e.querySelectorAll(V_)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function Z_(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function Q_(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(V_)||n.push(e);return n}function $_(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function ev(e,t,n,r,i){let a=$_(e,t,n),o=$_(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function tv(e,t,n,r){let i=Q_(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=Z_(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${B_} active`:B_;for(let e=c.length-1;e>=0;e--)ev(i,a,c[e][0],c[e][1],d)}function nv(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(X_(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))tv(t,s,o,n)}var rv={findBar:`_eV`,findInput:`_eW`,count:`_eX`,findIconBtn:`_eY _eg`},iv=`<div><input type=search placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button title="Previous match">↑</button><button title="Next match">↓</button><button title="Close find">×</button></div>`,av=` D b D l b b l`,ov=Ye(10),sv=M(11,e=>ov(e,e.j,e.k)),cv=j(9,sv),lv=j(10,sv),uv=(e,t)=>Fv(e,t?.length),dv=M(22,e=>uv(e,L_(e.s,e.u||``))),fv=M(39,I(`f5`,e=>kt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),ov(e,!1);return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))},{signal:t.signal}),e.a6=e.t,setTimeout(()=>e.b?.focus(),0),{abort:t}},onUpdate:function(){if(e.t!==e.a6){e.a6=e.t;let t=e.b;t?.focus(),t?.select()}},onDestroy:function(){e.a5&&clearTimeout(e.a5),this.abort.abort(),G_(``,null),xv(e,{query:``,hit:null,keys:[]})}})),3),pv=j(38,fv),mv=M(35,e=>pv(e,Bv(e)),3),hv=M(37,e=>Ft(e,`b`,e.u||``,Vv(e))),gv=M(29,e=>B(e.d,(e.u||``).trim()?e.a0?`${e.a2+1}/${e.a0}`:`0/0`:``),2),_v=Ye(20,e=>{dv(e),mv(e),hv(e),gv(e)}),vv=M(14,e=>_v(e,e.m,e.n)),yv=j(12,vv),bv=j(13,vv),xv=Ye(12),Sv=M(17,e=>xv(e,e.p,e.q)),Cv=j(15,Sv),wv=j(16,Sv),Tv=j(28,e=>{mv(e),gv(e)}),Ev=M(27,e=>Tv(e,e.a0?Math.min(e.x,e.a0-1):-1)),Dv=j(36,hv),Ov=M(34,e=>Dv(e,Hv(e)),2),kv=j(33,e=>{Ov(e),mv(e)}),Av=M(24,e=>kv(e,Uv(e))),jv=A(23,e=>{Ev(e),Av(e)}),Mv=(e,t)=>{Lv(e,t.timer),Rv(e,t.tick)},Nv=I(`f4`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`Enter`&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))}),k(e.e,`click`,function(){e.ac(-1)}),k(e.f,`click`,function(){e.ac(1)}),k(e.g,`click`,function(){ov(e,!1)})});function Pv(e){z(e.a,rv.findBar),z(e.b,rv.findInput),z(e.c,rv.count),z(e.e,rv.findIconBtn),z(e.f,rv.findIconBtn),z(e.g,rv.findIconBtn),jv(e,0),Mv(e,{timer:0,tick:0}),Nv(e)}var Fv=j(26,e=>{R(e.e,`disabled`,!e.a0),R(e.f,`disabled`,!e.a0),Ev(e),gv(e)}),Iv=j(18,e=>{dv(e),Av(e),Ov(e)}),Lv=j(31,e=>{Ov(e),mv(e),fv(e)}),Rv=j(32,fv),zv=j(19,fv);function Bv(e){return t=>{e.a5&&=(clearTimeout(e.a5),0),e.a7(e.u||``,(e.a2<0?0:e.a2)+t)}}function Vv(e){return function(t){e.aa(t)}}function Hv(e){return t=>{_v(e,t),jv(e,0),G_(t,L_(e.s,t)[0]??null),e.a5&&clearTimeout(e.a5),e.a5=setTimeout(()=>{e.a5=0,e.a7(t,0)},80)}}function Uv(e){return(t,n)=>{let r=L_(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){jv(e,0),G_(t,null),xv(e,{query:t,hit:null,keys:i});return}jv(e,(n%r.length+r.length)%r.length);let a=r[e.x];G_(t,a),xv(e,{query:t,hit:a,keys:i})}}L(`f3`,Bv),L(`f0`,Vv),L(`f2`,Hv),L(`f1`,Uv);var Wv=`diffs-container`,Gv=/(?=^diff --git)/gm,Kv=/(?<=\n)/,qv=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Jv=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yv=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xv=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zv=`header-prefix`,Qv=`header-filename-suffix`,$v=`header-metadata`,ey=`header-custom`,ty={dark:`pierre-dark`,light:`pierre-light`},ste=`data-theme-css`,cte=`data-unsafe-css`,lte=`data-diffs-scrollbar-measure`,ny=`--diffs-scrollbar-gutter-measured`,ute=1e5,dte=Object.freeze({fromStart:0,fromEnd:0}),ry={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},fte={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},iy=new Set,ay=null;function oy(e){iy.add(e),ay??=requestAnimationFrame(cy)}function sy(e){iy.delete(e)&&iy.size===0&&ay!=null&&(cancelAnimationFrame(ay),ay=null)}function cy(e){let t=new Set(iy);iy.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}ay=iy.size>0?requestAnimationFrame(cy):null}function ly(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function uy(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function dy(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var pte=new TextEncoder,mte=new TextDecoder(`utf-8`,{ignoreBOM:!0}),hte=/[\uD800-\uDFFF]/,fy=1024,py=new Uint8Array(fy);function gte(){py.length!==fy&&(py=new Uint8Array(fy))}function my(e){if(e.length===0)return e;if(hte.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;py.length<t&&(py=new Uint8Array(t));let{written:n}=pte.encodeInto(e,py);return mte.decode(py.subarray(0,n))}function hy(e,t){return e-(t===0?0:1)}function gy(e,t){return hy(e,t)+t}var _te=4096,vte=.5;function yte(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=xte(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}bte(t,e)}}function bte(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function xte(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>_te)return null;let c=[];for(let t=0;t<n;t++)c.push(_y(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(_y(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Cte(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*vte:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Ste=/\s+/g;function _y(e){return e.replace(Ste,``)}function Cte(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function wte(e,t){try{return Tte(e,t)}finally{gte()}}function Tte(e,{cacheKey:t,isGitDiff:n=Gv.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=wy(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=yy(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=xy(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?vy(i.contents):[],deletionLines:!l&&r!=null&&i!=null?vy(r.contents):[],cacheKey:Ey(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Yv),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=my(r.trim()),n!==r&&(c.prevName=my(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?Jv:qv):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=my(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=my(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=my(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=my(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=my(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=my(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Xv)??[];t!=null&&(c.prevObjectId=my(t)),n!=null&&(c.newObjectId=my(n)),r!=null&&(c.mode=my(r))}e.startsWith(`rename from `)&&(c.prevName=my(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=my(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
8
+ `)}function Tg(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var H={iconBtn:`_cv _cb`,spinning:`_cw _cc`,diffView:`_cx`,treeToggle:`_cy _cb`,diffTools:`_cz`,on:`_cA`,diffCol:`_cB`,diffHead:`_cC`,backBtn:`_cD`,headText:`_cE`,pageTitle:`_cF`,headWithSend:`_cG`,findBtn:`_cH`,diffMain:`_cI`,toastMeta:`_cJ`,diffStats:`_cK`,scope:`_cL`,scopeOpt:`_cM`,scopeOn:`_cN`,scopeChip:`_cO`,repoSection:`_cP`,repoSep:`_cQ`,repoWorktree:`_cR _l`,repoTitle:`_cS _k`,repoMeta:`_cT`,files:`_cU`,file:`_cV`,diffWait:`_cW`,treeChev:`_cX`,status:`_cY`,path:`_cZ`,centerPad:`_c0`,filesBtn:`_c1`,diffPad:`_c2`},Eg={headActions:`_eT`},Dg=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,Og=` D D l%l`,kg=(e,t)=>R(e.a,`value`,t),Ag=M(7,e=>B(e.b,e.f||e.g)),jg=j(5,Ag),Mg=j(6,Ag),Ng=(e,t)=>{kg(e,t[0]?.id),jg(e,t[0]?.title),Mg(e,t[0]?.agent)},Pg=N(3,1,e=>{R(e.b,`disabled`,e._.k),B(e.c,e._.k?`Sending…`:`Send to`),R(e.d,`disabled`,e._.k)}),Fg=I(`g2`,e=>{k(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){qg(e._,!0);try{await e._.i(e._.s)}finally{qg(e._,!1)}}})()}),Bt(e,`d`)}),Ig=e=>{Pg._(e),Lg._(e),zg._(e),z(e.a,V.splitPrimary),Fg(e)},Lg=N(3,1,e=>zt(e,`d`,e._.l,s_(e))),Rg=O(3,`<option> </option>`,` D `,0,Ng),zg=N(3,1,e=>Rg(e,[e._.m,`id`])),Bg=M(2,e=>B(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),Vg=N(3,0,e=>{R(e.a,`disabled`,e._.k),Bg(e)}),Hg=I(`g1`,e=>k(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){qg(e._,!0);try{await e._.i(e._.s)}finally{qg(e._,!1)}}})()})),Ug=e=>{Vg._(e),Wg._(e),Gg._(e),z(e.a,[V.btn,V.primary]),Hg(e)},Wg=N(3,0,Bg),Gg=N(3,0,Bg),Kg=A(9,e=>B(e.c,e.j?`Copied ✓`:`Copy`)),qg=A(10,e=>{Vg(e),Pg(e)}),Jg=j(18),Yg=M(13,e=>Jg(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),Xg=A(11,e=>{Yg(e),Lg(e)}),Zg=I(`g3`,e=>k(e.b,`click`,function(){(async()=>{await e.h()&&(Kg(e,!0),setTimeout(()=>{Kg(e,!1)},1500))})()}));function Qg(e){z(e.a,Eg.headActions),z(e.b,V.btn),Kg(e,!1),qg(e,!1),Xg(e,null),Zg(e)}var $g=j(12,e=>{e_(e,e.m[0]?.title),t_(e,e.m[0]?.agent),r_(e,e.m.length),Yg(e),zg(e)}),e_=j(16,Wg),t_=j(17,Gg),n_=D(3,`<button type=button> </button>`,` D `,Ug,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,Ig),r_=(e,t)=>n_(e,t===1?0:t?1:2),i_=(e,t)=>$g(e,t||[]),a_=j(7),o_=j(8);function s_(e){return t=>{Xg(e._,t)}}L(`g0`,s_);var c_=ei,l_=(e=>`/${e}&`)(ti);function u_(e){ii(e.a,`M17 17L21 21 M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z`)}var d_=(e,t)=>ni(e.a,t),f_=(e,t)=>ri(e.a,t),p_={wrap:`_eU`,fileFilter:`_eV`},m_=`<div><input type=search placeholder="Filter files… (globs, !excludes)" aria-label="Filter files"></div>`,h_=` D l`,g_=M(18,e=>Ft(e,`b`,e.l,M_(e))),__=j(11,g_),v_=M(10,e=>__(e,(e.j??e.h)||``)),y_=j(17,g_),b_=M(16,e=>y_(e,N_(e))),x_=j(15,b_),S_=M(14,e=>x_(e,P_(e)),2),C_=Ye(7,e=>{v_(e),S_(e)}),w_=M(6,e=>C_(e,e.e,e.f)),T_=j(4,w_),E_=j(5,w_),D_=A(9,e=>{v_(e),S_(e)}),O_=(e,t)=>j_(e,t.timer),k_=I(`j3`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function A_(e){z(e.a,p_.wrap),z(e.b,p_.fileFilter),D_(e,null),O_(e,{timer:0}),k_(e)}var j_=j(13,e=>{S_(e),b_(e)});function M_(e){return function(t){e.r(t)}}function N_(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,D_(e,null),C_(e,``);return}D_(e,t),e.n=setTimeout(e.p,150)}}function P_(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;D_(e,null),C_(e,t)}}L(`j0`,M_),L(`j2`,N_),L(`j1`,P_);var F_=200,I_=40;function L_(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=F_)break;(r?t.path:t.path.toLowerCase()).includes(i)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path});let e=new Set;R_(t,t.new,`additions`,i,r,e,a),R_(t,t.old,`deletions`,i,r,e,a)}return a}function R_(e,t,n,r,i,a,o){if(!t||o.length>=F_)return;let s=0,c=t.split(`
9
+ `);for(let t=0;t<c.length;t++){if(o.length>=F_||s>=I_)return;let l=c[t],u=(i?l:l.toLowerCase()).indexOf(r);u<0||n===`deletions`&&a.has(l)||(n===`additions`&&a.add(l),s++,o.push({key:e.key,path:e.path,repo:e.repo,line:t+1,side:n,preview:z_(l,u,r.length)}))}}function z_(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var B_=`search-mark`,V_=`mark.${B_}`,H_=`mark.${B_}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${B_} *,mark.${B_} *::before,mark.${B_} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${B_}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,U_={query:``,hit:null},W_=new Map;function G_(e,t){U_.query=e,U_.hit=t;for(let[e,t]of W_)nv(e,U_.query,U_.hit?.key===t?U_.hit:null);t&&requestAnimationFrame(()=>{for(let[e,n]of W_)n===t.key&&K_(e,t)})}function K_(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return;let r=n.querySelector(`mark.search-mark.active`);if(r){r.scrollIntoView({block:`center`});return}if(t.line<1)return;let i=[...n.querySelectorAll(`[data-line="${t.line}"]`)],a=t.side||`additions`;(i.find(e=>Z_(e)===a)??i[0])?.scrollIntoView({block:`center`})}function q_(e,t){let n=t&&U_.hit?.key===t?U_.hit:null;nv(e,U_.query,n),n&&requestAnimationFrame(()=>K_(e,n))}function J_(e,t){return W_.set(e,t),q_(e,t),()=>{W_.delete(e)}}function Y_(e){q_(e,W_.get(e))}function X_(e){for(let t of[...e.querySelectorAll(V_)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function Z_(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function Q_(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(V_)||n.push(e);return n}function $_(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function ev(e,t,n,r,i){let a=$_(e,t,n),o=$_(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function tv(e,t,n,r){let i=Q_(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=Z_(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${B_} active`:B_;for(let e=c.length-1;e>=0;e--)ev(i,a,c[e][0],c[e][1],d)}function nv(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(X_(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))tv(t,s,o,n)}var rv={findBar:`_eW`,findInput:`_eX`,count:`_eY`,findIconBtn:`_eZ _cb`},iv=`<div><input type=search placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button title="Previous match">↑</button><button title="Next match">↓</button><button title="Close find">×</button></div>`,av=` D b D l b b l`,ov=Ye(10),sv=M(11,e=>ov(e,e.j,e.k)),cv=j(9,sv),lv=j(10,sv),uv=(e,t)=>Fv(e,t?.length),dv=M(22,e=>uv(e,L_(e.s,e.u||``))),fv=M(39,I(`f5`,e=>kt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),ov(e,!1);return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))},{signal:t.signal}),e.a6=e.t,setTimeout(()=>e.b?.focus(),0),{abort:t}},onUpdate:function(){if(e.t!==e.a6){e.a6=e.t;let t=e.b;t?.focus(),t?.select()}},onDestroy:function(){e.a5&&clearTimeout(e.a5),this.abort.abort(),G_(``,null),xv(e,{query:``,hit:null,keys:[]})}})),3),pv=j(38,fv),mv=M(35,e=>pv(e,Bv(e)),3),hv=M(37,e=>Ft(e,`b`,e.u||``,Vv(e))),gv=M(29,e=>B(e.d,(e.u||``).trim()?e.a0?`${e.a2+1}/${e.a0}`:`0/0`:``),2),_v=Ye(20,e=>{dv(e),mv(e),hv(e),gv(e)}),vv=M(14,e=>_v(e,e.m,e.n)),yv=j(12,vv),bv=j(13,vv),xv=Ye(12),Sv=M(17,e=>xv(e,e.p,e.q)),Cv=j(15,Sv),wv=j(16,Sv),Tv=j(28,e=>{mv(e),gv(e)}),Ev=M(27,e=>Tv(e,e.a0?Math.min(e.x,e.a0-1):-1)),Dv=j(36,hv),Ov=M(34,e=>Dv(e,Hv(e)),2),kv=j(33,e=>{Ov(e),mv(e)}),Av=M(24,e=>kv(e,Uv(e))),jv=A(23,e=>{Ev(e),Av(e)}),Mv=(e,t)=>{Lv(e,t.timer),Rv(e,t.tick)},Nv=I(`f4`,e=>{It(e,`b`),k(e.b,`keydown`,function(t){t.key===`Enter`&&(t.preventDefault(),e.ac(t.shiftKey?-1:1))}),k(e.e,`click`,function(){e.ac(-1)}),k(e.f,`click`,function(){e.ac(1)}),k(e.g,`click`,function(){ov(e,!1)})});function Pv(e){z(e.a,rv.findBar),z(e.b,rv.findInput),z(e.c,rv.count),z(e.e,rv.findIconBtn),z(e.f,rv.findIconBtn),z(e.g,rv.findIconBtn),jv(e,0),Mv(e,{timer:0,tick:0}),Nv(e)}var Fv=j(26,e=>{R(e.e,`disabled`,!e.a0),R(e.f,`disabled`,!e.a0),Ev(e),gv(e)}),Iv=j(18,e=>{dv(e),Av(e),Ov(e)}),Lv=j(31,e=>{Ov(e),mv(e),fv(e)}),Rv=j(32,fv),zv=j(19,fv);function Bv(e){return t=>{e.a5&&=(clearTimeout(e.a5),0),e.a7(e.u||``,(e.a2<0?0:e.a2)+t)}}function Vv(e){return function(t){e.aa(t)}}function Hv(e){return t=>{_v(e,t),jv(e,0),G_(t,L_(e.s,t)[0]??null),e.a5&&clearTimeout(e.a5),e.a5=setTimeout(()=>{e.a5=0,e.a7(t,0)},80)}}function Uv(e){return(t,n)=>{let r=L_(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){jv(e,0),G_(t,null),xv(e,{query:t,hit:null,keys:i});return}jv(e,(n%r.length+r.length)%r.length);let a=r[e.x];G_(t,a),xv(e,{query:t,hit:a,keys:i})}}L(`f3`,Bv),L(`f0`,Vv),L(`f2`,Hv),L(`f1`,Uv);var Wv=`diffs-container`,Gv=/(?=^diff --git)/gm,Kv=/(?<=\n)/,qv=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Jv=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yv=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xv=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zv=`header-prefix`,Qv=`header-filename-suffix`,$v=`header-metadata`,ey=`header-custom`,ty={dark:`pierre-dark`,light:`pierre-light`},ste=`data-theme-css`,cte=`data-unsafe-css`,lte=`data-diffs-scrollbar-measure`,ny=`--diffs-scrollbar-gutter-measured`,ute=1e5,dte=Object.freeze({fromStart:0,fromEnd:0}),ry={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},fte={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},iy=new Set,ay=null;function oy(e){iy.add(e),ay??=requestAnimationFrame(cy)}function sy(e){iy.delete(e)&&iy.size===0&&ay!=null&&(cancelAnimationFrame(ay),ay=null)}function cy(e){let t=new Set(iy);iy.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}ay=iy.size>0?requestAnimationFrame(cy):null}function ly(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function uy(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function dy(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var pte=new TextEncoder,mte=new TextDecoder(`utf-8`,{ignoreBOM:!0}),hte=/[\uD800-\uDFFF]/,fy=1024,py=new Uint8Array(fy);function gte(){py.length!==fy&&(py=new Uint8Array(fy))}function my(e){if(e.length===0)return e;if(hte.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;py.length<t&&(py=new Uint8Array(t));let{written:n}=pte.encodeInto(e,py);return mte.decode(py.subarray(0,n))}function hy(e,t){return e-(t===0?0:1)}function gy(e,t){return hy(e,t)+t}var _te=4096,vte=.5;function yte(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=xte(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}bte(t,e)}}function bte(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function xte(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>_te)return null;let c=[];for(let t=0;t<n;t++)c.push(_y(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(_y(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Cte(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*vte:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Ste=/\s+/g;function _y(e){return e.replace(Ste,``)}function Cte(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function wte(e,t){try{return Tte(e,t)}finally{gte()}}function Tte(e,{cacheKey:t,isGitDiff:n=Gv.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=wy(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=yy(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=xy(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?vy(i.contents):[],deletionLines:!l&&r!=null&&i!=null?vy(r.contents):[],cacheKey:Ey(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Yv),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=my(r.trim()),n!==r&&(c.prevName=my(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?Jv:qv):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=my(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=my(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=my(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=my(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=my(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=my(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Xv)??[];t!=null&&(c.prevObjectId=my(t)),n!=null&&(c.newObjectId=my(n)),r!=null&&(c.mode=my(r))}e.startsWith(`rename from `)&&(c.prevName=my(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=my(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
10
10
  `||s[s.length-1]===`\r`||s[s.length-1]===`\r
11
11
  `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:Ey(p.hunkContext),hunkSpecs:my(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Ete(t)&&!by(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=Dy(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Oy(t);(g==null||g.type!==`change`)&&(g=ky(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Oy(t);(g==null||g.type!==`change`)&&(g=ky(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Oy(t);(g==null||g.type!==`context`)&&(g=ky(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=dy(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=dy(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(hy(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=gy(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=gy(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),yte(c),c}}function vy(e){let t=yy(e);for(let e=0;e<t.length;e++)t[e]=my(t[e]);return t}function yy(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
12
12
  `,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function Ete(e){let t=e[0];return t===`+`||t===`-`||t===` `}function by(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
@@ -33,7 +33,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
33
33
  \f\r &>`.split(``),`\0
34
34
  \f\r "&'<=>\``.split(``)],[`\0
35
35
  \f\r "&'<=>\``.split(``),`\0
36
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function cS(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Zb);let l=lS(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!tS(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!zx(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function lS(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=uS(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function uS(e,t,n){let r=qb(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=xx(r.attribute,Object.assign({},e.settings.characterReferences,{subset:sS.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ox:kx)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=xx(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:sS.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Dx(n,o)>Dx(n,e.alternative)&&(o=e.alternative),s=o+xx(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?sS.single:sS.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var dS=[`<`,`&`];function fS(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:xx(e.value,Object.assign({},r.settings.characterReferences,{subset:dS}))}function pS(e,t,n,r){return r.settings.allowDangerousHtml?e.value:fS(e,t,n,r)}function mS(e,t,n,r){return r.all(e)}var hS=$b(`type`,{invalid:gS,unknown:_S,handlers:{comment:Tx,doctype:Ex,element:cS,raw:pS,root:mS,text:fS}});function gS(e){throw Error("Expected node, not `"+e+"`")}function _S(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var vS={},yS={},bS=[];function xS(e,t){let n=t||vS,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:SS,all:CS,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||yb,characterReferences:n.characterReferences||yS,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Zb:Xb,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function SS(e,t,n){return hS(e,t,n,this)}function CS(e){let t=[],n=e&&e.children||bS,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var wS=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),sy(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||uy(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&vb(e.composedPath())||(US(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(US(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(US(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){US(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();US(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);US(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=kS(i)&&this.hoveredLine?.lineElement===i.lineElement;OS(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),OS(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),kS(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(jS(i)&&p!=null){p(i);break}if(AS(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!kS(i))break;OS(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,US(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),US(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),US(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();vb(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(_b(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=xS(gb());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);DS(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(PS(t));if(DS(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(DS(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(DS(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&vb(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=PS(e);if(t&&vb(n))return;let r=FS(e);return r==null?this.pathFromAnnotationSlot(e):PS(r)}pathFromAnnotationSlot(e){let t=LS(IS(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:PS(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=RS(t)?t:RS(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}uy(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,oy(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{sy(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!BS(this.renderedSelectedLinesState,n),i=!BS(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);MS(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=HS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=HS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:NS(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:NS(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:VS(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:VS(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function TS({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:ES({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function ES({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function DS(e){return e!=null&&`kind`in e&&e.kind===`line`}function OS(e){return e!=null&&`kind`in e&&e.kind===`token`}function kS(e){return DS(e)||OS(e)}function AS(e){return`type`in e&&e.type===`line-info`}function jS(e){return`kind`in e&&e.kind===`merge-conflict-action`}function MS(e){return e===`current`||e===`incoming`||e===`both`}function NS(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function PS(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function FS(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function IS(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function LS(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function RS(e){return e!=null&&typeof e.elementFromPoint==`function`}function zS(e,t){return e===t||uy(e??void 0,t??void 0)}function BS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&zS(e?.range??null,t.range)}function VS(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function HS(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function US(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var WS=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),qS(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?XS(t):ZS(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:GS(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:KS(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&JS(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function GS(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function KS(e){return Math.max(Math.ceil(e),0)}function qS(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?JS(e,{codeWidthChanged:!0,numberWidthChanged:!0}):YS(e))}function JS(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function YS(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function XS(e){e.codeElement.isConnected&&YS(e)}function ZS(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var QS=new Map,$S=new Map,eC=new Map,tC=new Set;function nC(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!tC.has(t))return!1;return!0}function rC(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(tC.has(n.name))continue;let e=QS.get(n.name);e??(e=n,QS.set(n.name,e)),tC.add(e.name),t.loadLanguageSync(e.data)}}function iC(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var aC=Object.defineProperty,oC=Object.getOwnPropertyDescriptor,sC=Object.getOwnPropertyNames,cC=Object.prototype.hasOwnProperty,lC=(e,t)=>{let n={};for(var r in e)aC(n,r,{get:e[r],enumerable:!0});return t||aC(n,Symbol.toStringTag,{value:`Module`}),n},uC=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=sC(t),a=0,o=i.length,s;a<o;a++)s=i[a],!cC.call(e,s)&&s!==n&&aC(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=oC(t,s))||r.enumerable});return e},dC=(e,t,n)=>(uC(e,t,`default`),n&&uC(n,t,`default`)),fC=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),pC=function(e){return`/`+e},mC={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pC(t,n),t=s(t),t in mC)return;mC[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fC,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hC=[{id:`abap`,name:`ABAP`,import:(()=>K(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>K(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>K(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>K(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>K(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>K(()=>import(`./_CnrRSwgo.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>K(()=>import(`./_CgrjRmW8.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>K(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>K(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>K(()=>import(`./_swr2EwEY.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>K(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>K(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>K(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>K(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>K(()=>import(`./_laNEHHov.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>K(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>K(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>K(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>K(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>K(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>K(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>K(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>K(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>K(()=>import(`./_B6Pa0t142.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>K(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>K(()=>import(`./_Bl9m4QYG2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>K(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>K(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>K(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>K(()=>import(`./_DpQWjwUv2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>K(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>K(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>K(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>K(()=>import(`./_qs4Ln4Rg2.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>K(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>K(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>K(()=>import(`./_ZpADOd1b2.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>K(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>K(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>K(()=>import(`./_DDQkL3qU.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>K(()=>import(`./_DwPmjIla.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>K(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>K(()=>import(`./_DFSNy_p5.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>K(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>K(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>K(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>K(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>K(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>K(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>K(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>K(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>K(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>K(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>K(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>K(()=>import(`./_DWKvGn_N.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>K(()=>import(`./_DxCjYI2X.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>K(()=>import(`./_CVhtozPf.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>K(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>K(()=>import(`./_PiE5epFe.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>K(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>K(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>K(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>K(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>K(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>K(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>K(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>K(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>K(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>K(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>K(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>K(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>K(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>K(()=>import(`./_C9Gfc8HD2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>K(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>K(()=>import(`./_C1kRr9Kc2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>K(()=>import(`./_Dvz6tufK2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>K(()=>import(`./_CAq-lrFG.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>K(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>K(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>K(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>K(()=>import(`./_Bk9DvADq.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>K(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>K(()=>import(`./_BAq6EcWp2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>K(()=>import(`./_Blov0sJd.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>K(()=>import(`./_BfTs8fRs2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>K(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>K(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>K(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>K(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>K(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>K(()=>import(`./_D78KjvOU.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>K(()=>import(`./_-PDLoMF12.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>K(()=>import(`./_BpKubHaQ2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>K(()=>import(`./_BrcHeNpA2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>K(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>K(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>K(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>K(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>K(()=>import(`./_Bjqxmegr.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>K(()=>import(`./_BGM6toVZ.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>K(()=>import(`./_BE1sAJ-G.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>K(()=>import(`./_b2WV0_P-.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>K(()=>import(`./_68tkSWB0.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>K(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>K(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>K(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>K(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>K(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>K(()=>import(`./_panznFin.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>K(()=>import(`./_B53Hw8eV.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>K(()=>import(`./_BLd6EDeA.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>K(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>K(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>K(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>K(()=>import(`./_CthC5WB8.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>K(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>K(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>K(()=>import(`./_DXL4wTUz.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>K(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>K(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>K(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>K(()=>import(`./_2dFS9eoW.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>K(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>K(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>K(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>K(()=>import(`./_DM4b41za.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>K(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>K(()=>import(`./_y_rhG45O.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>K(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>K(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>K(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>K(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>K(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>K(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>K(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>K(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>K(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>K(()=>import(`./_BTAL_hF4.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>K(()=>import(`./_D8lfT6ai2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>K(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>K(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>K(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>K(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>K(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>K(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>K(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>K(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>K(()=>import(`./_CxypEce-2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>K(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>K(()=>import(`./_DLdVt2YY.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>K(()=>import(`./_O8f0F-Db2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>K(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>K(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>K(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>K(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>K(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>K(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>K(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>K(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>K(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>K(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>K(()=>import(`./_C9CrsbjF.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>K(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>K(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>K(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>K(()=>import(`./_BaHrjjdk.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>K(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>K(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>K(()=>import(`./_3dvXM10f.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>K(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>K(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>K(()=>import(`./_D8pWUCwe.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>K(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>K(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>K(()=>import(`./_CpNZLYpm.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>K(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>K(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>K(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>K(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>K(()=>import(`./_DAjnTl6J.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>K(()=>import(`./_DmjWQ4d2.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>K(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>K(()=>import(`./_BfXqwnv1.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>K(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>K(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>K(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>K(()=>import(`./_Dl1jb9Oh.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>K(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>K(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>K(()=>import(`./_CNqFHPtk.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>K(()=>import(`./_DQtWh9mf.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>K(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>K(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>K(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>K(()=>import(`./_MpKNpArX.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>K(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>K(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>K(()=>import(`./_BWhBQNy22.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>K(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>K(()=>import(`./_CZrjQzIL.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>K(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>K(()=>import(`./_NLqR1tDd.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>K(()=>import(`./_S8j4yHoF.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>K(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>K(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>K(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>K(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>K(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>K(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>K(()=>import(`./_6RgCMzRh2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>K(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>K(()=>import(`./_CTr-8dOb.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>K(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>K(()=>import(`./_C8UrJJCG2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>K(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>K(()=>import(`./_DCXRfyXu.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>K(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>K(()=>import(`./_KvAucFiW2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>K(()=>import(`./_DuT1d3b7.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>K(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>K(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>K(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>K(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>K(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>K(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>K(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>K(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>K(()=>import(`./_BwkuLumM2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>K(()=>import(`./_eDBMsbht2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>K(()=>import(`./_BYFGGkPh2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>K(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>K(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>K(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>K(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>K(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>K(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>K(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>K(()=>import(`./_CIo7EE2m.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>K(()=>import(`./_q3Nmk9QB2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>K(()=>import(`./_D3e_oWUH.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>K(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>K(()=>import(`./_CMLA9XwU2.js`),[]))}],gC=Object.fromEntries(hC.map(e=>[e.id,e.import])),_C=Object.fromEntries(hC.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),vC={...gC,..._C},yC=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>K(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>K(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>K(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>K(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>K(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>K(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>K(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>K(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>K(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>K(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>K(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>K(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>K(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>K(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>K(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>K(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>K(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>K(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>K(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>K(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>K(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>K(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>K(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>K(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>K(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>K(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>K(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>K(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>K(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>K(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>K(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>K(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>K(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>K(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>K(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>K(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>K(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>K(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>K(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>K(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>K(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>K(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>K(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>K(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>K(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>K(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>K(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>K(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>K(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>K(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>K(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>K(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>K(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>K(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>K(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>K(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>K(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>K(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>K(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>K(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>K(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>K(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>K(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>K(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>K(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),bC=t({createOnigurumaEngine:()=>JC,getDefaultWasmLoader:()=>qC,loadWasm:()=>VC,setDefaultWasmLoader:()=>KC}),xC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function SC(){return 2147483648}function CC(){return typeof performance<`u`?performance.now():Date.now()}var wC=(e,t)=>e+(t-e%t)%t;async function TC(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=SC();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,wC(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:CC,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var EC=Object.defineProperty,DC=(e,t,n)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OC=(e,t,n)=>DC(e,typeof t==`symbol`?t:t+``,n),kC=null;function AC(e){throw new xC(e.UTF8ToString(e.getLastOnigError()))}var jC=class e{constructor(t){OC(this,`utf16Length`),OC(this,`utf8Length`),OC(this,`utf16Value`),OC(this,`utf8Value`),OC(this,`utf16OffsetToUtf8`),OC(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},MC=class e{constructor(t){if(OC(this,`id`,++e.LAST_ID),OC(this,`_onigBinding`),OC(this,`content`),OC(this,`utf16Length`),OC(this,`utf8Length`),OC(this,`utf16OffsetToUtf8`),OC(this,`utf8OffsetToUtf16`),OC(this,`ptr`),!kC)throw new xC(`Must invoke loadWasm first.`);this._onigBinding=kC,this.content=t;let n=new jC(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=kC.omalloc(1e4),e._sharedPtrInUse=!0,kC.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(kC)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};OC(MC,`LAST_ID`,0),OC(MC,`_sharedPtr`,0),OC(MC,`_sharedPtrInUse`,!1);var NC=MC,PC=class{constructor(e){if(OC(this,`_onigBinding`),OC(this,`_ptr`),!kC)throw new xC(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new jC(e[r]);t[r]=i.createString(kC),n[r]=i.utf8Length}let r=kC.omalloc(4*e.length);kC.HEAPU32.set(t,r/4);let i=kC.omalloc(4*e.length);kC.HEAPU32.set(n,i/4);let a=kC.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)kC.ofree(t[n]);kC.ofree(i),kC.ofree(r),a===0&&AC(kC),this._onigBinding=kC,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new NC(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function FC(e){return typeof e.instantiator==`function`}function IC(e){return typeof e.default==`function`}function LC(e){return e.data!==void 0}function RC(e){return typeof Response<`u`&&e instanceof Response}function zC(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var BC;function VC(e){if(BC)return BC;async function t(){kC=await TC(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),FC(n)?n=await n.instantiator(t):IC(n)?n=await n.default(t):(LC(n)&&(n=n.data),RC(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await UC(n)(t):await WC(n)(t):zC(n)||n instanceof WebAssembly.Module?n=await HC(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await HC(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return BC=t(),BC}function HC(e){return t=>WebAssembly.instantiate(e,t)}function UC(e){return t=>WebAssembly.instantiateStreaming(e,t)}function WC(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var GC;function KC(e){GC=e}function qC(){return GC}async function JC(e){return e&&await VC(e),{createScanner(e){return new PC(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new NC(e)}}}var YC=lC({});dC(YC,bC);var XC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ZC(e){return QC(e)}function QC(e){return Array.isArray(e)?$C(e):e instanceof RegExp?e:typeof e==`object`?ew(e):e}function $C(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=QC(e[n]);return t}function ew(e){let t={};for(let n in e)t[n]=QC(e[n]);return t}function tw(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function nw(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?nw(e.substring(0,e.length-1)):e.substr(~t+1)}var rw=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,iw=class{static hasCaptures(e){return e!==null&&(rw.lastIndex=0,rw.test(e))}static replaceCaptures(e,t,n){return e.replace(rw,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function aw(e,t){return e<t?-1:+(e>t)}function ow(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=aw(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function sw(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function cw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var lw=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},uw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(hw(e),t)}static createFromParsedTheme(e,t){return vw(e,t)}_cachedMatchRoot=new lw(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>fw(e.parent,t.parentScopes));return n?new mw(n.fontStyle,n.foreground,n.background):null}},dw=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function fw(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!pw(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function pw(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var mw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function hw(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&sw(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&sw(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new gw(l,u,e,o,s,c)}}return n}var gw=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},_w=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(_w||{});function vw(e,t){e.sort((e,t)=>{let n=aw(e.scope,t.scope);return n!==0||(n=ow(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new yw(t),o=new mw(n,a.getId(r),a.getId(i)),s=new Sw(new xw(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new uw(a,o,s)}var yw=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},bw=Object.freeze([]),xw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||bw,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Sw=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),xw.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ow(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new xw(e,t,n,r,i))}},Cw=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Tw(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ww(e){return e}function Tw(e){return e}function Ew(e,t){let n=[],r=Ow(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Dw(i)){let e=[];do e.push(i),i=r.next();while(Dw(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Dw(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ow(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function kw(e){typeof e.dispose==`function`&&e.dispose()}var Aw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},jw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Mw=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Nw=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Aw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Mw;for(let n of e)Pw(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Aw){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Pw(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Aw?Iw({baseGrammar:a,selfGrammar:i},r):Fw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Aw(e))}function Fw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Lw([r],t,n)}}function Iw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Lw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Lw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Lw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?tw({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Lw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Uw(i);switch(a.kind){case 0:Iw({...t,selfGrammar:t.baseGrammar},n);break;case 1:Iw(t,n);break;case 2:Fw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Fw(a.ruleName,i,n):Iw(i,n)}else a.kind===4?n.add(new jw(a.scopeName,a.ruleName)):n.add(new Aw(a.scopeName))}}}var Rw=class{kind=0},zw=class{kind=1},Bw=class{constructor(e){this.ruleName=e}kind=2},Vw=class{constructor(e){this.scopeName=e}kind=3},Hw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uw(e){if(e===`$base`)return new Rw;if(e===`$self`)return new zw;let t=e.indexOf(`#`);return t===-1?new Vw(e):t===0?new Bw(e.substring(1)):new Hw(e.substring(0,t),e.substring(t+1))}var Ww=/\\(\d+)/,Gw=/\\(\d+)/g,Kw=-1,qw=-2;function Jw(e){return e}function Yw(e){return e}var Xw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=iw.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=iw.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${nw(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:iw.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:iw.replaceCaptures(this._contentName,e,t)}},Zw=class extends Xw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Qw=class extends Xw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new rT(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iT,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},$w=class extends Xw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iT,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},eT=class extends Xw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new rT(i,this.id),this.beginCaptures=a,this._end=new rT(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new iT;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tT=class extends Xw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new rT(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new rT(o,qw),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new iT;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new iT,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},nT=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Zw(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Qw(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=tw({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new $w(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new tT(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new eT(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Uw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof $w||e instanceof eT||e instanceof tT)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},rT=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Ww.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Gw.lastIndex=0,this.source.replace(Gw,(e,t)=>cw(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},iT=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new aT(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new aT(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},aT=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
36
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function cS(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Zb);let l=lS(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!tS(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!zx(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function lS(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=uS(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function uS(e,t,n){let r=qb(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=xx(r.attribute,Object.assign({},e.settings.characterReferences,{subset:sS.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ox:kx)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=xx(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:sS.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Dx(n,o)>Dx(n,e.alternative)&&(o=e.alternative),s=o+xx(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?sS.single:sS.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var dS=[`<`,`&`];function fS(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:xx(e.value,Object.assign({},r.settings.characterReferences,{subset:dS}))}function pS(e,t,n,r){return r.settings.allowDangerousHtml?e.value:fS(e,t,n,r)}function mS(e,t,n,r){return r.all(e)}var hS=$b(`type`,{invalid:gS,unknown:_S,handlers:{comment:Tx,doctype:Ex,element:cS,raw:pS,root:mS,text:fS}});function gS(e){throw Error("Expected node, not `"+e+"`")}function _S(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var vS={},yS={},bS=[];function xS(e,t){let n=t||vS,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:SS,all:CS,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||yb,characterReferences:n.characterReferences||yS,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Zb:Xb,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function SS(e,t,n){return hS(e,t,n,this)}function CS(e){let t=[],n=e&&e.children||bS,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var wS=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),sy(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||uy(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&vb(e.composedPath())||(US(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(US(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(US(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){US(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();US(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);US(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=kS(i)&&this.hoveredLine?.lineElement===i.lineElement;OS(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),OS(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),kS(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(jS(i)&&p!=null){p(i);break}if(AS(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!kS(i))break;OS(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,US(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),US(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),US(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();vb(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(_b(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=xS(gb());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);DS(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(PS(t));if(DS(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(DS(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(DS(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&vb(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=PS(e);if(t&&vb(n))return;let r=FS(e);return r==null?this.pathFromAnnotationSlot(e):PS(r)}pathFromAnnotationSlot(e){let t=LS(IS(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:PS(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=RS(t)?t:RS(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}uy(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,oy(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{sy(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!BS(this.renderedSelectedLinesState,n),i=!BS(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);MS(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=HS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=HS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:NS(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:NS(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:VS(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:VS(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function TS({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:ES({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function ES({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function DS(e){return e!=null&&`kind`in e&&e.kind===`line`}function OS(e){return e!=null&&`kind`in e&&e.kind===`token`}function kS(e){return DS(e)||OS(e)}function AS(e){return`type`in e&&e.type===`line-info`}function jS(e){return`kind`in e&&e.kind===`merge-conflict-action`}function MS(e){return e===`current`||e===`incoming`||e===`both`}function NS(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function PS(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function FS(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function IS(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function LS(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function RS(e){return e!=null&&typeof e.elementFromPoint==`function`}function zS(e,t){return e===t||uy(e??void 0,t??void 0)}function BS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&zS(e?.range??null,t.range)}function VS(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function HS(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function US(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var WS=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),qS(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?XS(t):ZS(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:GS(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:KS(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&JS(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function GS(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function KS(e){return Math.max(Math.ceil(e),0)}function qS(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?JS(e,{codeWidthChanged:!0,numberWidthChanged:!0}):YS(e))}function JS(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function YS(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function XS(e){e.codeElement.isConnected&&YS(e)}function ZS(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var QS=new Map,$S=new Map,eC=new Map,tC=new Set;function nC(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!tC.has(t))return!1;return!0}function rC(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(tC.has(n.name))continue;let e=QS.get(n.name);e??(e=n,QS.set(n.name,e)),tC.add(e.name),t.loadLanguageSync(e.data)}}function iC(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var aC=Object.defineProperty,oC=Object.getOwnPropertyDescriptor,sC=Object.getOwnPropertyNames,cC=Object.prototype.hasOwnProperty,lC=(e,t)=>{let n={};for(var r in e)aC(n,r,{get:e[r],enumerable:!0});return t||aC(n,Symbol.toStringTag,{value:`Module`}),n},uC=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=sC(t),a=0,o=i.length,s;a<o;a++)s=i[a],!cC.call(e,s)&&s!==n&&aC(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=oC(t,s))||r.enumerable});return e},dC=(e,t,n)=>(uC(e,t,`default`),n&&uC(n,t,`default`)),fC=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),pC=function(e){return`/`+e},mC={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pC(t,n),t=s(t),t in mC)return;mC[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fC,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hC=[{id:`abap`,name:`ABAP`,import:(()=>K(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>K(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>K(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>K(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>K(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>K(()=>import(`./_DkvEBzS7.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>K(()=>import(`./_DvvBPEVw.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>K(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>K(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>K(()=>import(`./_BTe9kCin.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>K(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>K(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>K(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>K(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>K(()=>import(`./_YirxLGS4.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>K(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>K(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>K(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>K(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>K(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>K(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>K(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>K(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>K(()=>import(`./_D7PYIcBv2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>K(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>K(()=>import(`./_DsxNYA3W2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>K(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>K(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>K(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>K(()=>import(`./_DNm3GBFg2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>K(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>K(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>K(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>K(()=>import(`./_3wpK6Da62.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>K(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>K(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>K(()=>import(`./_B-1aqB9k2.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>K(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>K(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>K(()=>import(`./_q1aoVAj_.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>K(()=>import(`./_DNiAR62k.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>K(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>K(()=>import(`./_aTZInOPC.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>K(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>K(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>K(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>K(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>K(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>K(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>K(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>K(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>K(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>K(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>K(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>K(()=>import(`./_BL2e2Eo7.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>K(()=>import(`./_CkkpgSfP.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>K(()=>import(`./_BMs4fTHh.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>K(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>K(()=>import(`./_lkmVA5Jl.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>K(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>K(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>K(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>K(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>K(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>K(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>K(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>K(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>K(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>K(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>K(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>K(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>K(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>K(()=>import(`./_oy1NiP692.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>K(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>K(()=>import(`./_CzJm-Kgs2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>K(()=>import(`./_Dn6wx3eB2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>K(()=>import(`./_C_bKIJI8.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>K(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>K(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>K(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>K(()=>import(`./_h5G2RGPq.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>K(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>K(()=>import(`./_Dl2UteFV2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>K(()=>import(`./_DZU3Q5Te.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>K(()=>import(`./_Cze2fV8u2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>K(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>K(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>K(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>K(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>K(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>K(()=>import(`./_BxUEtXoQ.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>K(()=>import(`./_BbQFjjyq2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>K(()=>import(`./_hbd3yHWy2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>K(()=>import(`./_CX8l12E-2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>K(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>K(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>K(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>K(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>K(()=>import(`./_BzD2dIYX.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>K(()=>import(`./_toGhOk4U.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>K(()=>import(`./_kDIR2NR8.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>K(()=>import(`./_D-a9DwIr.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>K(()=>import(`./_BkJ_AQhK.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>K(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>K(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>K(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>K(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>K(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>K(()=>import(`./_Bx-q9uoN.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>K(()=>import(`./_DCrRdWzm.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>K(()=>import(`./_CVUfJEVu.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>K(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>K(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>K(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>K(()=>import(`./_DtJBxo8X.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>K(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>K(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>K(()=>import(`./_DZiGlTtq.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>K(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>K(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>K(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>K(()=>import(`./_rpwoQqaU.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>K(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>K(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>K(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>K(()=>import(`./_J7lGcvlZ.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>K(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>K(()=>import(`./_6akhJ5Fn.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>K(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>K(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>K(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>K(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>K(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>K(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>K(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>K(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>K(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>K(()=>import(`./_C0Y8EhIC.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>K(()=>import(`./_BJ9jTSsT2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>K(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>K(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>K(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>K(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>K(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>K(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>K(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>K(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>K(()=>import(`./_GlgJPuKL2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>K(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>K(()=>import(`./_y5S8OwPt.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>K(()=>import(`./_DyTukt_u2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>K(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>K(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>K(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>K(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>K(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>K(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>K(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>K(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>K(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>K(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>K(()=>import(`./_DQ6NSm2p.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>K(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>K(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>K(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>K(()=>import(`./_XQgJphFX.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>K(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>K(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>K(()=>import(`./_Da1JjXN5.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>K(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>K(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>K(()=>import(`./_C-nqelds.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>K(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>K(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>K(()=>import(`./_Obxt4Dxo.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>K(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>K(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>K(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>K(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>K(()=>import(`./_B4wJxefZ.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>K(()=>import(`./_BTAS1Dpg.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>K(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>K(()=>import(`./_CX2w84Lb.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>K(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>K(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>K(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>K(()=>import(`./_WXOM1NgB.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>K(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>K(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>K(()=>import(`./_xDXEaiYG.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>K(()=>import(`./_BIa9rsaF.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>K(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>K(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>K(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>K(()=>import(`./_BKlDC-Tb.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>K(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>K(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>K(()=>import(`./_CjCTUQV22.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>K(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>K(()=>import(`./_DD4eXl6W.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>K(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>K(()=>import(`./_CXJCHFX0.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>K(()=>import(`./_5wEIhz7a.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>K(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>K(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>K(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>K(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>K(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>K(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>K(()=>import(`./_DnGHFVcU2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>K(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>K(()=>import(`./_C2yKcodx.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>K(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>K(()=>import(`./_Docc3wCS2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>K(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>K(()=>import(`./_BiVQf6zi.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>K(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>K(()=>import(`./_d9P0yprv2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>K(()=>import(`./_C8uWyBcH.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>K(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>K(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>K(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>K(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>K(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>K(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>K(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>K(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>K(()=>import(`./_DPsop69P2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>K(()=>import(`./_CcrWJ_AF2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>K(()=>import(`./_Dsl39Q0T2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>K(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>K(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>K(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>K(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>K(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>K(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>K(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>K(()=>import(`./_BBxOP5gd.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>K(()=>import(`./_DJmEj4P02.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>K(()=>import(`./_CBDHZ0hg.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>K(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>K(()=>import(`./_CMLA9XwU2.js`),[]))}],gC=Object.fromEntries(hC.map(e=>[e.id,e.import])),_C=Object.fromEntries(hC.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),vC={...gC,..._C},yC=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>K(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>K(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>K(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>K(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>K(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>K(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>K(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>K(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>K(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>K(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>K(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>K(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>K(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>K(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>K(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>K(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>K(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>K(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>K(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>K(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>K(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>K(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>K(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>K(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>K(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>K(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>K(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>K(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>K(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>K(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>K(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>K(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>K(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>K(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>K(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>K(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>K(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>K(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>K(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>K(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>K(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>K(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>K(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>K(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>K(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>K(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>K(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>K(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>K(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>K(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>K(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>K(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>K(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>K(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>K(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>K(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>K(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>K(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>K(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>K(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>K(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>K(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>K(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>K(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>K(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),bC=t({createOnigurumaEngine:()=>JC,getDefaultWasmLoader:()=>qC,loadWasm:()=>VC,setDefaultWasmLoader:()=>KC}),xC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function SC(){return 2147483648}function CC(){return typeof performance<`u`?performance.now():Date.now()}var wC=(e,t)=>e+(t-e%t)%t;async function TC(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=SC();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,wC(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:CC,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var EC=Object.defineProperty,DC=(e,t,n)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OC=(e,t,n)=>DC(e,typeof t==`symbol`?t:t+``,n),kC=null;function AC(e){throw new xC(e.UTF8ToString(e.getLastOnigError()))}var jC=class e{constructor(t){OC(this,`utf16Length`),OC(this,`utf8Length`),OC(this,`utf16Value`),OC(this,`utf8Value`),OC(this,`utf16OffsetToUtf8`),OC(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},MC=class e{constructor(t){if(OC(this,`id`,++e.LAST_ID),OC(this,`_onigBinding`),OC(this,`content`),OC(this,`utf16Length`),OC(this,`utf8Length`),OC(this,`utf16OffsetToUtf8`),OC(this,`utf8OffsetToUtf16`),OC(this,`ptr`),!kC)throw new xC(`Must invoke loadWasm first.`);this._onigBinding=kC,this.content=t;let n=new jC(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=kC.omalloc(1e4),e._sharedPtrInUse=!0,kC.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(kC)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};OC(MC,`LAST_ID`,0),OC(MC,`_sharedPtr`,0),OC(MC,`_sharedPtrInUse`,!1);var NC=MC,PC=class{constructor(e){if(OC(this,`_onigBinding`),OC(this,`_ptr`),!kC)throw new xC(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new jC(e[r]);t[r]=i.createString(kC),n[r]=i.utf8Length}let r=kC.omalloc(4*e.length);kC.HEAPU32.set(t,r/4);let i=kC.omalloc(4*e.length);kC.HEAPU32.set(n,i/4);let a=kC.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)kC.ofree(t[n]);kC.ofree(i),kC.ofree(r),a===0&&AC(kC),this._onigBinding=kC,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new NC(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function FC(e){return typeof e.instantiator==`function`}function IC(e){return typeof e.default==`function`}function LC(e){return e.data!==void 0}function RC(e){return typeof Response<`u`&&e instanceof Response}function zC(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var BC;function VC(e){if(BC)return BC;async function t(){kC=await TC(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),FC(n)?n=await n.instantiator(t):IC(n)?n=await n.default(t):(LC(n)&&(n=n.data),RC(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await UC(n)(t):await WC(n)(t):zC(n)||n instanceof WebAssembly.Module?n=await HC(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await HC(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return BC=t(),BC}function HC(e){return t=>WebAssembly.instantiate(e,t)}function UC(e){return t=>WebAssembly.instantiateStreaming(e,t)}function WC(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var GC;function KC(e){GC=e}function qC(){return GC}async function JC(e){return e&&await VC(e),{createScanner(e){return new PC(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new NC(e)}}}var YC=lC({});dC(YC,bC);var XC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ZC(e){return QC(e)}function QC(e){return Array.isArray(e)?$C(e):e instanceof RegExp?e:typeof e==`object`?ew(e):e}function $C(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=QC(e[n]);return t}function ew(e){let t={};for(let n in e)t[n]=QC(e[n]);return t}function tw(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function nw(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?nw(e.substring(0,e.length-1)):e.substr(~t+1)}var rw=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,iw=class{static hasCaptures(e){return e!==null&&(rw.lastIndex=0,rw.test(e))}static replaceCaptures(e,t,n){return e.replace(rw,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function aw(e,t){return e<t?-1:+(e>t)}function ow(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=aw(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function sw(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function cw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var lw=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},uw=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(hw(e),t)}static createFromParsedTheme(e,t){return vw(e,t)}_cachedMatchRoot=new lw(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>fw(e.parent,t.parentScopes));return n?new mw(n.fontStyle,n.foreground,n.background):null}},dw=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function fw(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!pw(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function pw(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var mw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function hw(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&sw(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&sw(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new gw(l,u,e,o,s,c)}}return n}var gw=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},_w=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(_w||{});function vw(e,t){e.sort((e,t)=>{let n=aw(e.scope,t.scope);return n!==0||(n=ow(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new yw(t),o=new mw(n,a.getId(r),a.getId(i)),s=new Sw(new xw(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new uw(a,o,s)}var yw=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},bw=Object.freeze([]),xw=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||bw,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Sw=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),xw.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ow(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new xw(e,t,n,r,i))}},Cw=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Tw(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ww(e){return e}function Tw(e){return e}function Ew(e,t){let n=[],r=Ow(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Dw(i)){let e=[];do e.push(i),i=r.next();while(Dw(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Dw(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ow(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function kw(e){typeof e.dispose==`function`&&e.dispose()}var Aw=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},jw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Mw=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Nw=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Aw(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Mw;for(let n of e)Pw(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Aw){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Pw(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Aw?Iw({baseGrammar:a,selfGrammar:i},r):Fw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Aw(e))}function Fw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Lw([r],t,n)}}function Iw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Lw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Lw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Lw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?tw({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Lw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Uw(i);switch(a.kind){case 0:Iw({...t,selfGrammar:t.baseGrammar},n);break;case 1:Iw(t,n);break;case 2:Fw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Fw(a.ruleName,i,n):Iw(i,n)}else a.kind===4?n.add(new jw(a.scopeName,a.ruleName)):n.add(new Aw(a.scopeName))}}}var Rw=class{kind=0},zw=class{kind=1},Bw=class{constructor(e){this.ruleName=e}kind=2},Vw=class{constructor(e){this.scopeName=e}kind=3},Hw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Uw(e){if(e===`$base`)return new Rw;if(e===`$self`)return new zw;let t=e.indexOf(`#`);return t===-1?new Vw(e):t===0?new Bw(e.substring(1)):new Hw(e.substring(0,t),e.substring(t+1))}var Ww=/\\(\d+)/,Gw=/\\(\d+)/g,Kw=-1,qw=-2;function Jw(e){return e}function Yw(e){return e}var Xw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=iw.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=iw.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${nw(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:iw.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:iw.replaceCaptures(this._contentName,e,t)}},Zw=class extends Xw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Qw=class extends Xw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new rT(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iT,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},$w=class extends Xw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iT,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},eT=class extends Xw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new rT(i,this.id),this.beginCaptures=a,this._end=new rT(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new iT;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tT=class extends Xw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new rT(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new rT(o,qw),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new iT;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new iT,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},nT=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Zw(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Qw(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=tw({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new $w(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new tT(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new eT(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Uw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof $w||e instanceof eT||e instanceof tT)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},rT=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Ww.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Gw.lastIndex=0,this.source.replace(Gw,(e,t)=>cw(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},iT=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new aT(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new aT(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},aT=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
37
37
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},oT=class{constructor(e,t){this.languageId=e,this.tokenType=t}},sT=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new oT(e,8),this._embeddedLanguagesMatcher=new cT(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new oT(0,0);_getBasicScopeAttributes=new lw(e=>new oT(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},cT=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>cw(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var lT=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function uT(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=dT(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new lT(i,!0);f()}return new lT(i,!1);function f(){let o=fT(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Kw){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),_T(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof eT){let r=o;_T(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof tT){let r=o;_T(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(_T(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function dT(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof tT&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=gT(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==qw){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),_T(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function fT(e,t,n,r,i,a){let o=pT(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=mT(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function pT(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=hT(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function mT(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=hT(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function hT(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function gT(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function _T(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));uT(e,p,n&&d.start===0,d.start,f,i,!1,0),kw(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new vT(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var vT=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function yT(e,t,n,r,i,a,o,s){return new CT(e,t,n,r,i,a,o,s)}function bT(e,t,n,r,i){let a=Ew(t,xT),o=nT.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function xT(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(ST(t[r],e))return n=r+1,!0;return!1})}function ST(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var CT=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new sT(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=wT(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Ew(e,xT);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)bT(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&bT(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Jw(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Yw(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=wT(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=nT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ET.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Cw.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?TT.createRootAndLookUpScopeName(a,r,this):TT.createRoot(`unknown`,r),t=new ET(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
38
38
  `;let a=this.createOnigString(e),o=a.content.length,s=new OT(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=uT(this,a,i,0,t,s,!0,r);return kw(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function wT(e,t){return e=ZC(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var TT=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=dw.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new dw(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new dw(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Cw.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},ET=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?TT.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Yw(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=TT.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Jw(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,TT.fromExtension(r,n.contentNameScopesList))}},DT=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Ew(e,xT).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Ew(e,xT).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},OT=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Cw.set(n,0,ww(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Cw.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},kT=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,yT(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},AT=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new kT(uw.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(uw.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new DT(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Nw(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},jT=ET.NULL;function MT(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function NT(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function PT(e){return Array.isArray(e)?e:[e]}async function FT(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function IT(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function LT(e){return e===`ansi`||IT(e)}function RT(e){return e===`none`}function zT(e){return RT(e)}var BT=/(\r?\n)/g;function VT(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(BT),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var HT={light:`#333333`,dark:`#bbbbbb`},UT={light:`#fffffe`,dark:`#1e1e1e`},WT=`__shiki_resolved`;function GT(e){if(e?.[WT])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?HT.light:HT.dark,n||=t.type===`light`?UT.light:UT.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,WT,{enumerable:!1,writable:!1,value:!0}),t}async function KT(e){return[...new Set((await Promise.all(e.filter(e=>!LT(e)).map(async e=>await FT(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function qT(e){return(await Promise.all(e.map(async e=>zT(e)?null:GT(await FT(e))))).filter(e=>!!e)}function JT(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new XC(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var YT=class extends AT{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=GT(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=uw.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=JT(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new XC(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},XT=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},ZT=0;function QT(e){ZT+=1,e.warnings!==!1&&ZT>=10&&ZT%10==0&&console.warn(`[Shiki] ${ZT} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new XC("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(GT),i=new YT(new XT(e.engine,n),r,n,e.langAlias),a;function o(t){return JT(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new XC(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new XC(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await KT(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await qT(e))}function g(){if(t)throw new XC(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--ZT)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function $T(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([qT(e.themes||[]),KT(e.langs||[]),e.engine]);return QT({...e,themes:t,langs:n,engine:r})}var eE=new WeakMap;function tE(e,t){eE.set(e,t)}function nE(e){return eE.get(e)}var rE=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(PT(n).map(e=>[e,jT])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return iE(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function iE(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function aE(e,t){if(!(e instanceof rE))throw new XC(`Invalid grammar state`);return e.getInternalStack(t)}var oE=/,/,sE=/ /;function cE(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(IT(e.resolveLangAlias(n.lang||`text`))||RT(r))return VT(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new XC(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new XC(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return uE(t,o,i,a,n)}function lE(...e){if(e.length===2)return nE(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(IT(i)||RT(a))throw new XC(`Plain language does not have grammar state`);if(i===`ansi`)throw new XC(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new rE(dE(n,c,o,s,r).stateStack,c.name,o.name)}function uE(e,t,n,r,i){let a=dE(e,t,n,r,i),o=new rE(a.stateStack,t.name,n.name);return tE(a.tokens,o),a.tokens}function dE(e,t,n,r,i){let a=MT(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=VT(e),u=i.grammarState?aE(i.grammarState,n.name)??jT:i.grammarContextCode==null?jT:dE(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=NT(r[Cw.getForeground(s)],a),u=Cw.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Cw.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(oE).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(sE))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?fE(t.scopes):pE(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function fE(e){return e.map(e=>({scopeName:e}))}function pE(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:gE(e,i,t.slice(0,r))}}return n}function mE(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function hE(e,t,n){if(!mE(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)mE(e[r],n[i])&&--r,--i;return r===-1}function gE(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(hE(e,t,n)){r.push(a);break}return r}function _E(e,t,n,r=cE){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:nE(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=vE(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new rE(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&tE(s,c),s}function vE(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var yE=/\s+/g;function bE(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(yE)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(yE);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var xE=/:?lang=["']([^"']+)["']/g,SE=/(?:```|~~~)([\w-]+)/g,CE=/\\begin\{([\w-]+)\}/g,wE=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,TE=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function EE(e){let t=VT(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function DE(e,t,n){let r=new Set;for(let t of e.matchAll(xE)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(SE)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(CE)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(wE)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(TE.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var OE=[`color`,`background-color`];function kE(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function AE(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function jE(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=AE(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return kE(e,a)})):e}function ME(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>NE(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&OE.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new XC('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function NE(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&_w.Italic&&(t[`font-style`]=`italic`),e.fontStyle&_w.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&_w.Underline&&n.push(`underline`),e.fontStyle&_w.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function PE(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function FE(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=EE(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new XC(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new XC(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new XC(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));IE(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return jE(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new XC(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=LE(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new XC(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new XC(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&bE(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function IE(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new XC(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new XC(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function LE(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(LE).join(``):``}var RE=[FE()];function zE(e){let t=BE(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...RE]}function BE(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var VE=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],HE={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function UE(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function WE(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function GE(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)HE[r]&&t.push({type:`setDecoration`,value:HE[r]});else if(r<=29){let e=HE[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:VE[r-30]}});else if(r===38){let n=WE(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:VE[r-40]}});else if(r===48){let n=WE(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:VE[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:VE[r-100+8]}})}}return t}function KE(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=UE(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=GE(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var qE={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function JE(e=qE){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<VE.length;e++)r.push(t(VE[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var YE=/#([0-9a-f]{3,8})/i,XE=/var\((--[\w-]+-ansi-[\w-]+)\)/,ZE={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function QE(e,t,n){let r=MT(e,n),i=VT(t),a=JE(Object.fromEntries(VE.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||ZE[t]]}))),o=KE();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=NT(i,r),o=NT(o,r),n.decorations.has(`dim`)&&(i=$E(i));let s=_w.None;return n.decorations.has(`bold`)&&(s|=_w.Bold),n.decorations.has(`italic`)&&(s|=_w.Italic),n.decorations.has(`underline`)&&(s|=_w.Underline),n.decorations.has(`strikethrough`)&&(s|=_w.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function $E(e){let t=e.match(YE);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(XE);return n?`var(${n[1]}-dim)`:e}function eD(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!IT(r)&&!RT(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return QE(r,t,n)}return cE(e,t,n)}function tD(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new XC("`themes` option must not be empty");let p=_E(e,t,n,eD);if(c=nE(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new XC(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>ME(e,h,u,l,d))),c&&tE(a,c);let g=f.map(e=>MT(e.theme,n));i=nD(f,m,g,u,l,`fg`,d),r=nD(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=MT(n.theme,n);a=eD(e,t,n);let l=e.getTheme(n.theme);r=NT(l.bg,s),i=NT(l.fg,s),o=l.name,c=nE(a)}else throw new XC("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function nD(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=NT(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new XC('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${NT(t[r][a],n[r])||`inherit`}, ${NT(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var rD=/^\s+$/,iD=/^(\s*)(.*?)(\s*)$/;function aD(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>aD(e,t,n),codeToTokens:(t,n)=>tD(e,t,n)}){let i=t;for(let e of zE(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=tD(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=sD(a):d===`never`&&(a=cD(a)),f&&(a=lD(a));let p={...r,get source(){return i}};for(let e of zE(n))a=e.tokens?.call(p,a)||a;return oD(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function oD(e,t,n,r=nE(e)){let i=zE(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:bE,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
39
39
  `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=PE(a.htmlStyle||NE(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&tE(m,r),m}function sD(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&_w.Underline||i.fontStyle&_w.Strikethrough));o&&rD.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function cD(e){return e.map(e=>e.flatMap(e=>{if(rD.test(e.content))return e;let t=e.content.match(iD);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function lD(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=PE(e.htmlStyle||NE(e)),i=PE(n.htmlStyle||NE(n)),a=e.fontStyle&&(e.fontStyle&_w.Underline||e.fontStyle&_w.Strikethrough),o=n.fontStyle&&(n.fontStyle&_w.Underline||n.fontStyle&_w.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var uD=xS;function dD(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>aD(e,t,n),codeToTokens:(t,n)=>tD(e,t,n)},i=uD(aD(e,t,n,r));for(let e of zE(n))i=e.postprocess?.call(r,i,n)||i;return i}async function fD(e){let t=await $T(e);return{getLastGrammarState:(...e)=>lE(t,...e),codeToTokensBase:(e,n)=>eD(t,e,n),codeToTokensWithThemes:(e,n)=>_E(t,e,n),codeToTokens:(e,n)=>tD(t,e,n),codeToHast:(e,n)=>aD(t,e,n),codeToHtml:(e,n)=>dD(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function pD(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,LT(n))return[];let r=t[n];if(!r)throw new XC(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(zT(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new XC(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await fD({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function mD(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function hD(e,t){let n=mD(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var gD=pD({langs:vC,themes:yC,engine:()=>(0,YC.createOnigurumaEngine)(K(()=>import(`./_BnjxR4X6.js`),[]))}),{codeToHtml:Dte,codeToHast:Ote,codeToTokens:kte,codeToTokensBase:Ate,codeToTokensWithThemes:jte,getSingletonHighlighter:Mte,getLastGrammarState:Nte}=hD(gD,{guessEmbeddedLanguages:DE}),_D=4294967295,vD=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:_D,end:_D,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function yD(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function bD(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var xD=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),SD=String.raw;function CD(e,t){if(e==null)throw Error(t??`Value expected`);return e}var wD=SD`\[\^?`,TD=`c.? | C(?:-.?)?|${SD`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${SD`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${SD`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${SD`o\{[^\}]*\}?`}|${SD`\d{1,3}`}`,ED=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,DD=new RegExp(SD`
@@ -1529,7 +1529,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[qO(e),e])),Ite=new Map([[`s`,Tk(383)],[Tk(38
1529
1529
  `;if(t.endsWith(`
1530
1530
  `))return`
1531
1531
  `;if(t.endsWith(`\r`))return`\r`}return`
1532
- `}function nN(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function rN(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function iN(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function aN(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function oN(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function sN({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function cN(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:$A(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function lN(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var uN=-1,dN=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++uN}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:ty},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new WS,this.scrollSyncManager=new _j,this.interactionManager=new wS(`diff`,TS(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return cN(e)}createHunksRenderer(e){return new VM(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=hy(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(TS(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ly(this.appliedThemeCSS.theme,this.options.theme??ty)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){sy(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=sN(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),hN(this.pre,pN({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||gN(this.headerElement,mN({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),XA(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?sb(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!lN(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(cj(`merge`,e,t),this.setHydratedState(t),await oN(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=sN(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!fN(u,this.deletionFile)||!fN(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&yA(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=sb(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(CM(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:ee=!1,disableFileHeader:te=!1}=this.options;if(te&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,fte);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||Tj(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return Fj({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=xM(e,this.hunksRenderer.getExpandedHunksMap(),t);return CM(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(SM(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return Nj({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return Pj({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=Oj(o);if(e<s){let c=kj({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=Mj({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=Oj(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){oy(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||zM(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!aN(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${CA(r)}`,a=this.annotationCache.get(i);if(a==null||!iN(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Cre(CA(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=wre();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:QA(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):QA(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=bre;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??xS(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ey,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Zv,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Qv,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,$v,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Tre(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=GA(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??ty,s=typeof o==`string`?o:{...o},c=VA(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=tj({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:KA(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=qA(this.themeCSSStyle.textContent??``,VA(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&ij()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?ej(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=_N(t[0]),a=_N(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=xS(i),r.content.innerHTML=xS(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=YA({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=YA({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=YA({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=_N(r?.[0]),a=_N(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=_N(n?.[0]),i=_N(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=xS(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?ej(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=_N(t[0]),i=_N(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};xre(u,this.appliedPreAttributes)||(ZA(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function fN(e,t){return e==null||t==null?e==null&&t==null:lb(e,t)}function pN({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function mN({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function hN(e,t,n=!1){return!n&&e==null&&t}function gN(e,t,n=!1){return e==null&&t&&!n}function _N(e){if(e!=null&&e.type===`element`)return e.children??[]}function vN(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var yN={diffFile:`_eZ`},bN=`<div></div>`,xN=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,SN=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,CN=new CSSStyleSheet;CN.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+H_);var wN=ut(`e0`,0);function TN(e){z(e.a,yN.diffFile)}var EN=M(11,I(`e1`,e=>kt(e,{file:e.d,comments:e.e,draft:e.f,onMount:function(){let t=t=>{if(!t)return;let n=document.createElement(`div`);n.style.cssText=xN;let r=document.createElement(`p`);r.textContent=t.text,r.style.cssText=`margin:0;white-space:pre-wrap;`;let i=document.createElement(`button`);return i.textContent=`remove`,i.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;align-self:flex-start;font-size:.75rem;opacity:.7;`,i.onclick=()=>e.g?.(t.id),n.append(r,i),n},n=()=>{let t=document.createElement(`div`);t.style.cssText=xN;let n=document.createElement(`textarea`);n.placeholder=`Leave a comment…`,n.rows=3,n.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(sr()?`font-size:16px;`:``);let r=document.createElement(`button`);r.textContent=`Comment`,r.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`;let i=document.createElement(`button`);i.textContent=`Cancel`,i.style.cssText=SN,r.onclick=()=>{n.value.trim()&&e.h?.(n.value)},i.onclick=()=>e.i?.(),n.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&r.onclick(),e.key===`Escape`&&i.onclick()};let a=document.createElement(`div`);a.style.cssText=`display:flex;gap:.4rem;`,a.append(r,i),t.append(n,a);let o=()=>n.scrollIntoView({block:`center`,behavior:`smooth`});return n.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,o),n.addEventListener(`blur`,()=>e.removeEventListener(`resize`,o),{once:!0}))}),setTimeout(()=>{n.scrollIntoView({block:`center`,behavior:`instant`}),n.focus()},0),t},r=new Map,i,a={draft:!0},o,s=new dN({diffStyle:cr()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.j?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let r=e.metadata||{};return r.draft?o??=n():t(r.comment)}}),c=()=>{let t=[],n=new Map;for(let i of e.e||[]){let e=r.get(i.id)||{comment:i};n.set(i.id,e),t.push({side:i.side,lineNumber:i.line_end,metadata:e})}return r=n,e.f&&(i!==e.f&&(i=e.f,a={draft:!0},o=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:a})),t},l=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(CN)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,CN])},u=()=>{if(e.d.old==null&&e.d.new==null){e.k?.(`could not read ${e.d.path}`);return}let t=s.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:c()});Promise.resolve(t).then(()=>{l(),Y_(e.a)}).catch(t=>e.k?.(`diff render: ${t}`))};u();let d=new AbortController;return sr()&&vN(wN(e),d.signal),{instance:s,render:u,dragAbort:d,unregSearch:J_(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f}},onUpdate:function(){(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),7),DN=j(3,EN),ON=j(4,EN),kN=j(5,EN),AN=j(6,EN),jN=j(7,EN),MN=j(8,EN),NN=j(9,EN),PN=j(10,EN),FN={tree:`_e0`,closed:`_e1`,treeRepo:`_e2`,treeRepoName:`_e3`,treeDir:`_e4`,treeFile:`_e5`,treeFileName:`_e6`,treeNote:`_e7`,treeChev:`_e8`,status:`_e9`},IN=`<aside></aside>`,LN=e=>z(e.a,FN.treeNote),RN=M(4,e=>{z(e.a,[FN.treeDir,{[FN.closed]:e._._._._.m.has(e._._.c(e._.e))}]),B(e.c,e._._._._.m.has(e._._.c(e._.e))?`▸`:`▾`)},2),zN=F(15,RN,e=>e._._._._),BN=I(`h3`,e=>k(e.a,`click`,function(){let t=new Set(e._._._._.m);t.delete(e._._.c(e._.e))||t.add(e._._.c(e._.e)),RP(e._._._._,t)})),VN=e=>{zN(e),HN(e),UN._(e),WN._(e),GN._(e),z(e.b,FN.treeChev),BN(e)},HN=F(6,RN,e=>e._._),UN=N(0,0,e=>{R(e.a,`title`,e._.e),RN(e)}),WN=N(0,0,e=>bt(e.a,`padding-left:${.35+e._.f*.75}rem`)),GN=N(0,0,e=>B(e.d,e._.g)),KN=D(5,`<span>💬</span>`,` `,LN),qN=M(6,e=>KN(e,+!e._._._._.n.has(e._.j))),JN=F(16,qN,e=>e._._._._),YN=I(`h4`,e=>k(e.a,`click`,function(){e._._._._.j(e._.j)})),XN=e=>{JN(e),ZN._(e),QN._(e),$N._(e),eP._(e),tP._(e),z(e.a,FN.treeFile),z(e.b,FN.status),z(e.d,FN.treeFileName),YN(e)},ZN=N(0,1,e=>bt(e.a,`padding-left:${.5+e._.f*.75}rem`)),QN=N(0,1,e=>R(e.a,`title`,e._.i)),$N=N(0,1,qN),eP=N(0,1,e=>{R(e.b,`data-status`,e._.k),B(e.c,e._.k)}),tP=N(0,1,e=>B(e.e,e._.l)),nP=D(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,VN,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,XN),rP=M(3,e=>nP(e,!e._.f(e.c)&&e.c?.kind===`dir`?0:!e._.f(e.c)&&e.c?.kind!==`dir`?1:2)),iP=Xe(0,rP),aP=iP,oP=j(2,e=>{cP(e,e.c?.path),lP(e,e.c?.depth),uP(e,e.c?.label),dP(e,e.c?.file?.path),fP(e,e.c?.file?.key),pP(e,e.c?.file?.status),mP(e,e.c?.name),rP(e)}),sP=(e,t)=>oP(e,t[0]),cP=j(4,UN),lP=j(5,e=>{ZN(e),WN(e)}),uP=j(6,GN),dP=j(8,QN),fP=j(9,$N),pP=j(10,eP),mP=j(11,tP),hP=j(5,iP),gP=M(4,e=>hP(e,KP(e)),2),_P=F(15,gP,e=>e._._),vP=j(3,gP),yP=e=>{_P(e),xP._(e),wP._(e),vP(e,qP)},bP=j(2,P(HN)),xP=N(5,0,e=>{bP(e,JP(e)),gP(e)}),SP=O(0,`<!><!><!>`,`b%`,aP,sP),CP=(e,t)=>SP(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),wP=N(5,0,e=>CP(e,Tg(e._.l))),TP=D(5,`<!><!><!>`,`b%`,yP),EP=M(9,e=>{z(e.b,[FN.treeRepoName,{[FN.closed]:e._.k.has(e.i)}]),B(e.d,e._.k.has(e.i)?`▸`:`▾`),TP(e,+!!e._.k.has(e.i))}),DP=Xe(0,EP),OP=I(`h5`,e=>k(e.b,`click`,function(){let t=new Set(e._.k);t.delete(e.i)||t.add(e.i),PP(e._,t)})),kP=e=>{DP._(e),z(e.a,FN.treeRepo),z(e.c,FN.treeChev),OP(e)},AP=j(8,e=>{EP(e),xP(e)}),jP=(e,t)=>B(e.e,t),MP=(e,t)=>{AP(e,t[0]?.id),jP(e,t[0]?.label),NP(e,t[0]?.files)},NP=j(11,wP),PP=Ye(10,DP),FP=M(5,e=>PP(e,e.d,e.e)),IP=j(3,FP),LP=j(4,FP),RP=A(12,P(_P,zN));function zP(e){RP(e,new Set)}var BP=j(13,P(JN)),VP=(e,t)=>BP(e,t||new Set),HP=(e,t)=>z(e.a,[FN.tree,{[FN.closed]:t===!1}]),UP=O(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,kP,MP),WP=(e,t)=>UP(e,[t,`id`]),GP=j(9);function KP(e){return t=>{let n=e.d(t);for(let r of e._._.m){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function qP(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function JP(e){return t=>`${e._.i}/${t}`}L(`h2`,KP),L(`h1`,qP),L(`h0`,JP);var YP={iconBtn:`_em _eg`,spinning:`_en _eh`,sheetBackdrop:`_eo`,fileSheet:`_ep`,sheetHead:`_eq`,fileCount:`_er`,sheetList:`_es`,sheetFile:`_et`,sheetPath:`_eu`,status:`_ev`},XP=`<!><!><!>`,ZP=D(5,`<span>💬</span>`),QP=M(9,e=>ZP(e,+!e._._.o.has(e.i))),$P=F(18,QP,e=>e._._),eF=I(`d0`,e=>k(e.a,`click`,function(){fF(e._._,!1),e._._.l(e.i)})),tF=e=>{$P(e),z(e.a,[YP.sheetFile,V.mono]),z(e.b,YP.status),z(e.d,YP.sheetPath),eF(e)},nF=(e,t)=>{R(e.b,`data-status`,t),B(e.c,t)},rF=j(8,e=>{R(e.d,`title`,e.i),B(e.e,e.i),QP(e)}),iF=O(7,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,tF,(e,t)=>{rF(e,t[0]?.key),nF(e,t[0]?.status)}),aF=N(0,0,e=>iF(e,[e._.i,`key`])),oF=I(`d1`,e=>{k(e.a,`click`,function(){fF(e._,!1)}),k(e.g,`click`,function(){fF(e._,!1)})}),sF=e=>{aF._(e),lF._(e),uF._(e),z(e.a,YP.sheetBackdrop),z(e.b,YP.fileSheet),z(e.c,YP.sheetHead),z(e.d,YP.fileCount),z(e.g,YP.iconBtn),z(e.h,YP.sheetList),oF(e)},cF=M(8,e=>B(e.f,e._.j===e._.p?``:` / ${e._.p}`)),lF=N(0,0,e=>{B(e.e,e._.j),cF(e)}),uF=N(0,0,cF),dF=D(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D Db D%b%l l `,sF),fF=Ye(12,e=>dF(e,+!e.m)),pF=M(5,e=>fF(e,e.d,e.e)),mF=j(3,pF),hF=j(4,pF),gF=j(14,P($P)),_F=(e,t)=>gF(e,t||new Set),vF=j(15,uF),yF=M(10,e=>vF(e,e.h??e.j)),bF=j(7,yF),xF=j(9,e=>{yF(e),lF(e)}),SF=j(8,e=>{xF(e,e.i?.length),aF(e)}),CF=j(11),wF=((e,t,n,r,i,a)=>`<div><div><div><!><div><h1>Review</h1><span><!> file<!> changed <!></span></div><!></div><div><button>${e}</button><button title="Refresh diff">${t}</button><button title="Jump to file">Files (<!>)</button><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${n}</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button>${r}</div><!><div data-diff-main><!><!><!><!><!><!><!></div></div>${i}${a}</div>`)(Dp,is,c_,m_,IN,XP),TF=((e,t,n,r,i,a)=>` D D D%b D b D%c%c%m%l D D/${e}&l D/${t}&l Db%l D/${n}&l D b l D l/${r}&l%b D%b%b%b%b%b%b%m/${i}&/${a}&l`)(Op,as,l_,h_,` b`,`b%c`),EF=e=>z(e.a,H.diffPad),DF=e=>z(e.a,H.diffPad),OF=e=>z(e.a,H.diffPad),kF=N(5,0,e=>B(e.b,e._.t)),AF=e=>{kF._(e),z(e.a,V.chip)},jF=M(2,e=>R(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),MF=F(34,e=>{B(e.b,e._._._.q),jF(e)},e=>e._._._),NF=e=>{MF(e),PF(e),z(e.a,V.chip)},PF=F(35,jF,e=>e._._._),FF=F(26,e=>B(e.b,e._._._.i),e=>e._._._),IF=e=>{FF(e),LF(e),zF(e),BF(e),VF(e),HF(e),UF(e),z(e.a,[V.chip,V.pr]),z(e.c,V.dim)},LF=F(27,e=>R(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),RF=M(4,e=>R(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),zF=F(28,e=>{B(e.d,e._._._.k),RF(e)},e=>e._._._),BF=F(29,RF,e=>e._._._),VF=F(30,RF,e=>e._._._),HF=F(31,RF,e=>e._._._),UF=F(32,RF,e=>e._._._),WF=M(2,e=>R(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),GF=F(34,e=>{B(e.b,e._._._.q),WF(e)},e=>e._._._),KF=e=>{GF(e),qF(e),z(e.a,V.chip)},qF=F(35,WF,e=>e._._._),JF=F(33,e=>B(e.b,e._._._.p),e=>e._._._),YF=e=>{JF(e),z(e.a,H.repoTitle)},XF=F(26,e=>B(e.b,e._._._.i),e=>e._._._),ZF=I(`i35`,e=>k(e.a,`click`,function(e){e.stopPropagation()})),QF=e=>{XF(e),$F(e),tI(e),nI(e),rI(e),iI(e),aI(e),z(e.a,[V.chip,V.pr]),z(e.c,H.repoTitle),ZF(e)},$F=F(27,e=>R(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),eI=M(4,e=>R(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),tI=F(28,e=>{B(e.d,e._._._.k),eI(e)},e=>e._._._),nI=F(29,eI,e=>e._._._),rI=F(30,eI,e=>e._._._),iI=F(31,eI,e=>e._._._),aI=F(32,eI,e=>e._._._),oI=M(10,e=>R(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),sI=j(7,oI),cI=j(8,e=>{B(e.c,xg(e.i)),oI(e)}),lI=j(9,e=>{B(e.d,xg(e.j)),oI(e)}),uI=(e,t)=>B(e.b,t>0?` · `:``),dI=(e,t)=>{sI(e,t[0]?.pr?.headRefName),lI(e,t[0]?.pr?.headRefOid),cI(e,t[0]?.head),uI(e,t[1])},fI=(e,t)=>B(e.a,t>0?` · `:``),pI=(e,t)=>B(e.b,t),mI=(e,t)=>B(e.c,t),hI=O(1,`<!><!> #<!>`,`%b%c%`,0,(e,t)=>{pI(e,t[0]?.worktree),mI(e,t[0]?.pr?.number),fI(e,t[1])}),gI=O(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,dI),_I=F(141,e=>{hI(e,[e._._.c9,`id`]),gI(e,[e._._.c9,`id`])},e=>e._._),vI=gt(`i33`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{_I(e),z(e.a,V.dim),z(e.c,[V.mono,H.toastMeta])}),yI=D(6,`<span>local <!></span>`,` Db%`,NF),bI=M(7,e=>yI(e,+!e._._._.c8.has(e._._.d))),xI=F(140,bI,e=>e._._._),SI=e=>{xI(e),CI(e),DI(e),OI(e),AI(e),jI(e),MI(e),z(e.a,H.repoMeta),z(e.c,[V.chip,V.lane]),z(e.e,V.chip)},CI=F(23,bI,e=>e._._),wI=D(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,IF),TI=M(10,e=>R(e.c,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),EI=M(8,e=>B(e.d,e._._.g?e._._.g.headRefName:e._._.q)),DI=F(24,e=>{wI(e,+!e._._.g),TI(e),EI(e)},e=>e._._),OI=F(30,TI,e=>e._._),kI=M(9,e=>R(e.e,`title`,`${e._._.n} ${e._._.o}`)),AI=F(31,e=>{B(e.f,e._._.n),kI(e)},e=>e._._),jI=F(32,kI,e=>e._._),MI=F(34,e=>{TI(e),EI(e)},e=>e._._),NI=N(33,0,e=>B(e.b,e._.bn.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),PI=e=>{NI._(e),z(e.a,H.centerPad)},FI=F(132,I(`i37`,e=>kt(e,{onMount:function(){e._._._._._._.ba(e.a,()=>{cR(e._,!0)})}})),e=>e._._._._._._),II=e=>{FI(e),z(e.a,H.diffWait)},LI=M(11,e=>B(e.c,e._._._.b4.has(e._._.d)?`▸`:`▾`)),RI=F(131,LI,e=>e._._._),zI=I(`i36`,e=>k(e.a,`click`,function(){let t=new Set(e._._._.b4);t.delete(e._._.d)||t.add(e._._.d),GB(e._._._,t)})),BI=e=>{RI(e),UI(e),WI(e),JI(e),YI(e),XI(e),QI(e),$I(e),eL(e),z(e.a,H.repoSep),z(e.b,H.treeChev),z(e.d,H.repoWorktree),z(e.g,[V.chip,V.lane]),z(e.i,V.chip),zI(e)},VI=D(10,`<span>local <!></span>`,` Db%`,KF),HI=M(12,e=>VI(e,+!e._._._.c8.has(e._._.d))),UI=F(140,HI,e=>e._._._),WI=F(23,e=>{LI(e),HI(e)},e=>e._._),GI=D(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,QF,`<span> </span>`,` D `,YF),KI=M(15,e=>R(e.g,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),qI=M(13,e=>B(e.h,e._._.g?e._._.g.headRefName:e._._.q)),JI=F(24,e=>{GI(e,+!e._._.g),KI(e),qI(e)},e=>e._._),YI=F(25,e=>B(e.e,e._._.h),e=>e._._),XI=F(30,KI,e=>e._._),ZI=M(14,e=>R(e.i,`title`,`${e._._.n} ${e._._.o}`)),QI=F(31,e=>{B(e.j,e._._.n),ZI(e)},e=>e._._),$I=F(32,ZI,e=>e._._),eL=F(34,e=>{KI(e),qI(e)},e=>e._._),tL=N(26,0,e=>cv(e.a,e._.av)),nL=e=>{tL._(e),rL._(e),iL._(e),aL._(e),Pv(e.a),lv(e.a,DV(e)),yv(e.a),bv(e.a),Cv(e.a)},rL=N(26,0,e=>zv(e.a,e._.aw)),iL=N(26,0,e=>Iv(e.a,e._.bt)),aL=N(26,0,e=>wv(e.a,OV(e))),oL=F(126,e=>B(e.e,e._._.as?`, plus uncommitted`:``),e=>e._._),sL=e=>{oL(e),cL(e),lL(e),uL(e),dL(e)},cL=F(11,e=>B(e.a,xg(e._.h))),lL=F(12,e=>B(e.b,e._.i)),uL=F(13,e=>B(e.c,xg(e._.j))),dL=F(14,e=>B(e.d,e._.k)),fL=gt(`i34`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,sL),pL=e=>{Rr(e.a),Hr(e.a,fL(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},mL=M(6,e=>Br(e.a,`${e.d} #${e.f}`)),hL=j(3,mL),gL=j(5,mL),_L=(e,t)=>{hL(e,t[0]?.worktree),gL(e,t[0]?.pr?.number),vL(e,t[0]?.pr?.headRefName),yL(e,t[0]?.head),bL(e,t[0]?.localHead),xL(e,t[0]?.branch)},vL=j(8,P(lL)),yL=j(7,P(cL)),bL=j(9,P(uL)),xL=j(10,P(dL)),SL=F(126,e=>B(e.b,e._._.as?` — showing uncommitted changes only`:``),e=>e._._),CL=e=>{SL(e),wL(e)},wL=F(7,e=>B(e.a,e._.g)),TL=gt(`i30`,`already in <!><!>.`,`b%b%`,CL),EL=e=>{Rr(e.a),Hr(e.a,TL(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},DL=M(5,e=>Br(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),OL=j(3,DL),kL=j(4,DL),AL=(e,t)=>{OL(e,t[0]?.pr),kL(e,t[0]?.worktree),jL(e,t[0]?.base)},jL=j(6,P(wL)),ML=F(126,e=>B(e.b,e._._.as?` — showing uncommitted changes only`:``),e=>e._._),NL=e=>{ML(e),PL(e)},PL=F(5,e=>B(e.a,e._.e)),FL=gt(`i29`,`<!><!>.`,`%b%`,NL),IL=e=>{Rr(e.a),Hr(e.a,FL(e)),Ar(e.a,`warn`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},LL=(e,t)=>Br(e.a,`${t}: base not found`),RL=(e,t)=>{LL(e,t[0]?.worktree),zL(e,t[0]?.base)},zL=j(4,P(PL)),BL=M(2,e=>B(e.b,e._.az.trim()?`No matches in diffs.`:`No files match "${e._.ar}".`)),VL=N(33,1,BL),HL=e=>{VL._(e),UL._(e),z(e.a,H.centerPad)},UL=N(33,1,BL),WL=F(124,e=>{R(e.a,`disabled`,e._._.aq),B(e.b,e._._.aq?`Reloading…`:`Reload`)},e=>e._._),GL=I(`i31`,e=>k(e.a,`click`,function(){e._._.bj()})),KL=gt(`i32`,`<button> </button>`,` D `,e=>{WL(e),z(e.a,V.btn),GL(e)}),qL=N(31,0,e=>Kr(e.a,kV(e))),JL=e=>{qL._(e),Rr(e.a),Gr(e.a,rn({content:KL(e)})),Hr(e.a,vI(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Br(e.a,`GitHub is behind`),Fr(e.a),Lr(e.a,{})},YL=F(123,e=>B(e.a,e._._.ap),e=>e._._),XL=gt(`i28`,` `,` `,YL),ZL=e=>{Rr(e.a),Hr(e.a,XL(e)),Kr(e.a,AV(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},QL=M(1,e=>kN(e.a,e._._._._._._.an&&e._._._._._._.an?.key===e._._.j?e._._._._._._.an:null)),$L=F(122,QL,e=>e._._._._._._),eR=e=>{$L(e),nR(e),rR(e),iR(e),aR(e),oR(e),TN(e.a),MN(e.a,MV(e)),PN(e.a,jV(e))},tR=M(2,e=>jN(e.a,NV(e))),nR=F(143,tR,e=>e._._._._._._),rR=F(144,e=>AN(e.a,PV(e)),e=>e._._._._._._),iR=F(22,e=>{DN(e.a,e._._.i),tR(e)},e=>e._._),aR=F(23,e=>{NN(e.a,FV(e)),QL(e)},e=>e._._),oR=F(24,e=>ON(e.a,e._._.s),e=>e._._),sR=D(0,`<div></div>`,` `,II,bN,(e=>`/${e}&`)(` b`),eR),cR=A(1,e=>sR(e,+!!e.b)),lR=e=>cR(e,!1),uR=M(10,e=>R(e.a,`hidden`,!e._._._._.c0.has(e.j))),dR=F(136,uR,e=>e._._._._),fR=D(6,`<p>binary file</p>`,` `,OF,`<p>file too large to display</p>`,` `,DF,`<p>file could not be read</p>`,` `,EF,`<!><!><!>`,`b%`,lR),pR=M(21,e=>fR(e,e.o?0:e.p?1:e.q==null&&e.r==null?2:e.u?3:4),4),mR=A(20,e=>{nee(e,`a`,e.u),pR(e)}),hR=I(`i38`,e=>k(e.a,`toggle`,function(t,n){if(mR(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),gR=e=>{dR(e),bR(e),z(e.a,H.file),z(e.b,H.status),z(e.d,H.path),mR(e,!0),hR(e)},_R=P(oR),vR=j(18,e=>{SR(e,e.s.length),_R(e)}),yR=M(11,e=>vR(e,e._._._._.c4.get(e.j)||[])),bR=F(139,yR,e=>e._._._._),xR=D(5,`<span>💬 <!></span>`,` Db%`,AF),SR=j(19,e=>{xR(e,+!e.t),kF(e)}),CR=P(aR),wR=j(9,e=>{R(e.a,`data-key`,e.j),yR(e),uR(e),CR(e)}),TR=(e,t)=>{R(e.b,`data-status`,t),B(e.c,t)},ER=(e,t)=>{R(e.d,`title`,t),B(e.e,t)},DR=j(14,pR),OR=j(15,pR),kR=j(16,pR),AR=j(17,pR),jR=(e,t)=>NR(e,t[0]),MR=P(iR),NR=j(8,e=>{wR(e,e.i?.key),TR(e,e.i?.status),ER(e,e.i?.path),DR(e,e.i?.binary),OR(e,e.i?.tooLarge),kR(e,e.i?.old),AR(e,e.i?.new),MR(e)}),PR=O(0,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` E D l E m%l%`,gR,jR),FR=F(36,e=>PR(e,[e._._.s,`key`]),e=>e._._),IR=e=>{FR(e),z(e.a,H.files)},LR=M(5,e=>R(e.a,`hidden`,!e._.w&&!e._.g&&e._._.b3!==e._.d),3),RR=F(130,LR,e=>e._._),zR=e=>{RR(e),HR(e),WR(e),GR._(e),qR._(e),JR._(e),YR._(e),z(e.a,H.repoSection)},BR=D(2,`<div></div>`,` `,IR),VR=M(4,e=>BR(e,e._._.bp>1&&e._._.b4.has(e._.d)?1:0),2),HR=F(131,VR,e=>e._._),UR=D(1,`<button><span> </span><span> </span><!><span>on <!></span><span>vs <!></span><!></button>`,` D D l D l%b Db%l Db%l%`,BI,`<p><!><span>on <!></span><span>vs <!></span><!></p>`,` D%b Db%l Db%l%`,SI),WR=F(134,e=>{UR(e,e._._.bp>1?0:1),VR(e)},e=>e._._),GR=N(0,0,e=>{LR(e),VR(e)}),KR=M(3,e=>R(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),qR=N(0,0,e=>{KR(e),LR(e)}),JR=N(0,0,KR),YR=N(0,0,LR),XR=P(FR),ZR=j(18,e=>{oz(e,e.s.length),XR(e)}),QR=M(4,e=>ZR(e,e._.c1.get(e.d)||[])),$R=Xe(34,QR),ez=e=>{$R._(e),rz._(e)},tz=(e,t)=>lz(e,t.length),nz=M(5,e=>tz(e,e._.c2.get(e.d)||[])),rz=Xe(34,nz),iz=D(0,`<section><!><!></section>`,` D%b%`,zR),az=M(20,e=>iz(e,e.t||e.g?0:1)),oz=j(19,az),sz=P(WI,CI),cz=j(3,e=>{QR(e),nz(e),GR(e),sz(e)}),lz=j(22,YR),uz=P(JI,DI),dz=j(6,e=>{pz(e,e.g?.number),mz(e,e.g?.url),hz(e,e.g?.title),gz(e,e.g?.headRefName),az(e),qR(e),uz(e)}),fz=(e,t)=>{cz(e,t[0]?.id),dz(e,t[0]?.pr),vz(e,t[0]?.worktree),yz(e,t[0]?.head),bz(e,t[0]?.base),xz(e,t[0]?.baseSha),Sz(e,t[0]?.full_name),Cz(e,t[0]?.branch),wz(e,t[0]?.localHead)},pz=j(8,P(XF,FF)),mz=j(9,P($F,LF)),hz=j(10,P(tI,zF)),gz=j(11,P(nI,BF)),_z=P(YI),vz=j(7,e=>{JR(e),_z(e)}),yz=j(12,P(XI,OI,rI,VF)),bz=j(13,P(QI,AI,iI,HF)),xz=j(14,P($I,jI,aI,UF)),Sz=j(15,P(JF)),Cz=j(16,P(eL,MI,GF,MF)),wz=j(17,P(qF,PF)),Tz=N(10,0,e=>i_(e.a,e._.aj)),Ez=e=>{Tz._(e),Dz._(e),Oz._(e),Qg(e.a)},Dz=N(10,0,e=>a_(e.a,e._.ci)),Oz=N(10,0,e=>o_(e.a,e._.cj)),kz=I(`i27`,e=>k(e.a,`click`,function(){e._.ai?.()})),Az=e=>{z(e.a,[H.iconBtn,H.backBtn]),ts(e.b),ns(e.b,14),rs(e.b),kz(e)},jz=M(84,I(`i41`,e=>kt(e,{active:e.af,load:e.bg,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.ae||``,lastNonce:e.ag||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,Tn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.ad&&e.bi()},{signal:t.signal}),Tn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.aq)return;let r=t.data,i=r&&r[e.ad];if(!i)return;let a=pg(i);!a||!e.bd||a===e.bd||e.bl()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.bj(),this.wasActive=!!this.active;let t=e.ae||``,n=e.ag||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bb(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bf&&clearTimeout(e.bf),this.abort.abort()}})),11),Mz=j(83,jz),Nz=M(82,e=>Mz(e,IV(e))),Pz=j(81,e=>{Nz(e),jz(e)}),Fz=M(79,e=>Pz(e,LV(e))),Iz=j(78,e=>{Fz(e),jz(e)}),Lz=M(76,e=>Iz(e,RV(e)),4),Rz=j(73,e=>{Lz(e),jz(e)}),zz=j(98,P(dR)),Bz=(e,t)=>WP(e.a9,t),Vz=M(101,e=>Bz(e,e.bn.filter(t=>(e.c2.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.c2.get(t.id)||[]})))),Hz=j(100,e=>{Vz(e),rz(e)}),Uz=M(95,e=>Hz(e,new Map(e.bn.map(t=>[t.id,e.bw.filter(e=>e.repo===t.id)])))),Wz=j(94,e=>{SF(e.aa,e.bw),bV(e,e.bw?.length),zz(e,new Set(e.bw.map(e=>e.key))),Uz(e)}),Gz=M(93,e=>Wz(e,e.bu?e.bt.filter(t=>e.bu.has(t.key)||t.key===e.b2):e.bt),2),Kz=j(91,e=>{Gz(e),iL(e)}),qz=M(89,e=>Kz(e,(()=>{let t=gg(e.ar);return e.bq.filter(e=>t(e.key))})())),Jz=j(88,e=>{yV(e,e.bq?.length),qz(e)}),Yz=j(106,P(UI,xI)),Xz=O(32,fr,(e=>`/${e}&`)(pr),pL,_L),Zz=(e,t)=>{Yz(e,new Set(t.map(e=>e.id))),Xz(e,[t,`id`])},Qz=O(29,fr,(e=>`/${e}&`)(pr),IL,RL),$z=O(30,fr,(e=>`/${e}&`)(pr),EL,AL),eB=O(34,`<!><!><!>`,`b%`,ez,fz),tB=j(110,qL),nB=M(108,e=>tB(e,BV(e))),rB=P(_I),iB=j(107,e=>{SV(e,e.c9?.length),nB(e),rB(e)}),aB=M(86,e=>iB(e,e.bn.filter(t=>t.githubDrift&&!e.b5.has(t.id)))),oB=j(85,e=>{vV(e,e.bn.length),Jz(e,e.bn.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Zz(e,e.bn.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),Qz(e,[e.bn.filter(e=>e.baseMissing),`id`]),$z(e,[e.bn.filter(e=>e.contained&&e.files.length),`id`]),eB(e,[e.bn,`id`]),Uz(e),Vz(e),aB(e),NI(e)}),sB=j(99,$R),cB=e=>{sB(e,new Map(e.bn.map(t=>[t.id,e.bq.filter(e=>e.repo===t.id)])))},lB=j(116,Dz),uB=M(114,e=>lB(e,VV(e)),2),dB=j(117,Oz),fB=M(115,e=>dB(e,HV(e)),3),pB=D(33,`<p> </p>`,` D `,PI,`<p> </p>`,` D `,HL),mB=M(97,e=>pB(e,e.ak&&!e.bs?0:e.ak&&!e.by&&!e.b1?1:2),3),hB=A(46,e=>{Rz(e,zV(e)),oB(e,e.ak||[]),cB(e),uB(e),fB(e),mB(e)}),gB=(e,t)=>{VP(e.a9,t),_F(e.aa,t)},_B=P(bR),vB=j(102,e=>{gB(e,new Set(e.c4.keys())),_B(e)}),yB=j(112,P(rR)),bB=j(111,P(nR)),xB=M(50,e=>bB(e,WV(e)),2),SB=A(47,e=>{eV(e,e.al?.length),vB(e,(()=>{let t=new Map;for(let n of e.al){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),yB(e,UV(e)),xB(e),uB(e),fB(e)}),CB=P($L),wB=A(49,e=>{xB(e),CB(e)}),TB=D(28,fr,(e=>`/${e}&`)(pr),ZL),EB=P(YL),DB=A(51,e=>{TB(e,+!e.ap),EB(e)}),OB=P(WL),kB=A(52,e=>{z(e.o,[H.iconBtn,{[H.spinning]:e.aq}]),R(e.o,`disabled`,e.aq),R(e.v,`disabled`,e.aq),R(e.w,`disabled`,e.aq),R(e.x,`disabled`,e.aq),jz(e),OB(e)}),AB=A(53,e=>{T_(e.z,e.ar),qz(e),VL(e)}),jB=P(ML,SL,oL),MB=A(54,e=>{z(e.v,[H.scopeOpt,{[H.scopeOn]:!e.as}]),R(e.v,`aria-pressed`,e.as?`false`:`true`),z(e.w,[H.scopeOpt,{[H.scopeOn]:e.as}]),R(e.w,`aria-pressed`,e.as?`true`:`false`),z(e.x,[H.scopeChip,{[H.scopeOn]:e.as}]),R(e.x,`aria-pressed`,e.as?`true`:`false`),R(e.x,`title`,e.as?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),B(e.y,e.as?`Dirty`:`Clean`),Lz(e),Fz(e),jB(e)}),NB=A(55,e=>{z(e.m,[H.treeToggle,{[H.on]:e.at}]),R(e.m,`title`,e.at?`Hide file tree`:`Show file tree`),HP(e.a9,e.at)}),PB=A(56,e=>mF(e.aa,e.au)),FB=D(26,iv,(e=>`/${e}&`)(av),nL),IB=A(57,e=>{z(e.s,[H.iconBtn,H.findBtn,{[H.on]:e.av}]),FB(e,+!e.av),tL(e)}),LB=j(119),RB=I(`i40`,e=>{e.af&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`[data-palette]`)||(t.preventDefault(),IB(e,!0),BB(e,e.aw+1)))},{capture:!0,signal:Ae(e,0)})}),zB=M(59,e=>{ke(e,0),RB(e)}),BB=A(58,e=>{LB(e,GV(e)),zB(e),rL(e)}),VB=j(92,Gz),HB=e=>{VB(e,e.az.trim()?new Set(e.b0):null)},UB=A(60,e=>{tV(e,e.ay?.query),nV(e,e.ay?.keys),rV(e,e.ay?.hit),HB(e)}),WB=P(HR,RI),GB=A(66,e=>{IP(e.a9,e.b4),WB(e)}),KB=A(67,e=>{aB(e),nB(e)}),qB=(e,t)=>{cV(e,t.cbs),lV(e,t.io)},JB=(e,t)=>{uV(e,t.sig),dV(e,t.timer)},YB=j(120),XB=j(118,e=>{GP(e.a9,e.ck),CF(e.aa,e.ck),YB(e,KV(e))}),ZB=I(`i39`,e=>{k(e.m,`click`,function(){NB(e,!e.at),Zn(e.at)}),k(e.o,`click`,function(){e.bj()}),k(e.q,`click`,function(){PB(e,!0)}),k(e.s,`click`,function(){e.cl()}),k(e.v,`click`,function(){e.as&&(MB(e,!1),$n(!1),e.bg(!1))}),k(e.w,`click`,function(){e.as||(MB(e,!0),$n(!0),e.bg(!0))}),k(e.x,`click`,function(){let t=!e.as;MB(e,t),$n(t),e.bg(t)})});function QB(e){z(e.a,H.diffView),z(e.b,H.diffCol),z(e.e,H.headText),z(e.f,H.pageTitle),z(e.g,H.diffStats),z(e.l,H.diffTools),kp(e.n),Ap(e.n,14),jp(e.n),os(e.p),ss(e.p,14),cs(e.p),z(e.q,[V.btn,H.filesBtn]),u_(e.t),d_(e.t,14),f_(e.t),z(e.u,H.scope),A_(e.z),E_(e.z,XV(e)),z(e.a1,H.diffMain),zP(e.a9),LP(e.a9,YV(e)),hF(e.aa,JV(e)),hB(e,null),SB(e,[]),wB(e,null),DB(e,null),kB(e,!1),AB(e,``),MB(e,Qn()),NB(e,Xn()),PB(e,!1),IB(e,!1),BB(e,0),UB(e,{query:``,hit:null,keys:[]}),GB(e,new Set),KB(e,new Set),qB(e,{io:null,cbs:null}),JB(e,{sig:``,timer:0}),XB(e,qV(e)),ZB(e)}var $B=D(10,Dg,(e=>`/${e}&`)(Og),Ez),eV=j(48,e=>{z(e.c,[H.diffHead,{[H.headWithSend]:e.am>0}]),B(e.j,e.am?`· ${vt(e.am)} comment${vt(e.am===1?``:`s`)}`:``),$B(e,+!e.am)}),tV=j(61,UL),nV=j(62),rV=j(63,e=>{iV(e,e.b1?.key),aV(e,e.b1?.repo),mB(e)}),iV=j(64,Gz),aV=j(65,P(RR)),oV=j(72),sV=M(71,e=>oV(e,ZV(e))),cV=j(69,sV),lV=j(70,sV),uV=j(75,e=>{Lz(e),jz(e)}),dV=j(77,e=>{Nz(e),jz(e)}),fV=j(80,jz),pV=j(113,e=>{uB(e),fB(e)}),mV=j(39,e=>{fV(e,QV(e)),pV(e,$V(e)),Lz(e),jz(e),xB(e)}),hV=j(40,e=>{Lz(e),jz(e)}),gV=j(41,e=>{jz(e),zB(e)}),_V=j(42,jz),vV=j(87,P(WR)),yV=j(90,e=>{B(e.h,e.bs),B(e.i,e.bs===1?``:`s`),bF(e.aa,e.bs),mB(e)}),bV=j(96,e=>{B(e.r,e.by),mB(e)}),xV=D(31,fr,(e=>`/${e}&`)(pr),JL),SV=(e,t)=>xV(e,+!t),CV=j(43,fB),wV=D(3,(e=>`<button title="Back to terminal">${e}</button>`)($o),(e=>` D/${e}&l`)(es),Az),TV=j(44,e=>wV(e,+!e.ai)),EV=j(45,Tz);function DV(e){return t=>{IB(e._,t)}}function OV(e){return function(t){e._.cm(t)}}function kV(e){return function(){e._.cc()}}function AV(e){return function(){DB(e._,null)}}function jV(e){return function(t){DB(e._._._._._._,t)}}function MV(e){return function(){wB(e._._._._._._,null)}}function NV(e){return function(t){e._._._._._._.cd(e._._.i,t)}}function PV(e){return function(t){e._._._._._._.ce(t)}}function FV(e){return function(t){wB(e._._._._._._,{key:e._._.j,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function IV(e){return()=>{e.bf&&clearTimeout(e.bf),e.bf=setTimeout(()=>{e.bf=0,e.bj()},250)}}function LV(e){return()=>(KB(e,new Set),e.bg(e.as,!0))}function RV(e){return async(t=e.as,n=!1)=>{kB(e,!0),DB(e,null);try{let r=new URLSearchParams;t&&r.set(`uncommitted`,`1`),n&&r.set(`refresh`,`1`);let i=r.size?`?${r}`:``,[a,o]=await Promise.all([sn(`/api/workspaces/${e.ad}/diff${i}`),sn(`/api/workspaces/${e.ad}/review`)]);hB(e,a),SB(e,o.comments||[]),e.bd=fg(a),e.ae&&e.bb(e.ae)}catch(t){DB(e,String(t.message||t))}kB(e,!1)}}function zV(e){return t=>{if(!t)return;let n=e.ak||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set;for(let e of n)(!r||e.id!==r.id)&&i.add(e.id);GB(e,i);let a=Date.now(),o=()=>{let e=scrollEl?.(),n=e?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!e||!n){Date.now()-a<2500&&requestAnimationFrame(o);return}let r=n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:Math.max(0,r-8)})};requestAnimationFrame(o)}}function BV(e){return()=>{KB(e,new Set([...e.b5,...e.c9.map(e=>e.id)]))}}function VV(e){return async()=>await dg(yg(e.al,e.ak))?(await e.cf(),!0):(DB(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function HV(e){return async t=>{try{await sn(`/api/sessions/${t}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${yg(e.al,e.ak)}`,...hg()||{}})}),await e.cf(),e.ah?.(t)}catch(t){DB(e,String(t.message||t))}}}function UV(e){return async t=>{SB(e,e.al.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function WV(e){return async(t,n)=>{let r=e.an;wB(e,null);try{let i=await sn(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:t.repo,path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});SB(e,e.al.concat(i))}catch(t){DB(e,String(t.message||t))}}}function GV(e){return()=>{IB(e,!0),BB(e,e.aw+1)}}function KV(e){return t=>{UB(e,t),t.hit&&setTimeout(()=>e.ck(t.hit.key),0)}}function qV(e){return t=>{let n=e.a1.querySelector(`details[data-key="${CSS.escape(t)}"]`);n&&(n.open=!0,n.scrollIntoView({block:`start`}))}}function JV(e){return t=>{PB(e,t)}}function YV(e){return t=>{GB(e,t)}}function XV(e){return t=>{AB(e,t)}}function ZV(e){return(t,n)=>{e.b7??=new WeakMap,e.b8??=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.b8.unobserve(n.target),e.b7.get(n.target)?.())},{rootMargin:`600px 0px`}),e.b7.set(t,n),e.b8.observe(t)}}function QV(e){return async()=>{try{SB(e,(await sn(`/api/workspaces/${e.ad}/review`)).comments||[])}catch{}}}function $V(e){return async()=>{SB(e,[]),wB(e,null),await fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}L(`i16`,DV),L(`i17`,OV),L(`i19`,kV),L(`i18`,AV),L(`i24`,jV),L(`i22`,MV),L(`i21`,NV),L(`i23`,PV),L(`i20`,FV),L(`i5`,IV),L(`i4`,LV),L(`i2`,RV),L(`i1`,zV),L(`i6`,BV),L(`i10`,VV),L(`i11`,HV),L(`i8`,UV),L(`i7`,WV),L(`i13`,GV),L(`i14`,KV),L(`i12`,qV),L(`i26`,JV),L(`i25`,YV),L(`i15`,XV),L(`i0`,ZV),L(`i3`,QV),L(`i9`,$V);var J={page:`_bz`,body:`_bA`,content:`_bB`,pageHead:`_bC`,backBtn:`_bD`,pageHeadText:`_bE`,pageMeta:`_bF`,statusPill:`_bG`,statusOn:`_bH`,statusOff:`_bI`,progress:`_bJ`,section:`_bK`,sectionHead:`_bL`,sectionCount:`_bM`,sectionBtn:`_bN`,groupLabel:`_bO`,pickerWrap:`_bP`,cardList:`_bQ`,card:`_bR`,pending:`_bS`,cardMain:`_bT`,cardTitle:`_bU`,cardMeta:`_bV`,cardSub:`_bW`,cardTag:`_bX`,cardAction:`_bY`,dangerAction:`_bZ`,armed:`_b0`,okAction:`_b1`,prState:`_b2`,portLink:`_b3`,emptyNote:`_b4`,dangerZone:`_b5`,dangerRow:`_b6`,dangerBtn:`_b7`,dangerHint:`_b8`,pageHeadAside:`_b9`,iconBtn:`_b_ _eg`,spinning:`_ca _eh`},eH=((e,t,n)=>`<div role=region><div><div><header><button type=button title="Back to terminal" aria-label="Back to terminal">${e}</button><div><h1> </h1><p> </p></div><div><span> </span></div></header><!><!><section><div><h2>Repos</h2><span> </span><div></div><button title="Refresh repo list" aria-label="Refresh repo list">${t}</button></div><ul><!><!></ul><!><div>${n}</div></section><!><!><section><div><h2>Workspace</h2></div><div><!><button type=button> </button></div><p>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`)($o,is,us),tH=((e,t,n)=>` D D D D D/${e}&l D D l D m D D n%b%b D Db D l b D/${t}&m D%b%l%b D0${n}&m%b%b D b D%b D m o`)(es,as,ds),nH=new Map,rH=I(`k20`,e=>k(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),iH=e=>{z(e.a,[V.chip,J.portLink]),rH(e)},aH=j(3,e=>{R(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),B(e.b,e.d)}),oH=O(0,`<button>:<!></button>`,` Db%`,iH,(e,t)=>aH(e,t[0])),sH=N(4,0,e=>oH(e,[e._.k,e=>String(e)])),cH=e=>{sH._(e),z(e.a,J.cardMeta)},lH=e=>z(e.a,J.prState),uH=e=>z(e.a,J.prState),dH=N(0,0,e=>B(e.b,e._.e)),fH=e=>{dH._(e),z(e.a,[J.groupLabel,V.mono])},pH=e=>z(e.a,J.emptyNote),mH=e=>{z(e.a,[J.card,J.pending]),z(e.b,V.spin),z(e.c,J.cardMain),z(e.d,J.cardSub)},hH=(e,t)=>B(e.e,t),gH=(e,t)=>hH(e,t[0]),_H=e=>z(e.a,V.spin),vH=N(7,0,e=>B(e.b,e._.o)),yH=e=>{vH._(e),z(e.a,[J.cardTag,V.mono])},bH=I(`k21`,e=>k(e.f,`click`,function(){e._._.bn(e.m)})),xH=e=>{z(e.a,J.card),z(e.b,J.cardMain),z(e.c,[J.cardTitle,V.mono]),z(e.f,[J.cardAction,J.dangerAction]),bH(e)},SH=(e,t)=>R(e.b,`title`,t),CH=(e,t)=>B(e.d,t),wH=D(4,`<span></span>`,` `,cH),TH=(e,t)=>wH(e,+!t),EH=j(12,e=>{R(e.f,`title`,`Kill ${e.m}`),R(e.f,`aria-label`,`Kill process ${e.m}`)}),DH=(e,t)=>{SH(e,t[0]?.args),CH(e,t[0]?.cmd),OH(e,t[0]?.ports),EH(e,t[0]?.pid)},OH=j(10,e=>{TH(e,e.k?.length),sH(e)}),kH=O(4,`<li><div><span> </span><!></div><button type=button>×</button></li>`,` D D D l%l `,xH,DH),AH=N(31,0,e=>kH(e,[e._.bt,`pid`])),jH=e=>{AH._(e),MH._(e),z(e.a,J.section),z(e.b,J.sectionHead),z(e.c,J.sectionCount),z(e.e,J.cardList)},MH=N(31,0,e=>B(e.d,e._.bu)),NH=N(10,0,e=>R(e.a,`title`,`Confirm #${e._.u} is done — remove from this list`)),PH=I(`k18`,e=>k(e.a,`click`,function(){e._._._._.be(e._._.g,e._.u)})),FH=e=>{NH._(e),z(e.a,[J.cardAction,J.okAction]),PH(e)},IH=(e,t)=>R(e.f,`data-state`,t),LH=(e,t)=>B(e.g,t),RH=M(15,e=>{IH(e,e.n===`OPEN`&&e.o?`open`:(e.n||`open`).toLowerCase()),LH(e,e.n===`OPEN`&&e.o?`draft`:(e.n||`open`).toLowerCase())}),zH=D(10,`<button>✓</button>`,` `,FH),BH=D(7,`<span data-state=open title=Approved>✓</span>`,` `,uH,`<span data-state=closed title="Changes requested">✗</span>`,` `,lH),VH=M(19,e=>BH(e,e.n===`OPEN`&&e.s===`APPROVED`?0:e.n===`OPEN`&&e.s===`CHANGES_REQUESTED`?1:2)),HH=j(13,e=>{zH(e,+(e.n===`OPEN`)),RH(e),VH(e)}),UH=j(14,RH),WH=e=>{z(e.a,J.card),z(e.b,J.cardMain),z(e.c,J.cardTitle),z(e.e,J.cardMeta),z(e.f,J.prState),z(e.i,[J.cardTag,V.mono])},GH=(e,t)=>R(e.b,`href`,t),KH=(e,t)=>B(e.d,t),qH=j(18,VH),JH=j(20,e=>{B(e.j,e.u),NH(e)}),YH=(e,t)=>{HH(e,t[0]?.state),UH(e,t[0]?.isDraft),GH(e,t[0]?.url),KH(e,t[0]?.title),qH(e,t[0]?.reviewDecision),JH(e,t[0]?.number)},XH=D(0,`<p> </p>`,` D `,fH),ZH=F(101,e=>XH(e,e._._.bs>1?0:1),e=>e._._),QH=e=>{ZH(e),z(e.b,J.cardList)},$H=O(1,`<li><a target=_blank rel=noopener><span> </span><span><span> </span><!><span>#<!></span></span></a><!></li>`,` D D D l D D l%b Db%n%`,WH,YH),eU=(e,t)=>$H(e,[t,`number`]),tU=(e,t)=>{nU(e,t[0]?.worktree),eU(e,t[0]?.prs),rU(e,t[0]?.full_name)},nU=j(4,dH),rU=j(6),iU=F(99,e=>B(e.b,e._._.bo),e=>e._._),aU=I(`k17`,e=>k(e.a,`click`,function(){e._._.bd()})),oU=e=>{iU(e),z(e.a,[V.btn,J.sectionBtn]),aU(e)},sU=N(15,0,e=>B(e.c,e._.av)),cU=e=>{sU._(e),z(e.a,J.progress),z(e.b,V.spin)},lU=M(2,e=>{z(e.a,[J.cardAction,J.dangerAction,{[J.armed]:e._._.au===e._.m}]),B(e.b,e._._.au===e._.m?`Remove?`:`×`)}),uU=M(3,e=>R(e.a,`title`,e._._.au===e._.m?`Really remove ${e._.l}/? Uncommitted changes are lost.`:`Remove ${e._.l}/`),2),dU=F(97,e=>{lU(e),uU(e)},e=>e._._),fU=I(`k15`,e=>k(e.a,`click`,function(){e._._.au===e._.k?.full_name?(uW(e._._,null),e._._.bl(e._.k)):(uW(e._._,e._.k?.full_name),setTimeout(()=>{uW(e._._,null)},4e3))})),pU=e=>{dU(e),mU._(e),hU._(e),fU(e)},mU=N(8,1,uU),hU=N(8,1,e=>{lU(e),uU(e)}),gU=N(35,1,e=>R(e.a,`disabled`,!!e._.ar)),_U=I(`k23`,e=>k(e.a,`click`,function(){e._.bm(`restore`)})),vU=e=>{gU._(e),z(e.a,[V.btn,J.dangerBtn]),_U(e)},yU=N(35,0,e=>{R(e.a,`disabled`,!!e._.ar),B(e.b,e._.ar===`archive`?`Archiving…`:`Archive`)}),bU=I(`k22`,e=>k(e.a,`click`,function(){e._.bm(`archive`)})),xU=e=>{yU._(e),z(e.a,[V.btn,J.dangerBtn]),bU(e)},SU=F(95,e=>B(e.a,e._._.aq),e=>e._._),CU=gt(`k14`,` `,` `,SU),wU=e=>{Rr(e.a),Hr(e.a,CU(e)),Pr(e.a,`inline`),Kr(e.a,rG(e)),Gr(e.a),Fr(e.a),Ar(e.a),Br(e.a),Lr(e.a,{})},TU=D(8,`<span></span>`,` `,_H,`<button> </button>`,` D `,pU),EU=M(13,e=>TU(e,+!e._.ao.has(e.m))),DU=Xe(24,EU),OU=e=>{DU._(e),z(e.a,J.card),z(e.b,J.cardMain),z(e.c,[J.cardTitle,V.mono]),z(e.e,J.cardMeta),z(e.f,J.cardSub)},kU=j(11,e=>{B(e.d,e.l),mU(e)}),AU=j(12,e=>{B(e.g,e.m),EU(e),hU(e)}),jU=D(7,`<span title="Base branch">⎇ <!></span>`,` Db%`,yH),MU=M(16,e=>jU(e,+(e.o===e.p))),NU=j(14,e=>{MU(e),vH(e)}),PU=j(15,MU),FU=(e,t)=>IU(e,t[0]),IU=j(10,e=>{kU(e,e.k?.worktree),AU(e,e.k?.full_name),NU(e,e.k?.base_branch),PU(e,e.k?.default_branch)}),LU=N(30,0,e=>{z(e.e,[J.iconBtn,{[J.spinning]:e._.an}]),R(e.e,`disabled`,e._.an)}),RU=I(`k19`,e=>k(e.e,`click`,function(){e._.bc()})),zU=e=>{LU._(e),VU._(e),UU._(e),z(e.a,J.section),z(e.b,J.sectionHead),z(e.c,V.spacer),os(e.f),ss(e.f,14),cs(e.f),RU(e)},BU=D(3,`<button title="Confirm every merged/closed PR is done — remove them from this list">Clear <!></button>`,` Db%`,oU),VU=N(30,0,e=>BU(e,+!e._.bo)),HU=O(6,`<!><!><ul></ul>`,`b%b `,QH,tU),UU=N(30,0,e=>HU(e,[e._.br,`full_name`])),WU=it(88),GU=A(46,e=>{z(e.v,[J.iconBtn,{[J.spinning]:e.ak}]),R(e.v,`disabled`,e.ak)}),KU=A(49,LU),qU=j(82,e=>Tc(e.a2,iG(e))),JU=M(81,e=>qU(e,aG(e)),2),YU=j(83),XU=M(80,e=>YU(e,oG(e)),2),ZU=j(79,e=>{JU(e),XU(e)}),QU=O(25,`<li><span></span><div><span>Adding <!>…</span></div></li>`,` D b D Db%`,mH,gH),$U=M(78,e=>QU(e,[[...e.ao].filter(t=>!e.bf.has(t)),e=>e])),eW=A(50,e=>{EW(e,e.ao?.size),ZU(e,sG(e)),JU(e),XU(e),$U(e),DU(e)}),tW=D(14,fr,(e=>`/${e}&`)(pr),wU),nW=P(SU),rW=A(52,e=>{tW(e,+!e.aq),nW(e)}),iW=M(73,I(`k25`,e=>kt(e,{busyCount:e.ap,pendingAction:e.ar,onMount:function(){let t=new AbortController,n=t.signal;return Tn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.az&&dW(e,t.data.message)},{signal:n}),e.b8(n),e.b9(n,!1).then(()=>e.b9(n,!0)),{abort:t}},onDestroy:function(){this.abort.abort()}})),4),aW=D(15,`<p><span></span> </p>`,` D b `,cU),oW=M(58,e=>aW(e,e.ar&&e.av?0:1)),sW=M(55,e=>B(e.ab,e.ar===`delete`?`Deleting…`:e.as?`Really delete?`:`Delete`)),cW=A(53,e=>{R(e.e,`disabled`,!!e.ar),R(e.aa,`disabled`,!!e.ar),iW(e),oW(e),sW(e),yU(e),gU(e)}),lW=A(54,e=>{z(e.aa,[V.btn,V.danger,J.dangerBtn,{[V.armed]:e.as}]),sW(e)}),uW=A(56,P(dU)),dW=A(57,e=>{oW(e),sU(e)}),fW=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},pW=I(`k24`,e=>{k(e.e,`click`,function(){e.aj?.()}),k(e.v,`click`,function(){WU(e)()}),k(e.aa,`click`,function(){e.as?(lW(e,!1),e.bm(`delete`)):(lW(e,!0),setTimeout(()=>{lW(e,!1)},4e3))})});function mW(e){z(e.a,J.page),z(e.b,J.body),z(e.c,J.content),z(e.d,J.pageHead),z(e.e,[J.iconBtn,J.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,J.pageHeadText),z(e.j,[J.pageMeta,V.mono]),z(e.l,J.pageHeadAside),z(e.q,J.section),z(e.r,J.sectionHead),z(e.s,J.sectionCount),z(e.u,V.spacer),os(e.w),ss(e.w,14),cs(e.w),z(e.x,J.cardList),z(e.a1,J.pickerWrap),tt(e,28,ZW),_c(e.a2),bc(e.a2,lG(e)),$s(e.a2,cG(e)),Qs(e.a2),Ec(e.a2),z(e.a6,[J.section,J.dangerZone]),z(e.a7,J.sectionHead),z(e.a8,J.dangerRow),z(e.ac,J.dangerHint),GU(e,!1),KU(e,!1),eW(e,new Set),rW(e,null),cW(e,null),lW(e,!1),uW(e,null),dW(e,null),fW(e,nt(e)),pW(e)}var hW=j(91,e=>{nG(e,e.bt.length),AH(e)}),gW=A(47,e=>hW(e,e.al||[])),_W=P(iU),vW=j(86,e=>{VU(e),_W(e)}),yW=j(89,e=>{eG(e,e.br?.length),UU(e)}),bW=j(75),xW=M(72,e=>bW(e,uG(e)),2),SW=A(48,e=>{vW(e,(e.am||[]).reduce((e,t)=>e+t.prs.filter(e=>e.state!==`OPEN`).length,0)),yW(e,(e.am||[]).filter(e=>e.prs.length)),xW(e)}),CW=(e,t)=>{gW(e,nH.get(`procs:${t}`)||null),SW(e,nH.get(`prs:${t}`)||null)},wW=D(26,`<p>No repos yet — search below to add one.</p>`,` `,pH),TW=M(69,e=>wW(e,!e.b6&&!e.ap?0:1)),EW=j(51,e=>{iW(e),TW(e)}),DW=e=>{R(e.j,`title`,e.b3||e.b4),B(e.k,e.b3||e.b4)},OW=Ye(59,e=>{kW(e,e.ax),XU(e),DW(e)}),kW=e=>{LW(e,e.ax?.id),BW(e,e.ax?.repos),HW(e,e.ax?.name),UW(e,e.ax?.display_path),WW(e,e.ax?.path),KW(e,e.ax?.status)},AW=j(85),jW=j(70,e=>{AW(e,dG(e)),iW(e)}),MW=j(74),NW=j(71,e=>{MW(e,pG(e)),iW(e),xW(e)}),PW=j(76),FW=j(84),IW=M(62,e=>FW(e,gG(e))),LW=j(61,e=>{jW(e,fG(e)),NW(e,mG(e)),PW(e,hG(e)),iW(e),xW(e),JU(e),IW(e)}),RW=j(77,e=>{Sc(e.a2,e.bf),$U(e)}),zW=O(24,`<li><div><span><!>/</span><span><span> </span><!></span></div><!></li>`,` D D D%l D D l%m%`,OU,FU),BW=j(63,e=>{VW(e,e.b1?.length),RW(e,new Set(e.b1.map(e=>e.full_name))),zW(e,[e.b1,`full_name`])}),VW=j(68,e=>{B(e.t,e.b6),TW(e)}),HW=j(64,e=>B(e.i,e.b2)),UW=j(65),WW=j(66),GW=D(35,`<button type=button> </button>`,` D `,xU,`<button type=button>Restore</button>`,` `,vU),KW=j(67,e=>{z(e.m,[J.statusPill,e.b5===`active`?J.statusOn:J.statusOff]),B(e.n,e.b5===`active`?`Active`:`Archived`),GW(e,e.b5===`active`?0:1)}),qW=M(44,e=>OW(e,e.af,e.ah)),JW=j(41,e=>{CW(e,e.af?.id),qW(e)}),YW=j(43,qW),XW=j(45,IW),ZW=lt(`k16`,j(88)),QW=D(30,(e=>`<section><div><h2>Pull requests</h2><div></div><!><button title="Refresh PRs" aria-label="Refresh PRs">${e}</button></div><!></section>`)(is),(e=>` D Db b%b D/${e}&m%l`)(as),zU),$W=P(ZH),eG=j(90,e=>{QW(e,+!e.bs),$W(e)}),tG=D(31,`<section><div><h2>Running</h2><span> </span></div><ul></ul></section>`,` D Db D m `,jH),nG=j(92,e=>{tG(e,+!e.bu),MH(e)});function rG(e){return function(){rW(e._,null)}}function iG(e){return function(t,n){e.bk(t,n)}}function aG(e){return async(t,n)=>{if(!(!t||e.ao.has(t))){rW(e,null),e.bh(t,!0);try{OW(e,await sn(`/api/workspaces/${e.az}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){rW(e,String(t.message||t))}e.bh(t,!1)}}}function oG(e){return async t=>{if(!e.ao.has(t.full_name)){rW(e,null),e.bh(t.full_name,!0);try{await sn(`/api/workspaces/${e.ax?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),OW(e,{...e.ax,repos:(e.ax?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){rW(e,String(t.message||t))}e.bh(t.full_name,!1)}}}function sG(e){return(t,n)=>{let r=new Set(e.ao);n?r.add(t):r.delete(t),eW(e,r)}}function cG(e){return function(t){GU(e,t)}}function lG(e){return function(t){rW(e,t)}}function uG(e){return async()=>{for(let t of e.am||[])for(let n of t.prs)n.state!==`OPEN`&&await sn(`/api/workspaces/${e.az}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t.full_name,number:n.number})}).catch(()=>{});await e.b9(void 0,!1)}}function dG(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.b8(void 0),500)}}function fG(e){return async t=>{try{let n=await sn(`/api/workspaces/${e.az}/procs`,{signal:t});gW(e,n),nH.set(`procs:${e.az}`,n)}catch{}}}function pG(e){return async()=>{KU(e,!0),await e.b9(void 0,!0),KU(e,!1)}}function mG(e){return async(t,n)=>{try{let r=await sn(`/api/workspaces/${e.az}/prs${n?`?refresh`:``}`,{signal:t});SW(e,r),nH.set(`prs:${e.az}`,r)}catch{}}}function hG(e){return async(t,n)=>{rW(e,null);try{let r=await sn(`/api/workspaces/${e.az}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})});SW(e,r),nH.set(`prs:${e.az}`,r)}catch(t){rW(e,String(t.message||t))}}}function gG(e){return async t=>{rW(e,null),cW(e,t),dW(e,null);try{await sn(`/api/workspaces/${e.az}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`delete`&&e.aj?.()}catch(t){rW(e,String(t.message||t))}finally{cW(e,null),dW(e,null)}}}L(`k10`,rG),L(`k11`,iG),L(`k6`,aG),L(`k7`,oG),L(`k5`,sG),L(`k13`,cG),L(`k12`,lG),L(`k3`,uG),L(`k9`,dG),L(`k0`,fG),L(`k2`,pG),L(`k1`,mG),L(`k4`,hG),L(`k8`,gG);var _G={page:`_cb`,body:`_cc`,content:`_cd`,iconBtn:`_ce _eg`,spinning:`_cf _eh`,pageHead:`_cg`,backBtn:`_ch`,refreshBtn:`_ci`,pageHeadText:`_cj`,pageMeta:`_ck`,pageHeadAside:`_cl`,note:`_cm`,usageList:`_cn`,usageRow:`_co`,usageName:`_cp`,plan:`_cq`,usageStale:`_cr`,stale:`_cs`,usageMeters:`_ct`,meter:`_cu`,meterLabel:`_cv`,meterTrack:`_cw`,meterFill:`_cx`,fillOk:`_cy`,fillMid:`_cz`,fillWarm:`_cA`,fillHot:`_cB`,meterPct:`_cC`,pctOk:`_cD`,pctMid:`_cE`,pctWarm:`_cF`,pctHot:`_cG`,meterReset:`_cH`},vG=((e,t)=>`<div role=region><div><div><header><button type=button title="Back to terminal" aria-label="Back to terminal">${e}</button><div><h1>Usage</h1><p>Provider plan windows across your agents.</p></div><div><button title="Refresh usage" aria-label="Refresh usage">${t}</button></div></header><!></div></div></div>`)($o,is),yG=((e,t)=>` D D D D D/${e}&l D b l D D/${t}&n%n`)(es,as);function bG(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function xG(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:bG(n)}var SG=(e,t)=>B(e.i,t?`↻ ${vt(t)}`:``),CG=M(13,e=>SG(e,xG(e.m,e._.i!=null))),wG=Xe(5,CG),TG=e=>{wG._(e),z(e.a,_G.meter),z(e.b,_G.meterLabel),z(e.d,_G.meterTrack),z(e.h,_G.meterReset)},EG=M(16,e=>R(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),DG=j(15,e=>{B(e.g,e.p),EG(e)}),OG=(e,t)=>z(e.e,[_G.meterFill,t]),kG=(e,t)=>z(e.f,[_G.meterPct,t]),AG=(e,t)=>{bt(e.e,`width:${Math.min(100,Math.max(2,t))}%`),DG(e,Math.round(t)),OG(e,t>=90?_G.fillHot:t>=70?_G.fillWarm:t>=40?_G.fillMid:_G.fillOk),kG(e,t>=90?_G.pctHot:t>=70?_G.pctWarm:t>=40?_G.pctMid:_G.pctOk)},jG=j(12,e=>{CG(e),EG(e)}),MG=j(14,e=>{B(e.c,e.o),EG(e)}),NG=(e,t)=>{AG(e,t[0]?.used_percent),jG(e,t[0]?.resets_at),MG(e,t[0]?.window)},PG=N(4,0,e=>{R(e.a,`title`,`plan-usage could not reach this provider — these are its last cached numbers, ${bG(e._.i*1e3)} old`),B(e.b,bG(e._.i*1e3))}),FG=e=>{PG._(e),z(e.a,_G.usageStale)},IG=N(3,0,e=>B(e.b,e._.k.replace(/^default_/,``).replaceAll(`_`,` `))),LG=e=>{IG._(e),z(e.a,_G.plan)},RG=D(4,`<span>⚠ <!> old</span>`,` Db%`,FG),zG=j(8,e=>{z(e.a,[_G.usageRow,{[_G.stale]:e.i!=null}]),RG(e,+(e.i==null)),PG(e),wG(e)}),BG=e=>{z(e.b,_G.usageName),z(e.f,_G.usageMeters)},VG=(e,t)=>B(e.c,t),HG=D(3,`<span> </span>`,` D `,LG),UG=j(10,e=>{HG(e,+!e.k),IG(e)}),WG=O(5,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,TG,NG),GG=(e,t)=>WG(e,[t||[],`window`]),KG=(e,t)=>{zG(e,t[0]?.stale_seconds),VG(e,t[0]?.agent),UG(e,t[0]?.plan),GG(e,t[0]?.windows)},qG=e=>{z(e.a,[V.dim,_G.note]),z(e.b,V.spin)},JG=O(0,`<div><div><strong> </strong><!><!></div><div></div></div>`,` D E l%b%l `,BG,KG),YG=N(12,2,e=>JG(e,[e._.s||[],e=>`${e.agent}-${e.account||``}`])),XG=e=>{YG._(e),z(e.a,_G.usageList)},ZG=N(12,1,e=>B(e.b,e._.r)),QG=D(12,`<p><span></span> Loading usage…</p>`,` D `,qG,`<p> </p>`,` D `,e=>{ZG._(e),z(e.a,[V.dim,_G.note])},`<div></div>`,` `,XG),$G=A(16,e=>{eK(e,e.q?.error),tK(e,e.q?.agents),QG(e,e.q?e.q?.error?1:2:0)}),eK=j(17,ZG),tK=j(18,YG),nK=A(19,e=>{z(e.k,[_G.iconBtn,_G.refreshBtn,{[_G.spinning]:e.t}]),R(e.k,`disabled`,e.t)}),rK=j(21),iK=I(`w3`,e=>kt(e,{onMount:function(){e.u(!1)}})),aK=j(20,e=>{rK(e,uK(e)),iK(e)}),oK=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},sK=I(`w2`,e=>{k(e.e,`click`,function(){e.p?.()}),k(e.k,`click`,function(){e.v()})});function cK(e){z(e.a,_G.page),z(e.b,_G.body),z(e.c,_G.content),z(e.d,_G.pageHead),z(e.e,[_G.iconBtn,_G.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,_G.pageHeadText),z(e.i,_G.pageMeta),z(e.j,_G.pageHeadAside),os(e.l),ss(e.l,14),cs(e.l),$G(e,null),nK(e,!1),aK(e,dK(e)),oK(e,nt(e)),sK(e)}var lK=j(15);function uK(e){return async()=>{nK(e,!0),await e.u(!0),nK(e,!1)}}function dK(e){return async t=>{try{$G(e,await sn(`/api/usage${t?`?refresh`:``}`))}catch(t){$G(e,{error:String(t.message||t)})}}}L(`w1`,uK),L(`w0`,dK);var fK=Object.defineProperty,pK=Object.getOwnPropertyDescriptor,mK=(e,t)=>{for(var n in t)fK(e,n,{get:t[n],enumerable:!0})},hK=(e,t,n,r)=>{for(var i=r>1?void 0:r?pK(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&fK(t,n,i),i},Y=(e,t)=>(n,r)=>t(n,r,e),gK=`Terminal input`,_K={get:()=>gK,set:e=>gK=e},vK=`Too much output to announce, navigate to rows manually to read`,yK={get:()=>vK,set:e=>vK=e};function bK(e){return e.replace(/\r?\n/g,`\r`)}function xK(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function SK(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function CK(e,t,n,r){e.stopPropagation(),e.clipboardData&&wK(e.clipboardData.getData(`text/plain`),t,n,r)}function wK(e,t,n,r){e=bK(e),e=xK(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function TK(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function EK(e,t,n,r,i){TK(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function DK(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function OK(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var kK=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},AK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},jK=``,MK=` `,NK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new PK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},PK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},FK=class e extends NK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new PK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?DK(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},IK=`di$target`,LK=`di$dependencies`,RK=new Map;function zK(e){return e[LK]||[]}function BK(e){if(RK.has(e))return RK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);VK(t,e,r)};return t._id=e,RK.set(e,t),t}function VK(e,t,n){t[IK]===t?t[LK].push({id:e,index:n}):(t[LK]=[{id:e,index:n}],t[IK]=t)}var HK=BK(`BufferService`),UK=BK(`CoreMouseService`),WK=BK(`CoreService`),GK=BK(`CharsetService`),KK=BK(`InstantiationService`),qK=BK(`LogService`),JK=BK(`OptionsService`),YK=BK(`OscLinkService`),XK=BK(`UnicodeService`),ZK=BK(`DecorationService`),QK=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new FK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):$K(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};QK=hK([Y(0,HK),Y(1,JK),Y(2,YK)],QK);function $K(e,t){if(confirm(`Do you want to navigate to ${t}?
1532
+ `}function nN(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function rN(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function iN(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function aN(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function oN(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function sN({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function cN(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:$A(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function lN(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var uN=-1,dN=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++uN}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:ty},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new WS,this.scrollSyncManager=new _j,this.interactionManager=new wS(`diff`,TS(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return cN(e)}createHunksRenderer(e){return new VM(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=hy(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(TS(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ly(this.appliedThemeCSS.theme,this.options.theme??ty)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){sy(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=sN(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),hN(this.pre,pN({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||gN(this.headerElement,mN({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),XA(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?sb(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!lN(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(cj(`merge`,e,t),this.setHydratedState(t),await oN(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=sN(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!fN(u,this.deletionFile)||!fN(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&yA(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=sb(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(CM(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:ee=!1,disableFileHeader:te=!1}=this.options;if(te&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,fte);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||Tj(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return Fj({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=xM(e,this.hunksRenderer.getExpandedHunksMap(),t);return CM(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(SM(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return Nj({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return Pj({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=Oj(o);if(e<s){let c=kj({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=Mj({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=Oj(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){oy(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||zM(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!aN(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${CA(r)}`,a=this.annotationCache.get(i);if(a==null||!iN(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Cre(CA(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=wre();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:QA(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):QA(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=bre;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??xS(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ey,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Zv,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Qv,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,$v,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Tre(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=GA(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??ty,s=typeof o==`string`?o:{...o},c=VA(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=tj({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:KA(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=qA(this.themeCSSStyle.textContent??``,VA(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&ij()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?ej(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=_N(t[0]),a=_N(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=xS(i),r.content.innerHTML=xS(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=YA({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=YA({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=YA({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=_N(r?.[0]),a=_N(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=_N(n?.[0]),i=_N(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=xS(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?ej(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=_N(t[0]),i=_N(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};xre(u,this.appliedPreAttributes)||(ZA(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function fN(e,t){return e==null||t==null?e==null&&t==null:lb(e,t)}function pN({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function mN({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function hN(e,t,n=!1){return!n&&e==null&&t}function gN(e,t,n=!1){return e==null&&t&&!n}function _N(e){if(e!=null&&e.type===`element`)return e.children??[]}function vN(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var yN={diffFile:`_e0`},bN=`<div></div>`,xN=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,SN=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,CN=new CSSStyleSheet;CN.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+H_);var wN=ut(`e0`,0);function TN(e){z(e.a,yN.diffFile)}var EN=M(11,I(`e1`,e=>kt(e,{file:e.d,comments:e.e,draft:e.f,onMount:function(){let t=t=>{if(!t)return;let n=document.createElement(`div`);n.style.cssText=xN;let r=document.createElement(`p`);r.textContent=t.text,r.style.cssText=`margin:0;white-space:pre-wrap;`;let i=document.createElement(`button`);return i.textContent=`remove`,i.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;align-self:flex-start;font-size:.75rem;opacity:.7;`,i.onclick=()=>e.g?.(t.id),n.append(r,i),n},n=()=>{let t=document.createElement(`div`);t.style.cssText=xN;let n=document.createElement(`textarea`);n.placeholder=`Leave a comment…`,n.rows=3,n.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(sr()?`font-size:16px;`:``);let r=document.createElement(`button`);r.textContent=`Comment`,r.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`;let i=document.createElement(`button`);i.textContent=`Cancel`,i.style.cssText=SN,r.onclick=()=>{n.value.trim()&&e.h?.(n.value)},i.onclick=()=>e.i?.(),n.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&r.onclick(),e.key===`Escape`&&i.onclick()};let a=document.createElement(`div`);a.style.cssText=`display:flex;gap:.4rem;`,a.append(r,i),t.append(n,a);let o=()=>n.scrollIntoView({block:`center`,behavior:`smooth`});return n.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,o),n.addEventListener(`blur`,()=>e.removeEventListener(`resize`,o),{once:!0}))}),setTimeout(()=>{n.scrollIntoView({block:`center`,behavior:`instant`}),n.focus()},0),t},r=new Map,i,a={draft:!0},o,s=new dN({diffStyle:cr()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.j?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let r=e.metadata||{};return r.draft?o??=n():t(r.comment)}}),c=()=>{let t=[],n=new Map;for(let i of e.e||[]){let e=r.get(i.id)||{comment:i};n.set(i.id,e),t.push({side:i.side,lineNumber:i.line_end,metadata:e})}return r=n,e.f&&(i!==e.f&&(i=e.f,a={draft:!0},o=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:a})),t},l=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(CN)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,CN])},u=()=>{if(e.d.old==null&&e.d.new==null){e.k?.(`could not read ${e.d.path}`);return}let t=s.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:c()});Promise.resolve(t).then(()=>{l(),Y_(e.a)}).catch(t=>e.k?.(`diff render: ${t}`))};u();let d=new AbortController;return sr()&&vN(wN(e),d.signal),{instance:s,render:u,dragAbort:d,unregSearch:J_(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f}},onUpdate:function(){(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),7),DN=j(3,EN),ON=j(4,EN),kN=j(5,EN),AN=j(6,EN),jN=j(7,EN),MN=j(8,EN),NN=j(9,EN),PN=j(10,EN),FN={tree:`_e1`,closed:`_e2`,treeRepo:`_e3`,treeRepoName:`_e4`,treeDir:`_e5`,treeFile:`_e6`,treeFileName:`_e7`,treeNote:`_e8`,treeChev:`_e9`,status:`_e_`},IN=`<aside></aside>`,LN=e=>z(e.a,FN.treeNote),RN=M(4,e=>{z(e.a,[FN.treeDir,{[FN.closed]:e._._._._.m.has(e._._.c(e._.e))}]),B(e.c,e._._._._.m.has(e._._.c(e._.e))?`▸`:`▾`)},2),zN=F(15,RN,e=>e._._._._),BN=I(`h3`,e=>k(e.a,`click`,function(){let t=new Set(e._._._._.m);t.delete(e._._.c(e._.e))||t.add(e._._.c(e._.e)),RP(e._._._._,t)})),VN=e=>{zN(e),HN(e),UN._(e),WN._(e),GN._(e),z(e.b,FN.treeChev),BN(e)},HN=F(6,RN,e=>e._._),UN=N(0,0,e=>{R(e.a,`title`,e._.e),RN(e)}),WN=N(0,0,e=>bt(e.a,`padding-left:${.35+e._.f*.75}rem`)),GN=N(0,0,e=>B(e.d,e._.g)),KN=D(5,`<span>💬</span>`,` `,LN),qN=M(6,e=>KN(e,+!e._._._._.n.has(e._.j))),JN=F(16,qN,e=>e._._._._),YN=I(`h4`,e=>k(e.a,`click`,function(){e._._._._.j(e._.j)})),XN=e=>{JN(e),ZN._(e),QN._(e),$N._(e),eP._(e),tP._(e),z(e.a,FN.treeFile),z(e.b,FN.status),z(e.d,FN.treeFileName),YN(e)},ZN=N(0,1,e=>bt(e.a,`padding-left:${.5+e._.f*.75}rem`)),QN=N(0,1,e=>R(e.a,`title`,e._.i)),$N=N(0,1,qN),eP=N(0,1,e=>{R(e.b,`data-status`,e._.k),B(e.c,e._.k)}),tP=N(0,1,e=>B(e.e,e._.l)),nP=D(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,VN,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,XN),rP=M(3,e=>nP(e,!e._.f(e.c)&&e.c?.kind===`dir`?0:!e._.f(e.c)&&e.c?.kind!==`dir`?1:2)),iP=Xe(0,rP),aP=iP,oP=j(2,e=>{cP(e,e.c?.path),lP(e,e.c?.depth),uP(e,e.c?.label),dP(e,e.c?.file?.path),fP(e,e.c?.file?.key),pP(e,e.c?.file?.status),mP(e,e.c?.name),rP(e)}),sP=(e,t)=>oP(e,t[0]),cP=j(4,UN),lP=j(5,e=>{ZN(e),WN(e)}),uP=j(6,GN),dP=j(8,QN),fP=j(9,$N),pP=j(10,eP),mP=j(11,tP),hP=j(5,iP),gP=M(4,e=>hP(e,KP(e)),2),_P=F(15,gP,e=>e._._),vP=j(3,gP),yP=e=>{_P(e),xP._(e),wP._(e),vP(e,qP)},bP=j(2,P(HN)),xP=N(5,0,e=>{bP(e,JP(e)),gP(e)}),SP=O(0,`<!><!><!>`,`b%`,aP,sP),CP=(e,t)=>SP(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),wP=N(5,0,e=>CP(e,Tg(e._.l))),TP=D(5,`<!><!><!>`,`b%`,yP),EP=M(9,e=>{z(e.b,[FN.treeRepoName,{[FN.closed]:e._.k.has(e.i)}]),B(e.d,e._.k.has(e.i)?`▸`:`▾`),TP(e,+!!e._.k.has(e.i))}),DP=Xe(0,EP),OP=I(`h5`,e=>k(e.b,`click`,function(){let t=new Set(e._.k);t.delete(e.i)||t.add(e.i),PP(e._,t)})),kP=e=>{DP._(e),z(e.a,FN.treeRepo),z(e.c,FN.treeChev),OP(e)},AP=j(8,e=>{EP(e),xP(e)}),jP=(e,t)=>B(e.e,t),MP=(e,t)=>{AP(e,t[0]?.id),jP(e,t[0]?.label),NP(e,t[0]?.files)},NP=j(11,wP),PP=Ye(10,DP),FP=M(5,e=>PP(e,e.d,e.e)),IP=j(3,FP),LP=j(4,FP),RP=A(12,P(_P,zN));function zP(e){RP(e,new Set)}var BP=j(13,P(JN)),VP=(e,t)=>BP(e,t||new Set),HP=(e,t)=>z(e.a,[FN.tree,{[FN.closed]:t===!1}]),UP=O(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,kP,MP),WP=(e,t)=>UP(e,[t,`id`]),GP=j(9);function KP(e){return t=>{let n=e.d(t);for(let r of e._._.m){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function qP(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function JP(e){return t=>`${e._.i}/${t}`}L(`h2`,KP),L(`h1`,qP),L(`h0`,JP);var YP={iconBtn:`_ej _cb`,spinning:`_ek _cc`,sheetBackdrop:`_el`,fileSheet:`_em`,sheetHead:`_en`,fileCount:`_eo`,sheetList:`_ep`,sheetFile:`_eq`,sheetPath:`_er`,status:`_es`},XP=`<!><!><!>`,ZP=D(5,`<span>💬</span>`),QP=M(9,e=>ZP(e,+!e._._.o.has(e.i))),$P=F(18,QP,e=>e._._),eF=I(`d0`,e=>k(e.a,`click`,function(){fF(e._._,!1),e._._.l(e.i)})),tF=e=>{$P(e),z(e.a,[YP.sheetFile,V.mono]),z(e.b,YP.status),z(e.d,YP.sheetPath),eF(e)},nF=(e,t)=>{R(e.b,`data-status`,t),B(e.c,t)},rF=j(8,e=>{R(e.d,`title`,e.i),B(e.e,e.i),QP(e)}),iF=O(7,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,tF,(e,t)=>{rF(e,t[0]?.key),nF(e,t[0]?.status)}),aF=N(0,0,e=>iF(e,[e._.i,`key`])),oF=I(`d1`,e=>{k(e.a,`click`,function(){fF(e._,!1)}),k(e.g,`click`,function(){fF(e._,!1)})}),sF=e=>{aF._(e),lF._(e),uF._(e),z(e.a,YP.sheetBackdrop),z(e.b,YP.fileSheet),z(e.c,YP.sheetHead),z(e.d,YP.fileCount),z(e.g,YP.iconBtn),z(e.h,YP.sheetList),oF(e)},cF=M(8,e=>B(e.f,e._.j===e._.p?``:` / ${e._.p}`)),lF=N(0,0,e=>{B(e.e,e._.j),cF(e)}),uF=N(0,0,cF),dF=D(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D Db D%b%l l `,sF),fF=Ye(12,e=>dF(e,+!e.m)),pF=M(5,e=>fF(e,e.d,e.e)),mF=j(3,pF),hF=j(4,pF),gF=j(14,P($P)),_F=(e,t)=>gF(e,t||new Set),vF=j(15,uF),yF=M(10,e=>vF(e,e.h??e.j)),bF=j(7,yF),xF=j(9,e=>{yF(e),lF(e)}),SF=j(8,e=>{xF(e,e.i?.length),aF(e)}),CF=j(11),wF=((e,t,n,r,i,a)=>`<div><div><div><!><div><h1>Review</h1><span><!> file<!> changed <!></span></div><!></div><div><button>${e}</button><button title="Refresh diff">${t}</button><button title="Jump to file">Files (<!>)</button><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${n}</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button>${r}</div><!><div data-diff-main><!><!><!><!><!><!><!></div></div>${i}${a}</div>`)(Dp,is,c_,m_,IN,XP),TF=((e,t,n,r,i,a)=>` D D D%b D b D%c%c%m%l D D/${e}&l D/${t}&l Db%l D/${n}&l D b l D l/${r}&l%b D%b%b%b%b%b%b%m/${i}&/${a}&l`)(Op,as,l_,h_,` b`,`b%c`),EF=e=>z(e.a,H.diffPad),DF=e=>z(e.a,H.diffPad),OF=e=>z(e.a,H.diffPad),kF=N(5,0,e=>B(e.b,e._.t)),AF=e=>{kF._(e),z(e.a,V.chip)},jF=M(2,e=>R(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),MF=F(34,e=>{B(e.b,e._._._.q),jF(e)},e=>e._._._),NF=e=>{MF(e),PF(e),z(e.a,V.chip)},PF=F(35,jF,e=>e._._._),FF=F(26,e=>B(e.b,e._._._.i),e=>e._._._),IF=e=>{FF(e),LF(e),zF(e),BF(e),VF(e),HF(e),UF(e),z(e.a,[V.chip,V.pr]),z(e.c,V.dim)},LF=F(27,e=>R(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),RF=M(4,e=>R(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),zF=F(28,e=>{B(e.d,e._._._.k),RF(e)},e=>e._._._),BF=F(29,RF,e=>e._._._),VF=F(30,RF,e=>e._._._),HF=F(31,RF,e=>e._._._),UF=F(32,RF,e=>e._._._),WF=M(2,e=>R(e.a,`title`,`checked out ${e._._._.q} ${e._._._.r}`)),GF=F(34,e=>{B(e.b,e._._._.q),WF(e)},e=>e._._._),KF=e=>{GF(e),qF(e),z(e.a,V.chip)},qF=F(35,WF,e=>e._._._),JF=F(33,e=>B(e.b,e._._._.p),e=>e._._._),YF=e=>{JF(e),z(e.a,H.repoTitle)},XF=F(26,e=>B(e.b,e._._._.i),e=>e._._._),ZF=I(`i35`,e=>k(e.a,`click`,function(e){e.stopPropagation()})),QF=e=>{XF(e),$F(e),tI(e),nI(e),rI(e),iI(e),aI(e),z(e.a,[V.chip,V.pr]),z(e.c,H.repoTitle),ZF(e)},$F=F(27,e=>R(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),eI=M(4,e=>R(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),tI=F(28,e=>{B(e.d,e._._._.k),eI(e)},e=>e._._._),nI=F(29,eI,e=>e._._._),rI=F(30,eI,e=>e._._._),iI=F(31,eI,e=>e._._._),aI=F(32,eI,e=>e._._._),oI=M(10,e=>R(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),sI=j(7,oI),cI=j(8,e=>{B(e.c,xg(e.i)),oI(e)}),lI=j(9,e=>{B(e.d,xg(e.j)),oI(e)}),uI=(e,t)=>B(e.b,t>0?` · `:``),dI=(e,t)=>{sI(e,t[0]?.pr?.headRefName),lI(e,t[0]?.pr?.headRefOid),cI(e,t[0]?.head),uI(e,t[1])},fI=(e,t)=>B(e.a,t>0?` · `:``),pI=(e,t)=>B(e.b,t),mI=(e,t)=>B(e.c,t),hI=O(1,`<!><!> #<!>`,`%b%c%`,0,(e,t)=>{pI(e,t[0]?.worktree),mI(e,t[0]?.pr?.number),fI(e,t[1])}),gI=O(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,dI),_I=F(141,e=>{hI(e,[e._._.c9,`id`]),gI(e,[e._._.c9,`id`])},e=>e._._),vI=gt(`i33`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{_I(e),z(e.a,V.dim),z(e.c,[V.mono,H.toastMeta])}),yI=D(6,`<span>local <!></span>`,` Db%`,NF),bI=M(7,e=>yI(e,+!e._._._.c8.has(e._._.d))),xI=F(140,bI,e=>e._._._),SI=e=>{xI(e),CI(e),DI(e),OI(e),AI(e),jI(e),MI(e),z(e.a,H.repoMeta),z(e.c,[V.chip,V.lane]),z(e.e,V.chip)},CI=F(23,bI,e=>e._._),wI=D(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,IF),TI=M(10,e=>R(e.c,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),EI=M(8,e=>B(e.d,e._._.g?e._._.g.headRefName:e._._.q)),DI=F(24,e=>{wI(e,+!e._._.g),TI(e),EI(e)},e=>e._._),OI=F(30,TI,e=>e._._),kI=M(9,e=>R(e.e,`title`,`${e._._.n} ${e._._.o}`)),AI=F(31,e=>{B(e.f,e._._.n),kI(e)},e=>e._._),jI=F(32,kI,e=>e._._),MI=F(34,e=>{TI(e),EI(e)},e=>e._._),NI=N(33,0,e=>B(e.b,e._.bn.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),PI=e=>{NI._(e),z(e.a,H.centerPad)},FI=F(132,I(`i37`,e=>kt(e,{onMount:function(){e._._._._._._.ba(e.a,()=>{cR(e._,!0)})}})),e=>e._._._._._._),II=e=>{FI(e),z(e.a,H.diffWait)},LI=M(11,e=>B(e.c,e._._._.b4.has(e._._.d)?`▸`:`▾`)),RI=F(131,LI,e=>e._._._),zI=I(`i36`,e=>k(e.a,`click`,function(){let t=new Set(e._._._.b4);t.delete(e._._.d)||t.add(e._._.d),GB(e._._._,t)})),BI=e=>{RI(e),UI(e),WI(e),JI(e),YI(e),XI(e),QI(e),$I(e),eL(e),z(e.a,H.repoSep),z(e.b,H.treeChev),z(e.d,H.repoWorktree),z(e.g,[V.chip,V.lane]),z(e.i,V.chip),zI(e)},VI=D(10,`<span>local <!></span>`,` Db%`,KF),HI=M(12,e=>VI(e,+!e._._._.c8.has(e._._.d))),UI=F(140,HI,e=>e._._._),WI=F(23,e=>{LI(e),HI(e)},e=>e._._),GI=D(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,QF,`<span> </span>`,` D `,YF),KI=M(15,e=>R(e.g,`title`,`${e._._.g?`PR head`:`checked out`} ${e._._.g?e._._.g.headRefName:e._._.q} ${e._._.m}`),2),qI=M(13,e=>B(e.h,e._._.g?e._._.g.headRefName:e._._.q)),JI=F(24,e=>{GI(e,+!e._._.g),KI(e),qI(e)},e=>e._._),YI=F(25,e=>B(e.e,e._._.h),e=>e._._),XI=F(30,KI,e=>e._._),ZI=M(14,e=>R(e.i,`title`,`${e._._.n} ${e._._.o}`)),QI=F(31,e=>{B(e.j,e._._.n),ZI(e)},e=>e._._),$I=F(32,ZI,e=>e._._),eL=F(34,e=>{KI(e),qI(e)},e=>e._._),tL=N(26,0,e=>cv(e.a,e._.av)),nL=e=>{tL._(e),rL._(e),iL._(e),aL._(e),Pv(e.a),lv(e.a,DV(e)),yv(e.a),bv(e.a),Cv(e.a)},rL=N(26,0,e=>zv(e.a,e._.aw)),iL=N(26,0,e=>Iv(e.a,e._.bt)),aL=N(26,0,e=>wv(e.a,OV(e))),oL=F(126,e=>B(e.e,e._._.as?`, plus uncommitted`:``),e=>e._._),sL=e=>{oL(e),cL(e),lL(e),uL(e),dL(e)},cL=F(11,e=>B(e.a,xg(e._.h))),lL=F(12,e=>B(e.b,e._.i)),uL=F(13,e=>B(e.c,xg(e._.j))),dL=F(14,e=>B(e.d,e._.k)),fL=gt(`i34`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,sL),pL=e=>{Rr(e.a),Hr(e.a,fL(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},mL=M(6,e=>Br(e.a,`${e.d} #${e.f}`)),hL=j(3,mL),gL=j(5,mL),_L=(e,t)=>{hL(e,t[0]?.worktree),gL(e,t[0]?.pr?.number),vL(e,t[0]?.pr?.headRefName),yL(e,t[0]?.head),bL(e,t[0]?.localHead),xL(e,t[0]?.branch)},vL=j(8,P(lL)),yL=j(7,P(cL)),bL=j(9,P(uL)),xL=j(10,P(dL)),SL=F(126,e=>B(e.b,e._._.as?` — showing uncommitted changes only`:``),e=>e._._),CL=e=>{SL(e),wL(e)},wL=F(7,e=>B(e.a,e._.g)),TL=gt(`i30`,`already in <!><!>.`,`b%b%`,CL),EL=e=>{Rr(e.a),Hr(e.a,TL(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},DL=M(5,e=>Br(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),OL=j(3,DL),kL=j(4,DL),AL=(e,t)=>{OL(e,t[0]?.pr),kL(e,t[0]?.worktree),jL(e,t[0]?.base)},jL=j(6,P(wL)),ML=F(126,e=>B(e.b,e._._.as?` — showing uncommitted changes only`:``),e=>e._._),NL=e=>{ML(e),PL(e)},PL=F(5,e=>B(e.a,e._.e)),FL=gt(`i29`,`<!><!>.`,`%b%`,NL),IL=e=>{Rr(e.a),Hr(e.a,FL(e)),Ar(e.a,`warn`),Pr(e.a,`inline`),Gr(e.a),Fr(e.a),Kr(e.a),Lr(e.a,{})},LL=(e,t)=>Br(e.a,`${t}: base not found`),RL=(e,t)=>{LL(e,t[0]?.worktree),zL(e,t[0]?.base)},zL=j(4,P(PL)),BL=M(2,e=>B(e.b,e._.az.trim()?`No matches in diffs.`:`No files match "${e._.ar}".`)),VL=N(33,1,BL),HL=e=>{VL._(e),UL._(e),z(e.a,H.centerPad)},UL=N(33,1,BL),WL=F(124,e=>{R(e.a,`disabled`,e._._.aq),B(e.b,e._._.aq?`Reloading…`:`Reload`)},e=>e._._),GL=I(`i31`,e=>k(e.a,`click`,function(){e._._.bj()})),KL=gt(`i32`,`<button> </button>`,` D `,e=>{WL(e),z(e.a,V.btn),GL(e)}),qL=N(31,0,e=>Kr(e.a,kV(e))),JL=e=>{qL._(e),Rr(e.a),Gr(e.a,rn({content:KL(e)})),Hr(e.a,vI(e)),Ar(e.a,`info`),Pr(e.a,`inline`),Br(e.a,`GitHub is behind`),Fr(e.a),Lr(e.a,{})},YL=F(123,e=>B(e.a,e._._.ap),e=>e._._),XL=gt(`i28`,` `,` `,YL),ZL=e=>{Rr(e.a),Hr(e.a,XL(e)),Kr(e.a,AV(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},QL=M(1,e=>kN(e.a,e._._._._._._.an&&e._._._._._._.an?.key===e._._.j?e._._._._._._.an:null)),$L=F(122,QL,e=>e._._._._._._),eR=e=>{$L(e),nR(e),rR(e),iR(e),aR(e),oR(e),TN(e.a),MN(e.a,MV(e)),PN(e.a,jV(e))},tR=M(2,e=>jN(e.a,NV(e))),nR=F(143,tR,e=>e._._._._._._),rR=F(144,e=>AN(e.a,PV(e)),e=>e._._._._._._),iR=F(22,e=>{DN(e.a,e._._.i),tR(e)},e=>e._._),aR=F(23,e=>{NN(e.a,FV(e)),QL(e)},e=>e._._),oR=F(24,e=>ON(e.a,e._._.s),e=>e._._),sR=D(0,`<div></div>`,` `,II,bN,(e=>`/${e}&`)(` b`),eR),cR=A(1,e=>sR(e,+!!e.b)),lR=e=>cR(e,!1),uR=M(10,e=>R(e.a,`hidden`,!e._._._._.c0.has(e.j))),dR=F(136,uR,e=>e._._._._),fR=D(6,`<p>binary file</p>`,` `,OF,`<p>file too large to display</p>`,` `,DF,`<p>file could not be read</p>`,` `,EF,`<!><!><!>`,`b%`,lR),pR=M(21,e=>fR(e,e.o?0:e.p?1:e.q==null&&e.r==null?2:e.u?3:4),4),mR=A(20,e=>{nee(e,`a`,e.u),pR(e)}),hR=I(`i38`,e=>k(e.a,`toggle`,function(t,n){if(mR(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),gR=e=>{dR(e),bR(e),z(e.a,H.file),z(e.b,H.status),z(e.d,H.path),mR(e,!0),hR(e)},_R=P(oR),vR=j(18,e=>{SR(e,e.s.length),_R(e)}),yR=M(11,e=>vR(e,e._._._._.c4.get(e.j)||[])),bR=F(139,yR,e=>e._._._._),xR=D(5,`<span>💬 <!></span>`,` Db%`,AF),SR=j(19,e=>{xR(e,+!e.t),kF(e)}),CR=P(aR),wR=j(9,e=>{R(e.a,`data-key`,e.j),yR(e),uR(e),CR(e)}),TR=(e,t)=>{R(e.b,`data-status`,t),B(e.c,t)},ER=(e,t)=>{R(e.d,`title`,t),B(e.e,t)},DR=j(14,pR),OR=j(15,pR),kR=j(16,pR),AR=j(17,pR),jR=(e,t)=>NR(e,t[0]),MR=P(iR),NR=j(8,e=>{wR(e,e.i?.key),TR(e,e.i?.status),ER(e,e.i?.path),DR(e,e.i?.binary),OR(e,e.i?.tooLarge),kR(e,e.i?.old),AR(e,e.i?.new),MR(e)}),PR=O(0,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` E D l E m%l%`,gR,jR),FR=F(36,e=>PR(e,[e._._.s,`key`]),e=>e._._),IR=e=>{FR(e),z(e.a,H.files)},LR=M(5,e=>R(e.a,`hidden`,!e._.w&&!e._.g&&e._._.b3!==e._.d),3),RR=F(130,LR,e=>e._._),zR=e=>{RR(e),HR(e),WR(e),GR._(e),qR._(e),JR._(e),YR._(e),z(e.a,H.repoSection)},BR=D(2,`<div></div>`,` `,IR),VR=M(4,e=>BR(e,e._._.bp>1&&e._._.b4.has(e._.d)?1:0),2),HR=F(131,VR,e=>e._._),UR=D(1,`<button><span> </span><span> </span><!><span>on <!></span><span>vs <!></span><!></button>`,` D D l D l%b Db%l Db%l%`,BI,`<p><!><span>on <!></span><span>vs <!></span><!></p>`,` D%b Db%l Db%l%`,SI),WR=F(134,e=>{UR(e,e._._.bp>1?0:1),VR(e)},e=>e._._),GR=N(0,0,e=>{LR(e),VR(e)}),KR=M(3,e=>R(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),qR=N(0,0,e=>{KR(e),LR(e)}),JR=N(0,0,KR),YR=N(0,0,LR),XR=P(FR),ZR=j(18,e=>{oz(e,e.s.length),XR(e)}),QR=M(4,e=>ZR(e,e._.c1.get(e.d)||[])),$R=Xe(34,QR),ez=e=>{$R._(e),rz._(e)},tz=(e,t)=>lz(e,t.length),nz=M(5,e=>tz(e,e._.c2.get(e.d)||[])),rz=Xe(34,nz),iz=D(0,`<section><!><!></section>`,` D%b%`,zR),az=M(20,e=>iz(e,e.t||e.g?0:1)),oz=j(19,az),sz=P(WI,CI),cz=j(3,e=>{QR(e),nz(e),GR(e),sz(e)}),lz=j(22,YR),uz=P(JI,DI),dz=j(6,e=>{pz(e,e.g?.number),mz(e,e.g?.url),hz(e,e.g?.title),gz(e,e.g?.headRefName),az(e),qR(e),uz(e)}),fz=(e,t)=>{cz(e,t[0]?.id),dz(e,t[0]?.pr),vz(e,t[0]?.worktree),yz(e,t[0]?.head),bz(e,t[0]?.base),xz(e,t[0]?.baseSha),Sz(e,t[0]?.full_name),Cz(e,t[0]?.branch),wz(e,t[0]?.localHead)},pz=j(8,P(XF,FF)),mz=j(9,P($F,LF)),hz=j(10,P(tI,zF)),gz=j(11,P(nI,BF)),_z=P(YI),vz=j(7,e=>{JR(e),_z(e)}),yz=j(12,P(XI,OI,rI,VF)),bz=j(13,P(QI,AI,iI,HF)),xz=j(14,P($I,jI,aI,UF)),Sz=j(15,P(JF)),Cz=j(16,P(eL,MI,GF,MF)),wz=j(17,P(qF,PF)),Tz=N(10,0,e=>i_(e.a,e._.aj)),Ez=e=>{Tz._(e),Dz._(e),Oz._(e),Qg(e.a)},Dz=N(10,0,e=>a_(e.a,e._.ci)),Oz=N(10,0,e=>o_(e.a,e._.cj)),kz=I(`i27`,e=>k(e.a,`click`,function(){e._.ai?.()})),Az=e=>{z(e.a,[H.iconBtn,H.backBtn]),ts(e.b),ns(e.b,14),rs(e.b),kz(e)},jz=M(84,I(`i41`,e=>kt(e,{active:e.af,load:e.bg,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.ae||``,lastNonce:e.ag||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,Tn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.ad&&e.bi()},{signal:t.signal}),Tn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.aq)return;let r=t.data,i=r&&r[e.ad];if(!i)return;let a=pg(i);!a||!e.bd||a===e.bd||e.bl()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.bj(),this.wasActive=!!this.active;let t=e.ae||``,n=e.ag||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bb(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bf&&clearTimeout(e.bf),this.abort.abort()}})),11),Mz=j(83,jz),Nz=M(82,e=>Mz(e,IV(e))),Pz=j(81,e=>{Nz(e),jz(e)}),Fz=M(79,e=>Pz(e,LV(e))),Iz=j(78,e=>{Fz(e),jz(e)}),Lz=M(76,e=>Iz(e,RV(e)),4),Rz=j(73,e=>{Lz(e),jz(e)}),zz=j(98,P(dR)),Bz=(e,t)=>WP(e.a9,t),Vz=M(101,e=>Bz(e,e.bn.filter(t=>(e.c2.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.c2.get(t.id)||[]})))),Hz=j(100,e=>{Vz(e),rz(e)}),Uz=M(95,e=>Hz(e,new Map(e.bn.map(t=>[t.id,e.bw.filter(e=>e.repo===t.id)])))),Wz=j(94,e=>{SF(e.aa,e.bw),bV(e,e.bw?.length),zz(e,new Set(e.bw.map(e=>e.key))),Uz(e)}),Gz=M(93,e=>Wz(e,e.bu?e.bt.filter(t=>e.bu.has(t.key)||t.key===e.b2):e.bt),2),Kz=j(91,e=>{Gz(e),iL(e)}),qz=M(89,e=>Kz(e,(()=>{let t=gg(e.ar);return e.bq.filter(e=>t(e.key))})())),Jz=j(88,e=>{yV(e,e.bq?.length),qz(e)}),Yz=j(106,P(UI,xI)),Xz=O(32,fr,(e=>`/${e}&`)(pr),pL,_L),Zz=(e,t)=>{Yz(e,new Set(t.map(e=>e.id))),Xz(e,[t,`id`])},Qz=O(29,fr,(e=>`/${e}&`)(pr),IL,RL),$z=O(30,fr,(e=>`/${e}&`)(pr),EL,AL),eB=O(34,`<!><!><!>`,`b%`,ez,fz),tB=j(110,qL),nB=M(108,e=>tB(e,BV(e))),rB=P(_I),iB=j(107,e=>{SV(e,e.c9?.length),nB(e),rB(e)}),aB=M(86,e=>iB(e,e.bn.filter(t=>t.githubDrift&&!e.b5.has(t.id)))),oB=j(85,e=>{vV(e,e.bn.length),Jz(e,e.bn.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Zz(e,e.bn.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),Qz(e,[e.bn.filter(e=>e.baseMissing),`id`]),$z(e,[e.bn.filter(e=>e.contained&&e.files.length),`id`]),eB(e,[e.bn,`id`]),Uz(e),Vz(e),aB(e),NI(e)}),sB=j(99,$R),cB=e=>{sB(e,new Map(e.bn.map(t=>[t.id,e.bq.filter(e=>e.repo===t.id)])))},lB=j(116,Dz),uB=M(114,e=>lB(e,VV(e)),2),dB=j(117,Oz),fB=M(115,e=>dB(e,HV(e)),3),pB=D(33,`<p> </p>`,` D `,PI,`<p> </p>`,` D `,HL),mB=M(97,e=>pB(e,e.ak&&!e.bs?0:e.ak&&!e.by&&!e.b1?1:2),3),hB=A(46,e=>{Rz(e,zV(e)),oB(e,e.ak||[]),cB(e),uB(e),fB(e),mB(e)}),gB=(e,t)=>{VP(e.a9,t),_F(e.aa,t)},_B=P(bR),vB=j(102,e=>{gB(e,new Set(e.c4.keys())),_B(e)}),yB=j(112,P(rR)),bB=j(111,P(nR)),xB=M(50,e=>bB(e,WV(e)),2),SB=A(47,e=>{eV(e,e.al?.length),vB(e,(()=>{let t=new Map;for(let n of e.al){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),yB(e,UV(e)),xB(e),uB(e),fB(e)}),CB=P($L),wB=A(49,e=>{xB(e),CB(e)}),TB=D(28,fr,(e=>`/${e}&`)(pr),ZL),EB=P(YL),DB=A(51,e=>{TB(e,+!e.ap),EB(e)}),OB=P(WL),kB=A(52,e=>{z(e.o,[H.iconBtn,{[H.spinning]:e.aq}]),R(e.o,`disabled`,e.aq),R(e.v,`disabled`,e.aq),R(e.w,`disabled`,e.aq),R(e.x,`disabled`,e.aq),jz(e),OB(e)}),AB=A(53,e=>{T_(e.z,e.ar),qz(e),VL(e)}),jB=P(ML,SL,oL),MB=A(54,e=>{z(e.v,[H.scopeOpt,{[H.scopeOn]:!e.as}]),R(e.v,`aria-pressed`,e.as?`false`:`true`),z(e.w,[H.scopeOpt,{[H.scopeOn]:e.as}]),R(e.w,`aria-pressed`,e.as?`true`:`false`),z(e.x,[H.scopeChip,{[H.scopeOn]:e.as}]),R(e.x,`aria-pressed`,e.as?`true`:`false`),R(e.x,`title`,e.as?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),B(e.y,e.as?`Dirty`:`Clean`),Lz(e),Fz(e),jB(e)}),NB=A(55,e=>{z(e.m,[H.treeToggle,{[H.on]:e.at}]),R(e.m,`title`,e.at?`Hide file tree`:`Show file tree`),HP(e.a9,e.at)}),PB=A(56,e=>mF(e.aa,e.au)),FB=D(26,iv,(e=>`/${e}&`)(av),nL),IB=A(57,e=>{z(e.s,[H.iconBtn,H.findBtn,{[H.on]:e.av}]),FB(e,+!e.av),tL(e)}),LB=j(119),RB=I(`i40`,e=>{e.af&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`[data-palette]`)||(t.preventDefault(),IB(e,!0),BB(e,e.aw+1)))},{capture:!0,signal:Ae(e,0)})}),zB=M(59,e=>{ke(e,0),RB(e)}),BB=A(58,e=>{LB(e,GV(e)),zB(e),rL(e)}),VB=j(92,Gz),HB=e=>{VB(e,e.az.trim()?new Set(e.b0):null)},UB=A(60,e=>{tV(e,e.ay?.query),nV(e,e.ay?.keys),rV(e,e.ay?.hit),HB(e)}),WB=P(HR,RI),GB=A(66,e=>{IP(e.a9,e.b4),WB(e)}),KB=A(67,e=>{aB(e),nB(e)}),qB=(e,t)=>{cV(e,t.cbs),lV(e,t.io)},JB=(e,t)=>{uV(e,t.sig),dV(e,t.timer)},YB=j(120),XB=j(118,e=>{GP(e.a9,e.ck),CF(e.aa,e.ck),YB(e,KV(e))}),ZB=I(`i39`,e=>{k(e.m,`click`,function(){NB(e,!e.at),Zn(e.at)}),k(e.o,`click`,function(){e.bj()}),k(e.q,`click`,function(){PB(e,!0)}),k(e.s,`click`,function(){e.cl()}),k(e.v,`click`,function(){e.as&&(MB(e,!1),$n(!1),e.bg(!1))}),k(e.w,`click`,function(){e.as||(MB(e,!0),$n(!0),e.bg(!0))}),k(e.x,`click`,function(){let t=!e.as;MB(e,t),$n(t),e.bg(t)})});function QB(e){z(e.a,H.diffView),z(e.b,H.diffCol),z(e.e,H.headText),z(e.f,H.pageTitle),z(e.g,H.diffStats),z(e.l,H.diffTools),kp(e.n),Ap(e.n,14),jp(e.n),os(e.p),ss(e.p,14),cs(e.p),z(e.q,[V.btn,H.filesBtn]),u_(e.t),d_(e.t,14),f_(e.t),z(e.u,H.scope),A_(e.z),E_(e.z,XV(e)),z(e.a1,H.diffMain),zP(e.a9),LP(e.a9,YV(e)),hF(e.aa,JV(e)),hB(e,null),SB(e,[]),wB(e,null),DB(e,null),kB(e,!1),AB(e,``),MB(e,Qn()),NB(e,Xn()),PB(e,!1),IB(e,!1),BB(e,0),UB(e,{query:``,hit:null,keys:[]}),GB(e,new Set),KB(e,new Set),qB(e,{io:null,cbs:null}),JB(e,{sig:``,timer:0}),XB(e,qV(e)),ZB(e)}var $B=D(10,Dg,(e=>`/${e}&`)(Og),Ez),eV=j(48,e=>{z(e.c,[H.diffHead,{[H.headWithSend]:e.am>0}]),B(e.j,e.am?`· ${vt(e.am)} comment${vt(e.am===1?``:`s`)}`:``),$B(e,+!e.am)}),tV=j(61,UL),nV=j(62),rV=j(63,e=>{iV(e,e.b1?.key),aV(e,e.b1?.repo),mB(e)}),iV=j(64,Gz),aV=j(65,P(RR)),oV=j(72),sV=M(71,e=>oV(e,ZV(e))),cV=j(69,sV),lV=j(70,sV),uV=j(75,e=>{Lz(e),jz(e)}),dV=j(77,e=>{Nz(e),jz(e)}),fV=j(80,jz),pV=j(113,e=>{uB(e),fB(e)}),mV=j(39,e=>{fV(e,QV(e)),pV(e,$V(e)),Lz(e),jz(e),xB(e)}),hV=j(40,e=>{Lz(e),jz(e)}),gV=j(41,e=>{jz(e),zB(e)}),_V=j(42,jz),vV=j(87,P(WR)),yV=j(90,e=>{B(e.h,e.bs),B(e.i,e.bs===1?``:`s`),bF(e.aa,e.bs),mB(e)}),bV=j(96,e=>{B(e.r,e.by),mB(e)}),xV=D(31,fr,(e=>`/${e}&`)(pr),JL),SV=(e,t)=>xV(e,+!t),CV=j(43,fB),wV=D(3,(e=>`<button title="Back to terminal">${e}</button>`)($o),(e=>` D/${e}&l`)(es),Az),TV=j(44,e=>wV(e,+!e.ai)),EV=j(45,Tz);function DV(e){return t=>{IB(e._,t)}}function OV(e){return function(t){e._.cm(t)}}function kV(e){return function(){e._.cc()}}function AV(e){return function(){DB(e._,null)}}function jV(e){return function(t){DB(e._._._._._._,t)}}function MV(e){return function(){wB(e._._._._._._,null)}}function NV(e){return function(t){e._._._._._._.cd(e._._.i,t)}}function PV(e){return function(t){e._._._._._._.ce(t)}}function FV(e){return function(t){wB(e._._._._._._,{key:e._._.j,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function IV(e){return()=>{e.bf&&clearTimeout(e.bf),e.bf=setTimeout(()=>{e.bf=0,e.bj()},250)}}function LV(e){return()=>(KB(e,new Set),e.bg(e.as,!0))}function RV(e){return async(t=e.as,n=!1)=>{kB(e,!0),DB(e,null);try{let r=new URLSearchParams;t&&r.set(`uncommitted`,`1`),n&&r.set(`refresh`,`1`);let i=r.size?`?${r}`:``,[a,o]=await Promise.all([sn(`/api/workspaces/${e.ad}/diff${i}`),sn(`/api/workspaces/${e.ad}/review`)]);hB(e,a),SB(e,o.comments||[]),e.bd=fg(a),e.ae&&e.bb(e.ae)}catch(t){DB(e,String(t.message||t))}kB(e,!1)}}function zV(e){return t=>{if(!t)return;let n=e.ak||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set;for(let e of n)(!r||e.id!==r.id)&&i.add(e.id);GB(e,i);let a=Date.now(),o=()=>{let e=scrollEl?.(),n=e?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!e||!n){Date.now()-a<2500&&requestAnimationFrame(o);return}let r=n.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:Math.max(0,r-8)})};requestAnimationFrame(o)}}function BV(e){return()=>{KB(e,new Set([...e.b5,...e.c9.map(e=>e.id)]))}}function VV(e){return async()=>await dg(yg(e.al,e.ak))?(await e.cf(),!0):(DB(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function HV(e){return async t=>{try{await sn(`/api/sessions/${t}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${yg(e.al,e.ak)}`,...hg()||{}})}),await e.cf(),e.ah?.(t)}catch(t){DB(e,String(t.message||t))}}}function UV(e){return async t=>{SB(e,e.al.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function WV(e){return async(t,n)=>{let r=e.an;wB(e,null);try{let i=await sn(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:t.repo,path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});SB(e,e.al.concat(i))}catch(t){DB(e,String(t.message||t))}}}function GV(e){return()=>{IB(e,!0),BB(e,e.aw+1)}}function KV(e){return t=>{UB(e,t),t.hit&&setTimeout(()=>e.ck(t.hit.key),0)}}function qV(e){return t=>{let n=e.a1.querySelector(`details[data-key="${CSS.escape(t)}"]`);n&&(n.open=!0,n.scrollIntoView({block:`start`}))}}function JV(e){return t=>{PB(e,t)}}function YV(e){return t=>{GB(e,t)}}function XV(e){return t=>{AB(e,t)}}function ZV(e){return(t,n)=>{e.b7??=new WeakMap,e.b8??=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.b8.unobserve(n.target),e.b7.get(n.target)?.())},{rootMargin:`600px 0px`}),e.b7.set(t,n),e.b8.observe(t)}}function QV(e){return async()=>{try{SB(e,(await sn(`/api/workspaces/${e.ad}/review`)).comments||[])}catch{}}}function $V(e){return async()=>{SB(e,[]),wB(e,null),await fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}L(`i16`,DV),L(`i17`,OV),L(`i19`,kV),L(`i18`,AV),L(`i24`,jV),L(`i22`,MV),L(`i21`,NV),L(`i23`,PV),L(`i20`,FV),L(`i5`,IV),L(`i4`,LV),L(`i2`,RV),L(`i1`,zV),L(`i6`,BV),L(`i10`,VV),L(`i11`,HV),L(`i8`,UV),L(`i7`,WV),L(`i13`,GV),L(`i14`,KV),L(`i12`,qV),L(`i26`,JV),L(`i25`,YV),L(`i15`,XV),L(`i0`,ZV),L(`i3`,QV),L(`i9`,$V);var J={page:`_bz`,body:`_bA`,content:`_bB`,pageHead:`_bC`,backBtn:`_bD`,pageHeadText:`_bE`,pageMeta:`_bF`,statusPill:`_bG`,statusOn:`_bH`,statusOff:`_bI`,progress:`_bJ`,section:`_bK`,sectionHead:`_bL`,sectionCount:`_bM`,sectionBtn:`_bN`,groupLabel:`_bO`,pickerWrap:`_bP`,cardList:`_bQ`,card:`_bR`,pending:`_bS`,cardMain:`_bT`,cardTitle:`_bU`,cardMeta:`_bV`,cardSub:`_bW`,cardTag:`_bX`,cardAction:`_bY`,dangerAction:`_bZ`,armed:`_b0`,okAction:`_b1`,prState:`_b2`,portLink:`_b3`,emptyNote:`_b4`,dangerZone:`_b5`,dangerRow:`_b6`,dangerBtn:`_b7`,dangerHint:`_b8`,pageHeadAside:`_b9`,iconBtn:`_b_ _cb`,spinning:`_ca _cc`},eH=((e,t,n)=>`<div role=region><div><div><header><button type=button title="Back to terminal" aria-label="Back to terminal">${e}</button><div><h1> </h1><p> </p></div><div><span> </span></div></header><!><!><section><div><h2>Repos</h2><span> </span><div></div><button title="Refresh repo list" aria-label="Refresh repo list">${t}</button></div><ul><!><!></ul><!><div>${n}</div></section><!><!><section><div><h2>Workspace</h2></div><div><!><button type=button> </button></div><p>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`)($o,is,us),tH=((e,t,n)=>` D D D D D/${e}&l D D l D m D D n%b%b D Db D l b D/${t}&m D%b%l%b D0${n}&m%b%b D b D%b D m o`)(es,as,ds),nH=new Map,rH=I(`k20`,e=>k(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),iH=e=>{z(e.a,[V.chip,J.portLink]),rH(e)},aH=j(3,e=>{R(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),B(e.b,e.d)}),oH=O(0,`<button>:<!></button>`,` Db%`,iH,(e,t)=>aH(e,t[0])),sH=N(4,0,e=>oH(e,[e._.k,e=>String(e)])),cH=e=>{sH._(e),z(e.a,J.cardMeta)},lH=e=>z(e.a,J.prState),uH=e=>z(e.a,J.prState),dH=N(0,0,e=>B(e.b,e._.e)),fH=e=>{dH._(e),z(e.a,[J.groupLabel,V.mono])},pH=e=>z(e.a,J.emptyNote),mH=e=>{z(e.a,[J.card,J.pending]),z(e.b,V.spin),z(e.c,J.cardMain),z(e.d,J.cardSub)},hH=(e,t)=>B(e.e,t),gH=(e,t)=>hH(e,t[0]),_H=e=>z(e.a,V.spin),vH=N(7,0,e=>B(e.b,e._.o)),yH=e=>{vH._(e),z(e.a,[J.cardTag,V.mono])},bH=I(`k21`,e=>k(e.f,`click`,function(){e._._.bn(e.m)})),xH=e=>{z(e.a,J.card),z(e.b,J.cardMain),z(e.c,[J.cardTitle,V.mono]),z(e.f,[J.cardAction,J.dangerAction]),bH(e)},SH=(e,t)=>R(e.b,`title`,t),CH=(e,t)=>B(e.d,t),wH=D(4,`<span></span>`,` `,cH),TH=(e,t)=>wH(e,+!t),EH=j(12,e=>{R(e.f,`title`,`Kill ${e.m}`),R(e.f,`aria-label`,`Kill process ${e.m}`)}),DH=(e,t)=>{SH(e,t[0]?.args),CH(e,t[0]?.cmd),OH(e,t[0]?.ports),EH(e,t[0]?.pid)},OH=j(10,e=>{TH(e,e.k?.length),sH(e)}),kH=O(4,`<li><div><span> </span><!></div><button type=button>×</button></li>`,` D D D l%l `,xH,DH),AH=N(31,0,e=>kH(e,[e._.bt,`pid`])),jH=e=>{AH._(e),MH._(e),z(e.a,J.section),z(e.b,J.sectionHead),z(e.c,J.sectionCount),z(e.e,J.cardList)},MH=N(31,0,e=>B(e.d,e._.bu)),NH=N(10,0,e=>R(e.a,`title`,`Confirm #${e._.u} is done — remove from this list`)),PH=I(`k18`,e=>k(e.a,`click`,function(){e._._._._.be(e._._.g,e._.u)})),FH=e=>{NH._(e),z(e.a,[J.cardAction,J.okAction]),PH(e)},IH=(e,t)=>R(e.f,`data-state`,t),LH=(e,t)=>B(e.g,t),RH=M(15,e=>{IH(e,e.n===`OPEN`&&e.o?`open`:(e.n||`open`).toLowerCase()),LH(e,e.n===`OPEN`&&e.o?`draft`:(e.n||`open`).toLowerCase())}),zH=D(10,`<button>✓</button>`,` `,FH),BH=D(7,`<span data-state=open title=Approved>✓</span>`,` `,uH,`<span data-state=closed title="Changes requested">✗</span>`,` `,lH),VH=M(19,e=>BH(e,e.n===`OPEN`&&e.s===`APPROVED`?0:e.n===`OPEN`&&e.s===`CHANGES_REQUESTED`?1:2)),HH=j(13,e=>{zH(e,+(e.n===`OPEN`)),RH(e),VH(e)}),UH=j(14,RH),WH=e=>{z(e.a,J.card),z(e.b,J.cardMain),z(e.c,J.cardTitle),z(e.e,J.cardMeta),z(e.f,J.prState),z(e.i,[J.cardTag,V.mono])},GH=(e,t)=>R(e.b,`href`,t),KH=(e,t)=>B(e.d,t),qH=j(18,VH),JH=j(20,e=>{B(e.j,e.u),NH(e)}),YH=(e,t)=>{HH(e,t[0]?.state),UH(e,t[0]?.isDraft),GH(e,t[0]?.url),KH(e,t[0]?.title),qH(e,t[0]?.reviewDecision),JH(e,t[0]?.number)},XH=D(0,`<p> </p>`,` D `,fH),ZH=F(101,e=>XH(e,e._._.bs>1?0:1),e=>e._._),QH=e=>{ZH(e),z(e.b,J.cardList)},$H=O(1,`<li><a target=_blank rel=noopener><span> </span><span><span> </span><!><span>#<!></span></span></a><!></li>`,` D D D l D D l%b Db%n%`,WH,YH),eU=(e,t)=>$H(e,[t,`number`]),tU=(e,t)=>{nU(e,t[0]?.worktree),eU(e,t[0]?.prs),rU(e,t[0]?.full_name)},nU=j(4,dH),rU=j(6),iU=F(99,e=>B(e.b,e._._.bo),e=>e._._),aU=I(`k17`,e=>k(e.a,`click`,function(){e._._.bd()})),oU=e=>{iU(e),z(e.a,[V.btn,J.sectionBtn]),aU(e)},sU=N(15,0,e=>B(e.c,e._.av)),cU=e=>{sU._(e),z(e.a,J.progress),z(e.b,V.spin)},lU=M(2,e=>{z(e.a,[J.cardAction,J.dangerAction,{[J.armed]:e._._.au===e._.m}]),B(e.b,e._._.au===e._.m?`Remove?`:`×`)}),uU=M(3,e=>R(e.a,`title`,e._._.au===e._.m?`Really remove ${e._.l}/? Uncommitted changes are lost.`:`Remove ${e._.l}/`),2),dU=F(97,e=>{lU(e),uU(e)},e=>e._._),fU=I(`k15`,e=>k(e.a,`click`,function(){e._._.au===e._.k?.full_name?(uW(e._._,null),e._._.bl(e._.k)):(uW(e._._,e._.k?.full_name),setTimeout(()=>{uW(e._._,null)},4e3))})),pU=e=>{dU(e),mU._(e),hU._(e),fU(e)},mU=N(8,1,uU),hU=N(8,1,e=>{lU(e),uU(e)}),gU=N(35,1,e=>R(e.a,`disabled`,!!e._.ar)),_U=I(`k23`,e=>k(e.a,`click`,function(){e._.bm(`restore`)})),vU=e=>{gU._(e),z(e.a,[V.btn,J.dangerBtn]),_U(e)},yU=N(35,0,e=>{R(e.a,`disabled`,!!e._.ar),B(e.b,e._.ar===`archive`?`Archiving…`:`Archive`)}),bU=I(`k22`,e=>k(e.a,`click`,function(){e._.bm(`archive`)})),xU=e=>{yU._(e),z(e.a,[V.btn,J.dangerBtn]),bU(e)},SU=F(95,e=>B(e.a,e._._.aq),e=>e._._),CU=gt(`k14`,` `,` `,SU),wU=e=>{Rr(e.a),Hr(e.a,CU(e)),Pr(e.a,`inline`),Kr(e.a,rG(e)),Gr(e.a),Fr(e.a),Ar(e.a),Br(e.a),Lr(e.a,{})},TU=D(8,`<span></span>`,` `,_H,`<button> </button>`,` D `,pU),EU=M(13,e=>TU(e,+!e._.ao.has(e.m))),DU=Xe(24,EU),OU=e=>{DU._(e),z(e.a,J.card),z(e.b,J.cardMain),z(e.c,[J.cardTitle,V.mono]),z(e.e,J.cardMeta),z(e.f,J.cardSub)},kU=j(11,e=>{B(e.d,e.l),mU(e)}),AU=j(12,e=>{B(e.g,e.m),EU(e),hU(e)}),jU=D(7,`<span title="Base branch">⎇ <!></span>`,` Db%`,yH),MU=M(16,e=>jU(e,+(e.o===e.p))),NU=j(14,e=>{MU(e),vH(e)}),PU=j(15,MU),FU=(e,t)=>IU(e,t[0]),IU=j(10,e=>{kU(e,e.k?.worktree),AU(e,e.k?.full_name),NU(e,e.k?.base_branch),PU(e,e.k?.default_branch)}),LU=N(30,0,e=>{z(e.e,[J.iconBtn,{[J.spinning]:e._.an}]),R(e.e,`disabled`,e._.an)}),RU=I(`k19`,e=>k(e.e,`click`,function(){e._.bc()})),zU=e=>{LU._(e),VU._(e),UU._(e),z(e.a,J.section),z(e.b,J.sectionHead),z(e.c,V.spacer),os(e.f),ss(e.f,14),cs(e.f),RU(e)},BU=D(3,`<button title="Confirm every merged/closed PR is done — remove them from this list">Clear <!></button>`,` Db%`,oU),VU=N(30,0,e=>BU(e,+!e._.bo)),HU=O(6,`<!><!><ul></ul>`,`b%b `,QH,tU),UU=N(30,0,e=>HU(e,[e._.br,`full_name`])),WU=it(88),GU=A(46,e=>{z(e.v,[J.iconBtn,{[J.spinning]:e.ak}]),R(e.v,`disabled`,e.ak)}),KU=A(49,LU),qU=j(82,e=>Tc(e.a2,iG(e))),JU=M(81,e=>qU(e,aG(e)),2),YU=j(83),XU=M(80,e=>YU(e,oG(e)),2),ZU=j(79,e=>{JU(e),XU(e)}),QU=O(25,`<li><span></span><div><span>Adding <!>…</span></div></li>`,` D b D Db%`,mH,gH),$U=M(78,e=>QU(e,[[...e.ao].filter(t=>!e.bf.has(t)),e=>e])),eW=A(50,e=>{EW(e,e.ao?.size),ZU(e,sG(e)),JU(e),XU(e),$U(e),DU(e)}),tW=D(14,fr,(e=>`/${e}&`)(pr),wU),nW=P(SU),rW=A(52,e=>{tW(e,+!e.aq),nW(e)}),iW=M(73,I(`k25`,e=>kt(e,{busyCount:e.ap,pendingAction:e.ar,onMount:function(){let t=new AbortController,n=t.signal;return Tn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.az&&dW(e,t.data.message)},{signal:n}),e.b8(n),e.b9(n,!1).then(()=>e.b9(n,!0)),{abort:t}},onDestroy:function(){this.abort.abort()}})),4),aW=D(15,`<p><span></span> </p>`,` D b `,cU),oW=M(58,e=>aW(e,e.ar&&e.av?0:1)),sW=M(55,e=>B(e.ab,e.ar===`delete`?`Deleting…`:e.as?`Really delete?`:`Delete`)),cW=A(53,e=>{R(e.e,`disabled`,!!e.ar),R(e.aa,`disabled`,!!e.ar),iW(e),oW(e),sW(e),yU(e),gU(e)}),lW=A(54,e=>{z(e.aa,[V.btn,V.danger,J.dangerBtn,{[V.armed]:e.as}]),sW(e)}),uW=A(56,P(dU)),dW=A(57,e=>{oW(e),sU(e)}),fW=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},pW=I(`k24`,e=>{k(e.e,`click`,function(){e.aj?.()}),k(e.v,`click`,function(){WU(e)()}),k(e.aa,`click`,function(){e.as?(lW(e,!1),e.bm(`delete`)):(lW(e,!0),setTimeout(()=>{lW(e,!1)},4e3))})});function mW(e){z(e.a,J.page),z(e.b,J.body),z(e.c,J.content),z(e.d,J.pageHead),z(e.e,[J.iconBtn,J.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,J.pageHeadText),z(e.j,[J.pageMeta,V.mono]),z(e.l,J.pageHeadAside),z(e.q,J.section),z(e.r,J.sectionHead),z(e.s,J.sectionCount),z(e.u,V.spacer),os(e.w),ss(e.w,14),cs(e.w),z(e.x,J.cardList),z(e.a1,J.pickerWrap),tt(e,28,ZW),_c(e.a2),bc(e.a2,lG(e)),$s(e.a2,cG(e)),Qs(e.a2),Ec(e.a2),z(e.a6,[J.section,J.dangerZone]),z(e.a7,J.sectionHead),z(e.a8,J.dangerRow),z(e.ac,J.dangerHint),GU(e,!1),KU(e,!1),eW(e,new Set),rW(e,null),cW(e,null),lW(e,!1),uW(e,null),dW(e,null),fW(e,nt(e)),pW(e)}var hW=j(91,e=>{nG(e,e.bt.length),AH(e)}),gW=A(47,e=>hW(e,e.al||[])),_W=P(iU),vW=j(86,e=>{VU(e),_W(e)}),yW=j(89,e=>{eG(e,e.br?.length),UU(e)}),bW=j(75),xW=M(72,e=>bW(e,uG(e)),2),SW=A(48,e=>{vW(e,(e.am||[]).reduce((e,t)=>e+t.prs.filter(e=>e.state!==`OPEN`).length,0)),yW(e,(e.am||[]).filter(e=>e.prs.length)),xW(e)}),CW=(e,t)=>{gW(e,nH.get(`procs:${t}`)||null),SW(e,nH.get(`prs:${t}`)||null)},wW=D(26,`<p>No repos yet — search below to add one.</p>`,` `,pH),TW=M(69,e=>wW(e,!e.b6&&!e.ap?0:1)),EW=j(51,e=>{iW(e),TW(e)}),DW=e=>{R(e.j,`title`,e.b3||e.b4),B(e.k,e.b3||e.b4)},OW=Ye(59,e=>{kW(e,e.ax),XU(e),DW(e)}),kW=e=>{LW(e,e.ax?.id),BW(e,e.ax?.repos),HW(e,e.ax?.name),UW(e,e.ax?.display_path),WW(e,e.ax?.path),KW(e,e.ax?.status)},AW=j(85),jW=j(70,e=>{AW(e,dG(e)),iW(e)}),MW=j(74),NW=j(71,e=>{MW(e,pG(e)),iW(e),xW(e)}),PW=j(76),FW=j(84),IW=M(62,e=>FW(e,gG(e))),LW=j(61,e=>{jW(e,fG(e)),NW(e,mG(e)),PW(e,hG(e)),iW(e),xW(e),JU(e),IW(e)}),RW=j(77,e=>{Sc(e.a2,e.bf),$U(e)}),zW=O(24,`<li><div><span><!>/</span><span><span> </span><!></span></div><!></li>`,` D D D%l D D l%m%`,OU,FU),BW=j(63,e=>{VW(e,e.b1?.length),RW(e,new Set(e.b1.map(e=>e.full_name))),zW(e,[e.b1,`full_name`])}),VW=j(68,e=>{B(e.t,e.b6),TW(e)}),HW=j(64,e=>B(e.i,e.b2)),UW=j(65),WW=j(66),GW=D(35,`<button type=button> </button>`,` D `,xU,`<button type=button>Restore</button>`,` `,vU),KW=j(67,e=>{z(e.m,[J.statusPill,e.b5===`active`?J.statusOn:J.statusOff]),B(e.n,e.b5===`active`?`Active`:`Archived`),GW(e,e.b5===`active`?0:1)}),qW=M(44,e=>OW(e,e.af,e.ah)),JW=j(41,e=>{CW(e,e.af?.id),qW(e)}),YW=j(43,qW),XW=j(45,IW),ZW=lt(`k16`,j(88)),QW=D(30,(e=>`<section><div><h2>Pull requests</h2><div></div><!><button title="Refresh PRs" aria-label="Refresh PRs">${e}</button></div><!></section>`)(is),(e=>` D Db b%b D/${e}&m%l`)(as),zU),$W=P(ZH),eG=j(90,e=>{QW(e,+!e.bs),$W(e)}),tG=D(31,`<section><div><h2>Running</h2><span> </span></div><ul></ul></section>`,` D Db D m `,jH),nG=j(92,e=>{tG(e,+!e.bu),MH(e)});function rG(e){return function(){rW(e._,null)}}function iG(e){return function(t,n){e.bk(t,n)}}function aG(e){return async(t,n)=>{if(!(!t||e.ao.has(t))){rW(e,null),e.bh(t,!0);try{OW(e,await sn(`/api/workspaces/${e.az}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){rW(e,String(t.message||t))}e.bh(t,!1)}}}function oG(e){return async t=>{if(!e.ao.has(t.full_name)){rW(e,null),e.bh(t.full_name,!0);try{await sn(`/api/workspaces/${e.ax?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),OW(e,{...e.ax,repos:(e.ax?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){rW(e,String(t.message||t))}e.bh(t.full_name,!1)}}}function sG(e){return(t,n)=>{let r=new Set(e.ao);n?r.add(t):r.delete(t),eW(e,r)}}function cG(e){return function(t){GU(e,t)}}function lG(e){return function(t){rW(e,t)}}function uG(e){return async()=>{for(let t of e.am||[])for(let n of t.prs)n.state!==`OPEN`&&await sn(`/api/workspaces/${e.az}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t.full_name,number:n.number})}).catch(()=>{});await e.b9(void 0,!1)}}function dG(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.b8(void 0),500)}}function fG(e){return async t=>{try{let n=await sn(`/api/workspaces/${e.az}/procs`,{signal:t});gW(e,n),nH.set(`procs:${e.az}`,n)}catch{}}}function pG(e){return async()=>{KU(e,!0),await e.b9(void 0,!0),KU(e,!1)}}function mG(e){return async(t,n)=>{try{let r=await sn(`/api/workspaces/${e.az}/prs${n?`?refresh`:``}`,{signal:t});SW(e,r),nH.set(`prs:${e.az}`,r)}catch{}}}function hG(e){return async(t,n)=>{rW(e,null);try{let r=await sn(`/api/workspaces/${e.az}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})});SW(e,r),nH.set(`prs:${e.az}`,r)}catch(t){rW(e,String(t.message||t))}}}function gG(e){return async t=>{rW(e,null),cW(e,t),dW(e,null);try{await sn(`/api/workspaces/${e.az}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`delete`&&e.aj?.()}catch(t){rW(e,String(t.message||t))}finally{cW(e,null),dW(e,null)}}}L(`k10`,rG),L(`k11`,iG),L(`k6`,aG),L(`k7`,oG),L(`k5`,sG),L(`k13`,cG),L(`k12`,lG),L(`k3`,uG),L(`k9`,dG),L(`k0`,fG),L(`k2`,pG),L(`k1`,mG),L(`k4`,hG),L(`k8`,gG);var _G={page:`_c3`,body:`_c4`,content:`_c5`,iconBtn:`_c6 _cb`,spinning:`_c7 _cc`,pageHead:`_c8`,backBtn:`_c9`,refreshBtn:`_c_`,pageHeadText:`_da`,pageMeta:`_db`,pageHeadAside:`_dc`,note:`_dd`,usageList:`_de`,usageRow:`_df`,usageName:`_dg`,plan:`_dh`,usageStale:`_di`,stale:`_dj`,usageMeters:`_dk`,meter:`_dl`,meterLabel:`_dm`,meterTrack:`_dn`,meterFill:`_do`,fillOk:`_dp`,fillMid:`_dq`,fillWarm:`_dr`,fillHot:`_ds`,meterPct:`_dt`,pctOk:`_du`,pctMid:`_dv`,pctWarm:`_dw`,pctHot:`_dx`,meterReset:`_dy`},vG=((e,t)=>`<div role=region><div><div><header><button type=button title="Back to terminal" aria-label="Back to terminal">${e}</button><div><h1>Usage</h1><p>Provider plan windows across your agents.</p></div><div><button title="Refresh usage" aria-label="Refresh usage">${t}</button></div></header><!></div></div></div>`)($o,is),yG=((e,t)=>` D D D D D/${e}&l D b l D D/${t}&n%n`)(es,as);function bG(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function xG(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:bG(n)}var SG=(e,t)=>B(e.i,t?`↻ ${vt(t)}`:``),CG=M(13,e=>SG(e,xG(e.m,e._.i!=null))),wG=Xe(5,CG),TG=e=>{wG._(e),z(e.a,_G.meter),z(e.b,_G.meterLabel),z(e.d,_G.meterTrack),z(e.h,_G.meterReset)},EG=M(16,e=>R(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),DG=j(15,e=>{B(e.g,e.p),EG(e)}),OG=(e,t)=>z(e.e,[_G.meterFill,t]),kG=(e,t)=>z(e.f,[_G.meterPct,t]),AG=(e,t)=>{bt(e.e,`width:${Math.min(100,Math.max(2,t))}%`),DG(e,Math.round(t)),OG(e,t>=90?_G.fillHot:t>=70?_G.fillWarm:t>=40?_G.fillMid:_G.fillOk),kG(e,t>=90?_G.pctHot:t>=70?_G.pctWarm:t>=40?_G.pctMid:_G.pctOk)},jG=j(12,e=>{CG(e),EG(e)}),MG=j(14,e=>{B(e.c,e.o),EG(e)}),NG=(e,t)=>{AG(e,t[0]?.used_percent),jG(e,t[0]?.resets_at),MG(e,t[0]?.window)},PG=N(4,0,e=>{R(e.a,`title`,`plan-usage could not reach this provider — these are its last cached numbers, ${bG(e._.i*1e3)} old`),B(e.b,bG(e._.i*1e3))}),FG=e=>{PG._(e),z(e.a,_G.usageStale)},IG=N(3,0,e=>B(e.b,e._.k.replace(/^default_/,``).replaceAll(`_`,` `))),LG=e=>{IG._(e),z(e.a,_G.plan)},RG=D(4,`<span>⚠ <!> old</span>`,` Db%`,FG),zG=j(8,e=>{z(e.a,[_G.usageRow,{[_G.stale]:e.i!=null}]),RG(e,+(e.i==null)),PG(e),wG(e)}),BG=e=>{z(e.b,_G.usageName),z(e.f,_G.usageMeters)},VG=(e,t)=>B(e.c,t),HG=D(3,`<span> </span>`,` D `,LG),UG=j(10,e=>{HG(e,+!e.k),IG(e)}),WG=O(5,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,TG,NG),GG=(e,t)=>WG(e,[t||[],`window`]),KG=(e,t)=>{zG(e,t[0]?.stale_seconds),VG(e,t[0]?.agent),UG(e,t[0]?.plan),GG(e,t[0]?.windows)},qG=e=>{z(e.a,[V.dim,_G.note]),z(e.b,V.spin)},JG=O(0,`<div><div><strong> </strong><!><!></div><div></div></div>`,` D E l%b%l `,BG,KG),YG=N(12,2,e=>JG(e,[e._.s||[],e=>`${e.agent}-${e.account||``}`])),XG=e=>{YG._(e),z(e.a,_G.usageList)},ZG=N(12,1,e=>B(e.b,e._.r)),QG=D(12,`<p><span></span> Loading usage…</p>`,` D `,qG,`<p> </p>`,` D `,e=>{ZG._(e),z(e.a,[V.dim,_G.note])},`<div></div>`,` `,XG),$G=A(16,e=>{eK(e,e.q?.error),tK(e,e.q?.agents),QG(e,e.q?e.q?.error?1:2:0)}),eK=j(17,ZG),tK=j(18,YG),nK=A(19,e=>{z(e.k,[_G.iconBtn,_G.refreshBtn,{[_G.spinning]:e.t}]),R(e.k,`disabled`,e.t)}),rK=j(21),iK=I(`w3`,e=>kt(e,{onMount:function(){e.u(!1)}})),aK=j(20,e=>{rK(e,uK(e)),iK(e)}),oK=(e,t)=>{R(e.a,`aria-labelledby`,t),R(e.h,`id`,t)},sK=I(`w2`,e=>{k(e.e,`click`,function(){e.p?.()}),k(e.k,`click`,function(){e.v()})});function cK(e){z(e.a,_G.page),z(e.b,_G.body),z(e.c,_G.content),z(e.d,_G.pageHead),z(e.e,[_G.iconBtn,_G.backBtn]),ts(e.f),ns(e.f,14),rs(e.f),z(e.g,_G.pageHeadText),z(e.i,_G.pageMeta),z(e.j,_G.pageHeadAside),os(e.l),ss(e.l,14),cs(e.l),$G(e,null),nK(e,!1),aK(e,dK(e)),oK(e,nt(e)),sK(e)}var lK=j(15);function uK(e){return async()=>{nK(e,!0),await e.u(!0),nK(e,!1)}}function dK(e){return async t=>{try{$G(e,await sn(`/api/usage${t?`?refresh`:``}`))}catch(t){$G(e,{error:String(t.message||t)})}}}L(`w1`,uK),L(`w0`,dK);var fK=Object.defineProperty,pK=Object.getOwnPropertyDescriptor,mK=(e,t)=>{for(var n in t)fK(e,n,{get:t[n],enumerable:!0})},hK=(e,t,n,r)=>{for(var i=r>1?void 0:r?pK(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&fK(t,n,i),i},Y=(e,t)=>(n,r)=>t(n,r,e),gK=`Terminal input`,_K={get:()=>gK,set:e=>gK=e},vK=`Too much output to announce, navigate to rows manually to read`,yK={get:()=>vK,set:e=>vK=e};function bK(e){return e.replace(/\r?\n/g,`\r`)}function xK(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function SK(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function CK(e,t,n,r){e.stopPropagation(),e.clipboardData&&wK(e.clipboardData.getData(`text/plain`),t,n,r)}function wK(e,t,n,r){e=bK(e),e=xK(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function TK(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function EK(e,t,n,r,i){TK(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function DK(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function OK(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var kK=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},AK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},jK=``,MK=` `,NK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new PK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},PK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},FK=class e extends NK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new PK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?DK(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},IK=`di$target`,LK=`di$dependencies`,RK=new Map;function zK(e){return e[LK]||[]}function BK(e){if(RK.has(e))return RK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);VK(t,e,r)};return t._id=e,RK.set(e,t),t}function VK(e,t,n){t[IK]===t?t[LK].push({id:e,index:n}):(t[LK]=[{id:e,index:n}],t[IK]=t)}var HK=BK(`BufferService`),UK=BK(`CoreMouseService`),WK=BK(`CoreService`),GK=BK(`CharsetService`),KK=BK(`InstantiationService`),qK=BK(`LogService`),JK=BK(`OptionsService`),YK=BK(`OscLinkService`),XK=BK(`UnicodeService`),ZK=BK(`DecorationService`),QK=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new FK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):$K(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};QK=hK([Y(0,HK),Y(1,JK),Y(2,YK)],QK);function $K(e,t){if(confirm(`Do you want to navigate to ${t}?
1533
1533
 
1534
1534
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var eq=BK(`CharSizeService`),tq=BK(`CoreBrowserService`),nq=BK(`MouseService`),rq=BK(`RenderService`),iq=BK(`SelectionService`),aq=BK(`CharacterJoinerService`),oq=BK(`ThemeService`),sq=BK(`LinkProviderService`),cq=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?mq.isErrorNoTelemetry(e)?new mq(e.message+`
1535
1535
 
@@ -1611,5 +1611,5 @@ out vec4 outColor;
1611
1611
 
1612
1612
  void main() {
1613
1613
  outColor = v_color;
1614
- }`,V2=8,H2=V2*Float32Array.BYTES_PER_ELEMENT,U2=20*V2,W2=class{constructor(){this.attributes=new Float32Array(U2),this.count=0}},G2=0,K2=0,q2=0,J2=0,Y2=0,X2=0,Z2=0,Q2=class extends C1{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new W2,this._verticesCursor=new W2;let i=this._gl;this._program=G1(_2(i,z2,B2)),this._register(b1(()=>i.deleteProgram(this._program))),this._projectionLocation=G1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(b1(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(b1(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=G1(i.createBuffer()),this._register(b1(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,H2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,H2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,H2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,g2),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*N2,d=e.cells[u+P2],f=e.cells[u+F2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*V2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:G2=(n&16777215)<<8;break;case 0:default:G2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:G2=(r&16777215)<<8;break;case 0:default:G2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=y2(e.attributes,this._terminal.rows*this._terminal.cols*V2)),K2=i*this._dimensions.device.cell.width,q2=o*this._dimensions.device.cell.height,J2=(G2>>24&255)/255,Y2=(G2>>16&255)/255,X2=(G2>>8&255)/255,Z2=1,this._addRectangle(e.attributes,t,K2,q2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,J2,Y2,X2,Z2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},$2=class extends C1{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(b1(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=G1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=l2(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=d0,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},e4=class extends $2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&s2(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},t4=typeof window==`object`?window:globalThis,n4=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Y0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Y0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};n4.INSTANCE=new n4;var r4=n4;function i4(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}r4.INSTANCE.onDidChangeZoomLevel,r4.INSTANCE.onDidChangeFullscreen;var a4=typeof navigator==`object`?navigator.userAgent:``;a4.indexOf(`Firefox`);var o4=a4.indexOf(`AppleWebKit`)>=0;!(a4.indexOf(`Chrome`)>=0)&&a4.indexOf(`Safari`),a4.indexOf(`Electron/`),a4.indexOf(`Android`);var s4=!1;if(typeof t4.matchMedia==`function`){let e=t4.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=t4.matchMedia(`(display-mode: fullscreen)`);s4=e.matches,i4(t4,e,({matches:e})=>{s4&&t.matches||(s4=e)})}function c4(){return s4}var l4=`en`,u4=!1,d4=!1,f4=!1,p4=l4,m4,h4=globalThis,g4;typeof h4.vscode<`u`&&typeof h4.vscode.process<`u`?g4=h4.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(g4=process);var _4=typeof g4?.versions?.electron==`string`&&g4?.type===`renderer`;if(typeof g4==`object`){g4.platform,g4.platform,u4=g4.platform===`linux`,u4&&g4.env.SNAP&&g4.env.SNAP_REVISION,g4.env.CI||g4.env.BUILD_ARTIFACTSTAGINGDIRECTORY,p4=l4;let e=g4.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,p4=t.resolvedLanguage||l4,t.languagePack?.translationsConfigFile}catch{}d4=!0}else typeof navigator==`object`&&!_4?(m4=navigator.userAgent,m4.indexOf(`Windows`),m4.indexOf(`Macintosh`),(m4.indexOf(`Macintosh`)>=0||m4.indexOf(`iPad`)>=0||m4.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,u4=m4.indexOf(`Linux`)>=0,m4?.indexOf(`Mobi`),f4=!0,p4=globalThis._VSCODE_NLS_LANGUAGE||l4,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var v4=d4;f4&&typeof h4.importScripts==`function`&&h4.origin;var y4=m4,b4=p4,x4;(e=>{function t(){return b4}e.value=t;function n(){return b4.length===2?b4===`en`:b4.length>=3&&b4[0]===`e`&&b4[1]===`n`&&b4[2]===`-`}e.isDefaultVariant=n;function r(){return b4===`en`}e.isDefault=r})(x4||={});var S4=typeof h4.postMessage==`function`&&!h4.importScripts;(()=>{if(S4){let e=[];h4.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),h4.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var C4=!!(y4&&y4.indexOf(`Chrome`)>=0);y4&&y4.indexOf(`Firefox`),!C4&&y4&&y4.indexOf(`Safari`),y4&&y4.indexOf(`Edg/`),y4&&y4.indexOf(`Android`);var w4=typeof navigator==`object`?navigator:{};v4||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||w4&&w4.clipboard&&w4.clipboard.writeText,v4||w4&&w4.clipboard&&w4.clipboard.readText,v4||c4()||w4.keyboard,`ontouchstart`in t4||w4.maxTouchPoints,t4.PointerEvent&&(`ontouchstart`in t4||navigator.maxTouchPoints);var T4=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},E4=new T4,D4=new T4,O4=new T4;Array(230);var k4;(e=>{function t(e){return E4.keyCodeToStr(e)}e.toString=t;function n(e){return E4.strToKeyCode(e)}e.fromString=n;function r(e){return D4.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return O4.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return D4.strToKeyCode(e)||O4.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return E4.keyCodeToStr(e)}e.toElectronAccelerator=o})(k4||={});var A4=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),j4;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof M4?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:I0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:A4})})(j4||={});var M4=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?A4:(this._emitter||=new Y0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var N4;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(N4||={});var P4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Y0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await I0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};P4.EMPTY=P4.fromArray([]);function F4(e){return I4(e,0)}function I4(e,t){switch(typeof e){case`object`:return e===null?L4(349,t):Array.isArray(e)?B4(e,t):V4(e,t);case`string`:return z4(e,t);case`boolean`:return R4(e,t);case`number`:return L4(e,t);case`undefined`:return L4(937,t);default:return L4(617,t)}}function L4(e,t){return(t<<5)-t+e|0}function R4(e,t){return L4(e?433:863,t)}function z4(e,t){t=L4(149417,t);for(let n=0,r=e.length;n<r;n++)t=L4(e.charCodeAt(n),t);return t}function B4(e,t){return t=L4(104579,t),e.reduce((e,t)=>I4(t,e),t)}function V4(e,t){return t=L4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=z4(n,t),I4(e[n],t)),t)}var{registerWindow:Ire,getWindow:H4,getDocument:Lre,getWindows:Rre,getWindowsCount:zre,getWindowId:Bre,getWindowById:Vre,hasWindow:Hre,onDidRegisterWindow:Ure,onWillUnregisterWindow:Wre,onDidUnregisterWindow:Gre}=function(){let e=new Map,t={window:t4,disposables:new S1};e.set(t4.vscodeWindowId,t);let n=new Y0,r=new Y0,i=new Y0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return C1.None;let a=new S1,o={window:t,disposables:a.add(new S1)};return e.set(t.vscodeWindowId,o),a.add(b1(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(W4(t,K4.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:t4},getDocument(e){return H4(e).document}}}(),U4=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function W4(e,t,n,r){return new U4(e,t,n,r)}var G4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};G4.None=new G4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=F4(n),a=r.get(i);if(a)a.users+=1;else{let o=new Y0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(b1(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var K4={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:o4?`webkitAnimationStart`:`animationstart`,ANIMATION_END:o4?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:o4?`webkitAnimationIteration`:`animationiteration`},q4=class extends C1{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new w1,this._charAtlasDisposable=this._register(new w1),this._observerDisposable=this._register(new w1),this._model=new R2,this._workCell=new h2,this._workCell2=new h2,this._rectangleRenderer=this._register(new w1),this._glyphRenderer=this._register(new w1),this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Y0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new l0(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new e4(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=$1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(W4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(W4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=p2(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=p2(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(b1(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Q2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new A2(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=l2(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=y1(I0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),I0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new f2(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=Y4(e,n.rows-1,0),t=Y4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new J4(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*N2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+P2]!==this._cellColorResolver.result.bg||this._model.cells[v+F2]!==this._cellColorResolver.result.fg||this._model.cells[v+I2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=L2),this._model.cells[v]=g,this._model.cells[v+P2]=this._cellColorResolver.result.bg,this._model.cells[v+F2]=this._cellColorResolver.result.fg,this._model.cells[v+I2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*N2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,M1,0,0),this._model.cells[b]=0,this._model.cells[b+P2]=this._cellColorResolver.result.bg,this._model.cells[b+F2]=this._cellColorResolver.result.fg,this._model.cells[b+I2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},J4=class extends j0{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Y4(e,t,n=0){return Math.max(Math.min(e,t),n)}var X4=`di$target`,Z4=`di$dependencies`,Q4=new Map;function $4(e){if(Q4.has(e))return Q4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);e3(t,e,r)};return t._id=e,Q4.set(e,t),t}function e3(e,t,n){t[X4]===t?t[Z4].push({id:e,index:n}):(t[Z4]=[{id:e,index:n}],t[X4]=t)}$4(`BufferService`),$4(`CoreMouseService`),$4(`CoreService`),$4(`CharsetService`),$4(`InstantiationService`),$4(`LogService`);var t3=$4(`OptionsService`);$4(`OscLinkService`),$4(`UnicodeService`),$4(`DecorationService`);var n3={trace:0,debug:1,info:2,warn:3,error:4,off:5},r3=`xterm.js: `,i3=class extends C1{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),a3=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=n3[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:r3)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};i3=n1([r1(0,t3)],i3);var a3,o3=class extends C1{constructor(e){if(A1&&j1()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new q4(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(I0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(I0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(I0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(I0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(b1(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},s3=2,c3=1,l3=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(s3,Math.floor(u/e.css.cell.width)),rows:Math.max(c3,Math.floor(l/e.css.cell.height))}}},u3=`3.7.8`,d3=u3,f3=typeof Buffer==`function`,p3=typeof TextDecoder==`function`?new TextDecoder:void 0,m3=typeof TextEncoder==`function`?new TextEncoder:void 0,h3=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),g3=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(h3),_3=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,v3=String.fromCharCode.bind(String),y3=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),b3=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),x3=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),S3=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=h3[t>>18&63]+h3[t>>12&63]+h3[t>>6&63]+h3[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},C3=typeof btoa==`function`?e=>btoa(e):f3?e=>Buffer.from(e,`binary`).toString(`base64`):S3,w3=f3?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(v3.apply(null,e.subarray(n,n+4096)));return C3(t.join(``))},T3=(e,t=!1)=>t?b3(w3(e)):w3(e),E3=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?v3(192|t>>>6)+v3(128|t&63):v3(224|t>>>12&15)+v3(128|t>>>6&63)+v3(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return v3(240|t>>>18&7)+v3(128|t>>>12&63)+v3(128|t>>>6&63)+v3(128|t&63)},D3=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,O3=e=>e.replace(D3,E3),k3=f3?e=>Buffer.from(e,`utf8`).toString(`base64`):m3?e=>w3(m3.encode(e)):e=>C3(O3(e)),A3=(e,t=!1)=>t?b3(k3(e)):k3(e),j3=e=>A3(e,!0),M3=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,N3=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return v3((t>>>10)+55296)+v3((t&1023)+56320);case 3:return v3((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return v3((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},P3=e=>e.replace(M3,N3),F3=e=>{if(e=e.replace(/\s+/g,``),!_3.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=g3[e.charAt(a++)]<<18|g3[e.charAt(a++)]<<12|(n=g3[e.charAt(a++)])<<6|(r=g3[e.charAt(a++)]),n===64?i.push(v3(t>>16&255)):r===64?i.push(v3(t>>16&255,t>>8&255)):i.push(v3(t>>16&255,t>>8&255,t&255));return i.join(``)},I3=typeof atob==`function`?e=>atob(x3(e)):f3?e=>Buffer.from(e,`base64`).toString(`binary`):F3,L3=f3?e=>y3(Buffer.from(e,`base64`)):e=>y3(I3(e).split(``).map(e=>e.charCodeAt(0))),R3=e=>L3(B3(e)),z3=f3?e=>Buffer.from(e,`base64`).toString(`utf8`):p3?e=>p3.decode(L3(e)):e=>P3(I3(e)),B3=e=>x3(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),V3=e=>z3(B3(e)),H3=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},U3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),W3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,U3(t));e(`fromBase64`,function(){return V3(this)}),e(`toBase64`,function(e){return A3(this,e)}),e(`toBase64URI`,function(){return A3(this,!0)}),e(`toBase64URL`,function(){return A3(this,!0)}),e(`toUint8Array`,function(){return R3(this)})},G3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,U3(t));e(`toBase64`,function(e){return T3(this,e)}),e(`toBase64URI`,function(){return T3(this,!0)}),e(`toBase64URL`,function(){return T3(this,!0)})},K3={version:u3,VERSION:d3,atob:I3,atobPolyfill:F3,btoa:C3,btoaPolyfill:S3,fromBase64:V3,toBase64:A3,encode:A3,encodeURI:j3,encodeURL:j3,utob:O3,btou:P3,decode:V3,isValid:H3,fromUint8Array:T3,toUint8Array:R3,extendString:W3,extendUint8Array:G3,extendBuiltins:()=>{W3(),G3()}},q3=class{constructor(e=new Y3,t=new J3){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},J3=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},Y3=class{encodeText(e){return K3.encode(e)}decodeText(e){let t=K3.decode(e);return!K3.isValid(e)||K3.encode(t)!==e?``:t}},X3=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=Q3.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function Z3(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var Q3=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!Z3(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},$3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function e6(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var t6=class{constructor(e=e6,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||$3;this._linkProvider=this._terminal.registerLinkProvider(new X3(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function n6(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function r6(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function i6(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function a6(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var o6=450,s6=12,c6=` ·│┃()[]{}<>'"\`,;│|`;function l6(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||c6.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},o6)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>s6&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&dg(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var u6=5;function d6(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<u6)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await dg(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}var $={iconBtn:`_dI _eg`,termWrap:`_dJ`,term:`_dK`,xterm:`_dL`,termDead:`_dM`,termCopied:`_dN`,termCopiedFade:`_dO`,termUploading:`_dP`,trapBackdrop:`_dQ`,pasteTrap:`_dR`,kbSlot:`_dS`,keyBar:`_dT`,kspacer:`_dU`,sessBtn:`_dV`,sessDot:`_dW`,sessPop:`_dX`,sessRow:`_dY`,current:`_dZ`,sessOpen:`_d0`,sessTitle:`_d1`,sessRename:`_d2`,sessX:`_d3`,armed:`_d4`,sessEdit:`_d5`,sessNew:`_d6`,lone:`_d7`,kbarWs:`_d8`,kbarWsName:`_d9`,kbtn:`_d_ _eg`,kbtnEsc:`_ea`,dpadGrid:`_eb`,repeat:`_ec`,on:`_ed`,bigGlyph:`_ee`,enter:`_ef`},f6=ei,p6=(e=>`/${e}&`)(ti);function m6(e){ii(e.a,`M8 6L20 6 M4 6.01L4.01 5.99889 M4 12.01L4.01 11.9989 M4 18.01L4.01 17.9989 M8 12L20 12 M8 18L20 18`)}var h6=(e,t)=>ni(e.a,t),g6=(e,t)=>ri(e.a,t),_6=ei,v6=(e=>`/${e}&`)(ti);function y6(e){ii(e.a,`M15 4L8 20`)}var b6=(e,t)=>ni(e.a,t),x6=(e,t)=>ri(e.a,t),S6=ei,C6=(e=>`/${e}&`)(ti);function w6(e){ii(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var T6=(e,t)=>ni(e.a,t),E6=(e,t)=>ri(e.a,t),D6=ei,O6=(e=>`/${e}&`)(ti);function k6(e){ii(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var A6=(e,t)=>ni(e.a,t),j6=(e,t)=>ri(e.a,t),M6=ei,N6=(e=>`/${e}&`)(ti);function P6(e){ii(e.a,`M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z M3 16L10 13L21 18 M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z`)}var F6=(e,t)=>ni(e.a,t),I6=(e,t)=>ri(e.a,t),L6=`<div><div></div><!><!><!><!></div><!><!>`,R6=` D b%b%b%b%l%c`,z6=400,B6=55,V6=3e4,H6=150,U6=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`attach`}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`key`,label:`⇥`,seq:` `},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],W6=I(`u19`,e=>k(e.a,`click`,function(){e._._._.k.click()})),G6=e=>{P6(e.b),F6(e.b,16),I6(e.b),W6(e)},K6=I(`u13`,e=>k(e.a,`click`,function(){W8(e._._._,e._._.d),G8(e._._._,e._._.i||e._._.h)})),q6=e=>{z(e.a,[$.sessX,$.sessEdit]),ou(e.b),su(e.b,12),cu(e.b),K6(e)},J6=F(6,e=>Ft(e,`c`,e._._.c,p5(e)),e=>e._._),Y6=I(`u12`,e=>{It(e,`c`),k(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._.e(e._.d)):t.key===`Escape`&&(t.preventDefault(),W8(e._._,null))}),k(e.c,`blur`,function(){e._._.e(e._.d)}),kt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),X6=e=>{J6(e),Z6._(e),Q6._(e),e.b,Ai(e.b,14),Pi(e.b),z(e.c,$.sessRename),Y6(e)},Z6=N(0,0,e=>z(e.a,[V.dot,V[Qr(e._.g)]])),Q6=N(0,0,e=>Ni(e.b,e._.h)),$6=e=>z(e.a,$.termCopied),e8=e=>z(e.a,$.termUploading),t8=I(`u18`,e=>{k(e.a,`pointerdown`,function(e){e.preventDefault()}),k(e.a,`click`,function(){e._._._._.al()})}),n8=e=>{k6(e.b),A6(e.b,16),j6(e.b),t8(e)},r8=N(0,2,e=>{z(e.a,[$.repeat,{[$.enter]:e._.e===`↵`,[$.bigGlyph]:e._.e===`↵`||e._.e===`⇥`}]),B(e.b,e._.e)}),i8=I(`u20`,e=>{k(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.af(e._.f)}),k(e.a,`pointerup`,function(){e._._._._.ag()}),k(e.a,`pointercancel`,function(){e._._._._.ag()}),k(e.a,`pointerleave`,function(){e._._._._.ag()}),k(e.a,`contextmenu`,function(e){e.preventDefault()})}),a8=D(0,(e=>`<button title=Paste>${e}</button>`)(D6),(e=>` D/${e}&l`)(O6),n8,(e=>`<button title="Attach image">${e}</button>`)(M6),(e=>` D/${e}&l`)(N6),G6,`<button> </button>`,` D `,e=>{r8._(e),i8(e)}),o8=(e,t)=>a8(e,t===`paste`?0:t===`attach`?1:2),s8=(e,t)=>{o8(e,t[0]?.kind),c8(e,t[0]?.label),l8(e,t[0]?.seq)},c8=j(4),l8=j(5),u8=O(0,`<!><!><!>`,`b%`,0,s8),d8=(e,t)=>u8(e,[t]),f8=(e,t)=>d8(e,t[0]),p8=N(5,0,I(`u10`,e=>{e._.a5&&setTimeout(()=>e.d?.focus(),50)})),m8=I(`u11`,e=>{k(e.a,`click`,function(){l5(e._,!1)}),k(e.b,`click`,function(e){e.stopPropagation()}),k(e.d,`paste`,function(t){t.preventDefault(),e._.ak(t.clipboardData)}),k(e.e,`click`,function(){l5(e._,!1)})}),h8=e=>{p8._(e),z(e.a,$.trapBackdrop),z(e.b,$.pasteTrap),z(e.c,V.dim),z(e.e,V.btn),m8(e)},g8=I(`u9`,e=>k(e.b,`click`,function(){i5(e._,!1)})),_8=e=>{z(e.a,$.termDead),z(e.b,[V.btn,V.primary]),g8(e)},v8=F(57,e=>B(e.c,e._._.y),e=>e._._),y8=e=>{v8(e),z(e.a,$.kbarWs),z(e.b,$.kbarWsName)},b8=I(`u16`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.p?.(e.d)})),x8=e=>{z(e.a,$.iconBtn),e.b,Ai(e.b,15),Pi(e.b),b8(e)},S8=j(3,e=>{R(e.a,`title`,`New ${e.d} session`),Ni(e.b,e.d)}),C8=(e,t)=>S8(e,t[0]),w8=M(1,e=>{z(e.a,[$.sessX,{[$.armed]:e._._._._.g===e._._.d}]),R(e.a,`title`,e._._._._.g===e._._.d?`Really kill this session?`:`Kill session`)}),T8=F(8,w8,e=>e._._._._),E8=I(`u14`,e=>k(e.a,`click`,function(t,n){e._._._._.g===e._._.d?(J8(e._._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._._.w?.(e._._.d)):J8(e._._._._,e._._.d)})),D8=e=>{T8(e),O8(e),E8(e)},O8=F(9,w8,e=>e._._),k8=D(5,(e=>`<button title="Rename session">${e}</button>`)(iu),(e=>` D/${e}&l`)(au),q6),A8=F(53,e=>k8(e,+!e._._._._._.t),e=>e._._._._._),j8=I(`u15`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._.d!==e._._._._._.u&&e._._._._._.v?.(e._.d)})),M8=e=>{A8(e),P8(e),F8._(e),L8._(e),R8._(e),z(e.a,$.sessOpen),e.c,Ai(e.c,14),Pi(e.c),z(e.d,$.sessTitle),j8(e)},N8=D(6,`<button>×</button>`,` `,D8),P8=F(55,e=>N8(e,+!e._._._._._.w),e=>e._._._._._),F8=N(0,1,e=>z(e.b,[V.dot,V[Qr(e._.g)]])),I8=M(7,e=>B(e.e,e._.i||e._.h)),L8=N(0,1,e=>{Ni(e.c,e._.h),I8(e)}),R8=N(0,1,I8),z8=M(4,e=>z(e.a,[$.sessRow,{[$.current]:e.d===e._._._._.u}])),B8=F(54,z8,e=>e._._._._),Kre=e=>{B8(e),V8._(e)},qre=D(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(bi),(e=>` b/${e}& b`)(`b%c`),X6,(e=>`<button><span></span>${e}<span> </span></button><!><!><!>`)(bi),(e=>` D b/${e}& D m%b%c`)(`b%c`),M8),V8=Ze(0,1,3,e=>qre(e,e._.b===e.d?0:1)),Jre=P(O8),Yre=j(3,e=>{z8(e),Jre(e)}),Xre=(e,t)=>{Yre(e,t[0]?.id),Zre(e,t[0]?.state),Qre(e,t[0]?.agent),$re(e,t[0]?.title)},Zre=j(6,e=>{F8(e),Z6(e)}),Qre=j(7,e=>{L8(e),Q6(e)}),$re=j(8,R8),eie=O(0,`<div></div>`,` `,Kre,Xre),H8=F(52,e=>eie(e,[e._._._.s||[],`id`]),e=>e._._._),tie=j(4),U8=M(3,e=>tie(e,m5(e)),2),W8=A(1,e=>{U8(e),V8(e)}),nie=P(J6),G8=A(2,e=>{U8(e),nie(e)}),rie=e=>{H8(e),K8(e),W8(e,null),G8(e,``)},K8=F(53,U8,e=>e._._._),q8=F(50,e=>Ni(e.b,e._._.q||`shell`),e=>e._._),J8=A(6,P(T8)),iie=(e,t)=>{R(e.a,`popovertarget`,t),R(e.d,`id`,t)},aie=I(`u17`,e=>k(e.d,`toggle`,function(t,n){if(J8(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),oie=e=>{q8(e),Y8(e),X8(e),Z8(e),z(e.a,[$.kbtn,$.sessBtn]),e.b,Ai(e.b,16),Pi(e.b),z(e.d,$.sessPop),J8(e,null),iie(e,nt(e)),aie(e)},Y8=F(51,e=>z(e.c,[V.dot,$.sessDot,V[Qr(e._._.r)]]),e=>e._._),sie=D(4,`<!><!><!>`,`b%`,rie),X8=F(52,e=>{z(e.f,[$.sessNew,{[$.lone]:(e._._.s||[]).length<=1}]),sie(e,(e._._.s||[]).length>1?0:1)},e=>e._._),cie=O(5,(e=>`<button>${e}</button>`)(bi),(e=>` D/${e}&l`)(`b%c`),x8,C8),Z8=F(56,e=>cie(e,[[...e._._.x||[],`shell`],e=>e]),e=>e._._),Q8=N(6,0,e=>{z(e.c,[$.kbtn,{[$.on]:e._.k===`nav`}]),R(e.c,`aria-pressed`,e._.k===`nav`?`true`:`false`),z(e.e,[$.kbtn,{[$.on]:e._.k===`manage`}]),R(e.e,`aria-pressed`,e._.k===`manage`?`true`:`false`),z(e.g,[$.kbtn,{[$.on]:e._.k===`diff`}]),R(e.g,`title`,e._.k===`diff`?`Back to terminal`:`Review changes`),R(e.g,`aria-pressed`,e._.k===`diff`?`true`:`false`)}),lie=(e,t)=>{R(e.l,`popovertarget`,t),R(e.q,`id`,t)},uie=O(16,`<!><!><!>`,`b%`,0,f8),die=I(`u22`,e=>{k(e.c,`click`,function(){e._.l?.()}),k(e.e,`click`,function(){e._.m?.()}),k(e.g,`click`,function(){e._.k===`diff`?e._.n?.():e._.o?.()}),k(e.k,`change`,function(t,n){for(let t of n.files||[])e._.ah(t);n.value=``}),k(e.l,`pointerdown`,function(e){e.preventDefault()}),k(e.n,`pointerdown`,function(e){e.preventDefault()}),k(e.p,`pointerdown`,function(e){e.preventDefault()}),k(e.q,`pointerdown`,function(e){e.preventDefault()}),k(e.q,`toggle`,function(t,n){if(t.newState===`open`){let t=e.l.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.bottom=`auto`}})}),fie=e=>{Q8._(e),$8._(e),e5._(e),t5._(e),hie._(e),z(e.a,$.kbSlot),z(e.b,$.keyBar),m6(e.d),h6(e.d,16),g6(e.d),fi(e.f),pi(e.f,16),mi(e.f),si(e.h),ci(e.h,16),li(e.h),z(e.i,$.kspacer),z(e.l,$.kbtn),y6(e.m),b6(e.m,16),x6(e.m),w6(e.o),T6(e.o,16),E6(e.o),z(e.p,[$.kbtn,$.kbtnEsc]),z(e.q,$.dpadGrid),lie(e,nt(e)),uie(e,[U6]),die(e)},pie=D(8,(e=>`<button title=Sessions>${e}<span></span></button><div popover=auto><!><div></div></div>`)(bi),(e=>` D/${e}& l D%b l`)(`b%c`),oie),$8=N(6,0,e=>pie(e,+!e._.p)),mie=D(9,`<span aria-hidden=true><span> </span></span>`,` D D `,y8),e5=N(6,0,e=>mie(e,+!e._.y)),t5=N(6,0,e=>{z(e.n,[$.kbtn,{[$.on]:e._.a1}]),R(e.n,`title`,e._.a1?`Hide keyboard`:`Show keyboard`)}),hie=N(6,0,I(`u21`,e=>{k(e.n,`click`,function(){a5(e._,!e._.a1),e._.a7?.setKeyboard(e._.a1)}),k(e.p,`click`,function(){e._.a7?.send(`\x1B`)})})),n5=at(`u8`,1),gie=it(42),_ie=D(4,`<div><button>Reconnect</button></div>`,` D `,_8),r5=M(45,I(`u23`,e=>kt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new $$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:5e3,allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,linkHandler:{activate(e,t){ur(t)}}}),i=new l3;r.loadAddon(i),r.open(e.b);let a=sr();try{let e=new o3;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new q3(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>dg(t).then(()=>{})}))}catch{}r.loadAddon(new t6((e,t)=>ur(t))),i.fit();let o=a?i6(r):null,s=o?o.write:e=>r.write(e),c=n6({sessionId:e.u,term:r,write:s,onDead:()=>{i5(e,!0)},isVisible:()=>!!e.z},n);r.onData(e=>c.send(e)),r.attachCustomKeyEventHandler(t=>t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&c.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&dg(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.ab())}),!1):!(a&&t.type===`keydown`&&t.key===`Backspace`));let l=()=>{if(!e.b.clientWidth)return;let t=i.proposeDimensions();!t||t.cols===r.cols&&t.rows===r.rows||(i.fit(),c.resize(r.cols,r.rows))},u=new ResizeObserver(l);u.observe(e.b),n.addEventListener(`abort`,()=>u.disconnect());let d=()=>requestAnimationFrame(l);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||d()},{signal:n}),window.addEventListener(`pageshow`,d,{signal:n}),window.addEventListener(`focus`,d,{signal:n}),window.visualViewport?.addEventListener(`resize`,d,{signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.ah(t)}},{capture:!0,signal:n}),e.a7={send(e){c.send(e)},setKeyboard(e){let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a1&&i-t.height<H6&&(a5(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=l6(r,n5(e),{onStart(){o?.setFrozen(!0)},onEnd(){o?.setFrozen(!1)},onCopy(){e.ab()}},n);r6(r,n5(e),n,i.selecting),a6(r,e=>c.send(e),n)}else d6(r,n5(e),()=>e.ab(),n);e.z&&!a&&r.focus();let f={term:r,socket:c,abort:t,suspend:void 0};return e.z||(f.suspend=setTimeout(()=>c.disconnect(),V6)),f},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.z?(!e.a0&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a0&&!e.a2&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),V6)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),7),i5=A(26,e=>{_ie(e,+!e.a0),r5(e)}),a5=A(27,e=>{r5(e),t5(e)}),vie=D(6,((e,t,n,r,i)=>`<div><div><button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button>${n}</button><div></div><!><input type=file accept=image/* hidden><button title="More keys">${r}</button><button>${i}</button><button title=Escape>esc</button><div popover=auto></div></div></div>`)(f6,ui,ai,_6,S6),((e,t,n,r,i)=>` D D D/${e}&l D/${t}&l D/${n}&l b%b b D/${r}&l D/${i}&l b m`)(p6,di,oi,v6,C6),fie),o5=A(28,e=>{vie(e,+!e.a2),r5(e)}),yie=D(2,`<div>uploading…</div>`,` `,e8),s5=A(29,e=>yie(e,+!e.a3)),bie=D(3,`<div>Copied</div>`,` `,$6),c5=A(30,e=>bie(e,+!e.a4)),xie=D(5,`<div><div><p>Long-press below and choose Paste</p><input placeholder="Paste here…"><button>Cancel</button></div></div>`,` D D b b `,h8),l5=A(31,e=>{xie(e,+!e.a5),p8(e)}),Sie=(e,t)=>jie(e,t.current),Cie=(e,t)=>Nie(e,t.timer),wie=(e,t)=>Fie(e,t.current),Tie=I(`u24`,e=>{o5(e,sr()),k(e.a,`dragover`,function(e){e.preventDefault()}),k(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.ah(n)})});function Eie(e){z(e.a,$.termWrap),z(e.b,$.term),i5(e,!1),a5(e,!1),o5(e,!1),s5(e,!1),c5(e,!1),l5(e,!1),Sie(e,{current:null}),Cie(e,{timer:0}),wie(e,{current:null}),Tie(e)}var Die=j(41),u5=M(40,e=>Die(e,h5(e))),Oie=j(46),kie=j(47),d5=M(44,e=>{Oie(e,g5(e)),kie(e,_5(e))}),Aie=j(43,e=>{d5(e),r5(e)}),f5=M(34,e=>Aie(e,v5(e))),jie=j(33,e=>{u5(e),f5(e),d5(e),r5(e)}),Mie=j(37,r5),Nie=j(36,e=>Mie(e,y5(e))),Pie=j(42),Fie=j(39,e=>{Pie(e,b5(e)),u5(e)}),Iie=j(9,f5),Lie=j(10,e=>{R(e.a,`hidden`,e.k!=null&&e.k!==`term`),Q8(e)}),Rie=P(B8),zie=j(20,e=>{r5(e),Rie(e)}),Bie=j(25,r5),Vie=j(11),Hie=j(12),Uie=j(13),Wie=j(14),Gie=j(15,$8),Kie=j(16,P(q8)),qie=j(17,P(Y8)),Jie=j(18,P(X8,H8)),Yie=j(19,P(K8,A8)),Xie=j(21),Zie=j(22,P(P8)),Qie=j(23,P(Z8)),$ie=P(v8),eae=j(24,e=>{e5(e),$ie(e)});function p5(e){return t=>{G8(e._._,t)}}function m5(e){return t=>{if(e.b!==t)return;let n=e.c.trim();W8(e,null),n&&e._._._.t?.(t,n)}}function h5(e){return t=>{gie(e)(),e.a7?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.a7?.send(t),B6)},z6),e.ad=n}}function g5(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.ah(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.a7?.send(n)}l5(e,!1)}}function _5(e){return async()=>{if(!navigator.clipboard?.read){l5(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.ah(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.a7?.send(n)}}}catch{l5(e,!0)}}}function v5(e){return async t=>{if(t){s5(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.j}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.a7?.send(`${n.path} `)}finally{s5(e,!1)}}}}function y5(e){return()=>{clearTimeout(e.aa),c5(e,!0),e.aa=setTimeout(()=>{c5(e,!1)},1200)}}function b5(e){return()=>{let t=e.ad;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.ad=null)}}L(`u0`,p5),L(`u7`,m5),L(`u2`,h5),L(`u5`,g5),L(`u6`,_5),L(`u4`,v5),L(`u1`,y5),L(`u3`,b5);var tae=(e=>`<div><div>${e}</div><div><!><!><!><!><div></div></div></div>`)(Aee),nae=(e=>` D D/${e}&l D%b%b%b%b m`)(jee),rae=e=>z(e.a,Gl.padInline),x5=F(74,e=>B(e.a,e._._.a6),e=>e._._),iae=gt(`x35`,` `,` `,x5),aae=e=>{Rr(e.a),Hr(e.a,iae(e)),Kr(e.a,b7(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},oae=fe(3,0,2),S5=N(7,0,e=>oae(e,e._.z===`usage`)),sae=e=>{S5._(e),cK(e.b),lK(e.b,x7(e))},C5=M(4,e=>B(e.d,e._._.a7?`Starting…`:`Start ${e._._.o||`claude`}`)),w5=F(68,C5,e=>e._._),cae=I(`x36`,e=>k(e.c,`click`,function(){e._._.as(e._._.o||`claude`,!0)})),lae=e=>{w5(e),T5(e),z(e.a,Gl.emptySess),z(e.b,V.dim),z(e.c,[V.btn,V.primary]),cae(e)},T5=F(75,e=>{R(e.c,`disabled`,e._._.a7),C5(e)},e=>e._._),E5=M(8,e=>Bie(e.b,e._._.n&&e._._.z===`term`&&e.g===e._._.ar),3),D5=F(67,E5,e=>e._._),uae=e=>{D5(e),O5(e),k5(e),j5(e),M5(e),N5(e),F5(e),I5(e),L5(e),R5(e),Eie(e.b),Xie(e.b,E7(e)),Wie(e.b,T7(e)),Uie(e.b,w7(e)),Vie(e.b,C7(e)),Hie(e.b,S7(e))},O5=F(69,e=>Qie(e.b,e._._.r),e=>e._._),k5=F(71,e=>{Lie(e.b,e._._.z),E5(e)},e=>e._._),A5=M(11,e=>Gie(e.b,D7(e))),j5=F(77,e=>{Iie(e.b,e._._.a9),A5(e)},e=>e._._),M5=F(78,e=>eae(e.b,e._._.ae),e=>e._._),N5=F(79,e=>Jie(e.b,e._._.ao),e=>e._._),dae=fe(3,0,2),P5=M(7,e=>dae(e,e.g===e._._.ar)),F5=F(81,e=>{E5(e),P5(e)},e=>e._._),I5=F(82,e=>Zie(e.b,O7(e)),e=>e._._),L5=F(83,e=>Yie(e.b,k7(e)),e=>e._._),R5=F(84,A5,e=>e._._),fae=j(6,e=>{zie(e.b,e.g),E5(e),P5(e)}),pae=(e,t)=>qie(e.b,t),mae=(e,t)=>Kie(e.b,t),hae=O(0,(e=>`<!><!>${e}<!><!><!>`)(L6),(e=>`b%b/${e}&%b%c`)(R6),uae,(e,t)=>{fae(e,t[0]?.id),pae(e,t[0]?.state),mae(e,t[0]?.agent)}),z5=N(8,0,e=>hae(e,[e._.ao,`id`])),gae=e=>{z5._(e),B5._(e)},_ae=D(1,`<div><p>No sessions in this workspace.</p><button> </button></div>`,` D b D `,lae),B5=N(8,0,e=>_ae(e,+!!e._.aq)),V5=N(6,0,e=>YW(e.b,A7(e))),vae=e=>{V5._(e),H5._(e),U5._(e),mW(e.b),XW(e.b,j7(e))},yae=fe(3,0,2),H5=N(6,0,e=>yae(e,e._.z===`manage`)),U5=N(6,0,e=>JW(e.b,e._.a8)),W5=M(4,e=>gV(e.b,e._.n&&e._.z===`diff`)),G5=N(5,0,W5),bae=e=>{G5._(e),K5._(e),q5._(e),J5._(e),Y5._(e),X5._(e),QB(e.b),CV(e.b,N7(e)),TV(e.b,M7(e))},xae=fe(3,0,2),K5=N(5,0,e=>{xae(e,e._.z===`diff`),W5(e)}),q5=N(5,0,e=>hV(e.b,e._.a4)),J5=N(5,0,e=>_V(e.b,e._.a5)),Y5=N(5,0,e=>mV(e.b,e._.a9)),X5=N(5,0,e=>EV(e.b,e._.ao||[])),Sae=P(L5),Cae=j(65,e=>{ote(e.c,P7(e)),Sae(e)}),wae=D(8,`<!><!><!><!>`,`b%b%`,gae,`<p>Loading sessions…</p>`,` `,rae),Tae=P(F5),Eae=j(53,e=>{gh(e.c,e.ar),Tae(e)}),Z5=M(51,e=>Eae(e,(()=>{if(e.x&&e.ao?.some(t=>t.id===e.x))return e.x;let t=Jn(e.a9);return t&&e.ao?.some(e=>e.id===t)?t:e.ao?.[0]?.id??null})()),2),Dae=P(N5),Oae=j(50,e=>{rte(e.c,e.ao),toe(e,e.ao?.length),wae(e,+!e.ao),Z5(e),X5(e),z5(e),Dae(e)}),Q5=M(38,e=>Oae(e,e.w??e.m?.[e.a9]?.sessions??null),2),$5=M(63,I(`x38`,e=>kt(e,{active:e.n,load:e.b0,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.timer??=setInterval(r.refresh,1e4)):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return Tn().addEventListener(`sessions.changed`,t=>{let n=t.data?.workspaceId;r.started&&(!n||n===e.a9)&&r.refresh()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),An(()=>{if(!this.active)return;let t=Mn(e.a9);t&&e.af(t.pr),In(e.a9)&&e.ah();let n=Pn(e.a9);n&&(s7(e,n),d7(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),4),kae=j(62,$5),e7=M(61,e=>kae(e,I7(e)),2),Aae=j(60,e7),t7=M(58,e=>Aae(e,L7(e)),6),jae=P(R5),Mae=j(66,e=>{$ee(e.c,R7(e)),jae(e)}),n7=M(55,e=>Mae(e,z7(e)),2),Nae=j(54,e=>{t7(e),n7(e)}),r7=M(36,e=>Nae(e,B7(e))),Pae=j(64,P(I5)),i7=M(24,e=>Pae(e,V7(e))),a7=A(22,e=>{Cae(e,F7(e)),Q5(e),r7(e),t7(e),i7(e)}),o7=M(37,I(`x39`,e=>{e.x&&Yn(e.a9,e.x)})),s7=A(23,e=>{Z5(e),t7(e),i7(e),o7(e)}),Fae=j(47),Iae=j(48),c7=M(44,e=>Iae(e,U7(e))),Lae=j(49),l7=M(42,e=>Lae(e,W7(e))),u7=M(26,I(`x41`,e=>{!e.n&&(e.z===`nav`||e.z===`manage`||e.z===`usage`)&&d7(e,`term`)})),Rae=P(k5),d7=A(25,e=>{z(e.a,[Gl.workView,{[Gl.navPage]:e.z===`nav`}]),z(e.b,[Gl.sideWrap,{[Gl.sideHidden]:e.z===`manage`||e.z===`usage`}]),Eh(e.c,e.z),z(e.i,[Gl.termArea,{[Gl.asBar]:e.z!==`term`}]),Fae(e,H7(e)),c7(e),l7(e),u7(e),K5(e),H5(e),Rae(e),S5(e)}),zae=D(5,(e=>`<!><!>${e}<!><!><!>`)(wF),(e=>`b%b/${e}&%b%c`)(TF),bae),f7=A(27,e=>zae(e,+!e.a1)),Bae=D(6,(e=>`<!><!>${e}<!><!><!>`)(eH),(e=>`b%b/${e}&%b%c`)(tH),vae),p7=A(28,e=>Bae(e,+!e.a2)),Vae=D(7,(e=>`<!><!>${e}<!><!><!>`)(vG),(e=>`b%b/${e}&%b%c`)(yG),sae),m7=A(29,e=>Vae(e,+!e.a3)),h7=A(30,q5),g7=M(45,I(`x40`,e=>{if(e.n){let t=Mn(e.a9);t&&e.af(t.pr),In(e.a9)&&e.ah();let n=Pn(e.a9);n&&(s7(e,n),d7(e,`term`))}}),3),Hae=j(41,e=>{tte(e.c,G7(e)),l7(e),g7(e),$5(e)}),_7=A(31,e=>{Hae(e,K7(e)),J5(e)}),Uae=D(4,fr,(e=>`/${e}&`)(pr),aae),Wae=P(x5),v7=A(32,e=>{Uae(e,+!e.a6),Wae(e)}),y7=A(33,P(T5)),Gae=j(43,e=>{c7(e),g7(e),$5(e)}),Kae=j(46),qae=(e,t)=>{ooe(e,t.wanted),soe(e,t.run)};function Jae(e){Fh(e.c),_h(e.c,$7(e)),Dh(e.c,Q7(e)),Ih(e.c,Z7(e)),Uh(e.c,X7(e)),Kh(e.c,Y7(e)),z(e.d,Gl.mainCol),a7(e,null),s7(e,null),d7(e,`term`),f7(e,!1),p7(e,!1),m7(e,!1),h7(e,``),_7(e,0),v7(e,null),y7(e,!1),Gae(e,q7(e)),Kae(e,J7(e)),qae(e,{wanted:!1,run:void 0})}var Yae=j(34,e=>{fh(e.c,e.a8),Zae(e,e.a8?.id),Qae(e,e.a8?.status),$ae(e,e.a8?.name),U5(e)}),Xae=P(j5),Zae=j(35,e=>{Yee(e.c,e9(e)),Q5(e),Z5(e),g7(e),r7(e),t7(e),o7(e),n7(e),$5(e),Y5(e),Xae(e)}),Qae=j(39,t7),$ae=j(40,P(M5)),eoe=Yae,toe=j(52,B5),noe=j(12,e=>{Vh(e.c,e.m),Q5(e)}),roe=P(D5),ioe=I(`x37`,e=>k(e.a,`keydown`,e.n&&(t=>{if(t.key===`Escape`&&(e.z===`nav`||e.z===`manage`||e.z===`usage`)&&!document.querySelector(`dialog[open]`)&&d7(e,`term`),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.an()),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.ao?.length??0)>1){t.preventDefault();let n=e.ao.map(e=>e.id);s7(e,n[(Math.max(0,n.indexOf(e.ar))+(t.key===`]`?1:n.length-1))%n.length]),d7(e,`term`)}}))),aoe=j(13,e=>{Lh(e.c,e.n),u7(e),g7(e),$5(e),G5(e),roe(e),ioe(e)}),ooe=j(57,e=>{t7(e),e7(e)}),soe=j(59,e7),coe=P(w5),loe=j(14,e=>{t7(e),coe(e)}),uoe=j(15,e=>{Jee(e.c,e.p),n7(e)}),doe=(e,t)=>Rh(e.c,t),foe=P(O5),poe=j(17,e=>{Zee(e.c,e.r),foe(e)}),moe=(e,t)=>ite(e.c,t),hoe=(e,t)=>qh(e.c,t),goe=j(19),_oe=j(21,V5);function b7(e){return function(){v7(e._,null)}}function x7(e){return function(){d7(e._,`term`)}}function S7(e){return function(){e._._.am()}}function C7(e){return function(){e._._.al()}}function w7(e){return function(){d7(e._._,`term`)}}function T7(e){return function(){e._._.an()}}function E7(e){return function(t){s7(e._._,t),d7(e._._,`term`)}}function D7(e){return function(t){d7(e._._,`term`),e._._.b4(e._._.a9,t)}}function O7(e){return function(t){e._._.b2(t)}}function k7(e){return function(t,n){e._._.b3(t,n)}}function A7(e){return function(t){e._.v?.(t)}}function j7(e){return function(){d7(e._,`term`)}}function M7(e){return function(){d7(e._,`term`)}}function N7(e){return function(t){s7(e._,t),d7(e._,`term`)}}function P7(e){return function(t,n){e.b3(t.id,n)}}function F7(e){return async(t,n)=>{n=n.trim(),n&&(a7(e,(e.w||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function I7(e){return t=>(t&&(e.av=!0),(e.ax??=Ln(e.ay))())}function L7(e){return async()=>{let t=e.av;e.av=!1;try{let n=await sn(`/api/workspaces/${e.a9}/sessions`);if(!n.length&&t&&e.ad===`active`){let t=await e.as(e.o||`claude`,!1);n=t?[t]:[]}a7(e,n);let r=Jn(e.a9);r&&n.some(e=>e.id===r)&&s7(e,r),e.w.some(t=>t.id===e.x)||s7(e,e.w?.[0]?.id||null)}catch(t){if(a7(e,e.w||[]),cn(t))return;v7(e,String(t.message||t))}}}function R7(e){return function(t,n){e.b4(t,n)}}function z7(e){return async(t,n)=>{if(t===e.a9){let r=await e.as(n,!0);r&&Yn(t,r.id);return}try{Yn(t,(await sn(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.p?.(t)}catch(t){v7(e,String(t.message||t))}}}function B7(e){return async(t,n)=>{y7(e,!0);try{let r=await sn(`/api/workspaces/${e.a9}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});return n&&(a7(e,(e.w||[]).concat(r)),s7(e,r.id)),r}catch(t){return v7(e,String(t.message||t)),null}finally{y7(e,!1)}}}function V7(e){return async t=>{try{await sn(`/api/sessions/${t}`,{method:`DELETE`}),a7(e,(e.w||[]).filter(e=>e.id!==t)),e.x===t&&s7(e,e.w?.[0]?.id||null)}catch(t){v7(e,`Kill session failed: ${String(t.message||t)}`)}}}function H7(e){return()=>{d7(e,e.z===`nav`?`term`:`nav`)}}function U7(e){return()=>{e.z===`manage`?d7(e,`term`):e.ah()}}function W7(e){return()=>{e.z===`diff`?d7(e,`term`):e.af()}}function G7(e){return function(t){e.af(t)}}function K7(e){return t=>{h7(e,t||``),t&&_7(e,e.a5+1),f7(e,!0),d7(e,`diff`)}}function q7(e){return()=>{p7(e,!0),d7(e,`manage`)}}function J7(e){return()=>{m7(e,!0),d7(e,`usage`)}}function Y7(e){return function(t){e.b2(t)}}function X7(e){return function(){e.ak()}}function Z7(e){return function(t){v7(e,t)}}function Q7(e){return t=>{d7(e,t)}}function $7(e){return function(t){s7(e,t)}}function e9(e){return function(t){!t||t===e.a9?e.ah():e.t?.(t)}}L(`x21`,b7),L(`x26`,x7),L(`x34`,S7),L(`x33`,C7),L(`x32`,w7),L(`x31`,T7),L(`x28`,E7),L(`x27`,D7),L(`x29`,O7),L(`x30`,k7),L(`x24`,A7),L(`x25`,j7),L(`x23`,M7),L(`x22`,N7),L(`x19`,P7),L(`x10`,F7),L(`x8`,I7),L(`x7`,L7),L(`x17`,R7),L(`x11`,z7),L(`x6`,B7),L(`x9`,V7),L(`x3`,H7),L(`x4`,U7),L(`x5`,W7),L(`x20`,G7),L(`x0`,K7),L(`x1`,q7),L(`x2`,J7),L(`x18`,Y7),L(`x16`,X7),L(`x14`,Z7),L(`x13`,Q7),L(`x12`,$7),L(`x15`,e9);var t9=F(43,e=>B(e.a,e._._.y),e=>e._._),voe=gt(`n18`,` `,` `,t9),yoe=e=>{Rr(e.a),Hr(e.a,voe(e)),Kr(e.a,L9(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},n9=F(37,e=>{doe(e.b,e._._._.n),_oe(e.b,R9(e))},e=>e._._._),boe=e=>{n9(e),r9(e),i9(e),o9(e),s9(e),c9._(e),l9._(e),Jae(e.b),moe(e.b,B9(e)),hoe(e.b,z9(e))},r9=F(38,e=>noe(e.b,e._._._.o),e=>e._._._),i9=F(39,e=>{loe(e.b,e._._._.p?e._._._.p?.preferredAgent:`claude`),poe(e.b,e._._._.p?e._._._.p?.agents:[`claude`])},e=>e._._._),xoe=fe(3,0,2),a9=M(4,e=>{aoe(e.b,e._.f===e._._._.r),xoe(e,e._.f===e._._._.r)}),o9=F(40,a9,e=>e._._._),s9=F(44,e=>uoe(e.b,V9(e)),e=>e._._._),c9=N(0,0,e=>eoe(e.b,e._.e)),l9=N(0,0,e=>{goe(e.b,H9(e)),a9(e)}),Soe=D(0,(e=>`<!><!>${e}<!><!><!>`)(tae),(e=>`b%b/${e}&%b%c`)(nae),boe),Coe=j(4,e=>{Toe(e,e.e?.id),Soe(e,+!e.e),c9(e)}),u9=M(3,e=>Coe(e,e._._.n.find(t=>t.id===e.c))),d9=F(37,u9,e=>e._._),woe=d9,Toe=j(5,l9),Eoe=j(2,u9),Doe=O(0,`<!><!><!>`,`b%`,woe,(e,t)=>Eoe(e,t[0])),f9=N(3,1,e=>Doe(e,[e._.t,e=>e])),Ooe=f9,p9=M(1,e=>Nl(e.a,U9(e))),m9=N(3,0,p9),koe=e=>{m9._(e),h9._(e),El(e.a),Fl(e.a,W9(e))},h9=N(3,0,p9),g9=N(2,0,e=>fee(e.a,e._.n)),Aoe=e=>{g9._(e),_9._(e),v9._(e),y9._(e),x9._(e),S9._(e),C9._(e),Vo(e.a),Fo(e.a,q9(e)),xee(e.a,K9(e)),ho(e.a,G9(e)),Do(e.a),Oo(e.a)},_9=N(2,0,e=>kee(e.a,e._.o)),v9=N(2,0,e=>Po(e.a,e._.p)),y9=N(2,0,e=>hee(e.a,e._.r)),b9=M(1,e=>Eee(e.a,!e._.x&&e._.a9)),x9=N(2,0,e=>{mo(e.a,e._.x),b9(e)}),S9=N(2,0,e=>{See(e.a,Z9(e)),gee(e.a,X9(e)),vee(e.a,Y9(e)),_ee(e.a,J9(e))}),C9=N(2,0,b9),w9=M(32,I(`n20`,e=>kt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0,timer:void 0};Vn(e.l),ir(n);let i=(t,n)=>{n&&(Nn(t,n),Yn(t,n)),e.a5(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),lr()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),ur(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a4()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a4(!0))},{signal:n}),o(),Tn().addEventListener(`workspaces.changed`,()=>{e.z(),o()},{signal:n}),Tn().addEventListener(`sessions.changed`,()=>{clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),Tn().addEventListener(`status.changed`,t=>{t.data&&(A9(e,t.data),r.statusStale=!1)},{signal:n}),r.timer=setInterval(o,6e4);let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce),clearInterval(this.timer)}})),3),joe=P(s9),Moe=j(31,e=>{w9(e),S9(e),h9(e),joe(e)}),T9=M(20,e=>Moe(e,Q9(e))),Noe=D(2,(e=>`<!>${e}`)(Fi),(e=>`b/${e}&`)(Ii),Aoe),E9=M(36,e=>Noe(e,e.x||e.a9?0:1)),Poe=j(35,e=>{E9(e),C9(e)}),D9=M(34,e=>Poe(e,!e.w&&!e.a7)),Foe=j(33,D9),O9=M(18,e=>Foe(e,e.n.find(t=>t.id===e.r))),Ioe=P(d9,n9),k9=A(13,e=>{T9(e),O9(e),g9(e),m9(e),Ioe(e)}),Loe=P(r9),A9=A(14,e=>{_9(e),Loe(e)}),Roe=P(i9),zoe=A(15,e=>{v9(e),Roe(e)}),Boe=j(25,w9),j9=M(21,e=>Boe(e,$9(e))),M9=A(19,e=>{j9(e),T9(e),f9(e)}),Voe=P(o9),N9=A(17,e=>{M9(e,e.r?[e.r]:[]),j9(e),O9(e),y9(e),Voe(e)}),Hoe=D(3,Nc,(e=>`/${e}&`)(Pc),koe,`<!><!><!>`,`b%`,Ooe),P9=A(22,e=>{Hoe(e,+!e.w),D9(e)}),F9=A(23,e=>{E9(e),x9(e)}),Uoe=D(1,fr,(e=>`/${e}&`)(pr),yoe),Woe=P(t9),I9=A(24,e=>{Uoe(e,+!e.y),Woe(e)});I(`n19`,e=>k(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),F9(e,!e.x)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.n.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a5(n.id))}}));function L9(e){return function(){I9(e._,null)}}function R9(e){return function(t){k9(e._._._,e._._._.n.map(e=>e.id===t.id?t:e))}}function z9(e){return function(){P9(e._._._,!0)}}function B9(e){return function(t,n){Nn(t,n),Yn(t,n),e._._._.a5(t)}}function V9(e){return function(t){e._._._.a5(t)}}function H9(e){return function(t){let n=t||e._.f;Fn(n),e._._._.a5(n)}}function U9(e){return function(t){e._.n.some(e=>e.id===t.id)||k9(e._,[t,...e._.n]),P9(e._,!1),e._.a5(t.id)}}function W9(e){return function(){P9(e._,!1)}}function G9(e){return t=>{F9(e._,t)}}function K9(e){return function(){P9(e._,!0),F9(e._,!1)}}function q9(e){return function(t){zoe(e._,t)}}function J9(e){return function(t){P9(e._,!1),F9(e._,!1),Fn(t.id),e._.a5(t.id)}}function Y9(e){return function(t,n){F9(e._,!1),sn(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{Nn(t.id,n.id),e._.a5(t.id)}).catch(t=>{I9(e._,`New session failed: ${String(t.message||t)}`)})}}function X9(e){return function(t){jn(t.id),e._.a5(t.id)}}function Z9(e){return function(t){e._.a5(t.id)}}function Q9(e){return async t=>{e.n.find(e=>e.id===t)?.status===`archived`&&(await sn(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),k9(e,e.n.map(e=>e.id===t?{...e,status:`active`}:e))),N9(e,t),P9(e,!1),F9(e,!1),e.t.includes(t)||M9(e,e.t.concat(t)),Gn(t)}}function $9(e){return async()=>{try{let t=await sn(`/api/workspaces`);k9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));M9(e,e.t.filter(e=>n.has(e))),e.r&&!n.has(e.r)&&(N9(e,e.t[e.t?.length-1]||null),Gn(e.r))}catch(t){if(cn(t))return;I9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function Goe(e){return(t=!1)=>(e.a1||=t,(e.a2??=Ln(async()=>{let t=e.a1;e.a1=!1;try{A9(e,await sn(`/api/status${t?`?fresh`:``}`))}catch(e){if(!cn(e))throw e}}))())}L(`n3`,L9),L(`n16`,R9),L(`n17`,z9),L(`n14`,B9),L(`n13`,V9),L(`n15`,H9),L(`n12`,U9),L(`n11`,W9),L(`n10`,G9),L(`n9`,K9),L(`n4`,q9),L(`n8`,J9),L(`n7`,Y9),L(`n6`,X9),L(`n5`,Z9),L(`n2`,Q9),L(`n0`,$9),L(`n1`,Goe);var Koe=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};De(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Koe(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){Xt(t.b,e)}});var qoe=e=>z(e.a,on.boot),Joe=(e,t)=>B(e.b,t instanceof Error?t.message:String(t));gt(`b1`,`<div><p> </p></div>`,` E `,qoe,(e,t)=>Joe(e,t[0])),gt(`b0`,`<div><span></span>Loading workspaces…</div>`,` D `,e=>{z(e.a,on.boot),z(e.b,V.spin)}),st();export{t};
1615
- //# sourceMappingURL=index-MrlyfSPt.js.map
1614
+ }`,V2=8,H2=V2*Float32Array.BYTES_PER_ELEMENT,U2=20*V2,W2=class{constructor(){this.attributes=new Float32Array(U2),this.count=0}},G2=0,K2=0,q2=0,J2=0,Y2=0,X2=0,Z2=0,Q2=class extends C1{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new W2,this._verticesCursor=new W2;let i=this._gl;this._program=G1(_2(i,z2,B2)),this._register(b1(()=>i.deleteProgram(this._program))),this._projectionLocation=G1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(b1(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(b1(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=G1(i.createBuffer()),this._register(b1(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,H2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,H2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,H2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,g2),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*N2,d=e.cells[u+P2],f=e.cells[u+F2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*V2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:G2=(n&16777215)<<8;break;case 0:default:G2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:G2=(r&16777215)<<8;break;case 0:default:G2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=y2(e.attributes,this._terminal.rows*this._terminal.cols*V2)),K2=i*this._dimensions.device.cell.width,q2=o*this._dimensions.device.cell.height,J2=(G2>>24&255)/255,Y2=(G2>>16&255)/255,X2=(G2>>8&255)/255,Z2=1,this._addRectangle(e.attributes,t,K2,q2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,J2,Y2,X2,Z2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},$2=class extends C1{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(b1(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=G1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=l2(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=d0,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},e4=class extends $2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&s2(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},t4=typeof window==`object`?window:globalThis,n4=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Y0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Y0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};n4.INSTANCE=new n4;var r4=n4;function i4(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}r4.INSTANCE.onDidChangeZoomLevel,r4.INSTANCE.onDidChangeFullscreen;var a4=typeof navigator==`object`?navigator.userAgent:``;a4.indexOf(`Firefox`);var o4=a4.indexOf(`AppleWebKit`)>=0;!(a4.indexOf(`Chrome`)>=0)&&a4.indexOf(`Safari`),a4.indexOf(`Electron/`),a4.indexOf(`Android`);var s4=!1;if(typeof t4.matchMedia==`function`){let e=t4.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=t4.matchMedia(`(display-mode: fullscreen)`);s4=e.matches,i4(t4,e,({matches:e})=>{s4&&t.matches||(s4=e)})}function c4(){return s4}var l4=`en`,u4=!1,d4=!1,f4=!1,p4=l4,m4,h4=globalThis,g4;typeof h4.vscode<`u`&&typeof h4.vscode.process<`u`?g4=h4.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(g4=process);var _4=typeof g4?.versions?.electron==`string`&&g4?.type===`renderer`;if(typeof g4==`object`){g4.platform,g4.platform,u4=g4.platform===`linux`,u4&&g4.env.SNAP&&g4.env.SNAP_REVISION,g4.env.CI||g4.env.BUILD_ARTIFACTSTAGINGDIRECTORY,p4=l4;let e=g4.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,p4=t.resolvedLanguage||l4,t.languagePack?.translationsConfigFile}catch{}d4=!0}else typeof navigator==`object`&&!_4?(m4=navigator.userAgent,m4.indexOf(`Windows`),m4.indexOf(`Macintosh`),(m4.indexOf(`Macintosh`)>=0||m4.indexOf(`iPad`)>=0||m4.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,u4=m4.indexOf(`Linux`)>=0,m4?.indexOf(`Mobi`),f4=!0,p4=globalThis._VSCODE_NLS_LANGUAGE||l4,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var v4=d4;f4&&typeof h4.importScripts==`function`&&h4.origin;var y4=m4,b4=p4,x4;(e=>{function t(){return b4}e.value=t;function n(){return b4.length===2?b4===`en`:b4.length>=3&&b4[0]===`e`&&b4[1]===`n`&&b4[2]===`-`}e.isDefaultVariant=n;function r(){return b4===`en`}e.isDefault=r})(x4||={});var S4=typeof h4.postMessage==`function`&&!h4.importScripts;(()=>{if(S4){let e=[];h4.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),h4.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var C4=!!(y4&&y4.indexOf(`Chrome`)>=0);y4&&y4.indexOf(`Firefox`),!C4&&y4&&y4.indexOf(`Safari`),y4&&y4.indexOf(`Edg/`),y4&&y4.indexOf(`Android`);var w4=typeof navigator==`object`?navigator:{};v4||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||w4&&w4.clipboard&&w4.clipboard.writeText,v4||w4&&w4.clipboard&&w4.clipboard.readText,v4||c4()||w4.keyboard,`ontouchstart`in t4||w4.maxTouchPoints,t4.PointerEvent&&(`ontouchstart`in t4||navigator.maxTouchPoints);var T4=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},E4=new T4,D4=new T4,O4=new T4;Array(230);var k4;(e=>{function t(e){return E4.keyCodeToStr(e)}e.toString=t;function n(e){return E4.strToKeyCode(e)}e.fromString=n;function r(e){return D4.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return O4.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return D4.strToKeyCode(e)||O4.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return E4.keyCodeToStr(e)}e.toElectronAccelerator=o})(k4||={});var A4=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),j4;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof M4?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:I0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:A4})})(j4||={});var M4=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?A4:(this._emitter||=new Y0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var N4;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(N4||={});var P4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Y0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await I0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};P4.EMPTY=P4.fromArray([]);function F4(e){return I4(e,0)}function I4(e,t){switch(typeof e){case`object`:return e===null?L4(349,t):Array.isArray(e)?B4(e,t):V4(e,t);case`string`:return z4(e,t);case`boolean`:return R4(e,t);case`number`:return L4(e,t);case`undefined`:return L4(937,t);default:return L4(617,t)}}function L4(e,t){return(t<<5)-t+e|0}function R4(e,t){return L4(e?433:863,t)}function z4(e,t){t=L4(149417,t);for(let n=0,r=e.length;n<r;n++)t=L4(e.charCodeAt(n),t);return t}function B4(e,t){return t=L4(104579,t),e.reduce((e,t)=>I4(t,e),t)}function V4(e,t){return t=L4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=z4(n,t),I4(e[n],t)),t)}var{registerWindow:Ire,getWindow:H4,getDocument:Lre,getWindows:Rre,getWindowsCount:zre,getWindowId:Bre,getWindowById:Vre,hasWindow:Hre,onDidRegisterWindow:Ure,onWillUnregisterWindow:Wre,onDidUnregisterWindow:Gre}=function(){let e=new Map,t={window:t4,disposables:new S1};e.set(t4.vscodeWindowId,t);let n=new Y0,r=new Y0,i=new Y0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return C1.None;let a=new S1,o={window:t,disposables:a.add(new S1)};return e.set(t.vscodeWindowId,o),a.add(b1(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(W4(t,K4.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:t4},getDocument(e){return H4(e).document}}}(),U4=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function W4(e,t,n,r){return new U4(e,t,n,r)}var G4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};G4.None=new G4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=F4(n),a=r.get(i);if(a)a.users+=1;else{let o=new Y0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(b1(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var K4={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:o4?`webkitAnimationStart`:`animationstart`,ANIMATION_END:o4?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:o4?`webkitAnimationIteration`:`animationiteration`},q4=class extends C1{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new w1,this._charAtlasDisposable=this._register(new w1),this._observerDisposable=this._register(new w1),this._model=new R2,this._workCell=new h2,this._workCell2=new h2,this._rectangleRenderer=this._register(new w1),this._glyphRenderer=this._register(new w1),this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Y0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new l0(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new e4(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=$1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(W4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(W4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=p2(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=p2(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(b1(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Q2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new A2(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=l2(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=y1(I0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),I0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new f2(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=Y4(e,n.rows-1,0),t=Y4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new J4(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*N2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+P2]!==this._cellColorResolver.result.bg||this._model.cells[v+F2]!==this._cellColorResolver.result.fg||this._model.cells[v+I2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=L2),this._model.cells[v]=g,this._model.cells[v+P2]=this._cellColorResolver.result.bg,this._model.cells[v+F2]=this._cellColorResolver.result.fg,this._model.cells[v+I2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*N2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,M1,0,0),this._model.cells[b]=0,this._model.cells[b+P2]=this._cellColorResolver.result.bg,this._model.cells[b+F2]=this._cellColorResolver.result.fg,this._model.cells[b+I2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},J4=class extends j0{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Y4(e,t,n=0){return Math.max(Math.min(e,t),n)}var X4=`di$target`,Z4=`di$dependencies`,Q4=new Map;function $4(e){if(Q4.has(e))return Q4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);e3(t,e,r)};return t._id=e,Q4.set(e,t),t}function e3(e,t,n){t[X4]===t?t[Z4].push({id:e,index:n}):(t[Z4]=[{id:e,index:n}],t[X4]=t)}$4(`BufferService`),$4(`CoreMouseService`),$4(`CoreService`),$4(`CharsetService`),$4(`InstantiationService`),$4(`LogService`);var t3=$4(`OptionsService`);$4(`OscLinkService`),$4(`UnicodeService`),$4(`DecorationService`);var n3={trace:0,debug:1,info:2,warn:3,error:4,off:5},r3=`xterm.js: `,i3=class extends C1{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),a3=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=n3[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:r3)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};i3=n1([r1(0,t3)],i3);var a3,o3=class extends C1{constructor(e){if(A1&&j1()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new q4(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(I0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(I0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(I0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(I0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(b1(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},s3=2,c3=1,l3=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(s3,Math.floor(u/e.css.cell.width)),rows:Math.max(c3,Math.floor(l/e.css.cell.height))}}},u3=`3.7.8`,d3=u3,f3=typeof Buffer==`function`,p3=typeof TextDecoder==`function`?new TextDecoder:void 0,m3=typeof TextEncoder==`function`?new TextEncoder:void 0,h3=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),g3=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(h3),_3=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,v3=String.fromCharCode.bind(String),y3=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),b3=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),x3=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),S3=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=h3[t>>18&63]+h3[t>>12&63]+h3[t>>6&63]+h3[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},C3=typeof btoa==`function`?e=>btoa(e):f3?e=>Buffer.from(e,`binary`).toString(`base64`):S3,w3=f3?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(v3.apply(null,e.subarray(n,n+4096)));return C3(t.join(``))},T3=(e,t=!1)=>t?b3(w3(e)):w3(e),E3=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?v3(192|t>>>6)+v3(128|t&63):v3(224|t>>>12&15)+v3(128|t>>>6&63)+v3(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return v3(240|t>>>18&7)+v3(128|t>>>12&63)+v3(128|t>>>6&63)+v3(128|t&63)},D3=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,O3=e=>e.replace(D3,E3),k3=f3?e=>Buffer.from(e,`utf8`).toString(`base64`):m3?e=>w3(m3.encode(e)):e=>C3(O3(e)),A3=(e,t=!1)=>t?b3(k3(e)):k3(e),j3=e=>A3(e,!0),M3=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,N3=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return v3((t>>>10)+55296)+v3((t&1023)+56320);case 3:return v3((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return v3((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},P3=e=>e.replace(M3,N3),F3=e=>{if(e=e.replace(/\s+/g,``),!_3.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=g3[e.charAt(a++)]<<18|g3[e.charAt(a++)]<<12|(n=g3[e.charAt(a++)])<<6|(r=g3[e.charAt(a++)]),n===64?i.push(v3(t>>16&255)):r===64?i.push(v3(t>>16&255,t>>8&255)):i.push(v3(t>>16&255,t>>8&255,t&255));return i.join(``)},I3=typeof atob==`function`?e=>atob(x3(e)):f3?e=>Buffer.from(e,`base64`).toString(`binary`):F3,L3=f3?e=>y3(Buffer.from(e,`base64`)):e=>y3(I3(e).split(``).map(e=>e.charCodeAt(0))),R3=e=>L3(B3(e)),z3=f3?e=>Buffer.from(e,`base64`).toString(`utf8`):p3?e=>p3.decode(L3(e)):e=>P3(I3(e)),B3=e=>x3(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),V3=e=>z3(B3(e)),H3=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},U3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),W3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,U3(t));e(`fromBase64`,function(){return V3(this)}),e(`toBase64`,function(e){return A3(this,e)}),e(`toBase64URI`,function(){return A3(this,!0)}),e(`toBase64URL`,function(){return A3(this,!0)}),e(`toUint8Array`,function(){return R3(this)})},G3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,U3(t));e(`toBase64`,function(e){return T3(this,e)}),e(`toBase64URI`,function(){return T3(this,!0)}),e(`toBase64URL`,function(){return T3(this,!0)})},K3={version:u3,VERSION:d3,atob:I3,atobPolyfill:F3,btoa:C3,btoaPolyfill:S3,fromBase64:V3,toBase64:A3,encode:A3,encodeURI:j3,encodeURL:j3,utob:O3,btou:P3,decode:V3,isValid:H3,fromUint8Array:T3,toUint8Array:R3,extendString:W3,extendUint8Array:G3,extendBuiltins:()=>{W3(),G3()}},q3=class{constructor(e=new Y3,t=new J3){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},J3=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},Y3=class{encodeText(e){return K3.encode(e)}decodeText(e){let t=K3.decode(e);return!K3.isValid(e)||K3.encode(t)!==e?``:t}},X3=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=Q3.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function Z3(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var Q3=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!Z3(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},$3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function e6(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var t6=class{constructor(e=e6,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||$3;this._linkProvider=this._terminal.registerLinkProvider(new X3(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function n6(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function r6(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function i6(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function a6(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var o6=450,s6=12,c6=` ·│┃()[]{}<>'"\`,;│|`;function l6(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||c6.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},o6)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>s6&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&dg(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var u6=5;function d6(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<u6)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await dg(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}var $={iconBtn:`_dz _cb`,termWrap:`_dA`,term:`_dB`,xterm:`_dC`,termDead:`_dD`,termCopied:`_dE`,termCopiedFade:`_dF`,termUploading:`_dG`,trapBackdrop:`_dH`,pasteTrap:`_dI`,kbSlot:`_dJ`,keyBar:`_dK`,kspacer:`_dL`,sessBtn:`_dM`,sessDot:`_dN`,sessPop:`_dO`,sessRow:`_dP`,current:`_dQ`,sessOpen:`_dR`,sessTitle:`_dS`,sessRename:`_dT`,sessX:`_dU`,armed:`_dV`,sessEdit:`_dW`,sessNew:`_dX`,lone:`_dY`,kbarWs:`_dZ`,kbarWsName:`_d0`,kbtn:`_d1 _cb`,kbtnEsc:`_d2`,dpadGrid:`_d3`,repeat:`_d4`,on:`_d5`,bigGlyph:`_d6`,enter:`_d7`},f6=ei,p6=(e=>`/${e}&`)(ti);function m6(e){ii(e.a,`M8 6L20 6 M4 6.01L4.01 5.99889 M4 12.01L4.01 11.9989 M4 18.01L4.01 17.9989 M8 12L20 12 M8 18L20 18`)}var h6=(e,t)=>ni(e.a,t),g6=(e,t)=>ri(e.a,t),_6=ei,v6=(e=>`/${e}&`)(ti);function y6(e){ii(e.a,`M15 4L8 20`)}var b6=(e,t)=>ni(e.a,t),x6=(e,t)=>ri(e.a,t),S6=ei,C6=(e=>`/${e}&`)(ti);function w6(e){ii(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var T6=(e,t)=>ni(e.a,t),E6=(e,t)=>ri(e.a,t),D6=ei,O6=(e=>`/${e}&`)(ti);function k6(e){ii(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var A6=(e,t)=>ni(e.a,t),j6=(e,t)=>ri(e.a,t),M6=ei,N6=(e=>`/${e}&`)(ti);function P6(e){ii(e.a,`M21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6Z M3 16L10 13L21 18 M16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8C18 9.10457 17.1046 10 16 10Z`)}var F6=(e,t)=>ni(e.a,t),I6=(e,t)=>ri(e.a,t),L6=`<div><div></div><!><!><!><!></div><!><!>`,R6=` D b%b%b%b%l%c`,z6=400,B6=55,V6=3e4,H6=150,U6=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`attach`}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`key`,label:`⇥`,seq:` `},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],W6=I(`u19`,e=>k(e.a,`click`,function(){e._._._.k.click()})),G6=e=>{P6(e.b),F6(e.b,16),I6(e.b),W6(e)},K6=I(`u13`,e=>k(e.a,`click`,function(){W8(e._._._,e._._.d),G8(e._._._,e._._.i||e._._.h)})),q6=e=>{z(e.a,[$.sessX,$.sessEdit]),ou(e.b),su(e.b,12),cu(e.b),K6(e)},J6=F(6,e=>Ft(e,`c`,e._._.c,p5(e)),e=>e._._),Y6=I(`u12`,e=>{It(e,`c`),k(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._.e(e._.d)):t.key===`Escape`&&(t.preventDefault(),W8(e._._,null))}),k(e.c,`blur`,function(){e._._.e(e._.d)}),kt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),X6=e=>{J6(e),Z6._(e),Q6._(e),e.b,Ai(e.b,14),Pi(e.b),z(e.c,$.sessRename),Y6(e)},Z6=N(0,0,e=>z(e.a,[V.dot,V[Qr(e._.g)]])),Q6=N(0,0,e=>Ni(e.b,e._.h)),$6=e=>z(e.a,$.termCopied),e8=e=>z(e.a,$.termUploading),t8=I(`u18`,e=>{k(e.a,`pointerdown`,function(e){e.preventDefault()}),k(e.a,`click`,function(){e._._._._.al()})}),n8=e=>{k6(e.b),A6(e.b,16),j6(e.b),t8(e)},r8=N(0,2,e=>{z(e.a,[$.repeat,{[$.enter]:e._.e===`↵`,[$.bigGlyph]:e._.e===`↵`||e._.e===`⇥`}]),B(e.b,e._.e)}),i8=I(`u20`,e=>{k(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.af(e._.f)}),k(e.a,`pointerup`,function(){e._._._._.ag()}),k(e.a,`pointercancel`,function(){e._._._._.ag()}),k(e.a,`pointerleave`,function(){e._._._._.ag()}),k(e.a,`contextmenu`,function(e){e.preventDefault()})}),a8=D(0,(e=>`<button title=Paste>${e}</button>`)(D6),(e=>` D/${e}&l`)(O6),n8,(e=>`<button title="Attach image">${e}</button>`)(M6),(e=>` D/${e}&l`)(N6),G6,`<button> </button>`,` D `,e=>{r8._(e),i8(e)}),o8=(e,t)=>a8(e,t===`paste`?0:t===`attach`?1:2),s8=(e,t)=>{o8(e,t[0]?.kind),c8(e,t[0]?.label),l8(e,t[0]?.seq)},c8=j(4),l8=j(5),u8=O(0,`<!><!><!>`,`b%`,0,s8),d8=(e,t)=>u8(e,[t]),f8=(e,t)=>d8(e,t[0]),p8=N(5,0,I(`u10`,e=>{e._.a5&&setTimeout(()=>e.d?.focus(),50)})),m8=I(`u11`,e=>{k(e.a,`click`,function(){l5(e._,!1)}),k(e.b,`click`,function(e){e.stopPropagation()}),k(e.d,`paste`,function(t){t.preventDefault(),e._.ak(t.clipboardData)}),k(e.e,`click`,function(){l5(e._,!1)})}),h8=e=>{p8._(e),z(e.a,$.trapBackdrop),z(e.b,$.pasteTrap),z(e.c,V.dim),z(e.e,V.btn),m8(e)},g8=I(`u9`,e=>k(e.b,`click`,function(){i5(e._,!1)})),_8=e=>{z(e.a,$.termDead),z(e.b,[V.btn,V.primary]),g8(e)},v8=F(57,e=>B(e.c,e._._.y),e=>e._._),y8=e=>{v8(e),z(e.a,$.kbarWs),z(e.b,$.kbarWsName)},b8=I(`u16`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.p?.(e.d)})),x8=e=>{z(e.a,$.iconBtn),e.b,Ai(e.b,15),Pi(e.b),b8(e)},S8=j(3,e=>{R(e.a,`title`,`New ${e.d} session`),Ni(e.b,e.d)}),C8=(e,t)=>S8(e,t[0]),w8=M(1,e=>{z(e.a,[$.sessX,{[$.armed]:e._._._._.g===e._._.d}]),R(e.a,`title`,e._._._._.g===e._._.d?`Really kill this session?`:`Kill session`)}),T8=F(8,w8,e=>e._._._._),E8=I(`u14`,e=>k(e.a,`click`,function(t,n){e._._._._.g===e._._.d?(J8(e._._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._._.w?.(e._._.d)):J8(e._._._._,e._._.d)})),D8=e=>{T8(e),O8(e),E8(e)},O8=F(9,w8,e=>e._._),k8=D(5,(e=>`<button title="Rename session">${e}</button>`)(iu),(e=>` D/${e}&l`)(au),q6),A8=F(53,e=>k8(e,+!e._._._._._.t),e=>e._._._._._),j8=I(`u15`,e=>k(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._.d!==e._._._._._.u&&e._._._._._.v?.(e._.d)})),M8=e=>{A8(e),P8(e),F8._(e),L8._(e),R8._(e),z(e.a,$.sessOpen),e.c,Ai(e.c,14),Pi(e.c),z(e.d,$.sessTitle),j8(e)},N8=D(6,`<button>×</button>`,` `,D8),P8=F(55,e=>N8(e,+!e._._._._._.w),e=>e._._._._._),F8=N(0,1,e=>z(e.b,[V.dot,V[Qr(e._.g)]])),I8=M(7,e=>B(e.e,e._.i||e._.h)),L8=N(0,1,e=>{Ni(e.c,e._.h),I8(e)}),R8=N(0,1,I8),z8=M(4,e=>z(e.a,[$.sessRow,{[$.current]:e.d===e._._._._.u}])),B8=F(54,z8,e=>e._._._._),Kre=e=>{B8(e),V8._(e)},qre=D(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(bi),(e=>` b/${e}& b`)(`b%c`),X6,(e=>`<button><span></span>${e}<span> </span></button><!><!><!>`)(bi),(e=>` D b/${e}& D m%b%c`)(`b%c`),M8),V8=Ze(0,1,3,e=>qre(e,e._.b===e.d?0:1)),Jre=P(O8),Yre=j(3,e=>{z8(e),Jre(e)}),Xre=(e,t)=>{Yre(e,t[0]?.id),Zre(e,t[0]?.state),Qre(e,t[0]?.agent),$re(e,t[0]?.title)},Zre=j(6,e=>{F8(e),Z6(e)}),Qre=j(7,e=>{L8(e),Q6(e)}),$re=j(8,R8),eie=O(0,`<div></div>`,` `,Kre,Xre),H8=F(52,e=>eie(e,[e._._._.s||[],`id`]),e=>e._._._),tie=j(4),U8=M(3,e=>tie(e,m5(e)),2),W8=A(1,e=>{U8(e),V8(e)}),nie=P(J6),G8=A(2,e=>{U8(e),nie(e)}),rie=e=>{H8(e),K8(e),W8(e,null),G8(e,``)},K8=F(53,U8,e=>e._._._),q8=F(50,e=>Ni(e.b,e._._.q||`shell`),e=>e._._),J8=A(6,P(T8)),iie=(e,t)=>{R(e.a,`popovertarget`,t),R(e.d,`id`,t)},aie=I(`u17`,e=>k(e.d,`toggle`,function(t,n){if(J8(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),oie=e=>{q8(e),Y8(e),X8(e),Z8(e),z(e.a,[$.kbtn,$.sessBtn]),e.b,Ai(e.b,16),Pi(e.b),z(e.d,$.sessPop),J8(e,null),iie(e,nt(e)),aie(e)},Y8=F(51,e=>z(e.c,[V.dot,$.sessDot,V[Qr(e._._.r)]]),e=>e._._),sie=D(4,`<!><!><!>`,`b%`,rie),X8=F(52,e=>{z(e.f,[$.sessNew,{[$.lone]:(e._._.s||[]).length<=1}]),sie(e,(e._._.s||[]).length>1?0:1)},e=>e._._),cie=O(5,(e=>`<button>${e}</button>`)(bi),(e=>` D/${e}&l`)(`b%c`),x8,C8),Z8=F(56,e=>cie(e,[[...e._._.x||[],`shell`],e=>e]),e=>e._._),Q8=N(6,0,e=>{z(e.c,[$.kbtn,{[$.on]:e._.k===`nav`}]),R(e.c,`aria-pressed`,e._.k===`nav`?`true`:`false`),z(e.e,[$.kbtn,{[$.on]:e._.k===`manage`}]),R(e.e,`aria-pressed`,e._.k===`manage`?`true`:`false`),z(e.g,[$.kbtn,{[$.on]:e._.k===`diff`}]),R(e.g,`title`,e._.k===`diff`?`Back to terminal`:`Review changes`),R(e.g,`aria-pressed`,e._.k===`diff`?`true`:`false`)}),lie=(e,t)=>{R(e.l,`popovertarget`,t),R(e.q,`id`,t)},uie=O(16,`<!><!><!>`,`b%`,0,f8),die=I(`u22`,e=>{k(e.c,`click`,function(){e._.l?.()}),k(e.e,`click`,function(){e._.m?.()}),k(e.g,`click`,function(){e._.k===`diff`?e._.n?.():e._.o?.()}),k(e.k,`change`,function(t,n){for(let t of n.files||[])e._.ah(t);n.value=``}),k(e.l,`pointerdown`,function(e){e.preventDefault()}),k(e.n,`pointerdown`,function(e){e.preventDefault()}),k(e.p,`pointerdown`,function(e){e.preventDefault()}),k(e.q,`pointerdown`,function(e){e.preventDefault()}),k(e.q,`toggle`,function(t,n){if(t.newState===`open`){let t=e.l.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.bottom=`auto`}})}),fie=e=>{Q8._(e),$8._(e),e5._(e),t5._(e),hie._(e),z(e.a,$.kbSlot),z(e.b,$.keyBar),m6(e.d),h6(e.d,16),g6(e.d),fi(e.f),pi(e.f,16),mi(e.f),si(e.h),ci(e.h,16),li(e.h),z(e.i,$.kspacer),z(e.l,$.kbtn),y6(e.m),b6(e.m,16),x6(e.m),w6(e.o),T6(e.o,16),E6(e.o),z(e.p,[$.kbtn,$.kbtnEsc]),z(e.q,$.dpadGrid),lie(e,nt(e)),uie(e,[U6]),die(e)},pie=D(8,(e=>`<button title=Sessions>${e}<span></span></button><div popover=auto><!><div></div></div>`)(bi),(e=>` D/${e}& l D%b l`)(`b%c`),oie),$8=N(6,0,e=>pie(e,+!e._.p)),mie=D(9,`<span aria-hidden=true><span> </span></span>`,` D D `,y8),e5=N(6,0,e=>mie(e,+!e._.y)),t5=N(6,0,e=>{z(e.n,[$.kbtn,{[$.on]:e._.a1}]),R(e.n,`title`,e._.a1?`Hide keyboard`:`Show keyboard`)}),hie=N(6,0,I(`u21`,e=>{k(e.n,`click`,function(){a5(e._,!e._.a1),e._.a7?.setKeyboard(e._.a1)}),k(e.p,`click`,function(){e._.a7?.send(`\x1B`)})})),n5=at(`u8`,1),gie=it(42),_ie=D(4,`<div><button>Reconnect</button></div>`,` D `,_8),r5=M(45,I(`u23`,e=>kt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new $$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:5e3,allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,linkHandler:{activate(e,t){ur(t)}}}),i=new l3;r.loadAddon(i),r.open(e.b);let a=sr();try{let e=new o3;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new q3(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>dg(t).then(()=>{})}))}catch{}r.loadAddon(new t6((e,t)=>ur(t))),i.fit();let o=a?i6(r):null,s=o?o.write:e=>r.write(e),c=n6({sessionId:e.u,term:r,write:s,onDead:()=>{i5(e,!0)},isVisible:()=>!!e.z},n);r.onData(e=>c.send(e)),r.attachCustomKeyEventHandler(t=>t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&c.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&dg(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.ab())}),!1):!(a&&t.type===`keydown`&&t.key===`Backspace`));let l=()=>{if(!e.b.clientWidth)return;let t=i.proposeDimensions();!t||t.cols===r.cols&&t.rows===r.rows||(i.fit(),c.resize(r.cols,r.rows))},u=new ResizeObserver(l);u.observe(e.b),n.addEventListener(`abort`,()=>u.disconnect());let d=()=>requestAnimationFrame(l);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||d()},{signal:n}),window.addEventListener(`pageshow`,d,{signal:n}),window.addEventListener(`focus`,d,{signal:n}),window.visualViewport?.addEventListener(`resize`,d,{signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.ah(t)}},{capture:!0,signal:n}),e.a7={send(e){c.send(e)},setKeyboard(e){let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a1&&i-t.height<H6&&(a5(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=l6(r,n5(e),{onStart(){o?.setFrozen(!0)},onEnd(){o?.setFrozen(!1)},onCopy(){e.ab()}},n);r6(r,n5(e),n,i.selecting),a6(r,e=>c.send(e),n)}else d6(r,n5(e),()=>e.ab(),n);e.z&&!a&&r.focus();let f={term:r,socket:c,abort:t,suspend:void 0};return e.z||(f.suspend=setTimeout(()=>c.disconnect(),V6)),f},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.z?(!e.a0&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a0&&!e.a2&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),V6)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),7),i5=A(26,e=>{_ie(e,+!e.a0),r5(e)}),a5=A(27,e=>{r5(e),t5(e)}),vie=D(6,((e,t,n,r,i)=>`<div><div><button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button>${n}</button><div></div><!><input type=file accept=image/* hidden><button title="More keys">${r}</button><button>${i}</button><button title=Escape>esc</button><div popover=auto></div></div></div>`)(f6,ui,ai,_6,S6),((e,t,n,r,i)=>` D D D/${e}&l D/${t}&l D/${n}&l b%b b D/${r}&l D/${i}&l b m`)(p6,di,oi,v6,C6),fie),o5=A(28,e=>{vie(e,+!e.a2),r5(e)}),yie=D(2,`<div>uploading…</div>`,` `,e8),s5=A(29,e=>yie(e,+!e.a3)),bie=D(3,`<div>Copied</div>`,` `,$6),c5=A(30,e=>bie(e,+!e.a4)),xie=D(5,`<div><div><p>Long-press below and choose Paste</p><input placeholder="Paste here…"><button>Cancel</button></div></div>`,` D D b b `,h8),l5=A(31,e=>{xie(e,+!e.a5),p8(e)}),Sie=(e,t)=>jie(e,t.current),Cie=(e,t)=>Nie(e,t.timer),wie=(e,t)=>Fie(e,t.current),Tie=I(`u24`,e=>{o5(e,sr()),k(e.a,`dragover`,function(e){e.preventDefault()}),k(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.ah(n)})});function Eie(e){z(e.a,$.termWrap),z(e.b,$.term),i5(e,!1),a5(e,!1),o5(e,!1),s5(e,!1),c5(e,!1),l5(e,!1),Sie(e,{current:null}),Cie(e,{timer:0}),wie(e,{current:null}),Tie(e)}var Die=j(41),u5=M(40,e=>Die(e,h5(e))),Oie=j(46),kie=j(47),d5=M(44,e=>{Oie(e,g5(e)),kie(e,_5(e))}),Aie=j(43,e=>{d5(e),r5(e)}),f5=M(34,e=>Aie(e,v5(e))),jie=j(33,e=>{u5(e),f5(e),d5(e),r5(e)}),Mie=j(37,r5),Nie=j(36,e=>Mie(e,y5(e))),Pie=j(42),Fie=j(39,e=>{Pie(e,b5(e)),u5(e)}),Iie=j(9,f5),Lie=j(10,e=>{R(e.a,`hidden`,e.k!=null&&e.k!==`term`),Q8(e)}),Rie=P(B8),zie=j(20,e=>{r5(e),Rie(e)}),Bie=j(25,r5),Vie=j(11),Hie=j(12),Uie=j(13),Wie=j(14),Gie=j(15,$8),Kie=j(16,P(q8)),qie=j(17,P(Y8)),Jie=j(18,P(X8,H8)),Yie=j(19,P(K8,A8)),Xie=j(21),Zie=j(22,P(P8)),Qie=j(23,P(Z8)),$ie=P(v8),eae=j(24,e=>{e5(e),$ie(e)});function p5(e){return t=>{G8(e._._,t)}}function m5(e){return t=>{if(e.b!==t)return;let n=e.c.trim();W8(e,null),n&&e._._._.t?.(t,n)}}function h5(e){return t=>{gie(e)(),e.a7?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.a7?.send(t),B6)},z6),e.ad=n}}function g5(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.ah(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.a7?.send(n)}l5(e,!1)}}function _5(e){return async()=>{if(!navigator.clipboard?.read){l5(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.ah(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.a7?.send(n)}}}catch{l5(e,!0)}}}function v5(e){return async t=>{if(t){s5(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.j}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.a7?.send(`${n.path} `)}finally{s5(e,!1)}}}}function y5(e){return()=>{clearTimeout(e.aa),c5(e,!0),e.aa=setTimeout(()=>{c5(e,!1)},1200)}}function b5(e){return()=>{let t=e.ad;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.ad=null)}}L(`u0`,p5),L(`u7`,m5),L(`u2`,h5),L(`u5`,g5),L(`u6`,_5),L(`u4`,v5),L(`u1`,y5),L(`u3`,b5);var tae=(e=>`<div><div>${e}</div><div><!><!><!><!><div></div></div></div>`)(Aee),nae=(e=>` D D/${e}&l D%b%b%b%b m`)(jee),rae=e=>z(e.a,Gl.padInline),x5=F(74,e=>B(e.a,e._._.a6),e=>e._._),iae=gt(`x35`,` `,` `,x5),aae=e=>{Rr(e.a),Hr(e.a,iae(e)),Kr(e.a,b7(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},oae=fe(3,0,2),S5=N(7,0,e=>oae(e,e._.z===`usage`)),sae=e=>{S5._(e),cK(e.b),lK(e.b,x7(e))},C5=M(4,e=>B(e.d,e._._.a7?`Starting…`:`Start ${e._._.o||`claude`}`)),w5=F(68,C5,e=>e._._),cae=I(`x36`,e=>k(e.c,`click`,function(){e._._.as(e._._.o||`claude`,!0)})),lae=e=>{w5(e),T5(e),z(e.a,Gl.emptySess),z(e.b,V.dim),z(e.c,[V.btn,V.primary]),cae(e)},T5=F(75,e=>{R(e.c,`disabled`,e._._.a7),C5(e)},e=>e._._),E5=M(8,e=>Bie(e.b,e._._.n&&e._._.z===`term`&&e.g===e._._.ar),3),D5=F(67,E5,e=>e._._),uae=e=>{D5(e),O5(e),k5(e),j5(e),M5(e),N5(e),F5(e),I5(e),L5(e),R5(e),Eie(e.b),Xie(e.b,E7(e)),Wie(e.b,T7(e)),Uie(e.b,w7(e)),Vie(e.b,C7(e)),Hie(e.b,S7(e))},O5=F(69,e=>Qie(e.b,e._._.r),e=>e._._),k5=F(71,e=>{Lie(e.b,e._._.z),E5(e)},e=>e._._),A5=M(11,e=>Gie(e.b,D7(e))),j5=F(77,e=>{Iie(e.b,e._._.a9),A5(e)},e=>e._._),M5=F(78,e=>eae(e.b,e._._.ae),e=>e._._),N5=F(79,e=>Jie(e.b,e._._.ao),e=>e._._),dae=fe(3,0,2),P5=M(7,e=>dae(e,e.g===e._._.ar)),F5=F(81,e=>{E5(e),P5(e)},e=>e._._),I5=F(82,e=>Zie(e.b,O7(e)),e=>e._._),L5=F(83,e=>Yie(e.b,k7(e)),e=>e._._),R5=F(84,A5,e=>e._._),fae=j(6,e=>{zie(e.b,e.g),E5(e),P5(e)}),pae=(e,t)=>qie(e.b,t),mae=(e,t)=>Kie(e.b,t),hae=O(0,(e=>`<!><!>${e}<!><!><!>`)(L6),(e=>`b%b/${e}&%b%c`)(R6),uae,(e,t)=>{fae(e,t[0]?.id),pae(e,t[0]?.state),mae(e,t[0]?.agent)}),z5=N(8,0,e=>hae(e,[e._.ao,`id`])),gae=e=>{z5._(e),B5._(e)},_ae=D(1,`<div><p>No sessions in this workspace.</p><button> </button></div>`,` D b D `,lae),B5=N(8,0,e=>_ae(e,+!!e._.aq)),V5=N(6,0,e=>YW(e.b,A7(e))),vae=e=>{V5._(e),H5._(e),U5._(e),mW(e.b),XW(e.b,j7(e))},yae=fe(3,0,2),H5=N(6,0,e=>yae(e,e._.z===`manage`)),U5=N(6,0,e=>JW(e.b,e._.a8)),W5=M(4,e=>gV(e.b,e._.n&&e._.z===`diff`)),G5=N(5,0,W5),bae=e=>{G5._(e),K5._(e),q5._(e),J5._(e),Y5._(e),X5._(e),QB(e.b),CV(e.b,N7(e)),TV(e.b,M7(e))},xae=fe(3,0,2),K5=N(5,0,e=>{xae(e,e._.z===`diff`),W5(e)}),q5=N(5,0,e=>hV(e.b,e._.a4)),J5=N(5,0,e=>_V(e.b,e._.a5)),Y5=N(5,0,e=>mV(e.b,e._.a9)),X5=N(5,0,e=>EV(e.b,e._.ao||[])),Sae=P(L5),Cae=j(65,e=>{ote(e.c,P7(e)),Sae(e)}),wae=D(8,`<!><!><!><!>`,`b%b%`,gae,`<p>Loading sessions…</p>`,` `,rae),Tae=P(F5),Eae=j(53,e=>{gh(e.c,e.ar),Tae(e)}),Z5=M(51,e=>Eae(e,(()=>{if(e.x&&e.ao?.some(t=>t.id===e.x))return e.x;let t=Jn(e.a9);return t&&e.ao?.some(e=>e.id===t)?t:e.ao?.[0]?.id??null})()),2),Dae=P(N5),Oae=j(50,e=>{rte(e.c,e.ao),toe(e,e.ao?.length),wae(e,+!e.ao),Z5(e),X5(e),z5(e),Dae(e)}),Q5=M(38,e=>Oae(e,e.w??e.m?.[e.a9]?.sessions??null),2),$5=M(63,I(`x38`,e=>kt(e,{active:e.n,load:e.b0,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.timer??=setInterval(r.refresh,1e4)):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return Tn().addEventListener(`sessions.changed`,t=>{let n=t.data?.workspaceId;r.started&&(!n||n===e.a9)&&r.refresh()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),An(()=>{if(!this.active)return;let t=Mn(e.a9);t&&e.af(t.pr),In(e.a9)&&e.ah();let n=Pn(e.a9);n&&(s7(e,n),d7(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),4),kae=j(62,$5),e7=M(61,e=>kae(e,I7(e)),2),Aae=j(60,e7),t7=M(58,e=>Aae(e,L7(e)),6),jae=P(R5),Mae=j(66,e=>{$ee(e.c,R7(e)),jae(e)}),n7=M(55,e=>Mae(e,z7(e)),2),Nae=j(54,e=>{t7(e),n7(e)}),r7=M(36,e=>Nae(e,B7(e))),Pae=j(64,P(I5)),i7=M(24,e=>Pae(e,V7(e))),a7=A(22,e=>{Cae(e,F7(e)),Q5(e),r7(e),t7(e),i7(e)}),o7=M(37,I(`x39`,e=>{e.x&&Yn(e.a9,e.x)})),s7=A(23,e=>{Z5(e),t7(e),i7(e),o7(e)}),Fae=j(47),Iae=j(48),c7=M(44,e=>Iae(e,U7(e))),Lae=j(49),l7=M(42,e=>Lae(e,W7(e))),u7=M(26,I(`x41`,e=>{!e.n&&(e.z===`nav`||e.z===`manage`||e.z===`usage`)&&d7(e,`term`)})),Rae=P(k5),d7=A(25,e=>{z(e.a,[Gl.workView,{[Gl.navPage]:e.z===`nav`}]),z(e.b,[Gl.sideWrap,{[Gl.sideHidden]:e.z===`manage`||e.z===`usage`}]),Eh(e.c,e.z),z(e.i,[Gl.termArea,{[Gl.asBar]:e.z!==`term`}]),Fae(e,H7(e)),c7(e),l7(e),u7(e),K5(e),H5(e),Rae(e),S5(e)}),zae=D(5,(e=>`<!><!>${e}<!><!><!>`)(wF),(e=>`b%b/${e}&%b%c`)(TF),bae),f7=A(27,e=>zae(e,+!e.a1)),Bae=D(6,(e=>`<!><!>${e}<!><!><!>`)(eH),(e=>`b%b/${e}&%b%c`)(tH),vae),p7=A(28,e=>Bae(e,+!e.a2)),Vae=D(7,(e=>`<!><!>${e}<!><!><!>`)(vG),(e=>`b%b/${e}&%b%c`)(yG),sae),m7=A(29,e=>Vae(e,+!e.a3)),h7=A(30,q5),g7=M(45,I(`x40`,e=>{if(e.n){let t=Mn(e.a9);t&&e.af(t.pr),In(e.a9)&&e.ah();let n=Pn(e.a9);n&&(s7(e,n),d7(e,`term`))}}),3),Hae=j(41,e=>{tte(e.c,G7(e)),l7(e),g7(e),$5(e)}),_7=A(31,e=>{Hae(e,K7(e)),J5(e)}),Uae=D(4,fr,(e=>`/${e}&`)(pr),aae),Wae=P(x5),v7=A(32,e=>{Uae(e,+!e.a6),Wae(e)}),y7=A(33,P(T5)),Gae=j(43,e=>{c7(e),g7(e),$5(e)}),Kae=j(46),qae=(e,t)=>{ooe(e,t.wanted),soe(e,t.run)};function Jae(e){Fh(e.c),_h(e.c,$7(e)),Dh(e.c,Q7(e)),Ih(e.c,Z7(e)),Uh(e.c,X7(e)),Kh(e.c,Y7(e)),z(e.d,Gl.mainCol),a7(e,null),s7(e,null),d7(e,`term`),f7(e,!1),p7(e,!1),m7(e,!1),h7(e,``),_7(e,0),v7(e,null),y7(e,!1),Gae(e,q7(e)),Kae(e,J7(e)),qae(e,{wanted:!1,run:void 0})}var Yae=j(34,e=>{fh(e.c,e.a8),Zae(e,e.a8?.id),Qae(e,e.a8?.status),$ae(e,e.a8?.name),U5(e)}),Xae=P(j5),Zae=j(35,e=>{Yee(e.c,e9(e)),Q5(e),Z5(e),g7(e),r7(e),t7(e),o7(e),n7(e),$5(e),Y5(e),Xae(e)}),Qae=j(39,t7),$ae=j(40,P(M5)),eoe=Yae,toe=j(52,B5),noe=j(12,e=>{Vh(e.c,e.m),Q5(e)}),roe=P(D5),ioe=I(`x37`,e=>k(e.a,`keydown`,e.n&&(t=>{if(t.key===`Escape`&&(e.z===`nav`||e.z===`manage`||e.z===`usage`)&&!document.querySelector(`dialog[open]`)&&d7(e,`term`),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.an()),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.ao?.length??0)>1){t.preventDefault();let n=e.ao.map(e=>e.id);s7(e,n[(Math.max(0,n.indexOf(e.ar))+(t.key===`]`?1:n.length-1))%n.length]),d7(e,`term`)}}))),aoe=j(13,e=>{Lh(e.c,e.n),u7(e),g7(e),$5(e),G5(e),roe(e),ioe(e)}),ooe=j(57,e=>{t7(e),e7(e)}),soe=j(59,e7),coe=P(w5),loe=j(14,e=>{t7(e),coe(e)}),uoe=j(15,e=>{Jee(e.c,e.p),n7(e)}),doe=(e,t)=>Rh(e.c,t),foe=P(O5),poe=j(17,e=>{Zee(e.c,e.r),foe(e)}),moe=(e,t)=>ite(e.c,t),hoe=(e,t)=>qh(e.c,t),goe=j(19),_oe=j(21,V5);function b7(e){return function(){v7(e._,null)}}function x7(e){return function(){d7(e._,`term`)}}function S7(e){return function(){e._._.am()}}function C7(e){return function(){e._._.al()}}function w7(e){return function(){d7(e._._,`term`)}}function T7(e){return function(){e._._.an()}}function E7(e){return function(t){s7(e._._,t),d7(e._._,`term`)}}function D7(e){return function(t){d7(e._._,`term`),e._._.b4(e._._.a9,t)}}function O7(e){return function(t){e._._.b2(t)}}function k7(e){return function(t,n){e._._.b3(t,n)}}function A7(e){return function(t){e._.v?.(t)}}function j7(e){return function(){d7(e._,`term`)}}function M7(e){return function(){d7(e._,`term`)}}function N7(e){return function(t){s7(e._,t),d7(e._,`term`)}}function P7(e){return function(t,n){e.b3(t.id,n)}}function F7(e){return async(t,n)=>{n=n.trim(),n&&(a7(e,(e.w||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function I7(e){return t=>(t&&(e.av=!0),(e.ax??=Ln(e.ay))())}function L7(e){return async()=>{let t=e.av;e.av=!1;try{let n=await sn(`/api/workspaces/${e.a9}/sessions`);if(!n.length&&t&&e.ad===`active`){let t=await e.as(e.o||`claude`,!1);n=t?[t]:[]}a7(e,n);let r=Jn(e.a9);r&&n.some(e=>e.id===r)&&s7(e,r),e.w.some(t=>t.id===e.x)||s7(e,e.w?.[0]?.id||null)}catch(t){if(a7(e,e.w||[]),cn(t))return;v7(e,String(t.message||t))}}}function R7(e){return function(t,n){e.b4(t,n)}}function z7(e){return async(t,n)=>{if(t===e.a9){let r=await e.as(n,!0);r&&Yn(t,r.id);return}try{Yn(t,(await sn(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.p?.(t)}catch(t){v7(e,String(t.message||t))}}}function B7(e){return async(t,n)=>{y7(e,!0);try{let r=await sn(`/api/workspaces/${e.a9}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});return n&&(a7(e,(e.w||[]).concat(r)),s7(e,r.id)),r}catch(t){return v7(e,String(t.message||t)),null}finally{y7(e,!1)}}}function V7(e){return async t=>{try{await sn(`/api/sessions/${t}`,{method:`DELETE`}),a7(e,(e.w||[]).filter(e=>e.id!==t)),e.x===t&&s7(e,e.w?.[0]?.id||null)}catch(t){v7(e,`Kill session failed: ${String(t.message||t)}`)}}}function H7(e){return()=>{d7(e,e.z===`nav`?`term`:`nav`)}}function U7(e){return()=>{e.z===`manage`?d7(e,`term`):e.ah()}}function W7(e){return()=>{e.z===`diff`?d7(e,`term`):e.af()}}function G7(e){return function(t){e.af(t)}}function K7(e){return t=>{h7(e,t||``),t&&_7(e,e.a5+1),f7(e,!0),d7(e,`diff`)}}function q7(e){return()=>{p7(e,!0),d7(e,`manage`)}}function J7(e){return()=>{m7(e,!0),d7(e,`usage`)}}function Y7(e){return function(t){e.b2(t)}}function X7(e){return function(){e.ak()}}function Z7(e){return function(t){v7(e,t)}}function Q7(e){return t=>{d7(e,t)}}function $7(e){return function(t){s7(e,t)}}function e9(e){return function(t){!t||t===e.a9?e.ah():e.t?.(t)}}L(`x21`,b7),L(`x26`,x7),L(`x34`,S7),L(`x33`,C7),L(`x32`,w7),L(`x31`,T7),L(`x28`,E7),L(`x27`,D7),L(`x29`,O7),L(`x30`,k7),L(`x24`,A7),L(`x25`,j7),L(`x23`,M7),L(`x22`,N7),L(`x19`,P7),L(`x10`,F7),L(`x8`,I7),L(`x7`,L7),L(`x17`,R7),L(`x11`,z7),L(`x6`,B7),L(`x9`,V7),L(`x3`,H7),L(`x4`,U7),L(`x5`,W7),L(`x20`,G7),L(`x0`,K7),L(`x1`,q7),L(`x2`,J7),L(`x18`,Y7),L(`x16`,X7),L(`x14`,Z7),L(`x13`,Q7),L(`x12`,$7),L(`x15`,e9);var t9=F(43,e=>B(e.a,e._._.y),e=>e._._),voe=gt(`n18`,` `,` `,t9),yoe=e=>{Rr(e.a),Hr(e.a,voe(e)),Kr(e.a,L9(e)),Gr(e.a),Fr(e.a),Ar(e.a),Pr(e.a),Br(e.a),Lr(e.a,{})},n9=F(37,e=>{doe(e.b,e._._._.n),_oe(e.b,R9(e))},e=>e._._._),boe=e=>{n9(e),r9(e),i9(e),o9(e),s9(e),c9._(e),l9._(e),Jae(e.b),moe(e.b,B9(e)),hoe(e.b,z9(e))},r9=F(38,e=>noe(e.b,e._._._.o),e=>e._._._),i9=F(39,e=>{loe(e.b,e._._._.p?e._._._.p?.preferredAgent:`claude`),poe(e.b,e._._._.p?e._._._.p?.agents:[`claude`])},e=>e._._._),xoe=fe(3,0,2),a9=M(4,e=>{aoe(e.b,e._.f===e._._._.r),xoe(e,e._.f===e._._._.r)}),o9=F(40,a9,e=>e._._._),s9=F(44,e=>uoe(e.b,V9(e)),e=>e._._._),c9=N(0,0,e=>eoe(e.b,e._.e)),l9=N(0,0,e=>{goe(e.b,H9(e)),a9(e)}),Soe=D(0,(e=>`<!><!>${e}<!><!><!>`)(tae),(e=>`b%b/${e}&%b%c`)(nae),boe),Coe=j(4,e=>{Toe(e,e.e?.id),Soe(e,+!e.e),c9(e)}),u9=M(3,e=>Coe(e,e._._.n.find(t=>t.id===e.c))),d9=F(37,u9,e=>e._._),woe=d9,Toe=j(5,l9),Eoe=j(2,u9),Doe=O(0,`<!><!><!>`,`b%`,woe,(e,t)=>Eoe(e,t[0])),f9=N(3,1,e=>Doe(e,[e._.t,e=>e])),Ooe=f9,p9=M(1,e=>Nl(e.a,U9(e))),m9=N(3,0,p9),koe=e=>{m9._(e),h9._(e),El(e.a),Fl(e.a,W9(e))},h9=N(3,0,p9),g9=N(2,0,e=>fee(e.a,e._.n)),Aoe=e=>{g9._(e),_9._(e),v9._(e),y9._(e),x9._(e),S9._(e),C9._(e),Vo(e.a),Fo(e.a,q9(e)),xee(e.a,K9(e)),ho(e.a,G9(e)),Do(e.a),Oo(e.a)},_9=N(2,0,e=>kee(e.a,e._.o)),v9=N(2,0,e=>Po(e.a,e._.p)),y9=N(2,0,e=>hee(e.a,e._.r)),b9=M(1,e=>Eee(e.a,!e._.x&&e._.a9)),x9=N(2,0,e=>{mo(e.a,e._.x),b9(e)}),S9=N(2,0,e=>{See(e.a,Z9(e)),gee(e.a,X9(e)),vee(e.a,Y9(e)),_ee(e.a,J9(e))}),C9=N(2,0,b9),w9=M(32,I(`n20`,e=>kt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0,timer:void 0};Vn(e.l),ir(n);let i=(t,n)=>{n&&(Nn(t,n),Yn(t,n)),e.a5(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),lr()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),ur(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a4()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a4(!0))},{signal:n}),o(),Tn().addEventListener(`workspaces.changed`,()=>{e.z(),o()},{signal:n}),Tn().addEventListener(`sessions.changed`,()=>{clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),Tn().addEventListener(`status.changed`,t=>{t.data&&(A9(e,t.data),r.statusStale=!1)},{signal:n}),r.timer=setInterval(o,6e4);let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce),clearInterval(this.timer)}})),3),joe=P(s9),Moe=j(31,e=>{w9(e),S9(e),h9(e),joe(e)}),T9=M(20,e=>Moe(e,Q9(e))),Noe=D(2,(e=>`<!>${e}`)(Fi),(e=>`b/${e}&`)(Ii),Aoe),E9=M(36,e=>Noe(e,e.x||e.a9?0:1)),Poe=j(35,e=>{E9(e),C9(e)}),D9=M(34,e=>Poe(e,!e.w&&!e.a7)),Foe=j(33,D9),O9=M(18,e=>Foe(e,e.n.find(t=>t.id===e.r))),Ioe=P(d9,n9),k9=A(13,e=>{T9(e),O9(e),g9(e),m9(e),Ioe(e)}),Loe=P(r9),A9=A(14,e=>{_9(e),Loe(e)}),Roe=P(i9),zoe=A(15,e=>{v9(e),Roe(e)}),Boe=j(25,w9),j9=M(21,e=>Boe(e,$9(e))),M9=A(19,e=>{j9(e),T9(e),f9(e)}),Voe=P(o9),N9=A(17,e=>{M9(e,e.r?[e.r]:[]),j9(e),O9(e),y9(e),Voe(e)}),Hoe=D(3,Nc,(e=>`/${e}&`)(Pc),koe,`<!><!><!>`,`b%`,Ooe),P9=A(22,e=>{Hoe(e,+!e.w),D9(e)}),F9=A(23,e=>{E9(e),x9(e)}),Uoe=D(1,fr,(e=>`/${e}&`)(pr),yoe),Woe=P(t9),I9=A(24,e=>{Uoe(e,+!e.y),Woe(e)});I(`n19`,e=>k(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),F9(e,!e.x)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.n.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a5(n.id))}}));function L9(e){return function(){I9(e._,null)}}function R9(e){return function(t){k9(e._._._,e._._._.n.map(e=>e.id===t.id?t:e))}}function z9(e){return function(){P9(e._._._,!0)}}function B9(e){return function(t,n){Nn(t,n),Yn(t,n),e._._._.a5(t)}}function V9(e){return function(t){e._._._.a5(t)}}function H9(e){return function(t){let n=t||e._.f;Fn(n),e._._._.a5(n)}}function U9(e){return function(t){e._.n.some(e=>e.id===t.id)||k9(e._,[t,...e._.n]),P9(e._,!1),e._.a5(t.id)}}function W9(e){return function(){P9(e._,!1)}}function G9(e){return t=>{F9(e._,t)}}function K9(e){return function(){P9(e._,!0),F9(e._,!1)}}function q9(e){return function(t){zoe(e._,t)}}function J9(e){return function(t){P9(e._,!1),F9(e._,!1),Fn(t.id),e._.a5(t.id)}}function Y9(e){return function(t,n){F9(e._,!1),sn(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{Nn(t.id,n.id),e._.a5(t.id)}).catch(t=>{I9(e._,`New session failed: ${String(t.message||t)}`)})}}function X9(e){return function(t){jn(t.id),e._.a5(t.id)}}function Z9(e){return function(t){e._.a5(t.id)}}function Q9(e){return async t=>{e.n.find(e=>e.id===t)?.status===`archived`&&(await sn(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),k9(e,e.n.map(e=>e.id===t?{...e,status:`active`}:e))),N9(e,t),P9(e,!1),F9(e,!1),e.t.includes(t)||M9(e,e.t.concat(t)),Gn(t)}}function $9(e){return async()=>{try{let t=await sn(`/api/workspaces`);k9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));M9(e,e.t.filter(e=>n.has(e))),e.r&&!n.has(e.r)&&(N9(e,e.t[e.t?.length-1]||null),Gn(e.r))}catch(t){if(cn(t))return;I9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function Goe(e){return(t=!1)=>(e.a1||=t,(e.a2??=Ln(async()=>{let t=e.a1;e.a1=!1;try{A9(e,await sn(`/api/status${t?`?fresh`:``}`))}catch(e){if(!cn(e))throw e}}))())}L(`n3`,L9),L(`n16`,R9),L(`n17`,z9),L(`n14`,B9),L(`n13`,V9),L(`n15`,H9),L(`n12`,U9),L(`n11`,W9),L(`n10`,G9),L(`n9`,K9),L(`n4`,q9),L(`n8`,J9),L(`n7`,Y9),L(`n6`,X9),L(`n5`,Z9),L(`n2`,Q9),L(`n0`,$9),L(`n1`,Goe);var Koe=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};De(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Koe(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){Xt(t.b,e)}});var qoe=e=>z(e.a,on.boot),Joe=(e,t)=>B(e.b,t instanceof Error?t.message:String(t));gt(`b1`,`<div><p> </p></div>`,` E `,qoe,(e,t)=>Joe(e,t[0])),gt(`b0`,`<div><span></span>Loading workspaces…</div>`,` D `,e=>{z(e.a,on.boot),z(e.b,V.spin)}),st();export{t};
1615
+ //# sourceMappingURL=index-BkF_8voS.js.map